Mercurial > parpg-source
diff behaviours/base.py @ 50:b4a525456c99
Added talk method to the base behaviour.
author | KarstenBock@gmx.net |
---|---|
date | Thu, 08 Sep 2011 15:17:28 +0200 |
parents | 1bdadb768bcf |
children | 3dfd26b1c7ef |
line wrap: on
line diff
--- a/behaviours/base.py Thu Sep 08 14:30:01 2011 +0200 +++ b/behaviours/base.py Thu Sep 08 15:17:28 2011 +0200 @@ -95,4 +95,18 @@ if(action.getId() != 'stand'): self.idle_counter = 1 else: - self.idle_counter += 1 \ No newline at end of file + self.idle_counter += 1 + + def getLocation(self): + """Get the agents position as a fife.Location object. + @rtype: fife.Location + @return: the location of the agent""" + return self.agent.getLocation() + + + def talk(self, pc): + """Makes the agent ready to talk to the PC + @return: None""" + self.state = _AGENT_STATE_TALK + self.pc = pc.behaviour.agent + self.idle() \ No newline at end of file