fixed dialogue and minor bug fixes.

This commit is contained in:
2014-12-14 11:24:23 -08:00
parent 19394e78a7
commit 1ab740a30e
3 changed files with 56 additions and 61 deletions

View File

@@ -204,7 +204,8 @@
:collision "inside-antique/collision.png"
:apply-state (fn [entities]
(as-> entities entities
(if (actions/has-obtained? entities :teddy)
(if (or (actions/has-item? entities :teddy)
(actions/has-obtained? entities :balloon))
(update-in entities [:room :entities] #(dissoc % :teddy))
entities)))
:scale-fn (utils/scaler-fn-with-baseline 110 0.10 1.50)

View File

@@ -11,38 +11,38 @@
[play-clj.utils :refer :all]
[play-clj.g2d :refer :all]))
(defn play-warlocks-castle [entities]
(let [scenarios [#(actions/do-dialogue entities
:game-player "As you approach the lair of the cave beast, a foul odor fills your nostrils."
:game-player "To your horror, you realize that the stench is from the corpses of less wise wizards."
:game-player "The cave is eerie and dark. What do you do?")
#(actions/do-dialogue entities
:game-player "As you move forward in your quest, you come upon an abandoned library."
:game-player "Still, something doesn't feel right about the place."
:game-player "It's quiet."
:game-player "A little too quiet.")
#(actions/do-dialogue entities
:game-player "The treacherous stair lies before you.")]]
(doseq [scenario (take 2 (shuffle scenarios))]
(scenario))))
(defn nice-trophy-dialogue [entities]
{:run #(actions/respond entities %
:game-player "Thanks. I'm the reigning champ in the annual Town of Remington Junior Smarty Pants Derby."
:game-player "And with my sharp intellect, I'm guessing you want my trophy?")
:game-player "I earned it with my wisdom and sharp intellect."
:game-player "Oh, I'm guessing you want it? Perhaps to prove your wisdom and pull the Sword of Blergh?")
:choices ["Yes."
{:run #(do (actions/update-state entities (fn [state] (assoc state :current-riddle :wool)))
(actions/respond entities %
:game-player "Well, if you want my trophy, you'll have to earn it."
:game-player "There are a few riddles that even I, the wisest in all of Remington, cannot solve."
:game-player "How about you help me?"
:game-player "Bring me the answer:"
:game-player "White as snow, but not as cold,"
:game-player "Keeps you warm, or so I'm told."
:ego "Okay."))}
"No."
{:run #(actions/respond entities %
:game-player "That's exactly what I'd expect a dummy like you to say.")}]})
:game-player "My trophy is hard-won. You want pry it from my fingers easily."
:game-player "But I'm preparing for next year's Junior Smarty Pants Derby, and I need some help."
:game-player "If you can help me, it will secure my success for next year, and so you can have this trophy."
:game-player "Deal?")
:choices ["What is the Junior Smarty Pants Derby?"
{:run #(actions/respond entities %
:game-player "The annual Town of Remington Junior Smarty Pants Derby is a contest of wits."
:game-player "It's sort of like a game of riddles, mixed with a scavenger hunt."
:game-player "You must find the answer to the riddle to win."
:game-player "There are a few puzzles that even I, Brian O'Brainy, stumped."
:game-player "If you can help me, I'll let you have my trophy.")
:choices actions/previous-choices}
"Deal."
{:run #(do (actions/update-state entities (fn [state] (assoc state :current-riddle :wool)))
(actions/respond entities %
:game-player "Very well. I am studying for next year's derby, and there are a few puzzles that have me stumped."
:game-player "If you can bring me the answers to three riddles, I'll give you my trophy."
:game-player "Here's the first riddle:"
:game-player "'White as snow, but not as cold,\nKeeps you warm, or so I'm told.'"
:ego "Okay. So I'll be back soon."))}
"No thanks."
{:run #(actions/respond entities % :game-player "Fine by me.")}]}
"No."
{:run #(actions/respond entities % :game-player "Fine by me.")}]})
(defn walk-to-player [entities]
(actions/walk-to entities :ego [210 73] :face :right))
@@ -53,21 +53,16 @@
(actions/present-choices entities
{:choices ["Do you know anything about the sword in the stone up there?"
{:run #(actions/respond entities %
:game-player "It is said that only he who is worthy in wisdom can pull the sword!"
:game-player "I, of course have such wisdom, but I'm still unable to pull it myself.")
:choices ["How'd you get to be so wise?"
:game-player "It's the Sword of Blergh. There's a prophecy that says that whoever pulls it will be a great knight!"
:game-player "'The Sword of Blergh, with magic sting,\nshall yield to no earthly king.'"
:game-player "'Worthy in wisdom, courage, and might,\nonly then with sword he'll fight.'"
:game-player "I've often dreamed of pulling the sword myself.")
:choices ["Why don't you?"
{:run #(actions/respond entities %
:game-player "Ever heard of the annual Town of Remington Junior Smarty Pants Derby?"
:ego "I don't think so..."
:game-player "I'm the three times town champ!"
:game-player "My intellect has only been achieved with years of precise training!"
:ego "..."
:game-player "It would take years of careful honing of your skills to be as wise as I am.")
:choices actions/previous-choices}
"Why don't you pull the sword?"
{:run #(actions/respond entities %
:game-player "You must be mighty in strength to pull the sword."
:game-player "And I spend all my time studying!")
:game-player "I, of course, have the wisdom required for the task."
:game-player "But I'm not much of a warrior. I don't have the might required for the task."
:game-player "The knights of Remington have muscles the size of tree trunks."
:game-player "I'd never be able to prove my strength.")
:choices actions/previous-choices}
"Something else."
{:choices actions/something-else}]}
@@ -78,22 +73,19 @@
(when (= :wool (get-in @entities [:state :current-riddle]))
"What was that riddle again?")
{:run #(actions/respond entities %
:game-player "White as snow, but not as cold,"
:game-player "Keeps you warm, or so I'm told.")
:game-player "'White as snow, but not as cold,\nKeeps you warm, or so I'm told.'")
:choices actions/previous-choices}
(when (= :balloon (get-in @entities [:state :current-riddle]))
"What was that riddle again?")
{:run #(actions/respond entities %
:game-player "Filled with air, light as a feather,"
:game-player "If you want to keep it, best have a tether.")
:game-player "'Filled with air, light as a feather,\nIf you want to keep it, best have a tether.'")
:choices actions/previous-choices}
(when (= :frog-legs (get-in @entities [:state :current-riddle]))
"What was that riddle again?")
{:run #(actions/respond entities %
:game-player "Hippity-hop, I jump real far,"
:game-player "Now I'm dead, or at least have a scar.")
:game-player "'Hippity-hop, I'd jump so high,\nWithout these springs, can't harm a fly.'")
:choices actions/previous-choices}
"Nevermind."
{:run #(actions/respond entities % :game-player "See you around.")}]}))
@@ -110,15 +102,15 @@
(actions/play-animation entities :ego :reach)
(actions/do-dialogue entities
:ego "I can't pull it out!"
:ego "It looks like there's an enscription here.")
:ego "It looks like there's an inscription here.")
(actions/play-animation entities :ego :squat)
(actions/do-dialogue entities
:ego "The Sword of Blergh with magic sting,"
:ego "shall yield to no earthly king."
:ego "Worthy in wisdom, courage, and might,"
:ego "only then with sword he'll fight.")
:ego "'The Sword of Blergh with magic sting,\nShall yield to no earthly king.'"
:ego "Worthy in wisdom, courage, and might,\nOnly then with sword he'll fight. ")
(if (= 3 (count missing-items))
(actions/do-dialogue entities :ego "I have to prove myself worthy in wisdom, courage, and might!")
(actions/do-dialogue entities
:ego "I have to prove myself worthy in wisdom, courage, and might!"
:ego "Then I can become a knight and impress Georgia McGorgeous!")
(actions/do-dialogue entities :ego (str "I've proven myself in "
(str/join " and " (map item->proof obtained-items))
", but still have to prove myself in "
@@ -221,8 +213,8 @@
(actions/remove-item entities :wool)
(actions/do-dialogue entities
:game-player "That's right! Now for your second riddle:"
:game-player "Filled with air, light as a feather,"
:game-player "If you want to keep it, best have a tether."))
:game-player "'Filled with air, light as a feather,\nIf you want to keep it, best have a tether.'"
:ego "Okay. Be back soon."))
(actions/talk entities :ego "He doesn't need it.")))
:balloon (actions/get-script entities
(walk-to-player entities)
@@ -231,8 +223,8 @@
(actions/remove-item entities :balloon)
(actions/do-dialogue entities
:game-player "That's right! Now for your third riddle:"
:game-player "Hippity-hop, I jump really far,"
:game-player "Now I'm dead, or at least a have a scar."))
:game-player "'Hippity-hop, I'd jump so high,\nWithout these springs, can't harm a fly.'"
:ego "Okay. Be back soon."))
(actions/talk entities :ego "He doesn't need it.")))
:frog-legs (actions/get-script entities
(walk-to-player entities)
@@ -242,10 +234,12 @@
(actions/remove-item entities :frog-legs)
(actions/do-dialogue entities
:game-player "Wow! That's right!"
:game-player "I guess I'm not the wisest person in Remington."
:game-player "You have earned my trophy.")
:game-player "You, sir, have proven yourself worthy of my trophy."
:game-player "Even I, Brian O'Brainy, am impressed with your wisdom."
:game-player "Take it, and go in wisdom.")
(actions/give entities :trophy)
(actions/remove-entity entities :trophy))
(actions/remove-entity entities :trophy)
(actions/talk entities :ego "Thanks!"))
(actions/talk entities :ego "He doesn't need it.")))
:trophy (actions/get-script entities
(walk-to-player entities)

View File

@@ -32,7 +32,7 @@
(spit "save.edn" (entities :state)))
(defn load []
(edn/read-string (slurp "save.edn")))
(assoc (edn/read-string (slurp "save.edn")) :active? true))
(defn get-font [filename]
(let [font (bitmap-font filename)