def attack_damage(self, game_round): """ 向敌人发出伤害 :param game_round: 回合数 :return: 攻击伤害,被动伤害,是否触发必杀 """ # 是否重置被动 if self.passive_skills(): # print("八重樱触发了被动技能,", end="") self.passive_skill = 3 # print(f"八重樱被动技能剩余回合数: {self.passive_skill},", end="") # 是否发动必杀技 if self.unique_skills(): # print("八重樱触发了必杀技能,", end="") # 被动是否生效 if self.passive_skill > 0: self.passive_skill = self.passive_skill - 1 return Damage([self.attack], "物理", False), Damage([5], "元素", True), True else: return Damage([self.attack], "物理", False), Damage([0], "元素", True), True else: # 被动是否生效 if self.passive_skill > 0: self.passive_skill = self.passive_skill - 1 return Damage([self.attack], "物理", False), Damage([5], "元素", True), False else: return Damage([self.attack], "物理", False), Damage([0], "元素", True), False
def unique_skills(self): """ 必杀技:每3回合的一次攻击变为对敌人进行8次攻击,每次造成12点伤害 :return: 伤害值,伤害类型(物理/元素),是否无视防御,攻击次数 """ damage = [] for i in range(8): damage.append(12) return Damage(damage, "物理", False)
def unique_skills(self): """ 必杀技:每2回合的一次攻击变为对敌人造成4次1~16点无视防御的元素伤害 :return: 伤害 """ damage = [] for i in range(4): damage.append(random.randint(1, 16)) return Damage(damage, "元素", True)
def attack_damage(self, game_round): """ 向敌人发出伤害 :param game_round: 回合数 :return: 伤害值,伤害类型(物理/元素),是否无视防御,攻击次数 """ if game_round % 2 != 0: return Damage([self.attack], "物理", False) else: return self.unique_skills()
def unique_skills(self): """ 必杀技:每3回合的一次攻击变为对敌人造成无视防御的10~30点元素伤害 :return: 伤害值,伤害类型(物理/元素),是否无视防御 """ return Damage([random.randint(10, 30)], "元素", True)