It is currently 01 Jul 2025, 14:20
   
Text Size

[fixed/closed]Vesuva and enter-the-battlefield effects

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

[fixed/closed]Vesuva and enter-the-battlefield effects

Postby Korath » 01 Jul 2013, 06:17

Describe the Bug:
Vesuva doesn't activate its copied card's enter-the-battlefield effects.

Which card did behave improperly ?
Vesuva.

Which update are you using?(date,name)Which type(Duel,Gauntlet,Sealed Deck)
PoDMNv2 on top of CirothUngol. Solo duel/none.

What exactly should be the correct behavior/interaction ?
By analogy with the rulings for Clone, since it enters the battlefield as a copy (instead of becoming a copy when it enters the battlefield), it should get all of the enter-the-battlefield effects of the card it copies. That is, if you copy a Glimmerpost, you should gain life; it you copy a ravnica bounceland, you should have to return a land to your hand; if you copy a Bojuka Bog, you should exile a player's graveyard.

Are any other cards possibly affected by this bug ?
Clone, if it's been recoded. Almost certainly anything coded in C that should trigger these effects, which means they'll have to be fixed one-by-one.

Almost fixed | Open
In card_vesuva() in time_spiral.c, replace the EVENT_RESOLVE_SPELL handler with:
Code: Select all
    if( event == EVENT_RESOLVE_SPELL ){
        int result = check_for_cip_effects_removal(player, card);
        if( result != 2 ){
            tap_card(player, card);
        }
        cloning(player, card, instance->targets[0].player, instance->targets[0].card);
        create_targetted_legacy_effect(player, card, &empty, player, card);
        static int no_recurse = 0;
        if (instance->targets[0].player > -1 && instance->targets[12].card > -1 && no_recurse == 0){
            ++no_recurse;
            typedef int (*card_function_t)(int, int, event_t);
            card_function_t card_fn;
            card_fn = (card_function_t)cards_at_7c7000[instance->targets[12].card]->code_pointer;
            if (card_fn != (card_function_t)0x401010
                && card_fn != card_vesuva){
                return card_fn(player, card, event);
            }
            --no_recurse;
        }
    }
and add "_cards_at_7c7000 = 0x7c7000;" to manalink.lds and "extern card_data_t* cards_at_7c7000[];" to manalink.h.
Two questions:
  • Is that effect card doing anything besides providing a visual indicator that this card is a Vesuva?
  • How in the heck does cloning() have any effect? All its doing is setting target fields. In particular, whatever ends up changing the land's subtypes doesn't make a Vesuva copying Glimmerpost into a Locus in time for you to gain two life instead of one; and I'm worried about how to extend the "card_fn != card_vesuva" check above for other copying cards since internal_card_id doesn't seem to ever get changed. (Or maybe I was just inspecting it too early, like with the subtype problem?) The exe copies cards very, very differently; it responds to EVENT_CHANGE_TYPE, primarily by changing card_instance_t::internal_card_id.
Attachments
vesuva.zip
(2.33 KiB) Downloaded 256 times
Last edited by BAgate on 24 Apr 2014, 08:30, edited 4 times in total.
Reason: closed
User avatar
Korath
DEVELOPER
 
Posts: 3708
Joined: 02 Jun 2013, 05:57
Has thanked: 496 times
Been thanked: 1108 times

Re: Vesuva and enter-the-battlefield effects

Postby Gargaroz » 01 Jul 2013, 14:33

The bug is, everything should be did during "EVENT_CAST_SPELL", which I have fixed.
For the rest, "cloning" works in tandem with :
Code: Select all
if( instance->targets[12].card != -1 && instance->parent_card < 0 ){
    instance->internal_card_id = instance->targets[12].card;
}
Which actually switches the "internal_card_id". Maybe we should doing that during the event you mentioned ?
----
- Current / medium term task: adjusting the code for making Misdirection and such usable
- Long term task: inserting all the good stuff I left out from the "Golden Years" mod
Gargaroz
Programmer
 
Posts: 7097
Joined: 06 Nov 2009, 11:11
Has thanked: 82 times
Been thanked: 595 times

Re: Vesuva and enter-the-battlefield effects

Postby Korath » 01 Jul 2013, 15:10

Probably not until it's understood better (in particular, why the exe always calls the cards' functions twice with EVENT_CHANGE_TYPE, while altering several bits of land_can_be_played in between).
User avatar
Korath
DEVELOPER
 
Posts: 3708
Joined: 02 Jun 2013, 05:57
Has thanked: 496 times
Been thanked: 1108 times

[New info]Vesuva,Undiscovered Paradise bounce

Postby Korath » 27 Jul 2013, 02:25

Describe the Bug:
A. A Vesuva copying an Undiscovered Paradise can only be tapped for colorless mana.

B. When the Vesuva is bounced to my hand at untap, it leaves a (colorless-producing) Undiscovered Paradise in play. And goes back to my hand, too. (And when that's tapped and eventually bounced at my next untap, it puts another Vesuva in my hand, and leaves itself in play, too.)

Which card did behave improperly ?
Vesuva, but it's more likely a problem with the Undiscovered Paradise.

Which update are you using?(date,name)Which type(Duel,Gauntlet,Sealed Deck)
OtIv2, solo duel.

What exactly should be the correct behavior/interaction ?
The copy should be tappable for any color, and shouldn't leave itself in play when it bounces.

Are any other cards possibly affected by this bug ?
I sure hope not.
Attachments
vesuva-undiscovered-paradise-a.jpg
vesuva-undiscovered-paradise-b.jpg
Last edited by Aswan jaguar on 29 Jul 2013, 04:49, edited 5 times in total.
Reason: new info
User avatar
Korath
DEVELOPER
 
Posts: 3708
Joined: 02 Jun 2013, 05:57
Has thanked: 496 times
Been thanked: 1108 times

Re: Vesuva copying Undiscovered Paradise

Postby Korath » 27 Jul 2013, 02:33

Colorless-mana-producing Vesuva isn't limited to Undiscovered Paradise, alas:
vesuva-tropical-island.jpg

And copying a Serra's Sanctum gives the right color and amount of mana, but still shows only the colorless manastripe on the copy.
User avatar
Korath
DEVELOPER
 
Posts: 3708
Joined: 02 Jun 2013, 05:57
Has thanked: 496 times
Been thanked: 1108 times

Re: [confirmed]Vesuva mana color; Undiscovered Paradise boun

Postby Aswan jaguar » 28 Jul 2013, 05:41

I confirm it produces colourless mana no matter what it copies.
---
Trying to squash some bugs and playtesting.
User avatar
Aswan jaguar
Super Tester Elite
 
Posts: 8129
Joined: 13 May 2010, 12:17
Has thanked: 748 times
Been thanked: 477 times

Re: [confirmed both]Vesuva,Undiscovered Paradise bounce

Postby Gargaroz » 28 Jul 2013, 14:01

Well, it's a complex issue : if we're using our whacky "change internal id" method, CIP effects are perfectly copied but mana producing doesn't work.
Otherwise, if we use the engine method through "EVENT_CHANGE_TYPE", CIP effects doesn't work but the rest works perfectly, including correct mana producing.
The real challenge is combining both effects, I tried this way but it's not working for CIP effects ("instance->targets[12].card" cointains the "internal_card_id" of the land to copy) :
Code: Select all
if( instance->targets[12].card != -1 && instance->parent_card < 0 && event == EVENT_RESOLVE_SPELL){
    instance->internal_card_id = instance->targets[12].card;
}
   
if( event == EVENT_CHANGE_TYPE && affect_me(player, card) && event != EVENT_RESOLVE_SPELL ){
    event_result = instance->targets[12].card;
}
It should be noted that the hardcoded Clone doesn't reproduce CIP effects either.
Korath, any advices ?
----
- Current / medium term task: adjusting the code for making Misdirection and such usable
- Long term task: inserting all the good stuff I left out from the "Golden Years" mod
Gargaroz
Programmer
 
Posts: 7097
Joined: 06 Nov 2009, 11:11
Has thanked: 82 times
Been thanked: 595 times

Re: [confirmed both]Vesuva,Undiscovered Paradise bounce

Postby Korath » 28 Jul 2013, 23:07

Try this (completely untested; my source tree is an unbuildable amalgam of PoDMN and OtI at the moment):
Code: Select all
if ( event == EVENT_RESOLVE_SPELL && instance->targets[12].card != -1 && instance->targets[12].card != instance->internal_card_id && instance->parent_card < 0 ){
    instance->regen_status |= (1 << 24); // flag so that change_type is recalculated
    get_abilities(player, card, EVENT_CHANGE_TYPE, -1); // which should set internal_card_id
}

if( event == EVENT_CHANGE_TYPE && affect_me(player, card) ){
    event_result = instance->targets[12].card;
}
User avatar
Korath
DEVELOPER
 
Posts: 3708
Joined: 02 Jun 2013, 05:57
Has thanked: 496 times
Been thanked: 1108 times

Re: [New info]Vesuva,Undiscovered Paradise bounce

Postby Gargaroz » 29 Jul 2013, 11:42

Doesn't work, still no CIP effects, too bad :(
Could you please look at the original Clone code and see how it works ?
----
- Current / medium term task: adjusting the code for making Misdirection and such usable
- Long term task: inserting all the good stuff I left out from the "Golden Years" mod
Gargaroz
Programmer
 
Posts: 7097
Joined: 06 Nov 2009, 11:11
Has thanked: 82 times
Been thanked: 595 times

Re: [New info]Vesuva,Undiscovered Paradise bounce

Postby Gargaroz » 29 Jul 2013, 12:07

Ok, I have it !
And this solves another issue with card "cloning" something else, which as now doesn't work with activated abilities.
However, one last issue has to be resolved : if Vesuva clones something that have an ability like "sac this : do this", the ability won't work.
Here's the code :
Code: Select all
int vesuva_legacy(int player, int card, event_t event){

    card_instance_t *instance = get_card_instance( player, card );

   if(   trigger_condition == TRIGGER_COMES_INTO_PLAY && affect_me( player, card ) && reason_for_trigger_controller == affected_card_controller ){
      if( trigger_cause_controller == instance->targets[0].player && trigger_cause == instance->targets[0].card ){
         if(event == EVENT_TRIGGER){
            event_result |= 2;
         }
         else if(event == EVENT_RESOLVE_TRIGGER){
               card_instance_t *orig = get_card_instance( instance->targets[0].player, instance->targets[0].card );
               orig->targets[10].player = 66;
         }
      }
    }
   
   return 0;
}

int card_vesuva(int player, int card, event_t event){

    target_definition_t td;
    default_target_definition(player, card, &td, TYPE_LAND );
    td.allowed_controller = 2;
    td.preferred_controller = player;
    td.illegal_abilities = 0;

    card_instance_t *instance = get_card_instance( player, card );


    if( instance->targets[12].card != -1 && instance->parent_card < 0 && instance->targets[10].player != 66 ){
        instance->internal_card_id = instance->targets[12].card;
    }
   
   if( instance->targets[10].player == 66 && event == EVENT_CHANGE_TYPE && affect_me(player, card) ){
        event_result = instance->targets[12].card;
    }

    if( leaves_play(player, card, event) ){
        instance->targets[12].card = -1;
    }

    if( event == EVENT_CAST_SPELL && affect_me(player, card) ){
      if( can_target(&td) ){
         int target = 0;
         if( player == AI ){
            int i;
            for( i = 0; i < 2; i++){
               int count = 0;
               while( count < active_cards_count[i] ){
                    if( in_play(i, count) && get_id(i, count) == CARD_ID_CLOUDPOST ){
                       instance->targets[0].player = i;
                       instance->targets[0].card = count;
                       instance->number_of_targets = 1;
                       target = 1;
                       break;
                    }
                    count++;
                }
            }
         }
         if( target == 0 ){
            if( select_target(player, card, &td, "Select a land to copy", NULL) ){
               target = 1;
            }
         }
         if( target == 1 ){
            cloning(player, card, instance->targets[0].player, instance->targets[0].card);
            create_targetted_legacy_effect(player, card, &vesuva_legacy, player, card);
            int result = check_for_cip_effects_removal(player, card);
            if( result != 2 ){
               instance->state |= STATE_TAPPED;
            }
         }
      }
   }
   
   return 0;
}

----
- Current / medium term task: adjusting the code for making Misdirection and such usable
- Long term task: inserting all the good stuff I left out from the "Golden Years" mod
Gargaroz
Programmer
 
Posts: 7097
Joined: 06 Nov 2009, 11:11
Has thanked: 82 times
Been thanked: 595 times

Re: [part fixed, wait]Vesuva and enter-the-battlefield effec

Postby Korath » 15 Mar 2014, 08:52

Fixed creation of activation cards from cards no longer on the battlefield (e.g., a cost of "Sacrifice ~:" or "Return ~ to its owner's hand:" or "Exile ~:" or "Shuffle ~ into its owner's library:") in 93d99de and 4e3658c. Using a Vesuva to copy a Strip Mine and then activating it is a good test case.

I think the only thing remaining here is that Vesuva's manastripes don't update immediately.
---
And fixed that in c0350ad.
User avatar
Korath
DEVELOPER
 
Posts: 3708
Joined: 02 Jun 2013, 05:57
Has thanked: 496 times
Been thanked: 1108 times


Return to Archived Reports

Who is online

Users browsing this forum: No registered users and 33 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 33 users online :: 0 registered, 0 hidden and 33 guests (based on users active over the past 10 minutes)
Most users ever online was 5050 on 26 Jun 2025, 06:02

Users browsing this forum: No registered users and 33 guests

Login Form