It is currently 23 May 2024, 15:45
   
Text Size

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

Postby 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.
User avatar
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

Postby 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

Postby Sloth » 21 Aug 2013, 08:29

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?
User avatar
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

Postby swordshine » 21 Aug 2013, 10:22

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
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

Postby Sloth » 21 Aug 2013, 12:00

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.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times


Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 23 guests


Who is online

In total there are 23 users online :: 0 registered, 0 hidden and 23 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 23 guests

Login Form