Norbert wrote:
"cmp char_charid, charid_4_skeleton" plus
"jz loc_42D6" (
jump if/on zero).
If I'm not mistaken this means it skips the hit point deduction if char_charid is equal to a skeleton.
Correct.
Norbert wrote:
But where in PRINCE.EXE does the game set those char_charids for the enemies in each level?
It's in enter_guard(), in seg002.c:
Code: Select all
// level 3 has skeletons with infinite lives
if (current_level == 3) {
Char.charid = charid_4_skeleton;
} else {
Char.charid = charid_2_guard;
}
"current_level == 3" should be replaced with "tbl_guard_type[current_level] == 2".
That is, invincibility should depend on the level's guard type, not the level number.
The relevant part of the disassembly: (I deleted some empty lines)
Code: Select all
seg002:0196 EB 06 jmp short loc_381E
seg002:0198 loc_3818:
seg002:0198 C7 06 88 58 00 00 mov curr_guard_color, 0 ; non-plain guards have only one color
seg002:019E loc_381E:
seg002:019E 83 3E 9E 0F 03 cmp current_level, 3 ; level 3 has skeletons with infinite lives
seg002:01A3 75 07 jnz loc_382C
seg002:01A5 C6 06 2D 3D 04 mov char_charid, charid_4_skeleton ; skeleton
seg002:01AA EB 05 jmp short loc_3831
seg002:01AC loc_382C:
seg002:01AC C6 06 2D 3D 02 mov char_charid, charid_2_guard ; guard
seg002:01B1 loc_3831:
After some tries, I came up with this replacement:
Code: Select all
1556:0196 EB0F JMP 01A7
1556:0198 C70688580000 MOV WORD PTR [5888],0000
1556:019E B004 MOV AL,04
1556:01A0 83BFD40302 CMP WORD PTR [BX+03D4],+02
1556:01A5 7402 JZ 01A9
1556:01A7 B002 MOV AL,02
1556:01A9 A22D3D MOV [3D2D],AL
1556:01AC 90 NOP
1556:01AD 90 NOP
1556:01AE 90 NOP
1556:01AF 90 NOP
1556:01B0 90 NOP
Search: EB 06 C7 06 88 58 00 00 83 3E 9E 0F 03 75 07 C6 06 2D 3D 04 EB 05 C6 06 2D 3D 02
Replace with: EB 0F C7 06 88 58 00 00 B0 04 83 BF D4 03 02 74 02 B0 02 A2 2D 3D 90 90 90 90 90
Norbert wrote:
And, make the prince die if he skills customly placed shadows, regardless the levels they appear on.
(I guess you meant "kills".)
Do you mean guards (placed in the editor) on levels with guard type=shadow (set with CusPoP), or the special shadow appearing on levels 5,6,12?
And maybe make shadow-guards placed in the editor look like the shadow? (Currently they look like the kid.)
This might require further changes to the part above.