Mercurial > parpg-source
diff objects/action.py @ 44:98f26f7636d8
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 | 7b31de1dc964 |
children | d3a9caba067b |
line wrap: on
line diff
--- a/objects/action.py Tue Sep 06 15:21:36 2011 +0200 +++ b/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: