implemented library of items.

This commit is contained in:
2014-10-14 12:57:12 -07:00
parent de2a4f8c7c
commit 2c046134f8
7 changed files with 26 additions and 20 deletions

View File

@@ -1,5 +1,6 @@
(ns advent.screens.rooms.outside-house
(:require [advent.screens.rooms :as rooms]
(:require [advent.screens.items :as items]
[advent.screens.rooms :as rooms]
[advent.actions :as actions]
[advent.utils :as utils]
[clojure.zip :as zip]
@@ -164,23 +165,23 @@
entities
(if ((get-in @entities [:state :inventory]) :wool)
(if (actions/has-item? @entities items/wool)
(actions/talk entities :ego "The sheep has given me enough wool.")
(if (is-sheep-close? @entities)
(do (actions/walk-to entities :ego ego-sheep-loc)
(actions/give entities :wool)
(actions/give entities items/wool)
(actions/talk entities :ego "I guess her wool is shedding."))
(actions/talk entities :ego "She's too far away for me to pet her."))))
:scripts {:wool (actions/get-script entities
:scripts {items/wool (actions/get-script entities
(actions/talk entities :ego "She doesn't need it back."))
:carrot (actions/get-script entities
items/carrot (actions/get-script entities
(actions/walk-to entities :ego ego-sheep-loc)
(actions/talk entities :ego "Come on girl, get the carrot!")
(actions/walk-straight-to entities :sheep [95 150]))
:flask (actions/get-script entities
items/flask (actions/get-script entities
(if (is-sheep-close? @entities)
(do (actions/walk-to entities :ego ego-sheep-loc)
(actions/give entities :flask-with-contents)
(actions/give entities items/flask-with-milk)
(actions/talk entities :ego "Sheeps milk."))
(actions/talk entities :ego "She's too far away.")))}
:left {:walk (utils/flip sheep-walk)