HP: Difference between revisions

90 bytes added ,  13 January 2020
m
Now an Alive end
m (modified the reference section to show context of the link)
m (Now an Alive end)
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’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).
Line 7: Line 7:


== 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, 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 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 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.  


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.
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 19: Line 19:
! Item(s) !! INC !! Sector(s)
! Item(s) !! INC !! Sector(s)
|-
|-
| Yellow Coin and Heart Rotation || 4 || 1
| [[Yellow Coin]] and Heart Rotation || 4 || 1
|-
|-
| Red Coin and Manta Ring || 8 || 2
| [[Red Coin]] and Manta Ring || 8 || 2
|-
|-
| Blue Coin and Air bubble || 20 || 5
| [[Blue Coin]] and Air bubble || 20 || 5
|}
|}


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, 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, 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
*Bubba can eat Mario, instantly killing him.
*Bubba can eat Mario, instantly killing him.


Line 65: Line 65:
! Item(s) !! DEC !! Sector !! DEC (no hat) !! Sector (no hat)
! Item(s) !! DEC !! Sector !! DEC (no hat) !! Sector (no hat)
|-
|-
| 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
Line 73: Line 73:


*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.
*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.
*Note that going out of bounds, going near the [[Death Barrier|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 ==  
== References ==  
[https://m.youtube.com/watch?v=XeGNpeFOOCY UncommentatedPannen video on HP]
[https://m.youtube.com/watch?v=XeGNpeFOOCY UncommentatedPannen video on HP]
127

edits