|
NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
|
#include <game/bases/d_boss_life.hpp>
Interface for managing a boss's hit points, damage values, and damage state.
This class defines the common interface used to manage boss HP and to apply damage from different attack types. Derived classes are responsible for deciding how much damage each attack type deals and how the boss's damage state changes as its HP decreases.
The current HP is stored in mLife.
Damage should normally be applied through one of the update methods rather than modifying mLife directly.
Each update method obtains the damage amount from its corresponding getDamage method. This means that derived classes can change the damage dealt by an attack simply by overriding the appropriate getDamage method.
All update methods eventually call updateCommon, which subtracts the supplied damage from mLife and returns the resulting HP. If the boss survives the attack, it then calls damageRev.
damageRev can be overridden by a derived class to perform post-damage adjustments or state changes without having to reimplement every update method.
The isNonDamage, isOneDamage, and isTwoDamage methods provide phase/state information based on the boss's current HP. Their exact meaning is implementation-defined, so code using this interface should treat them as the derived class's definition of the corresponding damage states.
isDmgSection can additionally be used by implementations that divide HP into discrete sections. The base implementation returns false.
A concrete implementation must provide the damage-state methods and the damage values for each supported attack type.
Definition at line 5 of file d_boss_life.hpp.
Public Member Functions | |
| dBossLifeInf_c (int life) | |
| Constructs a new boss life manager. | |
| virtual | ~dBossLifeInf_c () |
| Destroys the boss life manager. | |
| virtual bool | isNonDamage () const =0 |
| Checks whether the boss has not yet been damaged. | |
| virtual bool | isOneDamage () const =0 |
| Checks whether the boss has been damaged once. | |
| virtual bool | isTwoDamage () const =0 |
| Checks whether the boss has been damaged twice. | |
| virtual bool | isDmgSection () const |
| Checks whether the current HP is at a damage section boundary. | |
| virtual int | getDamage_Fire () const =0 |
| Gets the damage dealt by fireball attacks. | |
| virtual int | getDamage_Fumi () const =0 |
| Gets the damage dealt by stomp (Fumi) attacks. | |
| virtual int | getDamage_HipAtk () const =0 |
| Gets the damage dealt by ground pound (Hip) attacks. | |
| virtual int | getDamage_Star () const =0 |
| Gets the damage dealt by Star invincibility attacks. | |
| virtual int | getDamage_PenguinSlide () const =0 |
| Gets the damage dealt by Penguin slide attacks. | |
| virtual int | getDamage_BlockHit () const =0 |
| Gets the damage dealt by block hit attacks. | |
| virtual int | getDamage_Shell () const =0 |
| Gets the damage dealt by shell attacks. | |
| virtual int | getDamage_Quake () const =0 |
| Gets the damage dealt by multiplayer ground pound (Quake) attacks. | |
| virtual void | damageRev (int dmg) |
| Post-damage callback invoked when a boss survives an attack. | |
| int | updateCommon (int dmg) |
Common update logic for all the update methods. | |
| int | updateFire () |
| Applies fireball damage to the boss. | |
| int | updateFumi () |
| Applies stomp (Fumi) damage to the boss. | |
| int | updateHipAtk () |
| Applies ground pound (Hip) damage to the boss. | |
| int | updateStar () |
| Applies Star damage to the boss. | |
| int | updatePenguinSlide () |
| Applies Penguin slide damage to the boss. | |
| int | updateBlockHit () |
| Applies block hit damage to the boss. | |
| int | updateShell () |
| Applies shell damage to the boss. | |
| int | updateQuake () |
| Applies multiplayer ground pound (Quake) damage to the boss. | |
Public Attributes | |
| int | mLife |
| The current hit point total. | |
|
inline |
Constructs a new boss life manager.
| life | Initial hit point total for the boss. |
Definition at line 9 of file d_boss_life.hpp.
|
inlinevirtual |
Destroys the boss life manager.
Definition at line 10 of file d_boss_life.hpp.
|
pure virtual |
Checks whether the boss has not yet been damaged.
Implemented in dBossLife_Common_c.
|
pure virtual |
Checks whether the boss has been damaged once.
Implemented in dBossLife_Common_c.
|
pure virtual |
Checks whether the boss has been damaged twice.
Implemented in dBossLife_Common_c.
|
inlinevirtual |
Checks whether the current HP is at a damage section boundary.
true if the implementation considers the current HP to be at a damage-section boundary; otherwise false .The default implementation always returns false . Implementations that divide boss HP into sections can override this method to expose those boundaries.
Reimplemented in dBossLife_Common_c.
Definition at line 23 of file d_boss_life.hpp.
|
pure virtual |
Gets the damage dealt by fireball attacks.
Implemented in dBossLife_Common_c.
|
pure virtual |
Gets the damage dealt by stomp (Fumi) attacks.
Implemented in dBossLife_Common_c.
|
pure virtual |
Gets the damage dealt by ground pound (Hip) attacks.
Implemented in dBossLife_Common_c.
|
pure virtual |
Gets the damage dealt by Star invincibility attacks.
Implemented in dBossLife_Common_c.
|
pure virtual |
Gets the damage dealt by Penguin slide attacks.
Implemented in dBossLife_Common_c.
|
pure virtual |
Gets the damage dealt by block hit attacks.
Implemented in dBossLife_Common_c.
|
pure virtual |
Gets the damage dealt by shell attacks.
Implemented in dBossLife_Common_c.
|
pure virtual |
Gets the damage dealt by multiplayer ground pound (Quake) attacks.
Implemented in dBossLife_Common_c.
|
inlinevirtual |
Post-damage callback invoked when a boss survives an attack.
| dmg | The amount of damage applied. |
Reimplemented in dBossLife_Common_c.
Definition at line 36 of file d_boss_life.hpp.
Common update logic for all the update methods.
| dmg | The amount of damage applied. |
Definition at line 41 of file d_boss_life.hpp.
|
inline |
Applies fireball damage to the boss.
Definition at line 51 of file d_boss_life.hpp.
|
inline |
Applies stomp (Fumi) damage to the boss.
Definition at line 55 of file d_boss_life.hpp.
|
inline |
Applies ground pound (Hip) damage to the boss.
Definition at line 59 of file d_boss_life.hpp.
|
inline |
Applies Star damage to the boss.
Definition at line 63 of file d_boss_life.hpp.
|
inline |
Applies Penguin slide damage to the boss.
Definition at line 67 of file d_boss_life.hpp.
|
inline |
Applies block hit damage to the boss.
Definition at line 71 of file d_boss_life.hpp.
|
inline |
Applies shell damage to the boss.
Definition at line 75 of file d_boss_life.hpp.
|
inline |
Applies multiplayer ground pound (Quake) damage to the boss.
Definition at line 79 of file d_boss_life.hpp.
| int dBossLifeInf_c::mLife |
The current hit point total.
Definition at line 81 of file d_boss_life.hpp.