![]() |
dsekai
World engine for retrocomputers.
|
Details of how the MOBILE::mp_hp field works. More...
Macros | |
#define | MOBILE_HP_MASK 0x00ff |
Bitmask denoting half of MOBILE::mp_hp devoted to MP. | |
#define | MOBILE_MP_MASK 0xff00 |
Bitmask denoting half of MOBILE::mp_hp devoted to HP. | |
#define | MOBILE_HP_DEATH -10 |
Value to set MOBILE::hp to on death but before deactivation. | |
Details of how the MOBILE::mp_hp field works.
These fields are combined to save space in an expected 16-bit struct alignment.
Use mobile_incr_hp() to modify.
Death occurs when the HP half reaches 0.
This value should be set to MOBILE_HP_DEATH on this mobile's death blow. From there, the engine will increment it up to its final value, -1, where the mobile will be deleted.
This allows for a relatively simple "blinking" death animation to occur by hiding frames for mobiles on negative even HP values.