Page 1 of 1

Destroy N permanents (r19700)

PostPosted: 17 Feb 2013, 19:13
by Max mtg
I've added a common routine for AI and Human to gather all permenents before actually destroying them.

Previously it started a loop from 1 to amount and sac'd units inside that loop. Now there are separate loops for selection and execution.
So I've some questions about selecting permanents:
* Are undestructable permanents valid targets for 'destroy' api?
* Should sacrifice targets be selected when "opponent's abilities cannot make you sac permanents" is in effect?

Also open for comments and opinions on that revision.

Re: Destroy N permanents (r19700)

PostPosted: 17 Feb 2013, 23:24
by friarsol
Just a quick clarification, you are trying to determine when you are accumulating the valid permanents, if you should throw it indestructible ones for destroy effects (or can't be sacrificed for sacrifice effects)? If a card is targeted, and is an invalid target when the spell is about to resolve, it is removed from the target object before it even gets to the effects.

My instinct is to say you don't need to include them, although the function should return if it can't do the expected action on the passed card anyway.

Re: Destroy N permanents (r19700)

PostPosted: 18 Feb 2013, 06:42
by Max mtg
friarsol wrote:My instinct is to say you don't need to include them, although the function should return if it can't do the expected action on the passed card anyway.
That is the question.

That's how it works now - any permanent matching ValidTgt$ can be choosen, and if it can't be sacrificed or destroyed, noone cares.
That seems fair - I can cast Viridian Corrupter, target my Darksteel Axe which won't get destroyed anyway and dont touch the Batterskull.

Ok, will leave the code as it is. Just in case, there are a couple of routines that can test a card for being destroyable and "sacrificable".

Re: Destroy N permanents (r19700)

PostPosted: 18 Feb 2013, 13:39
by friarsol
Max mtg wrote:That's how it works now - any permanent matching ValidTgt$ can be choosen, and if it can't be sacrificed or destroyed, noone cares.
That seems fair - I can cast Viridian Corrupter, target my Darksteel Axe which won't get destroyed anyway and dont touch the Batterskull.
Yep, that's totally legal. The AI shouldn't do it (unless they are forced to, then it's better to choose something they control that won't actually be effected.)

Re: Destroy N permanents (r19700)

PostPosted: 18 Feb 2013, 18:45
by Max mtg
friarsol wrote:The AI shouldn't do it (unless they are forced to, then it's better to choose something they control that won't actually be effected.)
The AI does choose indestructible permanents first, if the ability uses 'destroy' mechanics.

Re: Destroy N permanents (r19700)

PostPosted: 18 Feb 2013, 19:04
by friarsol
Max mtg wrote:The AI does choose indestructible permanents first, if the ability uses 'destroy' mechanics.
It looks like there are only three cards that even use the Destroy inside Sacrifice mechanics. We should try to convert these to actual Destroy effects since the AI knows how to avoid Indestructible cards for those effects.

Re: Destroy N permanents (r19700)

PostPosted: 18 Feb 2013, 20:34
by Sloth
friarsol wrote:
Max mtg wrote:The AI does choose indestructible permanents first, if the ability uses 'destroy' mechanics.
It looks like there are only three cards that even use the Destroy inside Sacrifice mechanics. We should try to convert these to actual Destroy effects since the AI knows how to avoid Indestructible cards for those effects.
Why do you want to convert anything? The AI does it correctly. When you play Imperial Edict it will choose Darksteel Colossus.

Re: Destroy N permanents (r19700)

PostPosted: 18 Feb 2013, 20:37
by friarsol
Sloth wrote:Why do you want to convert anything? The AI does it correctly. When you play Imperial Edict it will choose Darksteel Colossus.
I guess I misunderstood, I thought Max meant the AI was targeting Indestructible creatures the Human controlled with destroy style effects.