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