Page 1 of 1

[confirmed]Goblin Rabblemaster Bugged

PostPosted: 25 Jan 2022, 23:42
by etphonehome
Goblin Rabblemaster doesn't force the goblin it creates (in the turn it creates it) to attack.
Also, if you don't have a creature to attack and the game don't pause for you to choose creatures to attack, Goblin Rabblemaster doesn't create a goblin.

THX

Re: Goblin Rabblemaster Bugged

PostPosted: 26 Jan 2022, 16:22
by Aswan jaguar
Both have been already posted:
1) viewtopic.php?f=86&t=22330&p=225499&hilit=Goblin+Rabblemaster#p225499
2) viewtopic.php?f=86&t=15339&p=160819#p165844

In the meantime you can put a stop on combat phase so the token is created if you don't have creatures that can attack.
However you reconfirmed these bugs especially the one that is more than 7 years old.

Re: [duplicate]Goblin Rabblemaster Bugged

PostPosted: 27 Jan 2022, 00:07
by drool66
Is there reason we can't move beginning of combat effects from EVENT_PHASE_CHANGED to EVENT_MUST_ATTACK? The token is made on EVENT_PHASE_CHANGED which comes after EVENT_MUST_ATTACK, so the token doesn't get attack_if_able()
The only thing I can think of is interaction of effects and ordering them on the stack, but afaik I don't think we can do that now anyway - and can't until we do an analog of the STRIGGER system.
EDIT:
The following seems to work in a vacuum:
Code: Select all
   if( in_play(player, card) && ! is_humiliated(player, card, AL_STATIC) ){
      event_flags |= EA_FORCE_ATTACK;
   }

   if (event == EVENT_MUST_ATTACK && current_turn == player){
      token_generation_t token;
      default_token_definition(player, card, CARD_ID_GOBLIN, &token);
      token.pow = token.tou = 1;
      token.s_key_plus = SP_KEYWORD_HASTE;
      generate_token(&token);
      int c;
      for (c = 0; c < active_cards_count[player]; ++c){
         if ( c!= card && in_play(player, c) && is_what(player, c, TYPE_CREATURE) && has_subtype(player, c, SUBTYPE_GOBLIN) ){
            attack_if_able(player, c, event);
         }
      }
   }
[the rest of the code]

Re: [duplicate]Goblin Rabblemaster Bugged

PostPosted: 28 Jan 2022, 13:36
by Aswan jaguar
I tested a little your code and generally works better. It creates the token even when no other creature can attack and the token is forced to attack.

I tried with extra combat effects, with Savage Beating the token created in normal combat was forced to attack both in normal and in extra combat (good) but no token was created for the extra combat. So maybe other triggers, triggering at the beginning of combat will have issues with extra combat effects.

Previous code:
When extra combat begins it creates a token (good), but the tokens created on that turn are not forced to attack as said in top post in normal combat and don't in extra combat, too.

Re: [confirmed]Goblin Rabblemaster Bugged

PostPosted: 13 Feb 2022, 07:51
by Aswan jaguar
We are keeping this post and archive the old ones as now we have more info in this topic.
@drool66 I don't know if you intend to work on this again before a new release but otherwise we should push your code which works better in more cases, and the ones that are more common,too than the old one does.

Re: [confirmed]Goblin Rabblemaster Bugged

PostPosted: 13 Feb 2022, 09:38
by Korath
I don't think I had to do anything special to start dispatching beginning-of-combat triggers at EVENT_MUST_ATTACK, but it was a long time ago.

The loss-of-abilities check above isn't going to work unless that's the only card on the bf with a similar function. You've got to check it at EVENT_MUST_ATTACK, which will be dispatched if anything sets EA_FORCE_ATTACK. It's ok to set event_flags continuously in general, and especially so for this bit since EVENT_MUST_ATTACK only gets sent once a turn. Calling in_play() or is_humiliated() (which calls get_card_instance()) without filtering by event is abhorrent anyway, though no more so than all the other places it's done.

And of course you can currently order triggers. The only reason to try to deal with the original trigger system at all is because it lets you pick their order. Define an XTRIGGER if it bothers you that you can't here, though be aware that plenty of cards already run their beginning-of-combat triggers in response to EVENT_MUST_ATTACK instead of going through beginning_of_combat(). Probably some check for EVENT_PHASE_CHANGED themselves instead, too.