1#include "Game/MapObj/CoinHolder.hpp"
2#include "Game/MapObj/Coin.hpp"
4CoinHolder::CoinHolder(
const char *pName) :
DeriveActorGroup<
Coin>(pName, 0x200), mHostInfoArr(nullptr), mHostInfoCount(0) {
8bool CoinHolder::hopCoin(
const NameObj *pObj,
const TVec3f &a2,
const TVec3f &a3) {
11 if (hostInfo->_8 >= hostInfo->_4) {
15 Coin* coin = getDeadMember();
18 coin->setHostInfo(hostInfo);
19 coin->appearHop(a2, a3);
26bool CoinHolder::appearCoinFix(
const NameObj *pObj,
const TVec3f &a2, s32 a3) {
27 TVec3f stack_8(0.0f, 0.0f, 0.0f);
28 return appearCoin(pObj, a2, stack_8, a3, -1, -1, a3 == 1 ? 0.0f : 4.0f);
31bool CoinHolder::appearCoinPop(
const NameObj *pObj,
const TVec3f &a2, s32 a3) {
33 MR::calcGravityVector(
this, a2, &stack_20,
nullptr,
nullptr);
34 TVec3f stack_8 = -stack_20 % 25.0f;
35 return appearCoin(pObj, a2, stack_8, a3, -1, -1, a3 == 1 ? 0.0f : 4.0f);
38bool CoinHolder::appearCoinToVelocity(
const NameObj *pObj,
const TVec3f &a2,
const TVec3f &a3, s32 a4) {
39 return appearCoin(pObj, a2, a3, a4, -1, -1, a4 == 1 ? 0.0f : 4.0f);
51 hostInfo = &mHostInfoArr[mHostInfoCount];
52 hostInfo->mHostActor = pObj;
60s32 CoinHolder::getDeclareRemnantCoinCount(
const NameObj *pObj)
const {
63 if (MR::isGalaxyDarkCometAppearInCurrentStage()) {
67 return hostInfo->_4 - hostInfo->_8;
71 for (s32 i = 0; i < mHostInfoCount; i++) {
72 if (mHostInfoArr[i].mHostActor == pObj) {
73 return &mHostInfoArr[i];
81 for (
int i = 0; i < 0x20; i++) {
virtual void init(const JMapInfoIter &)
Intializes the NameObj and can set various settings and construct necessary classes.
The most basic form of an object.
void initWithoutIter()
Initializes a NameObj without a JMapInfoIter instance.