Page 1 of 1

Decker coded cards

PostPosted: 03 Nov 2012, 08:23
by decker
Hi,
So I'm going to post here the cards that I am fiddling with (I don't know if the id is of any use or only related to my version ?).

Kabuto Moth (200789d)
Code: Select all
int card_kabuto_moth(int player, int card, event_t event){

    return vanilla_creature_pumper(player, card, event, 0, 0, 0, 0, 0, 0, 3, 1, 2, 0, 0);
}
To Arms! (20078a2)
Code: Select all
int card_to_arms(int player, int card, event_t event){

   if( event == EVENT_CAN_CAST ){
      return 1;
    }

    if( event == EVENT_RESOLVE_SPELL ){
      manipulate_all(player, card, player, TYPE_CREATURE, 0, 0, 0, 0, 0, 0, 0, -1, 0, ACT_UNTAP);
      draw_cards(player, 1);
      kill_card(player, card, KILL_DESTROY);
    }
    return 0;   
}

Re: Decker coded cards

PostPosted: 03 Nov 2012, 08:38
by decker
Now I am trying to work on Silent Arbiter, but I'm having a hard time finding a similar card Crawlspace is the closest I found but code only talks about attackers.

So I was thinking about this kind of code but I had to try to guess the blocking part...

Code: Select all
int card_silent_arbiter(int player, int card, event_t event){

    card_instance_t *instance = get_card_instance(player, card);

    if( trigger_condition == TRIGGER_DECLARE_ATTACK && current_phase == PHASE_DECLARE_ATTACKERS ){
            if(event == EVENT_TRIGGER){
                event_result |= 2;
            }
            else if( event == EVENT_RESOLVE_TRIGGER){
                     instance->info_slot++;
                     if(instance->info_slot > 1 ){
                        forbid_attack = 1;
                     }
            }
       
    }
    if( trigger_condition == TRIGGER_DECLARE_ATTACK && current_phase == PHASE_DECLARE_BLOCKERS ){
            if(event == EVENT_TRIGGER){
                event_result |= 2;
            }
            else if( event == EVENT_RESOLVE_TRIGGER){
                     instance->info_slot++;
                     if(instance->info_slot > 1 ){
                        forbid_block = 1;
                     }
            }
       
    }
    if( instance->info_slot > 0 && eot_trigger(player, card, event) ){
        instance->info_slot = 0;
    }

    return 0;
}
I did not dare compile it as I kind of invented forbid_block

Re: Decker coded cards

PostPosted: 05 Nov 2012, 07:25
by stassy
Nice, I suggest also you PM Gargaroz about it as he doesn't often visit all the others forums beside the Bug and patch section.

Re: Decker coded cards

PostPosted: 06 Jul 2013, 18:45
by fabiopinhao
Hi,

Did you have success with the Silent Arbiter code?