New Super Mario Bros. U Headers
Loading...
Searching...
No Matches
ChibiYoshiAwaData.h
Go to the documentation of this file.
1#pragma once
2
3#include <actor/ActorUniqueID.h>
4
5#include <math/seadVector.h>
6
7class Actor;
8
9/**
10 * @brief Defines parameters for interaction with bubbles from the blue Baby Yoshi.
11 * @par vtable Address: 0x10108190
12 */
14{
15public:
16 /**
17 * @brief Defines the type of interaction the bubble will have upon contact with the actor.
18 */
20 {
21 cAwaType_Invalid = 0, ///< Bubble cannot catch the actor and breaks instead.
22 cAwaType_Catch, ///< Bubble catches the actor and spawns low value random content.
23 cAwaType_CatchBig, ///< Bubble catches the actor and spawns high value random content.
25 };
26 static_assert(sizeof(AwaType) == 4);
27
28 /**
29 * @brief Defines which stage of interaction we are currently in.
30 */
31 enum State
32 {
35 };
36 static_assert(sizeof(State) == 4);
37
38 /**
39 * @brief Defines the type of powerup item which has a chance to spawn in the bubble when caught.
40 */
42 {
43 cItemType_Normal = 0, ///< Random item.
44 cItemType_ForceMusasabi, ///< Always acorn.
45 cItemType_ForceKinoko ///< Always mushroom.
46 };
47 static_assert(sizeof(ItemType) == 4);
48
49public:
50 /**
51 * @brief Constructs the ChibiYoshiAwaData and parents it to an owner by ID.
52 * @param owner_id The ID of the actor which this data belongs to.
53 * @par Address: 0x0272D5EC
54 */
55 ChibiYoshiAwaData(ActorUniqueID owner_id);
56
57 /**
58 * @brief Called when a bubble hits the actor and either catches it or breaks.
59 * @par Address: 0x0272D730
60 */
61 virtual void setAwaHit(Actor* awa);
62 /**
63 * @brief Called as the bubble is swallowing the actor.
64 * @par Address: 0x0272D734
65 */
66 virtual void awaCatchMove(Actor* awa);
67 /**
68 * @brief Called when the bubble finishes swallowing the actor, and the actor should die.
69 * @par Address: 0x0272D700
70 */
71 virtual void setAwaCatchEnd(Actor* awa);
72 /**
73 * @brief Called when the bubble cannot catch the actor and breaks instead
74 * @par Address: 0x0272D738
75 */
76 virtual void setAwaInvalid(Actor* awa);
77
78 /**
79 * @brief The type of interaction the bubble will have upon contact with the actor.
80 */
82 {
83 return mAwaType;
84 }
85
86 /**
87 * @brief Set the type of interaction the bubble will have upon contact with the actor.
88 */
90 {
91 mAwaType = type;
92 }
93
94 /**
95 * @brief Which stage of interaction we are currently in.
96 */
98 {
99 return mState;
100 }
101
102 /**
103 * @brief Set which stage of interaction we are currently in.
104 */
105 void setState(State state)
106 {
107 mState = state;
108 }
109
110 /**
111 * @brief The type of powerup item which has a chance to spawn in the bubble when caught.
112 */
114 {
115 return mItemType;
116 }
117
118 /**
119 * @brief Set the type of powerup item which has a chance to spawn in the bubble when caught.
120 */
122 {
123 mItemType = type;
124 }
125
126 /**
127 * @brief An offset to the actor's center position, which modulates the target position the bubble should drift towards the moment it catches onto the actor.
128 */
130 {
131 return mPosOffset;
132 }
133
134 /**
135 * @brief An offset to the actor's center position, which modulates the target position the bubble should drift towards the moment it catches onto the actor.
136 */
137 const sead::Vector2f& getPosOffset() const
138 {
139 return mPosOffset;
140 }
141
142protected:
143 ActorUniqueID mOwnerID; ///< The ID of the actor which this data belongs to.
144 ActorUniqueID mChibiYoshiAwaID; ///< The ID of the bubble which we are currently interacting with.
145 AwaType mAwaType; ///< The type of interaction the bubble will have upon contact with the actor.
146 State mState; ///< Which stage of interaction we are currently in.
147 ItemType mItemType; ///< The type of powerup item which has a chance to spawn in the bubble when caught.
148 sead::Vector2f mPosOffset; ///< An offset to the actor's center position, which modulates the target position the bubble should drift towards the moment it catches onto the actor.
149};
150static_assert(sizeof(ChibiYoshiAwaData) == 0x20);
Definition Actor.h:19
Defines parameters for interaction with bubbles from the blue Baby Yoshi.
Definition ChibiYoshiAwaData.h:14
State
Defines which stage of interaction we are currently in.
Definition ChibiYoshiAwaData.h:32
@ cState_Catch
Definition ChibiYoshiAwaData.h:34
@ cState_None
Definition ChibiYoshiAwaData.h:33
void setAwaType(AwaType type)
Set the type of interaction the bubble will have upon contact with the actor.
Definition ChibiYoshiAwaData.h:89
const sead::Vector2f & getPosOffset() const
An offset to the actor's center position, which modulates the target position the bubble should drift...
Definition ChibiYoshiAwaData.h:137
virtual void setAwaInvalid(Actor *awa)
Called when the bubble cannot catch the actor and breaks instead.
sead::Vector2f mPosOffset
An offset to the actor's center position, which modulates the target position the bubble should drift...
Definition ChibiYoshiAwaData.h:148
State mState
Which stage of interaction we are currently in.
Definition ChibiYoshiAwaData.h:146
void setState(State state)
Set which stage of interaction we are currently in.
Definition ChibiYoshiAwaData.h:105
sead::Vector2f & getPosOffset()
An offset to the actor's center position, which modulates the target position the bubble should drift...
Definition ChibiYoshiAwaData.h:129
ActorUniqueID mOwnerID
The ID of the actor which this data belongs to.
Definition ChibiYoshiAwaData.h:143
virtual void setAwaHit(Actor *awa)
Called when a bubble hits the actor and either catches it or breaks.
AwaType mAwaType
The type of interaction the bubble will have upon contact with the actor.
Definition ChibiYoshiAwaData.h:145
State getState() const
Which stage of interaction we are currently in.
Definition ChibiYoshiAwaData.h:97
ItemType getItemType() const
The type of powerup item which has a chance to spawn in the bubble when caught.
Definition ChibiYoshiAwaData.h:113
ActorUniqueID mChibiYoshiAwaID
The ID of the bubble which we are currently interacting with.
Definition ChibiYoshiAwaData.h:144
AwaType
Defines the type of interaction the bubble will have upon contact with the actor.
Definition ChibiYoshiAwaData.h:20
@ cAwaType_Invalid
Bubble cannot catch the actor and breaks instead.
Definition ChibiYoshiAwaData.h:21
@ cAwaType_Catch
Bubble catches the actor and spawns low value random content.
Definition ChibiYoshiAwaData.h:22
@ cAwaType_Num
Definition ChibiYoshiAwaData.h:24
@ cAwaType_CatchBig
Bubble catches the actor and spawns high value random content.
Definition ChibiYoshiAwaData.h:23
virtual void setAwaCatchEnd(Actor *awa)
Called when the bubble finishes swallowing the actor, and the actor should die.
AwaType getAwaType() const
The type of interaction the bubble will have upon contact with the actor.
Definition ChibiYoshiAwaData.h:81
void setItemType(ItemType type)
Set the type of powerup item which has a chance to spawn in the bubble when caught.
Definition ChibiYoshiAwaData.h:121
ItemType
Defines the type of powerup item which has a chance to spawn in the bubble when caught.
Definition ChibiYoshiAwaData.h:42
@ cItemType_Normal
Random item.
Definition ChibiYoshiAwaData.h:43
@ cItemType_ForceMusasabi
Always acorn.
Definition ChibiYoshiAwaData.h:44
@ cItemType_ForceKinoko
Always mushroom.
Definition ChibiYoshiAwaData.h:45
ItemType mItemType
The type of powerup item which has a chance to spawn in the bubble when caught.
Definition ChibiYoshiAwaData.h:147
virtual void awaCatchMove(Actor *awa)
Called as the bubble is swallowing the actor.
ChibiYoshiAwaData(ActorUniqueID owner_id)
Constructs the ChibiYoshiAwaData and parents it to an owner by ID.