Page 1 of 1

Possibly faulty keyword and locating code for cards

PostPosted: 07 Feb 2011, 22:31
by Serra
Hi.

I'll have to keep this short, hope you'll forgive my Spartan style.

Since this is my first post on this forum, here is a short presentation of myself: I've played this game for 1+ years, and really enjoyed it. Now, other things must take priority, but I thought I'd help out with the program a little before leaving. Basically my way of saying "thanks for keeping this updated".

Therefore I've fixed a couple of bugs (most of the fixes can be found in the recent patch), and I'm going to update the coding-wiki to facilitate for the community and new coders to help out in the future.

Because of the above I have two questions:

1. The code for Sylvan Library, Armadillo Cloak and a couple of other cards cannot be found in the card code files. I assume they are located in the exe, but they are not listed as such in the manalink.h file. Therefore I conjecture that not all cards in the exe are written in the manalink.h file. My question is thus, how would one recode a card in the exe that is not listed in manalink.h? Can you just rewrite the card with new C code using SkyMagic Editor, or do you have to do something else?

2. The lifelink keyword seems to be faulty. To be more precise, in the following code:
Code: Select all
card_data_t card_d = get_card_data(player, card);
if(card_d.static_ability & KEYWORD_LIFELINK){
   life[player] = 1337;
}
the conditional never seems to evaluate to true. Is this correct, and if so, are there any more known problems with the keywords?

Re: Possibly faulty keyword and locating code for cards

PostPosted: 08 Feb 2011, 16:50
by jatill
1. Yes, you can just recode a card from scratch in C and abandon the code in the exe.
2. LIFELINK is not a keyword originally built into the game. It's just a bolt-on I added for convenience, so it won't work the way you are trying.

Re: Possibly faulty keyword and locating code for cards

PostPosted: 08 Feb 2011, 19:32
by Serra
OK. Thanks for the fast response.

Edit: Are there any other keywords that have the same restrictions on their use as lifelink?

Re: Possibly faulty keyword and locating code for cards

PostPosted: 08 Feb 2011, 20:09
by jatill
Haste and vigilance

Re: Possibly faulty keyword and locating code for cards

PostPosted: 13 Feb 2011, 13:59
by Serra
I'll add that to the wiki update. Thanks.

Re: Possibly faulty keyword and locating code for cards

PostPosted: 16 Feb 2011, 22:22
by Serra
The "Coding Cards in C"-wiki has now been substantially updated. Hope you like it! That is probably the last contribution to the manalink project I have time to make. Although you never know, maybe one day I'll have time to spare once again.

Untill then,
See you around!

Re: Possibly faulty keyword and locating code for cards

PostPosted: 16 Feb 2011, 22:46
by Salbei
Thanks for doing this.
Enjoy your time out :)

Re: Possibly faulty keyword and locating code for cards

PostPosted: 21 Feb 2011, 00:52
by Serra
No problem, and I will.