Examples:
# COUNTER-MOVING CARDS #
[card]
name=Ghave, Guru of Spores
auto=counter(1/1,5)
auto={1}{C(1/1,-1),creature|mybattlefield}:token(Saproling,Creature Saproling,1/1,green)
auto={1}{S(creature|mybattlefield}:counter(1/1,1) target(creature)
text=Ghave, Guru of Spores enters the battlefield with five +1/+1 counters on it. -- {1}, Remove a +1/+1 counter from a creature you control: Put a 1/1 green Saproling creature token onto the battlefield. -- {1}, Sacrifice a creature: Put a +1/+1 counter on target creature.
mana={2}{B}{G}{W}
type=Legendary Creature
subtype=Fungus Shaman
power=0
toughness=0
[/card]
# IF...THEN #
[card]
name=Goblin Goon
auto=@each my attackers:if type(creature|opponentbattlefield)~morethan~type(creature|mybattlefield) then transforms((,cantattack)) ueot
auto=@each my blockers:if type(creature|opponentbattlefield)~morethan~type(creature|mybattlefield) then transforms((,cantblock)) ueot
text=Goblin Goon can't attack unless you control more creatures than defending player. -- Goblin Goon can't block unless you control more creatures than attacking player.
mana={3}{R}
type=Creature
subtype=Goblin Mutant
power=6
toughness=6
[/card]
[card]
name=Pulse of the Tangle
auto=token(Beast,Creature Beast,3/3,green)
auto=if type(creature|opponentbattlefield)~morethan~type(creature|mybattlefield) then moveto(myhand)
text=Put a 3/3 green Beast creature token onto the battlefield. Then if an opponent controls more creatures than you, return Pulse of the Tangle to its owner's hand.
mana={1}{G}{G}
type=Sorcery
[/card]
# MULTIKICKER #
[card]
name=Joraga Warcaller
auto=kicker counter(1/1,kicked)
kicker=multi{1}{G}
auto=thisforeach(counter{1/1.1}) lord(other elf|myBattlefield) 1/1
text=Multikicker {1}{G} (You may pay an additional {1}{G} any number of times as you cast this spell.) -- Joraga Warcaller enters the battlefield with a +1/+1 counter on it for each time it was kicked. -- Other Elf creatures you control get +1/+1 for each +1/+1 counter on Joraga Warcaller.
mana={G}
type=Creature
subtype=Elf Warrior
power=1
toughness=1
[/card]
# PROLIFERATE #
[card]
name=Contagion Clasp
auto=counter(-1/-1,1) target(creature)
auto={4}{T}:target(proliferation) proliferate
text=When Contagion Clasp enters the battlefield, put a -1/-1 counter on target creature. -- {4}, Tap: Proliferate. (You choose any number of permanents and/or players with counters on them, then give each another counter of a kind already there.)
mana={2}
type=Artifact
[/card]
# MULTI-TARGET #
[card]
name=Argothian Elder
auto={T}:target(<2>land) untap
text={T}: Untap two target lands.
mana={3}{G}
type=Creature
subtype=Elf Druid
power=2
toughness=2
[/card]
[card]
name=Aven Augur
abilities=flying
auto={S}:target(<upto:2>other creature) moveTo(ownerhand) myUpkeepOnly
text=Flying -- Sacrifice Aven Augur: Return up to two target creatures to their owners' hands. Activate this ability only during your upkeep.
mana={3}{U}
type=Creature
subtype=Bird Wizard
power=2
toughness=2
[/card]
[card]
name=Bone Harvest
target=<anyamount>creature|mygraveyard
auto=moveTo(mylibrary)
auto=@next upkeep:draw:1 controller
text=Put any number of target creature cards from your graveyard on top of your library. -- Draw a card at the beginning of the next turn's upkeep.
mana={2}{B}
type=Instant
[/card]
Test suite tests will follow on weekend.
Have fun!
added abilities:
proliferate
ProliferateChooser:new targetchooser for cards with counter and poison counters "proliferation".
MenuAbility:new internal ability to create custom menus of abilities which can be activated in sequence one after another.
multikicker, syntax kicker=multi{b}
works with variable word "kicked", the amount of times it was kicked.
target=<number>tc,target=<upto:>tc,target=<anyamount>tc,target(<number>tc),target(<upto:>tc),target(<anynumber>tc);
multitarget is now supported with the exception of "devided any way you choose" which can not be supported becuase we allow detoggling of targeted cards with a "second" click....so you can not click the same card 2 times to add it to the targets list twice for example.
this is minor, as the bulk of multitarget is not "devided"
removed 's' parsing for multitarget, added a limit of 1000 to "unlimited" for easier handling; we currently can't handle activation of an ability on a 1000 cards very well on any platform(infact i don't suggest it)
Countershroud(counterstring), this MTGAbility allows you to denote that a card can not have counters of the type "counterstring" put on it.
"any" is for no counters allowed at all. this is a replacement effect. cards state that they can still be the targets of counter effects, however on resolve nothing is placed on them instead.
@counteradded(counterstring) from(target):,@counterremoved(counterstring) from(target):: these are triggers for cards which state "whenever you add a counter of "counterstring" to "target"; added counterEvents struct;
other changes:
added support for ai handling of multitargeted spells.
changed a few of delete( into SAFE_DELETE(, safed up a couple areas where they did not seem safe to me;
added better handling of menus presented to ai, it will try to select the best based on eff returns.
added varible lastactioncontroller for ai use, it keeps it truely from ever tripping over itself and brings ai more inline with MTG rules.
converted TC into a protected member.
added "abilitybelongsto" string to tc, and set "owner" of the tc. a tc should never belong to "no one" it should always have a owner.
abilitybelongs to string is solely for easier debugging, i found it was a pain to never know what ability created a tc while i coded multitarget. the owner of the tc is the only one that should be using it, if an ability needs to declare the opponent as the owner (choose discard which is currently unsupported for example) this will allow us to better handle that situation by setting the tc owner in the ability which called it.
rewrote the logic of "checkonly" in ai choose targets, the only time it is "checkonly" is when it is trying to see if it had a target for a spell before it cast it, i now set this in the actual function call instead, the old method was far to error prone.
wrote logic for ai checking of menu objects presented to it,
ai will now make better choices when a menu is presented to it based on what it already knows. this changes it from it's old method of "just click the first option".
taught ai how to use multi-mana producers such as birds and duel lands by adding a method for it to find it's mana for a payment. it can effectively use cards like birds of paradise and sol ring(without locking up). It's primary method of pMana searching was maintain for performance(no need to deep search if we have it in pMana).
added a vector to actionlayer to store mana abilities for pMana. this provides us with a dramatic improvement when mana lords are present by reducing the amount of objects that need checking when ai checks pMana.
with 80 mana objects and a ton of lords one instance i checked went from 8000ish checks down to 80<===big difference.
added "tapped" green coloring(sorry i missed that!)...added red coloring to current actionLayers current action card (usually the source).
changed "type(" restrictions second amount from atoi into wparsedint for more flexiable coding.
add "&" parsing to CD targetchooser, removed "iscolorandcolor" variables and functions becuase they were a hack the real fix was this.
cretaure[dragon&black&blue] a creature that is a dragon, and black and also blue.
changed some of the ai computeactions and
removed unneeded gaurds in ai chooseblockers, they did more harm then good.
-- zipFS has several limitations...
--- in a general way, seekg doesn't work... so getting a file's size needs to be done through JFileSystem.
--- getLine on files open with zipFS doesn't work so great. Not sure if it is a normal issue because files are open in binary or not... JFileSystem therefore offers a "readIntoString" function that needs to be used instead of the usual "getline" technique. However getLine can then be used on a stream connected to the string.
-- tested on Windows and PSP, I also made sure android still works, but haven't tested zip support on Android.
-- I tried to maintain backwards compatibility, but this might break on some platforms, if I broke some platforms and you can't find a way to fix them, please contact me and we'll figure something out
-- This removes wagic::ifstream. I didn't reimplement the securities that were involved in this, apologies for that. Might be useful to reimplement such securities in JFileSystem
-- I haven't tested options/profiles in a deep way, it is possible I broke that.
- rewrote some code dealing with text formatting for a card when rendering in text mode. I could swear my code has been reverted. If somebody has good reason to believe we should re-process the string formatting on every frame, please let me now. I believe my change can help rendering speed of text mode a lot.
- counters change to vector instead of array
this fixes an issue with infect creatures not triggering "bloodthirst" ...all other cases this was working correctly, bloodthirst however checks the damageCount.....