diff src/parpg/objects/action.py @ 69:ad75fa042b99

Changes to make PARPG "runable" with grease. (With the correct modified assets)
author KarstenBock@gmx.net
date Tue, 06 Sep 2011 15:22:51 +0200
parents 8b3890f17f94
children c25c734bd2a7
line wrap: on
line diff
--- a/src/parpg/objects/action.py	Tue Sep 06 15:21:36 2011 +0200
+++ b/src/parpg/objects/action.py	Tue Sep 06 15:22:51 2011 +0200
@@ -289,7 +289,7 @@
     def execute(self):
         """Talk with the NPC when close enough, otherwise move closer.
            @return: None"""
-        player_char = self.model.game_state.player_character
+        player_char = self.model.game_state.getObjectById("PlayerCharacter").fifeagent
         npc_coordinates = self.npc.getLocation().getLayerCoordinates()
         pc_coordinates = player_char.behaviour.agent.\
                             getLocation().getLayerCoordinates()
@@ -320,8 +320,8 @@
             else:
                 self.npc.behaviour.agent.say("Leave me alone!", 1000)
                 
-            self.model.game_state.player_character.behaviour.idle()
-            self.model.game_state.player_character.nextAction = None
+            self.model.game_state.getObjectById("PlayerCharacter").fifeagent.behaviour.idle()
+            self.model.game_state.getObjectById("PlayerCharacter").fifeagent.nextAction = None
             super(TalkAction, self).execute()
 
 class UseAction(Action):
@@ -369,7 +369,7 @@
     def execute(self):
         real_item = self.map_item.item
         self.model.deleteObject(self.map_item.ID)
-        self.model.game_state.player_character.\
+        self.model.game_state.getObjectById("PlayerCharacter").fifeagent.\
                                 inventory.placeItem(real_item)
         self.view.hud.inventory.updateInventoryButtons()
         super(PickUpAction, self).execute()
@@ -387,7 +387,7 @@
         map_item_values["ObjectType"] = "MapItem"
         map_item_values["ItemType"] = self.item.item_type
         map_item_values["Map"] = map_name
-        coords = self.model.game_state.player_character.\
+        coords = self.model.game_state.getObjectById("PlayerCharacter").fifeagent.\
                                         getLocation().getExactLayerCoordinates()
         map_item_values["Position"] = (coords.x, coords.y)
         map_item_values["Rotation"] = 0
@@ -424,7 +424,7 @@
         has_fruit = False
         has_wood = False
         has_bottle = False
-        player_character = self.model.game_state.player_character
+        player_character = self.model.game_state.getObjectById("PlayerCharacter").fifeagent
         for item in self.pot.items.itervalues():
             if item.item_type == "Questionable water":
                 if has_water: