mirror of https://github.com/zeldaret/mm.git
En_jc_mato matching (#119)
* starting actor * close to being done * updating txt files * z_en_jc_mato OK * Merge branch 'master' into en_jc_mato * fixing some suggestions * adding names * changing name to movement
This commit is contained in:
parent
d44d842192
commit
d61d236a04
|
|
@ -28,6 +28,7 @@ tools/ido5.3_compiler/
|
|||
tools/ido7.1_compiler/
|
||||
tools/qemu-mips
|
||||
tools/ido_recomp/* binary
|
||||
ctx.c
|
||||
|
||||
# Assets
|
||||
*.rgba32.png
|
||||
|
|
|
|||
|
|
@ -338,7 +338,9 @@ typedef struct {
|
|||
|
||||
// Extra information in the save context that is not saved
|
||||
typedef struct {
|
||||
/* 0x000 */ UNK_TYPE1 pad0[0xC];
|
||||
/* 0x000 */ UNK_TYPE1 pad0[0x4];
|
||||
/* 0x004 */ s16 unk04;
|
||||
/* 0x006 */ UNK_TYPE1 pad06[0x6];
|
||||
/* 0x00C */ s32 sceneSetupIndex;
|
||||
/* 0x010 */ s32 unk10;
|
||||
/* 0x014 */ UNK_TYPE1 pad14[0x10];
|
||||
|
|
@ -379,7 +381,8 @@ typedef struct {
|
|||
/* 0x0000 */ UNK_TYPE1 pad0[0x1];
|
||||
/* 0x0001 */ u8 unk1;
|
||||
/* 0x0002 */ u8 unk2;
|
||||
/* 0x0003 */ UNK_TYPE1 pad3[0x2];
|
||||
/* 0x0003 */ u8 unk3;
|
||||
/* 0x0004 */ u8 unk4;
|
||||
/* 0x0005 */ u8 unk5;
|
||||
/* 0x0006 */ UNK_TYPE1 pad6[0x2C8C];
|
||||
/* 0x0006 */ s16 unk_A00;
|
||||
|
|
@ -799,10 +802,13 @@ typedef struct {
|
|||
/* 0x250 */ s16 unk250;
|
||||
/* 0x252 */ s16 lifeSizeChange;
|
||||
/* 0x254 */ s16 lifeSizeChangeDirection; // 1 means shrinking, 0 growing
|
||||
/* 0x256 */ UNK_TYPE1 pad256[0x1A];
|
||||
/* 0x256 */ UNK_TYPE1 pad256[0x06];
|
||||
/* 0x25C */ u16 unk25C;
|
||||
/* 0x25E */ UNK_TYPE1 pad25E[0x12];
|
||||
/* 0x270 */ s16 lifeAlpha;
|
||||
/* 0x272 */ UNK_TYPE1 pad272[0xD6];
|
||||
} InterfaceContext; // size = 0x348
|
||||
}
|
||||
InterfaceContext; // size = 0x348
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ UNK_TYPE1 unk0;
|
||||
|
|
|
|||
|
|
@ -7518,9 +7518,9 @@ SECTIONS
|
|||
ovl_En_Jc_Mato : AT(RomLocation)
|
||||
{
|
||||
build/src/overlays/actors/ovl_En_Jc_Mato/z_en_jc_mato.o(.text)
|
||||
build/asm/overlays/ovl_En_Jc_Mato_data.o(.data)
|
||||
build/src/overlays/actors/ovl_En_Jc_Mato/z_en_jc_mato.o(.data)
|
||||
build/src/overlays/actors/ovl_En_Jc_Mato/z_en_jc_mato.o(.rodata)
|
||||
build/asm/overlays/ovl_En_Jc_Mato_rodata.o(.rodata)
|
||||
build/src/overlays/actors/ovl_En_Jc_Mato/z_en_jc_mato_overlay.o(.ovl)
|
||||
}
|
||||
SegmentEnd = .;
|
||||
SegmentSize = SegmentEnd - SegmentStart;
|
||||
|
|
|
|||
|
|
@ -197,3 +197,6 @@ D_06000EC0 = 0x06000EC0;
|
|||
/* en_cha */
|
||||
D_06000710 = 0x06000710;
|
||||
D_06000958 = 0x06000958;
|
||||
|
||||
/* z_en_jc_mato */
|
||||
D_06000390 = 0x06000390;
|
||||
|
|
@ -1,3 +1,9 @@
|
|||
/*
|
||||
* File: z_en_jc_mato.c
|
||||
* Overlay: ovl_en_jc_mato
|
||||
* Description: Boat Cruise Target
|
||||
*/
|
||||
|
||||
#include "z_en_jc_mato.h"
|
||||
|
||||
#define FLAGS 0x00004030
|
||||
|
|
@ -9,7 +15,10 @@ void EnJcMato_Destroy(Actor* thisx, GlobalContext* globalCtx);
|
|||
void EnJcMato_Update(Actor* thisx, GlobalContext* globalCtx);
|
||||
void EnJcMato_Draw(Actor* thisx, GlobalContext* globalCtx);
|
||||
|
||||
/*
|
||||
s32 EnJcMato_CheckForHit(EnJcMato* this, GlobalContext* globalCtx);
|
||||
void EnJcMato_SetupIdle(EnJcMato* this);
|
||||
void EnJcMato_Idle(EnJcMato* this, GlobalContext* globalCtx);
|
||||
|
||||
const ActorInit En_Jc_Mato_InitVars = {
|
||||
ACTOR_EN_JC_MATO,
|
||||
ACTORCAT_PROP,
|
||||
|
|
@ -19,20 +28,110 @@ const ActorInit En_Jc_Mato_InitVars = {
|
|||
(ActorFunc)EnJcMato_Init,
|
||||
(ActorFunc)EnJcMato_Destroy,
|
||||
(ActorFunc)EnJcMato_Update,
|
||||
(ActorFunc)EnJcMato_Draw
|
||||
(ActorFunc)EnJcMato_Draw,
|
||||
};
|
||||
*/
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Jc_Mato_0x80B9DEE0/func_80B9DEE0.asm")
|
||||
ColliderSphereInit sSphereInit = {
|
||||
{
|
||||
COLTYPE_NONE,
|
||||
AT_NONE,
|
||||
AC_ON | AC_TYPE_PLAYER,
|
||||
OC1_ON | OC1_TYPE_ALL,
|
||||
OC2_TYPE_1,
|
||||
COLSHAPE_SPHERE,
|
||||
},
|
||||
{
|
||||
ELEMTYPE_UNK0,
|
||||
{ 0xF7CFFFFF, 0x00, 0x00 },
|
||||
{ 0xF7CFFFFF, 0x00, 0x00 },
|
||||
TOUCH_NONE | TOUCH_SFX_NORMAL,
|
||||
BUMP_ON,
|
||||
OCELEM_ON,
|
||||
},
|
||||
{ 0, { { 0, 0, 0 }, 15 }, 100 },
|
||||
};
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Jc_Mato_0x80B9DEE0/func_80B9DFC8.asm")
|
||||
DamageTable EnJcMatoDamageTable = {
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0xF1, 0x01, 0x01, 0x01, 0x01, 0x01, 0xF1, 0xF1, 0xF1, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
};
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Jc_Mato_0x80B9DEE0/func_80B9DFDC.asm")
|
||||
s32 EnJcMato_CheckForHit(EnJcMato* this, GlobalContext* globalCtx) {
|
||||
this->collider.dim.worldSphere.center.x = this->pos.x;
|
||||
this->collider.dim.worldSphere.center.y = this->pos.y;
|
||||
this->collider.dim.worldSphere.center.z = this->pos.z;
|
||||
if ((this->collider.base.acFlags & 2) && !this->hitFlag && (this->actor.colChkInfo.damageEffect == 0xF)) {
|
||||
this->collider.base.acFlags &= 0xFFFD;
|
||||
Audio_PlayActorSound2(&this->actor, 0x4807);
|
||||
globalCtx->interfaceCtx.unk25C = 1;
|
||||
this->hitFlag = 1;
|
||||
return 1;
|
||||
} else {
|
||||
CollisionCheck_SetOC(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
|
||||
CollisionCheck_SetAC(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Jc_Mato_0x80B9DEE0/EnJcMato_Init.asm")
|
||||
void EnJcMato_SetupIdle(EnJcMato* this) {
|
||||
this->actionFunc = EnJcMato_Idle;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Jc_Mato_0x80B9DEE0/EnJcMato_Destroy.asm")
|
||||
void EnJcMato_Idle(EnJcMato* this, GlobalContext* globalCtx) {
|
||||
s16 shouldDespawn;
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Jc_Mato_0x80B9DEE0/EnJcMato_Update.asm")
|
||||
if (this->hitFlag != 0) {
|
||||
if (this->despawnTimer == 0) {
|
||||
shouldDespawn = 0;
|
||||
} else {
|
||||
this->despawnTimer--;
|
||||
shouldDespawn = this->despawnTimer;
|
||||
}
|
||||
if (shouldDespawn == 0) {
|
||||
Actor_MarkForDeath(&this->actor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Jc_Mato_0x80B9DEE0/EnJcMato_Draw.asm")
|
||||
void EnJcMato_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnJcMato* this = THIS;
|
||||
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 24.0f);
|
||||
Collider_InitSphere(globalCtx, &this->collider);
|
||||
Collider_SetSphere(globalCtx, &this->collider, &this->actor, &sSphereInit);
|
||||
this->collider.dim.worldSphere.radius = 0xF;
|
||||
this->actor.colChkInfo.damageTable = &EnJcMatoDamageTable;
|
||||
Actor_SetScale(&this->actor, 0.008f);
|
||||
this->hitFlag = 0;
|
||||
this->despawnTimer = 25;
|
||||
EnJcMato_SetupIdle(this);
|
||||
}
|
||||
|
||||
void EnJcMato_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnJcMato* this = THIS;
|
||||
|
||||
Collider_DestroySphere(globalCtx, &this->collider);
|
||||
}
|
||||
|
||||
void EnJcMato_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnJcMato* this = THIS;
|
||||
|
||||
this->actionFunc(this, globalCtx);
|
||||
if (!(gSaveContext.owl.unk4 & 1)) {
|
||||
EnJcMato_CheckForHit(this, globalCtx);
|
||||
}
|
||||
}
|
||||
|
||||
extern Gfx D_06000390[];
|
||||
Vec3f movement = { 0.0f, -2500.0f, 0.0f };
|
||||
|
||||
void EnJcMato_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnJcMato* this = THIS;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
func_8012C28C(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_OPA_DISP++, D_06000390);
|
||||
SysMatrix_MultiplyVector3fByState(&movement, &this->pos);
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,9 +5,15 @@
|
|||
|
||||
struct EnJcMato;
|
||||
|
||||
typedef void (*EnJcMatoActionFunc)(struct EnJcMato*, GlobalContext*);
|
||||
|
||||
typedef struct EnJcMato {
|
||||
/* 0x000 */ Actor actor;
|
||||
/* 0x144 */ char unk_144[0x6C];
|
||||
/* 0x144 */ EnJcMatoActionFunc actionFunc;
|
||||
/* 0x148 */ ColliderSphere collider;
|
||||
/* 0x1A0 */ s16 despawnTimer;
|
||||
/* 0x1A2 */ s16 hitFlag;
|
||||
/* 0x1A4 */ Vec3f pos;
|
||||
} EnJcMato; // size = 0x1B0
|
||||
|
||||
extern const ActorInit En_Jc_Mato_InitVars;
|
||||
|
|
|
|||
|
|
@ -15008,9 +15008,9 @@
|
|||
0x80B9D714:("func_80B9D714",),
|
||||
0x80B9D9C4:("ObjHunsui_Draw",),
|
||||
0x80B9DA60:("func_80B9DA60",),
|
||||
0x80B9DEE0:("func_80B9DEE0",),
|
||||
0x80B9DFC8:("func_80B9DFC8",),
|
||||
0x80B9DFDC:("func_80B9DFDC",),
|
||||
0x80B9DEE0:("EnJcMato_CheckForHit",),
|
||||
0x80B9DFC8:("EnJcMato_SetupIdle",),
|
||||
0x80B9DFDC:("EnJcMato_Idle",),
|
||||
0x80B9E030:("EnJcMato_Init",),
|
||||
0x80B9E0D0:("EnJcMato_Destroy",),
|
||||
0x80B9E0FC:("EnJcMato_Update",),
|
||||
|
|
|
|||
Loading…
Reference in New Issue