Page 1 of 1

[fixed]AI doesn't get that a creature can gain first strike.

PostPosted: 09 Sep 2016, 17:42
by Aswan jaguar
Describe the Bug:
AI doesn't get that Kessig Wolf,War-Spike Changeling,Order of the Ebon Hand,Emerald Dragonfly can gain first strike that is obvious when it decides to attack and defend,too.

Which card did behave improperly ?
AI-Kessig Wolf or AI-gain first in general

Which update are you using?(date,name)Which type(Duel,Gauntlet,Sealed Deck)
Manalink 2016/08/27: Eldritch Moon v2, duel

What exactly should be the correct behavior/interaction ?
AI gets that Kessig Wolf and others like it can gain first strike when there is mana to activate the ability.

Are any other cards possibly affected by this bug ?
-

Re: AI doesn't get that a creature can gain first strike.

PostPosted: 09 Sep 2016, 19:22
by Korath
The proper tool for this is EVENT_CHECK_ABILITIES; see comment next to it in defs.h (but be aware of Shandalar bug #826 - using this for evasion abilities is wonky).

General form is
Code: Select all
if (event == EVENT_CHECK_ABILITIES && affect_me(player, card) && generic_activated_ability(player, card, EVENT_CAN_ACTIVATE, /*costs*/))
  check_abilities_keywords |= KEYWORD_FIRST_STRIKE;
Needs two updates to setup_ai_combat_abilities() for the AI to recognize its own creatures can activate, but it's enough as-is for it to recognize that the human's can.

Re: [confi]AI doesn't get that a creature can gain first str

PostPosted: 28 Mar 2021, 09:25
by Aswan jaguar
Korath I have run some tests and noticed an issue I don't know if you are aware of it:
Let's say I have War-Spike Changeling and AI has also one or another creature with this ability and we both have mana to activate them.
If it is AI's turn and so AI attacks and has priority and I block AI will activate immediately to gain first strike.
If it is human's turn and AI blocks then human has the opportunity to activate first if I do then AI will never activate the ability in response. If I pass priority then AI will always activate the ability.

Re: [confi]AI doesn't get that a creature can gain first str

PostPosted: 28 Mar 2021, 18:06
by Aswan jaguar
Fixed original bug for all these cards and all that do it for themselves in commit 613d003 ("Add EVENT_CHECK_ABILITIES for activate own first strike", 2021-03-28)
Except Stillmoon Cavalier which needs more work as it has 3 activated abilities.