Page 2 of 3

Re: A guide to the AI of planeswalkers using ability factori

PostPosted: 29 Oct 2011, 12:15
by friarsol
I believe Chandra Nalaar is scriptable now as well.

Re: A guide to the AI of planeswalkers using ability factori

PostPosted: 29 Oct 2011, 16:19
by jeffwadsworth
friarsol wrote:I believe Chandra Nalaar is scriptable now as well.
Wouldn't we need a:
DB$ DamageAll | ValidCards$ Creature.TargetedPlayerCtrl
for the Ultimate?

Unless you know of another way?

Re: A guide to the AI of planeswalkers using ability factori

PostPosted: 29 Oct 2011, 18:13
by Sloth
jeffwadsworth wrote:
friarsol wrote:I believe Chandra Nalaar is scriptable now as well.
Wouldn't we need a:
DB$ DamageAll | ValidCards$ Creature.TargetedPlayerCtrl
for the Ultimate?

Unless you know of another way?
It's scriptable. Take a look at Flame Wave.

Re: A guide to the AI of planeswalkers using ability factori

PostPosted: 04 Nov 2011, 22:51
by slapshot5
I think Jace, the Mind Sculptor can be completely scripted too.

-slapshot5

Re: A guide to the AI of planeswalkers using ability factori

PostPosted: 05 Nov 2011, 00:27
by jeffwadsworth
slapshot5 wrote:I think Jace, the Mind Sculptor can be completely scripted too.

-slapshot5
I get an error when commenting out the Jace code. Here is a script that someone can test if they wish. Not tested at all due to that error.

| Open
Name:Jace, the Mind Sculptor
ManaCost:2 U U
Types:Planeswalker Jace
Text:no text
Loyalty:3
A:AB$ Dig | Cost$ AddCounter<2/LOYALTY> | ValidTgts$ Player | TgtPrompt$ Select target player | DigNum$ 1 | AnyNumber$ True | DestinationZone$ Library | LibraryPosition2$ 0 | Planeswalker$ True | SpellDescription$ Look at the top card of target player's library. You may put that card on the bottom of that player's library.
A:AB$ Draw | Cost$ 0 | NumCards$ 3 | SubAbility$ DBChangeZone | Planeswalker$ True | SpellDescription$ Draw three cards, then put two cards from your hand on top of your library in any order.
SVar:DBChangeZone:DB$ ChangeZone | Origin$ Hand | Destination$ Library | ChangeType$ Card.YouCtrl | ChangeNum$ 2 | LibraryPosition$ 0
A:AB$ ChangeZone | Cost$ SubCounter<1/LOYALTY> Origin$ Battlefield | Destination$ Hand | Hidden$ True | ValidTgts$ Creature | TgtPrompt$ Select target creature | Planeswalker$ True | SpellDescription$ Return target creature to its owner's hand.
A:AB$ ChangeZoneAll | Cost$ SubCounter<12/LOYALTY> | Origin$ Library | Destination$ Exile | ValidTgts$ Player | TgtPrompt$ Select target player | SubAbility$ DBChangeZone2 | Planeswalker$ True | Ultimate$ True | SpellDescription$ Exile all cards from target player's library, then that player shuffles his or her hand into his or her library.
SVar:DBChangeZone2:DB$ ChangeZoneAll | Origin$ Hand | Destination$ Library | Defined$ Targeted | ChangeType$ Card | Shuffle$ True
SVar:Rarity:Mythic
SVar:Picture:http://www.wizards.com/global/images/magic/general/jace_the_mind_sculptor.jpg
SetInfo:WWK|Mythic|http://magiccards.info/scans/en/wwk/31.jpg
Oracle:[+2] Look at the top card of target player's library. You may put that card on the bottom of that player's library.\n[0] Draw three cards, then put two cards from your hand on top of your library in any order.\n[-1] Return target creature to its owner's hand.\n[-12] Exile all cards from target player's library, then that player shuffles his or her hand into his or her library.
End

Re: A guide to the AI of planeswalkers using ability factori

PostPosted: 05 Nov 2011, 02:21
by slapshot5
jeffwadsworth wrote:I get an error when commenting out the Jace code. Here is a script that someone can test if they wish. Not tested at all due to that error.
What kind of error do you get?

Re: A guide to the AI of planeswalkers using ability factori

PostPosted: 05 Nov 2011, 03:09
by friarsol
jeffwadsworth wrote:
slapshot5 wrote:and Tezzeret the Seeker
I will add it tomorrow unless someone else does it. Sleep beckons.
Hey Jeff, where's Tez? If you did any local work with Tez, maybe it's part of why you have an error with Jace 2.0?

Re: A guide to the AI of planeswalkers using ability factori

PostPosted: 05 Nov 2011, 03:37
by friarsol
If Jace 2.0 and Tez are converted soon, as they appear they will be, only Sarkhan the Mad remains.

Here's the scoop:

1st Ability: Basically Dark Confidant with Damage to Self instead of You Losing Life. (Easy)

2nd Ability: "Target creature's controller sacrifices it." We don't really support this verbiage right now in AF_Sacrifice. It would need to be changed so if there are targets and you can't target players, a valid permanent needs to be targeted, and also Resolve would need to handle using the Targeted permanent as the sacrificee. After that it's just a SubAbility for a 5/5 Token for the TargetedController.

3rd Ability: "Each Dragon creature you control deals damage" I don't believe this supported right now either. We do have Repentance scripted, so maybe if the DamageSource returns multiple Sources, we just loop through the tgts and have multiple assignings of damage.

Code: Select all
        final ArrayList<Card> definedSources = AbilityFactory.getDefinedCards(saMe.getSourceCard(),
                params.get("DamageSource"), saMe);
        for (final Card source : definedSources){
            for (final Object o : tgts) {
Actually this doesn't quite work since each Dragon is capable of doing different amount of damage. The damage would need to be recalculated per Source. This area would need some additional code. If it was written in a more general manner, Wave of Reckoning might be scriptable after this work is completed.

Re: A guide to the AI of planeswalkers using ability factori

PostPosted: 05 Nov 2011, 04:24
by slapshot5
friarsol wrote:3rd Ability: "Each Dragon creature you control deals damage" I don't believe this supported right now either. We do have Repentance scripted, so maybe if the DamageSource returns multiple Sources, we just loop through the tgts and have multiple assignings of damage.

Code: Select all
        final ArrayList<Card> definedSources = AbilityFactory.getDefinedCards(saMe.getSourceCard(),
                params.get("DamageSource"), saMe);
        for (final Card source : definedSources){
            for (final Object o : tgts) {
Actually this doesn't quite work since each Dragon is capable of doing different amount of damage. The damage would need to be recalculated per Source. This area would need some additional code. If it was written in a more general manner, Wave of Reckoning might be scriptable after this work is completed.
Yeah, I was looking at this. (Haven't done any code though.) Another trick is you can decide (per dragon) if it damages Player or gets redirected to the Planeswalker. We currently don't support this, so an EachDamage AF is at least as good as what we've got.

-slapshot5

Re: A guide to the AI of planeswalkers using ability factori

PostPosted: 05 Nov 2011, 06:01
by jeffwadsworth
The error is weird. Something about too many lines in the class, default is 150. Anyway, I will fool with it in the morning. Good to see the Tez script finally get added.

Re: A guide to the AI of planeswalkers using ability factori

PostPosted: 05 Nov 2011, 12:30
by friarsol
jeffwadsworth wrote:The error is weird. Something about too many lines in the class, default is 150. Anyway, I will fool with it in the morning. Good to see the Tez script finally get added.
That sounds like a checkstyle error/warning not a compile error. I'd say just delete the whole block.

Re: A guide to the AI of planeswalkers using ability factori

PostPosted: 06 Nov 2011, 02:27
by slapshot5
Or, right-click on the project > Checkstyle > Deactivate. Problem solved.

Re: A guide to the AI of planeswalkers using ability factori

PostPosted: 07 Nov 2011, 01:13
by friarsol
slapshot, did you make code changes in AF_Sacrifice to support the second ability? http://cardforge.org/bugz/view.php?id=543

Re: A guide to the AI of planeswalkers using ability factori

PostPosted: 07 Nov 2011, 03:56
by slapshot5
friarsol wrote:slapshot, did you make code changes in AF_Sacrifice to support the second ability? http://cardforge.org/bugz/view.php?id=543
Uhh, No, I don't think so. I swear I copied something for that. But, I don't see what that would have been in a current search. I'll revert until it can be done.

-slapshot5

Re: A guide to the AI of planeswalkers using ability factori

PostPosted: 07 Nov 2011, 04:07
by friarsol
slapshot5 wrote:
friarsol wrote:slapshot, did you make code changes in AF_Sacrifice to support the second ability? http://cardforge.org/bugz/view.php?id=543
Uhh, No, I don't think so. I swear I copied something for that. But, I don't see what that would have been in a current search. I'll revert until it can be done.

-slapshot5
I said up above it couldn't be scripted yet :-d