Exemplo n.º 1
0
 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)
Exemplo n.º 2
0
 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()
Exemplo n.º 3
0
 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)
Exemplo n.º 4
0
 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})
Exemplo n.º 5
0
 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
Exemplo n.º 6
0
 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))
Exemplo n.º 7
0
 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
Exemplo n.º 8
0
 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)
Exemplo n.º 9
0
 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})
Exemplo n.º 10
0
 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)
Exemplo n.º 11
0
 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()
Exemplo n.º 12
0
 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)
Exemplo n.º 13
0
 def start_special_action(self, info):
     standart_actions.Custom(self.activate_special_action, order=self.order, unit=self.unit)
Exemplo n.º 14
0
 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()
Exemplo n.º 15
0
 def act(self, action=None):
     standart_actions.Custom(self.set_hp, order=40, actor=self.actor)
     self.actor.fight.action_queue.append(self)
Exemplo n.º 16
0
 def act(self, action=None):
     standart_actions.Custom(self.set_hp, order=40, unit=self.unit)
     self.unit.fight.action_queue.append(self)
Exemplo n.º 17
0
 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})
Exemplo n.º 18
0
 def start_special_action(self, info, types=None):
     standart_actions.Custom(self.activate_special_action,
                             order=self.order,
                             unit=self.unit,
                             types=types)