Merge pull request #660 from kevlahnota/master

Overload Cost
This commit is contained in:
Anthony Calosa
2015-11-10 12:57:56 +08:00
77 changed files with 1025 additions and 846 deletions
@@ -13,6 +13,8 @@ auto=flashbackrule
auto=retracerule auto=retracerule
auto=suspendrule auto=suspendrule
auto=morphrule auto=morphrule
auto=payzerorule
auto=overloadrule
auto=attackrule auto=attackrule
auto=blockrule auto=blockrule
auto=combattriggerrule auto=combattriggerrule
+2
View File
@@ -12,6 +12,8 @@ auto=flashbackrule
auto=retracerule auto=retracerule
auto=suspendrule auto=suspendrule
auto=morphrule auto=morphrule
auto=payzerorule
auto=overloadrule
auto=attackrule auto=attackrule
auto=blockrule auto=blockrule
auto=combattriggerrule auto=combattriggerrule
+2 -1
View File
@@ -16,7 +16,8 @@ auto=flashbackrule
auto=retracerule auto=retracerule
auto=suspendrule auto=suspendrule
auto=morphrule auto=morphrule
auto=playfromgraveyardrule auto=payzerorule
auto=overloadrule
auto=attackrule auto=attackrule
auto=blockrule auto=blockrule
auto=combattriggerrule auto=combattriggerrule
@@ -10933,6 +10933,17 @@ power=2
toughness=1 toughness=1
[/card] [/card]
[card] [card]
name=Blustersquall
alias=110000
other={3}{U} name(Overload)
target=creature|opponentbattlefield
auto=overload tap all(creature|opponentbattlefield)
auto=paidmana tap
text=Tap target creature you don't control. -- Overload {3}{U} (You may cast this spell for its overload cost. If you do, change its text by replacing all instances of "target" with "each.")
mana={U}
type=Instant
[/card]
[card]
name=Boa Constrictor name=Boa Constrictor
auto={T}:3/3 auto={T}:3/3
text={T}: Boa Constrictor gets +3/+3 until end of turn. text={T}: Boa Constrictor gets +3/+3 until end of turn.
@@ -16254,6 +16265,19 @@ mana={G}
type=Sorcery type=Sorcery
[/card] [/card]
[card] [card]
name=Chemister's Trick
alias=110000
other={3}{U}{R} name(Overload)
target=creature|opponentbattlefield
auto=paidmana -2/0
auto=paidmana mustattack
auto=overload -2/0 all(creature|opponentbattlefield)
auto=overload mustattack all(creature|opponentbattlefield)
text=Target creature you don't control gets -2/-0 until end of turn and attacks this turn if able. -- Overload {3}{U}{R} (You may cast this spell for its overload cost. If you do, change its text by replacing all instances of "target" with "each.")
mana={U}{R}
type=Instant
[/card]
[card]
name=Chief of the Edge name=Chief of the Edge
auto=lord(other warrior|myBattlefield) 1/0 auto=lord(other warrior|myBattlefield) 1/0
text=Other Warrior creatures you control get +1/+0. text=Other Warrior creatures you control get +1/+0.
@@ -19374,6 +19398,18 @@ mana={3}{U}{U}
type=Instant type=Instant
[/card] [/card]
[card] [card]
name=Counterflux
alias=110000
other={1}{U}{U}{R} name(Overload)
abilities=nofizzle
target=*|opponentstack
auto=paidmana fizzle
auto=overload fizzle all(*|opponentstack)
text=Counterflux can't be countered by spells or abilities. -- Counter target spell you don't control. -- Overload {1}{U}{U}{R} (You may cast this spell for its overload cost. If you do, change its text by replacing all instances of "target" with "each.")
mana={U}{U}{R}
type=Instant
[/card]
[card]
name=Counterintelligence name=Counterintelligence
target=<upto:2>creature target=<upto:2>creature
auto=moveTo(ownerhand) auto=moveTo(ownerhand)
@@ -21170,6 +21206,17 @@ mana={3}{B}
type=Instant type=Instant
[/card] [/card]
[card] [card]
name=Cyclonic Rift
alias=110000
other={6}{U} name(Overload)
target=*[-land]|opponentbattlefield
auto=overload moveto(ownerhand) all(*[-land]|opponentbattlefield)
auto=paidmana moveto(ownerhand)
text=Return target nonland permanent you don't control to its owner's hand. -- Overload {6}{U} (You may cast this spell for its overload cost. If you do, change its text by replacing all instances of "target" with "each.")
mana={1}{U}
type=Instant
[/card]
[card]
name=Cyclopean Mummy name=Cyclopean Mummy
auto=@movedTo(this|graveyard) from(battlefield):moveto(exile) auto=@movedTo(this|graveyard) from(battlefield):moveto(exile)
text=When Cyclopean Mummy dies, exile Cyclopean Mummy. text=When Cyclopean Mummy dies, exile Cyclopean Mummy.
@@ -25946,6 +25993,17 @@ mana={1}{U}
type=Instant type=Instant
[/card] [/card]
[card] [card]
name=Downsize
alias=110000
other={2}{U} name(Overload)
target=creature|opponentbattlefield
auto=overload -4/0 all(creature|opponentbattlefield)
auto=paidmana -4/0
text=Target creature you don't control gets -4/-0 until end of turn. -- Overload {2}{U} (You may cast this spell for its overload cost. If you do, change its text by replacing all instances of "target" with "each.")
mana={U}
type=Instant
[/card]
[card]
name=Dowsing Shaman name=Dowsing Shaman
auto={2}{G}{T}:moveTo(myhand) target(enchantment|mygraveyard) auto={2}{G}{T}:moveTo(myhand) target(enchantment|mygraveyard)
text={2}{G}, {T}: Return target enchantment card from your graveyard to your hand. text={2}{G}, {T}: Return target enchantment card from your graveyard to your hand.
@@ -28225,6 +28283,17 @@ type=Enchantment
subtype=Aura subtype=Aura
[/card] [/card]
[card] [card]
name=Dynacharge
alias=110000
other={2}{R} name(Overload)
target=creature|mybattlefield
auto=paidmana 2/0
auto=overload all(creature|mybattlefield) 2/0
text=Target creature you control gets +2/+0 until end of turn. -- Overload {2}{R} (You may cast this spell for its overload cost. If you do, change its text by replacing all instances of "target" with "each.")
mana={R}
type=Instant
[/card]
[card]
name=Dystopia name=Dystopia
auto=cumulativeupcost[{L}] sacrifice auto=cumulativeupcost[{L}] sacrifice
auto=@each opponent upkeep:ability$!name(sacrifice) notatarget(creature[green;white]|mybattlefield) sacrifice !$ opponent auto=@each opponent upkeep:ability$!name(sacrifice) notatarget(creature[green;white]|mybattlefield) sacrifice !$ opponent
@@ -28974,6 +29043,17 @@ power=1
toughness=1 toughness=1
[/card] [/card]
[card] [card]
name=Electrickery
alias=110000
other={1}{R} name(Overload)
target=creature|opponentbattlefield
auto=paidmana damage:1
auto=overload damage:1 all(creature|opponentbattlefield)
text=Electrickery deals 1 damage to target creature you don't control. -- Overload {1}{R} (You may cast this spell for its overload cost. If you do, change its text by replacing all instances of "target" with "each.")
mana={R}
type=Instant
[/card]
[card]
name=Electrolyze name=Electrolyze
target=creature,player target=creature,player
auto=damage:1 auto=damage:1
@@ -63401,6 +63481,30 @@ power=4
toughness=4 toughness=4
[/card] [/card]
[card] [card]
name=Mizzium Mortars
alias=110000
other={3}{R}{R}{R} name(Overload)
target=creature|opponentbattlefield
auto=paidmana damage:4
auto=overload damage:4 all(creature|opponentbattlefield)
text=Mizzium Mortars deals 4 damage to target creature you don't control. -- Overload {3}{R}{R}{R} (You may cast this spell for its overload cost. If you do, change its text by replacing all instances of "target" with "each.")
mana={1}{R}
type=Sorcery
[/card]
[card]
name=Mizzium Skin
alias=110000
other={1}{U} name(Overload)
target=creature|mybattlefield
auto=paidmana 0/1
auto=paidmana opponentshroud
auto=overload all(creature|mybattlefield) 0/1
auto=overload all(creature|mybattlefield) opponentshroud
text=Target creature you control gets +0/+1 and gains hexproof until end of turn. -- Overload {1}{U} (You may cast this spell for its overload cost. If you do, change its text by replacing all instances of "target" with "each.")
mana={U}
type=Instant
[/card]
[card]
name=Mnemonic Nexus name=Mnemonic Nexus
auto=moveto(opponentlibrary) all(*|opponentgraveyard) && shuffle opponent auto=moveto(opponentlibrary) all(*|opponentgraveyard) && shuffle opponent
auto=moveto(mylibrary) all(*|mygraveyard) && shuffle controller auto=moveto(mylibrary) all(*|mygraveyard) && shuffle controller
@@ -96955,6 +97059,17 @@ power=3
toughness=4 toughness=4
[/card] [/card]
[card] [card]
name=Street Spasm
alias=110000
other={X}{X}{R}{R} name(Overload)
target=creature[-flying]|opponentbattlefield
auto=paidmana damage:X
auto=overload damage:XX all(creature[-flying]|opponentbattlefield)
text=Street Spasm deals X damage to target creature without flying you don't control. -- Overload {X}{X}{R}{R} (You may cast this spell for its overload cost. If you do, change its text by replacing all instances of "target" with "each.")
mana={X}{R}
type=Instant
[/card]
[card]
name=Streetbreaker Wurm name=Streetbreaker Wurm
mana={3}{R}{G} mana={3}{R}{G}
type=Creature type=Creature
@@ -100365,6 +100480,19 @@ mana={U}{U}{U}
type=Instant type=Instant
[/card] [/card]
[card] [card]
name=Teleportal
alias=110000
other={3}{U}{R} name(Overload)
target=creature|mybattlefield
auto=paidmana 1/0
auto=paidmana unblockable
auto=overload all(creature|mybattlefield) 1/0
auto=overload all(creature|mybattlefield) unblockable
text=Target creature you control gets +1/+0 until end of turn and is unblockable this turn. -- Overload {3}{U}{R} (You may cast this spell for its overload cost. If you do, change its text by replacing all instances of "target" with "each.")
mana={U}{R}
type=Sorcery
[/card]
[card]
name=Telethopter name=Telethopter
auto={T(creature|myBattlefield)}:flying auto={T(creature|myBattlefield)}:flying
text=Tap an untapped creature you control: Telethopter gains flying until end of turn. text=Tap an untapped creature you control: Telethopter gains flying until end of turn.
@@ -107662,6 +107790,17 @@ type=Enchantment
subtype=Aura subtype=Aura
[/card] [/card]
[card] [card]
name=Vandalblast
alias=110000
other={4}{R} name(Overload)
target=artifact|opponentbattlefield
auto=overload destroy all(artifact|opponentbattlefield)
auto=paidmana destroy
text=Destroy target artifact you don't control. -- Overload {4}{R} (You may cast this spell for its overload cost. If you do, change its text by replacing all instances of "target" with "each.")
mana={R}
type=Sorcery
[/card]
[card]
name=Vanguard of Brimaz name=Vanguard of Brimaz
abilities=vigilance abilities=vigilance
auto=@targeted(this) from(*[instant;sorcery;enchantment]|myhand,mygraveyard):token(Cat Soldier,Creature Cat Soldier,1/1,white,vigilance) controller auto=@targeted(this) from(*[instant;sorcery;enchantment]|myhand,mygraveyard):token(Cat Soldier,Creature Cat Soldier,1/1,white,vigilance) controller
@@ -112353,6 +112492,19 @@ mana={4}
type=Artifact type=Artifact
[/card] [/card]
[card] [card]
name=Weapon Surge
alias=110000
other={1}{R} name(Overload)
target=creature|mybattlefield
auto=paidmana 1/0
auto=paidmana first strike
auto=overload all(creature|mybattlefield) 1/0
auto=overload all(creature|mybattlefield) first strike
text=Target creature you control gets +1/+0 and gains first strike until end of turn. -- Overload {1}{R} (You may cast this spell for its overload cost. If you do, change its text by replacing all instances of "target" with "each.")
mana={R}
type=Instant
[/card]
[card]
name=Weathered Wayfarer name=Weathered Wayfarer
auto={W}{T}:moveTo(myhand) target(land|mylibrary) restriction{type(land|opponentbattlefield)~morethan~type(land|mybattlefield)} auto={W}{T}:moveTo(myhand) target(land|mylibrary) restriction{type(land|opponentbattlefield)~morethan~type(land|mybattlefield)}
text={W}, {T}: Search your library for a land card, reveal it, and put it into your hand. Then shuffle your library. Activate this ability only if an opponent controls more lands than you. text={W}, {T}: Search your library for a land card, reveal it, and put it into your hand. Then shuffle your library. Activate this ability only if an opponent controls more lands than you.
@@ -1304,12 +1304,6 @@ type=Enchantment
text=Each noncreature, non-Equipment artifact is an Equipment with equip {X} and "Equipped creature gets +X/+0," where X is that artifact's converted mana cost. text=Each noncreature, non-Equipment artifact is an Equipment with equip {X} and "Equipped creature gets +X/+0," where X is that artifact's converted mana cost.
[/card] [/card]
[card] [card]
name=Blustersquall
text=Tap target creature you don't control. -- Overload {3}{U} (You may cast this spell for its overload cost. If you do, change its text by replacing all instances of "target" with "each.")
mana={U}
type=Instant
[/card]
[card]
name=Boar Umbra name=Boar Umbra
mana={2}{G} mana={2}{G}
type=Enchantment type=Enchantment
@@ -2380,12 +2374,6 @@ type=Enchantment
text=Whenever any spell is played, counter that spell if each player, other than the caster and his or her teammates, agrees to choose and discard a card. Those players must discard those cards after agreeing. Checks and Balances may be played only in a game with three or more players. text=Whenever any spell is played, counter that spell if each player, other than the caster and his or her teammates, agrees to choose and discard a card. Those players must discard those cards after agreeing. Checks and Balances may be played only in a game with three or more players.
[/card] [/card]
[card] [card]
name=Chemister's Trick
text=Target creature you don't control gets -2/-0 until end of turn and attacks this turn if able. -- Overload {3}{U}{R} (You may cast this spell for its overload cost. If you do, change its text by replacing all instances of "target" with "each.")
mana={U}{R}
type=Instant
[/card]
[card]
name=Chicken Egg name=Chicken Egg
mana={1}{R} mana={1}{R}
type=Summon — Egg type=Summon — Egg
@@ -2995,12 +2983,6 @@ mana={U}{U}
type=Enchantment type=Enchantment
[/card] [/card]
[card] [card]
name=Counterflux
text=Counterflux can't be countered by spells or abilities. -- Counter target spell you don't control. -- Overload {1}{U}{U}{R} (You may cast this spell for its overload cost. If you do, change its text by replacing all instances of "target" with "each.")
mana={U}{U}{R}
type=Instant
[/card]
[card]
name=Countryside Crusher name=Countryside Crusher
text=At the beginning of your upkeep, reveal the top card of your library. If it's a land card, put it into your graveyard and repeat this process. -- Whenever a land card is put into your graveyard from anywhere, put a +1/+1 counter on Countryside Crusher. text=At the beginning of your upkeep, reveal the top card of your library. If it's a land card, put it into your graveyard and repeat this process. -- Whenever a land card is put into your graveyard from anywhere, put a +1/+1 counter on Countryside Crusher.
mana={1}{R}{R} mana={1}{R}{R}
@@ -3300,12 +3282,6 @@ mana={2}{G}{G}
type=Enchantment type=Enchantment
[/card] [/card]
[card] [card]
name=Cyclonic Rift
text=Return target nonland permanent you don't control to its owner's hand. -- Overload {6}{U} (You may cast this spell for its overload cost. If you do, change its text by replacing all instances of "target" with "each.")
mana={1}{U}
type=Instant
[/card]
[card]
name=Cyclopean Giant name=Cyclopean Giant
text=When Cyclopean Giant is put into a graveyard from the battlefield, target land becomes a Swamp. Exile Cyclopean Giant. text=When Cyclopean Giant is put into a graveyard from the battlefield, target land becomes a Swamp. Exile Cyclopean Giant.
mana={2}{B}{B} mana={2}{B}{B}
@@ -4071,12 +4047,6 @@ mana={3}{B} // {2}{G}
type=Sorcery // Sorcery type=Sorcery // Sorcery
[/card] [/card]
[card] [card]
name=Downsize
text=Target creature you don't control gets -4/-0 until end of turn. -- Overload {2}{U} (You may cast this spell for its overload cost. If you do, change its text by replacing all instances of "target" with "each.")
mana={U}
type=Instant
[/card]
[card]
name=Draco name=Draco
text=Domain - Draco costs {2} less to cast for each basic land type among lands you control. -- Flying -- Domain - At the beginning of your upkeep, sacrifice Draco unless you pay {1}0}. This cost is reduced by {2} for each basic land type among lands you control. text=Domain - Draco costs {2} less to cast for each basic land type among lands you control. -- Flying -- Domain - At the beginning of your upkeep, sacrifice Draco unless you pay {1}0}. This cost is reduced by {2} for each basic land type among lands you control.
mana={16} mana={16}
@@ -4278,12 +4248,6 @@ power=1
toughness=1 toughness=1
[/card] [/card]
[card] [card]
name=Dynacharge
text=Target creature you control gets +2/+0 until end of turn. -- Overload {2}{R} (You may cast this spell for its overload cost. If you do, change its text by replacing all instances of "target" with "each.")
mana={R}
type=Instant
[/card]
[card]
name=Echo Chamber name=Echo Chamber
text={4}, {T}: An opponent chooses target creature he or she controls. Put a token that's a copy of that creature onto the battlefield. That token gains haste until end of turn. Exile the token at the beginning of the next end step. Activate this ability only any time you could cast a sorcery. text={4}, {T}: An opponent chooses target creature he or she controls. Put a token that's a copy of that creature onto the battlefield. That token gains haste until end of turn. Exile the token at the beginning of the next end step. Activate this ability only any time you could cast a sorcery.
mana={4} mana={4}
@@ -4334,12 +4298,6 @@ type=Land
text={T}: Add {1} to your mana pool. {T}: Add {2} to your mana pool. Spend this mana only to cast colorless Eldrazi spells or activate abilities of colorless Eldrazi. text={T}: Add {1} to your mana pool. {T}: Add {2} to your mana pool. Spend this mana only to cast colorless Eldrazi spells or activate abilities of colorless Eldrazi.
[/card] [/card]
[card] [card]
name=Electrickery
text=Electrickery deals 1 damage to target creature you don't control. -- Overload {1}{R} (You may cast this spell for its overload cost. If you do, change its text by replacing all instances of "target" with "each.")
mana={R}
type=Instant
[/card]
[card]
name=Electropotence name=Electropotence
text=Whenever a creature enters the battlefield under your control, you may pay {2}{R}. If you do, that creature deals damage equal to its power to target creature or player. text=Whenever a creature enters the battlefield under your control, you may pay {2}{R}. If you do, that creature deals damage equal to its power to target creature or player.
mana={2}{R} mana={2}{R}
@@ -10075,18 +10033,6 @@ mana={1}{U}{U}
type=Sorcery type=Sorcery
[/card] [/card]
[card] [card]
name=Mizzium Mortars
text=Mizzium Mortars deals 4 damage to target creature you don't control. -- Overload {3}{R}{R}{R} (You may cast this spell for its overload cost. If you do, change its text by replacing all instances of "target" with "each.")
mana={1}{R}
type=Sorcery
[/card]
[card]
name=Mizzium Skin
text=Target creature you control gets +0/+1 and gains hexproof until end of turn. -- Overload {1}{U} (You may cast this spell for its overload cost. If you do, change its text by replacing all instances of "target" with "each.")
mana={U}
type=Instant
[/card]
[card]
name=Mizzium Transreliquat name=Mizzium Transreliquat
text={3}: Mizzium Transreliquat becomes a copy of target artifact until end of turn. -- {1}{U}{R}: Mizzium Transreliquat becomes a copy of target artifact and gains this ability. text={3}: Mizzium Transreliquat becomes a copy of target artifact until end of turn. -- {1}{U}{R}: Mizzium Transreliquat becomes a copy of target artifact and gains this ability.
mana={3} mana={3}
@@ -15879,12 +15825,6 @@ type=Enchantment
subtype=Aura subtype=Aura
[/card] [/card]
[card] [card]
name=Street Spasm
text=Street Spasm deals X damage to target creature without flying you don't control. -- Overload {X}{X}{R}{R} (You may cast this spell for its overload cost. If you do, change its text by replacing all instances of "target" with "each.")
mana={X}{R}
type=Instant
[/card]
[card]
name=Strength of the Tajuru name=Strength of the Tajuru
text=Multikicker {1} (You may pay an additional {1} any number of times as you cast this spell.) -- Choose target creature, then choose another target creature for each time Strength of the Tajuru was kicked. Put X +1/+1 counters on each of them. text=Multikicker {1} (You may pay an additional {1} any number of times as you cast this spell.) -- Choose target creature, then choose another target creature for each time Strength of the Tajuru was kicked. Put X +1/+1 counters on each of them.
mana={X}{G}{G} mana={X}{G}{G}
@@ -16368,12 +16308,6 @@ mana={U}
type=Enchantment type=Enchantment
[/card] [/card]
[card] [card]
name=Teleportal
text=Target creature you control gets +1/+0 until end of turn and is unblockable this turn. -- Overload {3}{U}{R} (You may cast this spell for its overload cost. If you do, change its text by replacing all instances of "target" with "each.")
mana={U}{R}
type=Sorcery
[/card]
[card]
name=Telling Time name=Telling Time
text=Look at the top three cards of your library. Put one of those cards into your hand, one on top of your library, and one on the bottom of your library. text=Look at the top three cards of your library. Put one of those cards into your hand, one on top of your library, and one on the bottom of your library.
mana={1}{U} mana={1}{U}
@@ -17394,12 +17328,6 @@ power=3
toughness=3 toughness=3
[/card] [/card]
[card] [card]
name=Vandalblast
text=Destroy target artifact you don't control. -- Overload {4}{R} (You may cast this spell for its overload cost. If you do, change its text by replacing all instances of "target" with "each.")
mana={R}
type=Sorcery
[/card]
[card]
name=Vanguard's Shield name=Vanguard's Shield
text=Equipped creature gets +0/+3 and can block an additional creature. -- Equip {3} ({3}: Attach to target creature you control. Equip only as a sorcery.) text=Equipped creature gets +0/+3 and can block an additional creature. -- Equip {3} ({3}: Attach to target creature you control. Equip only as a sorcery.)
mana={2} mana={2}
+2
View File
@@ -214,6 +214,8 @@ public:
PUT_INTO_PLAY_WITH_KICKER = 31, PUT_INTO_PLAY_WITH_KICKER = 31,
STANDARD_FIZZLER = 32, STANDARD_FIZZLER = 32,
PAYZERO_COST = 33, PAYZERO_COST = 33,
OVERLOAD_COST = 34,
BESTOW_COST = 35,
}; };
}; };
+1 -1
View File
@@ -55,7 +55,7 @@ public:
Pos* view; Pos* view;
int X; int X;
int castX; int castX;
int alternateCostPaid[ManaCost::MANA_PAID_WITH_SUSPEND + 1]; int alternateCostPaid[ManaCost::MANA_PAID_WITH_BESTOW + 1];
int paymenttype; int paymenttype;
int castMethod; /* Tells if the card reached its current zone by being cast or not (brought into the zone by an effect). non 0 == cast, 0 == not cast */ int castMethod; /* Tells if the card reached its current zone by being cast or not (brought into the zone by an effect). non 0 == cast, 0 == not cast */
int frozen; int frozen;
+14 -1
View File
@@ -101,7 +101,7 @@ class MTGAlternativeCostRule: public PermanentAbility
{ {
protected: protected:
int isReactingToClick(MTGCardInstance * card, ManaCost * mana, ManaCost *alternateManaCost); int isReactingToClick(MTGCardInstance * card, ManaCost * mana, ManaCost *alternateManaCost);
int reactToClick(MTGCardInstance * card, ManaCost * alternateManaCost, int paymentType = ManaCost::MANA_PAID); int reactToClick(MTGCardInstance * card, ManaCost * alternateManaCost, int paymentType = ManaCost::MANA_PAID, bool overload = false);
string alternativeName; string alternativeName;
public: public:
int isReactingToClick(MTGCardInstance * card, ManaCost * mana = NULL); int isReactingToClick(MTGCardInstance * card, ManaCost * mana = NULL);
@@ -192,6 +192,19 @@ public:
virtual MTGPayZeroRule * clone() const; virtual MTGPayZeroRule * clone() const;
}; };
class MTGOverloadRule: public MTGAlternativeCostRule
{
public:
int isReactingToClick(MTGCardInstance * card, ManaCost * mana = NULL);
int reactToClick(MTGCardInstance * card);
virtual ostream& toString(ostream& out) const;
MTGOverloadRule(GameObserver* observer, int _id);
const string getMenuText()
{
return "Overload";
}
virtual MTGOverloadRule * clone() const;
};
class MTGSuspendRule: public MTGAlternativeCostRule class MTGSuspendRule: public MTGAlternativeCostRule
{ {
+3 -1
View File
@@ -48,7 +48,9 @@ public:
MANA_PAID_WITH_RETRACE = 6, MANA_PAID_WITH_RETRACE = 6,
MANA_PAID_WITH_MORPH = 7, MANA_PAID_WITH_MORPH = 7,
MANA_PAID_WITH_SUSPEND = 8, MANA_PAID_WITH_SUSPEND = 8,
MANA_PAID_WITH_OTHERCOST = 9 MANA_PAID_WITH_OVERLOAD = 9,
MANA_PAID_WITH_BESTOW = 10,
MANA_PAID_WITH_OTHERCOST = 11
}; };
ExtraCosts * extraCosts; ExtraCosts * extraCosts;
+2 -2
View File
@@ -18,8 +18,8 @@ using std::string;
#define SCALE_SELECTED 1.2f #define SCALE_SELECTED 1.2f
#define SCALE_NORMAL 1.0f #define SCALE_NORMAL 1.0f
#define SCALE_SHRINK 0.75f #define SCALE_SHRINK 0.75f
#define SCALE_SELECTED_LARGE 1.7F #define SCALE_SELECTED_LARGE 1.7f
#define SCALE_LARGE_NORMAL 1.5F #define SCALE_LARGE_NORMAL 1.5f
class SimpleButton: public JGuiObject class SimpleButton: public JGuiObject
{ {
+6
View File
@@ -303,6 +303,12 @@ bool Spell::FullfilledAlternateCost(const int &costType)
case ManaCost::MANA_PAID_WITH_SUSPEND: case ManaCost::MANA_PAID_WITH_SUSPEND:
hasFullfilledAlternateCost = (payResult == ManaCost::MANA_PAID_WITH_SUSPEND); hasFullfilledAlternateCost = (payResult == ManaCost::MANA_PAID_WITH_SUSPEND);
break; break;
case ManaCost::MANA_PAID_WITH_OVERLOAD:
hasFullfilledAlternateCost = (payResult == ManaCost::MANA_PAID_WITH_OVERLOAD);
break;
case ManaCost::MANA_PAID_WITH_BESTOW:
hasFullfilledAlternateCost = (payResult == ManaCost::MANA_PAID_WITH_BESTOW);
break;
} }
return hasFullfilledAlternateCost; return hasFullfilledAlternateCost;
+12 -2
View File
@@ -39,7 +39,9 @@ const string kAlternateCostKeywords[] =
"flashback", "flashback",
"retrace", "retrace",
"facedown", "facedown",
"suspended" "suspended",
"overload",
"bestow"
}; };
const int kAlternateCostIds[] = const int kAlternateCostIds[] =
{ {
@@ -51,7 +53,9 @@ const int kAlternateCostIds[] =
ManaCost::MANA_PAID_WITH_FLASHBACK, ManaCost::MANA_PAID_WITH_FLASHBACK,
ManaCost::MANA_PAID_WITH_RETRACE, ManaCost::MANA_PAID_WITH_RETRACE,
ManaCost::MANA_PAID_WITH_MORPH, ManaCost::MANA_PAID_WITH_MORPH,
ManaCost::MANA_PAID_WITH_SUSPEND ManaCost::MANA_PAID_WITH_SUSPEND,
ManaCost::MANA_PAID_WITH_OVERLOAD,
ManaCost::MANA_PAID_WITH_BESTOW
}; };
//Used for "dynamic ability" parsing //Used for "dynamic ability" parsing
@@ -1162,6 +1166,12 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
observer->addObserver(NEW MTGPayZeroRule(observer, -1)); observer->addObserver(NEW MTGPayZeroRule(observer, -1));
return NULL; return NULL;
} }
found = s.find("overloadrule");
if(found != string::npos)
{
observer->addObserver(NEW MTGOverloadRule(observer, -1));
return NULL;
}
//this rule handles attacking ability during attacker phase //this rule handles attacking ability during attacker phase
found = s.find("attackrule"); found = s.find("attackrule");
if(found != string::npos) if(found != string::npos)
+1 -1
View File
@@ -546,7 +546,7 @@ MTGCardInstance * MTGGameZone::removeCard(MTGCardInstance * card, int createCopy
copy->kicked = card->kicked; copy->kicked = card->kicked;
copy->storedCard = card->storedCard; copy->storedCard = card->storedCard;
copy->storedSourceCard = card->storedSourceCard; copy->storedSourceCard = card->storedSourceCard;
for (int i = 0; i < ManaCost::MANA_PAID_WITH_SUSPEND +1; i++) for (int i = 0; i < ManaCost::MANA_PAID_WITH_BESTOW +1; i++)
copy->alternateCostPaid[i] = card->alternateCostPaid[i]; copy->alternateCostPaid[i] = card->alternateCostPaid[i];
//stupid bug with tokens... //stupid bug with tokens...
+62 -1
View File
@@ -627,6 +627,8 @@ PermanentAbility(observer, _id)
int MTGAlternativeCostRule::isReactingToClick(MTGCardInstance * card, ManaCost * mana) int MTGAlternativeCostRule::isReactingToClick(MTGCardInstance * card, ManaCost * mana)
{ {
if (card->alias == 110000)
return 0;//overload has its own rule
ManaCost * alternateCost = card->getManaCost()->getAlternative(); ManaCost * alternateCost = card->getManaCost()->getAlternative();
if (!game->currentlyActing()->game->hand->hasCard(card) && !game->currentlyActing()->game->graveyard->hasCard(card) && !game->currentlyActing()->game->exile->hasCard(card)) if (!game->currentlyActing()->game->hand->hasCard(card) && !game->currentlyActing()->game->graveyard->hasCard(card) && !game->currentlyActing()->game->exile->hasCard(card))
return 0; return 0;
@@ -693,12 +695,17 @@ int MTGAlternativeCostRule::reactToClick(MTGCardInstance * card)
return reactToClick(card, alternateCost, ManaCost::MANA_PAID_WITH_ALTERNATIVE); return reactToClick(card, alternateCost, ManaCost::MANA_PAID_WITH_ALTERNATIVE);
} }
int MTGAlternativeCostRule::reactToClick(MTGCardInstance * card, ManaCost *alternateCost, int alternateCostType){ int MTGAlternativeCostRule::reactToClick(MTGCardInstance * card, ManaCost *alternateCost, int alternateCostType, bool overload){
Player * player = game->currentlyActing(); Player * player = game->currentlyActing();
ManaPool * playerMana = player->getManaPool(); ManaPool * playerMana = player->getManaPool();
//this handles extra cost payments at the moment a card is played. //this handles extra cost payments at the moment a card is played.
if(overload)
card->spellTargetType = "";
else if(card->model->data->spellTargetType.size())
card->spellTargetType = card->model->data->spellTargetType;
assert(alternateCost); assert(alternateCost);
if (alternateCost->isExtraPaymentSet() ) if (alternateCost->isExtraPaymentSet() )
{ {
@@ -1210,6 +1217,60 @@ MTGPayZeroRule * MTGPayZeroRule::clone() const
return NEW MTGPayZeroRule(*this); return NEW MTGPayZeroRule(*this);
} }
MTGOverloadRule::MTGOverloadRule(GameObserver* observer, int _id) :
MTGAlternativeCostRule(observer, _id)
{
aType = MTGAbility::OVERLOAD_COST;
}
int MTGOverloadRule::isReactingToClick(MTGCardInstance * card, ManaCost * mana)
{
if (card->alias != 110000)
return 0;
Player * player = game->currentlyActing();
ManaCost * cost = NEW ManaCost(card->model->data->getManaCost()->getAlternative());
if(card->getIncreasedManaCost()->getConvertedCost())
cost->add(card->getIncreasedManaCost());
if(card->getReducedManaCost()->getConvertedCost())
cost->remove(card->getReducedManaCost());
if (card->isLand())
return 0;
if (!player->game->graveyard->hasCard(card) && !player->game->exile->hasCard(card) && !player->game->hand->hasCard(card))
return 0;
if ((!card->has(Constants::CANPLAYFROMGRAVEYARD) && player->game->graveyard->hasCard(card))||(!card->has(Constants::CANPLAYFROMEXILE) && player->game->exile->hasCard(card)))
return 0;
return MTGAlternativeCostRule::isReactingToClick(card, mana, cost);
}
int MTGOverloadRule::reactToClick(MTGCardInstance * card)
{
if (!isReactingToClick(card))
return 0;
ManaCost * cost = NEW ManaCost(card->model->data->getManaCost()->getAlternative());
if(card->getIncreasedManaCost()->getConvertedCost())
cost->add(card->getIncreasedManaCost());
if(card->getReducedManaCost()->getConvertedCost())
cost->remove(card->getReducedManaCost());
card->paymenttype = MTGAbility::OVERLOAD_COST;
return MTGAlternativeCostRule::reactToClick(card, cost, ManaCost::MANA_PAID_WITH_OVERLOAD, true);
}
ostream& MTGOverloadRule::toString(ostream& out) const
{
out << "MTGOverloadRule ::: (";
return MTGAbility::toString(out) << ")";
}
MTGOverloadRule * MTGOverloadRule::clone() const
{
return NEW MTGOverloadRule(*this);
}
/////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////
bool MTGAttackRule::select(Target* t) bool MTGAttackRule::select(Target* t)