EnFamos OK with object_famos (#789)

* EnFamos: redo begin

* EnFamos: back to where I was previously

* EnFamos: matched looping draw function

* EnFamos: OK

* Famos: some docs

* Famos: some docs

* Famos: sfx convert pass

* EnFamos: some docs

* EnFamos: more docs

* Enfamos: more docks

* EnFamos: more doc

* EnFamos: more docks

* EnFamos: mass to dec

* Famos: limb enum

* Famos: more docs all functions named

* Famos: all struct mapped

* Apply suggestions from code review

Co-authored-by: EllipticEllipsis <elliptic.ellipsis@gmail.com>

* Famos: fix declaration order

* Famos: requested changes

* Famos: draw func using proper sSetupDL indexing

* Famos: fix text anim mismatch, change tlut to match gFamos SnakeCase

* Famos: formater pls

* Famos: requested changes

* Famos: more requested changes

* Apply suggestions from code review

Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>

* Update assets/xml/objects/object_famos.xml

Co-authored-by: Tom Overton <tom-overton@users.noreply.github.com>

* Famos: requested changes and format pass

* Apply suggestions from code review

Co-authored-by: EllipticEllipsis <elliptic.ellipsis@gmail.com>

* Famos: more requested changes

* Famos: more requested changes

* Famos: another change

* Apply suggestions from code review

Co-authored-by: EllipticEllipsis <elliptic.ellipsis@gmail.com>

* Famos: made define macro for agro distance

* Famos: separated conditions on separate lines

Co-authored-by: Isghj8 <isghj8@gmail.com>
Co-authored-by: EllipticEllipsis <elliptic.ellipsis@gmail.com>
Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>
Co-authored-by: Tom Overton <tom-overton@users.noreply.github.com>
This commit is contained in:
Isghj
2022-05-25 22:11:07 -04:00
committed by GitHub
co-authored by Isghj8 EllipticEllipsis Derek Hensley Tom Overton
parent 0582c636b8
commit 6d3bcc5cbb
6 changed files with 893 additions and 143 deletions
+27 -24
View File
@@ -1,28 +1,31 @@
<Root>
<!-- Death Armos: flying statues in Inverted Stone Tower Temple -->
<File Name="object_famos" Segment="6">
<Animation Name="object_famos_Anim_0000F8" Offset="0xF8" />
<DList Name="object_famos_DL_0012B0" Offset="0x12B0" />
<DList Name="object_famos_DL_001528" Offset="0x1528" />
<DList Name="object_famos_DL_001C88" Offset="0x1C88" />
<DList Name="object_famos_DL_001DE8" Offset="0x1DE8" />
<DList Name="object_famos_DL_001FA8" Offset="0x1FA8" />
<Texture Name="object_famos_TLUT_002068" OutName="tlut_002068" Format="rgba16" Width="4" Height="4" Offset="0x2068" />
<Texture Name="object_famos_TLUT_002088" OutName="tlut_002088" Format="rgba16" Width="4" Height="4" Offset="0x2088" />
<Texture Name="object_famos_TLUT_0020A8" OutName="tlut_0020A8" Format="rgba16" Width="4" Height="4" Offset="0x20A8" />
<Texture Name="object_famos_TLUT_0020C8" OutName="tlut_0020C8" Format="rgba16" Width="4" Height="4" Offset="0x20C8" />
<Texture Name="object_famos_Tex_0020E8" OutName="tex_0020E8" Format="ci4" Width="64" Height="64" Offset="0x20E8" />
<Texture Name="object_famos_Tex_0028E8" OutName="tex_0028E8" Format="ci4" Width="32" Height="32" Offset="0x28E8" />
<Texture Name="object_famos_Tex_002AE8" OutName="tex_002AE8" Format="ci4" Width="64" Height="64" Offset="0x2AE8" />
<Texture Name="object_famos_Tex_0032E8" OutName="tex_0032E8" Format="ci4" Width="32" Height="32" Offset="0x32E8" />
<Texture Name="object_famos_Tex_0034E8" OutName="tex_0034E8" Format="rgba16" Width="32" Height="32" Offset="0x34E8" />
<Limb Name="object_famos_Standardlimb_003CE8" Type="Standard" EnumName="OBJECT_FAMOS_LIMB_01" Offset="0x3CE8" />
<Limb Name="object_famos_Standardlimb_003CF4" Type="Standard" EnumName="OBJECT_FAMOS_LIMB_02" Offset="0x3CF4" />
<Limb Name="object_famos_Standardlimb_003D00" Type="Standard" EnumName="OBJECT_FAMOS_LIMB_03" Offset="0x3D00" />
<Limb Name="object_famos_Standardlimb_003D0C" Type="Standard" EnumName="OBJECT_FAMOS_LIMB_04" Offset="0x3D0C" />
<Limb Name="object_famos_Standardlimb_003D18" Type="Standard" EnumName="OBJECT_FAMOS_LIMB_05" Offset="0x3D18" />
<Skeleton Name="object_famos_Skel_003D38" Type="Normal" LimbType="Standard" LimbNone="OBJECT_FAMOS_LIMB_NONE" LimbMax="OBJECT_FAMOS_LIMB_MAX" EnumName="object_famos_Limbs" Offset="0x3D38" />
<Animation Name="object_famos_Anim_003DC8" Offset="0x3DC8" />
<TextureAnimation Name="object_famos_Matanimheader_003E30" Offset="0x3E30" />
<TextureAnimation Name="object_famos_Matanimheader_003E38" Offset="0x3E38" />
<Animation Name="gFamosShakeAnim" Offset="0xF8" />
<DList Name="gFamosHelmetDL" Offset="0x12B0" />
<DList Name="gFamosMainBodyDL" Offset="0x1528" />
<DList Name="gFamosShieldDL" Offset="0x1C88" />
<DList Name="gFamosSwordDL" Offset="0x1DE8" />
<DList Name="gFamosLightSwitchDL" Offset="0x1FA8" />
<Texture Name="gFamosBodyTLUT" OutName="body_tlut" Format="rgba16" Width="4" Height="4" Offset="0x2068" />
<Texture Name="gFamosBottomTLUT" OutName="bottom_tlut" Format="rgba16" Width="4" Height="4" Offset="0x2088" />
<Texture Name="gFamosShieldTLUT" OutName="shield_tlut" Format="rgba16" Width="4" Height="4" Offset="0x20A8" />
<Texture Name="gFamosSwordHiltTLUT" OutName="sword_hilt_tlut" Format="rgba16" Width="4" Height="4" Offset="0x20C8" />
<Texture Name="gFamosMainBodyTex" OutName="famos_main_body" Format="ci4" Width="64" Height="64" Offset="0x20E8" />
<Texture Name="gFamosBottomTex" OutName="famos_bottom" Format="ci4" Width="32" Height="32" Offset="0x28E8" />
<Texture Name="gFamosShieldTex" OutName="famos_shield" Format="ci4" Width="64" Height="64" Offset="0x2AE8" />
<Texture Name="gFamosSwordHiltTex" OutName="famos_sword_hilt" Format="ci4" Width="32" Height="32" Offset="0x32E8" />
<Texture Name="gFamosLightSwitchTex" OutName="famos_light_switch" Format="rgba16" Width="32" Height="32" Offset="0x34E8" />
<Limb Name="gFamosBodyLimb" Type="Standard" EnumName="FAMOS_LIMB_BODY" Offset="0x3CE8" />
<Limb Name="gFamosEmblemLimb" Type="Standard" EnumName="FAMOS_LIMB_EMBLEM" Offset="0x3CF4" />
<Limb Name="gFamosSwordLimb" Type="Standard" EnumName="FAMOS_LIMB_SWORD" Offset="0x3D00" />
<Limb Name="gFamosShieldLimb" Type="Standard" EnumName="FAMOS_LIMB_SHIELD" Offset="0x3D0C" />
<Limb Name="gFamosHeadLimb" Type="Standard" EnumName="FAMOS_LIMB_HEAD" Offset="0x3D18" />
<Skeleton Name="gFamosSkeleton" Type="Normal" LimbType="Standard" LimbNone="FAMOS_LIMB_NONE" LimbMax="FAMOS_LIMB_MAX" EnumName="FamosLimbs" Offset="0x3D38" />
<Animation Name="gFamosIdleAnim" Offset="0x3DC8" />
<TextureAnimation Name="gFamosNormalGlowingEmblemTexAnim" Offset="0x3E30" />
<TextureAnimation Name="gFamosFlippedGlowingEmblemTexAnim" Offset="0x3E38" />
</File>
</Root>
+1 -2
View File
@@ -969,8 +969,7 @@ beginseg
name "ovl_En_Famos"
compress
include "build/src/overlays/actors/ovl_En_Famos/z_en_famos.o"
include "build/data/ovl_En_Famos/ovl_En_Famos.data.o"
include "build/data/ovl_En_Famos/ovl_En_Famos.reloc.o"
include "build/src/overlays/actors/ovl_En_Famos/ovl_En_Famos_reloc.o"
endseg
beginseg
-3
View File
@@ -4208,9 +4208,6 @@ s32 func_800C9AE4(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId) {
return (func_800C9A4C(colCtx, poly, bgId) & 4) ? true : false;
}
/**
* unused
*/
u32 func_800C9B18(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId) {
return SurfaceType_GetData(colCtx, poly, bgId, 0) >> 26 & 0xF;
}
File diff suppressed because it is too large Load Diff
+46 -6
View File
@@ -2,18 +2,58 @@
#define Z_EN_FAMOS_H
#include "global.h"
#include "objects/object_famos/object_famos.h"
struct EnFamos;
typedef void (*EnFamosActionFunc)(struct EnFamos*, GlobalContext*);
typedef struct EnFamosRock {
/* 00 */ Vec3f pos;
/* 0C */ Vec3f velocity;
/* 18 */ Vec3s rotation;
/* 20 */ f32 scale;
} EnFamosRock; // size = 0x24
#define GET_FAMOS_PATH(thisx) (thisx->params)
#define GET_FAMOS_AGGRO_DISTANCE(thisx) (thisx->shape.rot.x)
// stateTimer gets reused:
// after spotting player, counts frames until first attack (8)
// after lost aggro, measures frames looking around before returning to home (60)
// before smash attack, counts frames before disabling emblem colider (4)
// after smash attack collision, counts frames before rising (3)
// after smash attack finish, counts frames rising above ground before next attempt (20)
typedef struct EnFamos {
/* 0x0000 */ Actor actor;
/* 0x0144 */ char unk_144[0x8C];
/* 0x01D0 */ EnFamosActionFunc actionFunc;
/* 0x01D4 */ char unk_1D4[0x440];
/* 0x000 */ Actor actor;
/* 0x144 */ SkelAnime skelAnime;
/* 0x188 */ Vec3s jointTable[FAMOS_LIMB_MAX];
/* 0x1AC */ Vec3s morphTable[FAMOS_LIMB_MAX];
/* 0x1D0 */ EnFamosActionFunc actionFunc;
/* 0x1D4 */ u8 animatedMaterialIndex;
/* 0x1D5 */ u8 hasFinishedRotating; // stable up or down
/* 0x1D6 */ u8 pathNodeCount;
/* 0x1D7 */ u8 currentPathNode;
/* 0x1D8 */ u8 isCalm; // is NOT aware of player
/* 0x1DA */ s16 hoverTimer; // start 30, decr to 0, repeat: for trig height adjustment when hovering
/* 0x1DC */ s16 stateTimer; // reused for different actionFunc
/* 0x1DE */ s16 debrisTimer; // also counts frames until despawning bom after death
/* 0x1E0 */ s16 flippedTimer; // frames until it flips right side up
/* 0x1E2 */ s16 cratorDespawnTimer;
/* 0x1E4 */ s16 targetYaw;
/* 0x1E6 */ s16 flipRot; // is used to detect if the actor has been flipped upside down by light arrows
/* 0x1E8 */ Vec3s* pathPoints;
/* 0x1EC */ f32 baseHeight; // because hover can hit the floor, we need to keep track so famos cannot by adjusted/moved by terain
/* 0x1F0 */ f32 aggroDistance;
/* 0x1F4 */ Vec3f targetDest;
/* 0x200 */ Vec3f calmPos;
// havent figured out what the difference between the colliders are, only one cylinder is visible in KZ
/* 0x20C */ ColliderCylinder collider1;
/* 0x258 */ ColliderCylinder collider2;
/* 0x2A4 */ ColliderJntSph emblemCollider;
/* 0x2C4 */ ColliderJntSphElement emblemColliderElements[2];
/* 0x344 */ EnFamosRock rocks[20];
} EnFamos; // size = 0x614
extern const ActorInit En_Famos_InitVars;
#endif // Z_EN_FAMOS_H
+37 -37
View File
@@ -5821,44 +5821,44 @@
0x808ABF30:("EnOssan_PartTimeWorker_Draw",),
0x808AC920:("EnFamos_Init",),
0x808ACB08:("EnFamos_Destroy",),
0x808ACB58:("func_808ACB58",),
0x808ACD2C:("func_808ACD2C",),
0x808ACF1C:("func_808ACF1C",),
0x808ACF98:("func_808ACF98",),
0x808AD05C:("func_808AD05C",),
0x808AD170:("func_808AD170",),
0x808AD18C:("func_808AD18C",),
0x808AD1F0:("func_808AD1F0",),
0x808AD294:("func_808AD294",),
0x808AD31C:("func_808AD31C",),
0x808AD378:("func_808AD378",),
0x808AD3E8:("func_808AD3E8",),
0x808AD42C:("func_808AD42C",),
0x808AD54C:("func_808AD54C",),
0x808AD5B0:("func_808AD5B0",),
0x808AD66C:("func_808AD66C",),
0x808AD68C:("func_808AD68C",),
0x808AD7EC:("func_808AD7EC",),
0x808AD840:("func_808AD840",),
0x808AD888:("func_808AD888",),
0x808AD8B8:("func_808AD8B8",),
0x808ADA74:("func_808ADA74",),
0x808ADAE8:("func_808ADAE8",),
0x808ADB4C:("func_808ADB4C",),
0x808ADB70:("func_808ADB70",),
0x808ADC40:("func_808ADC40",),
0x808ADC64:("func_808ADC64",),
0x808ADD20:("func_808ADD20",),
0x808ADDA8:("func_808ADDA8",),
0x808ADE00:("func_808ADE00",),
0x808ADE74:("func_808ADE74",),
0x808ADFA4:("func_808ADFA4",),
0x808ADFF0:("func_808ADFF0",),
0x808AE030:("func_808AE030",),
0x808ACB58:("EnFamos_SetupAttackDebris",),
0x808ACD2C:("EnFamos_SetupDeathDebris",),
0x808ACF1C:("EnFamos_IsPlayerSeen",),
0x808ACF98:("EnFamos_UpdateBobbingHeight",),
0x808AD05C:("EnFamos_UpdateFlipStatus",),
0x808AD170:("EnFamos_SetupStillIdle",),
0x808AD18C:("EnFamos_StillIdle",),
0x808AD1F0:("EnFamos_SetupPathingIdle",),
0x808AD294:("EnFamos_PathingIdle",),
0x808AD31C:("EnFamos_SetupTurnHome",),
0x808AD378:("EnFamos_TurnHome",),
0x808AD3E8:("EnFamos_SetupReturnHome",),
0x808AD42C:("EnFamos_ReturnHome",),
0x808AD54C:("EnFamos_SetupAlert",),
0x808AD5B0:("EnFamos_Alert",),
0x808AD66C:("EnFamos_SetupChase",),
0x808AD68C:("EnFamos_Chase",),
0x808AD7EC:("EnFamos_SetupAttackAim",),
0x808AD840:("EnFamos_AttackAim",),
0x808AD888:("EnFamos_SetupAttack",),
0x808AD8B8:("EnFamos_Attack",),
0x808ADA74:("EnFamos_SetupFinishAttack",),
0x808ADAE8:("EnFamos_FinishAttack",),
0x808ADB4C:("EnFamos_SetupAttackRebound",),
0x808ADB70:("EnFamos_AttackRebound",),
0x808ADC40:("EnFamos_SetupScanForPlayer",),
0x808ADC64:("EnFamos_ScanForPlayer",),
0x808ADD20:("EnFamos_SetupDeathSlam",),
0x808ADDA8:("EnFamos_DeathSlam",),
0x808ADE00:("EnFamos_SetupDeathExplosion",),
0x808ADE74:("EnFamos_DeathExplosion",),
0x808ADFA4:("EnFamos_SetupDeathFade",),
0x808ADFF0:("EnFamos_DeathFade",),
0x808AE030:("EnFamos_UpdateDebrisPosRot",),
0x808AE0EC:("EnFamos_Update",),
0x808AE304:("func_808AE304",),
0x808AE3A8:("func_808AE3A8",),
0x808AE3FC:("func_808AE3FC",),
0x808AE304:("EnFamos_OverrideLimbDraw",),
0x808AE3A8:("EnFamos_PostLimbDraw",),
0x808AE3FC:("EnFamos_DrawDebris",),
0x808AE530:("EnFamos_Draw",),
0x808AE8C0:("EnBombf_SetupAction",),
0x808AE8CC:("EnBombf_Init",),