Permalink
Browse files

Card Script API v3: Rename "action" to "play" and clean everything up

Commit bbe0aaf introduced optional
lists for all APIs. Most extra changes here are from cleaning these up.
  • Loading branch information...
jleclanche committed Jul 18, 2015
1 parent 09833b8 commit 7cf5dba495a1c9a0718140d3d8f88864c2c3bb98
Showing with 640 additions and 862 deletions.
  1. +3 −3 fireplace/card.py
  2. +1 −1 fireplace/cards/blackrock/adventure.py
  3. +8 −13 fireplace/cards/blackrock/brawl.py
  4. +26 −44 fireplace/cards/blackrock/collectible.py
  5. +41 −43 fireplace/cards/classic/druid.py
  6. +32 −47 fireplace/cards/classic/hunter.py
  7. +30 −40 fireplace/cards/classic/mage.py
  8. +35 −45 fireplace/cards/classic/neutral_common.py
  9. +9 −14 fireplace/cards/classic/neutral_epic.py
  10. +47 −75 fireplace/cards/classic/neutral_legendary.py
  11. +27 −51 fireplace/cards/classic/neutral_rare.py
  12. +29 −37 fireplace/cards/classic/paladin.py
  13. +28 −34 fireplace/cards/classic/priest.py
  14. +34 −38 fireplace/cards/classic/rogue.py
  15. +22 −28 fireplace/cards/classic/shaman.py
  16. +30 −36 fireplace/cards/classic/warlock.py
  17. +23 −27 fireplace/cards/classic/warrior.py
  18. +50 −50 fireplace/cards/debug/all.py
  19. +1 −1 fireplace/cards/game/all.py
  20. +11 −13 fireplace/cards/gvg/druid.py
  21. +7 −9 fireplace/cards/gvg/hunter.py
  22. +8 −12 fireplace/cards/gvg/mage.py
  23. +13 −21 fireplace/cards/gvg/neutral_common.py
  24. +10 −17 fireplace/cards/gvg/neutral_epic.py
  25. +11 −19 fireplace/cards/gvg/neutral_legendary.py
  26. +6 −8 fireplace/cards/gvg/neutral_rare.py
  27. +8 −12 fireplace/cards/gvg/paladin.py
  28. +8 −10 fireplace/cards/gvg/priest.py
  29. +13 −19 fireplace/cards/gvg/rogue.py
  30. +8 −12 fireplace/cards/gvg/shaman.py
  31. +8 −10 fireplace/cards/gvg/spare_parts.py
  32. +12 −20 fireplace/cards/gvg/warlock.py
  33. +6 −6 fireplace/cards/gvg/warrior.py
  34. +1 −1 fireplace/cards/naxxramas/bosses/other.py
  35. +23 −35 fireplace/cards/naxxramas/collectible.py
  36. +11 −11 fireplace/cards/tutorial/all.py
@@ -198,12 +198,12 @@ def action(self):
if self.has_combo and self.controller.combo:
logging.info("Activating %r combo targeting %r" % (self, self.target))
actions = self.data.scripts.combo
elif hasattr(self.data.scripts, "action"):
elif hasattr(self.data.scripts, "play"):
logging.info("Activating %r action targeting %r" % (self, self.target))
actions = self.data.scripts.action
actions = self.data.scripts.play
elif self.choose:
logging.info("Activating %r Choose One: %r", self, self.chosen)
actions = self.chosen.data.scripts.action
actions = self.chosen.data.scripts.play
else:
return
@@ -6,4 +6,4 @@
# Flameheart
class BRMA_01:
action = [Draw(CONTROLLER) * 2, GainArmor(FRIENDLY_HERO, 4)]
play = Draw(CONTROLLER) * 2, GainArmor(FRIENDLY_HERO, 4)
@@ -6,50 +6,45 @@
# Wild Magic
class TBA01_5:
activate = [Buff(Give(CONTROLLER, RandomMinion()), "TBA01_5e")]
activate = Buff(Give(CONTROLLER, RandomMinion()), "TBA01_5e")
class TBA01_5e:
cost = lambda self, i: 0
# Molten Rage
class TBA01_6:
activate = [Summon(CONTROLLER, "CS2_118")]
activate = Summon(CONTROLLER, "CS2_118")
##
# Minions
# Lucifron
class BRMC_85:
action = [Buff(ALL_MINIONS - SELF, "CS2_063e")]
play = Buff(ALL_MINIONS - SELF, "CS2_063e")
# Moira Bronzebeard
class BRMC_87:
deathrattle = [Summon(CONTROLLER, "BRM_028")]
deathrattle = Summon(CONTROLLER, "BRM_028")
# Son of the Flame
class BRMC_91:
action = [Hit(TARGET, 6)]
play = Hit(TARGET, 6)
# Golemagg
class BRMC_95:
def cost(self, value):
return value - self.controller.hero.damage
cost = lambda self, i: i - self.controller.hero.damage
# High Justice Grimstone
class BRMC_96:
events = [
OWN_TURN_BEGIN.on(Summon(CONTROLLER, RandomMinion(rarity=Rarity.LEGENDARY)))
]
events = OWN_TURN_BEGIN.on(Summon(CONTROLLER, RandomMinion(rarity=Rarity.LEGENDARY)))
# Garr
class BRMC_99:
events = [
SELF_DAMAGE.on(Summon(CONTROLLER, "BRMC_99e"))
]
events = SELF_DAMAGE.on(Summon(CONTROLLER, "BRMC_99e"))
@@ -6,138 +6,120 @@
# Flamewaker
class BRM_002:
events = [
OWN_SPELL_PLAY.after(Hit(RANDOM_ENEMY_MINION, 1) * 2)
]
events = OWN_SPELL_PLAY.after(Hit(RANDOM_ENEMY_MINION, 1) * 2)
# Twilight Whelp
class BRM_004:
action = [HOLDING_DRAGON & Buff(SELF, "BRM_004e")]
play = HOLDING_DRAGON & Buff(SELF, "BRM_004e")
# Imp Gang Boss
class BRM_006:
events = [
SELF_DAMAGE.on(Summon(CONTROLLER, "BRM_006t"))
]
events = SELF_DAMAGE.on(Summon(CONTROLLER, "BRM_006t"))
# Dark Iron Skulker
class BRM_008:
action = [Hit(ENEMY_MINIONS - DAMAGED, 2)]
play = Hit(ENEMY_MINIONS - DAMAGED, 2)
# Volcanic Lumberer
class BRM_009:
def cost(self, value):
return value - len(self.game.minions_killed_this_turn)
cost = lambda self, i: i - len(self.game.minions_killed_this_turn)
# Druid of the Flame (Firecat Form)
class BRM_010a:
action = [Morph(SELF, "BRM_010t")]
play = Morph(SELF, "BRM_010t")
# Druid of the Flame (Firehawk Form)
class BRM_010b:
action = [Morph(SELF, "BRM_010t2")]
play = Morph(SELF, "BRM_010t2")
# Core Rager
class BRM_014:
action = [Find(CONTROLLER_HAND) | Buff(SELF, "BRM_014e")]
play = Find(CONTROLLER_HAND) | Buff(SELF, "BRM_014e")
# Axe Flinger
class BRM_016:
events = [
SELF_DAMAGE.on(Hit(ENEMY_HERO, 2))
]
events = SELF_DAMAGE.on(Hit(ENEMY_HERO, 2))
# Dragonkin Sorcerer
class BRM_020:
events = [
Play(CONTROLLER, SPELL, SELF).on(Buff(SELF, "BRM_020e"))
]
events = Play(CONTROLLER, SPELL, SELF).on(Buff(SELF, "BRM_020e"))
# Dragon Egg
class BRM_022:
events = [
SELF_DAMAGE.on(Summon(CONTROLLER, "BRM_022t"))
]
events = SELF_DAMAGE.on(Summon(CONTROLLER, "BRM_022t"))
# Volcanic Drake
class BRM_025:
def cost(self, value):
return value - len(self.game.minions_killed_this_turn)
cost = lambda self, i: i - len(self.game.minions_killed_this_turn)
# Hungry Dragon
class BRM_026:
action = [Summon(OPPONENT, RandomMinion(cost=1))]
play = Summon(OPPONENT, RandomMinion(cost=1))
# Majordomo Executus
class BRM_027:
deathrattle = [Summon(CONTROLLER, "BRM_027h"), Summon(CONTROLLER, "BRM_027p")]
deathrattle = Summon(CONTROLLER, "BRM_027h"), Summon(CONTROLLER, "BRM_027p")
# DIE, INSECT!
class BRM_027p:
activate = [Hit(RANDOM_ENEMY_CHARACTER, 8)]
activate = Hit(RANDOM_ENEMY_CHARACTER, 8)
# Emperor Thaurissan
class BRM_028:
events = [
OWN_TURN_END.on(Buff(CONTROLLER_HAND, "BRM_028e"))
]
events = OWN_TURN_END.on(Buff(CONTROLLER_HAND, "BRM_028e"))
# Blackwing Technician
class BRM_033:
action = [HOLDING_DRAGON & Buff(SELF, "BRM_033e")]
play = HOLDING_DRAGON & Buff(SELF, "BRM_033e")
##
# Spells
# Solemn Vigil
class BRM_001:
action = [Draw(CONTROLLER) * 2]
def cost(self, value):
return value - len(self.game.minions_killed_this_turn)
play = Draw(CONTROLLER) * 2
cost = lambda self, i: i - len(self.game.minions_killed_this_turn)
# Dragon's Breath
class BRM_003:
action = [Hit(TARGET, 4)]
def cost(self, value):
return value - len(self.game.minions_killed_this_turn)
play = Hit(TARGET, 4)
cost = lambda self, i: i - len(self.game.minions_killed_this_turn)
# Demonwrath
class BRM_005:
action = [Hit(ALL_MINIONS - DEMON, 2)]
play = Hit(ALL_MINIONS - DEMON, 2)
# Gang Up
class BRM_007:
action = [Shuffle(CONTROLLER, Copy(TARGET)) * 3]
play = Shuffle(CONTROLLER, Copy(TARGET)) * 3
# Quick Shot
class BRM_013:
action = [Hit(TARGET, 3), Find(CONTROLLER_HAND) | Draw(CONTROLLER)]
play = Hit(TARGET, 3), Find(CONTROLLER_HAND) | Draw(CONTROLLER)
# Resurrect
class BRM_017:
def action(self):
def play(self):
minions = self.game.minions_killed.filter(controller=self.controller)
if minions:
return [Summon(CONTROLLER, random.choice(minions).id)]
return Summon(CONTROLLER, random.choice(minions).id)
Oops, something went wrong.

0 comments on commit 7cf5dba

Please sign in to comment.