added frankie.

This commit is contained in:
2014-12-30 09:37:10 -08:00
parent 218afe3973
commit 2b283835d0
7 changed files with 225 additions and 12 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

View File

@@ -120,4 +120,5 @@
:spear {:name "Spear" :value :spear :cursor :spear}
:monocle {:name "Monocle" :value :monocle :cursor :monocle}
:feather {:name "Feather" :value :feather :cursor :feather :scripts {:flask-flies-ash (make-finished-component)}}
:spell-component {:name "Spell component" :value :spell-component :cursor :spell-component}})
:spell-component {:name "Spell component" :value :spell-component :cursor :spell-component}
:money {:name "Money" :value :money :cursor :money}})

View File

@@ -13,6 +13,190 @@
(defn make-night [entities]
entities)
(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!"
{:run #(do (actions/respond entities %
:frankie "Not a chance, Faceplant."
:frankie "Burglers like us gotta eat too, you know."
:ego "But it's a matter of life and death! Georgia McGorgeous is counting on me!"
:frankie "Georgia's going steady with me now, Faceplant.")
(actions/play-animation entities :frankie :laugh)
(actions/do-dialogue entities :frankie "You'd be better off if you just packed your bags and left town."
: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."
:frankie "Like you're so different."
:frankie "Am I right boys?")
(actions/play-animation entities :frankie :glance)
(actions/do-dialogue entities
:frankie "We steal gold and diamonds."
:frankie "And you steal teddy bears.")
(actions/play-animation entities :frankie :laugh))
: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])
talk (utils/make-anim "castle-gate/frankie.png" [48 35] 0.2 [2 0 2 0 2 0 2 0 0 1 0])
laugh (utils/make-anim "castle-gate/frankie.png" [48 35] 0.1 [1 3 4 3 4 3 4 3 4 3 4 3 4 1 0])
glance (utils/make-anim "castle-gate/frankie.png" [48 35] 0.25 [0 6 0 6 5 5 5 6 7 7 7 6 ])]
(assoc (animation->texture screen stand)
:x 215 :y 90 :baseline 150
:anim stand
:anim-start 0
:scale-x 1.4
:scale-y 1.4
:talk-color (color 0.6 0.2 0.6 1.0)
:talk talk
:stand stand
:laugh laugh
: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)))
(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])]
(assoc (animation->texture screen stand)
:x 244 :y 102 :baseline 138
:scale-x 1.4
:scale-y 1.4
:anim stand
:anim-start 0
:stand stand)))
(defn make-goon-2 [screen]
(let [stand (utils/make-anim "castle-gate/goon-2.png" [12 32] 0.175 [0 0 0 0 0 0 0 0 0 0 0 0 0 1])]
(assoc (animation->texture screen stand)
:x 208 :y 102 :baseline 138
:scale-x 1.4
:scale-y 1.4
:anim stand
: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]))))
(defn make [screen]
(rooms/make :music {:day :town-2 :night :night}
@@ -24,15 +208,14 @@
(actions/walk-to entities :ego [129 148]))
:cursor :right}
:left-dir {:box [105 93 169 212]
:script (actions/get-script entities
(actions/walk-straight-to entities :ego [157 83])
(actions/transition-background entities :inside-castle [280 145])
(actions/walk-to entities :ego [245 90]))
:script (actions/get-script entities (attempt-walking-through-gate entities))
:cursor :left}}
:layers {:day [(assoc (texture "castle-gate/background.png") :x 0 :y 0 :baseline 0)]
:night [(assoc (texture "castle-gate/background.png") :x 0 :y 0 :baseline 0)]}
:entities {}
:entities {:frankie (make-frankie screen)
:goon-1 (make-goon-1 screen)
:goon-2 (make-goon-2 screen)}
:collision "castle-gate/collision.png"
:scale-fn (utils/scaler-fn-with-baseline 110 0.10 1.30)

View File

@@ -1,6 +1,7 @@
(ns advent.screens.rooms.outside-castle
(:require [advent.screens.items :as items]
[advent.screens.rooms :as rooms]
[advent.screens.rooms.castle-gate :as castle-gate]
[advent.actions :as actions]
[advent.utils :as utils]
[clojure.zip :as zip]
@@ -86,7 +87,7 @@
:ego "Hello there, peddler."
:peddler "Hello again, sir! I trust you are enjoying your goods!"
:ego "I sure am."
:peddler "I thought so!"))
:peddler "I thought so!"))
(defn do-wants-toy-conversation [entities]
(actions/do-dialogue entities
@@ -122,14 +123,42 @@
(defn should-block? [entities]
(and (= :night (get-in @entities [:state :time]))
(actions/has-obtained? entities :spell-component)
(actions/has-one-of? entities [:used-earplugs :glass-eye :motivational-tapes])))
(not (castle-gate/payed-toll? entities))))
(defn block-entrance [entities]
(actions/transition-background entities :castle-gate [340 40])
(actions/walk-straight-to entities :ego [300 45])
(if (get-in @entities [:state :seen-frankie?])
(do
(actions/do-dialogue entities
:frankie "Well, well, well. What have we here boys?"
:frankie "It's good ol' Faceplant again.")
(actions/play-animation entities :frankie :laugh))
(do
(actions/do-dialogue entities :frankie "Well, well, well. What have we here boys?")
(actions/play-animation entities :frankie :glance)
(actions/do-dialogue entities :frankie "It's good ol' Faceplant.")
(actions/play-animation entities :frankie :laugh)
(actions/do-dialogue entities
:ego "Uh, oh. Frankie Rockfist!"
:ego "Listen, I don't want any trouble."
:frankie "Well you found it tonight, Faceplant."
:frankie "Am I right boys?")
(actions/play-animation entities :frankie :glance)
(actions/do-dialogue entities :frankie "You looking for another beat down Faceplant?")
(actions/play-animation entities :frankie :laugh)
(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)))
(actions/update-state entities #(assoc % :seen-frankie? true)))
(defn go-through-gate [entities]
(actions/walk-to entities :ego [82 180])
(if (should-block? entities)
(do (actions/transition-background entities :castle-gate [340 40])
(actions/walk-straight-to entities :ego [300 45]))
(block-entrance entities)
(do
(actions/transition-background entities :inside-castle [280 145])
(actions/walk-to entities :ego [245 90]))))

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])
(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])
(defn cursor [filename which]
(let [scale 2