def activate(self, action): energy = self.unit.energy if self.unit.energy < 7 else 6 modifier = self.unit.range_accuracy - action.target.evasion + energy + 5 damage = engine.damage_roll(1, modifier) if damage: action.target.receive_damage(1) statuses.Bleeding(action.target) if 'alive' in action.target.types: self.string('use', format_dict={ 'actor': self.unit.name, 'target': action.target.name }) else: self.string('special', format_dict={ 'actor': self.unit.name, 'target': action.target.name }) else: self.string('fail', format_dict={ 'actor': self.unit.name, 'target': action.target.name }) self.unit.wasted_energy += 2
def activate(self, action): self.string('use', format_dict={ 'actor': self.actor.name, 'target': action.target.name }) statuses.Bleeding(self.actor) action.target.hp_delta += 2
def blood_touch(self, action): unit = action.unit target = unit.target statuses.Bleeding(target) unit.string('skill_1', format_dict={ 'actor': unit.name, 'target': target.name })
def on_hit(self, attack_action): if not self.melee: if attack_action.dmg_done and engine.roll_chance( self.bleed_chance ) and 'alive' in attack_action.target.types: statuses.Bleeding(attack_action.unit.target) attack_action.to_emotes(emoji_utils.emote_dict['bleeding_em']) self.melee = True
def on_hit(self, attack_action): if attack_action.dmg_done and engine.roll_chance(self.poison_chance): if 'undead' or 'zombie' not in attack_action.target.types: if engine.roll_chance(50): statuses.Poison(attack_action.unit.target) attack_action.to_emotes(emoji_utils.emote_dict['poisoned_em']) else: statuses.Bleeding(attack_action.unit.target) attack_action.to_emotes(emoji_utils.emote_dict['bleeding_em'])
def activate(self, action): energy = self.unit.energy if self.unit.energy < 7 else 6 modifier = self.unit.range_accuracy - action.target.evasion + energy + 5 self.dmg_done = engine.damage_roll(3, modifier) self.dmg_done += self.unit.damage self.target = action.target self.target.receive_hit(self) self.target.receive_damage(self.dmg_done) if self.dmg_done: if 'alive' in action.target.types: statuses.Bleeding(action.target) self.string('use', format_dict={ 'actor': self.unit.name, 'target': self.target.name, 'damage': self.dmg_done }) else: self.string('special', format_dict={ 'actor': self.unit.name, 'target': self.target.name, 'damage': self.dmg_done }) elif self.dmg_blocked: self.string('armor', format_dict={ 'actor': self.unit.name, 'target': self.target.name, 'armor_name': self.armored.name_lang_tuple() }) else: self.string('fail', format_dict={ 'actor': self.unit.name, 'target': self.target.name }) self.unit.waste_energy(2)
def check_blood(self, action): unit = action.unit triggered = False for target in unit.targets(): if any(actn.name == 'bleeding' for actn in target.actions()) and 'bleeding' in target.statuses: if target.statuses['bleeding'].strength >= 9: triggered = True break elif target.statuses[ 'bleeding'].strength > 6 and 'idle' not in target.action: triggered = True break if triggered: unit.announce(unit.to_string('skill_5', format_dict={'actor': unit.name}), image=unit.blood_spell_img) Custom(unit.string, 'skill_3', unit=unit, order=22, format_dict={'actor': unit.name}) for target in unit.targets(): statuses.Bleeding(target)
def on_hit(self, attack_action): if attack_action.dmg_done and engine.roll_chance( self.get_bleed_chance()) and 'alive' in attack_action.target.types: statuses.Bleeding(attack_action.unit.target) attack_action.to_emotes(emoji_utils.emote_dict['bleeding_em']) self.bleed_applied_turn = self.unit.fight.turn
def effect_resolve(self, attack_action): self.effect_chance = self.default_effect_chance statuses.Bleeding(attack_action.target) attack_action.to_emotes(emoji_utils.emote_dict['bleeding_em'])