News:

Don't forget to visit the main site! There's lots of helpful docs, patches, and more!

Main Menu

[SM] [ENEMY] Changing Kraid stand up HP value (solved)

Started by JAM, January 10, 2012, 03:07:22 AM

Previous topic - Next topic

JAM

I was trying to change value of Kraid HP when he is standing up, but haven't found this in hex tweaks and in his AI code (I was searching for $036A and $036B because he raising when his health is lower than $036B). Help anyone!

Scyzer

This is handled a bit differently.

Kraid doesn't check for specific HP values during the fight, but a fraction of his maximun HP, the values of which are determined in the initiation AI.
The part of the routine which sets up the fractions is at $A7A9FF.


org $A7A9FF
LDX #$0000 : LDA $0F8C  ;not indexed by enemy
LSR #3 : STA $12  ;12 now contains 1/8 of max HP
- STA $7E780C,X  ;Store fraction,X
CLC : ADC $12 : INX #2  ;increase the energy to check by 1/8 of max
CPX #$0010 : BMI -  ;Store all fractions to ram


The RAM from $7E780C - $7E781A will contain all fractions of max HP from 1/8 to 7/8. Kraid checks each fraction for shifts in AI and color.
The one you want is at $7E7818 (which is #$036B with normal Kraid HP).


org $A7C005
LDA $0F8C : CMP $7E7818 : BMI + : RTS
+ ;Change AI and stuffs here


Hopefully that's everything you need to do whatever. If you just wanted to check for a specific value, instead of CMP $7E7818, use CMP #$XXXX : NOP.

JAM

#2
Ahh... That's why. Yeah, it's a bit harder to find than amount of health when Torizo eye will be damaged or Spore Spawn will move faster. In those cases code is like:

LDA $0F8C
CMP !value
BMI (or BPL) $xx


I've incresed Kraid's HP to $1000 using cheat code after the room loads, because changing HP in enemy E2FF's DNA doesn't change anything and still I had to lower his HP to $036A to make him stand up (and palettes wasn't changing before that).

And I just understood, that real Kraid HP is DNA E2BF, not in E2FF. And all these calculcations you have provided based on E2BF's HP. Now it's clear. Now I know how to increase his HP and how to change value when he will stand up. Thanks for the help!