Mercurial > parpg-source
comparison entities/action.py @ 157:79d6b17b80a3
Implemented simple script system.
author | KarstenBock@gmx.net |
---|---|
date | Sat, 12 Nov 2011 16:27:39 +0100 |
parents | 2241722311bf |
children | 04854cf6e1ac |
comparison
equal
deleted
inserted
replaced
156:0655f2f0f3cd | 157:79d6b17b80a3 |
---|---|
42 @type commands: Dictionary | 42 @type commands: Dictionary |
43 """ | 43 """ |
44 self.commands = commands or () | 44 self.commands = commands or () |
45 self.controller = controller | 45 self.controller = controller |
46 self.model = controller.model | 46 self.model = controller.model |
47 self.executed = False | |
47 | 48 |
48 def execute(self): | 49 def execute(self): |
49 """To be overwritten""" | 50 """To be overwritten""" |
50 #Check if there are special commands and execute them | 51 #Check if there are special commands and execute them |
51 for command_data in self.commands: | 52 for command_data in self.commands: |
61 raise NoSuchQuestException | 62 raise NoSuchQuestException |
62 elif command == "ResetMouseCursor": | 63 elif command == "ResetMouseCursor": |
63 self.controller.resetMouseCursor() | 64 self.controller.resetMouseCursor() |
64 elif command == "StopDragging": | 65 elif command == "StopDragging": |
65 data_drag.dragging = False | 66 data_drag.dragging = False |
67 self.executed = True | |
66 | 68 |
67 class ChangeMapAction(Action): | 69 class ChangeMapAction(Action): |
68 """A change map scheduled""" | 70 """A change map scheduled""" |
69 def __init__(self, controller, target_map_name, target_pos, commands=None): | 71 def __init__(self, controller, target_map_name, target_pos, commands=None): |
70 """Initiates a change of the position of the character | 72 """Initiates a change of the position of the character |