Mercurial > parpg-source
comparison behaviours/npc.py @ 48:1bdadb768bcf
Added approach functionality to the BaseBehaviour
author | KarstenBock@gmx.net |
---|---|
date | Thu, 08 Sep 2011 14:20:31 +0200 |
parents | dd9bd93ec81c |
children | 8b1ad2d342d8 |
comparison
equal
deleted
inserted
replaced
47:dd9bd93ec81c | 48:1bdadb768bcf |
---|---|
64 | 64 |
65 def onInstanceActionFinished(self, instance, action): | 65 def onInstanceActionFinished(self, instance, action): |
66 """What the NPC does when it has finished an action. | 66 """What the NPC does when it has finished an action. |
67 Called by the engine and required for InstanceActionListeners. | 67 Called by the engine and required for InstanceActionListeners. |
68 @type instance: fife.Instance | 68 @type instance: fife.Instance |
69 @param instance: self.agent (the NPC listener is listening for this | 69 @param instance: self.agent |
70 instance) | |
71 @type action: ??? | 70 @type action: ??? |
72 @param action: ??? | 71 @param action: ??? |
73 @return: None""" | 72 @return: None""" |
74 if self.state == base._AGENT_STATE_WANDER: | 73 if self.state == base._AGENT_STATE_WANDER: |
75 self.target_loc = self.getTargetLocation() | 74 self.target_loc = self.getTargetLocation() |
76 self.idle() | 75 BaseBehaviour.onInstanceActionFinished(self, instance, action) |
77 | 76 |
78 | 77 |
79 def idle(self): | 78 def idle(self): |
80 """Controls the NPC when it is idling. Different actions | 79 """Controls the NPC when it is idling. Different actions |
81 based on the NPC's state. | 80 based on the NPC's state. |