It is currently 19 Apr 2024, 12:22
   
Text Size

[still issue]Disciple of Tevesh Szat AI code?

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

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

[still issue]Disciple of Tevesh Szat AI code?

Postby Aswan jaguar » 26 Oct 2018, 17:17

Describe the Bug:
When Disciple of Tevesh Szat is activated crashes game.

Which card did behave improperly?
Disciple of Tevesh Szat

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?
Disciple of Tevesh Szat

Are any other cards possibly affected by this bug?
-
Attachments
Disciple of Tevesh Szat activate-crash.rar
savegame and dump file
(15.88 KiB) Downloaded 161 times
Last edited by Aswan jaguar on 12 Oct 2019, 05:43, edited 2 times in total.
Reason: fixed-renamed to current issue
---
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: When Disciple of Tevesh Szat is activated crashes game.

Postby Aswan jaguar » 16 Aug 2019, 18:14

Fixed crash and activation cost issues in commit 1a1afc10.
Edit: I had to remove the AI priority code for this card as it caused dump errors which seemed harmless but still were annoying and I haven't got a clue of what a proper AI decision would be like. If you can help with that please do.
Current code:
Code: Select all
int card_disciple_of_tevesh_szat(int player, int card, event_t event){
/*
Disciple of Tevesh Szat |2|B|B
Creature נHuman Cleric 3/1
{T}: Target creature gets -1/-1 until end of turn.
{4}{B}{B}, {T}, Sacrifice Disciple of Tevesh Szat: Target creature gets -6/-6 until end of turn.
*/
   if( ! IS_GAA_EVENT(event) ){
      return 0;
   }

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

   card_instance_t *instance = get_card_instance(player, card);

   enum{
      CHOICE_M1_M1 = 1,
      CHOICE_M6_M6
   };

   if( event == EVENT_CAN_ACTIVATE ){
      if( generic_activated_ability(player, card, event, GAA_UNTAPPED | GAA_CAN_TARGET, MANACOST0, 0, &td, NULL) ){
         return 1;
       }
       return generic_activated_ability(player, card, event, GAA_UNTAPPED | GAA_CAN_TARGET | GAA_SACRIFICE_ME, MANACOST_XB(4, 2), 0, &td, NULL);
   }

   if( event == EVENT_ACTIVATE ){
      int abils[3] = {
                     0,
                         generic_activated_ability(player, card, EVENT_CAN_ACTIVATE, GAA_UNTAPPED | GAA_CAN_TARGET, MANACOST0, 0, &td, NULL),
                     generic_activated_ability(player, card, EVENT_CAN_ACTIVATE, GAA_UNTAPPED | GAA_CAN_TARGET, MANACOST_XB(4, 2), 0, &td, NULL)
      };

         int choice = DIALOG(player, card, event, DLG_RANDOM,
                          "Give -1/-1",       abils[1],   5,
                          "Sac and give -6/-6",   abils[2],    10);
         if( ! choice ){
              spell_fizzled = 1;
              return 0;
         }

         if( choice == CHOICE_M1_M1 ){
            return generic_activated_ability(player, card, event, GAA_UNTAPPED | GAA_CAN_TARGET, MANACOST0, 0, &td, "TARGET_CREATURE");
         }
         if( choice == CHOICE_M6_M6 ){
            return generic_activated_ability(player, card, event, GAA_UNTAPPED | GAA_CAN_TARGET | GAA_SACRIFICE_ME, MANACOST_XB(4, 2), 0, &td, "TARGET_CREATURE");
         }
   }

   if( event == EVENT_RESOLVE_ACTIVATION ){
      int choice = instance->info_slot;
      if( choice == CHOICE_M1_M1 && valid_target(&td) ){
         pump_until_eot(instance->parent_controller, instance->parent_card, instance->targets[0].player, instance->targets[0].card, -1, -1);
      }
      if( choice == CHOICE_M6_M6 && valid_target(&td) ){
         pump_until_eot(instance->parent_controller, instance->parent_card, instance->targets[0].player, instance->targets[0].card, -6, -6);
      }
   }
   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


Return to Bug Reports

Who is online

Users browsing this forum: No registered users and 41 guests

cron

Who is online

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

Login Form