comparison gamescenecontroller.py @ 86:a9cc5559ec2a

Move the identifier field from the FifeAgent component to the new General component. Added General Entity.
author KarstenBock@gmx.net
date Sat, 24 Sep 2011 15:48:24 +0200
parents e864b704dd59
children 0411a4bcceee
comparison
equal deleted inserted replaced
85:04af237dde10 86:a9cc5559ec2a
407 def initTalk(self, npc_info): 407 def initTalk(self, npc_info):
408 """ Starts the PlayerCharacter talking to an NPC. """ 408 """ Starts the PlayerCharacter talking to an NPC. """
409 # TODO: work more on this when we get NPCData and HeroData straightened 409 # TODO: work more on this when we get NPCData and HeroData straightened
410 # out 410 # out
411 npc = self.model.game_state.getObjectById( 411 npc = self.model.game_state.getObjectById(
412 npc_info.fifeagent.identifier, 412 npc_info.general.identifier,
413 self.model.game_state.current_map_name 413 self.model.game_state.current_map_name
414 ) 414 )
415 npc_pos = npc.fifeagent.behaviour.getLocation().getLayerCoordinates() 415 npc_pos = npc.fifeagent.behaviour.getLocation().getLayerCoordinates()
416 self.model.game_state.getObjectById("PlayerCharacter").fifeagent.\ 416 self.model.game_state.getObjectById("PlayerCharacter").fifeagent.\
417 behaviour.approach([npc_pos.x, 417 behaviour.approach([npc_pos.x,
428 obj = self.model.game_state.\ 428 obj = self.model.game_state.\
429 getObjectById(obj_id, 429 getObjectById(obj_id,
430 self.model.game_state.current_map_name) 430 self.model.game_state.current_map_name)
431 obj_pos = obj.fifeagent.behaviour.getLocation().getLayerCoordinates() 431 obj_pos = obj.fifeagent.behaviour.getLocation().getLayerCoordinates()
432 player = self.model.game_state.getObjectById("PlayerCharacter") 432 player = self.model.game_state.getObjectById("PlayerCharacter")
433 is_player = obj.fifeagent.identifier == player.fifeagent.identifier 433 is_player = obj.general.identifier == player.general.identifier
434 434
435 435
436 #TODO: Check all actions to be compatible with the grease components 436 #TODO: Check all actions to be compatible with the grease components
437 if obj is not None: 437 if obj is not None:
438 if obj.dialogue and not is_player: 438 if obj.dialogue and not is_player: