def ability(self, character, targets): ability_range = 1 base_damage = 20 damage_scaling = 1.0 targets = [ x for x in targets if (x.stats['enemy'] != character.stats['enemy']) and ( (x.stats['rank'] + character.stats['rank']) <= ability_range) ] target = select_target_by_aggro(targets) if target is not None: spell_damage = base_damage + damage_scaling * character.stats[ 'spell_damage'] target.effect(Effect(health=-spell_damage).return_effect()) print(character.get_name() + ' spat slime at ' + target.get_name() + ' for ' + str(spell_damage))
def attack(self, targets): targets = [ x for x in targets if (x.stats['enemy'] != self.stats['enemy']) and ( (x.stats['rank'] + self.stats['rank']) <= self.stats['range']) ] if len(targets) > 0: target = utils.select_target_by_aggro(targets) if target is not None: attack_effect = Effect( health=-self.stats['attack_damage']).return_effect() target.effect(attack_effect) self.gain_aggro(self.stats['attack_damage']) self.charge_gain(damage_dealt=-attack_effect['health']) print(self.get_name() + " attacked " + target.get_name() + ' for ' + str(attack_effect['health']))
def ability(self, character, targets): ability_range = 2 base_healing = 40 healing_scaling = 1.0 targets = [ x for x in targets if (x.stats['enemy'] == character.stats['enemy']) and ( (x.stats['rank'] + character.stats['rank']) <= ability_range) ] target = utils.select_target_by_aggro(targets) if target is not None: spell_damage = base_healing + healing_scaling * character.stats[ 'spell_damage'] target.effect(effect.Effect(health=spell_damage).return_effect()) print(character.get_name() + ' healed ' + target.get_name() + ' for ' + str(spell_damage))
def ability(self, character, targets): stat_scaling = 0.2 stat_change = character.stats['spell_damage'] * stat_scaling stat_loss = effect.Effect(attack_damage=-stat_change, spell_damage=-stat_change, speed=-stat_change).return_effect() ability_range = 3 targets = [ x for x in targets if (x.stats['enemy'] != character.stats['enemy']) and ( (x.stats['rank'] + character.stats['rank']) <= ability_range) ] target = utils.select_target_by_aggro(targets) if target is not None: target.effect(stat_loss) print(character.get_name() + ' gained ' + str(stat_change) + ' strength and speed')
def ability(self, character, targets): ability_range = 0 push_distance = 1 base_damage = 10 damage_scaling = 0.1 targets = [ x for x in targets if (x.stats['enemy'] != character.stats['enemy']) and ( (x.stats['rank'] + character.stats['rank']) <= ability_range) ] target = utils.select_target_by_aggro(targets) if target is not None: spell_damage = base_damage + damage_scaling * character.stats[ 'spell_damage'] target.effect( effect.Effect(health=-spell_damage, rank=push_distance).return_effect()) print(character.get_name() + ' pushed ' + target.get_name() + ' for ' + str(spell_damage))