The Abyss and targets chosen by other players
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
The Abyss and targets chosen by other players
by Sloth » 17 Aug 2013, 19:25
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.
Please post comments, wishes and bugs concerning this here.
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: The Abyss and targets chosen by other players
by swordshine » 19 Aug 2013, 11:56
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.
- swordshine
- Posts: 682
- Joined: 11 Jul 2010, 02:37
- Has thanked: 116 times
- Been thanked: 87 times
Re: The Abyss and targets chosen by other players
by Sloth » 21 Aug 2013, 08:29
What cards do you mean? Can you provide a script that i can test?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.
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: The Abyss and targets chosen by other players
by swordshine » 21 Aug 2013, 10:22
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.Sloth wrote:What cards do you mean? Can you provide a script that i can test?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.
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
- swordshine
- Posts: 682
- Joined: 11 Jul 2010, 02:37
- Has thanked: 116 times
- Been thanked: 87 times
Re: The Abyss and targets chosen by other players
by Sloth » 21 Aug 2013, 12:00
The whole TargetsWithDefinedController check was placed in a human only function. This is fixed now.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"
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
5 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 23 guests