From b63c516251cd51c0294055977d20af15b904e8c1 Mon Sep 17 00:00:00 2001 From: Reuben Castelino Date: Sat, 18 Oct 2014 16:54:21 -0700 Subject: [PATCH] fixed #106 --- .../jadventure/game/prompts/CommandCollection.java | 14 +++++++++++--- .../com/jadventure/game/prompts/DebugPrompt.java | 6 +++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/jadventure/game/prompts/CommandCollection.java b/src/main/java/com/jadventure/game/prompts/CommandCollection.java index ad848bdf..15bc1dad 100644 --- a/src/main/java/com/jadventure/game/prompts/CommandCollection.java +++ b/src/main/java/com/jadventure/game/prompts/CommandCollection.java @@ -43,8 +43,7 @@ public enum CommandCollection { "Game\n" + "-------------------------------------------------------------\n" + "save (s): Save your progress.\n" + -"exit: Exit the game and return to the main menu.\n" + -"debug: Starts debuggung.\n"; +"exit: Exit the game and return to the main menu."; private HashMap directionLinks = new HashMap() {{ @@ -70,6 +69,11 @@ public void initPlayer(Player player) { @SuppressWarnings("UnusedDeclaration") public void command_help() { QueueProvider.offer(helpText); + if (player.getName().equals("test")) { + QueueProvider.offer("debug: Starts Debugging.\n"); + } else { + QueueProvider.offer("\n"); + } } @Command(command="save", aliases="s", description="Save the game") @@ -97,7 +101,11 @@ public void command_m() { @Command(command="debug", aliases="", description="Start debugging") @SuppressWarnings("UnusedDeclaration") public void command_debug() { - new DebugPrompt(player); + if (player.getName().equals("test")) { + new DebugPrompt(player); + } else { + QueueProvider.offer("You don't have access to this function"); + } } @Command(command="goto", aliases="g", description="Goto a direction") diff --git a/src/main/java/com/jadventure/game/prompts/DebugPrompt.java b/src/main/java/com/jadventure/game/prompts/DebugPrompt.java index a7ebcd55..4a9ba3ab 100644 --- a/src/main/java/com/jadventure/game/prompts/DebugPrompt.java +++ b/src/main/java/com/jadventure/game/prompts/DebugPrompt.java @@ -18,7 +18,7 @@ public class DebugPrompt{ "level: modify player's level\n"+ "gold: modify player's gold\n"+ "backpack: Modify the player backpack\n"+ - "stats: Display the current stats\n"+ + "vs: Display the current stats\n"+ "help: Prints this info\n"+ "exit: Exits the debug prompt\n"; @@ -71,9 +71,9 @@ else if(command.startsWith("gold")){ player.setGold(newVal); } else if(command.equals("backpack")){ - new BackpackDebugPrompt(player); + new BackpackDebugPrompt(player); } - else if(command.equals("stats")) + else if(command.equals("vs")) player.getStats(); else if(command.equals("help")) QueueProvider.offer(helpText);