mirror of
https://github.com/MonsterDruide1/OdysseyDecomp
synced 2026-04-23 09:04:21 +00:00
Item: Implement DotCharacterRare and ItemAppearanceController (#914)
This commit is contained in:
parent
5e04000e61
commit
ae76c74af3
|
|
@ -48980,27 +48980,27 @@ Item/DotCharacterRare.o:
|
|||
- offset: 0x1c7478
|
||||
size: 120
|
||||
label: _ZN16DotCharacterRareC2EPKc
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x1c74f0
|
||||
size: 132
|
||||
label: _ZN16DotCharacterRareC1EPKc
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x1c7574
|
||||
size: 112
|
||||
label: _ZN16DotCharacterRare4initERKN2al13ActorInitInfoE
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x1c75e4
|
||||
size: 84
|
||||
label: _ZN16DotCharacterRare11appearPopUpEv
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x1c7638
|
||||
size: 60
|
||||
label: _ZN16DotCharacterRare8exePopUpEv
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x1c7674
|
||||
size: 64
|
||||
label: _ZNK12_GLOBAL__N_124DotCharacterRareNrvPopUp7executeEPN2al11NerveKeeperE
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
guess: true
|
||||
Item/ItemAppearanceController.o:
|
||||
'.text':
|
||||
|
|
@ -49009,41 +49009,41 @@ Item/ItemAppearanceController.o:
|
|||
label:
|
||||
- _ZN24ItemAppearanceControllerC1EPN2al9LiveActorEi
|
||||
- _ZN24ItemAppearanceControllerC2EPN2al9LiveActorEi
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x1c7714
|
||||
size: 104
|
||||
label: _ZN24ItemAppearanceController13requestAppearEPKN2al9SensorMsgEPKNS0_9HitSensorE
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x1c777c
|
||||
size: 64
|
||||
label: _ZN24ItemAppearanceController8exeCountEv
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x1c77bc
|
||||
size: 48
|
||||
label: _ZN24ItemAppearanceController9exeAppearEv
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x1c77ec
|
||||
size: 36
|
||||
label: _ZN24ItemAppearanceControllerD0Ev
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
lazy: true
|
||||
- offset: 0x1c7810
|
||||
size: 4
|
||||
label: ''
|
||||
label: '#_ZNK12_GLOBAL__N_115HostTypeNrvWait7executeEPN2al11NerveKeeperE'
|
||||
status: NotDecompiled
|
||||
- offset: 0x1c7814
|
||||
size: 68
|
||||
label: _ZNK12_GLOBAL__N_116HostTypeNrvCount7executeEPN2al11NerveKeeperE
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
guess: true
|
||||
- offset: 0x1c7858
|
||||
size: 48
|
||||
label: ''
|
||||
label: '#_ZNK12_GLOBAL__N_117HostTypeNrvAppear7executeEPN2al11NerveKeeperE'
|
||||
status: NotDecompiled
|
||||
- offset: 0x1c7888
|
||||
size: 4
|
||||
label: _ZNK12_GLOBAL__N_115HostTypeNrvDone7executeEPN2al11NerveKeeperE
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
guess: true
|
||||
Item/LifeMaxUpItem.o:
|
||||
'.text':
|
||||
|
|
|
|||
32
src/Item/DotCharacterRare.cpp
Normal file
32
src/Item/DotCharacterRare.cpp
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
#include "Item/DotCharacterRare.h"
|
||||
|
||||
#include "Library/LiveActor/ActorActionFunction.h"
|
||||
#include "Library/LiveActor/ActorInitUtil.h"
|
||||
#include "Library/Nerve/NerveSetupUtil.h"
|
||||
#include "Library/Nerve/NerveUtil.h"
|
||||
|
||||
namespace {
|
||||
NERVE_IMPL(DotCharacterRare, PopUp)
|
||||
|
||||
NERVES_MAKE_STRUCT(DotCharacterRare, PopUp)
|
||||
} // namespace
|
||||
|
||||
DotCharacterRare::DotCharacterRare(const char* name) : al::LiveActor(name) {}
|
||||
|
||||
void DotCharacterRare::init(const al::ActorInitInfo& info) {
|
||||
al::initActorWithArchiveName(this, info, "DotMarioCatRare", nullptr);
|
||||
al::initNerve(this, &NrvDotCharacterRare.PopUp, 0);
|
||||
makeActorAlive();
|
||||
}
|
||||
|
||||
void DotCharacterRare::appearPopUp() {
|
||||
al::startAction(this, "DotMarioCatRareReactionSmall");
|
||||
al::setNerve(this, &NrvDotCharacterRare.PopUp);
|
||||
appear();
|
||||
al::startHitReaction(this, "飛出し出現");
|
||||
}
|
||||
|
||||
void DotCharacterRare::exePopUp() {
|
||||
if (al::isActionEnd(this))
|
||||
kill();
|
||||
}
|
||||
19
src/Item/DotCharacterRare.h
Normal file
19
src/Item/DotCharacterRare.h
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
#pragma once
|
||||
|
||||
#include "Library/LiveActor/LiveActor.h"
|
||||
|
||||
namespace al {
|
||||
struct ActorInitInfo;
|
||||
} // namespace al
|
||||
|
||||
class DotCharacterRare : public al::LiveActor {
|
||||
public:
|
||||
DotCharacterRare(const char* name);
|
||||
|
||||
void init(const al::ActorInitInfo& info) override;
|
||||
void appearPopUp();
|
||||
|
||||
void exePopUp();
|
||||
};
|
||||
|
||||
static_assert(sizeof(DotCharacterRare) == 0x108);
|
||||
48
src/Item/ItemAppearanceController.cpp
Normal file
48
src/Item/ItemAppearanceController.cpp
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
#include "Item/ItemAppearanceController.h"
|
||||
|
||||
#include "Library/Item/ItemUtil.h"
|
||||
#include "Library/LiveActor/ActorActionFunction.h"
|
||||
#include "Library/LiveActor/ActorInitUtil.h"
|
||||
#include "Library/Nerve/NerveSetupUtil.h"
|
||||
#include "Library/Nerve/NerveUtil.h"
|
||||
|
||||
#include "Util/ItemUtil.h"
|
||||
|
||||
namespace {
|
||||
NERVE_HOST_TYPE_IMPL(ItemAppearanceController, Wait)
|
||||
NERVE_HOST_TYPE_IMPL(ItemAppearanceController, Appear)
|
||||
NERVE_HOST_TYPE_IMPL(ItemAppearanceController, Count)
|
||||
NERVE_HOST_TYPE_IMPL(ItemAppearanceController, Done)
|
||||
|
||||
NERVES_MAKE_STRUCT(HostType, Wait, Count)
|
||||
NERVES_MAKE_NOSTRUCT(HostType, Appear, Done)
|
||||
} // namespace
|
||||
|
||||
ItemAppearanceController::ItemAppearanceController(al::LiveActor* actor, s32 appearTime)
|
||||
: al::NerveExecutor("アイテム出現制御"), mActor(actor), mAppearTime(appearTime) {
|
||||
initNerve(&NrvHostType.Wait, 0);
|
||||
}
|
||||
|
||||
bool ItemAppearanceController::requestAppear(const al::SensorMsg* message,
|
||||
const al::HitSensor* hitSensor) {
|
||||
if (al::isNerve(this, &NrvHostType.Wait)) {
|
||||
rs::setAppearItemFactorAndOffsetByMsg(mActor, message, hitSensor);
|
||||
al::setNerve(this, &NrvHostType.Count);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void ItemAppearanceController::exeWait() {}
|
||||
|
||||
void ItemAppearanceController::exeCount() {
|
||||
if (al::isGreaterEqualStep(this, mAppearTime))
|
||||
al::setNerve(this, &Appear);
|
||||
}
|
||||
|
||||
void ItemAppearanceController::exeAppear() {
|
||||
al::appearItem(mActor);
|
||||
al::setNerve(this, &Done);
|
||||
}
|
||||
|
||||
void ItemAppearanceController::exeDone() {}
|
||||
27
src/Item/ItemAppearanceController.h
Normal file
27
src/Item/ItemAppearanceController.h
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
#pragma once
|
||||
|
||||
#include "Library/Nerve/NerveExecutor.h"
|
||||
|
||||
namespace al {
|
||||
class HitSensor;
|
||||
class LiveActor;
|
||||
class SensorMsg;
|
||||
} // namespace al
|
||||
|
||||
class ItemAppearanceController : public al::NerveExecutor {
|
||||
public:
|
||||
ItemAppearanceController(al::LiveActor* actor, s32 appearTime);
|
||||
|
||||
bool requestAppear(const al::SensorMsg* message, const al::HitSensor* hitSensor);
|
||||
|
||||
void exeWait();
|
||||
void exeCount();
|
||||
void exeAppear();
|
||||
void exeDone();
|
||||
|
||||
private:
|
||||
al::LiveActor* mActor;
|
||||
s32 mAppearTime;
|
||||
};
|
||||
|
||||
static_assert(sizeof(ItemAppearanceController) == 0x20);
|
||||
Loading…
Reference in a new issue