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

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]))))