def onCircleClicked(self): if self.client.cursor.x is not False and self.client.party['yourturn']: x = self.client.cursor.x y = self.client.cursor.y z = self.client.cursor.z if self.client.charcard: self.client.charcard.hide() # we clicked an active walkable tile, let's move the character if self.client.party['map']['tiles'][x][y][z].has_key( 'walkablezone'): charid = self.client.party['map']['tiles'][x][y][z][ 'walkablezone'] self.client.clicked_snd.play() dest = (x, y, z) self.client.send.GET_PATH(charid, dest) return # we clicked on a character if self.client.party['map']['tiles'][x][y][z].has_key('char'): charid = self.client.party['map']['tiles'][x][y][z]['char'] self.client.clicked_snd.play() # we clicked on a target, let's attack it! if self.client.party['map']['tiles'][x][y][z].has_key( 'attackablezone'): attackable = self.client.party['map']['tiles'][x][y][z][ 'attackablezone'] self.ignoreAll() if self.client.charbars: self.client.charbars.hide() self.client.actionpreview = GUI.ActionPreview( self.client.party['chars'][attackable], self.client.party['chars'][charid], 16, 99, lambda: GUI.AttackCheck( lambda: self.client.send.ATTACK( attackable, charid), self.client.send. UPDATE_PARTY), self.client.send.UPDATE_PARTY) # we clicked on the currently active character, let's display the menu elif self.client.party['chars'][charid][ 'active'] and self.client.party['yourturn']: self.client.send.UPDATE_PARTY() else: self.client.clicked_snd.play() self.client.send.UPDATE_PARTY()
'ct': 50, 'br': 12, 'fa': 13, } char2 = { 'name': 'Kivy', 'job': 'Kivy', 'team': 1, 'sign': 1, 'sprite': '4A_F_0', 'lv': 15, 'exp': 0, 'hp': 225, 'hpmax': 225, 'mp': 32, 'mpmax': 36, 'ct': 50, 'br': 12, 'fa': 13, } def foo(): pass GUI.ActionPreview(char1, char2, 25, 96, foo, foo) run()