def activate(self, action=None): rats = self.hp - self.actor.hp for i in range(rats): standart_actions.Custom(self.call_rat, order=51, actor=self.actor) self.hp = self.actor.hp if self.actor.fight.turn > (self.rat_number + 1) * 5: standart_actions.Custom(self.call_rat, order=51, actor=self.actor)
def start_special_action(self, info): if len(info) > 4: standart_actions.Custom(self.activate_special_action, info[-1], order=self.order, unit=self.unit) self.unit.end_turn() else: self.unit.active = True self.ask_options()
def start_special_action(self, info, types=None): target = self.unit.fight[info[-1]] standart_actions.Custom(self.activate_special_action, target, order=self.order, unit=self.unit, types=types)
def __init__(self, actor): Status.__init__(self, actor) self.unit.lost_weapon = self.unit.weapon self.unit.weapon = self.unit.default_weapon self.additional_buttons_actions = [('pick-up', self.finish, localization.LangTuple('statuses_weapon-loss', 'damage'))] self.handle_dict['pick-up'] = self.finish standart_actions.Custom(self.string, 'use', order=30, unit=self.unit, format_dict={'actor': self.unit.name})
def activate(self, action=None): hp_delta = self.unit.hp_delta if max(team.get_dmg() for team in self.unit.fight.teams) == self.unit.team.get_dmg(): self.unit.hp_delta - (bool(self.unit.dmg_received) + self.unit.dmg_received // self.unit.toughness) if hp_delta <= -self.unit.hp and self.ready_turn <= self.unit.fight.turn: self.unit.hp_delta += 1 - hp_delta - self.unit.hp standart_actions.Custom(self.string, 'use', unit=self.unit, format_dict={'actor': self.unit.name}) self.ready_turn = self.unit.fight.turn + self.cd
def start_special_action(self, info): self.unit.target = self.unit.fight[info[-1]] if self.special_available(target=self.unit.target): self.unit.fight.edit_queue(standart_actions.SpecialAttack(unit=self.unit, fight=self.unit.fight, info=info, order=self.order, energy_cost=self.special_energy_cost)) self.unit.fight.edit_queue(standart_actions.Custom(self.unit.waste_energy, self.special_energy_cost, unit=self.unit)) else: self.unit.fight.edit_queue(standart_actions.Attack(unit=self.unit, fight=self.unit.fight, info=info))
def activate(self, action=None): if any(unit.target == self.unit and 'attack' in unit.action for unit in self.unit.targets()) and self.unit.dmg_received == 0: if 'shield' in self.unit.action or 'dodge' in self.unit.action or 'defense' in self.unit.action: standart_actions.Custom(self.string, 'use', order=60, format_dict={'actor': self.unit.name}, unit=self.unit) self.activated_round = self.unit.fight.turn + 1
def activate_special_action(self, target=None): self.on_cd() targets = [target for target in self.targets() if any('attack' in action.action_type for action in target.actions()) and target.target == self.unit] if targets: standart_actions.Custom(self.counterattack, targets[0], order=10, unit=self.unit) else: standart_actions.AddString(localization.LangTuple(self.table_row, 'special_1_miss', format_dict={'actor': self.unit.name}), order=0, unit=self.unit) self.unit.waste_energy(self.special_energy_cost)
def __init__(self, actor): if 'animal' not in actor.types: return if 'prone' not in actor.disarmed: actor.disarmed.append('prone') if 'prone' not in actor.rooted: Status.__init__(self, actor) actor.rooted.append('prone') setattr(actor, 'evasion', getattr(actor, 'evasion') - 5) self.unit.boost_attribute('evasion', - 5) self.additional_buttons_actions = [('free', self.finish, localization.LangTuple('buttons', 'get_up'))] self.handle_dict['free'] = self.finish standart_actions.Custom(self.string, 'use', order=30, unit=self.unit, format_dict={'actor': self.unit.name})
def add_action(self, func, *args, order=5, to_queue=True, types=None, **kwargs): standart_actions.Custom(func, *args, order=order, to_queue=to_queue, unit=self, types=types, **kwargs)
def start_special_action(self, info, types=None): if len(info) > 4: self.melee = False self.unit.target = self.unit.fight[info[-1]] standart_actions.Custom(self.activate_special_action, info, order=self.order, unit=self.unit, types=self.special_types) self.unit.end_turn() self.on_cd() else: self.unit.active = True self.ask_options()
def receive_hit(self, action): # Применение брони if action.dmg_done > 0: self.activate_statuses('receive_hit', action=action) if action.dmg_done > 0 and action.blockable: armor_data = self.activate_armor(action) if armor_data[0] >= action.dmg_done: if not action.stringed and action.armor_string_alt: standart_actions.Custom(armor_data[1].string, 'use', order=19, unit=self, format_dict={ 'actor': self.name, 'dmg': action.dmg_done }) action.dmg_blocked = action.dmg_done action.dmg_done = 0 action.armored = armor_data[1] self.activate_abilities('receive_hit', action)
def start_special_action(self, info): standart_actions.Custom(self.activate_special_action, order=self.order, unit=self.unit)
def act(self, action): self.actor.change_weapon() self.turn_used = self.actor.fight.turn standart_actions.Custom(self.to_string, actor=self.actor, order=0) self.ask_action()
def act(self, action=None): standart_actions.Custom(self.set_hp, order=40, actor=self.actor) self.actor.fight.action_queue.append(self)
def act(self, action=None): standart_actions.Custom(self.set_hp, order=40, unit=self.unit) self.unit.fight.action_queue.append(self)
def __init__(self, actor, turns=1): self.turns = turns if 'stun' not in actor.disabled: actor.disabled.append('stun') Status.__init__(self, actor) standart_actions.Custom(self.string, 'use', order=30, unit=self.unit, format_dict={'actor': self.unit.name})
def start_special_action(self, info, types=None): standart_actions.Custom(self.activate_special_action, order=self.order, unit=self.unit, types=types)