WagicProject / wagic

Wagic the Homebrew
Other
350 stars 79 forks source link

Mana drain works only partially #1060

Closed Gourajiro closed 3 years ago

Gourajiro commented 3 years ago

It successfully counters the spell however it does not give mana at the next main phase I can think of a workaround for this (creating a shroud indestructible permanent with x counters that sacrifices itself on next main phase giving x mana)

Vitty85 commented 3 years ago

Hi,

I guess i solved, this is the correct code:

[card] name=Mana Drain target=*|stack auto=fizzle auto=if compare(manacost)~equalto~1 then transforms((,newability[phaseaction[opponent firstmain once]:add{1} opponent])) forever auto=if compare(manacost)~equalto~2 then transforms((,newability[phaseaction[opponent firstmain once]:add{2} opponent])) forever auto=if compare(manacost)~equalto~3 then transforms((,newability[phaseaction[opponent firstmain once]:add{3} opponent])) forever auto=if compare(manacost)~equalto~4 then transforms((,newability[phaseaction[opponent firstmain once]:add{4} opponent])) forever auto=if compare(manacost)~equalto~5 then transforms((,newability[phaseaction[opponent firstmain once]:add{5} opponent])) forever auto=if compare(manacost)~equalto~6 then transforms((,newability[phaseaction[opponent firstmain once]:add{6} opponent])) forever auto=if compare(manacost)~equalto~7 then transforms((,newability[phaseaction[opponent firstmain once]:add{7} opponent])) forever auto=if compare(manacost)~equalto~8 then transforms((,newability[phaseaction[opponent firstmain once]:add{8} opponent])) forever auto=if compare(manacost)~equalto~9 then transforms((,newability[phaseaction[opponent firstmain once]:add{9} opponent])) forever auto=if compare(manacost)~equalto~10 then transforms((,newability[phaseaction[opponent firstmain once]:add{10} opponent])) forever auto=if compare(manacost)~equalto~11 then transforms((,newability[phaseaction[opponent firstmain once]:add{11} opponent])) forever auto=if compare(manacost)~equalto~12 then transforms((,newability[phaseaction[opponent firstmain once]:add{12} opponent])) forever auto=if compare(manacost)~equalto~13 then transforms((,newability[phaseaction[opponent firstmain once]:add{13} opponent])) forever auto=if compare(manacost)~equalto~14 then transforms((,newability[phaseaction[opponent firstmain once]:add{14} opponent])) forever auto=if compare(manacost)~equalto~15 then transforms((,newability[phaseaction[opponent firstmain once]:add{15} opponent])) forever auto=if compare(manacost)~equalto~16 then transforms((,newability[phaseaction[opponent firstmain once]:add{16} opponent])) forever auto=if compare(manacost)~equalto~17 then transforms((,newability[phaseaction[opponent firstmain once]:add{17} opponent])) forever auto=if compare(manacost)~equalto~18 then transforms((,newability[phaseaction[opponent firstmain once]:add{18} opponent])) forever auto=if compare(manacost)~equalto~19 then transforms((,newability[phaseaction[opponent firstmain once]:add{19} opponent])) forever auto=if compare(manacost)~morethan~19 then transforms((,newability[phaseaction[opponent firstmain once]:add{20} opponent])) forever text=Counter target spell. At the beginning of your next main phase, add {X} to your mana pool, where X is that spell's converted mana cost. mana={U}{U} type=Instant [/card]

Let me know if it works, see you soon.

Gourajiro commented 3 years ago

It still doesn't seem to give the mana on my next main phase when I use it, also from what little I understand of the coding (I'm not that good at it) it's set to go off only at the first main phase, when used between main phases to counter an instant it should give you mana on the second main phase.

Note that one use of mana drain is using it against your own instant during an opponent endstep so you have more mana your next turn.

Vitty85 commented 3 years ago

Hi,

I used it on opponent spell during his own turn and I had mana on my first main phase.

About the other scenarios you reported I have to see if it’s possible to code them.

Probably I can switch the first and the second main but I’m not sure there is a way to make it work when you target your spell.

I will take a look, see you.

-- Inviato da iPhone

Il giorno 29 giu 2021, alle ore 03:23, Gourajiro @.***> ha scritto:

 It still doesn't seem to give the mana on my next main phase when I use it, also from what little I understand of the coding (I'm not that good at it) it's set to go off only at the first main phase, when used between main phases to counter an instant it should give you mana on the second main phase.

Note that one use of mana drain is using it against your own instant during an opponent endstep so you have more mana your next turn.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

Gourajiro commented 3 years ago

I might have implemented the code the wrong way (I haven't delved in wagic card coding in more than 5 years), I'm supposed to substitute the code in the primitives file right?

Vitty85 commented 3 years ago

Yes, you have to replace the entire card in borderline.txt file and then restart game. BTW i have a new code that should work properly (at least in my tests seems ok):

[card] name=Mana Drain target=*|stack auto=fizzle anyzone=if casted(this) then if compare(hasstorecard)~morethan~0 then if compare(restriction{opponentturnonly}~morethan~0) then transforms((,newability[becomes(,,blue),newability[thisforeach(variable{storedmanacost}>0) phaseaction[my firstmain once]:add{1}])) oneshot anyzone=if casted(this) then if compare(hasstorecard)~morethan~0 then if compare(restriction{myturnonly}~morethan~0) then if compare(currentphase)~lessthan~4 then transforms((,newability[becomes(,,blue),newability[thisforeach(variable{storedmanacost}>0) phaseaction[my firstmain once]:add{1}])) oneshot anyzone=if casted(this) then if compare(hasstorecard)~morethan~0 then if compare(restriction{myturnonly}~morethan~0) then if compare(currentphase)~morethan~3 then if compare(currentphase)~lessthan~10 then transforms((,newability[becomes(,,blue),newability[thisforeach(variable{storedmanacost}>0) phaseaction[my secondmain once]:add{1}])) oneshot anyzone=if casted(this) then if compare(hasstorecard)~morethan~0 then if compare(restriction{myturnonly}~morethan~0) then if compare(currentphase)~morethan~9 then transforms((,newability[becomes(,,blue),newability[thisforeach(variable{storedmanacost}>0) phaseaction[my firstmain once]:add{1}])) oneshot text=Counter target spell. At the beginning of your next main phase, add {X} to your mana pool, where X is that spell's converted mana cost. mana={U}{U} type=Instant [/card]

Let me know if it works, see you soon.

Gourajiro commented 3 years ago

I discovered what was the issue, I was changing the code in an old installation and running a new one. I did the tests and now, with this last code, the card works perfectly: it can even counter self casted spells for later use of mana. The code has been completely fixed. Will you change it in the next update?

Vitty85 commented 3 years ago

Sure I will do in next release, see you and thanks for your feedback.

-- Inviato da iPhone

Il giorno 29 giu 2021, alle ore 15:41, Gourajiro @.***> ha scritto:

 I discovered what was the issue, I was changing the code in an old installation and running a new one. I did the tests and now, with this last code, the card works perfectly: it can even counter self casted spells for later use of mana. The code has been completely fixed. Will you change it in the next update?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

Vitty85 commented 3 years ago

Fixed in new release update: https://github.com/WagicProject/wagic/releases/tag/wagic-v0.23.1