mirror of
https://github.com/MonsterDruide1/OdysseyDecomp
synced 2026-04-23 09:04:21 +00:00
Enemy: Implement WanwanHole (#987)
This commit is contained in:
parent
fd0293b9c5
commit
65d670dc85
|
|
@ -44474,40 +44474,40 @@ Enemy/WanwanHole.o:
|
|||
- offset: 0x1ac7d4
|
||||
size: 120
|
||||
label: _ZN10WanwanHoleC2EPKc
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x1ac84c
|
||||
size: 132
|
||||
label: _ZN10WanwanHoleC1EPKc
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x1ac8d0
|
||||
size: 116
|
||||
label: _ZN10WanwanHole4initERKN2al13ActorInitInfoE
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x1ac944
|
||||
size: 112
|
||||
label: _ZN10WanwanHole12attackSensorEPN2al9HitSensorES2_
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x1ac9b4
|
||||
size: 8
|
||||
label: _ZN10WanwanHole10receiveMsgEPKN2al9SensorMsgEPNS0_9HitSensorES5_
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x1ac9bc
|
||||
size: 52
|
||||
label: _ZN10WanwanHole7exeWaitEv
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x1ac9f0
|
||||
size: 96
|
||||
label: _ZN10WanwanHole5exeInEv
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x1aca50
|
||||
size: 56
|
||||
label: _ZNK12_GLOBAL__N_117WanwanHoleNrvWait7executeEPN2al11NerveKeeperE
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
guess: true
|
||||
- offset: 0x1aca88
|
||||
size: 100
|
||||
label: _ZNK12_GLOBAL__N_115WanwanHoleNrvIn7executeEPN2al11NerveKeeperE
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
guess: true
|
||||
Enemy/WanwanStateHack.o:
|
||||
'.text':
|
||||
|
|
|
|||
56
src/Enemy/WanwanHole.cpp
Normal file
56
src/Enemy/WanwanHole.cpp
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
#include "Enemy/WanwanHole.h"
|
||||
|
||||
#include "Library/LiveActor/ActorClippingFunction.h"
|
||||
#include "Library/LiveActor/ActorInitUtil.h"
|
||||
#include "Library/LiveActor/ActorSensorUtil.h"
|
||||
#include "Library/Nerve/NerveSetupUtil.h"
|
||||
#include "Library/Nerve/NerveUtil.h"
|
||||
#include "Library/Placement/PlacementFunction.h"
|
||||
#include "Library/Stage/StageSwitchUtil.h"
|
||||
|
||||
#include "Util/SensorMsgFunction.h"
|
||||
|
||||
namespace {
|
||||
NERVE_IMPL(WanwanHole, Wait);
|
||||
NERVE_IMPL(WanwanHole, In);
|
||||
NERVES_MAKE_NOSTRUCT(WanwanHole, Wait, In);
|
||||
} // namespace
|
||||
|
||||
WanwanHole::WanwanHole(const char* name) : al::LiveActor(name) {}
|
||||
|
||||
void WanwanHole::init(const al::ActorInitInfo& initInfo) {
|
||||
al::initActor(this, initInfo);
|
||||
al::initNerve(this, &Wait, 0);
|
||||
f32 addHoleRadius = 0.0f;
|
||||
al::tryGetArg(&addHoleRadius, initInfo, "AddHoleRadius");
|
||||
al::setSensorRadius(this, addHoleRadius);
|
||||
makeActorAlive();
|
||||
}
|
||||
|
||||
void WanwanHole::attackSensor(al::HitSensor* self, al::HitSensor* other) {
|
||||
if (al::isNerve(this, &Wait)) {
|
||||
if (rs::sendMsgWanwanHoleIn(other, self)) {
|
||||
al::invalidateClipping(this);
|
||||
al::setNerve(this, &In);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool WanwanHole::receiveMsg(const al::SensorMsg* message, al::HitSensor* other,
|
||||
al::HitSensor* self) {
|
||||
if (rs::isMsgPlayerDisregardHomingAttack(message))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
void WanwanHole::exeWait() {
|
||||
if (al::isFirstStep(this))
|
||||
al::validateClipping(this);
|
||||
}
|
||||
|
||||
void WanwanHole::exeIn() {
|
||||
if (al::isGreaterEqualStep(this, 60))
|
||||
al::tryOnStageSwitch(this, "SwitchWanwanInOn");
|
||||
if (al::isGreaterEqualStep(this, 100))
|
||||
al::setNerve(this, &Wait);
|
||||
}
|
||||
16
src/Enemy/WanwanHole.h
Normal file
16
src/Enemy/WanwanHole.h
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
#pragma once
|
||||
|
||||
#include "Library/LiveActor/LiveActor.h"
|
||||
|
||||
class WanwanHole : public al::LiveActor {
|
||||
public:
|
||||
WanwanHole(const char* name);
|
||||
void init(const al::ActorInitInfo& initInfo) override;
|
||||
void attackSensor(al::HitSensor* self, al::HitSensor* other) override;
|
||||
bool receiveMsg(const al::SensorMsg* message, al::HitSensor* other,
|
||||
al::HitSensor* self) override;
|
||||
void exeWait();
|
||||
void exeIn();
|
||||
};
|
||||
|
||||
static_assert(sizeof(WanwanHole) == 0x108);
|
||||
Loading…
Reference in a new issue