Mercurial > parpg-source
comparison dialogueactions.py @ 160:75c0b728ccf3
Further work on the scripting system.
author | KarstenBock@gmx.net |
---|---|
date | Sun, 13 Nov 2011 17:19:14 +0100 |
parents | b46afa76d2ef |
children |
comparison
equal
deleted
inserted
replaced
159:1b66e1ce226b | 160:75c0b728ccf3 |
---|---|
92 @type npc_id: basestring | 92 @type npc_id: basestring |
93 @param kwargs: keyword arguments (not used). | 93 @param kwargs: keyword arguments (not used). |
94 @type kwargs: dict of objects | 94 @type kwargs: dict of objects |
95 """ | 95 """ |
96 DialogueAction.__init__(self, *args, **kwargs) | 96 DialogueAction.__init__(self, *args, **kwargs) |
97 self.npc_id = args[0] | |
98 | 97 |
99 def __call__(self, game_state): | 98 def __call__(self, game_state): |
100 """ | 99 """ |
101 Add an NPC to the list of NPCs known by the player. | 100 Add an NPC to the list of NPCs known by the player. |
102 | 101 |
103 @param game_state: variables and functions that make up the current | 102 @param game_state: variables and functions that make up the current |
104 game state. | 103 game state. |
105 @type game_state: dict of objects | 104 @type game_state: dict of objects |
106 """ | 105 """ |
107 npc_id = self.npc_id | 106 npc_id = game_state["npc"].general.identifier |
108 # NOTE Technomage 2010-11-13: This print statement seems overly | 107 # NOTE Technomage 2010-11-13: This print statement seems overly |
109 # verbose, so I'm logging it as an INFO message instead. | 108 # verbose, so I'm logging it as an INFO message instead. |
110 # print("You've met {0}!".format(npc_id)) | 109 # print("You've met {0}!".format(npc_id)) |
111 self.logger.info("You've met {0}!".format(npc_id)) | 110 self.logger.info("You've met {0}!".format(npc_id)) |
112 game_state['meet'](npc_id) | 111 game_state['meet'](npc_id) |