It is currently 26 Apr 2024, 07:21
   
Text Size

One day, Doc went coding...

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

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

Re: One day, Doc went coding...

Postby jatill » 04 Jul 2010, 15:10

DrLambda wrote:Where do i get the proper reserved information for this? The Blinding Angel code is there, but Blinding Angel isn't in the current version as far as i can see. Also, how can i find out if the problem is the reserved information?
Use CardEditorLimited, it's in there. Knowing when the error is reserved information for me just comes from experience. I spent hours scratching my head with Blinding Angel before I figured out that was my problem.

DrLambda wrote:Also it's interesting to note how i actually spent like 4-5 hours now on a card that probably noone will play ;) (Well, it's better than Archangel though.)
Yeah, that's the sad part about making complete sets. At least you gained the experience :)
jatill
DEVELOPER
 
Posts: 2118
Joined: 24 Feb 2009, 16:35
Has thanked: 5 times
Been thanked: 17 times

Re: One day, Doc went coding...

Postby DrLambda » 04 Jul 2010, 21:06

Hey, Safe Passage actually was quite easy to do.

I'm back at the Angelic Arbiter but i still run into problems every few minutes. I changed the reserved information. Now, stopping the attack works... but increasing the cost actually won't. It's demotivating, especially because i know the code worked yesterday. I'm close to conceding to this card.

Let me show you the code i got there.
Code: Select all
int card_angelic_arbiter(int player, int card, event_t event)
{
   card_instance_t *instance = get_card_instance(player, card);

//RESETTING AT THE UPKEEP
   if( current_turn == player && upkeep_trigger(player, card, event) )
   {
          instance->info_slot = 0x05;
       }

//INCREASING THE COST IF OPPONENT ATTACKED THIS TURN
   else if( event == EVENT_MODIFY_COST_GLOBAL && affected_card_controller == 1-player )
   {
           card_instance_t *instance2 = get_card_instance( affected_card_controller, affected_card);     
           int type = cards_data[ instance2->internal_card_id ].type;
           if( ! ( type & TYPE_LAND ) && instance->info_slot == 0x06)
      {
                  COST_COLORLESS+=49;
           } 
       }

//CHECK IF OPPONENT IS ATTACKING
   else if( event == EVENT_DECLARE_ATTACKERS && current_turn == 1-player)
   {
              instance->info_slot = 0x06;
   }

//CHECK IF OPPONENT IS CASTING A SPELL
      else if(trigger_condition == TRIGGER_SPELL_CAST && player == affected_card_controller && player ==

reason_for_trigger_controller && player != trigger_cause_controller && card == affected_card )
       {
           card_instance_t *instance3 = get_card_instance(trigger_cause_controller, trigger_cause);
           if( ! ( cards_data[ instance3->internal_card_id].type & TYPE_LAND ) )
         {
                  if(event == EVENT_TRIGGER)
            {
                         event_result |= RESOLVE_TRIGGER_MANDATORY;
                     }
                  else if(event == EVENT_RESOLVE_TRIGGER)
            {
                         instance->info_slot = 0x07;
                     }
              }
       }

//MAKING IT IMPOSSIBLE TO ATTACK IF SPELL WAS PLAYED THIS TURN
   else if( event == EVENT_ATTACK_LEGALITY && player != current_turn && instance->info_slot == 0x07 )
   {
           event_result = 1;
       }
       return 0;
}
The following spoiled white cards are uncoded!
Angelic Arbiter (Code actually there, doesn't work)
Vengeful Archon (I didn't try to do it until now)
DrLambda
 
Posts: 49
Joined: 09 Jul 2008, 00:46
Has thanked: 0 time
Been thanked: 0 time

Re: One day, Doc went coding...

Postby jatill » 04 Jul 2010, 21:31

Any reason you're using weird hex number (ex: 0x07) instead of just 7?
So prepare to pull some hair out... the cost increase part of the card is also linked to the reserved information. So to get both halves of this card working, you need a combination of reserved informations.

Blinding Angel:
000004FF0F100003000000

Stonybrook Banneret:
000040FF01010002000000

I would try "or"ing them together and see if it works:
000044FF0F111003000000

Another tip: when you use upkeep_trigger, the game will show this card doing work during the upkeep, which is annoying and requires a click by the user. Just do phase = upkeep to avoid the click.

Vengeful Arrchon should hopefully be straightforward based safe passage.
jatill
DEVELOPER
 
Posts: 2118
Joined: 24 Feb 2009, 16:35
Has thanked: 5 times
Been thanked: 17 times

Re: One day, Doc went coding...

Postby DrLambda » 04 Jul 2010, 21:55

It works! Yay!

I actually thought about "or"ing them, but because i have no idea of reserved information, i thought it would actually break something.

I used the hex numbers because i broke something while coding this card and couldn't find the error, so this was one of the things i tried and forgot to change it back ;)

Thanks a lot again. You're really a big help at getting started at this.
DrLambda
 
Posts: 49
Joined: 09 Jul 2008, 00:46
Has thanked: 0 time
Been thanked: 0 time

Re: One day, Doc went coding...

Postby jatill » 06 Jul 2010, 12:16

DrLambda wrote:Thanks a lot again. You're really a big help at getting started at this.
Thanks, I do my best :) Looks like the entire spoiler is out now. Would you like to go through it and pick some card that look too difficult / time consuming, and I'll code those?

Looking at the list, I think the following cards are impossible, and/or can only be approximated:

Approximations:
Stormtide Leviathan
Captivating Vampire
Rise from the Grave
Combust
Incite
Gaea's Revenge
Sacred Wolf
Palace Guard
Alluring Siren
Frost Titan
Ice Cage

Impossible:
Redirect
Leyline of Punishment
Autumn's Veil
Leyline of Sanctity
Leyline of Anticipation

I am currently working on:
Conundrum Sphinx
Ice Cage
Phantom Beast
Stormtide Leviathan
jatill
DEVELOPER
 
Posts: 2118
Joined: 24 Feb 2009, 16:35
Has thanked: 5 times
Been thanked: 17 times

Re: One day, Doc went coding...

Postby aww1979 » 06 Jul 2010, 23:46

For Palace Guard, is it possible to tweak Avatar of Hope, since we already have that one, and palace guard is actually simpler? :p
aww1979
Tester
 
Posts: 1717
Joined: 03 Mar 2009, 19:36
Has thanked: 0 time
Been thanked: 2 times

Re: One day, Doc went coding...

Postby DrLambda » 07 Jul 2010, 08:44

I think the problem is that we don't have the code for the Avatar, and simply calling the function would include the cost-reducing effect. But what do i know?

I'll do the white cards first. I guess they shouldn't be too hard once i find out why Vengeful Archon prevents the damage just fine but doesn't shoot back. Also, while i believe you that the white Leyline is impossible, i'll still try ;)

Harder cards (just by looking at the list, may be easy though):
Mass Polymorph
Necrotic Plague
Phylactery Lich
Reassembling Skeleton (Yeah, it probably wasn't a good idea to try this as my 3rd card ever ;) I still have no idea how to take control of the rules engine card to activate abilities out of a graveyard (triggers work fine))
Wild Evocation
Obstinate Baloth (you already completed it, right?)

I guess thats it.

I still have a question about the distribution. To get it into your (jatill's) release, should i send you the .exe/.csv/.dat or the .c files or both? What else do you need to put it into My2000?

*Edit: Just checked, i'm working on the following cards in white.
Celestial Purge
Infantry Veteran
Inspired Charge
Leyline of Sanctity (?)
Palace Guard
Roc Egg
Silence
Vengeful Archon
DrLambda
 
Posts: 49
Joined: 09 Jul 2008, 00:46
Has thanked: 0 time
Been thanked: 0 time

Re: One day, Doc went coding...

Postby jatill » 07 Jul 2010, 12:03

Put the cards into you regular version, replacing whatever is convenient (even good cards). Then use deply.bat to make the zip file.
When we're both done, I'll accept the chore of merging everything together.

Good call on Palace Guard. You can just use the same code pointer, but do not cc[2] to 1. Voila, done.

Re Leyline, I had an idea. I can't make you an illegal target, but I can fizzle any spells that target you, I think. I haven't tested yet, but I'm going to try it later today for Gaea's Revenge.

Edit: Gaea's Revenge works about as expected, so that's good. I coded a few more cards:
Reassembling Skeleton
Awakener Druid
Necrotic Plague
Mass Polymorph
Wild Evocation
Obstinate Baloth
Phylactery Lich

If you want to peek at the code, here it is: http://www.mediafire.com/file/mzydlm24lmy/20100707.zip
Some code for the skeleton appears in game_startup.c. Don't accidentally clobber your files, though :)
jatill
DEVELOPER
 
Posts: 2118
Joined: 24 Feb 2009, 16:35
Has thanked: 5 times
Been thanked: 17 times

Re: One day, Doc went coding...

Postby DrLambda » 07 Jul 2010, 22:37

White cards should now be complete (Without Leyline).

I'll now do the black cards. There aren't that many left:
Requiring code (Even if trivial)
Blood Tithe
Bloodthrone Vampire
Captivating Vampire
Child of Night
Deathmark
Demon of Death's Gate
Doom Blade
Howling Banshee
Liliana's Caress
Nightwing Shade
Quag Sickness
Rise from the Grave
Rotting Legion
Stabbing Pain

Change to CSV and .EXE only
Barony Vampire
Bog Raiders
Nether Horror
DrLambda
 
Posts: 49
Joined: 09 Jul 2008, 00:46
Has thanked: 0 time
Been thanked: 0 time


Previous

Return to Development

Who is online

Users browsing this forum: No registered users and 25 guests


Who is online

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

Login Form