It is currently 16 Apr 2024, 18:01
   
Text Size

[fixed]Helvault no cards exiled back

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

[fixed]Helvault no cards exiled back

Postby Aswan jaguar » 31 Jul 2018, 10:48

Describe the Bug:
1- Helvault doesn't prompt for target after the menu you choose which ability to use. If you click on the target it works though.
2- Helvault doesn't return all cards exiled with it to the battlefield under their owners' control.
Which card did behave improperly?
Helvault

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?
1- Helvault prompt for target after the menu you choose which ability to use.
2- Helvault returns all cards exiled with it to the battlefield under their owners' control.

Are any other cards possibly affected by this bug?
-
Attachments
helvault no target menu.rar
(3.9 KiB) Downloaded 139 times
Last edited by Aswan jaguar on 23 Sep 2019, 16:07, edited 2 times 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: Helvault no target prompt & no cards exiled back

Postby Aswan jaguar » 20 Jul 2019, 10:46

Fixed the prompts in commit 6c6584a9. My efforts were unsuccessful so still the exiled cards don't return.
Code: Select all
int card_helvault(int player, int card, event_t event){
/*
Helvault |3
Legendary Artifact
{1}, {T}: Exile target creature you control.
{7}, {T}: Exile target creature you don't control.
When Helvault is put into a graveyard from the battlefield, return all cards exiled with it to the battlefield under their owners' control.
*/
   check_legend_rule(player, card, event);

   if( this_dies_trigger(player, card, event, RESOLVE_TRIGGER_MANDATORY) ){
      card_instance_t *instance = get_card_instance( player, card );
      int leg = 0;
      int idx = 0;
      int* loc;

      while ((loc = exiledby_find_any(player-2, instance->targets[1].card, &leg, &idx)) != NULL){
            int owner = (*loc & 0x80000000) ? 1 : 0;
            int iid = *loc & ~0x80000000;
            *loc = -1;
            int card_added = add_card_to_hand(owner, iid);
            put_into_play(player, card_added);
      }
   }

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

   target_definition_t td2;
   default_target_definition(player, card, &td2, TYPE_CREATURE);
   td2.allowed_controller = player;
   td2.preferred_controller = player;
   if( player == AI ){
      td2.required_state = TARGET_STATE_DESTROYED;
   }

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

   card_instance_t *instance = get_card_instance( player, card );

   enum{
      CHOICE_EXILE_YOURS = 1,
      CHOICE_EXILE_OPP,
      CHOICE_SHOW_EXILED
   };

   if( event == EVENT_CAN_ACTIVATE ){
      if( player == HUMAN &&
         generic_activated_ability(player, card, event, GAA_UNTAPPED | GAA_CAN_TARGET, MANACOST_X(1), 0, &td, NULL) )
      {
         return 1;
      }
      if( player == AI &&
         generic_activated_ability(player, card, event, GAA_UNTAPPED | GAA_CAN_TARGET | GAA_REGENERATION, MANACOST_X(1), 0, &td2, NULL) )
      {
         return 99;
      }
      if( generic_activated_ability(player, card, event, GAA_UNTAPPED |GAA_CAN_TARGET, MANACOST_X(7), 0, &td3, NULL) ){
         return 1;
      }
   }

   if( event == EVENT_ACTIVATE ){
      instance->info_slot = instance->number_of_targets = 0;
      int abils[4] = {
                  0,
                  0,
                  generic_activated_ability(player, card, EVENT_CAN_ACTIVATE, GAA_UNTAPPED |GAA_CAN_TARGET, MANACOST_X(7), 0,
                                    &td3, NULL),
                  player == HUMAN && exiledby_count(player, card, ANYBODY) ? 1 : 0
      };
      if( player == HUMAN ){
         abils[1] = generic_activated_ability(player, card, EVENT_CAN_ACTIVATE, GAA_UNTAPPED | GAA_CAN_TARGET, MANACOST_X(1), 0,
                                    &td, NULL);
      }
      else{
         abils[1] = generic_activated_ability(player, card, EVENT_CAN_ACTIVATE, GAA_UNTAPPED | GAA_CAN_TARGET | GAA_REGENERATION,
                                    MANACOST_X(1), 0, &td2, NULL);
      }
      int choice = DIALOG(player, card, event, DLG_RANDOM,
                     "Exile a creature you control",    abils[1], 5,
                     "Exile opponent's creature",       abils[2], 10,
                     "Show exiled creatures",          abils[3], 1);
      if( ! choice ){
         spell_fizzled = 1;
         return 0;
      }

      if( choice == CHOICE_EXILE_YOURS ){
         if( player == HUMAN ){
            return generic_activated_ability(player, card, event, GAA_UNTAPPED | GAA_CAN_TARGET | GAA_LITERAL_PROMPT, MANACOST_X(1), 0,
                                    &td, "Select target creature you control.");
         }
         else{
            generic_activated_ability(player, card, event, GAA_UNTAPPED | GAA_CAN_TARGET | GAA_REGENERATION, MANACOST_X(1), 0,
                                 &td2, NULL);
         }
      }
      if( choice == CHOICE_EXILE_OPP ){
         return generic_activated_ability(player, card, event, GAA_UNTAPPED |GAA_CAN_TARGET|GAA_LITERAL_PROMPT, MANACOST_X(7), 0,
                                 &td3, "Select target creature you don't control.");
      }
      if( choice == CHOICE_SHOW_EXILED ){
         exiledby_choose(player, card, CARD_ID_HELVAULT, EXBY_CHOOSE, 0, "Creature", 0);
         spell_fizzled = 1;
      }
   }

   if( event == EVENT_RESOLVE_ACTIVATION ){
      int good = 0;
      if( instance->info_slot == CHOICE_EXILE_YOURS && player == HUMAN && valid_target(&td) ){
         good = 1;
      }
      if( instance->info_slot == CHOICE_EXILE_YOURS && player == AI && valid_target(&td2) ){
         regenerate_target(instance->targets[0].player, instance->targets[0].card);
         good = 1;
      }
      if( instance->info_slot == CHOICE_EXILE_OPP && valid_target(&td3) ){
         good = 1;
      }
      if( good ){
         exile_card_and_remember_it_on_exiledby(instance->parent_controller, instance->parent_card,
                                       instance->targets[0].player, instance->targets[0].card);
      }
   }

   return 0;
}
---
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: Helvault no cards exiled back

Postby Aswan jaguar » 23 Sep 2019, 16:07

Finally fixed in commit 7819922a.
---
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 69 guests


Who is online

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

Login Form