It is currently 26 Apr 2024, 14:47
   
Text Size

Differences between original Manalink and the actual one.

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

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

Differences between original Manalink and the actual one.

Postby Gargaroz » 13 Dec 2011, 16:31

Mok, check this. I'll ask Jatill to post what he know here.

* What I know *
- Keyword "protections from enchantments" is now Shroud.

- Keyword "banding when attacking" is now "Protection from Creatures", but this isn't working

- Many new rules extensions are stored in Rules Engine & Deadbox cards, which are automatically generated at the beginning of the duel if needed. For this purpose, in cards_dat "cc[2]" / "CT_CardFlags3" is used for storing special values.

* What I did *
- Keyword after "protection from lands" are used for new creature abilities like Shadow. This is inaccurate and I'll remove it maing a new enum in the next future.

- Keyword "protection from interrupt" is used as "flag" for Changeling creatures. As currently "interrupt" is discontinued as card type, I think there's no problem if I leave things as they are.

- Keyword 0x20000000 is actually used for "Infect". Checking your XLS, seems to be originally unused, can we keep it this way ?

- Half of the "targets" array (after targets[10]) is used to store specific datas, especially for creatures (new abilities, +1/+1 counters and so on). Dunno if this is a problem with older cards, seems to work fine.
----
- 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: Differences between original Manalink and the actual one

Postby Snacko » 13 Dec 2011, 17:14

Someone hacked in double strike hard that makes no sense
KEYWORD_DOUBLE_STRIKE = KEYWORD_CANNOT_ATTACK | KEYWORD_FIRST_STRIKE, /* seriously wtf */
Snacko
DEVELOPER
 
Posts: 826
Joined: 29 May 2008, 19:35
Has thanked: 4 times
Been thanked: 74 times

Re: Differences between original Manalink and the actual one

Postby Gargaroz » 13 Dec 2011, 17:38

It's my fault, due to the fact I didn't understand properly the way the KEYWORD enum is written (I hate that bitwise shift crap).
But the best fact is that it actually worked, as I was using the KEYWORD_CANNOT_ATTACK mindlessly only as value for the "pump_ability_until_eot" function, so you had a creature that cannot attack and with double strike. This passed completly unnoticed until now, even for the bug hunters. :oops:
Don't worry, as I mentioned already above, I'll fix that.
----
- 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: Differences between original Manalink and the actual one

Postby Snacko » 13 Dec 2011, 19:13

Well this "bitwise sift crap" is the basic of making bitfield values human readable without converting hex to binary.

Also if you're fixing things, you should fix card coded to something like this, because reading the csv files over again is really bad.
Code: Select all
int is_valid_card(int card){
   if(card > active_cards_count) {
      return 0;
   }
   int id = get_internal_card_id_from_csv_id( card );
   card_ptr_t* c = cards_ptr[ card ];
   // no tokens or vanguard cardss
   if( id > -1 && cards_data[id].cc[2] != 3 && c->expansion != 4096 && cards_data[id].type != 128 ){
      // ante cards
      if( card != 43 && card != 56 && card != 479 && card != 431 && card != 60 && card != 763 && card != 810  ){
         // take out the rules engine and a 'dummy' card
         if( card != 1847 && card != 916 && card_coded[card/8] & 1<<card%8 ){
            return 1;
         }
      }
   }
   return 0;
}
where
char* card_coded;
and in lds _card_coded = 0x4EB7F8;
of course this value needs to be changed for the new magic.exe as the bitfield was most likely moved (ask mok where he moved it to)

also
Code: Select all
card_data_t* get_card_data(int player, int card){
    card_instance_t *instance = get_card_instance(player, card);
    int id = instance->internal_card_id;
    return &cards_data[id];
}
you should return reference and not copy the whole card_data_t struct; this will need a simple find&replace over all card_d variables from . to ->
Snacko
DEVELOPER
 
Posts: 826
Joined: 29 May 2008, 19:35
Has thanked: 4 times
Been thanked: 74 times

Re: Differences between original Manalink and the actual one

Postby Mok » 13 Dec 2011, 19:24

Snacko wrote:char* card_coded;
and in lds _card_coded = 0x4EB7F8;
of course this value needs to be changed for the new magic.exe as the bitfield was most likely moved (ask mok where he moved it to)
Yup, that little bitfield is now located at 0x75c000. But that's only for the new exe, for old ones (testing) it's indeed at 4eb7f8.
Mok
Programmer
 
Posts: 163
Joined: 23 Nov 2011, 14:28
Has thanked: 1 time
Been thanked: 61 times

Re: Differences between original Manalink and the actual one

Postby Gargaroz » 14 Dec 2011, 02:06

Thanx for the tips, Snacko ;)
----
- 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: Differences between original Manalink and the actual one

Postby Aswan jaguar » 14 Dec 2011, 04:47

Gargaroz wrote
"pump_ability_until_eot" function, so you had a creature that cannot attack and with double strike. This passed completly unnoticed until now, even for the bug hunters.

I am almost 100% certain that AI attacked with double strikers unless you mean that a pumped double striker didn't attack(or smt else).I am not at home to test right now.I will do later.
---
Trying to squash some bugs and playtesting.
User avatar
Aswan jaguar
Super Tester Elite
 
Posts: 8078
Joined: 13 May 2010, 12:17
Has thanked: 730 times
Been thanked: 458 times

Re: Differences between original Manalink and the actual one

Postby stassy » 14 Dec 2011, 10:37

Yup, Mirran Crusader is working perfectly in NLdecV2, don't know about the others 9 cards though
stassy
Moderator
 
Posts: 5274
Joined: 25 Feb 2009, 07:06
Has thanked: 471 times
Been thanked: 337 times

Re: Differences between original Manalink and the actual one

Postby Gargaroz » 14 Dec 2011, 10:47

Nah, it's the other way : if a creature is made "unable to attack until eot" from some spell, it had Double Strike too due to that error. But don't mind, I'll fix that.
----
- 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: Differences between original Manalink and the actual one

Postby jatill » 14 Dec 2011, 13:17

I'm not sure exactly what you're looking for, but here are some of the changes to magic.exe I made that I can think of:

1) Added a ton of code for new cards, obv
2) Changed the effect of rukh egg to be used for every legacy effect
3) Removed manaburn
4) Changed the location of images for main page buttons
5) Load bmp files a lot of places instead of pic files
6) Added some code for mulliganing to handle serum powder
7) Changed the legendary rule

I'm not sure how this is helping anyone. I'll also dump the contents of my patch.txt, where is my scratchpad for various addresses that I needed to look up frequently. Again, probably won't help, but can't hurt either :)
Last edited by jatill on 14 Dec 2011, 13:21, edited 1 time in total.
jatill
DEVELOPER
 
Posts: 2118
Joined: 24 Feb 2009, 16:35
Has thanked: 5 times
Been thanked: 17 times

Re: Differences between original Manalink and the actual one

Postby jatill » 14 Dec 2011, 13:17

patch.txt


next free: 1204B5E

ability keyword setting: 4d307c
abilities bmp: 608D3C
aer: 415910
415c90

-Make Metalworker a 1/2 (not 1/3)
-Fix text for Jareth and Birthlore Rangers
-Have Journey to Nowhere, O Ring, and Packmaster say what they exiled
-Fix Oran-Rief bug where is makes counters and produces mana
-Fix interaction with deathtouch and indestrictible
-Fix interaction with deathtouch and lifelink (at least for nighthawk)


Mana Pool Emptying:
43a195

Facemaker loader code:
440E20

Dialog checking sub: 4414E0

Update wiki
-add new card art to main page
-udate draft to point at proper csv
-update scores for new legends cards

red is loaded at 10006cec and 1000ef81
10044D61 (put at 1000eece)

Bugs:
Put some cards in their peoper sets for limited
Diabolic Edict: kill shroud guys
Ichorid: return to play
Plated Geopede: Appear in draft
Nightscape Familiar: only affect your spells
Wall of Roots: cannot attack
Cemetery Reaper: do not crash the game when nothing is selected

cardartnew: 35c1a4

put string at 456690

pic to bmp:
change 10017080 (or 459FA0) to 00466720


000000FFF8010001000000

004000FF11010002000000

archive trap not working right

004B8110
us: 004BC140
sc:020011F5



*Cobra Trap: trap condition does not work
*Summoning Trap: trap condition does not work
*Tanglesap: prevents damage from trample creatures too
*Vines of Vastwood: grants shroud, not super shroud
*Hellkite Charger: does not have "take extra attacks" ability
*Noble Vestige: has samite healer ability
*Shieldmate's Blessing is the same as Healing Salve
*Unstable Footing: doesn't prevent damage
*Token generators: sometimes make wrong creature types but right stats)



Known Bugs:
-Card type is actually Enchantment
-If you damage yourself, you can redirect it to your Planeswalkers
-Legacy effect has wrong title when attacking a Planeswalker



Parameter error: 201652f
20164df (1, -1) -> 410fe9 (1, -1) -> 477ea4 (1, -1)
201627f


Failures:
Living Plane
Natural Order

SPAT

Bloodstained Mire: 004E1803
Farseek: 004E4CDF
Tinker: 004DCBD2
Upheaval: 004E5EDB
top: 004E7253
cloudgoat: 004DF9EA
mystical tutor: 004E5BCD
Brainstorm: 004E7A40
Tooth and Nail: 004E7FE7
spirit of the night: 004E6919
Glimpse: 01202DD6
Izzet Signet: 01200170
arcbound worker: 01203543
basalt monolith: 0044E400
demonic hordes: 004523E0
exploration: 01203347
terramorphic: 004DFD9E
ivory guardians: 0042A110
fork: 004A28B0
symbiotic wurm: 004E0DDC
pregrine_drake: 004DB7E0
palinchron: 004DB720
progenitus: 01203430
flame jav: 0040DFF0
millstone: 00421F10

channel:
4edd30 - string
4A16F0 - code
7281b8 - pointer

ruk
892 - token
457E10 - code
735ed0 - pointer

Mulligan Code: 4165c7 -> 004165d6 (in sub 00416530)
Injected Code: 004523E0

new injection: 469685 (code to remove)

CALL 020014F2

Dual Land Code: 4725C0 injected at 1204Ab2

_ai_modifier = 0x7A31A8;

47281a

want to insert at 479108

Startup:
478E59 (CALL 00417090) to 45247f to 478E5E

Pregame:
478DD9 to 452499 to 478de5

416ff7 to 4524be to 416fff

Play or Draw:
478c67 to 45250d to 478c71

Quick Start
478e31 -> 45250d -> 478e36


220000FF0F010001000000
100000FFF1010002000000


4a16f9 to 4524e1 to 4a16ff (and 4a187b)

Naf's asp: code: 4A12A0
s
4a12a4 to 452526 to 4a12aa (and 4a1412)

dword_4EF184 == 30

birds code: 4357ad to 4524d6 to 4357b2

select target code:
47e9d3 to 45252d to 47e9d9 (calling 2001871)

tutor alphabetize code:
479363 -> 45252d -> 47936d


card zombie master: 004E203F

debug options: 49b9fc

regular options: 499fee


100-200 Bombs that potentially win the game on their own (Loxodon Warhammer, Meloku, Fireball)
80-99 High Quality removal (Terror, Swords to Plowshares)
70-79 Very strong Creatures (Air Elemental, Serra Angel)
60-69 Strong Spells (Tidings)
50-59 Above Average Creatures (Durkwood Boars, Prodigal Sorcerer)
40-49 Medium quality Removal (ex: Immolation)
20-39 Average Creatures
10-19 Lands and mana fixers
1-9 Filler cards (ex: Grizzly Bears)
0 Cards that should never make your draft / sealed deck

subtype name: 4eb93f
loaded into: 6087c8
loaded at 464a79
array loaded into: 79066C

Change 4671bc to jmp 1204708

7A5384 ???

4486cd -> 12046ee

4486cd: change to 'jmp 12046ee'
445b2c: change all constants to 64B to default to 'None'
446703: change set commands to call 2001d44 etc

butons: 4CEA20
26, C6, 70, 110

vult: 4C6CD0

120477c -> 4cebc8

counters:
4d4ca9 -> 120479c
48cbb4 -> 12047d2

is_creature (120482b

new coords: 1204745 -> 4cea2b

switcher: 440f33 -> 120487e
Magic Limited.exe string: 1204904


_indestructible = 0x12029B5;

play game: 4AC380

end duel: 4AC380 -> 46A220 -> 46A530 -> 46B6F0


4AcD98: call 46A220

Play game 2: 4ac2b0 -> 4278B0

Main game code: 43B110
Doran Code: 4B23C0 (4B2549)
First Strike Code: 4B39E0

Double Strike:
4B39F2 -> 01204A84 -> 4B3A12
jatill
DEVELOPER
 
Posts: 2118
Joined: 24 Feb 2009, 16:35
Has thanked: 5 times
Been thanked: 17 times


Return to Development

Who is online

Users browsing this forum: No registered users and 37 guests

cron

Who is online

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

Login Form