improving the story a bit.

This commit is contained in:
2015-01-01 11:04:17 -08:00
parent 1ee46df3f1
commit 9d3772b976
9 changed files with 97 additions and 124 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

After

Width:  |  Height:  |  Size: 8.7 KiB

View File

@@ -123,4 +123,5 @@
:spell-component {:name "Spell component" :value :spell-component :cursor :spell-component}
:money {:name "Money" :value :money :cursor :money}
:watch {:name "Watch" :value :watch :cursor :watch}
:broken-watch {:name "Halved watch" :value :broken-watch :cursor :broken-watch}})
:broken-watch {:name "Halved watch" :value :broken-watch :cursor :broken-watch}
:slingshot {:name "The Slinger's Shot" :value :slingshot :cursor :slingshot}})

View File

@@ -16,11 +16,10 @@
(defn walk-to-frankie [entities]
(actions/walk-to entities :ego [268 61] :face :left))
(defn payed-toll? [entities]
(not (actions/has-one-of? entities [:used-earplugs :glass-eye :motivational-tapes])))
(defn present-frankie-choices [entities]
(actions/present-choices entities {:choices ["Please, Frankie. Let me through!"
(actions/present-choices entities {:choices ["Please, Frankie. Give me my stuff back!"
{:run #(do (actions/respond entities %
:frankie "Not a chance, Faceplant."
:frankie "Burglers like us gotta eat too, you know."
@@ -31,12 +30,7 @@
:frankie "Ain't that right boys?")
(actions/play-animation entities :frankie :glance))
:choices actions/previous-choices}
"Toll?"
{:run #(actions/respond entities %
:frankie "That's right."
:frankie "Hand over all of your valuables. Gold coins, precious gems, etc."
:frankie "We've got mouths to feed.")
:choices actions/previous-choices}
"You guys are nothing but a bunch of crooks!"
{:run #(do (actions/respond entities %
:frankie "Oh please, Faceplant."
@@ -44,98 +38,22 @@
:frankie "Am I right boys?")
(actions/play-animation entities :frankie :glance)
(actions/do-dialogue entities
:frankie "We steal gold and diamonds."
:frankie "We steal gold, diamonds, and relic slingshots."
:frankie "And you steal teddy bears.")
(actions/play-animation entities :frankie :laugh))
:choices actions/previous-choices}
"Where is your secret stash?"
{:run #(do (actions/respond entities % :frankie "Like I'd ever tell you, Faceplant.")
(actions/play-animation entities :frankie :laugh)
(actions/do-dialogue entities :frankie "That's only for people in the 'Super secret cool club'!"))
:choices actions/previous-choices}
"Nevermind."
{:run #(actions/respond entities % :frankie "Come back when you've got some good valuables.")}]}))
(defn give-item-to-frankie [item]
(condp = item
:trophy (actions/get-script entities
(walk-to-frankie entities)
(if (payed-toll? entities)
(actions/talk entities :frankie "Faceplant, I can't thank you enough.")
(actions/do-dialogue entities :ego "How about this gold trophy, Frankie? Will you let me through?"
:frankie "That's not gold!"
:frankie "Ha ha ha!"
:frankie "That's made out of brass dummy.")))
:medal (actions/get-script entities
(walk-to-frankie entities)
(if (payed-toll? entities)
(actions/talk entities :frankie "Faceplant, I can't thank you enough.")
(actions/do-dialogue entities :ego "How about this gold medal, Frankie?"
:frankie "Faceplant. Your stupidity knows no limits."
:frankie "That's a plastic medal.")))
:glass-eye (actions/get-script entities
(walk-to-frankie entities)
(actions/do-dialogue entities
:ego "How about this glass eye Frankie?"
:ego "It's the choicest of glass eyes."
:frankie "Let me see that!")
(actions/remove-item entities :glass-eye)
(actions/do-dialogue entities
:frankie "It IS the choicest of glass eyes!"
:frankie "It's the choicest glass eye I've ever seen!"
:frankie "It must be made of the choicest glass, from across the sea!"
:frankie "Wow! Faceplant this is great!"
:frankie "I could fetch some real good dough for this."
:frankie "What would you say boys?")
(actions/play-animation entities :frankie :glance)
(actions/do-dialogue entities
:frankie "95 sheckles?"
:frankie "Faceplant, you are too kind. This is too generous."
:frankie "We can't send you out empty handed."
:frankie "Here, take this small cut.")
(actions/give entities :money))
:used-earplugs (actions/get-script entities
(actions/walk-to entities :ego [268 61])
(actions/do-dialogue entities :ego "How about these choice used earplugs, Frankie?"
:frankie "Let me see them!")
(actions/remove-item entities :used-earplugs)
(actions/do-dialogue entities
:frankie "Wow! They ARE the choicest of earplugs!"
:frankie "Faceplant this is great!"
:frankie "I could fetch some real good dough for them."
:frankie "What would you say boys? ")
(actions/play-animation entities :frankie :glance)
(actions/do-dialogue entities
:frankie "10 sheckels?"
:frankie "Faceplant, you are too kind. This is too generous."
:frankie "We can't send you out empty handed."
:frankie "Here, take this small cut.")
(actions/give entities :money))
:motivational-tapes (actions/get-script entities
(walk-to-frankie entities)
(actions/do-dialogue entities :ego "How about these choice motivational tapes, Frankie?"
:frankie "Let me see them!")
(actions/remove-item entities :motivational-tapes)
(actions/do-dialogue entities
:frankie "Wow! They ARE the choicest of motivational-tapes!"
:frankie "Faceplant this is great!"
:frankie "I could be motivated to turn away from this life of crime!" :frankie "Or, I could fetch some real good dough for them."
)
(actions/play-animation entities :frankie :laugh)
(actions/do-dialogue entities :frankie "What would you say boys? ")
(actions/play-animation entities :frankie :glance)
(actions/do-dialogue entities
:frankie "3 easy payments of 29.99 sheckels?"
:frankie "Faceplant, you are too kind. This is too generous."
:frankie "We can't send you out empty handed."
:frankie "Here, take this small cut.")
(actions/give entities :money))
(actions/get-script entities
(walk-to-frankie entities)
(if (payed-toll? entities)
(actions/talk entities :frankie "Faceplant, I can't thank you enough.")
(do
(actions/do-dialogue entities :ego "How about this Frankie?"
:frankie "Ha! Don't make me laugh."
:frankie "Right boys?")
(actions/play-animation entities :frankie :glance))))))
(defn make-frankie [screen]
(let [stand (utils/make-anim "castle-gate/frankie.png" [48 35] 0.19 [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1])
@@ -155,11 +73,8 @@
:glance glance
:script (actions/get-script entities
(walk-to-frankie entities)
(if (payed-toll? entities)
(actions/talk entities :frankie "Faceplant, I can't thank you enough.")
(do (actions/talk entities :ego "Listen, Frankie...")
(present-frankie-choices entities))))
:scripts give-item-to-frankie)))
(actions/talk entities :ego "Listen, Frankie...")
(present-frankie-choices entities)))))
(defn make-goon-1 [screen]
(let [stand (utils/make-anim "castle-gate/goon-1.png" [12 33] 0.21 [0 0 0 0 0 0 0 0 0 1])]
@@ -181,20 +96,7 @@
:anim-start 0
:stand stand)))
(defn attempt-walking-through-gate [entities]
(if (payed-toll? entities)
(do
(actions/walk-straight-to entities :ego [157 83])
(actions/transition-background entities :inside-castle [280 145])
(actions/walk-to entities :ego [245 90]))
(do
(actions/walk-straight-to entities :ego [220 55])
(actions/do-dialogue entities :frankie "Not so fast."
:frankie "Not without paying the toll.")
(actions/play-animation entities :frankie :laugh)
(actions/talk entities :frankie "Right boys?")
(actions/play-animation entities :frankie :glance)
(actions/walk-straight-to entities :ego [250 50]))))

View File

@@ -43,12 +43,13 @@
:ego "'Boy, I have been kidnapped by Blergh.'"
:ego "'He's got me locked up in his fortress of doom.'"
:ego "'It's actually pretty comfortable, despite the name.'"
:ego "'But you must hurry.'"
:ego "'You must cast the spell to restore magic to the Slinger's Shot yourself.'"
:ego "'You still do have The Slinger's Shot, don't you?'"
:ego "'I will do my best to help you along the way.'"
:ego "'You will need to add to your flask the ashes of magic, and the sound of buzzing.'"
:ego "'Then stir with the gift of flight.'"
:ego "'Then pour the contents in the cauldron.'"
:ego "'I will give you more instructions when I can.'"
:ego "'And please hurry, because we're being forced into a karaoke competition.'"
:ego "'I'm about at my witt's end.'"))
:ego "'I'm about at my witt's end.'"
:ego "'P.S., Guard that slingshot with your life!'"))

View File

@@ -368,7 +368,7 @@
:scale-fn (utils/scaler-fn-from-image "inside-castle/scale.png" 0.25 1.00)
:apply-state (fn [entities]
(as-> entities entities
(if (actions/has-item? entities :trophy)
(if (actions/has-obtained? entities :trophy)
(update-in entities [:room :entities] #(dissoc % :trophy))
entities)
(if (actions/has-item? entities :sword)

View File

@@ -122,8 +122,41 @@
(defn should-block? [entities]
(and (= :night (get-in @entities [:state :time]))
(actions/has-obtained? entities :spell-component)
(not (castle-gate/payed-toll? entities))))
(actions/has-obtained? entities :flask-2)))
(defn frankie-comment-on-item [entities]
(cond
(actions/has-item? entities :glass-eye) (do
(actions/remove-item entities :glass-eye)
(actions/do-dialogue entities
:frankie "And how about that? A glass eye."
:frankie "And not only that, it's the choicest of glass eyes!"
:frankie "It must be made of the choicest glass, from across the sea!"
:frankie "This'll be perfect for when I punch your eye out Faceplant."
:frankie "Or, I could fetch some real good dough for this."
:frankie "What would you say boys?")
(actions/play-animation entities :frankie :glance)
(actions/do-dialogue entities :frankie "95 sheckles?"))
(actions/has-item? entities :used-earplugs) (do
(actions/remove-item entities :used-earplugs)
(actions/do-dialogue entities
:frankie "And how about that? Some used earplugs."
:frankie "Wow! These are the choicest of earplugs!"
:frankie "They're great for tuning out your voice, Faceplant!"
:frankie "But, I could fetch some real good dough for them."
:frankie "What would you say boys? ")
(actions/play-animation entities :frankie :glance)
(actions/do-dialogue entities :frankie "10 sheckels?"))
(actions/has-item? entities :motivational-tapes) (do
(actions/remove-item entities :motivational-tapes)
(actions/do-dialogue entities
:frankie "And how about that? Some used earplugs."
:frankie "Wow! These are the choicest of earplugs!"
:frankie "They're great for tuning out your voice, Faceplant!"
:frankie "But, I could fetch some real good dough for them."
:frankie "What would you say boys? ")
(actions/play-animation entities :frankie :glance)
(actions/do-dialogue entities :frankie "3 easy payments of 29.99 sheckles?"))))
(defn block-entrance [entities]
(actions/transition-background entities :castle-gate [340 40])
@@ -150,8 +183,39 @@
(actions/do-dialogue entities
:ego "I'm just passing through..."
:frankie "Not tonight you're not."
:frankie "Unless, of course, you can pay the toll.")
(castle-gate/present-frankie-choices entities)))
:frankie "Unless, of course, you can pay the toll."
:frankie "Come here, faceplant."
:ego "Umm, err, I'd rather not."
:frankie "I said, come here."
:frankie "Now.")
(actions/walk-straight-to entities :ego [254 80])
(actions/do-dialogue entities
:frankie "Now what have we got to give us today, Faceplant?"
:frankie "A strength potion, oh very nice!"
:frankie "And some gold..."
:frankie "And what's this?"
:frankie "The Slinger's Shot?"
:ego "No, not the Slinger's Shot!"
:franki "Look like we hit the jackpot tonight boys!")
(frankie-comment-on-item entities)
(actions/give entities :money)
(actions/do-dialogue entities
:frankie "Here's a little tip for your troubles, Faceplant."
:frankie "Bubba, put this stuff in the secret stash."
:frankie "Now move along, Faceplant."
:frankie "Before we decide to take all of your stuff."
:ego "But I need that slingshot!"
:frankie "Too bad. Move along.")
(actions/remove-item entities :flask-1-strength)
(actions/remove-item entities :medal)
(actions/remove-item entities :trophy)
(actions/remove-item entities :slingshot)
(actions/walk-to entities :ego [181 79])
(actions/do-dialogue entities
:ego "Now what am I going to do?"
:ego "How will I break the news to Gandarf that I lost the Slinger's Shot?"
:ego "My sweet Georgia McGorgeous, I will find a way to save you!")))
(actions/update-state entities #(assoc % :seen-frankie? true)))

View File

@@ -133,19 +133,24 @@
:wizard "There's only one way to neutralize it:"
:wizard "The Slinger's Shot."
:wizard "It's a magical slingshot that has long lost its power."
:wizard "Here, take it.")
(actions/give entities :slingshot)
(actions/do-dialogue entities
:wizard "Whatever happens, do not lose that slingshot!"
:wizard "You and me, boy, we're going to return it to its powerful state."
:wizard "Then you can beat Blergh, come sunrise."
:wizard "Now, time is of the essence."
:wizard "Take this flask. Fill it with water from the fountain.")
:wizard "Take this flask. Fill it with water from the fountain."
:wizard "And remember. Don't lose the slingshot.")
(actions/give entities :flask-2))))
(defn add-wizard-if-necessary [entities]
(if (actions/has-obtained? entities :flask-water)
(if (actions/has-obtained? entities :money)
entities
(update-in entities [:room :entities] #(assoc % :wizard (get-in entities [:room :wizard])))))
(defn add-note-if-necessary [entities]
(if (and (actions/has-obtained? entities :flask-water)
(if (and (actions/has-obtained? entities :money)
(not (actions/has-obtained? entities :note-1)))
(update-in entities [:room :entities] #(assoc % :note (get-in entities [:room :note])))
entities))

View File

@@ -14,7 +14,7 @@
(let [{:keys [x y]} (input->screen screen {:x (:input-x screen) :y (:input-y screen)})]
(println (:input-x screen) (:input-y screen) "->" x y)))
(def +all-cursors+ [:main :wool :mushrooms :carrot :right :down :left :up :flask :flask-with-contents :trophy :ladder :stick :cat-toy :balloon :frog-legs :teddy :portrait :recipe :glass-eye :motivational-tapes :used-earplugs :grass :slobber :flask-with-strength :medal :kiss :sword :hourglass :mandrake :ball-n-chain :key :rope :crowbar :note-1 :ash :sack-lunch :flies :spear :monocle :feather :spell-component :money :watch :broken-watch])
(def +all-cursors+ [:main :wool :mushrooms :carrot :right :down :left :up :flask :flask-with-contents :trophy :ladder :stick :cat-toy :balloon :frog-legs :teddy :portrait :recipe :glass-eye :motivational-tapes :used-earplugs :grass :slobber :flask-with-strength :medal :kiss :sword :hourglass :mandrake :ball-n-chain :key :rope :crowbar :note-1 :ash :sack-lunch :flies :spear :monocle :feather :spell-component :money :watch :broken-watch :slingshot])
(defn cursor [filename which]
(let [scale 2