NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
dBossLife_Common_c Class Reference

#include <game/bases/d_boss_life.hpp>

Inheritance diagram for dBossLife_Common_c:
[legend]

Description

Standard boss life manager implementation, using 6-HP sections.

This class provides a section-based implementation of dBossLifeInf_c. Boss HP is divided into sections of 6 HP, with the current section determining the boss's damage state.

Definition at line 91 of file d_boss_life.hpp.

Public Member Functions

 dBossLife_Common_c (int num)
 Constructs a new boss life manager.
virtual ~dBossLife_Common_c ()
 Destroys the boss life manager.
int getSection () const
 Gets the current section (zero-indexed).
virtual bool isNonDamage () const override
 Checks whether the boss has not yet been damaged.
virtual bool isOneDamage () const override
 Checks whether the boss has been damaged once.
virtual bool isTwoDamage () const override
 Checks whether the boss has been damaged twice.
virtual bool isDmgSection () const override
 Checks whether the current HP is at a damage section boundary.
virtual void damageRev (int dmg) override
 Post-damage callback invoked when a boss survives an attack.
virtual int getDamage_Fire () const override
 Gets the damage dealt by fireball attacks.
virtual int getDamage_Fumi () const override
 Gets the damage dealt by stomp (Fumi) attacks.
virtual int getDamage_HipAtk () const override
 Gets the damage dealt by ground pound (Hip) attacks.
virtual int getDamage_Star () const override
 Gets the damage dealt by Star invincibility attacks.
virtual int getDamage_PenguinSlide () const override
 Gets the damage dealt by Penguin slide attacks.
virtual int getDamage_BlockHit () const override
 Gets the damage dealt by block hit attacks.
virtual int getDamage_Shell () const override
 Gets the damage dealt by shell attacks.
virtual int getDamage_Quake () const override
 Gets the damage dealt by multiplayer ground pound (Quake) attacks.
Public Member Functions inherited from dBossLifeInf_c
 dBossLifeInf_c (int life)
 Constructs a new boss life manager.
virtual ~dBossLifeInf_c ()
 Destroys the boss life manager.
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.

Additional Inherited Members

Public Attributes inherited from dBossLifeInf_c
int mLife
 The current hit point total.

Constructor & Destructor Documentation

◆ dBossLife_Common_c()

dBossLife_Common_c::dBossLife_Common_c ( int num)
inline

Constructs a new boss life manager.

Parameters
lifeInitial hit point total for the boss.

Definition at line 93 of file d_boss_life.hpp.

◆ ~dBossLife_Common_c()

virtual dBossLife_Common_c::~dBossLife_Common_c ( )
inlinevirtual

Destroys the boss life manager.

Definition at line 94 of file d_boss_life.hpp.

Member Function Documentation

◆ getSection()

int dBossLife_Common_c::getSection ( ) const
inline

Gets the current section (zero-indexed).

Definition at line 97 of file d_boss_life.hpp.

◆ isNonDamage()

virtual bool dBossLife_Common_c::isNonDamage ( ) const
inlineoverridevirtual

Checks whether the boss has not yet been damaged.

Implements dBossLifeInf_c.

Definition at line 99 of file d_boss_life.hpp.

◆ isOneDamage()

virtual bool dBossLife_Common_c::isOneDamage ( ) const
inlineoverridevirtual

Checks whether the boss has been damaged once.

Implements dBossLifeInf_c.

Definition at line 103 of file d_boss_life.hpp.

◆ isTwoDamage()

virtual bool dBossLife_Common_c::isTwoDamage ( ) const
inlineoverridevirtual

Checks whether the boss has been damaged twice.

Implements dBossLifeInf_c.

Definition at line 107 of file d_boss_life.hpp.

◆ isDmgSection()

virtual bool dBossLife_Common_c::isDmgSection ( ) const
inlineoverridevirtual

Checks whether the current HP is at a damage section boundary.

Reimplemented from dBossLifeInf_c.

Definition at line 112 of file d_boss_life.hpp.

◆ damageRev()

virtual void dBossLife_Common_c::damageRev ( int dmg)
inlineoverridevirtual

Post-damage callback invoked when a boss survives an attack.

Parameters
dmgThe amount of damage applied.

If the boss survives, the damage was at least 6 HP, and the resulting HP lies partway through a section, HP is rounded up to the next multiple of 6. This behavior is used to preserve complete 6-HP sections after heavy attacks.

Reimplemented from dBossLifeInf_c.

Definition at line 121 of file d_boss_life.hpp.

◆ getDamage_Fire()

virtual int dBossLife_Common_c::getDamage_Fire ( ) const
inlineoverridevirtual

Gets the damage dealt by fireball attacks.

Implements dBossLifeInf_c.

Definition at line 128 of file d_boss_life.hpp.

◆ getDamage_Fumi()

virtual int dBossLife_Common_c::getDamage_Fumi ( ) const
inlineoverridevirtual

Gets the damage dealt by stomp (Fumi) attacks.

Implements dBossLifeInf_c.

Definition at line 129 of file d_boss_life.hpp.

◆ getDamage_HipAtk()

virtual int dBossLife_Common_c::getDamage_HipAtk ( ) const
inlineoverridevirtual

Gets the damage dealt by ground pound (Hip) attacks.

Implements dBossLifeInf_c.

Definition at line 130 of file d_boss_life.hpp.

◆ getDamage_Star()

virtual int dBossLife_Common_c::getDamage_Star ( ) const
inlineoverridevirtual

Gets the damage dealt by Star invincibility attacks.

Implements dBossLifeInf_c.

Definition at line 131 of file d_boss_life.hpp.

◆ getDamage_PenguinSlide()

virtual int dBossLife_Common_c::getDamage_PenguinSlide ( ) const
inlineoverridevirtual

Gets the damage dealt by Penguin slide attacks.

Implements dBossLifeInf_c.

Definition at line 132 of file d_boss_life.hpp.

◆ getDamage_BlockHit()

virtual int dBossLife_Common_c::getDamage_BlockHit ( ) const
inlineoverridevirtual

Gets the damage dealt by block hit attacks.

Implements dBossLifeInf_c.

Definition at line 133 of file d_boss_life.hpp.

◆ getDamage_Shell()

virtual int dBossLife_Common_c::getDamage_Shell ( ) const
inlineoverridevirtual

Gets the damage dealt by shell attacks.

Implements dBossLifeInf_c.

Definition at line 134 of file d_boss_life.hpp.

◆ getDamage_Quake()

virtual int dBossLife_Common_c::getDamage_Quake ( ) const
inlineoverridevirtual

Gets the damage dealt by multiplayer ground pound (Quake) attacks.

Implements dBossLifeInf_c.

Definition at line 135 of file d_boss_life.hpp.