diff src/parpg/behaviours/base.py @ 77:8a7bb62f9f5d

Added talk method to the base behaviour.
author KarstenBock@gmx.net
date Thu, 08 Sep 2011 15:17:28 +0200
parents c3350fc9cd45
children 62cff91a19cb
line wrap: on
line diff
--- a/src/parpg/behaviours/base.py	Thu Sep 08 14:30:01 2011 +0200
+++ b/src/parpg/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