From abd34ab61aa8be29730739eabaa21838ac90fe85 Mon Sep 17 00:00:00 2001 From: Benoît LUBRANO DI SBARAGLIONE Date: Thu, 5 Jun 2014 18:42:25 +0200 Subject: Add instructions before end game --- src/esieequest/engine/commands/KillCommand.java | 5 +++++ src/esieequest/game/characters/Athanase.java | 10 +++++++--- src/esieequest/game/items/Banana.java | 1 + src/esieequest/game/items/PortableConsole.java | 8 ++++++-- src/esieequest/game/states/Quest.java | 1 + 5 files changed, 20 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/esieequest/engine/commands/KillCommand.java b/src/esieequest/engine/commands/KillCommand.java index bcc0021..9f5dc49 100644 --- a/src/esieequest/engine/commands/KillCommand.java +++ b/src/esieequest/engine/commands/KillCommand.java @@ -4,6 +4,11 @@ import esieequest.game.Game; import esieequest.game.Text; import esieequest.ui.View; +/** + * Allows the user to commit suicide. + * + * @author Benoit LUBRANO DI SBARAGLIONE + */ public class KillCommand implements Executable { @Override diff --git a/src/esieequest/game/characters/Athanase.java b/src/esieequest/game/characters/Athanase.java index 51fa3c0..442273f 100644 --- a/src/esieequest/game/characters/Athanase.java +++ b/src/esieequest/game/characters/Athanase.java @@ -10,6 +10,7 @@ import esieequest.ui.View; * Athanase the mathgorilla. * * @author Pacien TRAN-GIRARD + * @author Benoit LUBRANO DI SBARAGLIONE */ public class Athanase extends SimpleCharacter { @@ -36,7 +37,7 @@ public class Athanase extends SimpleCharacter { if (playersInventory.hasItem(Item.BANANA)) { playersInventory.removeItem(Item.BANANA); view.updateInventory(playersInventory); - view.echo("Ooooh! You have a banana! *nomz* WAIT!... It tastes like... an EMERGENCY BANANA! That means... Hmmm..." + view.echo("Ooooh! You have a banana! *nomz* WAIT!... It tastes like... an EMERGENCY BANANA! That means... Hmmm..." + "\n" + "They turned it ON... Their stupid machine... It was not ready. It was a beta... Obviously it crashed... WITH THE ENTIRE UNIVERSE" + "\n" + "I think we have to restart everything..."); @@ -71,12 +72,15 @@ public class Athanase extends SimpleCharacter { if (playersInventory.hasItem(Item.PORTABLE_CONSOLE)) { view.echo("The Universe is far away... Well... Not exactly... Sort of... Complicated. Find an antenna on the outside or something that may act as an amplifier and connect the Portable Console to contact the Universe."); } else { + view.echo("You should go outside, at the Console instead of talking to me."); + } + break; + case USE_DISK: + if (playersInventory.hasItem(Item.DISK)) { view.echo("Well... You have installed the console, right? Have you turned it ON and inserted the disk? Because you should."); } break; - } } - } diff --git a/src/esieequest/game/items/Banana.java b/src/esieequest/game/items/Banana.java index 81f0b45..4350463 100644 --- a/src/esieequest/game/items/Banana.java +++ b/src/esieequest/game/items/Banana.java @@ -7,6 +7,7 @@ import esieequest.ui.View; * A Banana that can be eaten only by Athanase. * * @author Pacien TRAN-GIRARD + * @author Benoit LUBRANO DI SBARAGLIONE */ public class Banana extends SimpleItem { diff --git a/src/esieequest/game/items/PortableConsole.java b/src/esieequest/game/items/PortableConsole.java index 9c14219..cf63da1 100644 --- a/src/esieequest/game/items/PortableConsole.java +++ b/src/esieequest/game/items/PortableConsole.java @@ -3,12 +3,14 @@ package esieequest.game.items; import esieequest.game.Game; import esieequest.game.map.Direction; import esieequest.game.map.Room; +import esieequest.game.states.Quest; import esieequest.ui.View; /** * The transponder. * * @author Pacien TRAN-GIRARD + * @author Benoit LUBRANO DI SBARAGLIONE */ public class PortableConsole extends SimpleItem { @@ -23,11 +25,13 @@ public class PortableConsole extends SimpleItem { public void use(final Game game, final View view) { final boolean onRoundabout = game.getPlayer().getCurrentRoom().equals( Room.ENTRANCE_ROUNDABOUT); - final boolean pointingSouth = game.getPlayer().getCurrentDirection().equals(Direction.EAST); + final boolean pointingEast = game.getPlayer().getCurrentDirection().equals(Direction.EAST); - if (onRoundabout && pointingSouth) { + if (onRoundabout && pointingEast) { game.getPlayer().getInventory().removeItem(Item.PORTABLE_CONSOLE); game.getPlayer().getCurrentSide().getInventory().putItem(Item.PORTABLE_CONSOLE); + game.getPlayer().setCurrentQuest(Quest.USE_DISK); + view.updateQuest(Quest.USE_DISK); view.updateInventory(game.getPlayer().getInventory()); view.updateLocation(game.getPlayer().getCurrentRoom(), game.getPlayer() diff --git a/src/esieequest/game/states/Quest.java b/src/esieequest/game/states/Quest.java index 2a7c591..a09ea09 100644 --- a/src/esieequest/game/states/Quest.java +++ b/src/esieequest/game/states/Quest.java @@ -18,6 +18,7 @@ public enum Quest { FIND_DISK("Find the Disk at Club*Nix"), FIND_CONSOLE("Find the Portable Remote Console at ESIEEspace"), INSTALL_CONSOLE("Find a place to install the Console"), + USE_DISK("Insert the disk into the Console"), ; -- cgit v1.2.3