From 6cd39f5c29c568973729c63ef66e1fb8d608c192 Mon Sep 17 00:00:00 2001 From: tzw0 Date: Thu, 31 Oct 2019 17:37:40 +0800 Subject: [PATCH] added task commands and update menu --- build/resources/main/asciiArt/Menu/frame2.txt | 36 +++++++++---------- src/main/java/farmio/Parser.java | 3 ++ src/main/resources/asciiArt/Menu/frame2.txt | 36 +++++++++---------- .../asciiArt/TaskCommands/frame11.txt | 17 +++++++++ .../asciiArt/TaskCommands/frame12.txt | 17 +++++++++ .../asciiArt/TaskCommands/frame13.txt | 17 +++++++++ .../asciiArt/TaskCommands/frame14.txt | 17 +++++++++ .../asciiArt/TaskCommands/frame15.txt | 17 +++++++++ .../asciiArt/TaskCommands/frame16.txt | 17 +++++++++ .../asciiArt/TaskCommands/frame21.txt | 17 +++++++++ src/main/resources/levels/1.1.json | 3 +- src/main/resources/levels/1.2.json | 3 +- 12 files changed, 160 insertions(+), 40 deletions(-) create mode 100644 src/main/resources/asciiArt/TaskCommands/frame11.txt create mode 100644 src/main/resources/asciiArt/TaskCommands/frame12.txt create mode 100644 src/main/resources/asciiArt/TaskCommands/frame13.txt create mode 100644 src/main/resources/asciiArt/TaskCommands/frame14.txt create mode 100644 src/main/resources/asciiArt/TaskCommands/frame15.txt create mode 100644 src/main/resources/asciiArt/TaskCommands/frame16.txt create mode 100644 src/main/resources/asciiArt/TaskCommands/frame21.txt diff --git a/build/resources/main/asciiArt/Menu/frame2.txt b/build/resources/main/asciiArt/Menu/frame2.txt index c3d0744f5b..39adeb28bb 100644 --- a/build/resources/main/asciiArt/Menu/frame2.txt +++ b/build/resources/main/asciiArt/Menu/frame2.txt @@ -1,19 +1,17 @@ -_______________________________________________________ - __________ - _.-"` `"-._ - .'_ _ _ _ _ _ _'. - / |_ |_||_|| | | | | | \ - / | | || \| | | |_| \ MENU: - ; \ Save Game - | | Load Game - | _. | Quit Game - ; /__\ ,_ ; - \ |= |;._.}{__ / Conditions - _.-""-|.' # '. ` `.-"{}<._/ Actions - / \ \ x `" Market - ----/ \_.-'|--X---- - -=_ | | |- X. =_ - - __ |_________|_.-'|_X-X## - `'-._|_|;:;_.-'` '::. `"- - .:;. .:. ::. '::. - _______________________________________________________ + +------------------------MENU--------------------------- + [Save Game] - save the game + [Load Game] - load the game + [Quit Game] - quit the game + + [Conditions] - show full list of conditions + [Actions] - show full list of actions + [Market] - show the the market rates of items + [Hint] - show hints on the current level + + [Task Commands] - show full list of task commands + + _[_]_ + \|/ (") \|/ + | ,(_)' | + ==|_\|/__|__\|/_|== -"- ==|_\|/__|__\|/_|== diff --git a/src/main/java/farmio/Parser.java b/src/main/java/farmio/Parser.java index c2851f59bb..8d3dbd303f 100644 --- a/src/main/java/farmio/Parser.java +++ b/src/main/java/farmio/Parser.java @@ -139,6 +139,9 @@ private static Command parseTaskAdd(String userInput) throws FarmioException { if (userInput.equals("market")) { return new CommandShowList("MarketList"); } + if (userInput.equals("task commands") || userInput.equals("task command")) { + return new CommandShowList("TaskCommands"); + } if (userInput.startsWith("do") || userInput.startsWith("if") || userInput.startsWith("for") || userInput.startsWith("while")) { return new CommandTaskCreate(parseTask(userInput)); diff --git a/src/main/resources/asciiArt/Menu/frame2.txt b/src/main/resources/asciiArt/Menu/frame2.txt index c3d0744f5b..39adeb28bb 100644 --- a/src/main/resources/asciiArt/Menu/frame2.txt +++ b/src/main/resources/asciiArt/Menu/frame2.txt @@ -1,19 +1,17 @@ -_______________________________________________________ - __________ - _.-"` `"-._ - .'_ _ _ _ _ _ _'. - / |_ |_||_|| | | | | | \ - / | | || \| | | |_| \ MENU: - ; \ Save Game - | | Load Game - | _. | Quit Game - ; /__\ ,_ ; - \ |= |;._.}{__ / Conditions - _.-""-|.' # '. ` `.-"{}<._/ Actions - / \ \ x `" Market - ----/ \_.-'|--X---- - -=_ | | |- X. =_ - - __ |_________|_.-'|_X-X## - `'-._|_|;:;_.-'` '::. `"- - .:;. .:. ::. '::. - _______________________________________________________ + +------------------------MENU--------------------------- + [Save Game] - save the game + [Load Game] - load the game + [Quit Game] - quit the game + + [Conditions] - show full list of conditions + [Actions] - show full list of actions + [Market] - show the the market rates of items + [Hint] - show hints on the current level + + [Task Commands] - show full list of task commands + + _[_]_ + \|/ (") \|/ + | ,(_)' | + ==|_\|/__|__\|/_|== -"- ==|_\|/__|__\|/_|== diff --git a/src/main/resources/asciiArt/TaskCommands/frame11.txt b/src/main/resources/asciiArt/TaskCommands/frame11.txt new file mode 100644 index 0000000000..99a345b069 --- /dev/null +++ b/src/main/resources/asciiArt/TaskCommands/frame11.txt @@ -0,0 +1,17 @@ + +---------------------Task Commands-------------------- + +Eg: TASK = 'do gotomarket' + +[delete X] - X is the index of the task to be deleted +[delete all] - clears all task in +[insert X TASK] - insert task at index X +[edit X TASK] - replaces task at index X +[TASK] - create task + + + + _[_]_ + \|/ (") \|/ + | ,(_)' | + ==|_\|/__|__\|/_|== -"- ==|_\|/__|__\|/_|== diff --git a/src/main/resources/asciiArt/TaskCommands/frame12.txt b/src/main/resources/asciiArt/TaskCommands/frame12.txt new file mode 100644 index 0000000000..99a345b069 --- /dev/null +++ b/src/main/resources/asciiArt/TaskCommands/frame12.txt @@ -0,0 +1,17 @@ + +---------------------Task Commands-------------------- + +Eg: TASK = 'do gotomarket' + +[delete X] - X is the index of the task to be deleted +[delete all] - clears all task in +[insert X TASK] - insert task at index X +[edit X TASK] - replaces task at index X +[TASK] - create task + + + + _[_]_ + \|/ (") \|/ + | ,(_)' | + ==|_\|/__|__\|/_|== -"- ==|_\|/__|__\|/_|== diff --git a/src/main/resources/asciiArt/TaskCommands/frame13.txt b/src/main/resources/asciiArt/TaskCommands/frame13.txt new file mode 100644 index 0000000000..99a345b069 --- /dev/null +++ b/src/main/resources/asciiArt/TaskCommands/frame13.txt @@ -0,0 +1,17 @@ + +---------------------Task Commands-------------------- + +Eg: TASK = 'do gotomarket' + +[delete X] - X is the index of the task to be deleted +[delete all] - clears all task in +[insert X TASK] - insert task at index X +[edit X TASK] - replaces task at index X +[TASK] - create task + + + + _[_]_ + \|/ (") \|/ + | ,(_)' | + ==|_\|/__|__\|/_|== -"- ==|_\|/__|__\|/_|== diff --git a/src/main/resources/asciiArt/TaskCommands/frame14.txt b/src/main/resources/asciiArt/TaskCommands/frame14.txt new file mode 100644 index 0000000000..99a345b069 --- /dev/null +++ b/src/main/resources/asciiArt/TaskCommands/frame14.txt @@ -0,0 +1,17 @@ + +---------------------Task Commands-------------------- + +Eg: TASK = 'do gotomarket' + +[delete X] - X is the index of the task to be deleted +[delete all] - clears all task in +[insert X TASK] - insert task at index X +[edit X TASK] - replaces task at index X +[TASK] - create task + + + + _[_]_ + \|/ (") \|/ + | ,(_)' | + ==|_\|/__|__\|/_|== -"- ==|_\|/__|__\|/_|== diff --git a/src/main/resources/asciiArt/TaskCommands/frame15.txt b/src/main/resources/asciiArt/TaskCommands/frame15.txt new file mode 100644 index 0000000000..99a345b069 --- /dev/null +++ b/src/main/resources/asciiArt/TaskCommands/frame15.txt @@ -0,0 +1,17 @@ + +---------------------Task Commands-------------------- + +Eg: TASK = 'do gotomarket' + +[delete X] - X is the index of the task to be deleted +[delete all] - clears all task in +[insert X TASK] - insert task at index X +[edit X TASK] - replaces task at index X +[TASK] - create task + + + + _[_]_ + \|/ (") \|/ + | ,(_)' | + ==|_\|/__|__\|/_|== -"- ==|_\|/__|__\|/_|== diff --git a/src/main/resources/asciiArt/TaskCommands/frame16.txt b/src/main/resources/asciiArt/TaskCommands/frame16.txt new file mode 100644 index 0000000000..99a345b069 --- /dev/null +++ b/src/main/resources/asciiArt/TaskCommands/frame16.txt @@ -0,0 +1,17 @@ + +---------------------Task Commands-------------------- + +Eg: TASK = 'do gotomarket' + +[delete X] - X is the index of the task to be deleted +[delete all] - clears all task in +[insert X TASK] - insert task at index X +[edit X TASK] - replaces task at index X +[TASK] - create task + + + + _[_]_ + \|/ (") \|/ + | ,(_)' | + ==|_\|/__|__\|/_|== -"- ==|_\|/__|__\|/_|== diff --git a/src/main/resources/asciiArt/TaskCommands/frame21.txt b/src/main/resources/asciiArt/TaskCommands/frame21.txt new file mode 100644 index 0000000000..99a345b069 --- /dev/null +++ b/src/main/resources/asciiArt/TaskCommands/frame21.txt @@ -0,0 +1,17 @@ + +---------------------Task Commands-------------------- + +Eg: TASK = 'do gotomarket' + +[delete X] - X is the index of the task to be deleted +[delete all] - clears all task in +[insert X TASK] - insert task at index X +[edit X TASK] - replaces task at index X +[TASK] - create task + + + + _[_]_ + \|/ (") \|/ + | ,(_)' | + ==|_\|/__|__\|/_|== -"- ==|_\|/__|__\|/_|== diff --git a/src/main/resources/levels/1.1.json b/src/main/resources/levels/1.1.json index d61e55d0b5..48bb5c138e 100644 --- a/src/main/resources/levels/1.1.json +++ b/src/main/resources/levels/1.1.json @@ -14,7 +14,8 @@ "Enter [Do GoToMarket] to create a task that tells Farmer + to drive to the market.~" ], "feedback": [ - "you have succesfully went to the market by using the [do] command ", + "you have succesfully went to the market by using the [do] command ", + "Note that your goal changed from white to green whent it is completed (ubuntu only)", ], "gold": 0, "seeds": 0, diff --git a/src/main/resources/levels/1.2.json b/src/main/resources/levels/1.2.json index c780d6d0a0..85966e929e 100644 --- a/src/main/resources/levels/1.2.json +++ b/src/main/resources/levels/1.2.json @@ -4,7 +4,8 @@ "Enter [Task] [Action] to buy seeds from the market.~" ], "feedback": [ - "you have succesfully bought seeds using gold" + "you have succesfully bought seeds using gold", + "Note that a symbol '->' shows you whenever there is a change in your assets, " ], "gold": 0, "seeds": 1,