Mercurial > parpg-source
changeset 50:b4a525456c99
Added talk method to the base behaviour.
author | KarstenBock@gmx.net |
---|---|
date | Thu, 08 Sep 2011 15:17:28 +0200 |
parents | 4f9747116061 |
children | d3a9caba067b |
files | behaviours/base.py |
diffstat | 1 files changed, 15 insertions(+), 1 deletions(-) [+] |
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