Page 1 of 1

[still bugged]Brainwash doesn't affect creature if 3 enchant

PostPosted: 16 Sep 2014, 22:31
by Nexhro
Describe the Bug:
A creature enchanted by Brainwash can attack without its controller having to pay {3} .

Which card did behave improperly ?
Brainwash

Which update are you using?(date,name)Which type(Duel,Gauntlet,Sealed Deck)
CoRM15 mini, duel

What exactly should be the correct behavior/interaction ?
A creature enchanted by Brainwash can't attack unless its controller pays {3} .

Are any other cards possibly affected by this bug ?
-

Re: [confirmed]Brainwash no effect

PostPosted: 26 Sep 2014, 12:51
by Gargaroz
Fixed in 83c8251

Re: [still bugged]Brainwash no effect

PostPosted: 29 Sep 2014, 05:50
by BAgate
Can attack normally without paying.If propaganda is controlled by opponent can attack just paying 2 instead of 5.

Re: [still bugged]Brainwash no effect

PostPosted: 14 Jan 2016, 15:59
by Aswan jaguar
1- Now when an AI creature is enchanted with Brainwash it will pay 3 no matter if it will attack or not as long as it has 3 mana to pay!
2- If a humans creature is enchanted with it,it will crash the game in humans turn at draw step if the creature is enchanted by AI's Brainwash or as soon as it gets attached to creature if human has cast it on it's own creature or as soon as human has 3 mana available.

Re: [still bugged]Brainwash no effect

PostPosted: 26 Sep 2019, 16:15
by Aswan jaguar
Fixed both in commit d2063f02 following Opprssive Ways code. There is an issue for both cards that if you enchant 3 times or ( more probably )the same creature then the first time everything seems to work correctly and you are asked to pay 3x3 = 9 mana but the following turn you are not prompt for mana and the creature can attack for free.
Code: Select all
int card_brainwash(int player, int card, event_t event){
   /*
     Brainwash |W
     Enchantment - Aura
     Enchant creature
     Enchanted creature can't attack unless its controller pays {3}.
   */

if (((trigger_condition == TRIGGER_PAY_TO_ATTACK && current_phase == PHASE_DECLARE_ATTACKERS && reason_for_trigger_controller == current_turn)
     && affect_me(player, card)))
   {
     card_instance_t* instance = in_play(player, card);
     if (instance && !instance->info_slot
        && instance->damage_target_card == trigger_cause && instance->damage_target_player == trigger_cause_controller)
      {
        if (!has_mana(reason_for_trigger_controller, COLOR_ANY, 3))
         forbid_attack = 1;
        else if (event == EVENT_TRIGGER)
         event_result |= RESOLVE_TRIGGER_MANDATORY;
        else if (event == EVENT_RESOLVE_TRIGGER)
         {
           if (charge_mana_while_resolving(player, card, event, reason_for_trigger_controller, COLOR_COLORLESS, 3))
            {
              forbid_attack = 0;
              instance->info_slot = 1;
            }
           else
            {
              forbid_attack = 1;
              cancel = 0;
            }
         }

        if (forbid_attack)
         remove_state(instance->damage_target_player, instance->damage_target_card, STATE_UNKNOWN8000);
      }
   }

  if (event == EVENT_ATTACK_LEGALITY)
   {
     card_instance_t* instance = get_card_instance(player, card);
     if (affect_me(instance->damage_target_player, instance->damage_target_card)
        && !instance->info_slot
        && !has_mana(event == EVENT_ATTACK_LEGALITY ? current_turn : 1-current_turn, COLOR_ANY, 3))
      event_result = 1;
   }

   return disabling_aura(player, card, event);
}