Tubo! (d_a_obj_tubo) (#95)
Some checks are pending
Build / build (SOUE01) (push) Waiting to run

* begin work

* fixup modifications to d_a_base header

* progress

* update from main again (forgor to fetch)

* progress

* Basically done

* clean up some inlines

* some at/tg hit typing and tubo naming

* more naming
This commit is contained in:
Elijah Thomas 2024-11-12 22:30:01 -05:00 committed by GitHub
parent 9525f8e9e5
commit 2ecf6509dd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
43 changed files with 1335 additions and 193 deletions

View File

@ -58,7 +58,7 @@ fn_11_13C0 = .text:0x000013C0; // type:function size:0x90
fn_11_1450 = .text:0x00001450; // type:function size:0x4C
fn_11_14A0 = .text:0x000014A0; // type:function size:0x170
fn_11_1610 = .text:0x00001610; // type:function size:0x1B0
fn_11_17C0 = .text:0x000017C0; // type:function size:0x64
fn_11_17C0__16dAcNpcCeFriend_cFP12dAcObjBase_c = .text:0x000017C0; // type:function size:0x64
fn_11_1830 = .text:0x00001830; // type:function size:0x94
fn_11_18D0 = .text:0x000018D0; // type:function size:0x88
fn_11_1960 = .text:0x00001960; // type:function size:0xD0

View File

@ -74,9 +74,9 @@ fn_12_1830 = .text:0x00001830; // type:function size:0x6C
fn_12_18A0 = .text:0x000018A0; // type:function size:0x74
fn_12_1920 = .text:0x00001920; // type:function size:0xF8
fn_12_1A20 = .text:0x00001A20; // type:function size:0x1FC
fn_12_1C20 = .text:0x00001C20; // type:function size:0x68
fn_12_1C20__14dAcNpcCeLady_cFP12dAcObjBase_c = .text:0x00001C20; // type:function size:0x68
fn_12_1C90 = .text:0x00001C90; // type:function size:0x164
fn_12_1E00 = .text:0x00001E00; // type:function size:0x80
fn_12_1E00__14dAcNpcCeLady_cFP12dAcObjBase_cPb = .text:0x00001E00; // type:function size:0x80
fn_12_1E80 = .text:0x00001E80; // type:function size:0x9C
fn_12_1F20 = .text:0x00001F20; // type:function size:0xF0
fn_12_2010 = .text:0x00002010; // type:function size:0x3C

View File

@ -17,3 +17,6 @@ REL/global_destructor_chain.c:
REL/d/a/obj/d_a_obj_tubo.cpp:
.text start:0x000000F0 end:0x000042D8
.ctors start:0x00000000 end:0x00000004
.rodata start:0x00000000 end:0x000000F0
.data start:0x00000000 end:0x00000324
.bss start:0x00000008 end:0x00000170

View File

@ -4,23 +4,23 @@ _unresolved = .text:0x00000060; // type:function size:0x4 scope:global
__register_global_object = .text:0x00000070; // type:function size:0x1C scope:global
__destroy_global_chain = .text:0x00000090; // type:function size:0x54 scope:global
dAcOtubo_c_classInit__Fv = .text:0x000000F0; // type:function size:0x130
fn_272_220 = .text:0x00000220; // type:function size:0x58
__dt__15dShadowCircle_cFv = .text:0x00000220; // type:function size:0x58
__dt__23sFState_c<10dAcOtubo_c>Fv = .text:0x00000280; // type:function size:0x58
__dt__26sFStateFct_c<10dAcOtubo_c>Fv = .text:0x000002E0; // type:function size:0x6C
__dt__79sStateMgr_c<10dAcOtubo_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x00000350; // type:function size:0xA0
__dt__49sFStateMgr_c<10dAcOtubo_c,20sStateMethodUsr_FI_c>Fv = .text:0x000003F0; // type:function size:0xA4
fn_272_4A0 = .text:0x000004A0; // type:function size:0x5C
AcOTubo__initModels = .text:0x00000500; // type:function size:0x90
fn_272_590 = .text:0x00000590; // type:function size:0x2B0
createHeap__10dAcOtubo_cFv = .text:0x00000500; // type:function size:0x90
actorCreate__10dAcOtubo_cFv = .text:0x00000590; // type:function size:0x2B0
changeState__79sStateMgr_c<10dAcOtubo_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>FRC12sStateIDIf_c = .text:0x00000840; // type:function size:0x10
fn_272_850 = .text:0x00000850; // type:function size:0x124
fn_272_980 = .text:0x00000980; // type:function size:0x8
fn_272_990 = .text:0x00000990; // type:function size:0x344
actorPostCreate__10dAcOtubo_cFv = .text:0x00000850; // type:function size:0x124
doDelete__10dAcOtubo_cFv = .text:0x00000980; // type:function size:0x8
actorExecute__10dAcOtubo_cFv = .text:0x00000990; // type:function size:0x344
executeState__79sStateMgr_c<10dAcOtubo_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x00000CE0; // type:function size:0x10
getStateID__79sStateMgr_c<10dAcOtubo_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x00000CF0; // type:function size:0x10
fn_272_D00 = .text:0x00000D00; // type:function size:0x1C
fn_272_D20 = .text:0x00000D20; // type:function size:0xC8
AcOTubo__draw = .text:0x00000DF0; // type:function size:0xE8
calcTimer<Uc>__4sLibFPUc_Uc = .text:0x00000D00; // type:function size:0x1C
registerInEvent__10dAcOtubo_cFv = .text:0x00000D20; // type:function size:0xC8
draw__10dAcOtubo_cFv = .text:0x00000DF0; // type:function size:0xE8
initializeState_Wait__10dAcOtubo_cFv = .text:0x00000EE0; // type:function size:0x4
executeState_Wait__10dAcOtubo_cFv = .text:0x00000EF0; // type:function size:0x224
finalizeState_Wait__10dAcOtubo_cFv = .text:0x00001120; // type:function size:0x4
@ -35,31 +35,31 @@ executeState_Slope__10dAcOtubo_cFv = .text:0x00001770; // type:function size:0x1
finalizeState_Slope__10dAcOtubo_cFv = .text:0x000018D0; // type:function size:0x4
initializeState_Rebirth__10dAcOtubo_cFv = .text:0x000018E0; // type:function size:0x164
executeState_Rebirth__10dAcOtubo_cFv = .text:0x00001A50; // type:function size:0xDC
fn_272_1B30 = .text:0x00001B30; // type:function size:0x1C
calcTimer<Us>__4sLibFPUs_Us = .text:0x00001B30; // type:function size:0x1C
finalizeState_Rebirth__10dAcOtubo_cFv = .text:0x00001B50; // type:function size:0x3C
fn_272_1B90 = .text:0x00001B90; // type:function size:0x198
fn_272_1D30 = .text:0x00001D30; // type:function size:0x78C
fn_272_24C0 = .text:0x000024C0; // type:function size:0x1B0
fn_272_2670 = .text:0x00002670; // type:function size:0x3A0
fn_272_2A10 = .text:0x00002A10; // type:function size:0x324
fn_272_2D40 = .text:0x00002D40; // type:function size:0x64
fn_272_2DB0 = .text:0x00002DB0; // type:function size:0xAC
fn_272_2E60 = .text:0x00002E60; // type:function size:0x1B8
fn_272_3020 = .text:0x00003020; // type:function size:0x12C
fn_272_3150 = .text:0x00003150; // type:function size:0x98
fn_272_31F0 = .text:0x000031F0; // type:function size:0x160
fn_272_3350 = .text:0x00003350; // type:function size:0x1E8
fn_272_3540 = .text:0x00003540; // type:function size:0x11C
fn_272_3660 = .text:0x00003660; // type:function size:0xCC
fn_272_3730 = .text:0x00003730; // type:function size:0x58
fn_272_3790 = .text:0x00003790; // type:function size:0x40
fn_272_37D0 = .text:0x000037D0; // type:function size:0x90
fn_272_3860 = .text:0x00003860; // type:function size:0x38
fn_272_38A0 = .text:0x000038A0; // type:function size:0x1C
fn_272_38C0 = .text:0x000038C0; // type:function size:0x8
fn_272_38D0 = .text:0x000038D0; // type:function size:0x94
fn_272_3970 = .text:0x00003970; // type:function size:0x108
fn_272_3A80 = .text:0x00003A80; // type:function size:0x58
destroy__10dAcOtubo_cFv = .text:0x00001B90; // type:function size:0x198
calcRoll__10dAcOtubo_cFv = .text:0x00001D30; // type:function size:0x78C
adjustRoll__10dAcOtubo_cFv = .text:0x000024C0; // type:function size:0x1B0
fn_272_2670__10dAcOtubo_cFv = .text:0x00002670; // type:function size:0x3A0
attemptDestroy__10dAcOtubo_cFv = .text:0x00002A10; // type:function size:0x324
attemptDestroyOnWall__10dAcOtubo_cFPUlPCUc = .text:0x00002D40; // type:function size:0x64
getCenter__10dAcOtubo_cCFv = .text:0x00002DB0; // type:function size:0xAC
fn_272_2E60__10dAcOtubo_cFRC7mVec3_c = .text:0x00002E60; // type:function size:0x1B8
fn_272_3020__10dAcOtubo_cFv = .text:0x00003020; // type:function size:0x12C
addPickupTarget__10dAcOtubo_cFv = .text:0x00003150; // type:function size:0x98
adjustAngle__10dAcOtubo_cFv = .text:0x000031F0; // type:function size:0x160
adjustSpeed__10dAcOtubo_cFv = .text:0x00003350; // type:function size:0x1E8
checkSlope__10dAcOtubo_cFv = .text:0x00003540; // type:function size:0x11C
fn_272_3660__10dAcOtubo_cFv = .text:0x00003660; // type:function size:0xCC
checkInvalidGround__10dAcOtubo_cFv = .text:0x00003730; // type:function size:0x58
checkOnLava__10dAcOtubo_cFv = .text:0x00003790; // type:function size:0x40
checkCarryType__10dAcOtubo_cCFv = .text:0x000037D0; // type:function size:0x90
checkSubmerged__10dAcOtubo_cFv = .text:0x00003860; // type:function size:0x38
fn_272_38A0__10dAcOtubo_cFv = .text:0x000038A0; // type:function size:0x1C
fn_272_38C0__10dAcOtubo_cFv = .text:0x000038C0; // type:function size:0x8
checkOnLog_0xE4E__10dAcOtubo_cCFv = .text:0x000038D0; // type:function size:0x94
checkRollHitMaybe__10dAcOtubo_cFv = .text:0x00003970; // type:function size:0x108
playRollSound__10dAcOtubo_cFv = .text:0x00003A80; // type:function size:0x58
__dt__10dAcOtubo_cFv = .text:0x00003AE0; // type:function size:0x150
build__26sFStateFct_c<10dAcOtubo_c>FRC12sStateIDIf_c = .text:0x00003C30; // type:function size:0x60
dispose__26sFStateFct_c<10dAcOtubo_c>FRP10sStateIf_c = .text:0x00003C90; // type:function size:0xC
@ -93,25 +93,25 @@ lbl_272_rodata_E0 = .rodata:0x000000E0; // type:object size:0x10 data:float
lbl_272_data_0 = .data:0x00000000; // type:object size:0x4 data:4byte
lbl_272_data_4 = .data:0x00000004; // type:object size:0x4
g_profile_OBJ_TUBO = .data:0x00000008; // type:object size:0x10
lbl_272_data_18 = .data:0x00000018; // type:object size:0x48
sSphSrc__10dAcOtubo_c = .data:0x00000018; // type:object size:0x2C
lbl_272_data_60 = .data:0x00000060; // type:object size:0x18 data:string
lbl_272_data_78 = .data:0x00000078; // type:object size:0x8
lbl_272_data_80 = .data:0x00000080; // type:object size:0x8 data:string
lbl_272_data_88 = .data:0x00000088; // type:object size:0x80
lbl_272_data_108 = .data:0x00000108; // type:object size:0x30
lbl_272_data_138 = .data:0x00000138; // type:object size:0x30
lbl_272_data_168 = .data:0x00000168; // type:object size:0x18
lbl_272_data_180 = .data:0x00000180; // type:object size:0x18
lbl_272_data_198 = .data:0x00000198; // type:object size:0xC
lbl_272_data_1A4 = .data:0x000001A4; // type:object size:0x14C
lbl_272_data_2F0 = .data:0x000002F0; // type:object size:0x34
__vt__10dAcOtubo_c = .data:0x00000088; // type:object size:0x80
__vt__49sFStateMgr_c<10dAcOtubo_c,20sStateMethodUsr_FI_c> = .data:0x00000108; // type:object size:0x30
__vt__79sStateMgr_c<10dAcOtubo_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c> = .data:0x00000138; // type:object size:0x30
__vt__26sFStateFct_c<10dAcOtubo_c> = .data:0x00000168; // type:object size:0x14
__vt__23sFState_c<10dAcOtubo_c> = .data:0x00000180; // type:object size:0x18
__vt__17EffectsStruct_Ext = .data:0x00000198; // type:object size:0xC
__vt__15dShadowCircle_c = .data:0x000001A4; // type:object size:0xC
__vt__25sFStateID_c<10dAcOtubo_c> = .data:0x000002F0; // type:object size:0x34
__global_destructor_chain = .bss:0x00000000; // type:object size:0x4 scope:global
lbl_272_bss_8 = .bss:0x00000008; // type:object size:0x10 data:4byte
lbl_272_bss_18 = .bss:0x00000018; // type:object size:0x40 data:4byte
lbl_272_bss_58 = .bss:0x00000058; // type:object size:0x40 data:4byte
lbl_272_bss_98 = .bss:0x00000098; // type:object size:0x40 data:4byte
lbl_272_bss_D8 = .bss:0x000000D8; // type:object size:0x40 data:4byte
lbl_272_bss_118 = .bss:0x00000118; // type:object size:0x30 data:4byte
StateID_Wait__10dAcOtubo_c = .bss:0x00000018; // type:object size:0x30 data:4byte
StateID_Grab__10dAcOtubo_c = .bss:0x00000058; // type:object size:0x30 data:4byte
StateID_Put__10dAcOtubo_c = .bss:0x00000098; // type:object size:0x30 data:4byte
StateID_Slope__10dAcOtubo_c = .bss:0x000000D8; // type:object size:0x30 data:4byte
StateID_Rebirth__10dAcOtubo_c = .bss:0x00000118; // type:object size:0x30 data:4byte
lbl_272_bss_148 = .bss:0x00000148; // type:object size:0x8 data:byte
lbl_272_bss_150 = .bss:0x00000150; // type:object size:0x10 data:float
lbl_272_bss_160 = .bss:0x00000160; // type:object size:0x1 data:byte

View File

@ -979,8 +979,8 @@ fn_8002A450 = .text:0x8002A450; // type:function size:0x1C0
fn_8002A610 = .text:0x8002A610; // type:function size:0x678
fn_8002AC90 = .text:0x8002AC90; // type:function size:0x460
fn_8002B0F0 = .text:0x8002B0F0; // type:function size:0x8
fn_8002B100 = .text:0x8002B100; // type:function size:0x14
fn_8002B120 = .text:0x8002B120; // type:function size:0x1F4
init__17EffectsStruct_ExtFP7dBase_cfff = .text:0x8002B100; // type:function size:0x14
fn_8002B120__17EffectsStruct_ExtFff = .text:0x8002B120; // type:function size:0x1F4
fn_8002B320 = .text:0x8002B320; // type:function size:0x4
fn_8002B330 = .text:0x8002B330; // type:function size:0x4
fn_8002B340 = .text:0x8002B340; // type:function size:0x4
@ -1077,7 +1077,7 @@ FUN_8002d630__9dAcBase_cFv = .text:0x8002D630; // type:function size:0x9C
FUN_8002d6d0__9dAcBase_cFv = .text:0x8002D6D0; // type:function size:0x40
playSoundEffect1__9dAcBase_cFUs = .text:0x8002D710; // type:function size:0x28
FUN_8002d740__9dAcBase_cFv = .text:0x8002D740; // type:function size:0x28
FUN_8002d770__9dAcBase_cFv = .text:0x8002D770; // type:function size:0x28
FUN_8002d770__9dAcBase_cFUsf = .text:0x8002D770; // type:function size:0x28
FUN_8002d7a0__9dAcBase_cFv = .text:0x8002D7A0; // type:function size:0x28
FUN_8002d7d0__9dAcBase_cFv = .text:0x8002D7D0; // type:function size:0x20
FUN_8002d7f0__9dAcBase_cFv = .text:0x8002D7F0; // type:function size:0x20
@ -1092,7 +1092,7 @@ changeLoadedEntitiesWithSet__9dAcBase_cFv = .text:0x8002D940; // type:function s
changeLoadedEntitiesNoSet__9dAcBase_cFv = .text:0x8002D960; // type:function size:0x14
createActor__9dAcBase_cFUsUlP7mVec3_cP7mAng3_cP7mVec3_cUllP7dBase_c = .text:0x8002D980; // type:function size:0xF4
createActorStage__9dAcBase_cFUsUlP7mVec3_cP7mAng3_cP7mVec3_cUllP7dBase_c = .text:0x8002DA80; // type:function size:0xF4
getCurrentEventActor__9dAcBase_cFv = .text:0x8002DB80; // type:function size:0x4
registerInEvent__9dAcBase_cFv = .text:0x8002DB80; // type:function size:0x4
unkVirtFunc_0x6C__9dAcBase_cFv = .text:0x8002DB90; // type:function size:0x4
doInteraction__9dAcBase_cFl = .text:0x8002DBA0; // type:function size:0x80
FUN_8002dc20__9dAcBase_cFPsPs = .text:0x8002DC20; // type:function size:0x28
@ -1122,14 +1122,14 @@ create__12dAcObjBase_cFQ28fProfile14PROFILE_NAME_eUlUlP7mVec3_cP7mAng3_cP7mVec3_
create__12dAcObjBase_cFPcUlUlP7mVec3_cP7mAng3_cP7mVec3_cUlUsSc = .text:0x8002E6D0; // type:function size:0xA0
ActorObjectBase__findObject = .text:0x8002E770; // type:function size:0x7C
getNextObject__12dAcObjBase_cFP9fLiMgBa_cP12dAcObjBase_c = .text:0x8002E7F0; // type:function size:0x58
isLinkPointer = .text:0x8002E850; // type:function size:0x14
isPlayer__12dAcObjBase_cFv = .text:0x8002E850; // type:function size:0x14
ActorObjectBase__calcVelocity = .text:0x8002E870; // type:function size:0x68
calcVelocity__12dAcObjBase_cFv = .text:0x8002E8E0; // type:function size:0xB8
updateMatrix__12dAcObjBase_cFv = .text:0x8002E9A0; // type:function size:0x58
ActorObjectBase__setDefaultCullDistance = .text:0x8002EA00; // type:function size:0xC
canBeLinkedToWoodTag__12dAcObjBase_cFv = .text:0x8002EA10; // type:function size:0x8
drop__12dAcObjBase_cFv = .text:0x8002EA20; // type:function size:0x8
fn_8002EA30 = .text:0x8002EA30; // type:function size:0x24
fn_8002EA30__12dAcObjBase_cFfffffPv = .text:0x8002EA30; // type:function size:0x24
fn_8002EA60 = .text:0x8002EA60; // type:function size:0xD0
fn_8002EB30 = .text:0x8002EB30; // type:function size:0x5C
ActorObjectBase__putInODesert = .text:0x8002EB90; // type:function size:0xD8
@ -2098,22 +2098,22 @@ createBase__7dBase_cFUsP7dBase_cUlUc = .text:0x80050A00; // type:function size:0
createRoot__7dBase_cFUsUlUc = .text:0x80050A10; // type:function size:0x4
CarriedActorCtor = .text:0x80050A20; // type:function size:0x118
CarriedActorDtor = .text:0x80050B40; // type:function size:0x80
fn_80050BC0 = .text:0x80050BC0; // type:function size:0xB4
set__16ActorCarryStructFUlfffPv = .text:0x80050BC0; // type:function size:0xB4
actorAttachingRelated = .text:0x80050C80; // type:function size:0x13C
fn_80050DC0 = .text:0x80050DC0; // type:function size:0x34
fn_80050E00 = .text:0x80050E00; // type:function size:0x34
fn_80050E40 = .text:0x80050E40; // type:function size:0x60
fn_80050EA0 = .text:0x80050EA0; // type:function size:0xC
fn_80050EA0__16ActorCarryStructFP12dAcObjBase_c = .text:0x80050EA0; // type:function size:0xC
fn_80050EB0 = .text:0x80050EB0; // type:function size:0x140
thisFuncDoesBushTp = .text:0x80050FF0; // type:function size:0x19C
bushTpFunc__16ActorCarryStructFR9dBgS_Acch = .text:0x80050FF0; // type:function size:0x19C
fn_80051190 = .text:0x80051190; // type:function size:0x4C
fn_800511E0 = .text:0x800511E0; // type:function size:0x1D8
fn_800511E0__16ActorCarryStructFP12dAcObjBase_c = .text:0x800511E0; // type:function size:0x1D8
isCarriedActor_NotGerock = .text:0x800513C0; // type:function size:0x78
fn_80051440 = .text:0x80051440; // type:function size:0x17C
fn_800515C0 = .text:0x800515C0; // type:function size:0xC
modifyMtx__13dAcObjRef_unkFv = .text:0x800515C0; // type:function size:0xC
fn_800515D0 = .text:0x800515D0; // type:function size:0x60
fn_80051630 = .text:0x80051630; // type:function size:0x144
fn_80051780 = .text:0x80051780; // type:function size:0x464
fn_800051630__13dAcObjRef_unkFv = .text:0x80051630; // type:function size:0x144
fn_80051780__13dAcObjRef_unkFRC8cCcD_Obj = .text:0x80051780; // type:function size:0x464
fn_80051BF0 = .text:0x80051BF0; // type:function size:0x8
fn_80051C00 = .text:0x80051C00; // type:function size:0x4C
InitColliderAndAddToFront = .text:0x80051C50; // type:function size:0x5C
@ -13559,13 +13559,13 @@ addRupees = .text:0x80251E90; // type:function size:0x18
getCurrentWalletCapacity = .text:0x80251EB0; // type:function size:0x8
getCurrentWalletCapacity2 = .text:0x80251EC0; // type:function size:0x4
AcItem__getCurrentArrowCount = .text:0x80251ED0; // type:function size:0x8
getCurrentTotalArrowCount = .text:0x80251EE0; // type:function size:0x38
getTotalArrowCount__9dAcItem_cFv = .text:0x80251EE0; // type:function size:0x38
changeArrowCounter = .text:0x80251F20; // type:function size:0xC
AddOrRemoveArrows = .text:0x80251F30; // type:function size:0x9C
AcItem__getMaxNumberOfArrows = .text:0x80251FD0; // type:function size:0x8
getCurrentTotalArrowCapacity = .text:0x80251FE0; // type:function size:0x38
getBombsCounter = .text:0x80252020; // type:function size:0x8
ActorLink__getTotalNumberOfBombs2 = .text:0x80252030; // type:function size:0x38
getTotalBombCount__9dAcItem_cFv = .text:0x80252030; // type:function size:0x38
changeBombCounter = .text:0x80252070; // type:function size:0xC
changeBombCounterAndPouch = .text:0x80252080; // type:function size:0x9C
getMaxStandardBombCapacity = .text:0x80252120; // type:function size:0x8
@ -13574,7 +13574,7 @@ getCurrentTearCount = .text:0x80252170; // type:function size:0x8
AcItem__incrementTearCount = .text:0x80252180; // type:function size:0xC
getMaxTearCount = .text:0x80252190; // type:function size:0x8
AcItem__getCurrentSlingshotSeedCount = .text:0x802521A0; // type:function size:0x8
getCurrentTotalSlingshotSeeds2 = .text:0x802521B0; // type:function size:0x38
getTotalSeedCount__9dAcItem_cFv = .text:0x802521B0; // type:function size:0x38
AcItem__changeSlingshotSeedCount = .text:0x802521F0; // type:function size:0xC
addDekuSeeds = .text:0x80252200; // type:function size:0x9C
AcItem__getMaxNumberOfSlingshotSeeds = .text:0x802522A0; // type:function size:0x8
@ -17269,7 +17269,7 @@ ModuleConstructorsX = .text:0x802DFCE0; // type:function size:0x44
ModuleDestructorsX = .text:0x802DFD30; // type:function size:0x44
cLib__memSet = .text:0x802DFD80; // type:function size:0x4
cLib__addCalcPos = .text:0x802DFD90; // type:function size:0x234
cLib__addCalcPosXZ = .text:0x802DFFD0; // type:function size:0x1B8
addCalcPosXZ__4cLibFP7mVec3_cRC7mVec3_cfff = .text:0x802DFFD0; // type:function size:0x1B8
cLib__addCalcPos2 = .text:0x802E0190; // type:function size:0x13C
cLib__addCalcPosXZ2 = .text:0x802E02D0; // type:function size:0xF8
cLib__chasePos = .text:0x802E03D0; // type:function size:0x174
@ -18788,7 +18788,7 @@ ChkAtWaterScaleBonk__8cCcD_ObjCFv = .text:0x80328DB0; // type:function size:0xC
ChkAtSwordBonk__8cCcD_ObjCFv = .text:0x80328DC0; // type:function size:0xC
GetAtActor__8cCcD_ObjFv = .text:0x80328DD0; // type:function size:0x4
ChkTgAtHitType__8cCcD_ObjCFUl = .text:0x80328DE0; // type:function size:0x18
GetTg_0x58__8cCcD_ObjCFv = .text:0x80328E00; // type:function size:0x8
GetTgAtHitType__8cCcD_ObjCFv = .text:0x80328E00; // type:function size:0x8
ChkTgBit14__8cCcD_ObjCFv = .text:0x80328E10; // type:function size:0xC
GetTgDamage__8cCcD_ObjCFv = .text:0x80328E20; // type:function size:0x8
GetTgDamageFlags__8cCcD_ObjCFv = .text:0x80328E30; // type:function size:0x8
@ -18805,7 +18805,7 @@ GetTg_0x6A__8cCcD_ObjCFv = .text:0x80328ED0; // type:function size:0x8
ChkTgBit8__8cCcD_ObjCFv = .text:0x80328EE0; // type:function size:0xC
GetTg_0x4A__8cCcD_ObjCFv = .text:0x80328EF0; // type:function size:0x8
GetTgActor__8cCcD_ObjFv = .text:0x80328F00; // type:function size:0x8
GetTg_0x2C__8cCcD_ObjCFv = .text:0x80328F10; // type:function size:0x8
GetTgAtHitDir__8cCcD_ObjCFv = .text:0x80328F10; // type:function size:0x8
GetCoActor__8cCcD_ObjFv = .text:0x80328F20; // type:function size:0x8
ChkCoBit4__8cCcD_ObjCFv = .text:0x80328F30; // type:function size:0xC
SetAtFlagsUpper__8cCcD_ObjFUl = .text:0x80328F40; // type:function size:0x14
@ -19047,7 +19047,7 @@ getCrossYLessD__8cM3dGPlaCFRC7mVec3_cPf = .text:0x80338520; // type:function siz
GetAngle__8cM3dGPlaCF4mAng = .text:0x80338580; // type:function size:0xAC
GetNegativeAngle__8cM3dGPlaCF4mAng = .text:0x80338630; // type:function size:0x48
__ct__8cM3dGSphFv = .text:0x80338680; // type:function size:0xC
SetC__8cM3dGSphFPC7mVec3_c = .text:0x80338690; // type:function size:0x1C
SetC__8cM3dGSphFRC7mVec3_c = .text:0x80338690; // type:function size:0x1C
Set__8cM3dGSphFPC7mVec3_cf = .text:0x803386B0; // type:function size:0x44
SetR__8cM3dGSphFf = .text:0x80338700; // type:function size:0x18
SetC__8cM3dGSphFfff = .text:0x80338720; // type:function size:0x30
@ -19267,7 +19267,7 @@ __ct__18dBgS_ObjGndChk_AllFv = .text:0x80341920; // type:function size:0x58
__ct__18dBgS_CamGndChk_WtrFv = .text:0x80341980; // type:function size:0x58
__dt__18dBgS_CamGndChk_WtrFv = .text:0x803419E0; // type:function size:0x58
ClearInstance__14dBgS_ObjGndChkFv = .text:0x80341A40; // type:function size:0x2C
CheckPos__14dBgS_ObjGndChkFPC7mVec3_c = .text:0x80341A70; // type:function size:0x5C
CheckPos__14dBgS_ObjGndChkFRC7mVec3_c = .text:0x80341A70; // type:function size:0x5C
GetMaterial__14dBgS_ObjGndChkFv = .text:0x80341AD0; // type:function size:0x30
GetPolyAtt1__14dBgS_ObjGndChkFv = .text:0x80341B00; // type:function size:0x30
GetTriPlane__14dBgS_ObjGndChkFP8cM3dGPla = .text:0x80341B30; // type:function size:0x40

View File

@ -7,6 +7,7 @@
namespace cLib {
s32 targetAngleY(const mVec3_c &target, const mVec3_c &source);
f32 addCalcPosXZ(mVec3_c *src, const mVec3_c &target, f32 scale, f32 maxStep, f32 minStep);
} // namespace cLib

View File

@ -2,6 +2,9 @@
#define C_LIB_CMATH
#include "common.h"
#include "egg/math/eggMath.h"
#include <cmath.h>
namespace cM {
s16 atan2s(f32, f32);
@ -24,6 +27,16 @@ inline T minMaxLimit(T val, T min, T max) {
return (T)((T)val < (T)min ? (T)min : ((T)val > (T)max ? (T)max : (T)val));
}
inline bool isZero(f32 val) {
return std::fabsf(val) <= EGG::Math<f32>::epsilon();
}
// When possivle, use the `isZero` func above.
// There are small cases where the result of fabs needs to be used again
inline bool isLessThanZero(f32 val) {
return val <= EGG::Math<f32>::epsilon();
}
} // namespace cM
#endif

View File

@ -87,6 +87,8 @@ public:
/* 0xE8 */ u32 field_0xe8;
/* 0xEC */ s8 roomid;
/* 0xED */ u8 actor_subtype;
/* 0xEE */ u8 field_0xEE;
/* 0xEF */ u8 field_0xEF;
/* 0xF0 */ u32 JStudio_actor;
/* 0xF4 */ char someStr[4];
/* 0xF8 */ char field_0xf8[0xfc - 0xf8];
@ -108,7 +110,7 @@ protected:
/* 0x5C | 8002ce90 */ virtual void unkVirtFunc_0x5C();
/* 0x60 | 8002cea0 */ virtual void unkVirtFunc_0x60();
/* 0x64 | 8002ceb0 */ virtual bool restorePosRotFromCopy();
/* 0x68 | 8002db80 */ virtual void *getCurrentEventActor();
/* 0x68 | 8002db80 */ virtual void registerInEvent();
/* 0x6C | 8002db90 */ virtual void unkVirtFunc_0x6C();
/* 0x70 | 8002dba0 */ virtual void doInteraction(s32);
@ -160,8 +162,14 @@ public:
return roomid;
}
bool ChkProperty_0x40000000() const {
return actor_properties & 0x40000000;
void clearActorProperty(u32 property) {
actor_properties &= ~property;
}
void setActorProperty(u32 property) {
actor_properties |= property;
}
bool checkActorProperty(u32 property) const {
return actor_properties & property;
}
public:
@ -180,7 +188,7 @@ public:
/* 8002cf90 */ void fillUpperParams2Byte();
/* 8002cfa0 */ u32 getParams2_ignoreLower();
/* 8002cfb0 */ void setParams2Upper_ignoreLower(u32 val);
/* 8002cfc0 */ u8 getParams2UpperByte();
/* 8002cfc0 */ int getParams2UpperByte();
/* 8002cfd0 */ void setParams2UpperByte(u32 val);
/* 8002cff0 */ static u32 buildParams2(u32 lower, u32 upper);
/* 8002d010 */ u32 getParams2Lower();
@ -213,7 +221,7 @@ public:
/* 8002d6d0 */ void FUN_8002d6d0();
/* 8002d710 */ void playSoundEffect1(u16 effect);
/* 8002d740 */ void FUN_8002d740();
/* 8002d770 */ void FUN_8002d770();
/* 8002d770 */ void FUN_8002d770(u16, f32);
/* 8002d7a0 */ void FUN_8002d7a0();
/* 8002d7d0 */ void FUN_8002d7d0();
/* 8002d7f0 */ void FUN_8002d7f0();

View File

@ -51,6 +51,10 @@ public:
void getItemFromBWheelItem();
bool isStateWait();
static int getTotalBombCount();
static int getTotalArrowCount();
static int getTotalSeedCount();
private:
/* 0x334 */ UNKTYPE *mpMdl; // Model has its own handling system
/* 0x338 */ dShadowCircle_c mShdw;

View File

@ -2,6 +2,7 @@
#define D_A_NPC_CE_FRIEND_H
#include "d/a/npc/d_a_npc.h"
#include "d/col/c/c_cc_d.h"
#include "s/s_State.hpp"
#include "s/s_StateMgr.hpp"
@ -10,6 +11,8 @@ public:
dAcNpcCeFriend_c() : mStateMgr(*this, sStateID::null) {}
virtual ~dAcNpcCeFriend_c() {}
bool fn_11_17C0(dAcObjBase_c *);
private:
/* 0x??? */ STATE_MGR_DECLARE(dAcNpcCeFriend_c);
};

View File

@ -2,6 +2,7 @@
#define D_A_NPC_CE_LADY_H
#include "d/a/npc/d_a_npc.h"
#include "d/col/c/c_cc_d.h"
#include "s/s_State.hpp"
#include "s/s_StateMgr.hpp"
@ -10,6 +11,9 @@ public:
dAcNpcCeLady_c() : mStateMgr(*this, sStateID::null) {}
virtual ~dAcNpcCeLady_c() {}
bool fn_12_1C20(dAcObjBase_c *);
void fn_12_1E00(dAcObjBase_c *, bool *);
private:
/* 0x??? */ STATE_MGR_DECLARE(dAcNpcCeLady_c);
};

View File

@ -1,6 +1,7 @@
#ifndef D_A_OBJ_BASE_H
#define D_A_OBJ_BASE_H
#include "c/c_math.h"
#include "d/a/d_a_base.h"
#include "d/col/c/c_cc_d.h"
#include "d/col/c/c_m3d_g_aab.h"
@ -12,6 +13,9 @@
#include "m/m_vec.h"
#include "m/types_m.h"
class dAcObjBase_c;
class dBgS_Acch;
// Size: 0xA8
struct ActorCarryStruct {
/* 0x00 */ fLiNdBa_c actorLink;
@ -24,14 +28,29 @@ struct ActorCarryStruct {
/* 0x28 */ mMtx_c carryTransMtx;
/* 0x58 */ mMtx_c field_0x58;
/* 0x88 */ s32 isCarried;
/* 0x8C */ u8 field_0x8C[0x10]; // mQuat_c
/* 0x9C */ void *dtor; // ???
/* 0x8C */ f32 field_0x8C;
/* 0x90 */ f32 field_0x90;
/* 0x94 */ f32 field_0x94;
/* 0x98 */ f32 field_0x98;
/* 0x9C */ void *dtor; // ???
/* 0xA0 */ u32 field_0xA0;
/* 0xA4 */ u32 field_0xA4;
void set(u32 flags, f32 x, f32 y, f32 z, void *unk);
// not real name, but sure
void bushTpFunc(dBgS_Acch &);
void fn_80050EA0(dAcObjBase_c *);
void fn_800511E0(dAcObjBase_c *);
bool testCarryFlag(u32 flag) {
return (carryFlags & flag) != 0;
}
bool checkCarryType(int type) const {
return (isCarried == 1 && carryType == type);
}
};
// Ghidra has it as `unk_ActorObjectBase`
@ -48,7 +67,7 @@ struct LightingInfo {
class dAcObjBase_c : public dAcBase_c {
public:
/* 0x0FC */ f32 yoffset;
/* 0x100 */ char _0[4];
/* 0x100 */ f32 field_0x100;
/* 0x104 */ f32 unkfloat;
/* 0x108 */ char _1[12];
/* 0x114 */ u16 targetFiTextId;
@ -66,11 +85,9 @@ public:
/* 0x1A4 */ f32 mCullingDistance;
/* 0x1A8 */ f32 field_0x1A8;
/* 0x1AC */ u32 mObjectActorFlags;
/* 0x1B0 */ u8 unk_0x1B0[0x1C0 - 0x1B0];
/* 0x1B0 */ f32 mField_0x1B0;
/* 0x1B4 */ mVec3_c mField_0x1B4;
/* 0x1C0 */ cCcD_Stts mStts;
/* 0x1FC */ mVec3_c mStartingPos;
/* 0x208 */ mAng3_c mStartingRot;
/* 0x210 */ ActorCarryStruct mActorCarryInfo;
@ -101,6 +118,20 @@ public:
return fabsf(forwardSpeed) <= speed;
}
bool checkYOffsetField_0x100() const {
return yoffset <= field_0x100;
}
void clearObjectProperty(u32 property) {
mObjectActorFlags &= ~property;
}
void setObjectProperty(u32 property) {
mObjectActorFlags |= property;
}
bool checkObjectProperty(u32 property) const {
return mObjectActorFlags & property;
}
// could be their own thing?
/* 8002de40 */ static void *getOarcFile(const char *oarcName, const char *fileName);
/* 8002de60 */ static void *getOarcSubEntry(const char *oarcName, const char *fileName);
@ -192,4 +223,22 @@ public:
} \
} while (0)
class dAcObjRef_unk {
public:
dAcObjRef_unk(dAcObjBase_c *ref) : mObj(nullptr), refOwner(ref) {}
~dAcObjRef_unk() {
refOwner = nullptr;
}
bool fn_80051780(const cCcD_Obj &);
void fn_800051630();
void modifyMtx();
/* 0x00 */ dAcRef_c<dAcObjBase_c> mObj;
/* 0x0C */ u8 _0C[4];
/* 0x10 */ dAcObjBase_c *refOwner;
/* 0x14 */ u8 _14[0x2C - 0x14];
};
#endif

View File

@ -35,7 +35,7 @@ public:
/* vt 0x44 */ virtual bool createHeap() override;
/* vt 0x54 */ virtual int actorExecute() override;
/* vt 0x5C */ virtual void unkVirtFunc_0x5C() override;
/* vt 0x68 */ virtual void *getCurrentEventActor() override;
/* vt 0x68 */ virtual void registerInEvent() override;
/* vt 0x6C */ virtual void unkVirtFunc_0x6C() override;
STATE_FUNC_DECLARE(dAcBomb_c, Wait);

View File

@ -16,7 +16,14 @@ public:
STATE_FUNC_DECLARE(dAcOlog_c, Fall);
STATE_FUNC_DECLARE(dAcOlog_c, Shake);
u8 getField_0xE4E() const {
return mField_0xE4E;
}
private:
// TODO: Fixup stuff
/* 0x330 */ u8 _330[0xE4E - 0x330];
/* 0xE4E */ u8 mField_0xE4E;
/* 0x??? */ STATE_MGR_DECLARE(dAcOlog_c);
};

View File

@ -1,15 +1,80 @@
#ifndef D_A_OBJ_TUBO_H
#define D_A_OBJ_TUBO_H
#include "common.h"
#include "d/a/d_a_base.h"
#include "d/a/npc/d_a_npc_ce_friend.h"
#include "d/a/npc/d_a_npc_ce_lady.h"
#include "d/a/obj/d_a_obj_base.h"
#include "d/col/bg/d_bg_s_acch.h"
#include "d/col/cc/d_cc_d.h"
#include "d/d_shadow.h"
#include "d/flag/sceneflag_manager.h"
#include "m/m3d/m_smdl.h"
#include "m/m_quat.h"
#include "m/m_vec.h"
#include "nw4r/g3d/g3d_resfile.h"
#include "s/s_State.hpp"
#include "s/s_StateMgr.hpp"
#include "toBeSorted/effects_struct.h"
class dAcOtubo_c : public dAcObjBase_c {
public:
dAcOtubo_c() : mStateMgr(*this, sStateID::null) {}
dAcOtubo_c() : mStateMgr(*this, sStateID::null), mField_0x8F0(this) {}
virtual ~dAcOtubo_c() {}
virtual int doDelete() override;
virtual int draw() override;
virtual bool createHeap() override;
virtual int actorCreate() override;
virtual int actorPostCreate() override;
virtual int actorExecute() override;
virtual void registerInEvent() override;
bool checkCarryType() const;
void destroy();
void calcRoll();
void adjustRoll();
void attemptDestroy();
void fn_272_2670();
mVec3_c getCenter() const;
void attemptDestroyOnWall(u32 *, const u8 *);
void fn_272_2E60(const mVec3_c &);
void fn_272_3020();
void addPickupTarget();
void adjustAngle();
void adjustSpeed();
bool checkSlope();
bool fn_272_3660();
bool checkInvalidGround();
bool checkOnLava();
bool checkSubmerged();
bool fn_272_38A0();
bool fn_272_38C0();
bool checkRollHitMaybe();
void playRollSound();
bool checkOnLog_0xE4E() const;
u8 getSubtype() const {
return params & 0xF; // 0 -> Tubo00, Else -> Tubo01
}
int getParams_0x3000() const {
return params >> 12 & 0x3;
}
u8 getParams_0xC000() const {
return params >> 14 & 0x3;
}
u8 getSceneflag() const {
return params >> 4 & 0xFF;
}
bool checkSceneflag() {
return SceneflagManager::sInstance->checkFlag(roomid, mSceneflag);
}
STATE_FUNC_DECLARE(dAcOtubo_c, Wait);
STATE_FUNC_DECLARE(dAcOtubo_c, Grab);
STATE_FUNC_DECLARE(dAcOtubo_c, Put);
@ -17,7 +82,55 @@ public:
STATE_FUNC_DECLARE(dAcOtubo_c, Rebirth);
private:
/* 0x??? */ STATE_MGR_DECLARE(dAcOtubo_c);
/* 0x330 */ nw4r::g3d::ResFile mRes;
/* 0x334 */ m3d::smdl_c mMdl;
/* 0x350 */ dShadowCircle_c mShdw;
/* 0x358 */ dBgS_AcchCir mAcchCir;
/* 0x3B4 */ dBgS_ObjAcch mObjAcch;
/* 0x764 */ dCcD_Sph mSph;
/* 0x8B4 */ STATE_MGR_DECLARE(dAcOtubo_c);
/* 0x8F0 */ dAcObjRef_unk mField_0x8F0;
/* 0x91C */ EffectsStruct_Ext mEff_0x91C;
/* 0x964 */ dAcRef_c<dAcNpcCeLady_c> mCeLady;
/* 0x970 */ dAcRef_c<dAcNpcCeFriend_c> mCeFriend;
/* 0x97C */ mQuat_c mQuat_0x97C;
/* 0x98C */ mQuat_c mQuat_0x98C;
/* 0x99C */ mQuat_c mQuat_0x99C;
/* 0x9AC */ mVec3_c mField_0x9AC;
/* 0x9B8 */ mVec3_c mField_0x9B8;
/* 0x9C4 */ mAng mField_0x9C4;
/* 0x9C6 */ mAng mField_0x9C6;
/* 0x9C8 */ mAng mField_0x9C8;
/* 0x9CA */ mAng mField_0x9CA;
/* 0x9CC */ mAng mField_0x9CC;
/* 0x9D0 */ f32 mField_0x9D0;
/* 0x9D4 */ f32 mField_0x9D4;
/* 0x9D8 */ f32 mField_0x9D8;
/* 0x9DC */ f32 mField_0x9DC;
/* 0x9E0 */ f32 mField_0x9E0;
/* 0x9E4 */ f32 mField_0x9E4;
/* 0x9E8 */ u16 mTimer_0x9E8;
/* 0x9EA */ bool mbMovingForward;
/* 0x9EB */ bool mbField_0x9EB;
/* 0x9EC */ bool mbField_0x9EC;
/* 0x9ED */ bool mbField_0x9ED;
/* 0x9EE */ bool mbField_0x9EE;
/* 0x9EF */ bool mbField_0x9EF;
/* 0x9F0 */ bool mbField_0x9F0;
/* 0x9F1 */ bool mbField_0x9F1;
/* 0x9F2 */ bool mbSubmerged;
/* 0x9F2 */ bool mbField_0x9F3;
/* 0x9F4 */ u8 mTimer_0x9F4;
/* 0x9F5 */ u8 mTimer_0x9F5;
/* 0x9F6 */ u8 mField_0x9F6;
/* 0x9F7 */ u8 mTimer_0x9F7;
/* 0x9F8 */ u8 mSceneflag;
/* 0x9F9 */ u8 mSubtype;
/* 0x9FC */ int mField_0x9FC;
static u8 sUnk0;
static u32 sUnk1;
static dCcD_SrcSph sSphSrc;
};
#endif

View File

@ -32,7 +32,7 @@ public:
return false;
}
const dAcObjBase_c *pObj = mObj.get();
return !(pObj && pObj->ChkProperty_0x40000000());
return !(pObj && pObj->checkActorProperty(0x40000000));
}
// ??? Template seems bad

View File

@ -1,7 +1,6 @@
#ifndef D_BG_S_ACCH_H
#define D_BG_S_ACCH_H
#include "d/a/obj/d_a_obj_base.h"
#include "d/col/bg/d_bg_s_gnd_chk.h"
#include "d/col/bg/d_bg_s_roof_chk.h"
#include "d/col/bg/d_bg_s_sph_chk.h"
@ -11,6 +10,8 @@
#include "d/col/c/c_m3d_g_lin.h"
#include "d/col/c/c_m3d_g_pla.h"
class dAcObjBase_c;
class dBgS_AcchCir : public cBgS_PolyInfo {
private:
/* 0x2C */ cM3dGCir m_cir;
@ -237,6 +238,9 @@ public:
mVec3_c *GetOldPos() {
return mpOldPos;
}
f32 GetWtrGroundH() const {
return mWtr.mGroundH;
}
f32 GetGroundH() const {
return mGroundHeight;
}
@ -309,6 +313,16 @@ public:
bool Chk_0x10000000() {
return mFlags & ACCH_FLAG_0x10000000;
}
void Clr_0x20000() {
mFlags &= ~ACCH_FLAG_0x20000;
}
void Set_0x20000() {
mFlags |= ACCH_FLAG_0x20000;
}
bool Chk_0x20000() {
return mFlags & ACCH_FLAG_0x20000;
}
void Clr_0x80000000() {
mFlags &= ~ACCH_FLAG_0x80000000;
}
@ -355,9 +369,9 @@ public:
u32 MaskRoofHit() {
return mFlags & ROOF_HIT;
}
bool ChkRoofHit() {
return MaskRoofHit();
}
// bool ChkRoofHit() {
// return MaskRoofHit();
// }
void OffClrSpeedY() {
mFlags |= CLR_SPEED_Y;
}

View File

@ -32,7 +32,7 @@ public:
}
static void ClearInstance();
static bool CheckPos(const mVec3_c *);
static bool CheckPos(const mVec3_c &);
static int GetMaterial();
static int GetPolyAtt1();
static bool GetTriPlane(cM3dGPla *);

View File

@ -327,36 +327,37 @@ struct cCcD_SrcGObjTg {
/* 0x0E */ u16 mField_0x0E;
};
enum cCcD_AtType_e {
enum dCcD_ObjAtType {
/* 0x 0000 0001 */ AT_TYPE_0x1 = (1 << 0),
/* 0x 0000 0002 */ AT_TYPE_0x2 = (1 << 1),
/* 0x 0000 0002 */ AT_TYPE_SWORD = (1 << 1),
/* 0x 0000 0004 */ AT_TYPE_0x4 = (1 << 2),
/* 0x 0000 0008 */ AT_TYPE_0x8 = (1 << 3),
/* 0x 0000 0008 */ AT_TYPE_PHYSICS = (1 << 3),
/* 0x 0000 0010 */ AT_TYPE_0x10 = (1 << 4),
/* 0x 0000 0020 */ AT_TYPE_0x20 = (1 << 5),
/* 0x 0000 0020 */ AT_TYPE_BOMB = (1 << 5),
/* 0x 0000 0040 */ AT_TYPE_0x40 = (1 << 6),
/* 0x 0000 0080 */ AT_TYPE_0x80 = (1 << 7),
/* 0x 0000 0080 */ AT_TYPE_SLINGSHOT = (1 << 7),
/* 0x 0000 0100 */ AT_TYPE_0x100 = (1 << 8),
/* 0x 0000 0200 */ AT_TYPE_0x200 = (1 << 9),
/* 0x 0000 0400 */ AT_TYPE_0x400 = (1 << 10),
/* 0x 0000 0800 */ AT_TYPE_0x800 = (1 << 11),
/* 0x 0000 0200 */ AT_TYPE_WIND = (1 << 9),
/* 0x 0000 0400 */ AT_TYPE_DAMAGE = (1 << 10),
/* 0x 0000 0800 */ AT_TYPE_WHIP = (1 << 11),
/* 0x 0000 1000 */ AT_TYPE_0x1000 = (1 << 12),
/* 0x 0000 2000 */ AT_TYPE_0x2000 = (1 << 13),
/* 0x 0000 4000 */ AT_TYPE_0x4000 = (1 << 14),
/* 0x 0000 2000 */ AT_TYPE_ARROW = (1 << 13),
/* 0x 0000 4000 */ AT_TYPE_CLAWSHOT = (1 << 14),
/* 0x 0000 8000 */ AT_TYPE_0x8000 = (1 << 15),
/* 0x 0001 0000 */ AT_TYPE_0x10000 = (1 << 16),
/* 0x 0001 0000 */ AT_TYPE_BELLOWS = (1 << 16),
/* 0x 0002 0000 */ AT_TYPE_0x20000 = (1 << 17),
/* 0x 0004 0000 */ AT_TYPE_0x40000 = (1 << 18),
/* 0x 0008 0000 */ AT_TYPE_0x80000 = (1 << 19),
/* 0x 0010 0000 */ AT_TYPE_0x100000 = (1 << 20),
/* 0x 0010 0000 */ AT_TYPE_BUBBLE = (1 << 20),
/* 0x 0020 0000 */ AT_TYPE_0x200000 = (1 << 21),
/* 0x 0040 0000 */ AT_TYPE_0x400000 = (1 << 22),
/* 0x 0040 0000 */ AT_TYPE_BEETLE = (1 << 22),
/* 0x 0080 0000 */ AT_TYPE_0x800000 = (1 << 23),
/* 0x 0100 0000 */ AT_TYPE_BUGNET = (1 << 24),
/* 0x 0200 0000 */ AT_TYPE_0x2000000 = (1 << 25),
/* 0x 0400 0000 */ AT_TYPE_0x4000000 = (1 << 26),
/* 0x 0400 0000 */ AT_TYPE_KOLOKTOS_SWORD = (1 << 26),
/* 0x 0800 0000 */ AT_TYPE_0x8000000 = (1 << 27),
};
enum cCcD_AtModifiers_e {
/* 0x 0000 0001 */ AT_MOD_FIRE = (1 << 0),
/* 0x 0000 0002 */ AT_MOD_0x2 = (1 << 1),
@ -630,9 +631,13 @@ public:
mField_0x4B = val;
}
void SetInfo_0x2(u16 val) {
mSrc.mInfo.mField_0x2 = val;
}
public:
/* 0x1C */ cCcD_SrcGObjTg mSrc;
/* 0x2C */ mVec3_c mField_0x2C;
/* 0x2C */ mVec3_c mAtHitDir;
/* 0x38 */ mVec3_c mHitPos;
/* 0x44 */ s16 *mShieldFrontRangeYAngle;
/* 0x48 */ s16 mShieldRange;
@ -737,7 +742,7 @@ public:
dAcObjBase_c *GetAtActor();
bool ChkTgAtHitType(u32) const;
u32 GetTg_0x58() const;
u32 GetTgAtHitType() const;
bool ChkTgBit14() const;
u8 GetTgDamage() const;
u16 GetTgDamageFlags() const;
@ -754,7 +759,7 @@ public:
bool ChkTgBit8() const;
u8 GetTg_0x4A() const;
dAcObjBase_c *GetTgActor();
const mVec3_c &GetTg_0x2C() const;
const mVec3_c &GetTgAtHitDir() const;
dAcObjBase_c *GetCoActor();
bool ChkCoBit4() const;
@ -780,7 +785,7 @@ public:
mCo.OnSPrm(f);
}
void SetTgFlag(u32 flag) {
void SetTgType(u32 flag) {
mTg.SetType(flag);
}
void SetAtFlag(u32 flag) {
@ -860,6 +865,9 @@ public:
// At
void OnAtSet() {
mAt.OnSPrm(1);
}
u32 ChkAtNoMass() const {
return mAt.MskSPrm(0x400);
}
@ -878,6 +886,9 @@ public:
// Tg
void OnTgSet() {
mTg.OnSPrm(1);
}
u32 GetTgGrp() const {
return mTg.MskSPrm(0x3E);
}
@ -894,9 +905,15 @@ public:
void SetTg_0x4B(u8 val) {
mTg.Set_0x4B(val);
}
void SetTgInfo_0x2(u16 val) {
mTg.SetInfo_0x2(val);
}
// Co
void OnCoSet() {
mCo.OnSPrm(1);
}
u32 ChkCoSet2() const {
return mCo.MskSPrm(0x800);
}
@ -906,6 +923,12 @@ public:
u32 ChkCoSameActorHit() const {
return mCo.MskSPrm(0x1000);
}
void ClrCo_0x400() {
mCo.OffSPrm(0x400);
}
void SetCo_0x400() {
mCo.OnSPrm(0x400);
}
/**
* SET HIT

View File

@ -11,15 +11,11 @@ public:
/* 0x10 */ f32 mRatio;
cM3dGSph();
void SetC(const mVec3_c *);
void SetC(const mVec3_c &);
void Set(const mVec3_c *, f32);
void SetR(f32);
void SetC(f32, f32, f32);
void SetC(const mVec3_c &p) {
SetC(&p);
}
f32 GetYDist(f32) const;
bool Cross(const cM3dGTri *, f32 *, mVec3_c *);
void Clamp(const mVec3_c &, mVec3_c &) const;

View File

@ -30,6 +30,12 @@ public:
return FileManager::sInstance->getDungeonFlagsConst() + offset;
}
u16 getCounterOrFlag(u16 idx, u32 count) const {
u16 offset = mStageIndex * 8;
const u16 *space = FileManager::sInstance->getDungeonFlagsConst() + offset;
return mpFlagIndex->getCounterOrFlag(idx, space, count);
}
static DungeonflagManager *sInstance;
};

View File

@ -23,6 +23,10 @@ struct mAng {
return mVal;
}
s16 *ref() {
return &mVal;
}
mAng operator-() {
return mAng(-mVal);
}
@ -50,8 +54,6 @@ struct mAng {
return nw4r::math::CosIdx(*this);
}
s16 mVal;
f32 degree() const {
return (360.0f / 65536.0f) * mVal;
}
@ -59,6 +61,9 @@ struct mAng {
static mAng fromDeg(f32 deg) {
return deg * sDegToAng;
}
f32 degree2() const {
return mVal * sAngToDeg;
}
static s16 angle(const mVec3_c &a, const mVec3_c &b) {
f32 rads = a.angle(b);
@ -99,6 +104,8 @@ struct mAng {
return rad * (65536.0f / (2.f * M_PI));
}
s16 mVal;
private:
static const f32 sHalfCircleDeg;
static const f32 sAngToDeg;

View File

@ -236,6 +236,10 @@ public:
return cM::atan2s(x * x, z * z);
}
f32 inprodXZ(const mVec3_c &other) const {
return x * other.x + z * other.z;
}
static mVec3_c Zero;
static mVec3_c Ex;
static mVec3_c Ey;

View File

@ -23,7 +23,7 @@ public:
void remove(bool);
void fn_80029929(u16 effect, mVec3_c *pos, void *, void *, void *, void *);
void setMtx(const mMtx_c&);
void setMtx(const mMtx_c &);
bool checkField0x00() const {
return field_0x00 != 0;
@ -35,4 +35,30 @@ private:
u8 field_0x2C[0x34 - 0x2C];
};
// Not sure if these belongs here, but it uses EffectsStruct
// Related Functions in the 8002B100 area
class EffectsStruct_Ext {
public:
EffectsStruct_Ext() : mField_0x00(1), mField_0x01(0) {}
void init(dBase_c *, f32, f32, f32);
void setField_0x00(u8 val) {
mField_0x00 = val;
}
void setField_0x01(u8 val) {
mField_0x01 = val;
}
void fn_8002B120(f32, f32);
/* 0x00 */ u8 mField_0x00;
/* 0x01 */ u8 mField_0x01;
/* 0x04 */ f32 mField_0x04;
/* 0x08 */ f32 mField_0x08;
/* 0x0C */ f32 mField_0x0C;
/* 0x10 */ EffectsStruct mEff;
virtual ~EffectsStruct_Ext() {}
};
#endif

View File

@ -2,6 +2,8 @@
#ifndef EVENT_MANAGER_H
#define EVENT_MANAGER_H
#include "common.h"
#include "sized_string.h"
#include "toBeSorted/event.h"
class dAcBase_c;
@ -21,9 +23,20 @@ public:
return isInEvent() && sInstance != nullptr && sInstance->mState != 7;
}
static const char *getCurrentEventName() {
return isInEvent() ? sInstance->mCurrentEvent.eventName : nullptr;
}
static bool isCurrentEvent(const char *name) {
return strequals(getCurrentEventName(), name);
}
private:
u8 field_0x000[0x184 - 0x000];
int mState;
/* 0x000 */ u8 _000[0x084 - 0x000];
/* 0x084 */ Event mCurrentEvent;
/* 0x0C4 */ u8 _0C4[0x184 - 0x0C4];
/* 0x184 */ int mState;
/* 0x18C */ u8 _18C[0x19C - 0x18C];
};
#endif

View File

@ -5,6 +5,24 @@
#include "m/m_angle.h"
#include "m/m_vec.h"
enum SpecialItemDropTable {
SPECIAL_ITEM_0 = 0,
SPECIAL_ITEM_1,
SPECIAL_ITEM_2,
SPECIAL_ITEM_3,
SPECIAL_ITEM_4,
SPECIAL_ITEM_5,
SPECIAL_ITEM_6,
SPECIAL_ITEM_7,
SPECIAL_ITEM_8,
SPECIAL_ITEM_9,
SPECIAL_ITEM_10,
SPECIAL_ITEM_11,
SPECIAL_ITEM_12,
SPECIAL_ITEM_13,
// ...
};
class SpecialItemDropMgr {
public:
static SpecialItemDropMgr *sInstance;

View File

@ -37,6 +37,7 @@ struct TimeAreaStruct {
/* 0x08 */ u8 field_0x08;
bool isNearZero() {
// is cM3d_IsZero
return fabsf(field_0x00) <= FLT_EPSILON;
}

View File

@ -6,8 +6,8 @@ SPECIAL_ACTOR_PROFILE(OBJ_SPIKE, dAcOspike_c, fProfile::OBJ_SPIKE, 0x1D9, 0, 2);
// clang-format off
dCcD_SrcUnk dAcOspike_c::sCcSrc = {
{{0x400, 0x2003F, {0, 0, 0}, 1, 0, 0, 0, 0},
{0xFEB77DFF, 0x111, 0x06, 0x407, 0, },
{{AT_TYPE_DAMAGE, 0x2003F, {0, 0, 0}, 1, 0, 0, 0, 0},
{~(AT_TYPE_BUGNET | AT_TYPE_BEETLE | AT_TYPE_0x80000 | AT_TYPE_0x8000 | AT_TYPE_WIND), 0x111, 0x06, 0x407, 0, },
{0}},
{-1.0f, -246.0f, -472.0f, 73.0f, 255.0f, 482.0f}};
// clang-format on

View File

@ -35,7 +35,7 @@ dCcD_SrcCyl dAcOtoD3StoneFigure_c::sCcSrc = {
0
},
{
0xFEB77DFF,
~(AT_TYPE_BUGNET | AT_TYPE_BEETLE | AT_TYPE_0x80000 | AT_TYPE_0x8000 | AT_TYPE_WIND),
0x1000111,
{
0x06,

View File

@ -9,7 +9,7 @@ SPECIAL_ACTOR_PROFILE(OBJ_TRIFORCE, dAcOtriforce_c, fProfile::OBJ_TRIFORCE, 0x15
// clang-format off
dCcD_SrcSph dAcOtriforce_c::sCcSrc = {
{{0, 0, 0, 0, 0, 0, 0, 0, 0},
{0xFEB77DFF, 0x111, 0x06, 0x407, 0, 0},
{~(AT_TYPE_BUGNET | AT_TYPE_BEETLE | AT_TYPE_0x80000 | AT_TYPE_0x8000 | AT_TYPE_WIND), 0x111, 0x06, 0x407, 0, 0},
{0xE9}},
{150.0f}};
// clang-format on

View File

@ -1,5 +1,47 @@
#include "d/a/obj/d_a_obj_tubo.h"
#include "c/c_lib.h"
#include "c/c_math.h"
#include "common.h"
#include "d/a/d_a_base.h"
#include "d/a/d_a_item.h"
#include "d/a/d_a_player.h"
#include "d/a/npc/d_a_npc_ce_friend.h"
#include "d/a/npc/d_a_npc_ce_lady.h"
#include "d/a/obj/d_a_obj_base.h"
#include "d/a/obj/d_a_obj_log.h"
#include "d/col/bg/d_bg_pc.h"
#include "d/col/bg/d_bg_s.h"
#include "d/col/bg/d_bg_s_gnd_chk.h"
#include "d/col/bg/d_bg_s_lin_chk.h"
#include "d/col/c/c_cc_d.h"
#include "d/col/c/c_m3d_g_pla.h"
#include "d/col/cc/d_cc_s.h"
#include "d/flag/dungeonflag_manager.h"
#include "d/flag/sceneflag_manager.h"
#include "egg/math/eggMath.h"
#include "f/f_manager.h"
#include "f/f_profile_name.h"
#include "m/m_angle.h"
#include "m/m_mtx.h"
#include "m/m_quat.h"
#include "m/m_vec.h"
#include "nw4r/math/math_arithmetic.h"
#include "rvl/MTX/mtxvec.h"
#include "s/s_Math.h"
#include "toBeSorted/attention.h"
#include "toBeSorted/event_manager.h"
#include "toBeSorted/special_item_drop_mgr.h"
void float_ordering() {
f32 f[] = {15.f, .4f, .4f, 5.f};
}
#pragma explicit_zero_data on
u8 dAcOtubo_c::sUnk0 = 1;
u32 dAcOtubo_c::sUnk1 = 0;
#pragma explicit_zero_data off
SPECIAL_ACTOR_PROFILE(OBJ_TUBO, dAcOtubo_c, fProfile::OBJ_TUBO, 0x194, 0, 130);
STATE_DEFINE(dAcOtubo_c, Wait);
@ -8,18 +50,818 @@ STATE_DEFINE(dAcOtubo_c, Put);
STATE_DEFINE(dAcOtubo_c, Slope);
STATE_DEFINE(dAcOtubo_c, Rebirth);
dCcD_SrcSph dAcOtubo_c::sSphSrc = {
/* mObjInf */
{/* mObjAt */ {AT_TYPE_PHYSICS, 0x12, {0, 0, 0}, 2, 0, 0, 0, 0, 0},
/* mObjTg */ {~(AT_TYPE_BUGNET | AT_TYPE_0x80000 | AT_TYPE_0x8000), 0x801111, {0xA, 0x40F}, 8, 0},
/* mObjCo */ {0x1E9}},
/* mSphInf */
{30.f},
};
bool dAcOtubo_c::createHeap() {
mRes = getOarcResFile("Tubo");
const char *subtype = getSubtype() == 0 ? "Tubo00" : "Tubo01";
TRY_CREATE(mMdl.create(mRes.GetResMdl(subtype), &heap_allocator, 0x120, 1, nullptr));
return true;
}
int dAcOtubo_c::actorCreate() {
CREATE_ALLOCATOR(dAcOtubo_c);
mObjAcch.Set(this, 1, &mAcchCir);
mAcchCir.SetWall(20.f, 30.f);
mEff_0x91C.init(this, 60.f, mScale.x, 0.f);
mEff_0x91C.setField_0x01(1);
int unkParam = getParams_0x3000();
if (unkParam != 1 && unkParam != 2) {
fn_8002EA30(-60.f, -20.f, 2.f, 1.f, 4.f, &mObjAcch);
}
mStts.SetRank(5);
mSph.Set(sSphSrc);
mSph.SetStts(mStts);
mSph.ClrAtSet();
forwardAccel = -4.f;
forwardMaxSpeed = -40.f;
mbMovingForward = 0;
mField_0x9D8 = 2.f;
mQuat_0x98C.set(1.f, 0.f, 0.f, 0.f);
mQuat_0x97C.set(1.f, 0.f, 0.f, 0.f);
mQuat_0x99C.set(1.f, 0.f, 0.f, 0.f);
mSceneflag = getSceneflag();
mSubtype = getSubtype();
mbField_0x9ED = getParams_0x3000() == 0;
mbField_0x9EF = getParams_0x3000() == 2;
if (getParams_0x3000() == 1) {
mTimer_0x9F4 = 0xF;
mSph.SetTgInfo_0x2(0);
}
mbField_0x9F0 = getParams_0xC000() == 0;
if (mSceneflag < 0xFF && checkSceneflag()) {
fillUpperParams2Byte();
}
mStateMgr.changeState(StateID_Wait);
boundingBox.Set(mVec3_c(-100.f, -40.f, -100.f), mVec3_c(100.f, 80.f, 100.f));
mActorCarryInfo.set(0xC8A0, 28.f, 50.f, 28.f, nullptr); // TODO (ActorCarry Flags)
mActorCarryInfo.field_0x8C = 26.f;
mActorCarryInfo.field_0x90 = 46.f;
mActorCarryInfo.field_0x94 = 28.f;
mActorCarryInfo.field_0x98 = 0.f;
return SUCCEEDED;
}
int dAcOtubo_c::actorPostCreate() {
mCeLady.link((dAcNpcCeLady_c *)fManager_c::searchBaseByProfName(fProfile::NPC_CE_LADY, nullptr));
if (mbField_0x9EF) {
if (DungeonflagManager::sInstance->getCounterOrFlag(3, 8) != 0) {
return FAILED;
}
actor_properties |= 4; // TODO ( actor_properties )
if (dBgS_ObjGndChk ::CheckPos(position + mVec3_c::Ey * 50.f)) {
position.y = dBgS_ObjGndChk::GetGroundHeight();
}
}
return SUCCEEDED;
}
int dAcOtubo_c::doDelete() {
return SUCCEEDED;
}
int dAcOtubo_c::actorExecute() {
mStateMgr.executeState();
bool bOffGround = false;
if (mTimer_0x9F4 != 0) {
mField_0x9DC = 0.f;
if (dBgS_ObjGndChk::CheckPos(position + mVec3_c::Ey * 500.f)) {
if (dBgS_ObjGndChk::GetGroundHeight() - position.y > 5.f) {
bOffGround = true;
mSph.ClrTgSet();
} else if (sLib::calcTimer(&mTimer_0x9F4) == 0) {
mSph.SetTgInfo_0x2(8);
mSph.OnTgSet();
bOffGround = false;
}
}
}
if (mSph.ChkCoHit()) {
mObjAcch.OnLineCheck();
} else {
mObjAcch.OffLineCheck();
}
if (!bOffGround) {
if (!checkCarryType()) {
calcVelocity();
position += velocity;
position += mStts.GetCcMove();
mField_0x9DC += position.y - mOldPosition.y;
adjustRoll();
}
mActorCarryInfo.bushTpFunc(mObjAcch);
}
if (mStateMgr.isState(StateID_Wait) || mStateMgr.isState(StateID_Slope)) {
attemptDestroy();
}
mSph.SetC(getCenter());
dCcS::GetInstance()->Set(&mSph);
mActorCarryInfo.fn_800511E0(this);
mField_0x8F0.modifyMtx();
calcRoll();
mMdl.setLocalMtx(mWorldMtx);
mMdl.calc(false);
poscopy2 = position + mVec3_c(0.f, 28.f, 0.f);
poscopy3 = poscopy2;
poscopy3.y += 48.f;
mbField_0x9EB = 0;
return SUCCEEDED;
}
extern "C" void fn_800A0550(dAcBase_c *);
void dAcOtubo_c::registerInEvent() {
if (EventManager::isCurrentEvent("HoleIn") || EventManager::isCurrentEvent("HoleOut")) {
fn_800A0550(this);
}
}
int dAcOtubo_c::draw() {
drawModelType1(&mMdl);
static mQuat_c quat(0.f, 30.f, 0.f, 40.f);
if (yoffset >= 0.f) {
drawShadow(mShdw, nullptr, mWorldMtx, &quat, -1, -1, -1, -1, -1, position.y - mObjAcch.GetGroundH());
}
return SUCCEEDED;
}
extern "C" void fn_8002A450(const mVec3_c &, u8, u8, const mVec3_c &, int, f32, f32);
void dAcOtubo_c::initializeState_Wait() {}
void dAcOtubo_c::executeState_Wait() {}
void dAcOtubo_c::executeState_Wait() {
if (mObjAcch.ChkGroundLanding()) {
if (!mbField_0x9EF || !EventManager::isInEvent()) {
if (mField_0x9F6 == 2) {
fn_8002A450(position, field_0xEE, field_0xEF, mField_0x1B4, 0, 1.0f, mField_0x1B0);
}
if (mbField_0x9F3) {
playSound(0xA46);
mbField_0x9F3 = false;
}
if (checkOnLava()) {
if (mField_0x9F6 != 2) {
fn_8002A450(position, field_0xEE, field_0xEF, mField_0x1B4, 0, 1.0f, mField_0x1B0);
}
playSound(0x9A3);
}
}
} else if (mObjAcch.ChkGndHit()) {
mObjAcch.SetRoofNone();
if (mbField_0x9EE) {
mbField_0x9EE = false;
}
addPickupTarget();
if (checkSlope()) {
mStateMgr.changeState(StateID_Slope);
return;
}
adjustSpeed();
if (forwardSpeed < 1.f) {
mbMovingForward = 0;
sLib::chase(&forwardSpeed, 0.f, 0.05f);
mField_0x9D8 = 2.f;
}
if (mSph.ChkAtSet()) {
mSph.ClrAtSet();
}
playRollSound();
if (!mbField_0x9EF) {
if (dBgS::GetInstance()->ChkMoveBG(mObjAcch.GetGnd(), true)) {
clearActorProperty(0x1);
} else {
setActorProperty(0x1);
}
}
mField_0x9DC = 0.f;
}
fn_272_2670();
}
void dAcOtubo_c::finalizeState_Wait() {}
void dAcOtubo_c::initializeState_Grab() {}
void dAcOtubo_c::executeState_Grab() {}
void dAcOtubo_c::finalizeState_Grab() {}
void dAcOtubo_c::initializeState_Grab() {
velocity = mVec3_c::Zero;
angle = mAng3_c::Zero;
mbMovingForward = 0;
mSph.SetCo_0x400();
clearActorProperty(0x1);
if (mbField_0x9ED) {
mTimer_0x9F7 = 5;
mbField_0x9EE = true;
}
mTimer_0x9F5 = 15;
mField_0x9DC = 0.f;
}
void dAcOtubo_c::executeState_Grab() {
if (mbField_0x9ED && sLib::calcTimer(&mTimer_0x9F7) == 0) {
dAcNpcCeLady_c *lady = mCeLady.get();
dAcNpcCeFriend_c *ceFriend = mCeFriend.get();
if (ceFriend && ceFriend->fn_11_17C0(this)) {
mActorCarryInfo.fn_80050EA0(this);
} else if (lady && lady->fn_12_1C20(this)) {
mActorCarryInfo.fn_80050EA0(this);
}
}
if (mActorCarryInfo.checkCarryType(5) && sLib::calcTimer(&mTimer_0x9F5) == 0 &&
(mObjAcch.ChkGndHit() || mObjAcch.ChkWallHit(nullptr) || mObjAcch.ChkRoofHit())) {
destroy();
} else if (dAcPy_c::LINK->getCurrentAction() == 66 /* Put Down Medium */) { // TODO (Link Action ID)
mStateMgr.changeState(StateID_Put);
} else {
if (mActorCarryInfo.isCarried != 4) {
bool isCarried = false;
if (mActorCarryInfo.isCarried == 1 && mActorCarryInfo.carryType == 5) {
isCarried = true;
}
if (isCarried) {
mField_0x9F6 = 0;
} else {
mField_0x9F6 = mActorCarryInfo.isCarried;
}
}
if (!checkCarryType()) {
mStateMgr.changeState(StateID_Wait);
}
}
}
void dAcOtubo_c::finalizeState_Grab() {
mField_0x9DC = 0.f;
if (forwardSpeed > 0.f) {
mbMovingForward = 1;
}
mField_0x9D4 = cM::rndF(40.f);
mSph.ClrCo_0x400();
if ((u8)mActorCarryInfo.isCarried == 2) {
mSph.OnAtSet();
}
mObjAcch.ClrRoofNone();
mObjAcch.mField_0x0D4 = 50.f;
}
void dAcOtubo_c::initializeState_Put() {}
void dAcOtubo_c::executeState_Put() {}
void dAcOtubo_c::finalizeState_Put() {}
void dAcOtubo_c::initializeState_Slope() {}
void dAcOtubo_c::executeState_Slope() {}
void dAcOtubo_c::executeState_Put() {
if (dAcPy_c::LINK->getCurrentAction() == 66 /* Put Down Medium */) { // TODO (Link Action ID)
mQuat_0x98C.slerpTo(mQuat_0x97C, 0.5f, mQuat_0x98C);
mQuat_0x98C.normalise();
}
if (!checkCarryType()) {
mStateMgr.changeState(StateID_Wait);
}
}
void dAcOtubo_c::finalizeState_Put() {
if (dBgS_ObjGndChk::CheckPos(position + mVec3_c::Ey * 10.f)) {
mbField_0x9F3 = nw4r::math::FAbs(position.y - dBgS_ObjGndChk::GetGroundHeight()) < 100.f;
}
if (!(dBgS_ObjGndChk::CheckPos(position + mVec3_c::Ey * 10.f) &&
nw4r::math::FAbs(position.y - dBgS_ObjGndChk::GetGroundHeight()) < 100.f)) {
mSph.OnAtSet();
}
forwardSpeed = 0.f;
}
void dAcOtubo_c::initializeState_Slope() {
cM3dGPla pla;
dBgS::GetInstance()->GetTriPla(mObjAcch.GetGnd(), &pla);
if (cM::isZero(forwardSpeed)) {
angle.y = pla.GetAngleY();
}
mAng plaAng = pla.GetAngleY();
mField_0x9C4 = (plaAng - angle.y);
mAng other = labs((s16)(angle.y - mField_0x9C4));
mField_0x9C6 = nw4r::math::FSqrt(other.degree2() / 180.f) * 910.f;
}
void dAcOtubo_c::executeState_Slope() {
if (mObjAcch.ChkGroundLanding()) {
fn_8002A450(position, field_0xEE, field_0xEF, mField_0x1B4, 0, 1.0f, mField_0x1B0);
} else if (mObjAcch.ChkGndHit()) {
mField_0x9DC = 0.f;
addPickupTarget();
if (checkRollHitMaybe()) {
adjustAngle();
} else {
mbMovingForward = 0;
forwardSpeed = 0.f;
velocity = mVec3_c::Zero;
cM3dGPla pla;
dBgS::GetInstance()->GetTriPla(mObjAcch.GetGnd(), &pla);
angle.y = cM::atan2s(pla.GetN().x, pla.GetN().z);
}
adjustSpeed();
if (mSph.ChkAtSet()) {
mSph.ClrAtSet();
}
playRollSound();
if (!checkSlope()) {
mStateMgr.changeState(StateID_Wait);
return;
}
}
fn_272_2670();
}
void dAcOtubo_c::finalizeState_Slope() {}
void dAcOtubo_c::initializeState_Rebirth() {}
void dAcOtubo_c::executeState_Rebirth() {}
void dAcOtubo_c::finalizeState_Rebirth() {}
void dAcOtubo_c::initializeState_Rebirth() {
SpecialItemDropMgr *mgr = SpecialItemDropMgr::sInstance;
mgr->giveSpecialDropItem(getParams2UpperByte(), roomid, &position, 0, rotation.y, -1);
mField_0x9AC = position;
obj_pos = &mField_0x9AC;
mField_0x9F6 = 0;
rotation = rot_copy;
mQuat_0x98C.set(1.f, 0.f, 0.f, 0.f);
forwardSpeed = 0.f;
velocity.y = 0.f;
mField_0x9DC = 0.f;
mSph.ClrCoSet();
mSph.ClrTgSet();
setObjectProperty(0x200);
mActorCarryInfo.fn_80050EA0(this);
int item_drop_table = getParams2UpperByte();
switch (item_drop_table) {
default: break;
case SPECIAL_ITEM_11: mField_0x9FC = 2; break;
case SPECIAL_ITEM_12: mField_0x9FC = 0; break;
case SPECIAL_ITEM_13: mField_0x9FC = 1; break;
}
mTimer_0x9E8 = 150;
clearActorProperty(0x1);
}
void dAcOtubo_c::executeState_Rebirth() {
setPostion(pos_copy);
mOldPosition = pos_copy;
u8 count = -1;
switch (mField_0x9FC) {
case 2: count = dAcItem_c::getTotalBombCount(); break;
case 0: count = dAcItem_c::getTotalArrowCount(); break;
case 1: count = dAcItem_c::getTotalSeedCount(); break;
}
if (checkObjectProperty(0x2) && count <= 3) {
if (sLib::calcTimer(&mTimer_0x9E8) == 0) {
mStateMgr.changeState(StateID_Wait);
}
} else {
mTimer_0x9E8 = 150;
}
}
void dAcOtubo_c::finalizeState_Rebirth() {
mSph.OnCoSet();
mSph.OnTgSet();
obj_pos = &position;
clearObjectProperty(0x200);
setActorProperty(0x1);
}
extern "C" void fn_80027510(void *, bool);
extern "C" void fn_80027560(void *, bool, int);
extern "C" void *fn_800298B0(u16, mVec3_c *, mVec3_c *, u32, u32, u32, u32, u32);
extern "C" u16 PARTICLE_RESOURCE_ID_MAPPING_109_, PARTICLE_RESOURCE_ID_MAPPING_209_;
extern "C" void *ENVIRONMENT;
extern "C" void fn_80022BE0(void *, const mVec3_c &);
void dAcOtubo_c::destroy() {
dAcNpcCeLady_c *lady = mCeLady.get();
bool boolParam = true;
if (lady) {
lady->fn_12_1E00(this, &boolParam);
}
if (!boolParam) {
return;
}
fn_80022BE0(ENVIRONMENT, position);
mActorCarryInfo.fn_80050EA0(this);
void *fx_thing = fn_800298B0(PARTICLE_RESOURCE_ID_MAPPING_209_, &poscopy2, nullptr, 0, 0, 0, 0, 0);
if (fx_thing) {
fn_80027510(fx_thing, mSubtype != 0);
}
fx_thing = fn_800298B0(PARTICLE_RESOURCE_ID_MAPPING_109_, &position, nullptr, 0, 0, 0, 0, 0);
if (fx_thing) {
fn_80027560(fx_thing, mSubtype != 0, 0);
}
playSound(0xA47); // TODO (Sound ID)
if (mSceneflag < 0xFF && !checkSceneflag()) {
SceneflagManager::sInstance->setFlag(roomid, mSceneflag);
}
if (mbField_0x9F0) {
mStateMgr.changeState(StateID_Rebirth);
} else {
deleteRequest();
}
}
void dAcOtubo_c::calcRoll() {
bool onLog = checkOnLog_0xE4E();
if (mbMovingForward || onLog) {
if (onLog) {
velocity = position - mOldPosition;
forwardSpeed = EGG::Math<f32>::sqrt(velocity.x * velocity.x + velocity.z * velocity.z);
angle.y = cM::atan2s(velocity.x, velocity.z);
}
f32 vel_mag = VEC3Len(velocity);
f32 f1 = mAng(vel_mag * (mField_0x9D4 + 200.f)).radian();
f32 f2 = mAng(vel_mag * 182.0f * 0.2f).radian();
f32 f0 = mAng(angle.y - rotation.y).radian();
mQuat_c q0, q1, q2, q3;
q1.setAxisRotation(mVec3_c::Ey, f0);
q0.setAxisRotation(mVec3_c::Ey, -f0);
q3.setAxisRotation(mVec3_c::Ex, f1);
q2.setAxisRotation(mVec3_c::Ey, f2);
mQuat_0x98C = q1 * q3 * q2 * q0 * mQuat_0x98C;
if (onLog) {
velocity = mVec3_c::Zero;
forwardSpeed = 0.f;
}
}
mMtx_c mtx0, mtx1, mtx2;
mtx0.fromQuat(mQuat_0x99C * mQuat_0x98C);
mtx1.transS(0.f, 28.f, 0.f);
mWorldMtx += mtx1;
mWorldMtx += mtx0;
mtx2.transS(0.f, -28.f, 0.f);
mWorldMtx += mtx2;
}
void dAcOtubo_c::adjustRoll() {
if (!mObjAcch.ChkGndHit()) {
return;
}
if (cM::isZero(forwardSpeed)) {
return;
}
s32 adj = forwardSpeed * 182;
mVec3_c vel = velocity;
vel.y = 0.f;
vel.normalize();
vel.rotY(0x4000);
vel *= mField_0x9D8 * mField_0x9C8.sin();
mAng old_9C8 = mField_0x9C8;
mField_0x9C8 += adj;
if (old_9C8.sin() * mField_0x9C8.sin() < 0.f) {
mField_0x9D8 *= 0.75f;
}
position += vel;
}
void dAcOtubo_c::fn_272_2670() {
if (mbField_0x9EF && EventManager::isInEvent()) {
mField_0x9DC = 0.f;
return;
}
if (mSph.ChkTgHit()) {
if (mSph.ChkTgAtHitType(AT_TYPE_BELLOWS | AT_TYPE_WIND)) {
mField_0x9DC = 0.f;
if (mTimer_0x9F4 == 0) {
if (!mbField_0x9EB) {
mField_0x9D0 = cM::rndFX(0.25f) + 1.f;
}
mbField_0x9EB = true;
fn_272_2E60(mSph.GetTgAtHitDir());
return;
}
}
} else {
if (mbField_0x9F1 && mField_0x8F0.fn_80051780(mSph)) {
velocity += mField_0x9B8;
mbField_0x9F1 = false;
}
static const s16 unk = {0}; // needed for rodata ordering
if (!cM::isZero(mField_0x9CA)) {
angle.y = (*(s16 *)((u8 *)this + 0x9CA)); // HACK to force load again
mField_0x9CA = 0;
} else {
mQuat_c q;
q.set(1.f, 0.f, 0.f, 0.f);
mQuat_0x99C.slerpTo(q, 0.2f, mQuat_0x99C);
}
}
if (mObjAcch.ChkGndHit()) {
if (yoffset >= 0.f && !checkCarryType()) {
mField_0x9DC = 0.f;
} else if (checkInvalidGround()) {
forwardSpeed = 0.0f;
mbMovingForward = 0;
}
}
if (mSph.ChkCoHit()) {
if (fn_272_38C0()) {
fn_272_3020();
}
} else if (cM::isZero(mField_0x9E0)) {
mField_0x9E0 = 0.1f;
}
// the ordering is weird here
f32 groundH = mObjAcch.GetGroundH();
f32 waterH = mObjAcch.GetWtrGroundH();
bool noSound = mbSubmerged;
mEff_0x91C.fn_8002B120(waterH, groundH);
if (checkSubmerged()) {
forwardAccel = -0.8f;
forwardMaxSpeed = -7.f;
mField_0x9DC = 0.f;
cLib::addCalcPosXZ(&velocity, mVec3_c::Zero, 0.05f, 1.0f, 0.2f);
forwardSpeed = EGG::Math<f32>::sqrt(velocity.x * velocity.x + velocity.z * velocity.z);
if (!noSound) {
playSound(0x9A0); // TODO (Sound ID) - Fall Water S
}
mbSubmerged = true;
} else {
forwardAccel = -4.f;
forwardMaxSpeed = -40.f;
mbSubmerged = false;
if (checkCarryType()) {
mStateMgr.changeState(StateID_Grab);
}
}
}
void dAcOtubo_c::attemptDestroy() {
if (mbField_0x9EF && mSph.ChkCoHit() && mSph.GetCoActor()->profile_name == fProfile::B_MG) {
destroy();
return;
}
if (mObjAcch.ChkWallHit(nullptr) && sLib::absDiff(mAcchCir.GetWallAngleY(), angle.y) > mAng::deg2short(70.f)) {
attemptDestroyOnWall(&sUnk1, &sUnk0);
angle.y = mAcchCir.GetWallAngleY();
forwardSpeed *= 0.5f;
return;
}
if (mSph.ChkTgHit() && ((mSph.ChkTgAtHitType(AT_TYPE_BEETLE) && mSph.ChkTgBit14()) ||
!mSph.ChkTgAtHitType(AT_TYPE_BEETLE | AT_TYPE_BELLOWS | AT_TYPE_WHIP | AT_TYPE_WIND))) {
destroy();
return;
}
if (mObjAcch.ChkGndHit() && yoffset >= 0.f && !checkCarryType()) {
if ((mField_0x9DC < -100.f && !mbField_0x9EE) || fn_272_3660()) {
destroy();
return;
}
mField_0x9DC = 0.f;
}
if (!mObjAcch.ChkGndHit() && mSph.ChkCoHit()) {
if (mActorCarryInfo.isCarried != 1 && forwardSpeed > 0.f) {
if (mSph.GetCoActor()->unkByteTargetFiRelated == 4) {
destroy();
return;
}
}
}
if (mSph.ChkCoHit()) {
dAcObjBase_c *obj = mSph.GetCoActor();
if (obj->isPlayer() &&
static_cast<dAcPy_c *>(obj)->getCurrentAction() == 0xC /* ROLL */) { // TODO (Player Action ID)
destroy();
}
}
if (mObjAcch.ChkRoofHit()) {
destroy();
} else if (!mbField_0x9EF && checkYOffsetField_0x100() && getParams_0x3000() != 1) {
FUN_8002dcd0();
} else if (fn_272_38A0()) {
destroy();
}
}
void dAcOtubo_c::attemptDestroyOnWall(u32 *, const u8 *unk) {
if (*unk && sLib::absDiff(mAcchCir.GetWallAngleY(), angle.y) > mAng::deg2short(70.f) && 15.f < forwardSpeed) {
destroy();
}
}
mVec3_c dAcOtubo_c::getCenter() const {
mMtx_c m;
m.ZXYrotS(rotation.x, rotation.y, rotation.z);
mVec3_c dir;
PSMTXMultVecSR(m, mVec3_c::Ey, dir);
return position + dir * 28.f;
}
void dAcOtubo_c::fn_272_2E60(const mVec3_c &vel) {
if (mField_0x8F0.fn_80051780(mSph)) {
if (mSph.ChkCoHit()) {
position += mStts.GetCcMove();
mField_0x8F0.fn_800051630();
}
forwardSpeed = 0.f;
velocity = mVec3_c::Zero;
mbField_0x9F1 = 1;
mField_0x9B8 = vel * 2.f;
} else if (mSph.ChkTgAtHitType(AT_TYPE_BELLOWS)) {
velocity.x += vel.x * 0.06f;
velocity.y += vel.y * 0.2f;
velocity.z += vel.z * 0.06f;
mField_0x9CA = cM::atan2s(vel.x, vel.z);
forwardSpeed = mField_0x9D0 * EGG::Math<f32>::sqrt(velocity.x * velocity.x + velocity.z * velocity.z);
}
mbMovingForward = 1;
}
void dAcOtubo_c::fn_272_3020() {
static const s16 ang_inc = {0x2000}; // needed for rodata ordering
mbField_0x9EB = 1;
static mVec3_c sRot = mVec3_c::Ey;
mQuat_c quat;
mVec3_c rot = mVec3_c::Ey + mVec3_c(0.f, 0.f, 1.f) * mField_0x9E0;
rot.normalize();
rot.rotY(mField_0x9CC);
mField_0x9CC += 0x2000;
quat.makeVectorRotation(sRot, rot);
sLib::chase(&mField_0x9E0, 0.f, 0.005f);
mQuat_0x99C.slerpTo(quat, 0.5f, mQuat_0x99C);
}
void dAcOtubo_c::addPickupTarget() {
if (cM::isZero(forwardSpeed)) {
AttentionManager *ins = AttentionManager::sInstance;
ins->addPickUpTarget(*this, 120.f);
ins->addUnk3Target(*this, 1, 500.f, -200.f, 200.f);
}
}
void dAcOtubo_c::adjustAngle() {
cM3dGPla pla;
dBgS::GetInstance()->GetTriPla(mObjAcch.GetGnd(), &pla);
// ??
f32 mult = 1.f;
velocity.x += pla.mNormal.x * mult;
velocity.z += pla.mNormal.z * mult;
velocity.y = -(velocity.x * pla.GetN().x + velocity.z * pla.GetN().z) / pla.GetN().y;
forwardSpeed = nw4r::math::FSqrt(velocity.x * velocity.x + velocity.z * velocity.z);
forwardSpeed = cM::minMaxLimit(forwardSpeed, -30.f, 30.f);
mAng a = mAng::fromVec(pla.GetN()); // Probably mean to be angle from Ey
if (sLib::absDiff(a, angle.y) < mAng::deg2short(90.f)) {
sLib::addCalcAngle(angle.y.ref(), pla.GetAngleY(), 5, 0x71C, 0x100);
} else {
angle.y = mAng::fromVec(velocity);
}
}
void dAcOtubo_c::adjustSpeed() {
cM3dGPla pla;
dBgS::GetInstance()->GetTriPla(mObjAcch.mGnd, &pla);
f32 step = 0.4f;
mAng gndAngle = mAng::angle(mVec3_c::Ey, pla.GetN());
step *= gndAngle.cos();
if (gndAngle < mAng::deg2short(5) ||
sLib::absDiff(cM::atan2s(pla.mNormal.x, pla.mNormal.z), angle.y) > mAng::deg2short(90)) {
f32 stepSize = yoffset;
sLib::chase(&forwardSpeed, 0.f, step + stepSize * -0.05f);
} else {
if (!mbMovingForward) {
step *= -1.f;
}
forwardSpeed = cM::minMaxLimit(forwardSpeed + step, 0.f, 30.f);
}
mbMovingForward = forwardSpeed > 0.f;
}
bool dAcOtubo_c::checkSlope() {
cM3dGPla pla;
dBgS::GetInstance()->GetTriPla(mObjAcch.mGnd, &pla);
mAng gndAngle = mAng::angle(mVec3_c::Ey, pla.GetN());
return sLib::absDiff(gndAngle, 0) > mAng::deg2short(5);
}
bool dAcOtubo_c::fn_272_3660() {
int poly_code = dBgS::GetInstance()->GetSpecialCode(mObjAcch.GetGnd());
return mField_0x9F6 == 2 && !mStateMgr.isState(StateID_Grab) && !checkSubmerged() && poly_code != POLY_ATTR_LAVA;
}
bool dAcOtubo_c::checkInvalidGround() {
int poly_code = dBgS::GetInstance()->GetSpecialCode(mObjAcch.GetGnd());
return poly_code == POLY_ATTR_LAVA || poly_code == POLY_ATTR_SAND_MED || poly_code == POLY_ATTR_SAND_DEEP_INSTANT ||
poly_code == POLY_ATTR_SAND_DEEP_SLOW;
}
bool dAcOtubo_c::checkOnLava() {
int poly_code = dBgS::GetInstance()->GetSpecialCode(mObjAcch.GetGnd());
return poly_code == POLY_ATTR_LAVA;
}
bool dAcOtubo_c::checkCarryType() const {
return mActorCarryInfo.checkCarryType(1) || mActorCarryInfo.checkCarryType(7) || mActorCarryInfo.checkCarryType(5);
}
bool dAcOtubo_c::checkSubmerged() {
return mObjAcch.ChkWaterIn() && position.y + 28.f < mObjAcch.mWtr.GetGroundH();
}
bool dAcOtubo_c::fn_272_38A0() {
return mField_0x9DC < -30000.f;
}
bool dAcOtubo_c::fn_272_38C0() {
return mSph.ChkCoBit4();
}
bool dAcOtubo_c::checkOnLog_0xE4E() const {
if (mObjAcch.ChkGndHit() && dBgS::GetInstance()->ChkMoveBG(mObjAcch.mGnd, true)) {
const dAcObjBase_c *obj = dBgS::GetInstance()->GetActorPointer(mObjAcch.mGnd);
if (obj && obj->profile_name == fProfile::OBJ_LOG) {
return static_cast<const dAcOlog_c *>(obj)->getField_0xE4E() >= 4;
}
}
return false;
}
bool dAcOtubo_c::checkRollHitMaybe() {
if (15.f < forwardSpeed) {
return true;
}
if (mObjAcch.ChkWallHit(nullptr)) {
mVec3_c a = mVec3_c::Ez * 60.f;
mVec3_c start = getCenter();
a.rotY(mAng::fromVec(velocity));
mVec3_c end = start + a;
if (dBgS_ObjLinChk::LineCross(&start, &end, this)) {
return false;
}
}
return true;
}
void dAcOtubo_c::playRollSound() {
if (!(forwardSpeed > 0.f)) {
return;
}
if (checkSubmerged()) {
return;
}
FUN_8002d770(0xA48, forwardSpeed);
}
void float_order() {
const f32 arr[] = {-30000.f, -0.05f, 30.f};
}

View File

@ -32,7 +32,7 @@ STATE_DEFINE(dAcOTumbleWeed_c, Slope);
dCcD_SrcSph dAcOTumbleWeed_c::sSphSrc = {
/* mObjInf */
{/* mObjAt */ {0, 0, {0, 0, 0}, 0, 0, 0, 0, 0, 0},
/* mObjTg */ {0xFFB77FFF, 0x111, {8, 0x40F}, 0, 0},
/* mObjTg */ {~(AT_TYPE_BEETLE | AT_TYPE_0x80000 | AT_TYPE_0x8000), 0x111, {8, 0x40F}, 0, 0},
/* mObjCo */ {0xE9}},
/* mSphInf */
{60.f},
@ -124,14 +124,14 @@ int dAcOTumbleWeed_c::actorExecute() {
return SUCCEEDED;
}
if (mSph.ChkTgHit() && mSph.ChkTgAtHitType(AT_TYPE_0x10000 | AT_TYPE_0x200)) {
if (mSph.ChkTgHit() && mSph.ChkTgAtHitType(AT_TYPE_BELLOWS | AT_TYPE_WIND)) {
mField_0x974 = 0.f;
adjustTumble(mSph.GetTg_0x2C() * 0.06f);
adjustTumble(mSph.GetTgAtHitDir() * 0.06f);
}
adjustTimeScale();
// TODO(mObjectActorFlags)
if (mObjectActorFlags & 0x2) {
if (checkObjectProperty(0x2)) {
// Weak function not being placed right
if (sLib::calcTimer(&mTumbleTimer) == 0) {
FUN_8002dcd0();
@ -274,7 +274,7 @@ void dAcOTumbleWeed_c::doBreak() {
void dAcOTumbleWeed_c::calcMatrix() {
if (mField_0x98B) {
f32 vel_mag = PSVECMag(velocity);
f32 vel_mag = VEC3Len(velocity);
f32 f1 = mAng(vel_mag * (mField_0x978 + 200.f)).radian();
f32 f2 = mAng(vel_mag * 182.0f * 0.2f).radian();
f32 f0 = mAng(angle.y - rotation.y).radian();

View File

@ -8,7 +8,6 @@
#include "d/col/cc/d_cc_s.h"
#include "d/flag/sceneflag_manager.h"
SPECIAL_ACTOR_PROFILE(TAG_REACTION, dTgReaction_c, fProfile::TAG_REACTION, 0x0151, 0, 0);
STATE_DEFINE(dTgReaction_c, Wait);
@ -21,7 +20,7 @@ const f32 dTgReaction_c::sHeight = 100.0f;
// clang-format off
dCcD_SrcCyl dTgReaction_c::sCcSrc = {
{{0, 0, 0, 0, 0, 0, 0, 0, 0},
{0x10000, 0x213, 0, 0x8, 0x8,},
{AT_TYPE_BELLOWS, 0x213, 0, 0x8, 0x8,},
{0xE8}},
{dTgReaction_c::sRadius, dTgReaction_c::sHeight}
};
@ -81,19 +80,19 @@ int dTgReaction_c::create() {
switch (getReactType()) {
case REACT_SLINGSHOT:
mCollision.SetTgFlag(0x80);
mCollision.SetTgType(AT_TYPE_SLINGSHOT);
mCollision.SetTgFlag_0xA(0);
mCollision.SetR(sCcSrc.mCylInf.mRadius * mScale.x);
mCollision.SetH(sCcSrc.mCylInf.mHeight * mScale.y);
break;
case REACT_GUST_BELLOWS:
mCollision.SetTgFlag(0x10000);
mCollision.SetTgType(AT_TYPE_BELLOWS);
mCollision.SetTgFlag_0xA(8);
mCollision.SetR(sCcSrc.mCylInf.mRadius * mScale.x);
mCollision.SetH(sCcSrc.mCylInf.mHeight * mScale.y);
break;
case REACT_UNDERWATER:
mCollision.SetTgFlag(0x100000);
mCollision.SetTgType(AT_TYPE_BUBBLE);
mCollision.SetTgFlag_0xA(0);
mCollision.SetR(sCcSrc.mCylInf.mRadius * mScale.x);
mCollision.SetH(sCcSrc.mCylInf.mHeight * mScale.y);
@ -213,7 +212,7 @@ void dTgReaction_c::checkForBonkItem() {
}
void dTgReaction_c::checkForBubble() {
if (mCollision.ChkTgHit() && mCollision.ChkTgAtHitType(AT_TYPE_0x100000)) {
if (mCollision.ChkTgHit() && mCollision.ChkTgAtHitType(AT_TYPE_BUBBLE)) {
if (dAcPy_c::LINK != nullptr && dAcPy_c::LINK->checkFlags0x350(0x40)) {
mVec3_c spawnPos = position;
dAcObjBase_c::create(fProfile::OBJ_BUBBLE, roomid, 0x4, &spawnPos, nullptr, nullptr, 0xFFFFFFFF);

View File

@ -3,12 +3,12 @@
#include "d/a/d_a_player.h"
#include "d/a/obj/d_a_obj_base.h"
#include "d/d_heap.h"
#include "d/flag/enemyflag_manager.h"
#include "f/f_list_nd.h"
#include "m/m_vec.h"
#include "toBeSorted/event.h"
#include "toBeSorted/event_manager.h"
#include "toBeSorted/file_manager.h"
#include "d/flag/enemyflag_manager.h"
#include "toBeSorted/room_manager.h"
#include "toBeSorted/scgame.h"
#include "toBeSorted/special_item_drop_mgr.h"
@ -243,9 +243,7 @@ u32 dAcBase_c::itemDroppingAndGivingRelated(mVec3_c *spawnPos, int subtype) {
u32 param2Copy = params2;
params2 = param2Copy | 0xFF000000;
// mAng3_c rot = {};
return SpecialItemDropMgr::sInstance->giveSpecialDropItem(
param2Copy >> 0x18, roomid, spawnPos, subtype, 0, -1
);
return SpecialItemDropMgr::sInstance->giveSpecialDropItem(param2Copy >> 0x18, roomid, spawnPos, subtype, 0, -1);
}
// 8002cf90
@ -264,7 +262,7 @@ void dAcBase_c::setParams2Upper_ignoreLower(u32 val) {
}
// 8002cfc0
u8 dAcBase_c::getParams2UpperByte() {
int dAcBase_c::getParams2UpperByte() {
return params2 >> 0x18;
}
@ -450,7 +448,7 @@ void dAcBase_c::FUN_8002d6d0() {}
// currently named ActorBase__playSoundEffect1
void dAcBase_c::playSoundEffect1(u16) {}
void dAcBase_c::FUN_8002d740() {}
void dAcBase_c::FUN_8002d770() {}
void dAcBase_c::FUN_8002d770(u16, f32) {}
void dAcBase_c::FUN_8002d7a0() {}
void dAcBase_c::FUN_8002d7d0() {}
void dAcBase_c::FUN_8002d7f0() {}
@ -551,7 +549,7 @@ dAcBase_c *dAcBase_c::createActorStage(
}
// 8002db80
void *dAcBase_c::getCurrentEventActor() {}
void dAcBase_c::registerInEvent() {}
// 8002db90
void dAcBase_c::unkVirtFunc_0x6C() {}

View File

@ -10,20 +10,11 @@
#include "d/col/bg/d_bg_w_base.h"
#include "d/col/c/c_cc_d.h"
#include "d/col/c/c_m3d_g_pla.h"
#include "egg/math/eggMath.h"
#include "m/m_angle.h"
#include "m/m_mtx.h"
#include "m/m_vec.h"
#include "rvl/MTX/mtxvec.h"
#include "toBeSorted/attention.h"
#include <cmath.h>
// Very Hack ??
static inline bool IsZero(f32 in) {
return in <= EGG::Math<f32>::epsilon();
}
extern "C" void fn_800298B0(u16, mVec3_c *, mVec3_c *, u32, u32, u32, u32, u32);
extern "C" u16 PARTICLE_RESOURCE_ID_MAPPING_394_;
@ -179,10 +170,10 @@ bool dAcOInsect_c::checkDeath(cCcD_Obj &col) {
}
if (col.ChkTgHit() &&
(col.ChkTgAtHitType(AT_TYPE_0x2) || col.ChkTgAtHitType(AT_TYPE_0x8) || col.ChkTgAtHitType(AT_TYPE_0x20) ||
col.ChkTgAtHitType(AT_TYPE_0x40) || col.ChkTgAtHitType(AT_TYPE_0x80) || col.ChkTgAtHitType(AT_TYPE_0x2000) ||
col.ChkTgAtHitType(AT_TYPE_0x4000) || col.ChkTgAtHitType(AT_TYPE_0x800000) ||
col.ChkTgAtHitType(AT_TYPE_0x800))) {
(col.ChkTgAtHitType(AT_TYPE_SWORD) || col.ChkTgAtHitType(AT_TYPE_PHYSICS) || col.ChkTgAtHitType(AT_TYPE_BOMB) ||
col.ChkTgAtHitType(AT_TYPE_0x40) || col.ChkTgAtHitType(AT_TYPE_SLINGSHOT) ||
col.ChkTgAtHitType(AT_TYPE_ARROW) || col.ChkTgAtHitType(AT_TYPE_CLAWSHOT) ||
col.ChkTgAtHitType(AT_TYPE_0x800000) || col.ChkTgAtHitType(AT_TYPE_WHIP))) {
mLinkNearby = 0;
return true;
}
@ -212,7 +203,7 @@ bool dAcOInsect_c::fn_8018FAA0() {
bool dAcOInsect_c::fn_8018FAD0() {
f32 speed = fabsf(forwardSpeed);
if (IsZero(speed)) {
if (cM::isLessThanZero(speed)) {
fn_8018FDF0(mPlane_0x3A8.GetN());
return true;
} else {

View File

@ -16,8 +16,11 @@ STATE_DEFINE(dAcArrow_c, Bound);
cCcD_SrcGObj dAcArrow_c::sCcSrcInf = {
{0x2000, 0x8BB, 0x15000000, 0, 0, 0, 0, 0, 0},
{0xFEB75C7F, 0x210, 0, 0x407, 0, 0},
{AT_TYPE_ARROW, 0x8BB, {0x15,0, 0}, 0, 0, 0, 0, 0, 0},
{
~(AT_TYPE_BUGNET | AT_TYPE_BEETLE | AT_TYPE_0x80000 | AT_TYPE_0x8000 | AT_TYPE_ARROW | AT_TYPE_0x100 | AT_TYPE_WIND | AT_TYPE_SLINGSHOT),
0x210, 0, 0x407, 0, 0
},
{0},
};
@ -28,7 +31,7 @@ dCcD_SrcCps dAcArrow_c::sCc1 = {
const dCcD_SrcSph dAcArrow_c::sCc2 = {
{{0x0, 0x0, 0x0, 0, 0, 0, 0, 0, 0},
{0x2, 0x211, 0, 0x407, 0, 0},
{AT_TYPE_SWORD, 0x211, 0, 0x407, 0, 0},
{0xC28}},
{100.0f},
};

View File

@ -96,7 +96,7 @@ void dAcObjFairy_c::executeState_CatchDemo() {
}
void dAcObjFairy_c::finalizeState_CatchDemo() {
field_0xB89 = 0;
mObjectActorFlags &= ~0x00000200;
clearObjectProperty(0x200);
}
bool dAcObjFairy_c::shouldAvoidLink() const {

View File

@ -58,7 +58,7 @@ void dAcOsw_c::rideCallback(dBgW *unknown, dAcObjBase_c *actor, dAcObjBase_c *in
}
}
}
interactor->mObjectActorFlags |= 0x40;
interactor->setObjectProperty(0x40);
}
}

View File

@ -58,8 +58,8 @@ void dBgS_ObjGndChk::ClearInstance() {
sInstance.ClearPi();
}
bool dBgS_ObjGndChk::CheckPos(const mVec3_c *pPos) {
sInstance.SetPos(pPos);
bool dBgS_ObjGndChk::CheckPos(const mVec3_c &pPos) {
sInstance.SetPos(&pPos);
sGroundHeight = dBgS::GetInstance()->GroundCross(&sInstance);
return sGroundHeight != -1e9f;
}

View File

@ -1,5 +1,6 @@
#include "d/col/c/c_cc_d.h"
#include "c/c_math.h"
#include "common.h"
#include "d/a/obj/d_a_obj_base.h"
#include "d/col/c/c_m3d.h"
@ -16,10 +17,6 @@
#include "rvl/MTX.h" // IWYU pragma: export
#include "s/s_Math.h"
// Very Hack ??
static inline bool IsZero(f32 in) {
return fabsf(in) <= EGG::Math<f32>::epsilon();
}
static inline void MtxTransMinusXYZ(mMtx_c &mtx, f32 x, f32 y, f32 z) {
PSMTXTrans(mtx, -x, -y, -z);
}
@ -441,7 +438,7 @@ bool cCcD_Obj::ChkTgAtHitType(u32 mask) const {
return mTg.mAtHitSrc.mType & mask;
}
u32 cCcD_Obj::GetTg_0x58() const {
u32 cCcD_Obj::GetTgAtHitType() const {
return mTg.mAtHitSrc.mType;
}
@ -508,8 +505,8 @@ dAcObjBase_c *cCcD_Obj::GetTgActor() {
return mTg.GetActor();
}
const mVec3_c &cCcD_Obj::GetTg_0x2C() const {
return mTg.mField_0x2C;
const mVec3_c &cCcD_Obj::GetTgAtHitDir() const {
return mTg.mAtHitDir;
}
dAcObjBase_c *cCcD_Obj::GetCoActor() {
@ -612,7 +609,7 @@ bool cCcD_TriAttr::Calc(const mVec3_c &start, const mVec3_c &end, mVec3_c *pOut)
}
mVec3_c tmp2 = tmp1 - tmp0;
f32 mag = tmp2.squaredLength();
if (IsZero(mag)) {
if (cM::isZero(mag)) {
bVar1 = true;
} else {
mag = tmp2.dot(*pOut - tmp0) / mag;
@ -978,7 +975,7 @@ bool cCcD_CpsAttr::Calc(const mVec3_c &start, const mVec3_c &end, mVec3_c *pOut)
bool bInverse;
f32 dist = EGG::Math<f32>::sqrt(tmp0.x * tmp0.x + tmp0.z * tmp0.z);
if (IsZero(dist)) {
if (cM::isZero(dist)) {
tmp1 = start;
tmp2 = end;
if (endRef.y > startRef.y) {
@ -1308,7 +1305,7 @@ void cCcD_SphAttr::Set(const cCcD_SrcSphAttr &src) {
a.z = 0.0f;
a.y = 0.0f;
a.x = 0.0f;
SetC(&a);
SetC(a);
}
mVec3_c &cCcD_SphAttr::GetCoP() {

View File

@ -6,12 +6,12 @@ cM3dGSph::cM3dGSph() {
mRatio = 1.0f;
}
void cM3dGSph::SetC(const mVec3_c *c) {
mCenter = *c;
void cM3dGSph::SetC(const mVec3_c &c) {
mCenter = c;
}
void cM3dGSph::Set(const mVec3_c *c, f32 r) {
SetC(c);
SetC(*c);
SetR(r);
}
@ -24,7 +24,7 @@ void cM3dGSph::SetR(f32 r) {
void cM3dGSph::SetC(f32 x, f32 y, f32 z) {
mVec3_c c(x, y, z);
SetC(&c);
SetC(c);
}
bool cM3dGSph::Cross(cM3dGUnk &pUnk, mVec3_c *pOut) {

View File

@ -62,17 +62,17 @@ void dCcD_Sph::Set(const dCcD_SrcSph &src) {
void dCcD_Sph::setCenter(const mVec3_c &c) {
SetAtVec(mVec3_c::Zero);
SetC(&c);
SetC(c);
}
void dCcD_Sph::moveCenter(const mVec3_c &c) {
SetAtVec(c - GetC());
SetC(&c);
SetC(c);
}
void dCcD_Sph::setCenterAndAtVec(const mVec3_c &a, const mVec3_c &b) {
SetAtVec(b);
SetC(&a);
SetC(a);
}
cCcD_ShapeAttr *dCcD_Sph::GetShapeAttr() {

View File

@ -5,7 +5,6 @@
#include "toBeSorted/event.h"
#include "toBeSorted/scgame.h"
SPECIAL_ACTOR_PROFILE(SW_TAG, dTgSw_c, fProfile::SW_TAG, 0x24, 0, 0);
STATE_DEFINE(dTgSw_c, OnWait);