Page 121 of 141

Re: Card Development Questions

PostPosted: 08 Jul 2013, 13:23
by swordshine
Sloth wrote:We actually need three triggers:
1. One that triggers only once per attacker (currently "AttackerBlocked"). Example: Alley Grifters.
2. One that triggers for each pair of attacker-blocker (currently "Blocks"). Example: No Quarter, Righteous Indignation.
3. One that triggers only once per blocker (a new trigger?). Example: Lairwatch Giant.
Yep, combat in Forge has changed a lot. We need fix that.

Re: Card Development Questions

PostPosted: 08 Jul 2013, 13:30
by jsv
swordshine wrote:These two scripts are different. "T:Mode$ Blocks" should only trigger once when it blocks any creatures (Lairwatch Giant and Guardian of the Gateless), this was implemented by ArsenalNut during GTC spoiler season. "T:Mode$ AttackerBlocked" should trigger multiple times for each blocking creature. I have not tested if these scripts are still working as supposed.
Well, that's what happens currently. After my fix the entire script looks like this:

Code: Select all
Name:Tolarian Entrancer
ManaCost:1 U
Types:Creature Human Wizard
PT:1/1
T:Mode$ Blocks | ValidCard$ Creature | ValidBlocked$ Card.Self | DelayedTrigger$ DelTrig | TriggerDescription$ Whenever CARDNAME becomes blocked by a creature, gain control of that creature at end of combat.
SVar:DelTrig:Mode$ Phase | Phase$ EndCombat | ValidPlayer$ Player | Execute$ TrigGainControl | TriggerDescription$ Gain control of blocking creature.
SVar:TrigGainControl:AB$ GainControl | Cost$ 0 | Defined$ TriggeredBlocker | NewController$ TriggeredAttackerController
SVar:Picture:http://www.wizards.com/global/images/magic/general/tolarian_entrancer.jpg
Oracle:Whenever Tolarian Entrancer becomes blocked by a creature, gain control of that creature at end of combat.
When there are multiple blockers, multiple "Gain control..." are added to the stack when the delayed trigger resolves.

Previous version:

Code: Select all
Name:Tolarian Entrancer
ManaCost:1 U
Types:Creature Human Wizard
PT:1/1
T:Mode$ AttackerBlocked | ValidCard$ Card.Self | ValidBlocker$ Creature | DelayedTrigger$ DelTrig | TriggerDescription$ Whenever CARDNAME becomes blocked by a creature, gain control of that creature at end of combat.
SVar:DelTrig:Mode$ Phase | Phase$ EndCombat | ValidPlayer$ Player | Execute$ TrigGainControl | TriggerDescription$ Gain control of blocking creature.
SVar:TrigGainControl:AB$ GainControl | Cost$ 0 | Defined$ TriggeredBlocker | NewController$ TriggeredAttackerController
SVar:Picture:http://www.wizards.com/global/images/magic/general/tolarian_entrancer.jpg
Oracle:Whenever Tolarian Entrancer becomes blocked by a creature, gain control of that creature at end of combat.
doesn't work in 1.4.2+. It does create the trigger, but the list of blockers in runParams is empty.

Guess that's not the way things are supposed to work, but there is no reason to revert my patch just yet. :)

Re: Card Development Questions

PostPosted: 08 Jul 2013, 13:42
by swordshine
In current version, both Lairwatch Giant and Guardian of the Gateless trigger once when blocks, but it's weird to assign the damage. I chose damage order twice and dealt damage twice.

My test:1) I cast a Lairwatch Giant and Gideon Jura, gave ai two Abbey Matron.
2) Activated Gideon Jura, force ai to attack.
3) When Lairwatch Giant blocks two Abbey Matron, I chose damage order twice and assigned damage twice.
4) Both Abbey Matron died in FirstStrike step (Lairwatch Giant is 5/3 with First Strike, and Abbey Matron is 1/3).

Re: Card Development Questions

PostPosted: 08 Jul 2013, 14:07
by Sloth
jsv wrote:Guess that's not the way things are supposed to work, but there is no reason to revert my patch just yet. :)
No, your fix sets it right: Tolarian Entrancer has to use a "Blocks" trigger and not an "AttackerBlocked" trigger.

There was still something broken with the TriggeringObjects of AttackerBlocked, but Tolarian Entrancer shouldn't have worked the way it was scripted.

swordshine wrote:In current version, both Lairwatch Giant and Guardian of the Gateless trigger once when blocks, ...
You are right the "Blocks" trigger triggers only once per blocker, but this also means that Righteous Indignation does not work correctly with creatures blocking more than one attacker.

Re: Card Development Questions

PostPosted: 08 Jul 2013, 14:35
by friarsol
swordshine wrote:but it's weird to assign the damage. I chose damage order twice and dealt damage twice.

My test:1) I cast a Lairwatch Giant and Gideon Jura, gave ai two Abbey Matron.
2) Activated Gideon Jura, force ai to attack.
3) When Lairwatch Giant blocks two Abbey Matron, I chose damage order twice and assigned damage twice.
4) Both Abbey Matron died in FirstStrike step (Lairwatch Giant is 5/3 with First Strike, and Abbey Matron is 1/3).
I believe the problem is when Max flattened the Blockers->AttackingBand HashMap, he didn't account for Blockers being able to appear in more than one AttackingBand object in getAllBlockers().

Not at a machine that can commit, but I believe getAllBlockers() should be accumulating a Set<Card> which then gets converted to a List before it returns.

I believe this was in Combat.java

Re: Card Development Questions

PostPosted: 28 Jul 2013, 07:50
by swordshine
A question about Gilded Drake: I'm thinking of adding a param "CantFizzle" for this card in MagicStack.hasFizzled, around Line 698, in order to make this card not to be counted by rules(if the targed card is destroyed, this etb ability should be resolved and Gilded Drake should be sacrificed as a result).
if (sa.hasParam("CantFizzle") {fizzle = false;}
Is that a good solution?

Re: Card Development Questions

PostPosted: 28 Jul 2013, 10:33
by Sloth
swordshine wrote:A question about Gilded Drake: I'm thinking of adding a param "CantFizzle" for this card in MagicStack.hasFizzled, around Line 698, in order to make this card not to be counted by rules(if the targed card is destroyed, this etb ability should be resolved and Gilded Drake should be sacrificed as a result).
if (sa.hasParam("CantFizzle") {fizzle = false;}
Is that a good solution?
I searched the comprehensive rules for other possibilities of abilities being countered by the rules, but couldn't find any.

Your solution sounds good.

Re: Card Development Questions

PostPosted: 01 Aug 2013, 11:02
by swordshine
I'm going to convert the Devour ability to a replacement effect to support Jund. Two devour ability cannot be compatible in the original code. I'll move Devour effect (a new param Devour$ True) and trigger (Kresh Avatar) to sacrifice effect. clearDevoured() will be run in GameAction.changeZone when the destination is not the Battlefield.
Is there something important missing?

Re: Card Development Questions

PostPosted: 01 Aug 2013, 13:39
by swordshine
Some preparations for Strionic Resonator: Convert some keywords to correct triggers (
including Undying, Annihilator, Persist, Cascade, Poisonous, Vanishing, Ripple, Recover, Bushido, Fading, Echo, Cumulative upkeep).
Convert wome cards to script (Celestial Mantle, Scalpelexis)
Fix some keywords (Frenzy, current script for Frency Sliver is a hacked one, the trigger should be granted to each sliver; Replicate, should be similar to Storm, the second part is a triggered ability)
Add "Amount$ All" for some cards with play effect linked with triggered ability, e.g. Elite Arcanist.
Maybe we should go through all the triggered ability with Remembered or Imprinted.

Re: Card Development Questions

PostPosted: 01 Aug 2013, 14:37
by friarsol
swordshine wrote:Some preparations for Strionic Resonator
Specifically for Elite Arcanist and Isochron Scepter, you can cast 0-All of the cards exiled by the triggered ability (after they are copied).

Re: Card Development Questions

PostPosted: 01 Aug 2013, 14:56
by swordshine
I thought it could be handled by adding "Amount$ All" because they are optional effects. I copied code from TriggerHandler.runSingleTrigger to copy Elite Arcanist' s ability, however, I encountered a bug that the played card was not removed from the list in PlayEffect, weird.

Re: Card Development Questions

PostPosted: 02 Aug 2013, 03:35
by swordshine
I think I've got Strionic Resonator working for many cards:
Intrinsic trigger with targets(Sun Titan)
Intrinsic trigger without targets (Primeval Titan)
Temporary trigger (Frenzy Sliver, also converted this card to AddTrigger)
Converted Celestial Mantle
Converted Annihilator, Poisonous
Set Bushido isTrigger(true)

Re: Card Development Questions

PostPosted: 02 Aug 2013, 12:42
by swordshine
OK, I've updated Playeffect and scripts for Spellbinder, Isochron Scepter, Elite Arcanist and all lands with Hideaway keyword. Now they are compatible with Strionic Resonator.
I'll do some tests and commit the changes in two days when I'm back.
Remaining keywords that are not functionized as triggers in Forge (cannot be targeted by Stifle or Strionic Resonator, should be converted):
Undying
Persist
Cascade
Vanishing
Fading
Ripple
Recover
Echo
Cumulative upkeep (this one is complicated, current code is not correct)
Replicate
Madness
Miracle
At the beginning of... sacrifice/exile/destroy

Re: Card Development Questions

PostPosted: 02 Aug 2013, 13:13
by friarsol
swordshine wrote:Cascade (this one is crazy)
....
Cumulative upkeep (this one is complicated, current code is not corrent, adding counters should be part of the resolving)
Cascade shouldn't be too terrible. DigUntil nonLand card with CMC LT X where X = CMC of Cascading card. Remember the found Card, and then potentially cast it for free.

I looked at Cumulative Upkeep a few months back and it was pretty atrocious. We really need a cost multiplier that just appends multiple costs together, since each Cumulative Upkeep cost is paid separately. So if you have 3 age counters on Illusionary Forces you pay U three times. But if you have Jotun Grunt with three age counters, you get to choose a different graveyard three times.

Re: Card Development Questions

PostPosted: 04 Aug 2013, 06:53
by swordshine
friarsol wrote:Cascade shouldn't be too terrible. DigUntil nonLand card with CMC LT X where X = CMC of Cascading card. Remember the found Card, and then potentially cast it for free.
Cascade is converted now.