def sword_attack_giant_normal(self, target): assert_type(target, characters.Character) attacker = self.action_manager if d6() == 1: damage = d6(2) + (attacker.get_force() * 4) defense = target.get_armor() target.apply_damage(damage - defense)
def light_saber_attack_giant_normal(self, target): assert_type(target, characters.Character) attacker = self.action_manager if self.light_saber_mode and d6() == 1: damage = d6(3) + (attacker.get_force() * 4) defense = target.get_armor() target.apply_damage(damage - defense) self.light_saber_mode = False
def combo_attack(self, attackers, target): assert_type(target, characters.Character) if all([character.has_advantage(self.name) for character in attackers]) and not self.already_used: best_skill = max([character.get_skill() for character in attackers]) if d6() <= best_skill: combo_fire_power = sum([character.get_fire_power() for character in attackers]) damage = d6(1) + combo_fire_power defense = target.get_armor() target.apply_damage(damage - defense) self.already_used = True
def combo_attack(self, attackers, target): assert_type(target, characters.Character) if all([character.has_advantage(self.name) for character in attackers]) and not self.already_used: best_skill = max( [character.get_skill() for character in attackers]) if d6() <= best_skill: combo_fire_power = sum( [character.get_fire_power() for character in attackers]) damage = d6(1) + combo_fire_power defense = target.get_armor() target.apply_damage(damage - defense) self.already_used = True
def sword_attack_normal_giant(self, target): assert_type(target, characters.Character) attacker = self.action_manager if attacker.check_skill(): damage = d6(2) + attacker.get_force() defense = (target.get_armor() * 4) target.apply_damage(damage - defense)
def light_saber_attack_normal_giant(self, target): assert_type(target, characters.Character) attacker = self.action_manager if self.light_saber_mode and attacker.check_skill(): damage = d6(3) + attacker.get_force() defense = (target.get_armor() * 4) target.apply_damage(damage - defense) self.light_saber_mode = False
def devastating_blow_fire_power(self, target): assert_type(target, characters.Character) if self.action_manager.check_skill(): damage = (d6() + self.action_manager.get_force()) * 2 defense = target.get_armor() target.apply_damage(damage - defense)
def check_fire_power(self): return d6() < self.fire_power
def check_endurance(self): return d6() < self.endurance
def check_skill(self): return d6() < self.skill
def check_force(self): return d6() <= self.force