[fixed]Demonic consultation -> game hangs (plz confirm)
Im trying to cast Demonic Consultation and game hangs (seem to be waiting but nothing occur)
High Quality Resources for Collectible Card Games
https://www.slightlymagic.net/forum/
https://www.slightlymagic.net/forum/viewtopic.php?f=110&t=28387
int card_demonic_consultation(int player, int card, event_t event){
/* Demonic Consultation |B 0x20016C3
* Instant
* Name a card. Exile the top six cards of your library, then reveal cards from the top of your library until you reveal the named card.
* Put that card into your hand and exile all other cards revealed this way. */
if( event == EVENT_RESOLVE_SPELL ){
// remove the top 6
int i=0;
for(i=0;i<6;i++){
rfg_top_card_of_deck(player);
}
test_definition_t test;
default_test_definition(&test, TYPE_ANY);
int choice = -1;
if( IS_AI(player) ){// AI code crashed if lands >= 4 so I disabled it.
/*if( count_subtype(player, TYPE_LAND, -1) >= 4 ){
test.type_flag = DOESNT_MATCH;
test.cmc = count_subtype(player, TYPE_LAND, -1)+1;
test.cmc_flag = F5_CMC_LESSER_THAN_VALUE;
} */
choice = ai_name_a_random_csvid( player, card, player, 0, &test);
}
else{
choice = card_from_list(player, 3, TYPE_ANY, 0, 0, 0, 0, 0, 0, 0, -1, 0);
}
test_definition_t test1;
default_test_definition(&test1, TYPE_ANY);
test1.id = choice;
reveal_card_until_you_reveal_test(player, player, &test1, RCUYRT_EXILE_REST | RCUYRT_ADD_TEST_TO_HAND);
kill_card(player, card, KILL_DESTROY);
}
return generic_spell(player, card, event, 0, NULL, NULL, 0, NULL);
}