Ignore:
Timestamp:
11/01/09 21:29:41 (10 years ago)
Author:
orlandov
Message:

Ticket #104 - Patch by Vaporice and or1andov. Integrate quests into game dialogue and make it possible to persist quest state. fixes[s:trac, t:134]

  • Integrate Vaporice's quest engine implementation
  • Discontinue or1andov's sample dialogue and use Zenbitz's Drunkard
  • Reuse Zenbitz's dialogue functions and callbacks in the game PlayerCharacter? class
  • Whitespace and style tweaks
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/game/scripts/objects/actors.py

    r360 r361  
    118118         
    119119        # PC _has_ an inventory, he _is not_ one 
    120         self.inventory = None 
     120        self.inventory = set(('beer',)) 
     121        self.peopleIknow = set() 
    121122         
    122123        self.state = _AGENT_STATE_NONE 
     
    124125        self.createBehaviour(agent_layer) 
    125126     
     127    def meet(self, npc): 
     128        """Record that the PC has met a certain NPC 
     129        @type npc: str 
     130        @param npc: The NPC's name or id""" 
     131        if npc in self.peopleIknow: 
     132            raise RuntimeError("I already know %s" % npc) 
     133        self.peopleIknow.add(npc) 
     134 
     135    def met(self, npc): 
     136        """Indicate whether the PC has met this npc before 
     137        @type npc: str 
     138        @param npc: The NPC's name or id 
     139        @return: None""" 
     140        return npc in self.peopleIknow 
     141 
    126142    def createBehaviour(self, layer): 
    127         """ Creates the behaviour for this actor. 
     143        """Creates the behaviour for this actor. 
    128144            @return None """ 
    129145        self.behaviour = PCBehaviour(self, layer) 
     
    173189        l = fife.Location(self.behaviour.agent.getLocation()) 
    174190        l.setLayerCoordinates(fife.ModelCoordinate(*boxLocation)) 
    175         self.behaviour.agent.move('run', l, self.behaviour.speed) 
    176          
     191        self.behaviour.agent.move('run', l, self.behaviour.speed+1) 
     192 
    177193 
    178194class NPCBehaviour(ActorBehaviour): 
     
    205221            # rl = randint(-1, 1);ud = randint(-1, 1);x += rl;y += ud 
    206222        l = fife.Location(self.agent.getLocation()) 
    207         l.setLayerCoordinates(fife.ModelCoordinate(*tuple([x, y]))) 
     223        l.setLayerCoordinates(fife.ModelCoordinate(x, y)) 
    208224        return l 
    209225 
Note: See TracChangeset for help on using the changeset viewer.