It is currently 16 Apr 2024, 21:00
   
Text Size

Decker coded cards

Discuss Upcoming Releases, Coding New Cards, Etc.
PLEASE DO NOT REPORT BUGS HERE!

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

Decker coded cards

Postby decker » 03 Nov 2012, 08:23

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;   
}
User avatar
decker
 
Posts: 61
Joined: 09 May 2010, 18:37
Location: Nice, France (GMT+1)
Has thanked: 2 times
Been thanked: 1 time

Re: Decker coded cards

Postby decker » 03 Nov 2012, 08:38

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
User avatar
decker
 
Posts: 61
Joined: 09 May 2010, 18:37
Location: Nice, France (GMT+1)
Has thanked: 2 times
Been thanked: 1 time

Re: Decker coded cards

Postby stassy » 05 Nov 2012, 07:25

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.
stassy
Moderator
 
Posts: 5274
Joined: 25 Feb 2009, 07:06
Has thanked: 471 times
Been thanked: 337 times

Re: Decker coded cards

Postby fabiopinhao » 06 Jul 2013, 18:45

Hi,

Did you have success with the Silent Arbiter code?
fabiopinhao
 
Posts: 2
Joined: 06 Jul 2013, 18:43
Has thanked: 0 time
Been thanked: 0 time


Return to Development

Who is online

Users browsing this forum: No registered users and 20 guests

cron

Who is online

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

Login Form