It is currently 20 Apr 2024, 01:49
   
Text Size

[fixed]Alpha Brawl targeted creature also damage to itself

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

[fixed]Alpha Brawl targeted creature also damage to itself

Postby Aswan jaguar » 18 Jan 2020, 13:36

Describe the Bug:
Alpha Brawl targeted creature for the 2nd part of the ability it counts also itself and so deals also damage to itself as all others do.
Code: Select all
int card_alpha_brawl(int player, int card, event_t event){
/*
Alpha Brawl |6|R|R
Sorcery
Target creature an opponent controls deals damage equal to its power to each other creature that player controls,
then each of those creatures deals damage equal to its power to that creature.
*/
   if( ! IS_GS_EVENT(player, card, event) ){
      return 0;
   }

   target_definition_t td;
   default_target_definition(player, card, &td, TYPE_CREATURE);
   td.allowed_controller = 1-player;

   card_instance_t *instance = get_card_instance(player, card);

   if(event == EVENT_RESOLVE_SPELL ){
      if( valid_target(&td) ){
         int my_damage = get_power(instance->targets[0].player, instance->targets[0].card);
         if( my_damage > 0 ){
            test_definition_t test;
            default_test_definition(&test, TYPE_CREATURE);
            test.not_me = 1;
            new_damage_all(instance->targets[0].player, instance->targets[0].card, instance->targets[0].player, my_damage, 0, &test);
         }
         int count = active_cards_count[instance->targets[0].player]-1;
         while(count > -1 ){
               if( in_play(instance->targets[0].player, count) && is_what(instance->targets[0].player, count, TYPE_CREATURE) ){
                  int dmg = get_power(instance->targets[0].player, count);
                  if( dmg > 0 ){
                     damage_creature(instance->targets[0].player, instance->targets[0].card, dmg,
                                 instance->targets[0].player, count);
                  }
               }
               count--;
         }
      }
      kill_card(player, card, KILL_DESTROY);
   }

   return generic_spell(player, card, event, GS_CAN_TARGET, &td, "TARGET_CREATURE", 1, NULL);
}
Which card did behave improperly?
Alpha Brawl

Which update are you using? (date, name)Which type? (duel, gauntlet, sealed deck)
Manalink dev 51094f68 version - duel

What exactly should be the correct behavior/interaction?
Alpha Brawl:
Target creature an opponent controls deals damage equal to its power to each other creature that player controls, then each of those(dealt damage creatures) deals damage equal to its power to that creature.

Are any other cards possibly affected by this bug?
-
Attachments
alpha brawl why dmage to only creature.rar
(2.34 KiB) Downloaded 432 times
Last edited by Aswan jaguar on 07 Nov 2021, 10:28, edited 1 time 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: Alpha Brawl targeted creature also damage to itself

Postby Aswan jaguar » 07 Nov 2021, 10:28

Fixed in commit cb20513 and similar bugs for Chandra's Ignition and Archangel Avacyn // Avacyn, the Purifier.
---
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 50 guests


Who is online

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

Login Form