Skip to content

Commit

Permalink
Merge pull request #229 from tzw0/FarmLogic
Browse files Browse the repository at this point in the history
fixed hint
  • Loading branch information
tzw0 authored Oct 31, 2019
2 parents b9ef7a1 + d0dabf9 commit 7b6f30c
Show file tree
Hide file tree
Showing 14 changed files with 162 additions and 41 deletions.
36 changes: 17 additions & 19 deletions build/resources/main/asciiArt/Menu/frame2.txt
Original file line number Diff line number Diff line change
@@ -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

_[_]_
\|/ (") \|/
| ,(_)' |
==|_\|/__|__\|/_|== -"- ==|_\|/__|__\|/_|==
2 changes: 1 addition & 1 deletion src/main/java/commands/CommandLevelStart.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public void execute(Farmio farmio) throws FarmioFatalException {
int lastFrameId = level.getNarratives().size() - 1;
for (String narrative: level.getNarratives()) {
String userInput = ui.getInput();
if (userInput.equals("skip")) {
if (userInput.toLowerCase().equals("skip")) {
farmio.getSimulation().simulate(level.getPath(), lastFrameId);
ui.typeWriter(level.getNarratives().get(lastFrameId), false);
break;
Expand Down
1 change: 1 addition & 0 deletions src/main/java/commands/CommandShowList.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public CommandShowList(String listPath) {
* @throws FarmioFatalException if Simulation file cannot be found.
*/
@Override

public void execute(Farmio farmio) throws FarmioFatalException {
Ui ui = farmio.getUi();
double level = farmio.getFarmer().getLevel();
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/farmio/Parser.java
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
36 changes: 17 additions & 19 deletions src/main/resources/asciiArt/Menu/frame2.txt
Original file line number Diff line number Diff line change
@@ -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

_[_]_
\|/ (") \|/
| ,(_)' |
==|_\|/__|__\|/_|== -"- ==|_\|/__|__\|/_|==
17 changes: 17 additions & 0 deletions src/main/resources/asciiArt/TaskCommands/frame11.txt
Original file line number Diff line number Diff line change
@@ -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 <CODE>
[insert X TASK] - insert task at index X
[edit X TASK] - replaces task at index X
[TASK] - create task



_[_]_
\|/ (") \|/
| ,(_)' |
==|_\|/__|__\|/_|== -"- ==|_\|/__|__\|/_|==
17 changes: 17 additions & 0 deletions src/main/resources/asciiArt/TaskCommands/frame12.txt
Original file line number Diff line number Diff line change
@@ -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 <CODE>
[insert X TASK] - insert task at index X
[edit X TASK] - replaces task at index X
[TASK] - create task



_[_]_
\|/ (") \|/
| ,(_)' |
==|_\|/__|__\|/_|== -"- ==|_\|/__|__\|/_|==
17 changes: 17 additions & 0 deletions src/main/resources/asciiArt/TaskCommands/frame13.txt
Original file line number Diff line number Diff line change
@@ -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 <CODE>
[insert X TASK] - insert task at index X
[edit X TASK] - replaces task at index X
[TASK] - create task



_[_]_
\|/ (") \|/
| ,(_)' |
==|_\|/__|__\|/_|== -"- ==|_\|/__|__\|/_|==
17 changes: 17 additions & 0 deletions src/main/resources/asciiArt/TaskCommands/frame14.txt
Original file line number Diff line number Diff line change
@@ -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 <CODE>
[insert X TASK] - insert task at index X
[edit X TASK] - replaces task at index X
[TASK] - create task



_[_]_
\|/ (") \|/
| ,(_)' |
==|_\|/__|__\|/_|== -"- ==|_\|/__|__\|/_|==
17 changes: 17 additions & 0 deletions src/main/resources/asciiArt/TaskCommands/frame15.txt
Original file line number Diff line number Diff line change
@@ -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 <CODE>
[insert X TASK] - insert task at index X
[edit X TASK] - replaces task at index X
[TASK] - create task



_[_]_
\|/ (") \|/
| ,(_)' |
==|_\|/__|__\|/_|== -"- ==|_\|/__|__\|/_|==
17 changes: 17 additions & 0 deletions src/main/resources/asciiArt/TaskCommands/frame16.txt
Original file line number Diff line number Diff line change
@@ -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 <CODE>
[insert X TASK] - insert task at index X
[edit X TASK] - replaces task at index X
[TASK] - create task



_[_]_
\|/ (") \|/
| ,(_)' |
==|_\|/__|__\|/_|== -"- ==|_\|/__|__\|/_|==
17 changes: 17 additions & 0 deletions src/main/resources/asciiArt/TaskCommands/frame21.txt
Original file line number Diff line number Diff line change
@@ -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 <CODE>
[insert X TASK] - insert task at index X
[edit X TASK] - replaces task at index X
[TASK] - create task



_[_]_
\|/ (") \|/
| ,(_)' |
==|_\|/__|__\|/_|== -"- ==|_\|/__|__\|/_|==
3 changes: 2 additions & 1 deletion src/main/resources/levels/1.1.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/levels/1.2.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 7b6f30c

Please sign in to comment.