small progress.

This commit is contained in:
2015-01-03 14:36:44 -08:00
parent 9d3772b976
commit 57492617f7
9 changed files with 120 additions and 9 deletions

View File

@@ -17,6 +17,16 @@
(actions/walk-to entities :ego [268 61] :face :left))
(defn drop-walkie-talkie [entities]
(actions/talk entities :ego "I'll drop one of these off in here.")
(actions/walk-to entities :ego [155 64])
(actions/walk-straight-to entities :ego [106 18] :face :left)
(actions/play-animation entities :ego :squat)
(actions/remove-item entities :walkie-talkies)
(actions/give entities :walkie-talkie)
(actions/walk-straight-to entities :ego [155 64]))
(defn present-frankie-choices [entities]
(actions/present-choices entities {:choices ["Please, Frankie. Give me my stuff back!"
@@ -97,7 +107,10 @@
:stand stand)))
(defn attempt-walking-through-gate [entities]
(actions/walk-to entities :ego [157 83])
(actions/transition-background entities :inside-castle [280 145])
(actions/walk-to entities :ego [245 90]))
(defn make [screen]
@@ -111,7 +124,9 @@
:cursor :right}
:left-dir {:box [105 93 169 212]
:script (actions/get-script entities (attempt-walking-through-gate entities))
:cursor :left}}
:cursor :left}
:big-tree {:box [20 10 82 235]
:scripts {:walkie-talkies (actions/get-script entities (drop-walkie-talkie entities))}}}
: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)]}

View File

@@ -213,6 +213,24 @@
(when (get-in @entities [:room :entities :ladder])
(actions/talk entities :ego "I'll get down.")
(get-down entities)))})))}}
:rock {:box [62 83 101 103]
:script (actions/get-script entities
(when (and (actions/has-obtained? entities :note-1)
(not (actions/has-obtained? entities :walkie-talkies)))
(actions/walk-to entities :ego [85 99])
(actions/play-animation entities :ego :squat)
(actions/do-dialogue entities
:ego "Hey! A little lever."
:ego "I think this is Gandarf's stash of helpful stuff.")
(actions/play-animation entities :ego :squat)
(actions/give entities :flashlight)
(actions/do-dialogue entities :ego "What is this?")
(actions/play-animation entities :ego :squat)
(actions/give entities :camera)
(actions/do-dialogue entities :ego "These are all really strange devices.")
(actions/play-animation entities :ego :squat)
(actions/give entities :walkie-talkies)
(actions/do-dialogue entities :ego "I wonder what all of these magic devices do.")))}
:grass {:box [26 105 60 160]
:script (actions/get-script entities
(if (not (actions/has-item? entities :grass))
@@ -313,5 +331,6 @@
entities)
(if (= :night (get-in entities [:state :time]))
(make-night entities)
entities)))
(utils/remove-interaction :rock)
)))
:start-pos [203 1])))

View File

@@ -52,4 +52,47 @@
: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 "'P.S., Guard that slingshot with your life!'"))
:ego "'P.S., Guard that slingshot with your life!'"
:ego "'P.P.S., If anything goes wrong, you can look for supplies behind a nearby r...'"
:ego "It just cuts off there."))
(defn read-note-2 [entities]
(actions/do-dialogue entities
:ego "It's another note from Gandarf. It's written on the back of a bingo card. It reads:"
:ego "'Boy, the situation is dire. I don't have much time. Please hurry.'"
:ego "'We've been forced into playing bingo for the last 3 hours.'"
:ego "'You are almost done with the spell to restore magic to The Slinger's Shot.'"
:ego "'You haven't lost it, right?'"
:ego "'You need to add the root of all evil to the cauldron.'"
:ego "'Also, you'll need to add a split second.'"
:ego "'Then, dip the Slinger's Shot in to complete the spell.'"))
(defn listen-1 [entities]
(actions/talk entities :ego "Did you see the look on Faceplant's face when we took his stuff?" :animate? false :stop? false)
(actions/talk entities :ego "It looked like he was about to pee his pants." :animate? false :stop? false)
(actions/talk entities :ego "Am I right boys?" :animate? false :stop? false))
(defn listen-2 [entities]
(actions/talk entities :ego "Hey Bubba, did you put our spoils in our secret stash yet?" :animate? false :stop? false)
(actions/talk entities :ego "You don't remember where it's at?" :animate? false :stop? false)
(actions/talk entities :ego "It's right outside the jail." :animate? false :stop? false)
(actions/talk entities :ego "You just have to pull the secret lever." :animate? false :stop? false)
(actions/update-state entities #(assoc % :knows-about-stash? true :stop? false)))
(defn listen-3 [entities]
(actions/talk entities :ego "We're going to be rich after we fence this stuff we've stolen." :animate? false :stop? false)
(actions/talk entities :ego "Am I right boys?" :animate? false :stop? false))
(defn listen-to-frankie [entities]
(if (get-in @entities [:room :entities :frankie])
(do
(actions/play-animation entities :ego :reach-up :stop? false)
(Thread/sleep 1000)
(actions/play-animation entities :ego :reach-down :stop? false)
(actions/talk entities :ego "I don't hear anything in it."))
(do
(actions/talk entities :ego "I'll just give it a listen.")
(actions/play-animation entities :ego :reach-up :stop? false)
((rand-nth [listen-1 listen-2 listen-3]) entities)
(actions/play-animation entities :ego :reach-down))))

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.common :as common]
[advent.screens.rooms.castle-gate :as castle-gate]
[advent.actions :as actions]
[advent.utils :as utils]
@@ -196,7 +197,7 @@
: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 "Look like we hit the jackpot tonight boys!")
(frankie-comment-on-item entities)
(actions/give entities :money)
(actions/do-dialogue entities
@@ -227,11 +228,20 @@
(actions/transition-background entities :inside-castle [280 145])
(actions/walk-to entities :ego [245 90]))))
(defn add-note-if-necessary [entities]
(if (and (actions/has-obtained? entities :spell-component)
(not (actions/has-item? entities :spell-component))
(not (actions/has-obtained? entities :note-2)))
(update-in entities [:room :entities] #(assoc % :note (get-in entities [:room :note])))
entities))
(defn make-night [entities]
(-> entities
(update-in [:room :entities] #(dissoc % :peddler))
(update-in [:room :entities] #(dissoc % :balloons))
(utils/remove-interaction :wares)))
(utils/remove-interaction :wares)
add-note-if-necessary))
(defn make [screen]
(let [peddler-sheet (texture! (texture "outside-castle/peddler-talk.png" ) :split 18 36)
@@ -355,6 +365,12 @@
(actions/play-animation entities :ego :squat)
(actions/give entities :flies)
(actions/talk entities :ego "Hopefully they won't fly out of my backpack."))})}
:note (rooms/make-entity :note (assoc (texture "outside-castle/note.png")
:x 198 :y 66 :baseline 174
:script (actions/get-script entities
(actions/walk-to entities :ego [210 79] :face :left)
(actions/play-animation entities :ego :squat)
(common/read-note-2 entities))))
:collision "outside-castle/collision.png"
:scale-fn (utils/scaler-fn-with-baseline 110 0.10 1.00)
:start-pos [310 80]