made winning and losing work.
This commit is contained in:
@@ -15,6 +15,15 @@
|
|||||||
:y 0
|
:y 0
|
||||||
:baseline 1000))
|
:baseline 1000))
|
||||||
|
|
||||||
|
(defn play-battle [entities anim]
|
||||||
|
(actions/transition-music entities :town-1 :fight)
|
||||||
|
(actions/add-entity entities :fight (get-in @entities [:room :fight]))
|
||||||
|
(actions/add-entity entities :hands-fight (get-in @entities [:room :hands-fight]))
|
||||||
|
(actions/play-animation entities :hands-fight anim)
|
||||||
|
(actions/transition-music entities :fight :town-1)
|
||||||
|
(actions/remove-entity entities :hands-fight)
|
||||||
|
(actions/remove-entity entities :fight))
|
||||||
|
|
||||||
(defn do-warrior-dialogue [entities]
|
(defn do-warrior-dialogue [entities]
|
||||||
(actions/walk-to entities :ego [150 45] :face :left)
|
(actions/walk-to entities :ego [150 45] :face :left)
|
||||||
(actions/talk entities :ego "Hey guys!")
|
(actions/talk entities :ego "Hey guys!")
|
||||||
@@ -33,7 +42,8 @@
|
|||||||
:warriors "'Thou art my father, and I am thy son. Therefore I will speaketh in this manner.'"
|
:warriors "'Thou art my father, and I am thy son. Therefore I will speaketh in this manner.'"
|
||||||
:ego "... I think I've got the idea.")
|
:ego "... I think I've got the idea.")
|
||||||
:choices actions/previous-choices}
|
:choices actions/previous-choices}
|
||||||
"Can I be a knight like you guys?"
|
(when (not (actions/has-obtained? entities :medal))
|
||||||
|
"Can I be a knight like you guys?")
|
||||||
{:run #(actions/respond entities %
|
{:run #(actions/respond entities %
|
||||||
:warriors "We thinketh not, young esquire."
|
:warriors "We thinketh not, young esquire."
|
||||||
:warriors "You lacketh the strength and vigor required for such a task.")
|
:warriors "You lacketh the strength and vigor required for such a task.")
|
||||||
@@ -47,20 +57,14 @@
|
|||||||
(if (actions/has-item? @entities :flask-1-strength)
|
(if (actions/has-item? @entities :flask-1-strength)
|
||||||
(do
|
(do
|
||||||
(actions/do-dialogue entities :ego "One sec.")
|
(actions/do-dialogue entities :ego "One sec.")
|
||||||
(actions/play-animation entities :ego :grow)
|
(actions/play-animation entities :ego :grow :stop? false)
|
||||||
|
(play-battle entities :win)
|
||||||
(actions/do-dialogue entities
|
(actions/do-dialogue entities
|
||||||
:warriors "Congratulations young master. Thou art worthy in might."
|
:warriors "Congratulations young master. Thou art worthy in might."
|
||||||
:warriors "Take my medal of strength.")
|
:warriors "Take my medal of strength.")
|
||||||
(actions/give entities :medal))
|
(actions/give entities :medal))
|
||||||
(do
|
(do
|
||||||
|
(play-battle entities :lose)
|
||||||
(actions/transition-music entities :town-1 :fight)
|
|
||||||
(actions/add-entity entities :fight (get-in @entities [:room :fight]))
|
|
||||||
(actions/add-entity entities :hands-fight (get-in @entities [:room :hands-fight]))
|
|
||||||
(actions/play-animation entities :hands-fight :lose)
|
|
||||||
(actions/transition-music entities :fight :town-1)
|
|
||||||
(actions/remove-entity entities :hands-fight)
|
|
||||||
(actions/remove-entity entities :fight)
|
|
||||||
(actions/do-dialogue entities
|
(actions/do-dialogue entities
|
||||||
:warriors "You lost, young master. Go hitherto, unto thy gym."))))}
|
:warriors "You lost, young master. Go hitherto, unto thy gym."))))}
|
||||||
"Something else."
|
"Something else."
|
||||||
|
|||||||
Reference in New Issue
Block a user