Page 1 of 1

[fixed]Matter Reshaper no put on battlefield if cmc 3 & less

PostPosted: 31 Dec 2017, 11:47
by Aswan jaguar
Describe the Bug:
When Matter Reshaper dies it will put permanent card always in hand no matter if cmc is 3 or less.(Tested with 3 cmc creature and land).

Which card did behave improperly?
Matter Reshaper

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

What exactly should be the correct behavior/interaction?
Matter Reshaper: When Matter Reshaper dies, reveal the top card of your library. You may put that card onto the battlefield if it's a permanent card with converted mana cost 3 or less. Otherwise, put that card into your hand.

Are any other cards possibly affected by this bug?
-

Re: Matter Reshaper no put on battlefield if cmc 3 & less

PostPosted: 28 Apr 2019, 12:06
by Aswan jaguar
I tried a lot but either I make it have a correct effect but no prompt to choose to put it on battlefield or not, or it always puts the permanent in hand like I mention above.
Please help, here is the code without any changes by me:
Code: Select all
int card_matter_reshaper(int player, int card, event_t event){
   /* Matter Reshaper   |2|C   0x200e43b
    * Creature - Eldrazi 3/2
    * When ~ dies, reveal the top card of your library.
    You may put that card onto the battlefield if it's a permanent card with converted mana cost 3 or less.
    Otherwise, put that card into your hand. */

has_colorless_only_mana_in_casting_cost(player, card, event, 1);
if( this_dies_trigger(player, card, event, RESOLVE_TRIGGER_MANDATORY) ){
      int *deck = deck_ptr[player];
      if( deck[0] != -1 ){
         reveal_card_iid(player, card, deck[0]);
         int card_added = add_card_to_hand(player, deck[0]);
         remove_card_from_deck(player, 0);
         if( is_what(player, card_added, TYPE_PERMANENT) && get_cmc(player, card_added) <= 3 ){
            int choice = DIALOG(player, card, event, DLG_NO_STORAGE, DLG_NO_CANCEL,
                           "Put this card in play", 1, 5,
                           "Decline", 1, 1);
            if( choice == 1 ){
               put_into_play(player, card_added);
            }
         }
      }
   }

   return 0;
}

Re: Matter Reshaper no put on battlefield if cmc 3 & less

PostPosted: 01 May 2019, 05:36
by Korath
DIALOG() only ever does anything during EVENT_CAN_CAST, EVENT_CAST_SPELL, EVENT_RESOLVE_SPELL, EVENT_CAN_ACTIVATE, EVENT_ACTIVATE, and EVENT_RESOLVE_ACTIVATION; see its documentation in manalink.h. this_dies_trigger() only ever returns true during EVENT_RESOLVE_THIS_DIES_TRIGGER. So - along with setting DLG_NO_STORAGE - you have to explicitly pass one of those six events for anything to happen, instead of just event.

Re: Matter Reshaper no put on battlefield if cmc 3 & less

PostPosted: 01 May 2019, 10:24
by Aswan jaguar
Fixed in commit 9da4ec93.