當前位置: 首頁>>代碼示例>>Python>>正文


Python base.Prototype類代碼示例

本文整理匯總了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
開發者ID:sandrobonazzola,項目名稱:wizards-magic2,代碼行數:7,代碼來源:air_cards_deck.py

示例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
開發者ID:sandrobonazzola,項目名稱:wizards-magic2,代碼行數:7,代碼來源:fire_cards_deck.py

示例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
開發者ID:sandrobonazzola,項目名稱:wizards-magic2,代碼行數:7,代碼來源:fire_cards_deck.py

示例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
開發者ID:sandrobonazzola,項目名稱:wizards-magic2,代碼行數:7,代碼來源:earth_cards_deck.py

示例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)
開發者ID:sandrobonazzola,項目名稱:wizards-magic2,代碼行數:7,代碼來源:life_cards_deck.py

示例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
開發者ID:sandrobonazzola,項目名稱:wizards-magic2,代碼行數:7,代碼來源:life_cards_deck.py

示例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)
開發者ID:sandrobonazzola,項目名稱:wizards-magic2,代碼行數:8,代碼來源:death_cards_deck.py

示例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)
開發者ID:sandrobonazzola,項目名稱:wizards-magic2,代碼行數:10,代碼來源:fire_cards_deck.py

示例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)
開發者ID:sandrobonazzola,項目名稱:wizards-magic2,代碼行數:10,代碼來源:water_cards_deck.py

示例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)
開發者ID:sandrobonazzola,項目名稱:wizards-magic2,代碼行數:12,代碼來源:air_cards_deck.py

示例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)
開發者ID:sandrobonazzola,項目名稱:wizards-magic2,代碼行數:12,代碼來源:death_cards_deck.py

示例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)
開發者ID:sandrobonazzola,項目名稱:wizards-magic2,代碼行數:13,代碼來源:earth_cards_deck.py

示例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)
開發者ID:sandrobonazzola,項目名稱:wizards-magic2,代碼行數:13,代碼來源:death_cards_deck.py

示例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)
開發者ID:sandrobonazzola,項目名稱:wizards-magic2,代碼行數:15,代碼來源:life_cards_deck.py


注:本文中的base.Prototype類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。