Skip to content

Commit

Permalink
fixed #106
Browse files Browse the repository at this point in the history
  • Loading branch information
projectdelphai committed Oct 18, 2014
1 parent 73c9d1d commit b63c516
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
14 changes: 11 additions & 3 deletions src/main/java/com/jadventure/game/prompts/CommandCollection.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, String> directionLinks = new HashMap<String,String>()
{{
Expand All @@ -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")
Expand Down Expand Up @@ -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")
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/jadventure/game/prompts/DebugPrompt.java
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit b63c516

Please sign in to comment.