Re: Community Wad
Before going through the new problematic cards, I just realized that the version of Telekinesis I suggested has some flaws. Let's forget that I opted for STEP_DRAW rather than STEP_UPKEEP, it's not even important. Any step we decide to make the delayed trigger happen poses the problem "what if the creature's controller has to skip that step?". A safer approach would be the following:
However, this implementation still fails in a scenario: "what if the creature's controller has to skip the untap step?". The TapAndHold() would still be in effect when we call the second Hold(), making the creature skip only 1 untap.
There's only one solution that should work in all scenarios: the spell ability will call a delayed trigger that fires at the creature's controller untap step. That delayed trigger will call another delayed trigger that fires with the condition I wrote up here and calls Hold() on the creature.
Here's the complete code I would write. I have simplified some things, such as not creating delayDC when we already have a chest with the information we need. I honestly don't know if we can pass the whole EffectDC of a delayed trigger to another one, it will be a good time to test it.
There's another flaw: I understand why you are using twice the amount of +0/+1 and +1/+0 counters in order to simulate +0/+2 and +2/+0, but that's an approximation that would result in a wrong interaction with cards such as Thief of Blood. The correct approach would be to code your own +0/+2 and +2/+0 counters, maybe with a manager that gives the stat increase: you should ask Xander9009 if something like that has been already coded, I'm pretty sure it has.
- Code: Select all
return MTG():GetStep() > STEP_UNTAP and MTG():GetStep() ~= STEP_CLEANUP
However, this implementation still fails in a scenario: "what if the creature's controller has to skip the untap step?". The TapAndHold() would still be in effect when we call the second Hold(), making the creature skip only 1 untap.
There's only one solution that should work in all scenarios: the spell ability will call a delayed trigger that fires at the creature's controller untap step. That delayed trigger will call another delayed trigger that fires with the condition I wrote up here and calls Hold() on the creature.
Here's the complete code I would write. I have simplified some things, such as not creating delayDC when we already have a chest with the information we need. I honestly don't know if we can pass the whole EffectDC of a delayed trigger to another one, it will be a good time to test it.
- Telekinesis code (hopefully working in all possible scenarios) | Open
I guess the main problem here is that GetEffectX is a function written in the official Functions.lol file, so it's just like ours and it's not a method, while GetPaidX and GetManaX are card object's methods, and as such need to be called from their object:Splinterverse wrote:-- Frankenstein's Monster http://pastebin.com/pFzwwMVM
- Code: Select all
local x_amount = GetEffectX()
--------------
local x_amount = EffectSource():GetPaidX()
--------------
local x_amount = EffectSource():GetManaX()
There's another flaw: I understand why you are using twice the amount of +0/+1 and +1/+0 counters in order to simulate +0/+2 and +2/+0, but that's an approximation that would result in a wrong interaction with cards such as Thief of Blood. The correct approach would be to code your own +0/+2 and +2/+0 counters, maybe with a manager that gives the stat increase: you should ask Xander9009 if something like that has been already coded, I'm pretty sure it has.
The code seems reasonable to me. My guess is that the game stops when encountering LoseGame or WinGame for the first time. If that's the case, you'll need to settle with approximations such as the ones used for removing a creature from combat. In this case you could deal each player an amount of unpreventable damage equal to their life total.Splinterverse wrote:-- Divine Intervention http://pastebin.com/HF1E1zD1
LKI usually makes sense for damage sources because the damage usually needs to happen even if its source leaves the battlefield in response, but I'm not sure in this case: should the intervening_if fail if the Aura leaves the battlefield in response? There's no enchanted creature anymore if there's no Aura... this should be asked to someone with deep knowledge of the rules.Splinterverse wrote:-- Earthbind http://pastebin.com/DD4K9Pip