aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/esieequest/game/Game.java98
-rw-r--r--src/esieequest/game/characters/Character.java2
-rw-r--r--src/esieequest/game/items/Disk.java3
-rw-r--r--src/esieequest/game/items/PortableConsole.java3
-rw-r--r--src/esieequest/game/map/Direction.java20
5 files changed, 62 insertions, 64 deletions
diff --git a/src/esieequest/game/Game.java b/src/esieequest/game/Game.java
index 92bc99f..9851607 100644
--- a/src/esieequest/game/Game.java
+++ b/src/esieequest/game/Game.java
@@ -29,7 +29,7 @@ public class Game implements SerialisableObject {
29 public static final int DEFAULT_INVENTORY_LIMIT = 10; 29 public static final int DEFAULT_INVENTORY_LIMIT = 10;
30 public static final int DEFAULT_STEPS_LIMIT = 0; 30 public static final int DEFAULT_STEPS_LIMIT = 0;
31 public static final int CHALLENGE_STEPS_LIMIT = 50; 31 public static final int CHALLENGE_STEPS_LIMIT = 50;
32 public static final Direction DEFAULT_DIRECTION = Direction.NORTH; 32 public static final Direction DEFAULT_DIRECTION = Direction.WEST;
33 public static final Room DEFAULT_ROOM = Room.AMPHITHEATER_SEAT; 33 public static final Room DEFAULT_ROOM = Room.AMPHITHEATER_SEAT;
34 public static final Quest DEFAULT_QUEST = Quest.WHAT_HAPPENED; 34 public static final Quest DEFAULT_QUEST = Quest.WHAT_HAPPENED;
35 35
@@ -83,52 +83,52 @@ public class Game implements SerialisableObject {
83 * Connects Room-s together using Door-s. 83 * Connects Room-s together using Door-s.
84 */ 84 */
85 public void connectRooms() { 85 public void connectRooms() {
86 this.d(Room.AMPHITHEATER_SEAT, Direction.NORTH, Room.AMPHITHEATER_STAGE); 86 this.d(Room.AMPHITHEATER_SEAT, Direction.WEST, Room.AMPHITHEATER_STAGE);
87 this.d(Room.AMPHITHEATER_STAGE, Direction.WEST, Room.CAFETERIA); 87 this.d(Room.AMPHITHEATER_STAGE, Direction.SOUTH, Room.CAFETERIA);
88 this.d(Room.CAFETERIA, Direction.NORTH, Room.CAFETERIA_STREET); 88 this.d(Room.CAFETERIA, Direction.WEST, Room.CAFETERIA_STREET);
89 this.d(Room.CAFETERIA_STREET, Direction.EAST, Room.ESIEESPACE_STREET); 89 this.d(Room.CAFETERIA_STREET, Direction.NORTH, Room.ESIEESPACE_STREET);
90 90
91 this.d(Room.ESIEESPACE_STREET, Direction.SOUTH, Room.ESIEESPACE_FRONT); 91 this.d(Room.ESIEESPACE_STREET, Direction.EAST, Room.ESIEESPACE_FRONT);
92 this.d(Room.ESIEESPACE_FRONT, Direction.EAST, Room.ESIEESPACE_ENTRANCE); 92 this.d(Room.ESIEESPACE_FRONT, Direction.NORTH, Room.ESIEESPACE_ENTRANCE);
93 this.d(Room.ESIEESPACE_ENTRANCE, Direction.NORTH, Room.ESIEESPACE); 93 this.d(Room.ESIEESPACE_ENTRANCE, Direction.WEST, Room.ESIEESPACE);
94 94
95 this.d(Room.ESIEESPACE_STREET, Direction.EAST, Room.ENTRANCE_STREET); 95 this.d(Room.ESIEESPACE_STREET, Direction.NORTH, Room.ENTRANCE_STREET);
96 this.d(Room.ENTRANCE_STREET, Direction.SOUTH, Room.ENTRANCE_STAIRS); 96 this.d(Room.ENTRANCE_STREET, Direction.EAST, Room.ENTRANCE_STAIRS);
97 this.d(Room.ENTRANCE_STAIRS, Direction.SOUTH, Room.ENTRANCE_ROUNDABOUT); 97 this.d(Room.ENTRANCE_STAIRS, Direction.EAST, Room.ENTRANCE_ROUNDABOUT);
98 98
99 this.d(Room.ENTRANCE_STREET, Direction.EAST, Room.WING_STREET); 99 this.d(Room.ENTRANCE_STREET, Direction.NORTH, Room.WING_STREET);
100 this.d(Room.WING_STREET, Direction.NORTH, Room.WING_FLOOR_ONE); 100 this.d(Room.WING_STREET, Direction.WEST, Room.WING_FLOOR_ONE);
101 this.d(Room.WING_FLOOR_ONE, Direction.WEST, Room.WING_STAIRS_ONE); 101 this.d(Room.WING_FLOOR_ONE, Direction.SOUTH, Room.WING_STAIRS_ONE);
102 this.d(Room.WING_STAIRS_ONE, Direction.SOUTH, new Door(Room.WING_STAIRS_TWO)); 102 this.d(Room.WING_STAIRS_ONE, Direction.EAST, new Door(Room.WING_STAIRS_TWO));
103 this.d(Room.WING_STAIRS_TWO, Direction.SOUTH, new Door(Room.WING_STAIRS_ONE)); 103 this.d(Room.WING_STAIRS_TWO, Direction.EAST, new Door(Room.WING_STAIRS_ONE));
104 this.d(Room.WING_STAIRS_ONE, Direction.UP, new HiddenDoor(Room.WING_STAIRS_TWO)); 104 this.d(Room.WING_STAIRS_ONE, Direction.UP, new HiddenDoor(Room.WING_STAIRS_TWO));
105 this.d(Room.WING_STAIRS_TWO, Direction.DOWN, new HiddenDoor(Room.WING_STAIRS_ONE)); 105 this.d(Room.WING_STAIRS_TWO, Direction.DOWN, new HiddenDoor(Room.WING_STAIRS_ONE));
106 this.d(Room.WING_STAIRS_TWO, Direction.EAST, Room.WING_FLOOR_TWO); 106 this.d(Room.WING_STAIRS_TWO, Direction.NORTH, Room.WING_FLOOR_TWO);
107 this.d(Room.WING_FLOOR_TWO, Direction.NORTH, Room.WING_OFFICE_CORRIDOR); 107 this.d(Room.WING_FLOOR_TWO, Direction.WEST, Room.WING_OFFICE_CORRIDOR);
108 this.d(Room.WING_OFFICE_CORRIDOR, Direction.EAST, Room.WING_OFFICE); 108 this.d(Room.WING_OFFICE_CORRIDOR, Direction.NORTH, Room.WING_OFFICE);
109 109
110 this.d(Room.WING_STREET, Direction.EAST, Room.CLUBNIX_STREET); 110 this.d(Room.WING_STREET, Direction.NORTH, Room.CLUBNIX_STREET);
111 this.d(Room.CLUBNIX_STREET, Direction.SOUTH, Room.CLUBNIX_FRONT); 111 this.d(Room.CLUBNIX_STREET, Direction.EAST, Room.CLUBNIX_FRONT);
112 this.d(Room.CLUBNIX_FRONT, Direction.EAST, Room.CLUBNIX_ENTRANCE); 112 this.d(Room.CLUBNIX_FRONT, Direction.NORTH, Room.CLUBNIX_ENTRANCE);
113 this.d(Room.CLUBNIX_ENTRANCE, Direction.NORTH, Room.CLUBNIX); 113 this.d(Room.CLUBNIX_ENTRANCE, Direction.WEST, Room.CLUBNIX);
114 114
115 this.d(Room.WING_FLOOR_ONE, Direction.EAST, new HiddenDoor(Room.SECRET_CORRIDOR_ENTRANCE)); 115 this.d(Room.WING_FLOOR_ONE, Direction.NORTH, new HiddenDoor(Room.SECRET_CORRIDOR_ENTRANCE));
116 this.d(Room.SECRET_CORRIDOR_ENTRANCE, Direction.WEST, new Door(Room.WING_FLOOR_ONE)); 116 this.d(Room.SECRET_CORRIDOR_ENTRANCE, Direction.SOUTH, new Door(Room.WING_FLOOR_ONE));
117 this.d(Room.SECRET_CORRIDOR_ENTRANCE, Direction.NORTH, Room.STORAGE_ROOM); 117 this.d(Room.SECRET_CORRIDOR_ENTRANCE, Direction.WEST, Room.STORAGE_ROOM);
118 this.d(Room.SECRET_CORRIDOR_ENTRANCE, Direction.SOUTH, Room.SECRET_LAB); 118 this.d(Room.SECRET_CORRIDOR_ENTRANCE, Direction.EAST, Room.SECRET_LAB);
119 this.d(Room.SECRET_CORRIDOR_ENTRANCE, Direction.EAST, Room.SECRET_CORRIDOR_END); 119 this.d(Room.SECRET_CORRIDOR_ENTRANCE, Direction.NORTH, Room.SECRET_CORRIDOR_END);
120 this.d(Room.SECRET_CORRIDOR_END, Direction.NORTH, new TrapDoor(Room.DEAD_END)); 120 this.d(Room.SECRET_CORRIDOR_END, Direction.WEST, new TrapDoor(Room.DEAD_END));
121 121
122 final LockedDoor lockedDoorEnter = new LockedDoor(Room.LOCKED_ROOM); 122 final LockedDoor lockedDoorEnter = new LockedDoor(Room.LOCKED_ROOM);
123 lockedDoorEnter.setKey(Item.KEYCARD); 123 lockedDoorEnter.setKey(Item.KEYCARD);
124 this.d(Room.SECRET_CORRIDOR_END, Direction.SOUTH, lockedDoorEnter); 124 this.d(Room.SECRET_CORRIDOR_END, Direction.EAST, lockedDoorEnter);
125 125
126 final LockedDoor lockedDoorExit = new LockedDoor(Room.SECRET_CORRIDOR_END); 126 final LockedDoor lockedDoorExit = new LockedDoor(Room.SECRET_CORRIDOR_END);
127 lockedDoorExit.setKey(Item.KEYCARD); 127 lockedDoorExit.setKey(Item.KEYCARD);
128 this.d(Room.LOCKED_ROOM, Direction.NORTH, lockedDoorExit); 128 this.d(Room.LOCKED_ROOM, Direction.WEST, lockedDoorExit);
129 129
130 this.d(Room.SECRET_CORRIDOR_END, Direction.EAST, new Door(Room.TRANSPORTER_ROOM)); 130 this.d(Room.SECRET_CORRIDOR_END, Direction.NORTH, new Door(Room.TRANSPORTER_ROOM));
131 this.d(Room.TRANSPORTER_ROOM, Direction.WEST, new TransporterDoor(Room.values())); 131 this.d(Room.TRANSPORTER_ROOM, Direction.SOUTH, new TransporterDoor(Room.values()));
132 } 132 }
133 133
134 /** 134 /**
@@ -166,19 +166,19 @@ public class Game implements SerialisableObject {
166 public void addItems() { 166 public void addItems() {
167 167
168 // secret corridor 168 // secret corridor
169 this.i(Room.STORAGE_ROOM, Direction.WEST, Item.STORAGE_CUBE); 169 this.i(Room.STORAGE_ROOM, Direction.SOUTH, Item.STORAGE_CUBE);
170 this.i(Room.STORAGE_ROOM, Direction.EAST, Item.SAFETY_CUBE); 170 this.i(Room.STORAGE_ROOM, Direction.NORTH, Item.SAFETY_CUBE);
171 this.i(Room.STORAGE_ROOM, Direction.NORTH, Item.BLACK_HOLE); 171 this.i(Room.STORAGE_ROOM, Direction.WEST, Item.BLACK_HOLE);
172 172
173 this.i(Room.SECRET_LAB, Direction.SOUTH, Item.BEAMER); 173 this.i(Room.SECRET_LAB, Direction.EAST, Item.BEAMER);
174 174
175 this.i(Room.DEAD_END, Direction.NORTH, Item.KEYCARD); 175 this.i(Room.DEAD_END, Direction.WEST, Item.KEYCARD);
176 176
177 // scenario 177 // scenario
178 this.i(Room.AMPHITHEATER_STAGE, Direction.SOUTH, Item.NOTE); 178 this.i(Room.AMPHITHEATER_STAGE, Direction.EAST, Item.NOTE);
179 this.i(Room.CAFETERIA, Direction.WEST, Item.BANANA); 179 this.i(Room.CAFETERIA, Direction.SOUTH, Item.BANANA);
180 this.i(Room.ESIEESPACE, Direction.NORTH, Item.PORTABLE_CONSOLE); 180 this.i(Room.ESIEESPACE, Direction.WEST, Item.PORTABLE_CONSOLE);
181 this.i(Room.CLUBNIX, Direction.NORTH, Item.DISK); 181 this.i(Room.CLUBNIX, Direction.WEST, Item.DISK);
182 182
183 } 183 }
184 184
@@ -202,10 +202,10 @@ public class Game implements SerialisableObject {
202 public void addCharacters() { 202 public void addCharacters() {
203 203
204 // secret corridor 204 // secret corridor
205 this.c(Room.LOCKED_ROOM, Direction.SOUTH, Character.SUMOBOT); 205 this.c(Room.LOCKED_ROOM, Direction.EAST, Character.SUMOBOT);
206 206
207 // scenario 207 // scenario
208 this.c(Room.WING_OFFICE, Direction.EAST, Character.ATHANASE); 208 this.c(Room.WING_OFFICE, Direction.NORTH, Character.ATHANASE);
209 209
210 } 210 }
211 211
diff --git a/src/esieequest/game/characters/Character.java b/src/esieequest/game/characters/Character.java
index 66250fe..b9dbd9b 100644
--- a/src/esieequest/game/characters/Character.java
+++ b/src/esieequest/game/characters/Character.java
@@ -15,7 +15,7 @@ public enum Character implements SerialisableObject {
15 // @formatter:off 15 // @formatter:off
16 16
17 // secret corridor 17 // secret corridor
18 SUMOBOT(new Sumobot(Room.LOCKED_ROOM, Direction.SOUTH)), 18 SUMOBOT(new Sumobot(Room.LOCKED_ROOM, Direction.EAST)),
19 19
20 // scenario 20 // scenario
21 ATHANASE(new Athanase()); 21 ATHANASE(new Athanase());
diff --git a/src/esieequest/game/items/Disk.java b/src/esieequest/game/items/Disk.java
index 096aa48..81c1456 100644
--- a/src/esieequest/game/items/Disk.java
+++ b/src/esieequest/game/items/Disk.java
@@ -22,8 +22,7 @@ public class Disk extends SimpleItem {
22 public void use(final Game game, final Viewable view) { 22 public void use(final Game game, final Viewable view) {
23 final boolean onRoundabout = game.getPlayer().getCurrentRoom().equals( 23 final boolean onRoundabout = game.getPlayer().getCurrentRoom().equals(
24 Room.ENTRANCE_ROUNDABOUT); 24 Room.ENTRANCE_ROUNDABOUT);
25 final boolean pointingSouth = game.getPlayer().getCurrentDirection() 25 final boolean pointingSouth = game.getPlayer().getCurrentDirection().equals(Direction.EAST);
26 .equals(Direction.SOUTH);
27 final boolean deviceInstalled = game.getPlayer().getCurrentSide().getInventory().hasItem( 26 final boolean deviceInstalled = game.getPlayer().getCurrentSide().getInventory().hasItem(
28 Item.PORTABLE_CONSOLE); 27 Item.PORTABLE_CONSOLE);
29 28
diff --git a/src/esieequest/game/items/PortableConsole.java b/src/esieequest/game/items/PortableConsole.java
index c3b9b5e..b7883f1 100644
--- a/src/esieequest/game/items/PortableConsole.java
+++ b/src/esieequest/game/items/PortableConsole.java
@@ -23,8 +23,7 @@ public class PortableConsole extends SimpleItem {
23 public void use(final Game game, final Viewable view) { 23 public void use(final Game game, final Viewable view) {
24 final boolean onRoundabout = game.getPlayer().getCurrentRoom().equals( 24 final boolean onRoundabout = game.getPlayer().getCurrentRoom().equals(
25 Room.ENTRANCE_ROUNDABOUT); 25 Room.ENTRANCE_ROUNDABOUT);
26 final boolean pointingSouth = game.getPlayer().getCurrentDirection() 26 final boolean pointingSouth = game.getPlayer().getCurrentDirection().equals(Direction.EAST);
27 .equals(Direction.SOUTH);
28 27
29 if (onRoundabout && pointingSouth) { 28 if (onRoundabout && pointingSouth) {
30 game.getPlayer().getInventory().removeItem(Item.PORTABLE_CONSOLE); 29 game.getPlayer().getInventory().removeItem(Item.PORTABLE_CONSOLE);
diff --git a/src/esieequest/game/map/Direction.java b/src/esieequest/game/map/Direction.java
index 89cc442..95d1b18 100644
--- a/src/esieequest/game/map/Direction.java
+++ b/src/esieequest/game/map/Direction.java
@@ -9,10 +9,10 @@ public enum Direction {
9 9
10 // @formatter:off 10 // @formatter:off
11 11
12 WEST,
13 EAST,
12 NORTH, 14 NORTH,
13 SOUTH, 15 SOUTH,
14 EAST,
15 WEST,
16 UP, 16 UP,
17 DOWN;