Page 139 of 140

Re: Card Development Questions

PostPosted: 07 Aug 2016, 15:27
by Hanmac
i finally found what was wrong with Kilnspire District
the X variable was overwritten by something else.
by CardFactory.buildPlaneAbilities.
i try to use something else there like "PlanarDiceCostX", but it does not work as i wanted :/
(so it breaks the DiceCost)

i try to experiment a bit, but i will see how i can get it working.
==
Edit: fixed it via unorthodox way ;P
instead of setting the SVar to the card, i set it to the Ability XD

Re: Card Development Questions

PostPosted: 08 Aug 2016, 20:13
by Hanmac
hey you guys, i am currently trying to get Kodama of the Center Tree 's Soulshift X working ...
for that i am trying to create a game state before a DestroyAll spell does hit the field.

(my current work is to create a copy of the Battlefield zone with LKI copies of the cards)

it's not finish yet, and need to be written nicely, but thats my idea so far.

it does work for now for an destroy all spell, but i need to work on it more.
===

as "Payment" i need help by other developers.
i need to find the place why Zulaport Cutthroat or Wayward Disciple does work so different for some destroy all spells.

More info there:
viewtopic.php?f=52&t=6333&p=199331#p199331


Work:

does not Work:

in general it does look like: "destroy" works, "destroy, and X" works not.
(maybe something does mess with the triggers?)

i even did try to debug it with step by step debugger but i didn't find the culprit yet.

my last thought was about GameAction: line 273 with "c.setZone(zoneTo);" but then the others should not work too.

Re: Card Development Questions

PostPosted: 09 Aug 2016, 05:32
by mastroego
Is this in any way related to the Knight Exemplar problem (which I believe - not sure - is still present in Forge)?
I mean a board sweeper should only destroy the Knight Exemplar while leaving the other knights untouched by the destroy effect, but that wasn't what happened with Forge.

Re: Card Development Questions

PostPosted: 09 Aug 2016, 05:42
by Hanmac
@mastroego maybe yes:
i noticed some bug that for the destroy spells where it's not working it depends on where the card is on the battlefield.

like for Life's Finale, if i have:

Zulaport Cutthroat does trigger for the other creatures.

while with

Zulaport Cutthroat does not.

For Knight Exemplar, you might checkout what board sweeper is it.
(like if it only destroy or if it does more.)
i might check it out too, but currently (as you can see) i have other things to do.

Re: Card Development Questions

PostPosted: 09 Aug 2016, 06:34
by mastroego
Yeah, no problem here, do your thing ;)
I just wondered if they were a different manifestation of a single underlying problem :)

Re: Card Development Questions

PostPosted: 09 Aug 2016, 08:49
by Hanmac
i think i found the culprit of the Destroy problem:

AbilityUtils.resolveSubAbilities L1282
Revision: 31273
Author: @friarsol

Code: Select all
// Needed - Equip an untapped creature with Sword of the Paruns then cast Deadshot on it. Should deal 2 more damage.
game.getAction().checkStaticAbilities(); // this will refresh continuous abilities for players and permanents.
game.getTriggerHandler().resetActiveTriggers();
AbilityUtils.resolveApiAbility(abSub, game);
the resetActiveTriggers is the problem there .. while i understand why it is there, to prevent Landfall from Path to Exile
it does prevent other triggers from happening.

@friarsol can you might take a look and maybe you find a way to solve my problem.

Re: Card Development Questions

PostPosted: 09 Aug 2016, 13:25
by friarsol
Hanmac wrote:@friarsol can you might take a look and maybe you find a way to solve my problem.
I'm doubt I'll be able to do any serious debugging into triggers anytime soon.

Also, can we have a separate thread for this? It seems large enough discussion topic to not just be in Card Development Questions

Re: Card Development Questions

PostPosted: 09 Aug 2016, 14:53
by Hanmac
Super News for EVERYONE!!

i got both problems fixed (with adding that LastStateBattlefield)

now the triggers does work correct for the "Destroy and X" spells.
(a Special Rule only for ChangesZone)
But Please does tell me if you guys find anything there it does not work. (we probably need more test cases for something like that)

and Kodama of the Center Tree does now also work with SoulshiftX (as far was i tested it)

Edit:
its not 100% perfect yet.
Grazing Gladehart sacrificed for Perilous Forays,
does cause it to trigger. but i will see how i can get it working.

i got this closes, but there might be more.

Re: Card Development Questions

PostPosted: 09 Aug 2016, 15:19
by Agetian
Hanmac wrote:Super News for EVERYONE!!

i got both problems fixed (with adding that LastStateBattlefield)

now the triggers does work correct for the "Destroy and X" spells.
(a Special Rule only for ChangesZone)
But Please does tell me if you guys find anything there it does not work. (we probably need more test cases for something like that)

and Kodama of the Center Tree does now also work with SoulshiftX (as far was i tested it)
This is really amazing, thanks a lot for your effort! As soon as I get a little free time I'll check it out and test it, if I see anything weird I'll report immediately! ;)
Again, thanks a lot for all your contributions! :)

- Agetian

Re: Card Development Questions

PostPosted: 09 Aug 2016, 15:42
by Agetian
I started this thread to unload this one: viewtopic.php?f=52&t=18920
Feel free to pick up other issues from that thread as well (this is for anybody willing to do so). :)

- Agetian

Re: Card Development Questions

PostPosted: 12 Aug 2016, 07:02
by swordshine
@Hanmac
Can Glimmervoid Basin target other spells in the stack? IIRC, this function was not implemented last time.

Re: Card Development Questions

PostPosted: 12 Aug 2016, 07:28
by Hanmac
@Swordshine: i thought it did.
(it can target the cards, but maybe not the SpellAbilities)
i need to see if i need to change more on that.

for if the Stack can be targeted:
TargetRestrictions.getAllCandidates does have special Logic for Stack.

===

i wanted to do Damping Engine, i read a bit how do to IgnoreCost.

the problems i had for now:
  • the IgnoreCost need to be done with the whole effect, but for that i need Cant Play Lands & Cant Cast.
  • IgnoreCost only works for StaticAbilityContinuous, Cant Play Lands & Cant Cast are done via StaticAbilityCantBeCast
  • StaticAbilityContinuous can add more StaticAbilities, but only to Creatures

my plan for now: do a combined Static Ability, which does grant the two of them to the Player.
For that the Player does need to have Properties to store them too.
all places where Cant Play Lands & Cant Cast is used, i need to check for Player abilities too.

Re: Card Development Questions

PostPosted: 13 Aug 2016, 03:12
by swordshine
Hanmac wrote:@Swordshine: i thought it did.
(it can target the cards, but maybe not the SpellAbilities)
i need to see if i need to change more on that.

for if the Stack can be targeted:
TargetRestrictions.getAllCandidates does have special Logic for Stack.
It doesn't work in my recent test. I'll do some debug in a few hours.
Situation: Give AI three creature spells and I cast Counterspell targeting one of them. No copies were created.
Here's the code that I usually test Planes.
Code: Select all
Name:For Test
ManaCost:0
Types:Artifact
T:Mode$ SpellCast | ValidCard$ Instant,Sorcery | IsSingleTarget$ True | Execute$ TrigCopy | TriggerZones$ Battlefield | TriggerDescription$ Whenever a player casts an instant or sorcery spell with a single target, he or she copies that spell for each other spell, permanent, card not on the battlefield, and/or player the spell could target. Each copy targets a different one of them.
SVar:TrigCopy:DB$ CopySpellAbility | Defined$ TriggeredSpellAbility | Controller$ TriggeredActivator | CopyForEachCanTarget$ Spell,Permanent,Card,Player
SVar:Picture:http://www.wizards.com/global/images/magic/general/glimmervoid_basin.jpg
Oracle:Whenever a player casts an instant or sorcery spell with a single target, he or she copies that spell for each other spell, permanent, card not on the battlefield, and/or player the spell could target. Each copy targets a different one of them.\nWhenever you roll {CHAOS}, choose target creature. Each player except that creature's controller puts a token that's a copy of that creature onto the battlefield.

Re: Card Development Questions

PostPosted: 13 Aug 2016, 10:33
by Hanmac
@swordshine: i will see what i can do,
currently TargetRestrictions.getAllCandidates does not return SpellAbilities,
and i don't know if i might break something when i have i return it.

===
Also checkout, i did Damping Engine ...
(but the code does still feel ugly)

it works with creating DetachedEffects, and they does hold the static abilities.

i tested it and it does work, but the view might not get updated as i wanted ...

Re: Card Development Questions

PostPosted: 14 Aug 2016, 12:31
by Hanmac
I did LastStateGraveyard similar to my LastStateBattlefield.

i use it for when a creature does enter the Battlefield with X +1/+1 counters depending on something in the graveyard where it does should count itself (and others too)

for example:
2 Diregraf Colossus returned from the graveyard to the Battlefield with Ever After.
both should count itself and the other one for counting (it was wrong first)