It is currently 29 Apr 2024, 09:32
   
Text Size

Kumano, Master Yamabushi doesn't trigger/create effect card

Report wrong Card behavior to get it fixed.
PLEASE ADD SAVEGAMES TO YOUR TOPIC !

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

Kumano, Master Yamabushi doesn't trigger/create effect card

Postby Aswan jaguar » 22 Dec 2019, 11:18

Describe the Bug:
Kumano, Master Yamabushi doesn't create an effect card when it deals damage to a creature so it can trigger if that creature dies in dev. I tried everything I could think to solve this keeping the new functions but failed so I used also an old function that I guess it is supposed to be redundant if new functions are used correctly. I don't see any issue in my simple tests but I could be causing issues that my very limited knowledge of the code doesn't allow me to understand.
old code:
Code: Select all
int card_kumano_master_yamabushi(int player, int card, event_t event){
   /* Kumano, Master Yamabushi   |3|R|R   0x2006024
    * Legendary Creature - Human Shaman 4/4
    * |1|R: ~ deals 1 damage to any target.
    * If a creature dealt damage by ~ this turn would die, exile it instead. */
   check_legend_rule(player, card, event);

   check_damage_test(player, card, event, DDBM_TRACE_DAMAGING_SOURCES | DDBM_MUST_DAMAGE_CREATURE, player, card, 0, NULL);

   if( resolve_damage_trigger(player, card, event, DDBM_TRACE_DAMAGING_SOURCES | DDBM_MUST_DAMAGE_CREATURE, player, card) ){
      card_instance_t *instance = get_card_instance( player, card );
      int i;
      for(i = 0; i<instance->info_slot; i++){
         rfg_when_die(player, card, instance->targets[i].player, instance->targets[i].card);

      }
   }

   if( ! IS_GAA_EVENT(event) ){
      return 0;
   }

   target_definition_t td;
   default_target_definition(player, card, &td, TYPE_CREATURE|TARGET_TYPE_PLANESWALKER );
   td.zone = TARGET_ZONE_CREATURE_OR_PLAYER;

   if( event == EVENT_RESOLVE_ACTIVATION ){
      if( valid_target(&td)  ){
         damage_target0(player, card, 1);
      }
   }

   return generic_activated_ability(player, card, event, GAA_CAN_TARGET, MANACOST_XR(1, 1), 0, &td, "TARGET_ANY");
}
Temporary code that also addresses an issue that previous effect cards weren't cleared so they were adding up each time the ability triggered in commit df28ff6b:
Code: Select all
int card_kumano_master_yamabushi(int player, int card, event_t event){
   /* Kumano, Master Yamabushi   |3|R|R   0x2006024
    * Legendary Creature - Human Shaman 4/4
    * |1|R: ~ deals 1 damage to any target.
    * If a creature dealt damage by ~ this turn would die, exile it instead. */
   check_legend_rule(player, card, event);

   damage_effects(player, card, event);
   check_damage_test(player, card, event, DDBM_TRACE_DAMAGING_SOURCES | DDBM_MUST_DAMAGE_CREATURE | DDBM_TRACE_DAMAGED_CREATURES, player, card, 0, NULL);

   if( resolve_damage_trigger(player, card, event, DDBM_TRACE_DAMAGING_SOURCES | DDBM_MUST_DAMAGE_CREATURE | DDBM_TRACE_DAMAGED_CREATURES, player, card) ){
      card_instance_t *instance = get_card_instance( player, card );
      int i;
      for(i = 0; i<instance->targets[1].player; i++){
         rfg_when_die(player, card, instance->targets[i].player, instance->targets[i].card);
      }
      instance->targets[1].player = 0;
   }

   if( ! IS_GAA_EVENT(event) ){
      return 0;
   }

   target_definition_t td;
   default_target_definition(player, card, &td, TYPE_CREATURE|TARGET_TYPE_PLANESWALKER );
   td.zone = TARGET_ZONE_CREATURE_OR_PLAYER;

   if( event == EVENT_RESOLVE_ACTIVATION ){
      if( valid_target(&td)  ){
         damage_target0(player, card, 1);
      }
   }

   return generic_activated_ability(player, card, event, GAA_CAN_TARGET, MANACOST_XR(1, 1), 0, &td, "TARGET_ANY");
}
I didn't touch anything in the rest of the effect card code:
Code: Select all
static int rfg_when_die_legacy(int player, int card, event_t event){

   if( event == EVENT_GRAVEYARD_FROM_PLAY ){
      card_instance_t *instance= get_card_instance(player, card);

      int p = instance->damage_target_player;
      int c = instance->damage_target_card;

      if( affect_me(p, c) ){
         card_instance_t *affected = get_card_instance(p, c);
         if( affected->kill_code >= KILL_DESTROY && affected->kill_code <= KILL_SACRIFICE ){
            affected->kill_code = KILL_EXILE;
            set_special_flags2(p, c, SF2_WILL_BE_EXILED_IF_PUTTED_IN_GRAVE);
         }
      }
   }

   if( trigger_condition == TRIGGER_LEAVE_PLAY && affect_me(player, card) ){
      card_instance_t *instance= get_card_instance(player, card);
      int p = instance->targets[0].player;
      int c = instance->targets[0].card;

      if( other_leaves_play(player, card, event, p, c) ){
         kill_card(player, card, KILL_EXILE);
      }
   }


   if( event == EVENT_CLEANUP ){
      kill_card(player, card, KILL_EXILE);
   }

   return 0;
}

static int rfg_when_die(int player, int card, int t_player, int t_card){
   int legacy = create_targetted_legacy_effect(player, card, &rfg_when_die_legacy, t_player, t_card);
   card_instance_t *instance = get_card_instance( player, legacy );
   instance->targets[0].player = player;
   instance->targets[0].card = card;
   instance->number_of_targets = 1;
   return legacy;
}
Also has these bugs here:
viewtopic.php?f=86&t=20819&p=214669&hilit=kumano#p214669

Which card did behave improperly?
Kumano, Master Yamabushi

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

What exactly should be the correct behavior/interaction?
Kumano, Master Yamabushi ability creates an effect card when it deals damage to a creature and exiles that creature if it dies that turn.

Are any other cards possibly affected by this bug?
-
---
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 Bug Reports

Who is online

Users browsing this forum: No registered users and 48 guests

cron

Who is online

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

Login Form