It is currently 18 Apr 2024, 06:01
   
Text Size

[fixed]Belbe's Armor AI no consider in attack/de decisions

Moderators: BAgate, drool66, Aswan jaguar, gmzombie, stassy, CCGHQ Admins

[fixed]Belbe's Armor AI no consider in attack/de decisions

Postby Aswan jaguar » 23 May 2017, 13:07

Describe the Bug:
1- AI never uses Belbe's Armor to reduce opponent's creature power even if it will die.It only uses the ability to it's own creatures to boost their toughness. fix
2- Also AI doesn't consider the ability while thinking if it will attack or not or block or not.
Which card did behave improperly?
Belbe's Armor AI part.

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?
1- AI can also use Belbe's Armor ability to reduce an opponent's creature power to reduce/prevent damage.
2- Also AI considers the ability while thinking if it will attack or not or block or not.
Are any other cards possibly affected by this bug?
-
Attachments
ai no activate belbe's armor.rar
(2.74 KiB) Downloaded 135 times
Last edited by Aswan jaguar on 16 Nov 2019, 18:43, edited 6 times in total.
Reason: fixed
---
Trying to squash some bugs and playtesting.
User avatar
Aswan jaguar
Super Tester Elite
 
Posts: 8078
Joined: 13 May 2010, 12:17
Has thanked: 730 times
Been thanked: 458 times

Re: [confirm]Belbe's Armor AI never activates on opponent's

Postby Aswan jaguar » 02 Mar 2019, 09:59

Allow AI to target creatures in cd06792.
---
Trying to squash some bugs and playtesting.
User avatar
Aswan jaguar
Super Tester Elite
 
Posts: 8078
Joined: 13 May 2010, 12:17
Has thanked: 730 times
Been thanked: 458 times

Re: [confirm]Belbe's Armor AI never activates on opponent's

Postby Korath » 18 Jul 2019, 22:20

default_target_definition() defaults preferred_controller to 1-player, so if you don't override it - and with this change, you don't - it'll prefer to always target the opponent's creature, never its own.
User avatar
Korath
DEVELOPER
 
Posts: 3707
Joined: 02 Jun 2013, 05:57
Has thanked: 496 times
Been thanked: 1106 times

Re: [confirm]Belbe's Armor AI never activates on opponent's

Postby Aswan jaguar » 19 Jul 2019, 11:15

Fixed so now AI can target creatures of both players in commit aee0ac9010.
---
Trying to squash some bugs and playtesting.
User avatar
Aswan jaguar
Super Tester Elite
 
Posts: 8078
Joined: 13 May 2010, 12:17
Has thanked: 730 times
Been thanked: 458 times

Re: [confirm]Belbe's Armor AI never activates on opponent's

Postby Aswan jaguar » 19 Jul 2019, 17:21

Korath any example card I can follow to get "2- Also AI doesn't consider the ability while thinking if it will attack or not or block or not." working?
---
Trying to squash some bugs and playtesting.
User avatar
Aswan jaguar
Super Tester Elite
 
Posts: 8078
Joined: 13 May 2010, 12:17
Has thanked: 730 times
Been thanked: 458 times

Re: [confirm]Belbe's Armor AI never activates on opponent's

Postby Korath » 19 Jul 2019, 18:40

I don't see any card in Manalink of the form " {X}, (maybe some other costs): (This/Target creature) gets (±XX / ±X/+0 / +0/±X) until end of turn" with any combat AI at all, but for activated abilities of permanents - like this is - the form used in Shandalar's implementation of Belbe's Armor in src/shandalar/cards/pump_target_activated.cpp will work. There isn't an exact equivalent to has_mana_to_activate_X(), but when there isn't a mana cost in addition to {X} and you're not worried about accounting for external cost modifications, "avail = has_mana(player, COLOR_ANY, 1);" is close enough.
User avatar
Korath
DEVELOPER
 
Posts: 3707
Joined: 02 Jun 2013, 05:57
Has thanked: 496 times
Been thanked: 1106 times

Re: [confirm]Belbe's Armor AI no consider in attack/de decis

Postby Aswan jaguar » 16 Nov 2019, 18:41

Fixed in commit 6ba435bd.
Current code is:
Code: Select all
int card_belbes_armor(int player, int card, event_t event){
/* CARD_ID_BELBES_ARMOR   4670
Belbe's Armor   |3
Artifact
|X, |T: Target creature gets -X/+X until end of turn. */
   
   target_definition_t td;
   default_target_definition(player, card, &td, TYPE_CREATURE);
    td.preferred_controller = ANYBODY;

    if (event == EVENT_CHECK_PUMP)
    {
      int avail = generic_activated_ability(player, card, EVENT_CAN_ACTIVATE, GAA_UNTAPPED | GAA_CAN_TARGET,
                                                                   MANACOST_X(-1), 0, &td, "TARGET_CREATURE");
      pumpable_power[1-player] -= avail;
      pumpable_toughness[player] += avail;
    }
   
   if( ! IS_GAA_EVENT(event) ){
      return 0;
   }

   card_instance_t *instance = get_card_instance(player, card);

   if( event == EVENT_RESOLVE_ACTIVATION ){
      if( valid_target(&td) ){
         int amount = instance->info_slot;
         pump_until_eot(instance->parent_controller, instance->parent_card, instance->targets[0].player, instance->targets[0].card,
                     -amount, amount);
      }
   }

   return generic_activated_ability(player, card, event, GAA_UNTAPPED | GAA_CAN_TARGET, MANACOST_X(-1), 0, &td, "TARGET_CREATURE");
}
And the values in AI inc power/toughness in Manalink.csv are -100/100.
Generally AI most of the times gets the ability in attack/defend decisions but I see weird decisions with creatures with first strike. I think it is a problem with EVENT_CHECK_PUMP vs first strike.
For instance AI has a 4/4, an 1/1 and a 3/2 creature with first strike and an untapped Belbe's Armor and 6 mana available while I have a 5/5 first striker. AI will attack only with the 2 non strikers.
---
Trying to squash some bugs and playtesting.
User avatar
Aswan jaguar
Super Tester Elite
 
Posts: 8078
Joined: 13 May 2010, 12:17
Has thanked: 730 times
Been thanked: 458 times


Return to Archived Reports

Who is online

Users browsing this forum: No registered users and 28 guests


Who is online

In total there are 28 users online :: 0 registered, 0 hidden and 28 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 28 guests

Login Form