def character_spells_action(self, user_name): character = self.online_users[user_name].character locale = self.online_users[user_name].locale return Action(202, { "spells" : spells_manager.get_spells(character, locale), "spells_to_learn" : spells_manager.get_spells_to_learn(character, locale), "substance_name" : smarty.get_substance_name(character.class_id, locale) })
def div_args(self, user_name, skirmish_users): user = skirmish_users[user_name] actions = list() count = smarty.get_attack_count(user.battle_character.class_id, user.battle_character.level) for i in range(count): actions.append((0, user.locale.translate(smarty.main_abilities[0]))) count = smarty.get_defence_count(user.battle_character.class_id, user.battle_character.level) for i in range(count): actions.append((1, user.locale.translate(smarty.main_abilities[1]))) count = smarty.get_spell_count(user.battle_character.class_id, user.battle_character.level) for i in range(count): actions.append((2, smarty.get_ability_name(user.battle_character.class_id, user.locale))) actions.append((3, smarty.get_substance_name(user.battle_character.class_id, user.locale))) return { "actions" : actions, "spells" : spells_manager.get_spells(user.battle_character, user.locale) }