Issue
attach then equip: plating will give bonus to both creatures
Fix
Changed "attach" to "retarget target(creature|mybattlefield)"
as this doesnot admit this bug
Attach should become deprecated in future
- saves source card in storedSourceCard for ATransform
- adds support for WParsedInt in pay as "pay[[{value:WParsedInt}]]":
name=Spell Rupture
target=*|stack
auto=if cantargetcard(*|opponentstack) then transforms((,newability[pay[[{value:power:highest:creature:opponentbattlefield}]] name(pay {value} mana) donothing?fizzle])) forever
text=Counter target spell unless its controller pays {X}, where X is the greatest power among creatures you control.
mana={1}{U}
type=Instant
- adds support for {x} in *some* “pay” abilities (Syncopate):
name=Syncopate
target=*|stack
auto=transforms((,newability[pay[[{x}]] name(pay {value} mana) donothing?fizzleto(exile)])) forever
text=Counter target spell unless its controller pays {X}. If that spell is countered this way, exile it instead of putting it into its owner's graveyard.
mana={X}{U}
type=Instant
- support of "name(pay {value} mana)" in pay abilities to show actual number to pay (see example above)
Get rid of common code
Better naming of zone (where we put spell after countering)
More generic syntax: fizzleto(X) where X in [hand, exile, librarytop]
which will give more flexibility later
added
"whenever a creature enters the battlefield you may pay {1}, if you do gain one life"
conditional may pay({cost}) effect
this version is a super type ability, and can only be used in certain combos.
to nest you will need to use it in its subtype pay[[{cost}]] effect
pay keyword can have sideeffects coded as follows
pay[[{1}]] life:1?life:-1
pay one mana and gain 1 life, if you dont then you lose one life. notice no space between the abilities and the question mark.
added castcard()
a method to cast a targeted card, this contains the following subkeywords which can be used in combinations
(normal)
(restricted)
(copied)
(noevent)
castcard(restricted copied noevent) for example will cast a card that is a copy or the spell without sending a cast event only when the spell is castable.
"normal" subkeyword cast the actual spell, not a copy.
extended the use of exiledeath to everyzone, any card going from any zone to graveyard is placed in exile if it has exiledeath.
limited swipe left to open hand only when hand is closed view.
"moveto(" can now be named.
i choose to use other cost instead of creating a brand new cost type.
otherrestriction determines if the card is the miracle for the turn.
[card]
name=Devastation Tide
auto=all(*[-land]) moveto(ownerhand)
other={1}{u} name(Miracle)
otherrestriction=miracle
text=Return all nonland permanents to their owners' hands. -- Miracle {1}{U} (You may cast this card for its miracle cost when you draw it if it's the first card you drew this turn.)
mana={3}{U}{U}
type=Sorcery
[/card]
opponentpoolsave(
mypoolsave(
ex:Upwelling
added a tag for mana, doesntempty
add{g}{g}{g} doesntempty
what this does is make THAT mana remain in the pool until end of turn.
ex:
Sakura-Tribe Springcaller
added
cantbeblockerof(this)<--this = the card who owns the ability.
cantbeblockerof(targetchooser) <--the target cant block anything targetable by this targetchooser.
spin engine and similar will use cantbeblockerof(this).
others were done with a workaround, which i hope will be updated soon.
ownerscontrol
opponentscontrol
ownerscontrol returns 1 if the owner has the card in thier battlefield. 0 otherwise. vice versa.
this should make it easier to add cards which should be treated differently depending on who controls them.
"donothing"
this is to avoid using powerandtoughness 0/0 ability to mean "do nothing"
old code
[card]
name=Inquisition
target=player
auto=target(*|targetedpersonshand) 0/0
auto=foreach(*[white]|targetedpersonshand) damage:1 targetedplayer
text=Target player reveals his or her hand. Inquisition deals damage to that player equal to the number of white cards in his or her hand.
mana={2}{B}
type=Sorcery
[/card]
new code
[card]
name=Inquisition
target=player
auto=target(*|targetedpersonshand) donothing
auto=foreach(*[white]|targetedpersonshand) damage:1 targetedplayer
text=Target player reveals his or her hand. Inquisition deals damage to that player equal to the number of white cards in his or her hand.
mana={2}{B}
type=Sorcery
[/card]
auto=choice damage:1 target(creature) restriction{type(creature[blue])~morethan~1}
this choice menu will only appear is there is more than one blue creature inplay
auto=replacedraw choice damage:2
auto=replacedraw choice draw:2 noreplace
notice noreplace exempts the draw from sending a draw event. draw events and drawn events are seperate events.
added dredge and it's rules.
[card]
name=Dakmor Salvage
auto=tap
auto={t}:add{b}
dredge=dredge(2)
text=Dakmor Salvage enters the battlefield tapped. -- {T}: Add {B} to your mana pool. -- Dredge 2 (If you would draw a card, instead you may put exactly two cards from the top of your library into your graveyard. If you do, return this card from your graveyard to your hand. Otherwise, draw a card.)
type=Land
[/card]
Added variable "controllerturn", "opponentturn" -> returns integer value if its your turn then 1 if not then 0.
ex. use
restriction=during my turn
otherrestriction=during opponent turn
auto=this(variable{controllerturn}) lord(creature|mybattlefield) 8/0
auto=this(variable{opponentturn}) lord(creature|mybattlefield) 0/8
paid(blah)
auto=if paid(alternative) then damage:3 target(creature)
auto=if paid(alternative) then life:10 target(player)
auto=ifnot paid(alternative) then damage:3 controller
auto=ifnot paid(alternative) then life:4 opponent
it can be used any place a restriction can be used.
rearranged the constants for the payment type keywords to match the order we int the alternatePayment array on a card, added keywords for the remaining payment types,
"notpaid",
"paidmana",
the 2 above pretain to paying the real manacost of a card
it checks the mana={1} cost line and is not joined to the other types.
"kicker",
"alternative",
"buyback",
"flashback",
"retrace",
"facedown",
"suspended"
note: all test pass in this revision.
restriction{{ }} incases where we will have squiqqly brackets in a tc.
this corrects the bug where helix pennicle restricted trigger was not triggering.
this should allow players to code cards with the detain ability of rtr correctly, as well as a handful of similar cards in the unsupported text.
detain is coded
auto={1}{t}:target(creature|opponentBattlefield) transforms((Detained,newability[cantattack],newability[cantblock],newability[noactivatedability])) uynt
enjoy
format is as follows
HINT#combo hold(blah|myhand)^until(blah|mygraveyard)^until(blah|opponentshand)^restriction{type(creature|mybattlefield)~morethan~2}^cast(blah) targeting(blah|mygraveyard)^totalmananneeded({g}{g}{r}{u}{2})
the ai can be told to hold more then one card, until as many condiations as you want are met, until( is a TC and can basically be used in a fasion of saying "hold arbor elf until you have a lord of atlantas in play and a gaint growth in you hand"
once the condiations are met you can later tell it to cast(gaint growth) targeting(arbor elf[fresh]|mybattlefield)...
I also included the whole of the games restrictions system...
so you can get really really creative with this so far.
the next thing I will do is ability targeting and card favoring.
it requires an update to your mtg rules txt...
the coding is as follows
[card]
name=Arbor Elf
mana={g}
auto=soulbond 1/3
auto=soulbond {t}:add{g}
abilities=soulbond
type=Creature
subtype=Elf Druid
power=1
toughness=1
[/card]
auto=soulbond *any ability supported by wagic*
abilities=soulbond
the above arbor elf gives itself and its soulbond creature a 1/3 bonus and the ability to tap for green mana.
{x:black}
{x:color}
creating a snapshot of a card instance in garbage for stored cards, the issue with previous version was it was using base model value instead of what the storedcard was actually at the time it was in battlefield. example, animal boneyard test was coming up 1 toughness short becuase the creature storedcard pointed to was sent to graveyard for the sacrifice.
changed myStored TargetChooser to use storedSourceCard instead, as this is supposed to point to the actual card and not a snapshot.