mirror of
https://github.com/MonsterDruide1/OdysseyDecomp
synced 2026-04-23 09:04:21 +00:00
ModeBalloon: Implement TimeBalloonCircle
This commit is contained in:
parent
b6f947c559
commit
642de29d03
|
|
@ -94766,69 +94766,69 @@ ModeBalloon/TimeBalloonCircle.o:
|
|||
- offset: 0x35f8d4
|
||||
size: 156
|
||||
label: _ZN17TimeBalloonCircleC2Ev
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x35f970
|
||||
size: 160
|
||||
label: _ZN17TimeBalloonCircleC1Ev
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x35fa10
|
||||
size: 172
|
||||
label: _ZN17TimeBalloonCircle4initERKN2al13ActorInitInfoE
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x35fabc
|
||||
size: 44
|
||||
label: _ZN17TimeBalloonCircle6appearEv
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x35fae8
|
||||
size: 64
|
||||
label: _ZN17TimeBalloonCircle12attackSensorEPN2al9HitSensorES2_
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x35fb28
|
||||
size: 72
|
||||
label: _ZN17TimeBalloonCircle10receiveMsgEPKN2al9SensorMsgEPNS0_9HitSensorES5_
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x35fb70
|
||||
size: 68
|
||||
label: _ZN17TimeBalloonCircle8setTransERKN4sead7Vector3IfEE
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x35fbb4
|
||||
size: 68
|
||||
label: _ZN17TimeBalloonCircle12startStandbyEv
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x35fbf8
|
||||
size: 68
|
||||
label: _ZN17TimeBalloonCircle9startPlayEv
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x35fc3c
|
||||
size: 4
|
||||
label: _ZN17TimeBalloonCircle9hideModelEv
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x35fc40
|
||||
size: 60
|
||||
label: _ZN17TimeBalloonCircle7exeWaitEv
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x35fc7c
|
||||
size: 60
|
||||
label: _ZN17TimeBalloonCircle6exeOutEv
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x35fcb8
|
||||
size: 60
|
||||
label: _ZN17TimeBalloonCircle5exeInEv
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x35fcf4
|
||||
size: 64
|
||||
label: _ZNK12_GLOBAL__N_124TimeBalloonCircleNrvWait7executeEPN2al11NerveKeeperE
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
guess: true
|
||||
- offset: 0x35fd34
|
||||
size: 64
|
||||
label: _ZNK12_GLOBAL__N_122TimeBalloonCircleNrvIn7executeEPN2al11NerveKeeperE
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
guess: true
|
||||
- offset: 0x35fd74
|
||||
size: 64
|
||||
label: _ZNK12_GLOBAL__N_123TimeBalloonCircleNrvOut7executeEPN2al11NerveKeeperE
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
guess: true
|
||||
ModeBalloon/TimeBalloonData.o:
|
||||
'.text':
|
||||
|
|
|
|||
89
src/ModeBalloon/TimeBalloonCircle.cpp
Normal file
89
src/ModeBalloon/TimeBalloonCircle.cpp
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
#include "ModeBalloon/TimeBalloonCircle.h"
|
||||
|
||||
#include "Library/Joint/JointControllerKeeper.h"
|
||||
#include "Library/LiveActor/ActorActionFunction.h"
|
||||
#include "Library/LiveActor/ActorInitUtil.h"
|
||||
#include "Library/LiveActor/ActorModelFunction.h"
|
||||
#include "Library/LiveActor/ActorMovementFunction.h"
|
||||
#include "Library/LiveActor/ActorSensorUtil.h"
|
||||
#include "Library/Nerve/NerveSetupUtil.h"
|
||||
#include "Library/Nerve/NerveUtil.h"
|
||||
|
||||
#include "Npc/DecalJointCtrl.h"
|
||||
#include "Util/SensorMsgFunction.h"
|
||||
|
||||
namespace {
|
||||
NERVE_IMPL(TimeBalloonCircle, Wait)
|
||||
NERVE_IMPL(TimeBalloonCircle, In)
|
||||
NERVE_IMPL(TimeBalloonCircle, Out)
|
||||
|
||||
NERVES_MAKE_NOSTRUCT(TimeBalloonCircle, Wait, In, Out)
|
||||
} // namespace
|
||||
|
||||
TimeBalloonCircle::TimeBalloonCircle() : al::LiveActor("TimeBalloonCircle") {}
|
||||
|
||||
void TimeBalloonCircle::init(const al::ActorInitInfo& info) {
|
||||
al::initActorWithArchiveName(this, info, "TimeBalloonCircle", nullptr);
|
||||
al::initNerve(this, &Wait, 0);
|
||||
al::invalidateHitSensors(this);
|
||||
al::initJointControllerKeeper(this, 25);
|
||||
mDecalJointCtrl = new DecalJointCtrl(this, 25);
|
||||
makeActorDead();
|
||||
}
|
||||
|
||||
void TimeBalloonCircle::appear() {
|
||||
al::LiveActor::appear();
|
||||
al::setNerve(this, &Wait);
|
||||
}
|
||||
|
||||
void TimeBalloonCircle::attackSensor(al::HitSensor* self, al::HitSensor* other) {
|
||||
if (!al::sendMsgPush(other, self))
|
||||
rs::sendMsgPushToPlayer(other, self);
|
||||
}
|
||||
|
||||
bool TimeBalloonCircle::receiveMsg(const al::SensorMsg* message, al::HitSensor* other,
|
||||
al::HitSensor* self) {
|
||||
if (rs::isMsgPlayerDisregardHomingAttack(message) ||
|
||||
rs::isMsgPlayerDisregardTargetMarker(message))
|
||||
return true;
|
||||
return al::isMsgPlayerDisregard(message);
|
||||
}
|
||||
|
||||
void TimeBalloonCircle::setTrans(const sead::Vector3f& trans) {
|
||||
mTrans = trans;
|
||||
al::resetPosition(this, mTrans);
|
||||
mDecalJointCtrl->calc();
|
||||
}
|
||||
|
||||
void TimeBalloonCircle::startStandby() {
|
||||
al::invalidateHitSensors(this);
|
||||
al::showModelIfHide(this);
|
||||
al::startAction(this, "In");
|
||||
al::setNerve(this, &In);
|
||||
}
|
||||
|
||||
void TimeBalloonCircle::startPlay() {
|
||||
al::validateHitSensors(this);
|
||||
al::showModelIfHide(this);
|
||||
al::startAction(this, "Out");
|
||||
al::setNerve(this, &Out);
|
||||
}
|
||||
|
||||
void TimeBalloonCircle::hideModel() {
|
||||
al::hideModelIfShow(this);
|
||||
}
|
||||
|
||||
void TimeBalloonCircle::exeWait() {
|
||||
if (al::isFirstStep(this))
|
||||
al::startAction(this, "Wait");
|
||||
}
|
||||
|
||||
void TimeBalloonCircle::exeOut() {
|
||||
if (al::isActionEnd(this))
|
||||
al::setNerve(this, &Wait);
|
||||
}
|
||||
|
||||
void TimeBalloonCircle::exeIn() {
|
||||
if (al::isActionEnd(this))
|
||||
al::setNerve(this, &Wait);
|
||||
}
|
||||
39
src/ModeBalloon/TimeBalloonCircle.h
Normal file
39
src/ModeBalloon/TimeBalloonCircle.h
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
#pragma once
|
||||
|
||||
#include <math/seadVector.h>
|
||||
|
||||
#include "Library/LiveActor/LiveActor.h"
|
||||
|
||||
class DecalJointCtrl;
|
||||
|
||||
namespace al {
|
||||
struct ActorInitInfo;
|
||||
class HitSensor;
|
||||
class SensorMsg;
|
||||
} // namespace al
|
||||
|
||||
class TimeBalloonCircle : public al::LiveActor {
|
||||
public:
|
||||
TimeBalloonCircle();
|
||||
|
||||
void init(const al::ActorInitInfo& info) override;
|
||||
void appear() override;
|
||||
void attackSensor(al::HitSensor* self, al::HitSensor* other) override;
|
||||
bool receiveMsg(const al::SensorMsg* message, al::HitSensor* other,
|
||||
al::HitSensor* self) override;
|
||||
|
||||
void setTrans(const sead::Vector3f& trans);
|
||||
void startStandby();
|
||||
void startPlay();
|
||||
void hideModel();
|
||||
|
||||
void exeWait();
|
||||
void exeOut();
|
||||
void exeIn();
|
||||
|
||||
private:
|
||||
sead::Vector3f mTrans = sead::Vector3f::zero;
|
||||
DecalJointCtrl* mDecalJointCtrl = nullptr;
|
||||
};
|
||||
|
||||
static_assert(sizeof(TimeBalloonCircle) == 0x120);
|
||||
18
src/Npc/DecalJointCtrl.h
Normal file
18
src/Npc/DecalJointCtrl.h
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#pragma once
|
||||
|
||||
#include <basis/seadTypes.h>
|
||||
|
||||
namespace al {
|
||||
class LiveActor;
|
||||
} // namespace al
|
||||
|
||||
class DecalJointCtrl {
|
||||
public:
|
||||
DecalJointCtrl(al::LiveActor* actor, s32 count);
|
||||
void calc();
|
||||
|
||||
private:
|
||||
u8 _0[0x28];
|
||||
};
|
||||
|
||||
static_assert(sizeof(DecalJointCtrl) == 0x28);
|
||||
Loading…
Reference in a new issue