Here is a small example inspired from SDLmain.c:
g_launcher = new JGameLauncher();
InitGame();
MTGCollection()->loadFolder("sets/primitives/");
MTGCollection()->loadFolder("sets/", "_cards.dat");
options.reloadProfile();
TestSuite testSuite("test/_tests.txt");
int result = testSuite.run();
DestroyGame();
delete g_launcher;
return result;
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
Edge of autumn
Mirrorworks
Clone of the card now have the same image as original
Issue with cloning and trigger "nontoken * enters"
Blitzkrig rules
Hermit druid rules
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]
example:
[card]
name=AEther Burst
target=<plusonetype:AEther Burst:graveyard>creature|battlefield
auto=moveto(ownerhand)
text=Return up to X target creatures to their owners' hands, where X is one plus the number of cards named AEther Burst in all graveyards as you cast AEther Burst.
mana={1}{U}
type=Instant
[/card]
[card]
name=Vitalizing Cascade
auto=life:Xplusthree
text=You gain X plus 3 life.
mana={X}{G}{W}
type=Instant
[/card]
example usage:
auto=life:thriceX
auto=@damaged(player):life:twicethatmuch
auto=life:twicetype:creature:mybattlefield
so to code cards like Debt to the Deathless
[card]
name=Debt to the Deathless
auto=@lifeloss(opponent):life:thatmuch controller
auto=life:-twiceX opponent
text=Each opponent loses two times X life. You gain life equal to the life lost this way.
mana={X}{W}{W}{B}{B}
type=Sorcery
[/card]
#HINT:good(icy prison)
ai will act as though the effects of this card are now good, choosing to cast it on it's own creatures.
#HINT:bad(ancestral recall)
ai will now use this card targeting the opponent.
good in cases where you are trying to mill the opponent
the effects in wagic have gotten so complex that ai simply has no idea what some cards should target. this helps in most of the cases.
first, i added a timer to hide the big card after 5 secs or until a movement is registered.
2nd, removed the advancing of phases with flick up.
3rd added a flick left to "show/hide hand"
4th, fixed an error in the logic of "getDifficulty" part of the reason optimizedhand was not working.
finally, unrefactored the checks of optimized hand, it was FAR to difficult to see what was actually happening the way it was coded.
optimizedhand is finally working again,
toggledifficulty and optimizedhand will again trigger and greatly improve ai vs player matches
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.
"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