mirror of
https://github.com/zeldaret/ss
synced 2026-06-02 02:00:06 -04:00
Merge pull request #260 from swekka/d_a_obj_windmill
d_a_obj_windmill almost OK
This commit is contained in:
@@ -8,17 +8,17 @@ __dt__27sFState_c<14dAcOwindmill_c>Fv = .text:0x00000220; // type:function size:
|
||||
__dt__30sFStateFct_c<14dAcOwindmill_c>Fv = .text:0x00000280; // type:function size:0x6C
|
||||
__dt__83sStateMgr_c<14dAcOwindmill_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x000002F0; // type:function size:0xA0
|
||||
__dt__53sFStateMgr_c<14dAcOwindmill_c,20sStateMethodUsr_FI_c>Fv = .text:0x00000390; // type:function size:0xA4
|
||||
fn_374_440 = .text:0x00000440; // type:function size:0x40
|
||||
AcOwindmill__initModels = .text:0x00000480; // type:function size:0x174
|
||||
AcOwindmill__init = .text:0x00000600; // type:function size:0x2E8
|
||||
__dt__Q34nw4r3g3d15IScnObjCallbackFv = .text:0x00000440; // type:function size:0x40
|
||||
createHeap__14dAcOwindmill_cFv = .text:0x00000480; // type:function size:0x174
|
||||
create__14dAcOwindmill_cFv = .text:0x00000600; // type:function size:0x2E8
|
||||
changeState__83sStateMgr_c<14dAcOwindmill_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>FRC12sStateIDIf_c = .text:0x000008F0; // type:function size:0x10
|
||||
fn_374_900 = .text:0x00000900; // type:function size:0x8
|
||||
AcOwindmill__update = .text:0x00000910; // type:function size:0xD0
|
||||
doDelete__14dAcOwindmill_cFv = .text:0x00000900; // type:function size:0x8
|
||||
actorExecute__14dAcOwindmill_cFv = .text:0x00000910; // type:function size:0xD0
|
||||
executeState__83sStateMgr_c<14dAcOwindmill_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x000009E0; // type:function size:0x10
|
||||
AcOwindmill__draw = .text:0x000009F0; // type:function size:0x28
|
||||
draw__14dAcOwindmill_cFv = .text:0x000009F0; // type:function size:0x28
|
||||
initializeState_Wait__14dAcOwindmill_cFv = .text:0x00000A20; // type:function size:0xC
|
||||
executeState_Wait__14dAcOwindmill_cFv = .text:0x00000A30; // type:function size:0x174
|
||||
AcOwindmill__decrement = .text:0x00000BB0; // type:function size:0x1C
|
||||
calcTimer<s>__4sLibFPs_s = .text:0x00000BB0; // type:function size:0x1C
|
||||
finalizeState_Wait__14dAcOwindmill_cFv = .text:0x00000BD0; // type:function size:0x4
|
||||
initializeState_CameraMove__14dAcOwindmill_cFv = .text:0x00000BE0; // type:function size:0x28
|
||||
executeState_CameraMove__14dAcOwindmill_cFv = .text:0x00000C10; // type:function size:0x1D8
|
||||
@@ -33,16 +33,16 @@ finalizeState_Collect__14dAcOwindmill_cFv = .text:0x000012F0; // type:function s
|
||||
initializeState_CollectStick__14dAcOwindmill_cFv = .text:0x00001300; // type:function size:0x24
|
||||
executeState_CollectStick__14dAcOwindmill_cFv = .text:0x00001330; // type:function size:0x260
|
||||
finalizeState_CollectStick__14dAcOwindmill_cFv = .text:0x00001590; // type:function size:0x58
|
||||
isWindmillRepaired = .text:0x000015F0; // type:function size:0x48
|
||||
isLightTowerRaised2 = .text:0x00001640; // type:function size:0x48
|
||||
AcOwindmill__attachPinwheel = .text:0x00001690; // type:function size:0x8C
|
||||
isWindmillRepaired__14dAcOwindmill_cFv = .text:0x000015F0; // type:function size:0x48
|
||||
isLightTowerRaised2__14dAcOwindmill_cFv = .text:0x00001640; // type:function size:0x48
|
||||
attachPinwheel__14dAcOwindmill_cFv = .text:0x00001690; // type:function size:0x8C
|
||||
__dt__14dAcOwindmill_cFv = .text:0x00001720; // type:function size:0x100
|
||||
getStateID__83sStateMgr_c<14dAcOwindmill_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x00001820; // type:function size:0x10
|
||||
fn_374_1830 = .text:0x00001830; // type:function size:0x4
|
||||
fn_374_1840 = .text:0x00001840; // type:function size:0x4
|
||||
fn_374_1850 = .text:0x00001850; // type:function size:0x4
|
||||
fn_374_1860 = .text:0x00001860; // type:function size:0x4
|
||||
fn_374_1870 = .text:0x00001870; // type:function size:0x4
|
||||
ExecCallback_DRAW_XLU__Q34nw4r3g3d15IScnObjCallbackFQ44nw4r3g3d6ScnObj6TimingPQ34nw4r3g3d6ScnObjUlPv = .text:0x00001830; // type:function size:0x4
|
||||
ExecCallback_DRAW_OPA__Q34nw4r3g3d15IScnObjCallbackFQ44nw4r3g3d6ScnObj6TimingPQ34nw4r3g3d6ScnObjUlPv = .text:0x00001840; // type:function size:0x4
|
||||
ExecCallback_CALC_MAT__Q34nw4r3g3d15IScnObjCallbackFQ44nw4r3g3d6ScnObj6TimingPQ34nw4r3g3d6ScnObjUlPv = .text:0x00001850; // type:function size:0x4
|
||||
ExecCallback_CALC_WORLD__Q34nw4r3g3d15IScnObjCallbackFQ44nw4r3g3d6ScnObj6TimingPQ34nw4r3g3d6ScnObjUlPv = .text:0x00001860; // type:function size:0x4
|
||||
ExecCallback_CALC_VIEW__Q34nw4r3g3d15IScnObjCallbackFQ44nw4r3g3d6ScnObj6TimingPQ34nw4r3g3d6ScnObjUlPv = .text:0x00001870; // type:function size:0x4
|
||||
build__30sFStateFct_c<14dAcOwindmill_c>FRC12sStateIDIf_c = .text:0x00001880; // type:function size:0x60
|
||||
dispose__30sFStateFct_c<14dAcOwindmill_c>FRP10sStateIf_c = .text:0x000018E0; // type:function size:0xC
|
||||
initialize__27sFState_c<14dAcOwindmill_c>Fv = .text:0x000018F0; // type:function size:0x1C
|
||||
@@ -62,24 +62,24 @@ isSameName__29sFStateID_c<14dAcOwindmill_c>CFPCc = .text:0x00001E90; // type:fun
|
||||
_ctors = .ctors:0x00000000; // type:label scope:global
|
||||
_dtors = .dtors:0x00000000; // type:label scope:global
|
||||
__destroy_global_chain_reference = .dtors:0x00000000; // type:object size:0x4 scope:global
|
||||
lbl_374_rodata_0 = .rodata:0x00000000; // type:object size:0x20 data:float
|
||||
lbl_374_rodata_20 = .rodata:0x00000020; // type:object size:0x4 align:4 data:float
|
||||
lbl_374_rodata_24 = .rodata:0x00000024; // type:object size:0x28 align:4 data:float
|
||||
lbl_374_rodata_4C = .rodata:0x0000004C; // type:object size:0x4 align:4 data:float
|
||||
lbl_374_rodata_50 = .rodata:0x00000050; // type:object size:0xC align:8
|
||||
lbl_374_rodata_0 = .rodata:0x00000000; // type:object size:0x20 scope:local data:float
|
||||
lbl_374_rodata_20 = .rodata:0x00000020; // type:object size:0x4 scope:local align:4 data:float
|
||||
lbl_374_rodata_24 = .rodata:0x00000024; // type:object size:0x28 scope:local align:4 data:float
|
||||
lbl_374_rodata_4C = .rodata:0x0000004C; // type:object size:0x4 scope:local align:4 data:float
|
||||
lbl_374_rodata_50 = .rodata:0x00000050; // type:object size:0xC scope:local align:8
|
||||
g_profile_OBJ_WINDMILL = .data:0x00000000; // type:object size:0x6C data:4byte
|
||||
lbl_374_data_6C = .data:0x0000006C; // type:object size:0x1C data:string
|
||||
rotationIncremenst = .data:0x00000088; // type:object size:0x4 data:4byte
|
||||
lbl_374_data_8C = .data:0x0000008C; // type:object size:0x4 data:4byte
|
||||
lbl_374_data_90 = .data:0x00000090; // type:object size:0x8 data:4byte
|
||||
AcOwindmill__vtable = .data:0x00000098; // type:object size:0x80
|
||||
lbl_374_data_118 = .data:0x00000118; // type:object size:0x30
|
||||
lbl_374_data_148 = .data:0x00000148; // type:object size:0x30
|
||||
lbl_374_data_178 = .data:0x00000178; // type:object size:0x18
|
||||
lbl_374_data_190 = .data:0x00000190; // type:object size:0x198
|
||||
lbl_374_data_328 = .data:0x00000328; // type:object size:0x34
|
||||
lbl_374_data_6C = .data:0x0000006C; // type:object size:0x1C scope:local data:string
|
||||
rotationIncremenst = .data:0x00000088; // type:object size:0x4 scope:local data:4byte
|
||||
lbl_374_data_8C = .data:0x0000008C; // type:object size:0x4 scope:local data:4byte
|
||||
lbl_374_data_90 = .data:0x00000090; // type:object size:0x8 scope:local data:4byte
|
||||
__vt__14dAcOwindmill_c = .data:0x00000098; // type:object size:0x80
|
||||
__vt__53sFStateMgr_c<14dAcOwindmill_c,20sStateMethodUsr_FI_c> = .data:0x00000118; // type:object size:0x30
|
||||
__vt__83sStateMgr_c<14dAcOwindmill_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c> = .data:0x00000148; // type:object size:0x30
|
||||
lbl_374_data_178 = .data:0x00000178; // type:object size:0x18 scope:local
|
||||
lbl_374_data_190 = .data:0x00000190; // type:object size:0x198 scope:local
|
||||
__vt__29sFStateID_c<14dAcOwindmill_c> = .data:0x00000328; // type:object size:0x34
|
||||
__global_destructor_chain = .bss:0x00000000; // type:object size:0x4 scope:global
|
||||
lbl_374_bss_8 = .bss:0x00000008; // type:object size:0x10 data:4byte
|
||||
lbl_374_bss_8 = .bss:0x00000008; // type:object size:0x10 scope:local data:4byte
|
||||
AcOwindmill__STATE_WAIT = .bss:0x00000018; // type:object size:0x40 data:4byte
|
||||
AcOwindmill__STATE_CAMERA_MOVE = .bss:0x00000058; // type:object size:0x40 data:4byte
|
||||
AcOwindmill__STATE_MOVE = .bss:0x00000098; // type:object size:0x80 data:4byte
|
||||
|
||||
@@ -2571,7 +2571,7 @@ vt_0x1A4__17daPlayerActBase_cFv = .text:0x8005CA40; // type:function size:0x8
|
||||
vt_0x1A0__17daPlayerActBase_cFv = .text:0x8005CA50; // type:function size:0x8
|
||||
getVec3F_Z__17daPlayerActBase_cCFv = .text:0x8005CA60; // type:function size:0xC
|
||||
isOffeset0x435eEqual0x20__17daPlayerActBase_cFv = .text:0x8005CA70; // type:function size:0x8
|
||||
setWindMillPos__17daPlayerActBase_cFv = .text:0x8005CA80; // type:function size:0x4
|
||||
setWindMillPos__17daPlayerActBase_cCFP7mVec3_c = .text:0x8005CA80; // type:function size:0x4
|
||||
getBellowsPosOrOtherVec3F__17daPlayerActBase_cCFv = .text:0x8005CA90; // type:function size:0x8
|
||||
getPointedAngle__17daPlayerActBase_cCFv = .text:0x8005CAA0; // type:function size:0x8
|
||||
isGustBellowsBeingBlown__17daPlayerActBase_cFv = .text:0x8005CAB0; // type:function size:0x8
|
||||
|
||||
@@ -35,11 +35,13 @@ private:
|
||||
/* 0x6B0 */ STATE_MGR_DECLARE(dAcOpinwheel_c);
|
||||
/* 0x6EC */ s16 mStateTimer;
|
||||
/* 0x6EE */ s16 mRotationSpeed;
|
||||
/* 0x6F0 */ bool mBeingBlown;
|
||||
|
||||
static dCcD_SrcSph sSphSrc;
|
||||
|
||||
static const u32 unused;
|
||||
|
||||
public:
|
||||
/* 0x6F0 */ bool mBeingBlown;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,15 +1,31 @@
|
||||
#ifndef D_A_OBJ_WINDMILL_H
|
||||
#define D_A_OBJ_WINDMILL_H
|
||||
|
||||
#include "d/a/d_a_base.h"
|
||||
#include "d/a/obj/d_a_obj_base.h"
|
||||
#include "d/a/obj/d_a_obj_pinwheel.h"
|
||||
#include "d/col/bg/d_bg_w.h"
|
||||
#include "m/m3d/m_anmchr.h"
|
||||
#include "m/m3d/m_anmmatclr.h"
|
||||
#include "m/m3d/m_smdl.h"
|
||||
#include "m/m_angle.h"
|
||||
#include "m/m_vec.h"
|
||||
#include "nw4r/g3d/res/g3d_resfile.h"
|
||||
#include "s/s_State.hpp"
|
||||
#include "s/s_StateMgr.hpp"
|
||||
#include "toBeSorted/stage_render_stuff.h"
|
||||
|
||||
class dAcOwindmill_c : public dAcObjBase_c {
|
||||
public:
|
||||
dAcOwindmill_c() : mStateMgr(*this, sStateID::null) {}
|
||||
dAcOwindmill_c() : mStateMgr(*this, sStateID::null), mCallback(this) {}
|
||||
virtual ~dAcOwindmill_c() {}
|
||||
|
||||
virtual bool createHeap() override;
|
||||
virtual int create() override;
|
||||
virtual int doDelete() override;
|
||||
virtual int actorExecute() override;
|
||||
virtual int draw() override;
|
||||
|
||||
STATE_FUNC_DECLARE(dAcOwindmill_c, Wait);
|
||||
STATE_FUNC_DECLARE(dAcOwindmill_c, CameraMove);
|
||||
STATE_FUNC_DECLARE(dAcOwindmill_c, Move);
|
||||
@@ -17,7 +33,44 @@ public:
|
||||
STATE_FUNC_DECLARE(dAcOwindmill_c, CollectStick);
|
||||
|
||||
private:
|
||||
/* 0x??? */ STATE_MGR_DECLARE(dAcOwindmill_c);
|
||||
bool isWindmillRepaired();
|
||||
bool isLightTowerRaised2();
|
||||
void attachPinwheel();
|
||||
|
||||
/* 0x330 */ nw4r::g3d::ResFile mResFile;
|
||||
/* 0x334 */ m3d::smdl_c mMdl;
|
||||
/* 0x330 */ m3d::anmChr_c mAnmChr;
|
||||
/* 0x350 */ m3d::anmMatClr_c mAnmClr;
|
||||
/* 0x388 */ dBgW mBgW;
|
||||
/* 0x5C4 */ STATE_MGR_DECLARE(dAcOwindmill_c);
|
||||
/* 0x600 */ dScnCallback_c mCallback;
|
||||
/* 0x60C */ dAcRef_c<dAcOpinwheel_c> mPinwheel;
|
||||
/* 0x618 */ mVec3_c mWindmillPosition;
|
||||
/* 0x624 */ mAng mWindmillRotation;
|
||||
/* 0x626 */ s16 mTimer1;
|
||||
/* 0x628 */ s16 mTimer2;
|
||||
/* 0x62A */ s16 mTimer3;
|
||||
/* 0x62C */ u8 mSceneFlagInPlace;
|
||||
/* 0x62D */ u8 mSceneFlagBeingBlown;
|
||||
/* 0x62E */ u8 mCurrentStuckPos;
|
||||
/* 0x62F */ u8 mSetRotation;
|
||||
/* 0x630 */ f32 field_0x630;
|
||||
/* 0x634 */ f32 field_0x634;
|
||||
/* 0x638 */ bool mHasPropellor;
|
||||
/* 0x639 */ bool mHasPinwheel;
|
||||
/* 0x63A */ bool field_0x63A;
|
||||
|
||||
static const s16 sStateTimer1_0x50;
|
||||
static const f32 sTargetHalf;
|
||||
static const f32 sTargetOne;
|
||||
static const s16 sStateTimer1_0xC;
|
||||
static const s16 sStateTimer1_0x32;
|
||||
static const s16 sStateTimer2_0xF;
|
||||
static const s16 s0xF_unused;
|
||||
|
||||
static s32 sRotationIncrement1;
|
||||
static s32 sRotationIncrement2;
|
||||
static s32 sRotationIncrement3;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define D_A_PLAYER_ACT_H
|
||||
|
||||
#include "d/d_player_base.h"
|
||||
#include "m/m_vec.h"
|
||||
|
||||
class dAcEnBase_c;
|
||||
class dAcOFairy_c;
|
||||
@@ -201,7 +202,7 @@ public:
|
||||
/* vt 0x17C */ virtual const mVec3_c &getBellowsPosOrOtherVec3F() const {
|
||||
return mPosition;
|
||||
}
|
||||
/* vt 0x180 */ virtual void setWindMillPos() {}
|
||||
/* vt 0x180 */ virtual void setWindMillPos(mVec3_c *position) const {}
|
||||
/* vt 0x184 */ virtual bool isOffeset0x435eEqual0x20() {
|
||||
return 0;
|
||||
}
|
||||
@@ -412,7 +413,7 @@ public:
|
||||
/* vt 0x2A8 */ virtual void lookTowardItem() {}
|
||||
/* vt 0x2AC */ virtual void vt_0x2AC() {}
|
||||
/* vt 0x2B0 */ virtual void vt_0x2B0() {}
|
||||
/* vt 0x2B4 */ virtual void triggerMoveEventMaybe(u32, u32, u32, mVec3_c &, const mAng&, u32, u32) {}
|
||||
/* vt 0x2B4 */ virtual void triggerMoveEventMaybe(u32, u32, u32, mVec3_c &, const mAng &, u32, u32) {}
|
||||
/* vt 0x2B8 */ virtual void setActorRef9() {}
|
||||
/* vt 0x2BC */ virtual void unlinkActorRef9() {}
|
||||
/* vt 0x2C0 */ virtual bool vt_0x2C0() {
|
||||
|
||||
@@ -1,5 +1,26 @@
|
||||
#include "d/a/obj/d_a_obj_windmill.h"
|
||||
|
||||
#include "d/a/d_a_player.h"
|
||||
#include "d/a/obj/d_a_obj_base.h"
|
||||
#include "d/a/obj/d_a_obj_pinwheel.h"
|
||||
#include "d/col/bg/d_bg_s.h"
|
||||
#include "d/d_light_env.h"
|
||||
#include "d/d_rumble.h"
|
||||
#include "d/d_sc_game.h"
|
||||
#include "d/d_stage.h"
|
||||
#include "d/flag/sceneflag_manager.h"
|
||||
#include "d/flag/storyflag_manager.h"
|
||||
#include "d/snd/d_snd_wzsound.h"
|
||||
#include "f/f_base.h"
|
||||
#include "m/m_angle.h"
|
||||
#include "m/m_vec.h"
|
||||
#include "nw4r/g3d/res/g3d_resanmchr.h"
|
||||
#include "nw4r/g3d/res/g3d_resfile.h"
|
||||
#include "nw4r/g3d/res/g3d_resmdl.h"
|
||||
#include "s/s_Math.h"
|
||||
#include "toBeSorted/arc_managers/current_stage_arc_manager.h"
|
||||
#include "toBeSorted/event_manager.h"
|
||||
|
||||
SPECIAL_ACTOR_PROFILE(OBJ_WINDMILL, dAcOwindmill_c, fProfile::OBJ_WINDMILL, 0x1DC, 0, 6);
|
||||
|
||||
STATE_DEFINE(dAcOwindmill_c, Wait);
|
||||
@@ -8,18 +29,313 @@ STATE_DEFINE(dAcOwindmill_c, Move);
|
||||
STATE_DEFINE(dAcOwindmill_c, Collect);
|
||||
STATE_DEFINE(dAcOwindmill_c, CollectStick);
|
||||
|
||||
void dAcOwindmill_c::initializeState_Wait() {}
|
||||
void dAcOwindmill_c::executeState_Wait() {}
|
||||
const s16 dAcOwindmill_c::sStateTimer1_0x50 = 0x50;
|
||||
const f32 dAcOwindmill_c::sTargetHalf = 0.5f;
|
||||
const f32 dAcOwindmill_c::sTargetOne = 1.f;
|
||||
const s16 dAcOwindmill_c::sStateTimer1_0xC = 0xC;
|
||||
const s16 dAcOwindmill_c::sStateTimer1_0x32 = 0x32;
|
||||
const s16 dAcOwindmill_c::sStateTimer2_0xF = 0xF;
|
||||
const s16 dAcOwindmill_c::s0xF_unused = 0xF;
|
||||
|
||||
bool dAcOwindmill_c::createHeap() {
|
||||
mHasPropellor = getFromParams(0x14, 1);
|
||||
void *data = CurrentStageArcManager::GetInstance()->getData("g3d/stage.brres");
|
||||
mResFile = nw4r::g3d::ResFile(data);
|
||||
dStage_c::bindStageResToFile(&mResFile);
|
||||
dStage_c::bindSkyCmnToResFile(&mResFile);
|
||||
|
||||
nw4r::g3d::ResMdl mdl = mResFile.GetResMdl("StageF000Windmill");
|
||||
TRY_CREATE(mMdl.create(mdl, &mAllocator, 0x120));
|
||||
|
||||
nw4r::g3d::ResAnmChr resAnmChr = mResFile.GetResAnmChr("StageF000Windmill");
|
||||
TRY_CREATE(mAnmChr.create(mdl, resAnmChr, &mAllocator, nullptr));
|
||||
|
||||
nw4r::g3d::ResAnmClr resAnmClr = mResFile.GetResAnmClr("StageF000Windmill");
|
||||
TRY_CREATE(mAnmClr.create(mdl, resAnmClr, &mAllocator, nullptr, 1));
|
||||
|
||||
void *dzb = CurrentStageArcManager::GetInstance()->getData("dzb/StageF000Windmill.dzb");
|
||||
void *plc = CurrentStageArcManager::GetInstance()->getData("dat/StageF000Windmill.plc");
|
||||
updateMatrix();
|
||||
return !mBgW.Set((cBgD_t *)dzb, (PLC *)plc, cBgW::MOVE_BG_e, &mWorldMtx, &mScale);
|
||||
}
|
||||
|
||||
int dAcOwindmill_c::create() {
|
||||
CREATE_ALLOCATOR(dAcOwindmill_c);
|
||||
mBgW.SetCrrFunc(dBgS_MoveBGProc_Typical);
|
||||
dBgS::GetInstance()->Regist(&mBgW, this);
|
||||
mSetRotation = getFromParams(0, 0xF);
|
||||
mSceneFlagInPlace = getFromParams(4, 0xFF);
|
||||
mSceneFlagBeingBlown = getFromParams(0xC, 0xFF);
|
||||
mWindmillRotation = mRotation.y.mVal;
|
||||
mWindmillPosition = mPosition;
|
||||
|
||||
mWindmillPosition.x += -95.22334f * (mRotation.y + mAng(0xc17)).sin();
|
||||
mWindmillPosition.z += -95.22334f * (mRotation.y + mAng(0xc17)).cos();
|
||||
mWindmillPosition.y += -86.11143f;
|
||||
|
||||
if (mHasPropellor || isWindmillRepaired()) {
|
||||
attachPinwheel();
|
||||
}
|
||||
mCallback.attach(mMdl);
|
||||
mMdl.setAnm(mAnmChr);
|
||||
mMdl.setAnm(mAnmClr);
|
||||
mAnmClr.setFrame(0.f, 0);
|
||||
field_0x634 = mAnmClr.getFrameMax(0) - 1.f;
|
||||
if (isLightTowerRaised2() || SceneflagManager::sInstance->checkBoolFlag(mRoomID, mSceneFlagInPlace)) {
|
||||
s8 delta = mSetRotation - mCurrentStuckPos;
|
||||
if (delta < 0) {
|
||||
delta += 0xC;
|
||||
}
|
||||
mRotation.y += 0x1555 * delta;
|
||||
mCurrentStuckPos = mSetRotation;
|
||||
mStateMgr.changeState(StateID_CollectStick);
|
||||
mTimer1 = 0;
|
||||
mTimer2 = 0;
|
||||
mAnmClr.setFrame(field_0x634, 0);
|
||||
} else {
|
||||
mStateMgr.changeState(StateID_Wait);
|
||||
}
|
||||
mMdl.setPriorityDraw(0x1C, 9);
|
||||
mBoundingBox.Set(mVec3_c(-440.f, -10.f, -160.f), mVec3_c(440.f, 910.f, 250.f));
|
||||
mCullingDistance = 500000.f;
|
||||
return SUCCEEDED;
|
||||
}
|
||||
|
||||
s32 dAcOwindmill_c::sRotationIncrement1 = 0x44;
|
||||
s32 dAcOwindmill_c::sRotationIncrement2 = 0x44;
|
||||
s32 dAcOwindmill_c::sRotationIncrement3 = -0x73e9;
|
||||
|
||||
int dAcOwindmill_c::doDelete() {
|
||||
return SUCCEEDED;
|
||||
}
|
||||
|
||||
int dAcOwindmill_c::actorExecute() {
|
||||
mStateMgr.executeState();
|
||||
updateMatrix();
|
||||
mMdl.setLocalMtx(mWorldMtx);
|
||||
mBgW.Move();
|
||||
mAnmChr.play();
|
||||
if (dScGame_c::currentSpawnInfo.isNight() &&
|
||||
SceneflagManager::sInstance->checkBoolFlag(mRoomID, mSceneFlagBeingBlown)) {
|
||||
dLightEnv_c::GetInstance().set_override_spf(0xb, 0xb, 0.f);
|
||||
}
|
||||
return SUCCEEDED;
|
||||
}
|
||||
|
||||
int dAcOwindmill_c::draw() {
|
||||
drawModelType1(&mMdl);
|
||||
return SUCCEEDED;
|
||||
}
|
||||
|
||||
void dAcOwindmill_c::initializeState_Wait() {
|
||||
mTimer1 = sStateTimer1_0x32;
|
||||
}
|
||||
void dAcOwindmill_c::executeState_Wait() {
|
||||
if (mAnmClr.getFrame(0) != 0.f) {
|
||||
mAnmClr.play();
|
||||
}
|
||||
if (!mHasPinwheel && isWindmillRepaired()) {
|
||||
attachPinwheel();
|
||||
}
|
||||
sLib::addCalc(&field_0x630, sTargetHalf, 0.5f, 0.1f, 0.f);
|
||||
mAnmChr.setRate(field_0x630);
|
||||
|
||||
if (mPinwheel.get() != NULL && mPinwheel.get()->mBeingBlown) {
|
||||
mStateMgr.changeState(StateID_CameraMove);
|
||||
} else {
|
||||
const dAcPy_c *link = dAcPy_c::GetLink();
|
||||
if (sLib::calcTimer(&mTimer1) == 0 || !link->checkActionFlagsCont(0x100)) {
|
||||
mTimer1 = 0;
|
||||
SceneflagManager::sInstance->unsetFlag(mRoomID, mSceneFlagBeingBlown);
|
||||
}
|
||||
if (SceneflagManager::sInstance->checkBoolFlag(mRoomID, mSceneFlagBeingBlown)) {
|
||||
link->setWindMillPos(&mWindmillPosition);
|
||||
}
|
||||
}
|
||||
}
|
||||
void dAcOwindmill_c::finalizeState_Wait() {}
|
||||
void dAcOwindmill_c::initializeState_CameraMove() {}
|
||||
void dAcOwindmill_c::executeState_CameraMove() {}
|
||||
|
||||
void dAcOwindmill_c::initializeState_CameraMove() {
|
||||
mTimer1 = sStateTimer1_0xC;
|
||||
dAcPy_c::GetLink()->setWindMillPos(&mWindmillPosition);
|
||||
}
|
||||
|
||||
void dAcOwindmill_c::executeState_CameraMove() {
|
||||
if (mPinwheel.get() != NULL && mPinwheel.get()->mBeingBlown) {
|
||||
SceneflagManager::sInstance->setFlag(mRoomID, mSceneFlagBeingBlown);
|
||||
}
|
||||
sLib::addCalc(&field_0x630, sTargetHalf, 0.5f, 0.1f, 0.f);
|
||||
mAnmChr.setRate(field_0x630);
|
||||
const dAcPy_c *link = dAcPy_c::GetLink();
|
||||
if (!link->checkActionFlagsCont(0x100)) {
|
||||
SceneflagManager::sInstance->unsetFlag(mRoomID, mSceneFlagBeingBlown);
|
||||
const sStateIDIf_c *oldState = mStateMgr.getOldStateID();
|
||||
mStateMgr.changeState(*oldState);
|
||||
} else {
|
||||
if (SceneflagManager::sInstance->checkBoolFlag(mRoomID, mSceneFlagBeingBlown)) {
|
||||
link->setWindMillPos(&mWindmillPosition);
|
||||
}
|
||||
if (sLib::calcTimer(&mTimer1) == 0) {
|
||||
if (mPinwheel.get() != NULL && mPinwheel.get()->mBeingBlown) {
|
||||
*mStateMgr.getOldStateID() == StateID_CollectStick;
|
||||
mStateMgr.changeState(StateID_Move);
|
||||
} else {
|
||||
const sStateIDIf_c *oldState = mStateMgr.getOldStateID();
|
||||
mStateMgr.changeState(*oldState);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void dAcOwindmill_c::finalizeState_CameraMove() {}
|
||||
void dAcOwindmill_c::initializeState_Move() {}
|
||||
void dAcOwindmill_c::executeState_Move() {}
|
||||
void dAcOwindmill_c::finalizeState_Move() {}
|
||||
|
||||
void dAcOwindmill_c::initializeState_Move() {
|
||||
mTimer1 = sStateTimer1_0x50;
|
||||
}
|
||||
|
||||
void dAcOwindmill_c::executeState_Move() {
|
||||
holdSound(SE_Windmil_ROLL_LV);
|
||||
if (field_0x63A) {
|
||||
if (field_0x634 != mAnmClr.getFrame(0)) {
|
||||
mAnmClr.play();
|
||||
}
|
||||
if (sLib::calcTimer(&mTimer3) == 0) {
|
||||
field_0x63A = false;
|
||||
mAnmClr.setRate(-1.f, 0);
|
||||
}
|
||||
} else {
|
||||
if (mAnmClr.getFrame(0) != 0.f) {
|
||||
mAnmClr.play();
|
||||
}
|
||||
}
|
||||
if (mPinwheel.get() != NULL && mPinwheel.get()->mBeingBlown) {
|
||||
SceneflagManager::sInstance->setFlag(mRoomID, mSceneFlagBeingBlown);
|
||||
}
|
||||
const dAcPy_c *link = dAcPy_c::GetLink();
|
||||
if (!link->checkActionFlagsCont(0x100)) {
|
||||
SceneflagManager::sInstance->unsetFlag(mRoomID, mSceneFlagBeingBlown);
|
||||
}
|
||||
|
||||
if (SceneflagManager::sInstance->checkBoolFlag(mRoomID, mSceneFlagBeingBlown)) {
|
||||
link->setWindMillPos(&mWindmillPosition);
|
||||
}
|
||||
sLib::addCalc(&field_0x630, sTargetOne, 0.5f, 0.1f, 0.f);
|
||||
mAnmChr.setRate(field_0x630);
|
||||
mRotation.y += sRotationIncrement1;
|
||||
if (sLib::calcTimer(&mTimer1) == 0) {
|
||||
mCurrentStuckPos++;
|
||||
if (mCurrentStuckPos == 0xC) {
|
||||
mCurrentStuckPos = 0;
|
||||
}
|
||||
if (mCurrentStuckPos == mSetRotation) {
|
||||
mStateMgr.changeState(StateID_Collect);
|
||||
} else {
|
||||
if (mPinwheel.get() != NULL && mPinwheel.get()->mBeingBlown) {
|
||||
mStateMgr.changeState(StateID_Move);
|
||||
} else {
|
||||
mStateMgr.changeState(StateID_Wait);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void dAcOwindmill_c::finalizeState_Move() {
|
||||
field_0x63A = false;
|
||||
mAnmClr.setRate(-1.f, 0);
|
||||
mRotation.y = mWindmillRotation + (mAng)mAng::fromDeg(mCurrentStuckPos * 0x1e);
|
||||
}
|
||||
|
||||
void dAcOwindmill_c::initializeState_Collect() {}
|
||||
void dAcOwindmill_c::executeState_Collect() {}
|
||||
|
||||
void dAcOwindmill_c::executeState_Collect() {
|
||||
const dAcPy_c *link = dAcPy_c::GetLink();
|
||||
if (SceneflagManager::sInstance->checkBoolFlag(mRoomID, mSceneFlagBeingBlown)) {
|
||||
link->setWindMillPos(&mWindmillPosition);
|
||||
}
|
||||
if (mPinwheel.get() != NULL && mPinwheel.get()->mBeingBlown) {
|
||||
field_0x63A = true;
|
||||
startSound(SE_Windmil_LIGHT);
|
||||
mTimer3 = 15.f - (field_0x634 + 1.f);
|
||||
mAnmClr.setRate(1.f, 0);
|
||||
sLib::addCalc(&field_0x630, sTargetOne, 0.5f, 0.1f, 0.f);
|
||||
mAnmChr.setRate(field_0x630);
|
||||
mRotation.y += sRotationIncrement2;
|
||||
mStateMgr.changeState(StateID_Move);
|
||||
mTimer1--;
|
||||
} else {
|
||||
sLib::addCalc(&field_0x630, sTargetHalf, 0.5f, 0.1f, 0.f);
|
||||
mAnmChr.setRate(field_0x630);
|
||||
startSound(SE_Windmil_CORRECT);
|
||||
dRumble_c::start(dRumble_c::sRumblePreset3, 0x11);
|
||||
mStateMgr.changeState(StateID_CollectStick);
|
||||
}
|
||||
}
|
||||
|
||||
void dAcOwindmill_c::finalizeState_Collect() {}
|
||||
void dAcOwindmill_c::initializeState_CollectStick() {}
|
||||
void dAcOwindmill_c::executeState_CollectStick() {}
|
||||
void dAcOwindmill_c::finalizeState_CollectStick() {}
|
||||
|
||||
void dAcOwindmill_c::initializeState_CollectStick() {
|
||||
mTimer1 = sStateTimer1_0x32;
|
||||
mTimer2 = sStateTimer2_0xF;
|
||||
mAnmClr.setRate(1.f, 0);
|
||||
}
|
||||
|
||||
void dAcOwindmill_c::executeState_CollectStick() {
|
||||
if (!EventManager::sInstance->isInEvent()) {
|
||||
SceneflagManager::sInstance->setFlag(mRoomID, mSceneFlagInPlace);
|
||||
}
|
||||
const dAcPy_c *link = dAcPy_c::GetLink();
|
||||
if (SceneflagManager::sInstance->checkBoolFlag(mRoomID, mSceneFlagBeingBlown)) {
|
||||
link->setWindMillPos(&mWindmillPosition);
|
||||
}
|
||||
if (mPinwheel.get() != NULL && mPinwheel.get()->mBeingBlown) {
|
||||
sLib::addCalc(&field_0x630, sTargetOne, 0.5f, 0.1f, 0.f);
|
||||
mAnmChr.setRate(field_0x630);
|
||||
if (mTimer2 != 0) {
|
||||
field_0x63A = true;
|
||||
startSound(SE_Windmil_LIGHT);
|
||||
mTimer3 = 15.f - (field_0x634 + 1.f);
|
||||
mStateMgr.changeState(StateID_Move);
|
||||
mAnmClr.setRate(1.f, 0);
|
||||
} else {
|
||||
mStateMgr.changeState(StateID_CameraMove);
|
||||
}
|
||||
} else {
|
||||
sLib::addCalc(&field_0x630, sTargetHalf, 0.5f, 0.1f, 0.f);
|
||||
mAnmChr.setRate(field_0x630);
|
||||
if (mTimer2 == 1) {
|
||||
startSound(SE_Windmil_LIGHT);
|
||||
}
|
||||
if (sLib::calcTimer(&mTimer2) == 0) {
|
||||
if (field_0x634 != mAnmClr.getFrame(0)) {
|
||||
mAnmClr.play();
|
||||
}
|
||||
}
|
||||
if (sLib::calcTimer(&mTimer1) == 0 || !link->checkActionFlagsCont(0x100)) {
|
||||
mTimer1 = 0;
|
||||
SceneflagManager::sInstance->unsetFlag(mRoomID, mSceneFlagBeingBlown);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void dAcOwindmill_c::finalizeState_CollectStick() {
|
||||
SceneflagManager::sInstance->unsetFlag(mRoomID, mSceneFlagInPlace);
|
||||
mAnmClr.setRate(-1.f, 0);
|
||||
}
|
||||
|
||||
bool dAcOwindmill_c::isWindmillRepaired() {
|
||||
return StoryflagManager::sInstance->getCounterOrFlag(STORYFLAG_661);
|
||||
}
|
||||
|
||||
bool dAcOwindmill_c::isLightTowerRaised2() {
|
||||
return StoryflagManager::sInstance->getCounterOrFlag(STORYFLAG_662);
|
||||
}
|
||||
|
||||
void dAcOwindmill_c::attachPinwheel() {
|
||||
mAng3_c pinwheelRot = mRotation;
|
||||
pinwheelRot.y += sRotationIncrement3;
|
||||
dAcOpinwheel_c *pinwheel = (dAcOpinwheel_c *)dAcObjBase_c::create(
|
||||
fProfile::OBJ_PINWHEEL, mRoomID, 0, &mWindmillPosition, &pinwheelRot, nullptr, 0xFFFFFFFF
|
||||
);
|
||||
mPinwheel.link(pinwheel);
|
||||
mHasPinwheel = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user