本文整理汇总了Python中base.Prototype类的典型用法代码示例。如果您正苦于以下问题:Python Prototype类的具体用法?Python Prototype怎么用?Python Prototype使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Prototype类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: cast_action
def cast_action(self):
if self.parent.player.mana['air'] >= 2:
# if player have mana for cast
Prototype.cast_action(self) # activating focus-cast
for card in self.get_enemy_cards():
if card.cast: # if it`s caster
card.light_switch(True) # enable lighting
示例2: cast_action
def cast_action(self):
Prototype.cast_action(self) # enable focus-cast
for card in self.get_self_cards():
if card.element == "fire" and card != self:
card.light_switch(True)
else:
continue
示例3: summon
def summon(self):
Prototype.summon(self)
for card in self.get_enemy_cards():
if card.element == "water":
card.damage(6, self)
else:
continue
示例4: attack
def attack(self):
if self.moves_alive:
e_card = wzglobals.cardboxes[self.get_attack_position()].card
Prototype.attack(self)
if e_card.name != 'player':
self.parent.player.enemy.damage(self.power, self, True)
e_card = None
示例5: cast_action
def cast_action(self):
if self.parent.player.mana['life'] >= 2:
# если хватает маны, то активируем фокус
Prototype.cast_action(self)
for card in self.get_enemy_cards():
if card.element == "death":
card.light_switch(True)
示例6: turn
def turn(self):
Prototype.turn(self)
if self.parent.player.mana['life'] >= 2:
self.parent.player.mana['life'] -= 2
else:
self.parent.player.mana['life'] = 0
self.parent.player.mana['death'] += 1
示例7: summon
def summon(self):
Prototype.summon(self)
attack_position = self.get_attack_position()
wzglobals.cardboxes[attack_position].card.damage(10, self)
for adjacent_pos in self.get_attack_adjacent_position(
attack_position
):
wzglobals.cardboxes[adjacent_pos].card.damage(10, self)
示例8: __init__
def __init__(self):
self.name = "Cerberus"
self.element = "fire"
self.level = 4
self.power = 4
self.info = _("Attacks adjacent enemy units at a half of it`s strength.")
self.cast = False
self.health = 6
self.imagefile = "cerberus.gif"
Prototype.__init__(self)
示例9: __init__
def __init__(self):
self.name = "IceGuard"
self.element = "water"
self.level = 5
self.info = _("Reduces all damage done to owner by 50%. " "Suffers 200% damage from fire.")
self.power = 4
self.cast = False
self.health = 19
self.imagefile = "ice_guard.gif"
Prototype.__init__(self)
示例10: __init__
def __init__(self):
self.name = "Nymph"
self.element = "air"
self.level = 3
self.power = 1
self.cast = False
self.info = _(
"Owner receives 1 Air at the beginning of Owners turn."
)
self.health = 12
self.imagefile = 'nymph.gif'
Prototype.__init__(self)
示例11: attack
def attack(self):
if self.moves_alive:
if wzglobals.cardboxes[
self.get_attack_position()
].card.name == "player":
self.run_attack_animation()
wzglobals.cardboxes[
self.get_attack_position()
].card.damage(self.power + 10, self)
self.die()
else:
Prototype.attack(self)
示例12: __init__
def __init__(self):
self.name = "Golem"
self.element = "earth"
self.level = 5
self.power = 4
self.cast = False
self.health = 15
self.info = _(
"Regenerates 3 health every turn. "
"While owner's Earth less than 3, it suffers 3 damage instead."
)
self.imagefile = 'golem.gif'
Prototype.__init__(self)
示例13: __init__
def __init__(self):
self.name = "Vampire"
self.element = "death"
self.level = 9
self.power = 6
self.health = 22
self.cast = False
self.info = _(
"When attacks living creature, restores health equal to "
"50% of damage dealt. Maximum 30 health."
)
self.imagefile = 'vampire.gif'
Prototype.__init__(self)
示例14: __init__
def __init__(self):
self.name = "Apostate"
self.element = "life"
self.level = 5
self.info = _(
"Steals 2 owner's Life and gives owner 1 Death in the "
"beginning of owner's turn. \n"
"Serves Death. Once cast, Apostate permanently turns into "
"a Banshee. Banshee restores only 1/2 of normal health."
)
self.cast = True
self.power = 4
self.health = 14
self.imagefile = 'apostate.gif'
Prototype.__init__(self)