Changeset 179:a7cdf8458edd


Ignore:
Timestamp:
04/06/11 17:39:46 (12 years ago)
Author:
Adrianna Pińska <adrianna.pinska@…>
Branch:
default
Phase:
public
Rebase:
30393933363963386166363862626565393564613436306636623163633333656335643031663737
Message:

ichiro and hattori, plus stuff for querying npc state from the world

Files:
2 added
1 edited

Legend:

Unmodified
Added
Removed
  • skaapsteker/dialogue.py

    r171 r179  
    1616       """
    1717
    18     def __init__(self, json_filename, world):
     18    def __init__(self, npc_name, world):
    1919        self.world = world
     20        world.npcs[npc_name] = self
    2021        self.state = "start"
    2122        self.states = AttrDict()
    22         src = json.loads(data.load(json_filename).read())
     23        src = json.loads(data.load('npcs/' + npc_name + '.json').read())
    2324        for state, state_src in src.iteritems():
    2425            pseudo_path = [json_filename, state]
     
    125126        self._fox_is_disguised = False
    126127
     128        self._fire_started = False
     129
     130        self.npcs = {}
     131
    127132    def fox_has_tea(self):
    128133        return self._fox_has_tea
     
    134139        return self._fox_is_disguised
    135140
     141    def fire_started(self):
     142        return self._fire_started
     143
     144    def npc_is(self, npc_name, state):
     145        return self.npcs[npc_name].state == state
Note: See TracChangeset for help on using the changeset viewer.