本文整理汇总了Python中base.Prototype.damage方法的典型用法代码示例。如果您正苦于以下问题:Python Prototype.damage方法的具体用法?Python Prototype.damage怎么用?Python Prototype.damage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类base.Prototype
的用法示例。
在下文中一共展示了Prototype.damage方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: damage
# 需要导入模块: from base import Prototype [as 别名]
# 或者: from base.Prototype import damage [as 别名]
def damage(self, damage, enemy, cast=False):
if enemy.element == "fire":
Prototype.damage(self, damage * 2, enemy)
elif enemy.element == "water":
Prototype.damage(self, 1, enemy)
else:
Prototype.damage(self, damage, enemy)
示例2: damage
# 需要导入模块: from base import Prototype [as 别名]
# 或者: from base.Prototype import damage [as 别名]
def damage(self, damage, enemy, cast=False):
if self.stone:
if damage - 2 > 0:
Prototype.damage(self, damage - 2, enemy)
else:
Prototype.damage(self, 0, enemy)
else:
Prototype.damage(self, damage, enemy)
示例3: damage
# 需要导入模块: from base import Prototype [as 别名]
# 或者: from base.Prototype import damage [as 别名]
def damage(self, damage, enemy, cast=False):
if not cast:
Prototype.damage(self, 1, enemy, cast)
else:
Prototype.damage(self, damage, enemy, cast)
示例4: damage
# 需要导入模块: from base import Prototype [as 别名]
# 或者: from base.Prototype import damage [as 别名]
def damage(self, damage, enemy, cast=False):
if enemy.element == "fire":
return
else:
Prototype.damage(self, damage, enemy)
示例5: damage
# 需要导入模块: from base import Prototype [as 别名]
# 或者: from base.Prototype import damage [as 别名]
def damage(self, damage, enemy, cast=False):
if not cast:
Prototype.damage(self, int(ceil(damage / floor(2))), enemy)
self.parent.player.damage(int(ceil(damage / floor(2))), enemy)
else:
Prototype.damage(self, damage * 2, enemy, True)