Primeval Titan (Working & Added)

Card coding that have been confirmed working and added to the SVN are moved in this forum. Do not post here.
mnguyen
Posts: 229
Joined: Thu Apr 29, 2010 4:13 pm

Primeval Titan (Working & Added)

Post by mnguyen »

Hey all,
I was wondering if anybody could critique what I have done for Primeval Titan on my own machine. I've tried to test it as much as I can. I think I've weeded out the bugs. I used a combination of the coding done for Zeth's addon for sun titan and the posting for Patron of the Moon. Posted here: viewtopic.php?f=21&t=1910&p=15002&hilit=offering#p15002

I tried a few other ways but I couldn't get the second land to tap correctly. Either that or the card allowed more than 2 lands to be brought out. This solution works nicely in most cases.

I think this could be applied to Grave Titan as well. Although I think Grave Titan is less complicated as it generates zombie tokens and doesn't do anything ultra complicated other than that. I'll post that too if requested.

btw, I don't know what the numbering scheme is for the cards, I just used the id for sun titan as a base and added to that.
Thanks in advance!
--Michael

Code: Select all

[card]
name=Primeval Titan Fetch Land 1
auto=may moveto(myBattlefield) target(land|myLibrary) && tap
auto=@movedto(this|exile):token(-335544669)
auto=moveto(exile)
type=nothing
id=-335544668
type=nothing
[/card]


[card]
name=Primeval Titan Fetch Land 2
auto=may moveto(myBattlefield) target(land|myLibrary) && tap
auto=moveto(exile)
type=nothing
id=-335544669
type=nothing
[/card]

[card]
name=Primeval Titan
auto=may token(-335544668)
auto={c(0/0,-1,Fetch)}: token(-335544668) limit:1
auto=@each mycombatdamage: counter(0/0,1,Fetch) target(primeval titan[attacking])
auto=@each mycombatends: thisforeach(counter{0/0.1.Fetch}): counter(0/0,-1,Fetch) all(this)
mana={4}{G}{G}
type=Creature
subtype=Giant
power=6
toughness=6
[/card]
Zethfox
Posts: 3029
Joined: Thu Jun 10, 2010 11:28 pm

Re: coding for Primeval Titan

Post by Zethfox »

the biggest bug is that if he dies in combat damage you should still be able to activate his effect...since he "attacked"...we really need a way to check attacked or blocked BEFORE combat damage step :(
mnguyen
Posts: 229
Joined: Thu Apr 29, 2010 4:13 pm

Re: coding for Primeval Titan

Post by mnguyen »

That's right. I couldn't do that without giving every attacking primeval titan the ability to bring in land equal to the number of primeval titans onscreen. Coding it for the select attackers phase doesn't work since you could easily remove him as an attacker and add it again to regnerate the effect. ( like "Veterans of the Depths"). I could try to code it against the select blockers phase of the opponents... hmmm....
mnguyen
Posts: 229
Joined: Thu Apr 29, 2010 4:13 pm

Re: coding for Primeval Titan

Post by mnguyen »

This seems to work like a charm now. Except you have to remember to activate the counters as an interrupt before it moves onto the phase (combatdamage).
I included a revised "Sun Titan" with the same modification. I can't figure out how to remove the dependency of having to manually activate the counter on the titan. I'll leave that to the experts. I just wanted to be able to play test one of my decks I've created. It seems to be working.

What do you think Zethfox?

==Michael

Code: Select all

[card]
name=Primeval Titan Fetch Land 1
auto=may moveto(myBattlefield) target(land|myLibrary) && tap
auto=@movedto(this|exile):token(-335544669)
auto=moveto(exile)
type=nothing
id=-335544668
type=nothing
[/card]
[card]
name=Primeval Titan Fetch Land 2
auto=may moveto(myBattlefield) target(land|myLibrary) && tap
auto=moveto(exile)
id=-335544669
type=nothing
[/card]
[card]
name=Primeval Titan
abilities=trample
auto=may token(-335544668)
auto={c(0/0,-1,Fetch)}: token(-335544668) limit:1
auto=@each myblockers: counter(0/0,1,Fetch) target(primeval titan[attacking])
auto=@each mycombatdamage: thisforeach(counter{0/0.1.Fetch}): counter(0/0,-1,Fetch) all(this)
mana={4}{G}{G}
type=Creature
subtype=Giant
power=6
toughness=6
[/card]

[card]
name=Grave Titan Zombie Token
auto=token(Zombie,Creature Zombie,2/2,black) * 2
auto=moveto(exile)
id=-335544670
type=nothing
[/card]
[card]
name=Grave Titan
abilities=deathtouch
auto=token(Zombie,Creature Zombie,2/2,black) * 2
auto={c(0/0,-1,Fetch)}: token(-335544670) limit:1
auto=@each myblockers: counter(0/0,1,Fetch) target(grave titan[attacking])
auto=@each mycombatdamage: thisforeach(counter{0/0.1.Fetch}): counter(0/0,-1,Fetch) all(this)
mana={B}
type=Creature
subtype=Giant
power=6
toughness=6
[/card]
[card]
name=sun titan
auto=counter(0/0,0,Fetch)
auto=may moveTo(mybattlefield) target(*[-sorcery;-instant;manacost<=3]|mygraveyard)
auto={c(0/0,-1,Fetch)}: token(-335544667) limit:1
auto=@each myblockers: counter(0/0,1,Fetch) target(sun titan[attacking])
auto=@each mycombatdamage: thisforeach(counter{0/0.1.Fetch}): counter(0/0,-1,Fetch) all(this)
text=useless text
mana={4}{w}{w}
power=6
toughness=6
abilities=vigilance
type=creature
subtype=gaint
[/card]

[card]
name=titanfetch
auto=may moveTo(mybattlefield) target(*[-sorcery;-instant;manacost<=3]|mygraveyard)
auto=moveto(exile) all(this)
type=nothing
id=-335544667
[/card]


Zethfox
Posts: 3029
Joined: Thu Jun 10, 2010 11:28 pm

Re: coding for Primeval Titan

Post by Zethfox »

i tried that too :( unfortunately the way the source is coded to handle the combat steps if there are no creatures avilible to block it skips right to combat damage. so you still miss out on it...for automatic counter removel try this

auto=@each myblockers: counter(0/0,1,Fetch) all(primeval titan[attacking]) && counter(0/0,-1,Fetch) all(other primeval titan[attacking]) && thisforeach(counter{0/0.1.fetch}) token(-335544668) && thisforeach(counter{0/0.1.fetch}) counter(0/0,-1,fetch)


that will put the counter on him, activate the effect then remove the counter from him. so you can take off the manuel activation part. and the counter removel at combat damage. it should also take care of manuelly having to put the counter on him...i havent tested this so dont kill me if it doesnt work...just using a trick that worked on another card i coded.

maybe you can find a way to make it work :)
i will say the issue with attacked/blocked is something Wololo and i have discussed, but both our solutions to the probelm would require a serious amount of coding in the source.

for the purpose of just using as a play test tool until the support for "blocked/attacked" is added...this should work fine...just remember sometime you should have won matchs if the effect didnt work that round... i do the very same thing sometimes, just to see how a deck would do i code the missing cards with something as close as possible to what it would do. give me a good idea as to if i should be clicking "bid now" a playset on ebay of a card :D
mnguyen
Posts: 229
Joined: Thu Apr 29, 2010 4:13 pm

Re: coding for Primeval Titan

Post by mnguyen »

thanks for the info. That's basically what I am doing. My friend and I are just getting back into magic after 10+ years for me and less for him. I coded a few cards "Rise from the grave" for example to act like a "reanimate' but without giving the card brought back the extra attributes. Now I don't know if that latter part is possible, I just needed something to test the viability of my deck I was building. The fact that it should be black and a zombie type creature didn't matter. I was playing around with the titans since they are a new type of creature we got in M11 so I wanted to build a deck around the titans I did have.

Wagic has truly reignited my interest in the game. It's actually what got me to buy into M10 and M11 this year.

What you guys are doing is great! I only wish I could contribute more than just hacking away at card coding. I'd need a complete walkthrough as the way pointers work in C++ are different from java in many ways. I haven't done any real C++ coding in a very long time and trying to follow what you have done without any roadmap requires more time than I have.

Thanks for all the hard work and making Wagic what it is today.

--Mike
mnguyen
Posts: 229
Joined: Thu Apr 29, 2010 4:13 pm

Re: coding for Primeval Titan

Post by mnguyen »

Zethfox,
I just confirmed your fix to my coding of primeval titan works almost flawlessly! Even if the computer has no blockers the land fetch works. However, the first land fetch is mandatory there is no option to cancel ( 99% you would not want to. ie mishra's something or another.. )

Apparently the computer doesn't skip the blocking phase if it has no creatures to block so we are golden!

Thanks for the help!
mnguyen
Posts: 229
Joined: Thu Apr 29, 2010 4:13 pm

Re: coding for Primeval Titan

Post by mnguyen »

So here is my complete code for primeval titan that works minus the mandatory 1st land fetch.

Code: Select all

[card]
name=Primeval Titan Fetch Land 1
auto=may moveto(myBattlefield) target(land|myLibrary) && tap
auto=@movedto(this|exile):token(-335544669)
auto=moveto(exile)
type=nothing
id=-335544668
type=nothing
[/card]


[card]
name=Primeval Titan Fetch Land 2
auto=may moveto(myBattlefield) target(land|myLibrary) && tap
auto=moveto(exile)
id=-335544669
type=nothing
[/card]

[card]
name=Primeval Titan
abilities=trample
auto=may token(-335544668)
auto={c(0/0,-1,Fetch)}: token(-335544668) limit:1
auto=@each myblockers: counter(0/0,1,Fetch) all(primeval titan[attacking]) && counter(0/0,-1,Fetch) all(other primeval titan[attacking]) && thisforeach(counter{0/0.1.fetch}) token(-335544668) && thisforeach(counter{0/0.1.fetch}) counter(0/0,-1,fetch)
mana={1}
type=Creature
subtype=Giant
power=6
toughness=6
[/card]

mnguyen
Posts: 229
Joined: Thu Apr 29, 2010 4:13 pm

Re: coding for Primeval Titan

Post by mnguyen »

So here is my complete code for primeval titan that works minus the mandatory 1st land fetch.

Code: Select all

[card]
name=Primeval Titan Fetch Land 1
auto=may moveto(myBattlefield) target(land|myLibrary) && tap
auto=@movedto(this|exile):token(-335544669)
auto=moveto(exile)
type=nothing
id=-335544668
type=nothing
[/card]


[card]
name=Primeval Titan Fetch Land 2
auto=may moveto(myBattlefield) target(land|myLibrary) && tap
auto=moveto(exile)
id=-335544669
type=nothing
[/card]

[card]
name=Primeval Titan
abilities=trample
auto=may token(-335544668)
auto={c(0/0,-1,Fetch)}: token(-335544668) limit:1
auto=@each myblockers: counter(0/0,1,Fetch) all(primeval titan[attacking]) && counter(0/0,-1,Fetch) all(other primeval titan[attacking]) && thisforeach(counter{0/0.1.fetch}) token(-335544668) && thisforeach(counter{0/0.1.fetch}) counter(0/0,-1,fetch)
mana={1}
type=Creature
subtype=Giant
power=6
toughness=6
[/card]

Zethfox
Posts: 3029
Joined: Thu Jun 10, 2010 11:28 pm

Re: coding for Primeval Titan

Post by Zethfox »

ive actually added quite a bit to the game with 0 knowledge of C++, dont let the source scare you off...crack it open one of these days, you might be amazed with what you can do.
Locked