def cast(self): Magic.cast(self) for card in self.get_enemy_cards(): if card.level < 5: card.die() else: continue
def cast(self): Magic.cast(self) diff = self.player.mana["fire"] + self.level - self.player.enemy.mana["fire"] if diff > 0: self.player.enemy.damage(diff * 2, self, True) else: self.player.enemy.damage(1, self, True)
def cast(self): Magic.cast(self) air_mana = self.player.mana['air'] + self.level power = air_mana + 2 for card in self.get_enemy_cards(): card.damage(power, self, True) power -= 2
def cast(self): # работает единожды, поэтому нет нужды добавлять в группу и # создавать ф-ию периодического каста. Magic.cast(self) enemy_cards = self.get_enemy_cards() # берем список вражеских карт for card in enemy_cards: card.damage(card.power - 1, self, True)
def __init__(self): self.element = "water" self.name = "SeaJustice" self.level = 3 self.info = _("Every enemy creature suffers damage equal to its attack -1") self.imagefile = "sea_justice.gif" Magic.__init__(self)
def __init__(self): self.element = "fire" self.name = "FireSpikes" self.level = 3 self.imagefile = "fire_spikes.gif" self.info = _("Deals 3 damage to each enemy creature. " "Cheap and still good. Pure Fire.") Magic.__init__(self)
def cast(self): Magic.cast(self) life_mana = wzglobals.player.mana['life'] + self.level wzglobals.player.heal(life_mana * 3) for card in self.get_self_cards(): card.heal(3, card.max_health) wzglobals.player.mana['life'] = 0
def __init__(self): self.element = "water" self.name = "Paralyze" self.level = 10 self.imagefile = "paralyze.gif" self.info = _("Paralyzes enemy player and creatures for one turn, " "so they skip one turn.") Magic.__init__(self)
def __init__(self): self.element = "fire" self.name = "FireSpikes" self.level = 3 self.imagefile = 'fire_spikes.gif' self.info = _("Deals 3 damage to each enemy creature. " "Cheap and still good. Pure Fire.") Magic.__init__(self)
def cast(self): Magic.cast(self) enemy_cards = self.get_enemy_cards() self_cards = self.get_self_cards() for card in enemy_cards + self_cards: card.damage(25, self, True) self.player.damage(25, self, True) self.player.enemy.damage(25, self, True)
def cast(self): Magic.cast(self) diff = (self.player.mana['fire'] + self.level - self.player.enemy.mana['fire']) if diff > 0: self.player.enemy.damage(diff * 2, self, True) else: self.player.enemy.damage(1, self, True)
def cast(self): Magic.cast(self) power = self.player.mana['life'] + self.level # mana['life'] - count of Life ; # level - cast this spell, because mana decreased before # spell activated. self.player.damage(power, self, True) self.player.enemy.damage(power * 2, self, True)
def cast(self): Magic.cast(self) for card in self.get_enemy_cards() + self.get_self_cards(): for spell in card.spells: spell.unset(card) card.spells = [] if card.element == 'fire': card.heal(3, card.max_health)
def __init__(self): self.element = "water" self.name = "SeaJustice" self.level = 3 self.info = _( "Every enemy creature suffers damage equal to its attack -1") self.imagefile = 'sea_justice.gif' Magic.__init__(self)
def __init__(self): self.element = "water" self.name = "Paralyze" self.level = 10 self.imagefile = 'paralyze.gif' self.info = _("Paralyzes enemy player and creatures for one turn, " "so they skip one turn.") Magic.__init__(self)
def cast(self): Magic.cast(self) for card in self.get_enemy_cards() + self.get_self_cards(): for spell in card.spells: spell.unset(card) card.spells = [] if card.element == "fire": card.heal(3, card.max_health)
def cast(self): Magic.cast(self) cards = self.get_enemy_cards() + self.get_self_cards() for card in cards: if card.element == "death": card.heal(5, card.max_health) else: card.damage(13, self, True)
def cast(self): Magic.cast(self) self.protected_cards = {} for cardbox in self.get_self_cardboxes(): if cardbox.card.name != "player": # if card exists self.protected_cards[cardbox.position] = cardbox.card cardbox.card = AbsoluteDefenceSpirit(cardbox.card) wzglobals.magic_cards.add(self)
def __init__(self): self.element = "death" self.name = "Curse" self.level = 4 self.imagefile = 'curse.gif' self.info = _("Reduces all enemy elements by 1. " "Curse and Doom are now your enemy's only guests.") Magic.__init__(self)
def cast(self): Magic.cast(self) cards = self.get_enemy_cards() + self.get_self_cards() for card in cards: if card.element == "death": card.die() self.player.mana['life'] += 3 self.player.heal(1)
def cast(self): Magic.cast(self) death_mana = wzglobals.player.mana['death'] + self.level if death_mana < 8: wzglobals.player.enemy.damage(5, self, True) wzglobals.player.heal(5) else: wzglobals.player.enemy.damage(death_mana + 5, self, True) wzglobals.player.heal(death_mana + 5)
def cast(self): Magic.cast(self) earth_mana = self.player.mana['earth'] + self.level if earth_mana > 12: cards = self.get_enemy_cards() else: cards = self.get_enemy_cards() + self.get_self_cards() for card in cards: card.damage(15, self, True)
def __init__(self): self.element = "fire" self.name = "RitualFlame" self.level = 5 self.imagefile = 'ritual_flame.gif' self.info = _("Destroys all spell effects from all creatures, " "both owner's and enemy's. " "Heals all Fire creatures for 3.") Magic.__init__(self)
def __init__(self): self.element = "fire" self.name = "Fireball" self.level = 8 self.imagefile = 'fireball.gif' self.info = _("Each enemy creature suffers damage equal to owner's " "Fire + 3. " "As easy as it is - a ball of burning fire.") Magic.__init__(self)
def __init__(self): self.element = "earth" self.name = "Quicksands" self.level = 6 self.imagefile = 'quicksands.gif' self.info = _("Kills all enemy creatures of level less than 5. " "Only the skilled one can survive the swamp's most " "dangerous weapon.") Magic.__init__(self)
def __init__(self): self.element = "air" self.name = "BlackWind" self.level = 8 self.imagefile = 'black_wind.gif' self.info = _("Winds away strongest enemy creature. " "Perfect against high-level enemy creatures. " "One of the most useful spells.") Magic.__init__(self)
def cast(self): Magic.cast(self) cards = self.get_self_cards() for card in cards: if card.element != 'death': card.set_power(card.power + 1) self.cards.append(card) else: card.damage(10, self, True) wzglobals.magic_cards.add(self)
def __init__(self): self.element = "death" self.name = "StealLife" self.level = 6 self.imagefile = 'steal_life.gif' self.info = _( "If owner's Death less than 8, steals 5 health from enemy " "player. Otherwise steals Death + 5. Death's cold vampiric " "touch. So painful and surreal..") Magic.__init__(self)
def __init__(self): self.element = "death" self.name = "CoverOfDarkness" self.level = 11 self.imagefile = 'cover_of_darkness.gif' self.info = _("All living creatures suffer 13 damage. " "All undead creatures heal for 5. " "The Lord of Chaos most useful tool. " "Your army of darkness shall reign forever.") Magic.__init__(self)
def cast(self): Magic.cast(self) self.cards = self.get_enemy_cards() # берем "слепок" вражеских карт, которые будем травить for card in self.cards: if card.element != "death": card.spells.append(self) # говорим карте чтобы она начала креститься card.damage(1, self, True) wzglobals.magic_cards.add(self) # добавляем периодизацию
def __init__(self): self.element = "death" self.name = "TotalWeakness" self.level = 8 self.imagefile = 'total_weakness.gif' self.info = _( "Every enemy creature suffers effect of Weakness: its attack " "decreased by 50% (rounded down). Make the strongest the " "weakest, and then assasinate him.") Magic.__init__(self)
def __init__(self): self.element = "death" self.name = "Curse" self.level = 4 self.imagefile = 'curse.gif' self.info = _( "Reduces all enemy elements by 1. " "Curse and Doom are now your enemy's only guests." ) Magic.__init__(self)
def __init__(self): self.element = "earth" self.name = "Earthquake" self.level = 10 self.imagefile = 'earthquake.gif' self.info = _( "Hits each creature for 15 damage. " "Doesn't affect owner's creatures, if onwer's Earth > 12. " "Even the earth itself is a powerful weapon.") Magic.__init__(self)
def __init__(self): self.element = "death" self.name = "ChaosVortex" self.level = 13 self.imagefile = 'chaos_vortex.gif' self.info = _("Banishes each creature into hell. " "Each banished creature gives caster 1 Death. " "Whenever one unfolds Chaos, no mortal can stand its " "fearful ugly nature.") Magic.__init__(self)
def __init__(self): self.element = "air" self.name = "Spellbreaker" self.level = 7 self.imagefile = 'spellbreaker.gif' self.info = _("Owner's creatures become permanently immune to all " "damaging spells, spell effects, and poison. " "Remember that your creatures can no longer be affected " "by Bless, Restructure and other good spell effects.") Magic.__init__(self)
def __init__(self): self.element = "earth" self.name = "Revival" self.level = 5 self.imagefile = 'revival.gif' self.info = _( "Heals all friendly creatures for 4. " "Gives owner 2 health for each of his creatures on a field. " "Heal me! Heal me!") Magic.__init__(self)
def __init__(self): self.element = "earth" self.name = "Restructure" self.level = 6 self.imagefile = 'restructure.gif' self.info = _("All onwer's creatures gain +3 health to their maximum, " "healing for 6 in the same time. " "Scatter to pieces, connect once again. " "Now you are stronger, none shall remain!") Magic.__init__(self)
def __init__(self): self.element = "death" self.name = "TotalWeakness" self.level = 8 self.imagefile = 'total_weakness.gif' self.info = _( "Every enemy creature suffers effect of Weakness: its attack " "decreased by 50% (rounded down). Make the strongest the " "weakest, and then assasinate him." ) Magic.__init__(self)
def __init__(self): self.element = "earth" self.name = "Revival" self.level = 5 self.imagefile = 'revival.gif' self.info = _( "Heals all friendly creatures for 4. " "Gives owner 2 health for each of his creatures on a field. " "Heal me! Heal me!" ) Magic.__init__(self)
def __init__(self): self.element = "earth" self.name = "Quicksands" self.level = 6 self.imagefile = 'quicksands.gif' self.info = _( "Kills all enemy creatures of level less than 5. " "Only the skilled one can survive the swamp's most " "dangerous weapon." ) Magic.__init__(self)
def __init__(self): self.element = "life" self.name = "LifeSacrifice" self.level = 8 self.imagefile = 'life_sacrifice.gif' self.info = _( "Owner loses health equal to his Life. " "Enemy suffers damage, double of this amount. " "Sacrificing is the true loving act." ) Magic.__init__(self)
def __init__(self): self.element = "fire" self.name = "RitualFlame" self.level = 5 self.imagefile = "ritual_flame.gif" self.info = _( "Destroys all spell effects from all creatures, " "both owner's and enemy's. " "Heals all Fire creatures for 3." ) Magic.__init__(self)
def __init__(self): self.element = "water" self.name = "Poison" self.level = 3 self.imagefile = "poison.gif" self.info = _( "Poisons all enemy units so that they lose health every turn, " "also hits them with 1 damage. " "Posion doesn`t affect undead." ) Magic.__init__(self)
def __init__(self): self.element = "earth" self.name = "Earthquake" self.level = 10 self.imagefile = 'earthquake.gif' self.info = _( "Hits each creature for 15 damage. " "Doesn't affect owner's creatures, if onwer's Earth > 12. " "Even the earth itself is a powerful weapon." ) Magic.__init__(self)
def __init__(self): self.element = "fire" self.name = "Fireball" self.level = 8 self.imagefile = "fireball.gif" self.info = _( "Each enemy creature suffers damage equal to owner's " "Fire + 3. " "As easy as it is - a ball of burning fire." ) Magic.__init__(self)
def __init__(self): self.element = "death" self.name = "StealLife" self.level = 6 self.imagefile = 'steal_life.gif' self.info = _( "If owner's Death less than 8, steals 5 health from enemy " "player. Otherwise steals Death + 5. Death's cold vampiric " "touch. So painful and surreal.." ) Magic.__init__(self)
def __init__(self): self.element = "air" self.name = "BlackWind" self.level = 8 self.imagefile = 'black_wind.gif' self.info = _( "Winds away strongest enemy creature. " "Perfect against high-level enemy creatures. " "One of the most useful spells." ) Magic.__init__(self)
def __init__(self): self.element = "life" self.name = "Purify" self.level = 7 self.imagefile = 'purify.gif' self.info = _( "If owner has Life creatures in play, " "heals owner for 5 and steals 4 health from each enemy " "creature, giving them to opposed owner's creature. " "Only pure souls can use God's blessings." ) Magic.__init__(self)