HP: Difference between revisions

From Ukikipedia
Jump to navigation Jump to search
mNo edit summary
m (Misc edits)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[File:HP-INC.gif|frameless|right]]
[[File:HP-INC.gif|frameless|right]]
HP (also known as Health) is the measure of [[Mario|Mario’s]] health. If this reaches 0, Mario loses a life.
'''HP''' (also known as '''Health''') is the measure of [[Mario|Mario’s]] health. If this reaches 0, Mario loses a life.


The variable that represents Mario’s HP is a short, which ranges from 0 to 2176 (or 0x0000 to 0x0880 in hexadecimal). Specifically, the upper byte represents how many full sectors of health Mario has, and the lower byte represents what portion of the next sector Mario has. Thus, one sector is equivalent to 256 HP units. The number of sectors displayed is the truncated version of the actual number of sectors. The maximum health is 2176 HP units (8.5 sectors). Mario will die if he goes below 256 HP units (1 sector).
The variable that represents Mario’s HP is a short, which ranges from 0 to 2176 (or 0x0000 to 0x0880 in hexadecimal). Specifically, the upper byte represents how many full sectors of health Mario has, and the lower byte represents what portion of the next sector Mario has. Thus, one sector is equivalent to 256 HP units. The number of sectors displayed is the truncated version of the actual number of sectors. The maximum health is 2176 HP units (8.5 sectors). Mario will die if he goes below 256 HP units (1 sector).


The HP short is signed, so even if there was a way to push it below 0, it would not wrap around to 65535. Instead, you'd have to push it below -32768 to wrap it around to 32767. Of course, if HP is above 2176, it will just get set to 2176.  
The HP variable is signed, so even if there was a way to push it below 0, it would not wrap around to 65535. Instead, the value would have to be pushed below -32768 to wrap it around to 32767. However, if HP is above 2176, it will just get set to 2176.  


== INC and DEC ==
== INC and DEC ==
There are two bytes related to health: the increase counter and the decrease counter. When Mario gains or loses an integer number of health sectors, it’s these counters that manage that. Specifically, these counters specify how many increments of 64 HP units (one quarter sector) Mario should gain or lose. For example, if Mario touches a [[Goomba|goomba]], the decrease counter increases to 4. Thus, over the next 4 frames, Mario will lose 64 HP units on each frame, resulting in one full health sector lost.
There are two bytes related to health: the increase counter and the decrease counter. When Mario gains or loses an integer number of health sectors, it’s these counters that manage that. Specifically, these counters specify how many increments of 64 HP units (one quarter sector) Mario should gain or lose. For example, if Mario touches a [[Goomba|goomba]], the decrease counter increases to 4. Thus, over the next 4 frames, Mario will lose 64 HP units on each frame, resulting in one full health sector lost.


Once Mario's HP goes below 256 (1 sector), then he's dead, and there's no way to restore HP at that point. Mario can still collect [[Coin|coins]] to increase the INC counter, but the INC and DEC counters no longer function. For example, if you have 255 HP and collect a yellow coin, then INC will increase from 0 to 4, but it will just stay at 4 while Mario does the dying animation.  
Once Mario's HP goes below 256 (1 sector), then he's dead, and there's no way to restore HP at that point. Mario can still collect [[Coin|coins]] to increase the INC counter, but the INC and DEC counters no longer function. For example, if Mario has 255 HP and collects a yellow coin, then INC will increase from 0 to 4, but it will just stay at 4 while Mario does the dying animation.  


Separately, there are many things that change Mario’s HP directly, rather than going through the counter system. These include being underwater, being at the surface of [[Water|water]], being in cold water, being in toxic gas, and being burned by fire. Additionally, there are some things that set Mario’s HP to a particular value. These include being eaten by bubba, dying, selecting a save file, and letting the demo play.
Separately, there are many things that change Mario’s HP directly, rather than going through the counter system. These include being underwater, being at the surface of [[Water|water]], being in cold water, being in toxic gas, and being burned by fire. Additionally, there are some things that set Mario’s HP to a particular value. These include being eaten by [[Bubba]], dying, selecting a save file, and letting the demo play.


== Gaining Health ==
== Gaining Health ==
Line 47: Line 47:
'''Enemies that shock:''' [[Amp]]
'''Enemies that shock:''' [[Amp]]


'''Enemies with a Knockback of 1:''' Bubble, Cheep Chomp, [[Goomba]], [[Scuttlebug]], Swoop
'''Enemies with a Knockback of 1:''' Bubble, [[Cheep Chomp]], [[Goomba]], [[Scuttlebug]], [[Swoop]]


'''Enemies with a Knockback of 2:''' Big Cannonball, [[Goomba|Big Goomba]], Big Piranha Plant, [[Bob-omb]], [[Boo]], Bookend, Bubba, Chairs, Clam, Fly Guy, Lakitu, [[Moneybag]], Mr I, Pokey, Skeeter, Small Cannonball, Small Piranha Plant, Snowman, [[Snufit]], [[Spindrift]], Spiny
'''Enemies with a Knockback of 2:''' Big Cannonball, [[Goomba|Big Goomba]], Big Piranha Plant, [[Bob-omb]], [[Boo]], [[Bookend]], [[Bubba]], [[Haunted Chair]], Clam, [[Fly Guy]], [[Lakitu]], [[Moneybag]], Mr. I, [[Pokey]], [[Skeeter]], Small Cannonball, Small Piranha Plant, [[Mr. Blizzard]], [[Snufit]], [[Spindrift]], [[Spiny]]
*Bubba can eat Mario, instantly killing him.
*Bubba can also eat Mario, instantly killing him.


'''Enemies with a Knockback of 3:''' Big Boo, [[Bullet Bill]], [[Chain Chomp]], Piano, Piranha Plant, [[Sushi]], Unagi
'''Enemies with a Knockback of 3:''' Big Boo, [[Bullet Bill]], [[Chain Chomp]], [[Mad Piano]], [[Piranha Plant]], [[Sushi]], [[Unagi]]


'''Enemies that squish:''' [[Grindel]], King Whomp, [[Spindel]], [[Thwomp]], Tox Box, Whomp
'''Enemies that squish:''' [[Grindel]], King Whomp, [[Spindel]], [[Thwomp]], [[Tox Box]], [[Whomp]]


'''Enemies that don't do damage:''' Big Bullies, [[Bomp]], [[Bully | Bullies]], [[Chuckya]], Heave Ho, Klepto, Koopa, Manta, Small Koopa
'''Enemies that don't do damage:''' Big Bullies, [[Bomp]], [[Bully | Bullies]], [[Chuckya]], Heave Ho, Klepto, Koopa, Manta, Small Koopa
Line 67: Line 67:
| Small [[Fall Damage]] || 8 || -2 || 12 || -3
| Small [[Fall Damage]] || 8 || -2 || 12 || -3
|-
|-
| Lava || 12 || -3 || 18 || -4.5
| [[Lava]] || 12 || -3 || 18 || -4.5
|-
|-
| Big Fall Damage || 16 || -4 || 24 || -6
| Big Fall Damage || 16 || -4 || 24 || -6

Latest revision as of 05:52, 27 March 2023

HP-INC.gif

HP (also known as Health) is the measure of Mario’s health. If this reaches 0, Mario loses a life.

The variable that represents Mario’s HP is a short, which ranges from 0 to 2176 (or 0x0000 to 0x0880 in hexadecimal). Specifically, the upper byte represents how many full sectors of health Mario has, and the lower byte represents what portion of the next sector Mario has. Thus, one sector is equivalent to 256 HP units. The number of sectors displayed is the truncated version of the actual number of sectors. The maximum health is 2176 HP units (8.5 sectors). Mario will die if he goes below 256 HP units (1 sector).

The HP variable is signed, so even if there was a way to push it below 0, it would not wrap around to 65535. Instead, the value would have to be pushed below -32768 to wrap it around to 32767. However, if HP is above 2176, it will just get set to 2176.

INC and DEC

There are two bytes related to health: the increase counter and the decrease counter. When Mario gains or loses an integer number of health sectors, it’s these counters that manage that. Specifically, these counters specify how many increments of 64 HP units (one quarter sector) Mario should gain or lose. For example, if Mario touches a goomba, the decrease counter increases to 4. Thus, over the next 4 frames, Mario will lose 64 HP units on each frame, resulting in one full health sector lost.

Once Mario's HP goes below 256 (1 sector), then he's dead, and there's no way to restore HP at that point. Mario can still collect coins to increase the INC counter, but the INC and DEC counters no longer function. For example, if Mario has 255 HP and collects a yellow coin, then INC will increase from 0 to 4, but it will just stay at 4 while Mario does the dying animation.

Separately, there are many things that change Mario’s HP directly, rather than going through the counter system. These include being underwater, being at the surface of water, being in cold water, being in toxic gas, and being burned by fire. Additionally, there are some things that set Mario’s HP to a particular value. These include being eaten by Bubba, dying, selecting a save file, and letting the demo play.

Gaining Health

Item(s) INC Sector(s)
Yellow Coin and Heart Rotation 4 1
Red Coin and Manta Ring 8 2
Blue Coin and Air bubble 20 5

Losing Health

Enemies

Item(s) DEC Sector DEC (no hat) Sector (no hat)
Shock 4 -1 8 -2
1 Knockback 4 -1 8 -2
2 Knockback 8 -2 12 -3
3 Knockback 12 -3 20 -5
Squish 12 -3 18 -4.5

Enemies that shock: Amp

Enemies with a Knockback of 1: Bubble, Cheep Chomp, Goomba, Scuttlebug, Swoop

Enemies with a Knockback of 2: Big Cannonball, Big Goomba, Big Piranha Plant, Bob-omb, Boo, Bookend, Bubba, Haunted Chair, Clam, Fly Guy, Lakitu, Moneybag, Mr. I, Pokey, Skeeter, Small Cannonball, Small Piranha Plant, Mr. Blizzard, Snufit, Spindrift, Spiny

  • Bubba can also eat Mario, instantly killing him.

Enemies with a Knockback of 3: Big Boo, Bullet Bill, Chain Chomp, Mad Piano, Piranha Plant, Sushi, Unagi

Enemies that squish: Grindel, King Whomp, Spindel, Thwomp, Tox Box, Whomp

Enemies that don't do damage: Big Bullies, Bomp, Bullies, Chuckya, Heave Ho, Klepto, Koopa, Manta, Small Koopa

  • Heave Ho & Chuckya launch Mario, which can cause fall damage or death.
  • Bullies & Big Bullies can push Mario into lava, which can cause lava damage or death.

Environment

Item(s) DEC Sector DEC (no hat) Sector (no hat)
Small Fall Damage 8 -2 12 -3
Lava 12 -3 18 -4.5
Big Fall Damage 16 -4 24 -6
  • If Mario remains in the squished state for 10 seconds straight, then his HP will be set to 255, and he will die as a result.
  • Note that going out of bounds, going near the death barrier, going into the whirlpool in DDD, and going into the quicksand in SSL all kill Mario, but they don't actually change his HP.

References

UncommentatedPannen video on HP