NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
d_a_en_carry.cpp
1#include <game/bases/d_a_en_carry.hpp>
2
4
6 if (actor->mKind == STAGE_ACTOR_ENEMY) {
7 dEn_c *enemy = (dEn_c *) actor;
8 if (enemy->mFlags & EN_IS_SHELL) {
9 return true;
10 }
11 }
12 return actor->mProfName == fProfile::EN_MECHA_KOOPA ||
13 actor->mProfName == fProfile::EN_BOMHEI;
14}
15
16int daEnCarry_c::acmShellPlayerNo(dActor_c *actor) const {
18 return mPlayerNo;
19 }
20 return *actor->getPlrNo();
21}
22
23void daEnCarry_c::shellDamageEffect(dCc_c *cc, dActor_c *actor) {
24 bool damageEffect = true;
26 damageEffect = false;
27 }
28 if (damageEffect) {
29 mVec2_c pos2D = cc->mCollPos;
30 hitdamageEffect(mVec3_c(pos2D, 5500.0f));
31 } else if (acmIsCarryEnemy(actor)) {
32 ((daEnCarry_c *) actor)->mForceShellDamageEffect = true;
33 }
34}
35
36void daEnCarry_c::initializeState_Carry() {}
37void daEnCarry_c::finalizeState_Carry() {}
38void daEnCarry_c::executeState_Carry() {}
bool isState(const sStateIDIf_c &other) const
Checks if the actor is currently in the given state.
The minimum required implementation for a stage actor.
Definition d_actor.hpp:15
u8 mKind
The actor's kind. Value is a STAGE_ACTOR_KIND_e.
Definition d_actor.hpp:374
s8 mPlayerNo
The player associated with the actor, -1 if not associated to any player.
Definition d_actor.hpp:375
dActor_c()
Constructs a new actor.
Definition d_actor.cpp:46
virtual s8 * getPlrNo()
Gets the player number associated with the actor. See mPlayerNo.
Definition d_actor.hpp:105
@ STAGE_ACTOR_ENEMY
An enemy actor.
Definition d_actor.hpp:49
Collider ("Collision Check") class - handles collisions between actors.
Definition d_cc.hpp:111
mVec2_c mCollPos
The position where the last collision occurred.
Definition d_cc.hpp:289
dEn_c()
Constructs a new enemy actor.
Definition d_enemy.cpp:28
u32 mFlags
Flags for this actor. See FLAGS_e.
Definition d_enemy.hpp:286
A carryable enemy. [As opposed to dEnemyCarry_c, this class is used a bit more widely....
static bool acmIsCarryEnemy(dActor_c *actor)
Checks whether the given actor is a carryable enemy.
static sFStateVirtualID_c< daEnCarry_c > StateID_Carry
The enemy is being carried.
bool mForceShellDamageEffect
Whether to force the shell damage effect the next time shellDamageEffect is called.
ProfileName mProfName
The base's profile name.
Definition f_base.hpp:61
#define STATE_VIRTUAL_DEFINE(class, name)
Defines a virtual state.
Definition s_State.hpp:46