Page 1 of 1

The Abyss and targets chosen by other players

PostPosted: 17 Aug 2013, 19:25
by Sloth
r22941 converts The Abyss to script, but the implementation could be a lot more elegant and not all cards of that type will now be scriptable.

Please post comments, wishes and bugs concerning this here.

Re: The Abyss and targets chosen by other players

PostPosted: 19 Aug 2013, 11:56
by swordshine
AI's chosen target for triggered abilities didn't actually follow several target restrictions, e.g. "TargetsWithDefinedController". If this bug is fixed, many cards would be scriptable.

Re: The Abyss and targets chosen by other players

PostPosted: 21 Aug 2013, 08:29
by Sloth
swordshine wrote:AI's chosen target for triggered abilities didn't actually follow several target restrictions, e.g. "TargetsWithDefinedController". If this bug is fixed, many cards would be scriptable.
What cards do you mean? Can you provide a script that i can test?

Re: The Abyss and targets chosen by other players

PostPosted: 21 Aug 2013, 10:22
by swordshine
Sloth wrote:
swordshine wrote:AI's chosen target for triggered abilities didn't actually follow several target restrictions, e.g. "TargetsWithDefinedController". If this bug is fixed, many cards would be scriptable.
What cards do you mean? Can you provide a script that i can test?
At the beginning of a game, give AI a Karmic Justice and two lands. Cast Stone Rain to destroy one of the lands. There are no valid permanents to target, but AI would target a permanent it controls.
Here is another card using "TargetingPlayer" and "TargetsWithDefinedController":
Necrotic Plague | Open
Code: Select all
Name:Necrotic Plague
ManaCost:2 B B
Types:Enchantment Aura
K:Enchant creature
A:SP$ Attach | Cost$ 2 B B | ValidTgts$ Creature | AILogic$ Curse
S:Mode$ Continuous | Affected$ Creature.EnchantedBy | AddTrigger$ NecroticPlagueTrig | AddSVar$ NecroticPlagueSac | Description$ Enchanted creature has "At the beginning of your upkeep, sacrifice this creature."
SVar:NecroticPlagueTrig:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ NecroticPlagueSac | TriggerDescription$ At the beginning of your upkeep, sacrifice CARDNAME.
SVar:NecroticPlagueSac:AB$ Sacrifice | Cost$ 0 | SacValid$ Self
T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Card.AttachedBy | Execute$ TrigChoose | TriggerDescription$ When enchanted creature dies, its controller chooses target creature one of his or her opponents controls. Return CARDNAME from its owner's graveyard to the battlefield attached to that creature.
SVar:TrigChoose:AB$ Pump | Cost$ 0 | ValidTgts$ Creature | TgtPrompt$ Choose a creature your opponents control | TargetsWithDefinedController$ TriggeredCardOpponent | IsCurse$ True | TargetingPlayer$ TriggeredCardController | SubAbility$ DBChange
SVar:DBChange:DB$ ChangeZone | Defined$ Self | Origin$ Graveyard | Destination$ Battlefield | AttachedTo$ ParentTarget
SVar:Picture:http://www.wizards.com/global/images/magic/general/necrotic_plague.jpg

Re: The Abyss and targets chosen by other players

PostPosted: 21 Aug 2013, 12:00
by Sloth
swordshine wrote:At the beginning of a game, give AI a Karmic Justice and two lands. Cast Stone Rain to destroy one of the lands. There are no valid permanents to target, but AI would target a permanent it controls.
Here is another card using "TargetingPlayer" and "TargetsWithDefinedController"
The whole TargetsWithDefinedController check was placed in a human only function. This is fixed now.