mirror of https://github.com/zeldaret/mm.git
Some pathing docs (#1205)
* Some pathing docs * Missed one * Uno mas * Uno mas x2 * Cleanup * fix * namefixer * NULL * More * PR * Actually remove SQ * -1 define, plus some more pathing cleanup * Actor macros instead * Format * ADDITIONAL_PATH_INDEX_NONE * Remove reliance on PATH_INDEX_NONE * Missed some PathIndex cleanup * Review * format
This commit is contained in:
parent
47bc7c12e2
commit
cd53dd317f
|
@ -1503,7 +1503,7 @@ void Interface_Update(PlayState* play);
|
|||
void Interface_Destroy(PlayState* play);
|
||||
void Interface_Init(PlayState* play);
|
||||
|
||||
Path* Path_GetByIndex(PlayState* play, s16 index, s16 max);
|
||||
Path* Path_GetByIndex(PlayState* play, s16 index, s16 indexNone);
|
||||
f32 Path_OrientAndGetDistSq(Actor* actor, Path* path, s16 waypoint, s16* yaw);
|
||||
void Path_CopyLastPoint(Path* path, Vec3f* dest);
|
||||
|
||||
|
|
|
@ -469,10 +469,13 @@ typedef struct {
|
|||
/* 0x00C */ ObjectStatus status[OBJECT_EXCHANGE_BANK_MAX];
|
||||
} ObjectContext; // size = 0x958
|
||||
|
||||
#define PATH_INDEX_NONE -1
|
||||
#define ADDITIONAL_PATH_INDEX_NONE (u8)-1
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ u8 count; // number of points in the path
|
||||
/* 0x1 */ u8 unk1;
|
||||
/* 0x2 */ s16 unk2;
|
||||
/* 0x0 */ u8 count; // Number of points in the path
|
||||
/* 0x1 */ u8 additionalPathIndex;
|
||||
/* 0x2 */ s16 customValue; // Path specific to help distinguish different paths
|
||||
/* 0x4 */ Vec3s* points; // Segment Address to the array of points
|
||||
} Path; // size = 0x8
|
||||
|
||||
|
|
|
@ -108,7 +108,7 @@ s32 SubS_ChangeAnimationByInfoS(SkelAnime* skelAnime, AnimationInfoS* animationI
|
|||
|
||||
s32 SubS_HasReachedPoint(Actor* actor, Path* path, s32 pointIndex);
|
||||
|
||||
Path* SubS_GetDayDependentPath(struct PlayState* play, u8 pathIndex, u8 max, s32* startPointIndex);
|
||||
Path* SubS_GetDayDependentPath(struct PlayState* play, u8 pathIndex, u8 pathIndexNone, s32* startPointIndex);
|
||||
|
||||
s32 SubS_WeightPathing_ComputePoint(Path* path, s32 waypoint, Vec3f* point, f32 progress, s32 direction);
|
||||
s32 SubS_WeightPathing_Move(Actor* actor, Path* path, s32* waypoint, f32* progress, s32 direction, s32 returnStart);
|
||||
|
@ -126,7 +126,7 @@ s32 SubS_TrackPoint(Vec3f* target, Vec3f* focusPos, Vec3s* shapeRot, Vec3s* trac
|
|||
|
||||
s32 SubS_AngleDiffLessEqual(s16 angleA, s16 threshold, s16 angleB);
|
||||
|
||||
Path* SubS_GetPathByIndex(struct PlayState* play, s16 pathIndex, s16 max);
|
||||
Path* SubS_GetPathByIndex(struct PlayState* play, s16 pathIndex, s16 pathIndexNone);
|
||||
s32 SubS_CopyPointFromPath(Path* path, s32 pointIndex, Vec3f* dst);
|
||||
s16 SubS_GetDistSqAndOrientPoints(Vec3f* vecA, Vec3f* vecB, f32* distSq);
|
||||
s32 SubS_MoveActorToPoint(Actor* actor, Vec3f* point, s16 rotStep);
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
#include "global.h"
|
||||
|
||||
Path* Path_GetByIndex(PlayState* play, s16 index, s16 max) {
|
||||
Path* Path_GetByIndex(PlayState* play, s16 index, s16 indexNone) {
|
||||
Path* path;
|
||||
|
||||
if (index != max) {
|
||||
if (index != indexNone) {
|
||||
path = &play->setupPathList[index];
|
||||
} else {
|
||||
path = NULL;
|
||||
|
|
|
@ -489,9 +489,9 @@ Path* SubS_GetAdditionalPath(PlayState* play, u8 pathIndex, s32 limit) {
|
|||
if (i >= limit) {
|
||||
break;
|
||||
}
|
||||
pathIndex = path->unk1;
|
||||
pathIndex = path->additionalPathIndex;
|
||||
i++;
|
||||
} while (pathIndex != 0xFF);
|
||||
} while (pathIndex != ADDITIONAL_PATH_INDEX_NONE);
|
||||
|
||||
return path;
|
||||
}
|
||||
|
@ -585,7 +585,7 @@ s32 SubS_HasReachedPoint(Actor* actor, Path* path, s32 pointIndex) {
|
|||
return reached;
|
||||
}
|
||||
|
||||
Path* SubS_GetDayDependentPath(PlayState* play, u8 pathIndex, u8 max, s32* startPointIndex) {
|
||||
Path* SubS_GetDayDependentPath(PlayState* play, u8 pathIndex, u8 pathIndexNone, s32* startPointIndex) {
|
||||
Path* path = NULL;
|
||||
s32 found = false;
|
||||
s32 time = (((s16)TIME_TO_MINUTES_F(gSaveContext.save.time) % 60) +
|
||||
|
@ -593,17 +593,17 @@ Path* SubS_GetDayDependentPath(PlayState* play, u8 pathIndex, u8 max, s32* start
|
|||
30;
|
||||
s32 day = CURRENT_DAY;
|
||||
|
||||
if (pathIndex == max) {
|
||||
if (pathIndex == pathIndexNone) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
while (pathIndex != 0xFF) {
|
||||
while (pathIndex != ADDITIONAL_PATH_INDEX_NONE) {
|
||||
path = &play->setupPathList[pathIndex];
|
||||
if (sPathDayFlags[day] & path->unk2) {
|
||||
if (path->customValue & sPathDayFlags[day]) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
pathIndex = path->unk1;
|
||||
pathIndex = path->additionalPathIndex;
|
||||
}
|
||||
|
||||
if (found == true) {
|
||||
|
@ -1098,8 +1098,8 @@ s32 SubS_AngleDiffLessEqual(s16 angleA, s16 threshold, s16 angleB) {
|
|||
return (ABS_ALT(BINANG_SUB(angleB, angleA)) <= threshold) ? true : false;
|
||||
}
|
||||
|
||||
Path* SubS_GetPathByIndex(PlayState* play, s16 pathIndex, s16 max) {
|
||||
return (pathIndex != max) ? &play->setupPathList[pathIndex] : NULL;
|
||||
Path* SubS_GetPathByIndex(PlayState* play, s16 pathIndex, s16 pathIndexNone) {
|
||||
return (pathIndex != pathIndexNone) ? &play->setupPathList[pathIndex] : NULL;
|
||||
}
|
||||
|
||||
s32 SubS_CopyPointFromPath(Path* path, s32 pointIndex, Vec3f* dst) {
|
||||
|
|
|
@ -56,8 +56,8 @@ s32 func_80BC3980(BgF40Block* this, PlayState* play) {
|
|||
this->unk_160 = 0;
|
||||
this->unk_164 = 0;
|
||||
|
||||
if (BGF40BLOCK_GET_PATH(&this->dyna.actor) != 0x3F) {
|
||||
this->path = &play->setupPathList[BGF40BLOCK_GET_PATH(&this->dyna.actor)];
|
||||
if (BGF40BLOCK_GET_PATH_INDEX(&this->dyna.actor) != BGF40BLOCK_PATH_INDEX_NONE) {
|
||||
this->path = &play->setupPathList[BGF40BLOCK_GET_PATH_INDEX(&this->dyna.actor)];
|
||||
if (this->path != NULL) {
|
||||
points = Lib_SegmentedToVirtual(this->path->points);
|
||||
|
||||
|
@ -78,8 +78,8 @@ s32 func_80BC3A2C(BgF40Block* this, PlayState* play) {
|
|||
this->unk_160 = this->path->count - 1;
|
||||
this->unk_164 = this->path->count - 1;
|
||||
|
||||
if (BGF40BLOCK_GET_PATH(&this->dyna.actor) != 0x3F) {
|
||||
this->path = &play->setupPathList[BGF40BLOCK_GET_PATH(&this->dyna.actor)];
|
||||
if (BGF40BLOCK_GET_PATH_INDEX(&this->dyna.actor) != BGF40BLOCK_PATH_INDEX_NONE) {
|
||||
this->path = &play->setupPathList[BGF40BLOCK_GET_PATH_INDEX(&this->dyna.actor)];
|
||||
if (this->path != NULL) {
|
||||
points = Lib_SegmentedToVirtual(this->path->points);
|
||||
points += this->unk_164;
|
||||
|
@ -231,8 +231,8 @@ void BgF40Block_Init(Actor* thisx, PlayState* play) {
|
|||
DynaPolyActor_Init(&this->dyna, DYNA_TRANSFORM_POS);
|
||||
DynaPolyActor_LoadMesh(play, &this->dyna, &gStoneTowerBlockCol);
|
||||
|
||||
if (BGF40BLOCK_GET_PATH(&this->dyna.actor) != 0x3F) {
|
||||
this->path = &play->setupPathList[BGF40BLOCK_GET_PATH(&this->dyna.actor)];
|
||||
if (BGF40BLOCK_GET_PATH_INDEX(&this->dyna.actor) != BGF40BLOCK_PATH_INDEX_NONE) {
|
||||
this->path = &play->setupPathList[BGF40BLOCK_GET_PATH_INDEX(&this->dyna.actor)];
|
||||
} else {
|
||||
this->path = NULL;
|
||||
}
|
||||
|
|
|
@ -7,9 +7,11 @@ struct BgF40Block;
|
|||
|
||||
typedef void (*BgF40BlockActionFunc)(struct BgF40Block*, PlayState*);
|
||||
|
||||
#define BGF40BLOCK_GET_PATH(thisx) (((thisx)->params & 0x1FC) >> 2)
|
||||
#define BGF40BLOCK_GET_PATH_INDEX(thisx) (((thisx)->params & 0x1FC) >> 2)
|
||||
#define BGF40BLOCK_GET_SWITCHFLAG(thisx) (((thisx)->params & 0xFE00) >> 9)
|
||||
|
||||
#define BGF40BLOCK_PATH_INDEX_NONE 0x3F
|
||||
|
||||
typedef struct BgF40Block {
|
||||
/* 0x000 */ DynaPolyActor dyna;
|
||||
/* 0x15C */ Path* path;
|
||||
|
|
|
@ -190,7 +190,7 @@ void func_80953F9C(BgIngate* this, PlayState* play) {
|
|||
|
||||
if (this->unk160 & 2) {
|
||||
|
||||
if (this->timePath->unk1 != 0xFF) {
|
||||
if (this->timePath->additionalPathIndex != ADDITIONAL_PATH_INDEX_NONE) {
|
||||
func_80953E38(play);
|
||||
func_800B7298(play, &this->dyna.actor, PLAYER_CSMODE_WAIT);
|
||||
this->dyna.actor.textId = 0x9E4;
|
||||
|
@ -262,7 +262,7 @@ void func_80954340(BgIngate* this, PlayState* play) {
|
|||
if (DECR(this->unk16A) == 0) {
|
||||
if (this->timePath != NULL) {
|
||||
func_800B7298(play, &this->dyna.actor, PLAYER_CSMODE_END);
|
||||
this->timePath = &play->setupPathList[this->timePath->unk1];
|
||||
this->timePath = &play->setupPathList[this->timePath->additionalPathIndex];
|
||||
func_80953F14(this, play);
|
||||
Environment_StopTime();
|
||||
}
|
||||
|
@ -287,7 +287,7 @@ void func_809543D4(BgIngate* this, PlayState* play) {
|
|||
func_8019F208();
|
||||
} else {
|
||||
if (this->timePath != NULL) {
|
||||
this->timePath = &play->setupPathList[this->timePath->unk1];
|
||||
this->timePath = &play->setupPathList[this->timePath->additionalPathIndex];
|
||||
}
|
||||
func_80953F14(this, play);
|
||||
CLEAR_WEEKEVENTREG(WEEKEVENTREG_90_40);
|
||||
|
@ -328,7 +328,7 @@ void BgIngate_Init(Actor* thisx, PlayState* play2) {
|
|||
this->unk160 |= 0x8;
|
||||
this->unk160 |= 0x10;
|
||||
Actor_SetScale(&this->dyna.actor, 1.0f);
|
||||
this->timePath = SubS_GetAdditionalPath(play, BGINGATE_GET_FF(&this->dyna.actor), 0);
|
||||
this->timePath = SubS_GetAdditionalPath(play, BGINGATE_GET_PATH_INDEX(&this->dyna.actor), 0);
|
||||
this->dyna.actor.room = -1;
|
||||
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_WOODFALL_TEMPLE)) {
|
||||
CLEAR_WEEKEVENTREG(WEEKEVENTREG_90_40);
|
||||
|
@ -350,7 +350,7 @@ void BgIngate_Init(Actor* thisx, PlayState* play2) {
|
|||
this->actionFunc = func_80953F8C;
|
||||
}
|
||||
}
|
||||
this->timePath = SubS_GetAdditionalPath(play, BGINGATE_GET_FF(&this->dyna.actor), phi_a2);
|
||||
this->timePath = SubS_GetAdditionalPath(play, BGINGATE_GET_PATH_INDEX(&this->dyna.actor), phi_a2);
|
||||
if (this->timePath != NULL) {
|
||||
sp38 = Lib_SegmentedToVirtual(this->timePath->points);
|
||||
Math_Vec3s_ToVec3f(&sp2C, &sp38[0]);
|
||||
|
@ -361,7 +361,7 @@ void BgIngate_Init(Actor* thisx, PlayState* play2) {
|
|||
this->dyna.actor.world.pos.y = -15.0f;
|
||||
this->dyna.actor.world.pos.z = sp2C.z;
|
||||
}
|
||||
this->timePath = SubS_GetAdditionalPath(play, BGINGATE_GET_FF(&this->dyna.actor), 0);
|
||||
this->timePath = SubS_GetAdditionalPath(play, BGINGATE_GET_PATH_INDEX(&this->dyna.actor), 0);
|
||||
} else {
|
||||
Actor_Kill(&this->dyna.actor);
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ struct BgIngate;
|
|||
|
||||
typedef void (*BgIngateActionFunc)(struct BgIngate*, PlayState*);
|
||||
|
||||
#define BGINGATE_GET_FF(thisx) ((thisx)->params & 0xFF)
|
||||
#define BGINGATE_GET_PATH_INDEX(thisx) ((thisx)->params & 0xFF)
|
||||
|
||||
typedef struct BgIngate {
|
||||
/* 0x000 */ DynaPolyActor dyna;
|
||||
|
|
|
@ -129,7 +129,7 @@ void func_80AB2268(DmChar09* this, PlayState* play) {
|
|||
s32 i;
|
||||
s32 cueChannel;
|
||||
s32 max = 0;
|
||||
s32 pathnum;
|
||||
s32 pathIndex;
|
||||
u8 temp = false;
|
||||
|
||||
if (!DMCHAR09_GET_F(&this->actor)) {
|
||||
|
@ -160,12 +160,12 @@ void func_80AB2268(DmChar09* this, PlayState* play) {
|
|||
}
|
||||
|
||||
if (play->csCtx.actorCues[cueChannel]->id >= 2) {
|
||||
pathnum = DMCHAR09_GET_PATH(&this->actor);
|
||||
path = &play->setupPathList[pathnum];
|
||||
pathIndex = DMCHAR09_GET_PATH_INDEX(&this->actor);
|
||||
path = &play->setupPathList[pathIndex];
|
||||
|
||||
for (i = 0; i < max; i++) {
|
||||
pathnum = path->unk1;
|
||||
path = &play->setupPathList[pathnum];
|
||||
pathIndex = path->additionalPathIndex;
|
||||
path = &play->setupPathList[pathIndex];
|
||||
}
|
||||
|
||||
this->unk_224 = Lib_SegmentedToVirtual(path->points);
|
||||
|
@ -175,7 +175,7 @@ void func_80AB2268(DmChar09* this, PlayState* play) {
|
|||
this->unk_220 = 1;
|
||||
this->unk_22E = true;
|
||||
|
||||
this->speed = (u16)play->csCtx.actorCues[cueChannel]->rot.z * 0.00390625f;
|
||||
this->speed = (u16)play->csCtx.actorCues[cueChannel]->rot.z * (1.0f / 256.0f);
|
||||
this->actionFunc = func_80AB1FDC;
|
||||
} else {
|
||||
this->unk_22E = false;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include "global.h"
|
||||
#include "objects/object_bee/object_bee.h"
|
||||
|
||||
#define DMCHAR09_GET_PATH(thisx) (((thisx)->params >> 4) & 0xF)
|
||||
#define DMCHAR09_GET_PATH_INDEX(thisx) (((thisx)->params >> 4) & 0xF)
|
||||
#define DMCHAR09_GET_100(thisx) ((thisx)->params & 0x100)
|
||||
#define DMCHAR09_GET_F(thisx) ((thisx)->params & 0xF)
|
||||
|
||||
|
|
|
@ -1610,7 +1610,7 @@ void EnAkindonuts_Init(Actor* thisx, PlayState* play) {
|
|||
this->actor.gravity = -1.0f;
|
||||
|
||||
if (!ENAKINDONUTS_GET_4(&this->actor)) {
|
||||
this->path = SubS_GetPathByIndex(play, ENAKINDONUTS_GET_FC00(&this->actor), 0x3F);
|
||||
this->path = SubS_GetPathByIndex(play, ENAKINDONUTS_GET_PATH_INDEX(&this->actor), ENAKINDONUTS_PATH_INDEX_NONE);
|
||||
if (this->path == NULL) {
|
||||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
|
|
|
@ -10,7 +10,9 @@ typedef void (*EnAkindonutsUnkFunc)(struct EnAkindonuts*, PlayState*);
|
|||
|
||||
#define ENAKINDONUTS_GET_3(thisx) ((thisx)->params & 3)
|
||||
#define ENAKINDONUTS_GET_4(thisx) (((thisx)->params & 4) >> 2)
|
||||
#define ENAKINDONUTS_GET_FC00(thisx) (((thisx)->params & 0xFC00) >> 0xA)
|
||||
#define ENAKINDONUTS_GET_PATH_INDEX(thisx) (((thisx)->params & 0xFC00) >> 0xA)
|
||||
|
||||
#define ENAKINDONUTS_PATH_INDEX_NONE 0x3F
|
||||
|
||||
enum {
|
||||
/* 1 */ ENAKINDONUTS_3_1 = 1,
|
||||
|
|
|
@ -134,12 +134,12 @@ void EnAob01_InitializeDogPaths(EnAob01* this, PlayState* play) {
|
|||
s32 pathIndex = ENAOB01_GET_STARTING_DOG_PATH_INDEX(&this->actor);
|
||||
s16 i = 0;
|
||||
|
||||
if (pathIndex != 0x3F) {
|
||||
if (pathIndex != ENAOB01_PATH_INDEX_NONE) {
|
||||
do {
|
||||
this->dogPaths[i] = SubS_GetPathByIndex(play, pathIndex, 0x3F);
|
||||
pathIndex = this->dogPaths[i]->unk1;
|
||||
this->dogPaths[i] = SubS_GetPathByIndex(play, pathIndex, ENAOB01_PATH_INDEX_NONE);
|
||||
pathIndex = this->dogPaths[i]->additionalPathIndex;
|
||||
i++;
|
||||
} while (pathIndex != 0xFF);
|
||||
} while (pathIndex != ADDITIONAL_PATH_INDEX_NONE);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -153,7 +153,7 @@ void EnAob01_SpawnDogs(EnAob01* this, PlayState* play) {
|
|||
EnAob01_InitializeDogPaths(this, play);
|
||||
|
||||
for (i = 0; i < RACEDOG_COUNT; i++) {
|
||||
enDgParams = ENDG_PARAMS(this->dogPaths[sDogInfo[i].pathIndex]->unk1, i);
|
||||
enDgParams = ENDG_PARAMS(this->dogPaths[sDogInfo[i].pathIndex]->additionalPathIndex, i);
|
||||
|
||||
this->dogs[i] = Actor_SpawnAsChildAndCutscene(
|
||||
&play->actorCtx, play, ACTOR_EN_DG, sDogInfo[i].pos.x, sDogInfo[i].pos.y, sDogInfo[i].pos.z, 0,
|
||||
|
|
|
@ -29,6 +29,8 @@ typedef void (*EnAob01ActionFunc)(struct EnAob01*, PlayState*);
|
|||
#define ENAOB01_FLAG_SURPRISE (1 << 7)
|
||||
#define ENAOB01_FLAG_PLAYER_CAN_TALK (1 << 8)
|
||||
|
||||
#define ENAOB01_PATH_INDEX_NONE 0x3F
|
||||
|
||||
typedef struct EnAob01 {
|
||||
/* 0x000 */ Actor actor;
|
||||
/* 0x144 */ EnAob01ActionFunc actionFunc;
|
||||
|
|
|
@ -511,7 +511,7 @@ void EnBaba_FinishInit(EnBaba* this, PlayState* play) {
|
|||
} else if (play->sceneId == SCENE_BACKTOWN) {
|
||||
if ((BOMB_SHOP_LADY_GET_TYPE(&this->actor) == BOMB_SHOP_LADY_TYPE_FOLLOW_SCHEDULE) &&
|
||||
(gSaveContext.save.entrance != ENTRANCE(NORTH_CLOCK_TOWN, 7)) &&
|
||||
(BOMB_SHOP_LADY_GET_PATH_INDEX(&this->actor) != 0x3F)) {
|
||||
(BOMB_SHOP_LADY_GET_PATH_INDEX(&this->actor) != BOMB_SHOP_LADY_PATH_INDEX_NONE)) {
|
||||
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_58_40) ||
|
||||
(gSaveContext.save.time >= CLOCK_TIME(0, 20) && (gSaveContext.save.time < CLOCK_TIME(6, 0)))) {
|
||||
Actor_Kill(&this->actor);
|
||||
|
@ -550,7 +550,7 @@ void EnBaba_FinishInit(EnBaba* this, PlayState* play) {
|
|||
this->animIndex = BOMB_SHOP_LADY_ANIM_SWAY;
|
||||
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex);
|
||||
this->actionFunc = EnBaba_DoNothing;
|
||||
} else if (BOMB_SHOP_LADY_GET_PATH_INDEX(&this->actor) != 0x3F) {
|
||||
} else if (BOMB_SHOP_LADY_GET_PATH_INDEX(&this->actor) != BOMB_SHOP_LADY_PATH_INDEX_NONE) {
|
||||
this->animIndex = BOMB_SHOP_LADY_ANIM_WALKING_HOLDING_BAG;
|
||||
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex);
|
||||
this->actionFunc = EnBaba_Walk;
|
||||
|
@ -728,7 +728,7 @@ void EnBaba_Init(Actor* thisx, PlayState* play) {
|
|||
Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit);
|
||||
CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
|
||||
|
||||
this->path = SubS_GetPathByIndex(play, BOMB_SHOP_LADY_GET_PATH_INDEX(&this->actor), 0x3F);
|
||||
this->path = SubS_GetPathByIndex(play, BOMB_SHOP_LADY_GET_PATH_INDEX(&this->actor), BOMB_SHOP_LADY_PATH_INDEX_NONE);
|
||||
|
||||
Actor_SetScale(&this->actor, 0.01f);
|
||||
|
||||
|
|
|
@ -12,6 +12,8 @@ typedef void (*EnBabaActionFunc)(struct EnBaba*, PlayState*);
|
|||
#define BOMB_SHOP_LADY_GET_PATH_INDEX(thisx) (((thisx)->params & 0x3F00) >> 8)
|
||||
#define BOMB_SHOP_LADY_GET_TYPE(thisx) (((thisx)->params & 0xC000) >> 0xE)
|
||||
|
||||
#define BOMB_SHOP_LADY_PATH_INDEX_NONE 0x3F
|
||||
|
||||
// Types BOMB_SHOP_LADY_TYPE_FOLLOW_SCHEDULE and BOMB_SHOP_LADY_TYPE_IDLE can only be used in SCENE_BACKTOWN
|
||||
// Type BOMB_SHOP_LADY_TYPE_SWAY can be used anywhere except SCENE_BACKTOWN and SCENE_BOMYA
|
||||
typedef enum {
|
||||
|
|
|
@ -162,7 +162,7 @@ void EnBba01_FinishInit(EnHy* this, PlayState* play) {
|
|||
this->actor.flags |= ACTOR_FLAG_1;
|
||||
this->actor.draw = EnBba01_Draw;
|
||||
this->waitingOnInit = false;
|
||||
if (ENBBA01_GET_PATH(&this->actor) == 0x3F) {
|
||||
if (ENBBA01_GET_PATH_INDEX(&this->actor) == ENBBA01_PATH_INDEX_NONE) {
|
||||
this->actionFunc = EnBba01_FaceFoward;
|
||||
} else {
|
||||
this->actionFunc = EnBba01_Walk;
|
||||
|
@ -227,7 +227,7 @@ void EnBba01_Init(Actor* thisx, PlayState* play) {
|
|||
Collider_SetCylinder(play, &this->enHy.collider, &this->enHy.actor, &sCylinderInit);
|
||||
CollisionCheck_SetInfo2(&this->enHy.actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
|
||||
this->enHy.actor.flags &= ~ACTOR_FLAG_1;
|
||||
this->enHy.path = SubS_GetPathByIndex(play, ENBBA01_GET_PATH(&this->enHy.actor), 0x3F);
|
||||
this->enHy.path = SubS_GetPathByIndex(play, ENBBA01_GET_PATH_INDEX(&this->enHy.actor), ENBBA01_PATH_INDEX_NONE);
|
||||
this->enHy.waitingOnInit = true;
|
||||
Actor_SetScale(&this->enHy.actor, 0.01f);
|
||||
this->enHy.actionFunc = EnBba01_FinishInit;
|
||||
|
|
|
@ -7,7 +7,9 @@ struct EnBba01;
|
|||
|
||||
typedef void (*EnBba01ActionFunc)(struct EnBba01*, PlayState*);
|
||||
|
||||
#define ENBBA01_GET_PATH(thisx) (((thisx)->params & 0x7E00) >> 9)
|
||||
#define ENBBA01_GET_PATH_INDEX(thisx) (((thisx)->params & 0x7E00) >> 9)
|
||||
|
||||
#define ENBBA01_PATH_INDEX_NONE 0x3F
|
||||
|
||||
typedef struct EnBba01 {
|
||||
/* 0x000 */ EnHy enHy;
|
||||
|
|
|
@ -93,8 +93,8 @@ void EnBomBowlMan_Init(Actor* thisx, PlayState* play) {
|
|||
return;
|
||||
}
|
||||
|
||||
this->unk_29A = ENBOMBOWLMAN_GET_FF00(&this->actor);
|
||||
this->path = SubS_GetPathByIndex(play, this->unk_29A, 0x3F);
|
||||
this->pathIndex = ENBOMBOWLMAN_GET_PATH_INDEX(&this->actor);
|
||||
this->path = SubS_GetPathByIndex(play, this->pathIndex, ENBOMBOWLMAN_PATH_INDEX_NONE);
|
||||
this->unk_2C8 = 80.0f;
|
||||
|
||||
if ((gSaveContext.save.entrance == ENTRANCE(EAST_CLOCK_TOWN, 2)) && CHECK_WEEKEVENTREG(WEEKEVENTREG_73_80) &&
|
||||
|
@ -156,7 +156,7 @@ void func_809C4B50(EnBomBowlMan* this) {
|
|||
}
|
||||
|
||||
void func_809C4B6C(EnBomBowlMan* this) {
|
||||
if ((this->unk_29A != ENBOMBOWLMAN_FF00_MINUS1) && (this->path != NULL)) {
|
||||
if ((this->pathIndex != PATH_INDEX_NONE) && (this->path != NULL)) {
|
||||
if (!SubS_CopyPointFromPath(this->path, this->unk_298, &this->unk_2A0)) {
|
||||
Actor_Kill(&this->actor);
|
||||
}
|
||||
|
|
|
@ -9,13 +9,13 @@ typedef void (*EnBomBowlManActionFunc)(struct EnBomBowlMan*, PlayState*);
|
|||
|
||||
#define ENBOMBOWLMAN_GET_F(thisx) ((thisx)->params & 0xF)
|
||||
#define ENBOMBOWLMAN_GET_F0(thisx) (((thisx)->params >> 4) & 0xF)
|
||||
#define ENBOMBOWLMAN_GET_FF00(thisx) (((thisx)->params >> 8) & 0xFF)
|
||||
#define ENBOMBOWLMAN_GET_PATH_INDEX(thisx) (((thisx)->params >> 8) & 0xFF)
|
||||
|
||||
#define ENBOMBOWLMAN_PATH_INDEX_NONE 0x3F
|
||||
|
||||
#define ENBOMBOWLMAN_F0_0 0
|
||||
#define ENBOMBOWLMAN_F0_2 2
|
||||
|
||||
#define ENBOMBOWLMAN_FF00_MINUS1 -1
|
||||
|
||||
typedef struct EnBomBowlMan {
|
||||
/* 0x000 */ Actor actor;
|
||||
/* 0x144 */ SkelAnime skelAnime;
|
||||
|
@ -30,7 +30,7 @@ typedef struct EnBomBowlMan {
|
|||
/* 0x292 */ UNK_TYPE1 unk292[2];
|
||||
/* 0x294 */ Path* path;
|
||||
/* 0x298 */ s16 unk_298;
|
||||
/* 0x29A */ s16 unk_29A;
|
||||
/* 0x29A */ s16 pathIndex;
|
||||
/* 0x29C */ s16 unk_29C;
|
||||
/* 0x29E */ s16 unk_29E;
|
||||
/* 0x2A0 */ Vec3f unk_2A0;
|
||||
|
|
|
@ -152,7 +152,7 @@ void EnCne01_FinishInit(EnHy* this, PlayState* play) {
|
|||
this->actor.flags |= ACTOR_FLAG_1;
|
||||
this->actor.draw = EnCne01_Draw;
|
||||
this->waitingOnInit = false;
|
||||
if (ENCNE01_GET_PATH(&this->actor) == 0x3F) {
|
||||
if (ENCNE01_GET_PATH_INDEX(&this->actor) == ENCNE01_PATH_INDEX_NONE) {
|
||||
this->actionFunc = EnCne01_FaceForward;
|
||||
} else {
|
||||
this->actionFunc = EnCne01_Walk;
|
||||
|
@ -217,7 +217,7 @@ void EnCne01_Init(Actor* thisx, PlayState* play) {
|
|||
Collider_SetCylinder(play, &this->enHy.collider, &this->enHy.actor, &sCylinderInit);
|
||||
CollisionCheck_SetInfo2(&this->enHy.actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
|
||||
this->enHy.actor.flags &= ~ACTOR_FLAG_1;
|
||||
this->enHy.path = SubS_GetPathByIndex(play, ENCNE01_GET_PATH(&this->enHy.actor), 0x3F);
|
||||
this->enHy.path = SubS_GetPathByIndex(play, ENCNE01_GET_PATH_INDEX(&this->enHy.actor), ENCNE01_PATH_INDEX_NONE);
|
||||
this->enHy.waitingOnInit = true;
|
||||
Actor_SetScale(&this->enHy.actor, 0.01f);
|
||||
this->enHy.actionFunc = EnCne01_FinishInit;
|
||||
|
|
|
@ -7,7 +7,9 @@ struct EnCne01;
|
|||
|
||||
typedef void (*EnCne01ActionFunc)(struct EnCne01*, PlayState*);
|
||||
|
||||
#define ENCNE01_GET_PATH(thisx) (((thisx)->params & 0x7E00) >> 9)
|
||||
#define ENCNE01_GET_PATH_INDEX(thisx) (((thisx)->params & 0x7E00) >> 9)
|
||||
|
||||
#define ENCNE01_PATH_INDEX_NONE 0x3F
|
||||
|
||||
typedef struct EnCne01 {
|
||||
/* 0x000 */ EnHy enHy;
|
||||
|
|
|
@ -77,8 +77,8 @@ void EnDaiku_Init(Actor* thisx, PlayState* play) {
|
|||
Collider_InitAndSetCylinder(play, &this->collider, &this->actor, &sCylinderInit);
|
||||
this->unk_278 = ENDAIKU_GET_FF(&this->actor);
|
||||
if (this->unk_278 == ENDAIKU_PARAMS_FF_3) {
|
||||
this->unk_288 = ENDAIKU_GET_FF00(&this->actor);
|
||||
this->unk_258 = SubS_GetPathByIndex(play, this->unk_288, 0x3F);
|
||||
this->pathIndex = ENDAIKU_GET_PATH_INDEX(&this->actor);
|
||||
this->path = SubS_GetPathByIndex(play, this->pathIndex, ENDAIKU_PATH_INDEX_NONE);
|
||||
} else if (this->unk_278 == ENDAIKU_PARAMS_FF_2) {
|
||||
this->unk_264 = -2000;
|
||||
}
|
||||
|
@ -134,8 +134,8 @@ void func_8094373C(EnDaiku* this, s32 arg1) {
|
|||
}
|
||||
|
||||
void func_809437C8(EnDaiku* this) {
|
||||
if ((this->unk_288 != -1) && (this->unk_258 != 0)) {
|
||||
if (!SubS_CopyPointFromPath(this->unk_258, this->unk_25C, &this->unk_26C)) {
|
||||
if ((this->pathIndex != PATH_INDEX_NONE) && (this->path != NULL)) {
|
||||
if (!SubS_CopyPointFromPath(this->path, this->unk_25C, &this->unk_26C)) {
|
||||
Actor_Kill(&this->actor);
|
||||
}
|
||||
}
|
||||
|
@ -208,9 +208,9 @@ void func_809438F8(EnDaiku* this, PlayState* play) {
|
|||
|
||||
xzDist = sqrtf(SQ(this->actor.world.pos.x - this->unk_26C.x) + SQ(this->actor.world.pos.z - this->unk_26C.z));
|
||||
yawDiff = fabsf(this->actor.world.rot.y - this->unk_282);
|
||||
if ((xzDist < 4.0f) && (this->unk_258 != NULL) && (yawDiff < 10.0f)) {
|
||||
if ((xzDist < 4.0f) && (this->path != NULL) && (yawDiff < 10.0f)) {
|
||||
this->unk_25C++;
|
||||
if (this->unk_25C >= this->unk_258->count) {
|
||||
if (this->unk_25C >= this->path->count) {
|
||||
this->unk_25C = 0;
|
||||
}
|
||||
|
||||
|
@ -221,6 +221,7 @@ void func_809438F8(EnDaiku* this, PlayState* play) {
|
|||
|
||||
if (this->unk_278 != ENDAIKU_PARAMS_FF_0) {
|
||||
s16 angle = ABS_ALT(BINANG_SUB(this->actor.yawTowardsPlayer, this->actor.world.rot.y));
|
||||
|
||||
this->unk_280 = this->actor.yawTowardsPlayer;
|
||||
if ((this->unk_278 == ENDAIKU_PARAMS_FF_1) || (this->unk_278 == ENDAIKU_PARAMS_FF_2) || (angle <= 0x2890)) {
|
||||
func_800B8614(&this->actor, play, 100.0f);
|
||||
|
|
|
@ -8,7 +8,9 @@ struct EnDaiku;
|
|||
typedef void (*EnDaikuActionFunc)(struct EnDaiku*, PlayState*);
|
||||
|
||||
#define ENDAIKU_GET_FF(thisx) ((thisx)->params & 0xFF)
|
||||
#define ENDAIKU_GET_FF00(thisx) (((thisx)->params >> 8) & 0xFF)
|
||||
#define ENDAIKU_GET_PATH_INDEX(thisx) (((thisx)->params >> 8) & 0xFF)
|
||||
|
||||
#define ENDAIKU_PATH_INDEX_NONE 0x3F
|
||||
|
||||
enum {
|
||||
/* 0x0 */ ENDAIKU_PARAMS_FF_0,
|
||||
|
@ -23,7 +25,7 @@ typedef struct EnDaiku {
|
|||
/* 0x188 */ Vec3s jointTable[17];
|
||||
/* 0x1EE */ Vec3s morphTable[17];
|
||||
/* 0x254 */ EnDaikuActionFunc actionFunc;
|
||||
/* 0x258 */ Path* unk_258;
|
||||
/* 0x258 */ Path* path;
|
||||
/* 0x25C */ s16 unk_25C;
|
||||
/* 0x25E */ s16 unk_25E;
|
||||
/* 0x260 */ s16 unk_260;
|
||||
|
@ -38,7 +40,7 @@ typedef struct EnDaiku {
|
|||
/* 0x280 */ s16 unk_280;
|
||||
/* 0x282 */ s16 unk_282;
|
||||
/* 0x284 */ f32 unk_284;
|
||||
/* 0x288 */ s16 unk_288;
|
||||
/* 0x288 */ s16 pathIndex;
|
||||
/* 0x28A */ s16 unk_28A;
|
||||
/* 0x28C */ s16 unk_28C;
|
||||
/* 0x28E */ UNK_TYPE1 unk_28E[0xE];
|
||||
|
|
|
@ -69,8 +69,8 @@ static ColliderCylinderInit sCylinderInit = {
|
|||
};
|
||||
|
||||
void func_80BE61D0(EnDaiku2* this) {
|
||||
if ((this->unk_27A != -1) && (this->unk_258 != 0)) {
|
||||
if (!SubS_CopyPointFromPath(this->unk_258, this->unk_25C, &this->unk_268)) {
|
||||
if ((this->pathIndex != PATH_INDEX_NONE) && (this->path != NULL)) {
|
||||
if (!SubS_CopyPointFromPath(this->path, this->unk_25C, &this->unk_268)) {
|
||||
Actor_Kill(&this->actor);
|
||||
}
|
||||
}
|
||||
|
@ -87,8 +87,8 @@ void EnDaiku2_Init(Actor* thisx, PlayState* play) {
|
|||
this->actor.targetMode = 0;
|
||||
Collider_InitAndSetCylinder(play, &this->collider, &this->actor, &sCylinderInit);
|
||||
this->unk_278 = ENDAIKU2_GET_7F(&this->actor);
|
||||
this->unk_27A = ENDAIKU2_GET_1F80(&this->actor);
|
||||
this->unk_258 = SubS_GetPathByIndex(play, this->unk_27A, 0x3F);
|
||||
this->pathIndex = ENDAIKU2_GET_PATH_INDEX(&this->actor);
|
||||
this->path = SubS_GetPathByIndex(play, this->pathIndex, ENDAIKU2_PATH_INDEX_NONE);
|
||||
this->unk_280 = ENDAIKU2_GET_8000(&this->actor);
|
||||
Actor_SetScale(&this->actor, 0.01f);
|
||||
if (!this->unk_280) {
|
||||
|
@ -100,7 +100,7 @@ void EnDaiku2_Init(Actor* thisx, PlayState* play) {
|
|||
if (this->unk_278 == ENDAIKU2_GET_7F_127) {
|
||||
this->unk_278 = ENDAIKU2_GET_7F_MINUS1;
|
||||
} else if (Flags_GetSwitch(play, this->unk_278)) {
|
||||
this->unk_25C = this->unk_258->count - 1;
|
||||
this->unk_25C = this->path->count - 1;
|
||||
func_80BE61D0(this);
|
||||
Math_Vec3f_Copy(&this->actor.world.pos, &this->unk_268);
|
||||
}
|
||||
|
@ -342,9 +342,9 @@ void func_80BE6D40(EnDaiku2* this, PlayState* play) {
|
|||
Math_ApproachF(&this->actor.world.pos.z, this->unk_268.z, 0.5f, fabsf(Math_CosS(this->actor.world.rot.y) * 6.0f));
|
||||
|
||||
if ((sqrtf(SQ(this->actor.world.pos.x - this->unk_268.x) + SQ(this->actor.world.pos.z - this->unk_268.z)) < 4.0f) &&
|
||||
(this->unk_258 != 0)) {
|
||||
(this->path != NULL)) {
|
||||
this->unk_25C++;
|
||||
if (this->unk_25C >= this->unk_258->count) {
|
||||
if (this->unk_25C >= this->path->count) {
|
||||
func_80BE6EB0(this);
|
||||
return;
|
||||
}
|
||||
|
@ -385,7 +385,7 @@ void func_80BE6EF0(EnDaiku2* this, PlayState* play) {
|
|||
fabsf(Math_CosS(this->actor.world.rot.y) * 4.0f));
|
||||
if ((sqrtf(SQ(this->actor.world.pos.x - this->unk_268.x) + SQ(this->actor.world.pos.z - this->unk_268.z)) <
|
||||
4.0f) &&
|
||||
(this->unk_258 != 0)) {
|
||||
(this->path != NULL)) {
|
||||
if (!func_80BE64C0(this, play)) {
|
||||
if (this->unk_276 != 3) {
|
||||
func_80BE6408(this, 3);
|
||||
|
@ -412,7 +412,7 @@ void func_80BE6EF0(EnDaiku2* this, PlayState* play) {
|
|||
Math_Vec3f_Copy(&sp40, &this->unk_268);
|
||||
var = this->unk_25C;
|
||||
this->unk_25C++;
|
||||
if (this->unk_25C < this->unk_258->count) {
|
||||
if (this->unk_25C < this->path->count) {
|
||||
func_80BE61D0(this);
|
||||
func_80BE6CFC(this);
|
||||
return;
|
||||
|
|
|
@ -8,9 +8,11 @@ struct EnDaiku2;
|
|||
typedef void (*EnDaiku2ActionFunc)(struct EnDaiku2*, PlayState*);
|
||||
|
||||
#define ENDAIKU2_GET_7F(thisx) ((thisx)->params & 0x7F)
|
||||
#define ENDAIKU2_GET_1F80(thisx) (((thisx)->params >> 7) & 0x3F)
|
||||
#define ENDAIKU2_GET_PATH_INDEX(thisx) (((thisx)->params >> 7) & 0x3F)
|
||||
#define ENDAIKU2_GET_8000(thisx) (((thisx)->params >> 15) & 0x1)
|
||||
|
||||
#define ENDAIKU2_PATH_INDEX_NONE 0x3F
|
||||
|
||||
enum {
|
||||
/* -1 */ ENDAIKU2_GET_7F_MINUS1 = -1,
|
||||
/* 0 */ ENDAIKU2_GET_7F_0,
|
||||
|
@ -35,7 +37,7 @@ typedef struct EnDaiku2 {
|
|||
/* 0x188 */ Vec3s jointTable[17];
|
||||
/* 0x1EE */ Vec3s morphTable[17];
|
||||
/* 0x254 */ EnDaiku2ActionFunc actionFunc;
|
||||
/* 0x258 */ Path* unk_258;
|
||||
/* 0x258 */ Path* path;
|
||||
/* 0x25C */ s16 unk_25C;
|
||||
/* 0x260 */ f32 unk_260;
|
||||
/* 0x264 */ f32 unk_264;
|
||||
|
@ -43,7 +45,7 @@ typedef struct EnDaiku2 {
|
|||
/* 0x274 */ s16 unk_274;
|
||||
/* 0x276 */ s16 unk_276;
|
||||
/* 0x278 */ s16 unk_278;
|
||||
/* 0x27A */ s16 unk_27A;
|
||||
/* 0x27A */ s16 pathIndex;
|
||||
/* 0x27C */ UNK_TYPE1 unk_27C[0x4];
|
||||
/* 0x280 */ s32 unk_280;
|
||||
/* 0x284 */ f32 unk_284;
|
||||
|
|
|
@ -1302,7 +1302,7 @@ void EnDg_Init(Actor* thisx, PlayState* play) {
|
|||
CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
|
||||
Actor_ProcessInitChain(&this->actor, sInitChain);
|
||||
|
||||
this->path = SubS_GetPathByIndex(play, ENDG_GET_PATH(&this->actor), 0x3F);
|
||||
this->path = SubS_GetPathByIndex(play, ENDG_GET_PATH_INDEX(&this->actor), ENDG_PATH_INDEX_NONE);
|
||||
Actor_SetScale(&this->actor, 0.0075f);
|
||||
this->actor.targetMode = 1;
|
||||
this->actor.gravity = -3.0f;
|
||||
|
|
|
@ -19,9 +19,11 @@ struct EnDg;
|
|||
typedef void (*EnDgActionFunc)(struct EnDg*, PlayState*);
|
||||
|
||||
#define ENDG_GET_INDEX(thisx) (((thisx)->params & 0x3E0) >> 5)
|
||||
#define ENDG_GET_PATH(thisx) (((thisx)->params & 0xFC00) >> 10)
|
||||
#define ENDG_GET_PATH_INDEX(thisx) (((thisx)->params & 0xFC00) >> 10)
|
||||
#define ENDG_PARAMS(path, index) ((path << 10) | (index << 5))
|
||||
|
||||
#define ENDG_PATH_INDEX_NONE 0x3F
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ ENDG_INDEX_RACETRACK_0,
|
||||
/* 1 */ ENDG_INDEX_RACETRACK_1,
|
||||
|
|
|
@ -394,7 +394,7 @@ void EnEgol_DestroyBlocks(EnEgol* this, PlayState* play, Vec3f pos1, Vec3f pos2)
|
|||
}
|
||||
|
||||
void EnEgol_GetWaypoint(EnEgol* this) {
|
||||
if ((this->pathIndex != -1) && (this->path != NULL) &&
|
||||
if ((this->pathIndex != PATH_INDEX_NONE) && (this->path != NULL) &&
|
||||
!SubS_CopyPointFromPath(this->path, this->waypoint, &this->waypointPos)) {
|
||||
Actor_Kill(&this->actor);
|
||||
}
|
||||
|
@ -426,9 +426,9 @@ void EnEgol_Init(Actor* thisx, PlayState* play) {
|
|||
Collider_InitAndSetJntSph(play, &this->eyeCollider, &this->actor, &sEyeJntSphInit, this->eyeElements);
|
||||
Collider_InitAndSetQuad(play, &this->laserCollider, &this->actor, &sLaserQuadInit);
|
||||
|
||||
this->pathIndex = EYEGORE_GET_PATH(&this->actor);
|
||||
if (this->pathIndex == 0x3F) {
|
||||
this->pathIndex = -1;
|
||||
this->pathIndex = EYEGORE_GET_PATH_INDEX(&this->actor);
|
||||
if (this->pathIndex == EYEGORE_PATH_INDEX_NONE) {
|
||||
this->pathIndex = PATH_INDEX_NONE;
|
||||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
}
|
||||
|
@ -445,7 +445,7 @@ void EnEgol_Init(Actor* thisx, PlayState* play) {
|
|||
this->minLaserRange = 200.0f;
|
||||
}
|
||||
|
||||
this->path = SubS_GetPathByIndex(play, this->pathIndex, 0x3F);
|
||||
this->path = SubS_GetPathByIndex(play, this->pathIndex, EYEGORE_PATH_INDEX_NONE);
|
||||
|
||||
EYEGORE_SET_SPH_DIM(this->eyeCollider.elements[0], 500, 0, 0, 26, 1.0f);
|
||||
|
||||
|
|
|
@ -8,10 +8,12 @@ struct EnEgol;
|
|||
|
||||
typedef void (*EnEgolActionFunc)(struct EnEgol*, PlayState*);
|
||||
|
||||
#define EYEGORE_GET_PATH(thisx) ((thisx)->params & 0x3F)
|
||||
#define EYEGORE_GET_PATH_INDEX(thisx) ((thisx)->params & 0x3F)
|
||||
#define EYEGORE_GET_SWITCH(thisx) (((thisx)->params >> 6) & 0x7F)
|
||||
|
||||
#define EYEGORE_PARAMS(switch, path) ((((switch) & 0x7F) << 6) | ((path) & 0x3F))
|
||||
#define EYEGORE_PATH_INDEX_NONE 0x3F
|
||||
|
||||
#define EYEGORE_PARAMS(switch, pathIndex) ((((switch) & 0x7F) << 6) | ((pathIndex) & 0x3F))
|
||||
|
||||
#define EYEGORE_EFFECT_COUNT 100
|
||||
|
||||
|
|
|
@ -166,13 +166,13 @@ void EnFamos_Init(Actor* thisx, PlayState* play) {
|
|||
s32 i;
|
||||
|
||||
Actor_ProcessInitChain(&this->actor, sInitChain);
|
||||
if (FAMOS_GET_PATH(thisx) != 0xFF) {
|
||||
path = &play->setupPathList[this->actor.params];
|
||||
if (FAMOS_GET_PATH_INDEX(&this->actor) != FAMOS_PATH_INDEX_NONE) {
|
||||
path = &play->setupPathList[FAMOS_GET_PATH_INDEX(&this->actor)];
|
||||
this->pathPoints = Lib_SegmentedToVirtual(path->points);
|
||||
this->pathNodeCount = path->count;
|
||||
if (this->pathNodeCount == 1) {
|
||||
this->pathCount = path->count;
|
||||
if (this->pathCount == 1) {
|
||||
this->pathPoints = NULL;
|
||||
this->pathNodeCount = 0;
|
||||
this->pathCount = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -365,15 +365,15 @@ void EnFamos_StillIdle(EnFamos* this, PlayState* play) {
|
|||
*/
|
||||
void EnFamos_SetupPathingIdle(EnFamos* this) {
|
||||
if (this->isCalm) {
|
||||
this->currentPathNode++;
|
||||
if (this->currentPathNode == this->pathNodeCount) {
|
||||
this->currentPathNode = 0;
|
||||
this->waypointIndex++;
|
||||
if (this->waypointIndex == this->pathCount) {
|
||||
this->waypointIndex = 0;
|
||||
}
|
||||
} else {
|
||||
this->isCalm = true;
|
||||
}
|
||||
|
||||
Math_Vec3s_ToVec3f(&this->targetDest, &this->pathPoints[this->currentPathNode]);
|
||||
Math_Vec3s_ToVec3f(&this->targetDest, &this->pathPoints[this->waypointIndex]);
|
||||
this->targetYaw = Actor_WorldYawTowardPoint(&this->actor, &this->targetDest);
|
||||
this->actionFunc = EnFamos_PathingIdle;
|
||||
this->actor.speed = 0.0f;
|
||||
|
|
|
@ -15,9 +15,11 @@ typedef struct EnFamosRock {
|
|||
/* 0x20 */ f32 scale;
|
||||
} EnFamosRock; // size = 0x24
|
||||
|
||||
#define FAMOS_GET_PATH(thisx) ((thisx)->params)
|
||||
#define FAMOS_GET_PATH_INDEX(thisx) ((thisx)->params)
|
||||
#define FAMOS_GET_AGGRO_DISTANCE(thisx) ((thisx)->shape.rot.x)
|
||||
|
||||
#define FAMOS_PATH_INDEX_NONE 0xFF
|
||||
|
||||
// stateTimer gets reused:
|
||||
// after spotting player, counts frames until first attack (8)
|
||||
// after lost aggro, measures frames looking around before returning to home (60)
|
||||
|
@ -33,8 +35,8 @@ typedef struct EnFamos {
|
|||
/* 0x1D0 */ EnFamosActionFunc actionFunc;
|
||||
/* 0x1D4 */ u8 animatedMaterialIndex;
|
||||
/* 0x1D5 */ u8 hasFinishedRotating; // stable up or down
|
||||
/* 0x1D6 */ u8 pathNodeCount;
|
||||
/* 0x1D7 */ u8 currentPathNode;
|
||||
/* 0x1D6 */ u8 pathCount;
|
||||
/* 0x1D7 */ u8 waypointIndex;
|
||||
/* 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
|
||||
|
|
|
@ -171,7 +171,7 @@ void func_809619D0(EnFu* this, PlayState* play) {
|
|||
}
|
||||
|
||||
for (i = 0; i < this->unk_542; i++) {
|
||||
path = &play->setupPathList[path->unk1];
|
||||
path = &play->setupPathList[path->additionalPathIndex];
|
||||
}
|
||||
|
||||
this->unk_520 = path->count;
|
||||
|
|
|
@ -191,8 +191,8 @@ void EnGe1_SetupPath(EnGe1* this, PlayState* play) {
|
|||
|
||||
this->curPointIndex = 0;
|
||||
|
||||
if (GERUDO_WHITE_GET_PATH(&this->picto.actor) != 0x3F) {
|
||||
this->path = &play->setupPathList[GERUDO_WHITE_GET_PATH(&this->picto.actor)];
|
||||
if (GERUDO_WHITE_GET_PATH_INDEX(&this->picto.actor) != GERUDO_WHITE_PATH_INDEX_NONE) {
|
||||
this->path = &play->setupPathList[GERUDO_WHITE_GET_PATH_INDEX(&this->picto.actor)];
|
||||
if (this->path != NULL) {
|
||||
point = Lib_SegmentedToVirtual(this->path->points);
|
||||
Math_Vec3s_ToVec3f(&this->picto.actor.world.pos, point);
|
||||
|
|
|
@ -6,7 +6,9 @@
|
|||
#include "objects/object_ge1/object_ge1.h"
|
||||
|
||||
#define GERUDO_WHITE_GET_TYPE(thisx) (((thisx)->params) & 0xF)
|
||||
#define GERUDO_WHITE_GET_PATH(thisx) ((((thisx)->params) & 0xFC00) >> 10)
|
||||
#define GERUDO_WHITE_GET_PATH_INDEX(thisx) ((((thisx)->params) & 0xFC00) >> 10)
|
||||
|
||||
#define GERUDO_WHITE_PATH_INDEX_NONE 0x3F
|
||||
|
||||
//! Only the first type is used
|
||||
typedef enum {
|
||||
|
|
|
@ -200,8 +200,8 @@ s32 EnGe2_LookForPlayer(PlayState* play, Actor* actor, Vec3f* pos, s16 yaw, s16
|
|||
* @return true if path is set up in reverse
|
||||
*/
|
||||
s32 EnGe2_SetupPath(EnGe2* this, PlayState* play) {
|
||||
if (GERUDO_PURPLE_GET_PATH(&this->picto.actor) != GERUDO_PURPLE_PATH_NONE) {
|
||||
this->path = &play->setupPathList[GERUDO_PURPLE_GET_PATH(&this->picto.actor)];
|
||||
if (GERUDO_PURPLE_GET_PATH_INDEX(&this->picto.actor) != GERUDO_PRUPLE_PATH_INDEX_NONE) {
|
||||
this->path = &play->setupPathList[GERUDO_PURPLE_GET_PATH_INDEX(&this->picto.actor)];
|
||||
if (this->path != NULL) {
|
||||
Path* path = this->path;
|
||||
Vec3s* points = Lib_SegmentedToVirtual(path->points);
|
||||
|
@ -228,14 +228,14 @@ void EnGe2_GetNextPath(EnGe2* this, PlayState* play) {
|
|||
Path* curPath;
|
||||
Path* nextPath;
|
||||
Vec3s* points;
|
||||
u8 unk1;
|
||||
u8 nextPathIndex;
|
||||
|
||||
this->curPointIndex = 0;
|
||||
|
||||
if (GERUDO_PURPLE_GET_PATH(&this->picto.actor) != GERUDO_PURPLE_PATH_NONE) {
|
||||
curPath = &play->setupPathList[GERUDO_PURPLE_GET_PATH(&this->picto.actor)];
|
||||
unk1 = curPath->unk1;
|
||||
nextPath = &play->setupPathList[unk1];
|
||||
if (GERUDO_PURPLE_GET_PATH_INDEX(&this->picto.actor) != GERUDO_PRUPLE_PATH_INDEX_NONE) {
|
||||
curPath = &play->setupPathList[GERUDO_PURPLE_GET_PATH_INDEX(&this->picto.actor)];
|
||||
nextPathIndex = curPath->additionalPathIndex;
|
||||
nextPath = &play->setupPathList[nextPathIndex];
|
||||
this->path = nextPath;
|
||||
points = Lib_SegmentedToVirtual(nextPath->points);
|
||||
this->picto.actor.world.pos.x = points[0].x;
|
||||
|
@ -252,8 +252,8 @@ void EnGe2_SetupBlownAwayPath(EnGe2* this, PlayState* play) {
|
|||
|
||||
this->curPointIndex = 0;
|
||||
|
||||
if (GERUDO_PURPLE_GET_PATH(&this->picto.actor) != GERUDO_PURPLE_PATH_NONE) {
|
||||
this->path = &play->setupPathList[GERUDO_PURPLE_GET_PATH(&this->picto.actor)];
|
||||
if (GERUDO_PURPLE_GET_PATH_INDEX(&this->picto.actor) != GERUDO_PRUPLE_PATH_INDEX_NONE) {
|
||||
this->path = &play->setupPathList[GERUDO_PURPLE_GET_PATH_INDEX(&this->picto.actor)];
|
||||
if (this->path != NULL) {
|
||||
points = Lib_SegmentedToVirtual(this->path->points);
|
||||
Math_Vec3s_ToVec3f(&this->picto.actor.world.pos, points);
|
||||
|
|
|
@ -11,12 +11,12 @@ typedef void (*EnGe2ActionFunc)(struct EnGe2*, PlayState*);
|
|||
|
||||
#define GERUDO_PURPLE_GET_EXIT(thisx) (((thisx)->params) & 0x1F) //!< Exit to send Player to when caught
|
||||
#define GERUDO_PURPLE_GET_TYPE(thisx) (((thisx)->params & 0xE0) >> 5)
|
||||
#define GERUDO_PURPLE_GET_PATH(thisx) ((((thisx)->params) & 0xFC00) >> 10)
|
||||
#define GERUDO_PURPLE_GET_PATH_INDEX(thisx) ((((thisx)->params) & 0xFC00) >> 10)
|
||||
|
||||
#define GERUDO_PURPLE_PARAMS(path, type, exit) (((path) & 0x1F) | (((type) & 7) << 5) | (((exit) & 0x3F) << 10))
|
||||
#define GERUDO_PURPLE_PARAMS(exit, type, pathIndex) (((exit) & 0x1F) | (((type) & 7) << 5) | (((pathIndex) & 0x3F) << 10))
|
||||
|
||||
#define GERUDO_PURPLE_EXIT_NONE 0x1F
|
||||
#define GERUDO_PURPLE_PATH_NONE 0x3F
|
||||
#define GERUDO_PRUPLE_PATH_INDEX_NONE 0x3F
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ GERUDO_PURPLE_TYPE_CUTSCENE,
|
||||
|
|
|
@ -183,14 +183,14 @@ void func_80B3B0A0(EnGg2* this, PlayState* play) {
|
|||
void func_80B3B120(EnGg2* this, PlayState* play) {
|
||||
Vec3s sp30;
|
||||
|
||||
if (this->unk_1D8 != NULL) {
|
||||
func_80B3B7E4(this->unk_1D8, this->unk_1DC, &this->actor.world.pos, &sp30);
|
||||
if (this->path != NULL) {
|
||||
func_80B3B7E4(this->path, this->unk_1DC, &this->actor.world.pos, &sp30);
|
||||
Math_SmoothStepToS(&this->actor.world.rot.y, sp30.y, 4, 0x3E8, 1);
|
||||
this->actor.shape.rot.y = this->actor.world.rot.y;
|
||||
Math_SmoothStepToS(&this->actor.shape.rot.x, sp30.x, 4, 0x3E8, 1);
|
||||
this->actor.world.rot.x = -this->actor.shape.rot.x;
|
||||
if (func_80B3B648(this, this->unk_1D8, this->unk_1DC) != 0) {
|
||||
if (this->unk_1DC >= (this->unk_1D8->count - 2)) {
|
||||
if (func_80B3B648(this, this->path, this->unk_1DC) != 0) {
|
||||
if (this->unk_1DC >= (this->path->count - 2)) {
|
||||
this->actionFunc = func_80B3AE60;
|
||||
this->actor.speed = 0.0f;
|
||||
} else {
|
||||
|
@ -227,15 +227,15 @@ void func_80B3B294(EnGg2* this, PlayState* play) {
|
|||
SET_WEEKEVENTREG(WEEKEVENTREG_20_10);
|
||||
}
|
||||
|
||||
if (this->unk_1D8 != NULL) {
|
||||
func_80B3B7E4(this->unk_1D8, this->unk_1DC, &this->actor.world.pos, &sp30);
|
||||
if (this->path != NULL) {
|
||||
func_80B3B7E4(this->path, this->unk_1DC, &this->actor.world.pos, &sp30);
|
||||
Math_SmoothStepToS(&this->actor.world.rot.y, sp30.y, 4, 0x3E8, 1);
|
||||
this->actor.shape.rot.y = this->actor.world.rot.y;
|
||||
Math_SmoothStepToS(&this->actor.shape.rot.x, sp30.x, 4, 0x3E8, 1);
|
||||
this->actor.world.rot.x = -this->actor.shape.rot.x;
|
||||
|
||||
if (func_80B3B648(this, this->unk_1D8, this->unk_1DC)) {
|
||||
if (this->unk_1DC < (this->unk_1D8->count - 1)) {
|
||||
if (func_80B3B648(this, this->path, this->unk_1DC)) {
|
||||
if (this->unk_1DC < (this->path->count - 1)) {
|
||||
this->unk_1DC++;
|
||||
} else {
|
||||
this->unk_2F1 = 1;
|
||||
|
@ -369,7 +369,7 @@ void EnGg2_Init(Actor* thisx, PlayState* play2) {
|
|||
this->actor.bgCheckFlags |= BGCHECKFLAG_PLAYER_400;
|
||||
SkelAnime_InitFlex(play, &this->skelAnime, &object_gg_Skel_00F6C0, &object_gg_Anim_00F578, this->jointTable,
|
||||
this->morphTable, 20);
|
||||
this->unk_1D8 = SubS_GetPathByIndex(play, ENGG2_GET_FC00(&this->actor), 0x3F);
|
||||
this->path = SubS_GetPathByIndex(play, ENGG2_GET_PATH_INDEX(&this->actor), ENGG2_PATH_INDEX_NONE);
|
||||
this->actor.flags &= ~ACTOR_FLAG_REACT_TO_LENS;
|
||||
this->unk_2F0 = 0;
|
||||
this->unk_2F1 = 0;
|
||||
|
|
|
@ -7,14 +7,16 @@ struct EnGg2;
|
|||
|
||||
typedef void (*EnGg2ActionFunc)(struct EnGg2*, PlayState*);
|
||||
|
||||
#define ENGG2_GET_FC00(thisx) (((thisx)->params & 0xFC00) >> 0xA)
|
||||
#define ENGG2_GET_PATH_INDEX(thisx) (((thisx)->params & 0xFC00) >> 0xA)
|
||||
|
||||
#define ENGG2_PATH_INDEX_NONE 0x3F
|
||||
|
||||
typedef struct EnGg2 {
|
||||
/* 0x000 */ Actor actor;
|
||||
/* 0x144 */ UNK_TYPE1 unk144[0x4C];
|
||||
/* 0x190 */ SkelAnime skelAnime;
|
||||
/* 0x1D4 */ EnGg2ActionFunc actionFunc;
|
||||
/* 0x1D8 */ Path* unk_1D8;
|
||||
/* 0x1D8 */ Path* path;
|
||||
/* 0x1DC */ s32 unk_1DC;
|
||||
/* 0x1E0 */ Vec3s unk_1E0;
|
||||
/* 0x1E6 */ Vec3s unk_1E6;
|
||||
|
|
|
@ -1025,7 +1025,7 @@ void EnGk_Init(Actor* thisx, PlayState* play) {
|
|||
Actor_Kill(&this->actor);
|
||||
} else {
|
||||
this->csId = this->actor.csId;
|
||||
this->path = SubS_GetPathByIndex(play, ENGK_GET_F0(&this->actor), 0xF);
|
||||
this->path = SubS_GetPathByIndex(play, ENGK_GET_PATH_INDEX(&this->actor), ENGK_PATH_INDEX_NONE);
|
||||
this->actionFunc = func_80B51760;
|
||||
}
|
||||
} else if (play->sceneId == SCENE_GORONRACE) {
|
||||
|
|
|
@ -8,9 +8,11 @@ struct EnGk;
|
|||
typedef void (*EnGkActionFunc)(struct EnGk*, PlayState*);
|
||||
|
||||
#define ENGK_GET_F(thisx) ((thisx)->params & 0xF)
|
||||
#define ENGK_GET_F0(thisx) (((thisx)->params & 0xF0) >> 4)
|
||||
#define ENGK_GET_PATH_INDEX(thisx) (((thisx)->params & 0xF0) >> 4)
|
||||
#define ENGK_GET_3F00(thisx) (((thisx)->params & 0x3F00) >> 8)
|
||||
|
||||
#define ENGK_PATH_INDEX_NONE 0xF
|
||||
|
||||
enum {
|
||||
/* 0 */ ENGK_F_0,
|
||||
/* 1 */ ENGK_F_1,
|
||||
|
|
|
@ -973,7 +973,7 @@ s32 func_8094F53C(EnGm* this, PlayState* play) {
|
|||
}
|
||||
|
||||
s32 func_8094F7D0(EnGm* this, PlayState* play, ScheduleOutput* scheduleOutput, u8 arg3, s16 arg4) {
|
||||
u8 sp4F = ENGM_GET_FF(&this->actor);
|
||||
u8 pathIndex = ENGM_GET_PATH_INDEX(&this->actor);
|
||||
Vec3s* sp48;
|
||||
Vec3f sp3C;
|
||||
Vec3f sp30;
|
||||
|
@ -985,7 +985,7 @@ s32 func_8094F7D0(EnGm* this, PlayState* play, ScheduleOutput* scheduleOutput, u
|
|||
actor = func_8094DEE0(this, play, arg3, arg4);
|
||||
|
||||
if (D_80951A0C[scheduleOutput->result] >= 0) {
|
||||
this->timePath = SubS_GetAdditionalPath(play, sp4F, D_80951A0C[scheduleOutput->result]);
|
||||
this->timePath = SubS_GetAdditionalPath(play, pathIndex, D_80951A0C[scheduleOutput->result]);
|
||||
}
|
||||
|
||||
if ((actor != NULL) && (actor->update != NULL)) {
|
||||
|
@ -1004,7 +1004,7 @@ s32 func_8094F7D0(EnGm* this, PlayState* play, ScheduleOutput* scheduleOutput, u
|
|||
|
||||
s32 func_8094F904(EnGm* this, PlayState* play, ScheduleOutput* scheduleOutput) {
|
||||
u16 sp56 = SCHEDULE_TIME_NOW;
|
||||
u8 sp55 = ENGM_GET_FF(&this->actor);
|
||||
u8 pathIndex = ENGM_GET_PATH_INDEX(&this->actor);
|
||||
EnDoor* door;
|
||||
Vec3s* sp4C;
|
||||
Vec3f sp40;
|
||||
|
@ -1016,7 +1016,7 @@ s32 func_8094F904(EnGm* this, PlayState* play, ScheduleOutput* scheduleOutput) {
|
|||
door = func_8094DF90(play, scheduleOutput->result);
|
||||
|
||||
if (D_80951A0C[scheduleOutput->result] >= 0) {
|
||||
this->timePath = SubS_GetAdditionalPath(play, sp55, D_80951A0C[scheduleOutput->result]);
|
||||
this->timePath = SubS_GetAdditionalPath(play, pathIndex, D_80951A0C[scheduleOutput->result]);
|
||||
}
|
||||
|
||||
if ((door != NULL) && (door->knobDoor.dyna.actor.update != NULL)) {
|
||||
|
@ -1051,14 +1051,14 @@ s32 func_8094F904(EnGm* this, PlayState* play, ScheduleOutput* scheduleOutput) {
|
|||
s32 func_8094FAC4(EnGm* this, PlayState* play, ScheduleOutput* scheduleOutput) {
|
||||
u16 sp2E = SCHEDULE_TIME_NOW;
|
||||
u16 phi_v1;
|
||||
u8 sp2B = ENGM_GET_FF(&this->actor);
|
||||
u8 pathIndex = ENGM_GET_PATH_INDEX(&this->actor);
|
||||
u16 tmp;
|
||||
s16 pad;
|
||||
s32 ret = false;
|
||||
|
||||
this->timePath = NULL;
|
||||
if (D_80951A0C[scheduleOutput->result] >= 0) {
|
||||
this->timePath = SubS_GetAdditionalPath(play, sp2B, D_80951A0C[scheduleOutput->result]);
|
||||
this->timePath = SubS_GetAdditionalPath(play, pathIndex, D_80951A0C[scheduleOutput->result]);
|
||||
}
|
||||
|
||||
if ((this->timePath != NULL) && (this->timePath->count < 3)) {
|
||||
|
@ -1152,7 +1152,7 @@ s32 func_8094FE10(EnGm* this, PlayState* play, ScheduleOutput* scheduleOutput) {
|
|||
|
||||
s32 func_8094FF04(EnGm* this, PlayState* play, ScheduleOutput* scheduleOutput) {
|
||||
static Vec3f D_80951D9C = { 64.0f, 0.0f, -122.0f };
|
||||
u8 sp4F = ENGM_GET_FF(&this->actor);
|
||||
u8 pathIndex = ENGM_GET_PATH_INDEX(&this->actor);
|
||||
Vec3s* sp48;
|
||||
Vec3f sp3C;
|
||||
Vec3f sp30;
|
||||
|
@ -1162,7 +1162,7 @@ s32 func_8094FF04(EnGm* this, PlayState* play, ScheduleOutput* scheduleOutput) {
|
|||
this->timePath = NULL;
|
||||
|
||||
if (D_80951A0C[scheduleOutput->result] >= 0) {
|
||||
this->timePath = SubS_GetAdditionalPath(play, sp4F, D_80951A0C[scheduleOutput->result]);
|
||||
this->timePath = SubS_GetAdditionalPath(play, pathIndex, D_80951A0C[scheduleOutput->result]);
|
||||
}
|
||||
|
||||
if (this->timePath != NULL) {
|
||||
|
|
|
@ -9,7 +9,7 @@ typedef void (*EnGmActionFunc)(struct EnGm*, PlayState*);
|
|||
typedef s32 (*EnGmUnkFunc)(struct EnGm*, PlayState*);
|
||||
typedef void (*EnGmUnkFunc2)(struct EnGm*, PlayState*);
|
||||
|
||||
#define ENGM_GET_FF(thisx) ((thisx)->params & 0xFF)
|
||||
#define ENGM_GET_PATH_INDEX(thisx) ((thisx)->params & 0xFF)
|
||||
|
||||
typedef struct EnGm {
|
||||
/* 0x000 */ Actor actor;
|
||||
|
|
|
@ -1883,7 +1883,8 @@ void EnGo_SetupSpectator(EnGo* this, PlayState* play) {
|
|||
*/
|
||||
void EnGo_SetupGatekeeper(EnGo* this, PlayState* play) {
|
||||
if (gSaveContext.save.day >= 2) {
|
||||
this->gatekeeperPath = SubS_GetDayDependentPath(play, ENGO_GET_PATH(&this->actor), 0xFF, &this->indexPathPoint);
|
||||
this->gatekeeperPath = SubS_GetDayDependentPath(play, ENGO_GET_PATH_INDEX(&this->actor), ENGO_PATH_INDEX_NONE,
|
||||
&this->indexPathPoint);
|
||||
if (this->gatekeeperPath != NULL) {
|
||||
this->indexPathPoint = 1;
|
||||
}
|
||||
|
|
|
@ -11,8 +11,9 @@ typedef s32 (*MsgEventFunc)(Actor*, PlayState*);
|
|||
|
||||
#define ENGO_GET_TYPE(thisx) (((thisx)->params & 0xF) & 0xFF)
|
||||
#define ENGO_GET_SUBTYPE(thisx) ((((thisx)->params & 0x70) >> 4) & 0xFF)
|
||||
#define ENGO_GET_PATH_INDEX(thisx) ((((thisx)->params & 0x7F80) >> 7) & 0xFF)
|
||||
|
||||
#define ENGO_GET_PATH(thisx) ((((thisx)->params & 0x7F80) >> 7) & 0xFF)
|
||||
#define ENGO_PATH_INDEX_NONE 0xFF
|
||||
|
||||
#define ENGO_SNOW_EFFECT_COUNT 16
|
||||
#define ENGO_OTHER_EFFECT_COUNT 16
|
||||
|
|
|
@ -87,7 +87,7 @@ void EnHiddenNuts_Init(Actor* thisx, PlayState* play) {
|
|||
|
||||
Collider_InitAndSetCylinder(play, &this->collider, &this->actor, &sCylinderInit);
|
||||
|
||||
this->unk_21E = ENHIDDENNUTS_GET_F80(&this->actor);
|
||||
this->pathIndex = ENHIDDENNUTS_GET_PATH_INDEX(&this->actor);
|
||||
this->switchFlag = ENHIDDENNUTS_GET_SWITCHFLAG(&this->actor);
|
||||
|
||||
if (this->switchFlag == 0x7F) {
|
||||
|
@ -99,12 +99,12 @@ void EnHiddenNuts_Init(Actor* thisx, PlayState* play) {
|
|||
return;
|
||||
}
|
||||
|
||||
if (this->unk_21E == 0x1F) {
|
||||
if (this->pathIndex == ENHIDDENNUTS_PATH_INDEX_NONE) {
|
||||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
}
|
||||
|
||||
this->path = SubS_GetPathByIndex(play, this->unk_21E, 0x3F);
|
||||
this->path = SubS_GetPathByIndex(play, this->pathIndex, ENHIDDENNUTS_PATH_INDEX_NONE_ALT);
|
||||
this->csId = this->actor.csId;
|
||||
func_801A5080(2);
|
||||
func_80BDB268(this);
|
||||
|
|
|
@ -8,7 +8,10 @@ struct EnHiddenNuts;
|
|||
typedef void (*EnHiddenNutsActionFunc)(struct EnHiddenNuts*, PlayState*);
|
||||
|
||||
#define ENHIDDENNUTS_GET_SWITCHFLAG(thisx) ((thisx)->params & 0x7F)
|
||||
#define ENHIDDENNUTS_GET_F80(thisx) (((thisx)->params >> 7) & 0x1F)
|
||||
#define ENHIDDENNUTS_GET_PATH_INDEX(thisx) (((thisx)->params >> 7) & 0x1F)
|
||||
|
||||
#define ENHIDDENNUTS_PATH_INDEX_NONE 0x1F
|
||||
#define ENHIDDENNUTS_PATH_INDEX_NONE_ALT 0x3F
|
||||
|
||||
typedef struct EnHiddenNuts {
|
||||
/* 0x000 */ Actor actor;
|
||||
|
@ -23,7 +26,7 @@ typedef struct EnHiddenNuts {
|
|||
/* 0x218 */ s16 unk_218;
|
||||
/* 0x21A */ s16 unk_21A;
|
||||
/* 0x21C */ s16 switchFlag;
|
||||
/* 0x21E */ s16 unk_21E;
|
||||
/* 0x21E */ s16 pathIndex;
|
||||
/* 0x220 */ s32 unk_220;
|
||||
/* 0x224 */ s16 unk_224;
|
||||
/* 0x226 */ s16 csId;
|
||||
|
|
|
@ -497,7 +497,7 @@ s32 func_80BF1B40(EnIg* this, PlayState* play) {
|
|||
}
|
||||
|
||||
s32 func_80BF1C44(EnIg* this, PlayState* play, ScheduleOutput* scheduleOutput, s32 arg3, s32 arg4) {
|
||||
u8 sp4F = ENIG_GET_FF(&this->actor);
|
||||
u8 pathIndex = ENIG_GET_PATH_INDEX(&this->actor);
|
||||
Vec3s* sp48;
|
||||
Vec3f sp3C;
|
||||
Vec3f sp30;
|
||||
|
@ -509,7 +509,7 @@ s32 func_80BF1C44(EnIg* this, PlayState* play, ScheduleOutput* scheduleOutput, s
|
|||
this->timePath = NULL;
|
||||
|
||||
if (D_80BF3318[scheduleOutput->result] >= 0) {
|
||||
this->timePath = SubS_GetAdditionalPath(play, sp4F, D_80BF3318[scheduleOutput->result]);
|
||||
this->timePath = SubS_GetAdditionalPath(play, pathIndex, D_80BF3318[scheduleOutput->result]);
|
||||
}
|
||||
|
||||
if ((sp2C != NULL) && (sp2C->update != NULL)) {
|
||||
|
@ -541,7 +541,7 @@ s32 func_80BF1D78(EnIg* this, PlayState* play, ScheduleOutput* scheduleOutput) {
|
|||
|
||||
s32 func_80BF1DF4(EnIg* this, PlayState* play, ScheduleOutput* scheduleOutput) {
|
||||
u16 sp56 = SCHEDULE_TIME_NOW;
|
||||
u8 sp55 = ENIG_GET_FF(&this->actor);
|
||||
u8 pathIndex = ENIG_GET_PATH_INDEX(&this->actor);
|
||||
EnDoor* door;
|
||||
Vec3s* sp4C;
|
||||
Vec3f sp40;
|
||||
|
@ -553,7 +553,7 @@ s32 func_80BF1DF4(EnIg* this, PlayState* play, ScheduleOutput* scheduleOutput) {
|
|||
door = func_80BF1200(play, scheduleOutput->result);
|
||||
|
||||
if (D_80BF3318[scheduleOutput->result] >= 0) {
|
||||
this->timePath = SubS_GetAdditionalPath(play, sp55, D_80BF3318[scheduleOutput->result]);
|
||||
this->timePath = SubS_GetAdditionalPath(play, pathIndex, D_80BF3318[scheduleOutput->result]);
|
||||
}
|
||||
|
||||
if ((door != NULL) && (door->knobDoor.dyna.actor.update != NULL)) {
|
||||
|
@ -587,7 +587,7 @@ s32 func_80BF1DF4(EnIg* this, PlayState* play, ScheduleOutput* scheduleOutput) {
|
|||
s32 func_80BF1FA8(EnIg* this, PlayState* play, ScheduleOutput* scheduleOutput) {
|
||||
u16 sp2E = SCHEDULE_TIME_NOW;
|
||||
u16 phi_v1;
|
||||
u8 sp2B = ENIG_GET_FF(&this->actor);
|
||||
u8 pathIndex = ENIG_GET_PATH_INDEX(&this->actor);
|
||||
u16 tmp;
|
||||
s16 pad;
|
||||
s32 ret = false;
|
||||
|
@ -595,7 +595,7 @@ s32 func_80BF1FA8(EnIg* this, PlayState* play, ScheduleOutput* scheduleOutput) {
|
|||
this->timePath = NULL;
|
||||
|
||||
if (D_80BF3318[scheduleOutput->result] >= 0) {
|
||||
this->timePath = SubS_GetAdditionalPath(play, sp2B, D_80BF3318[scheduleOutput->result]);
|
||||
this->timePath = SubS_GetAdditionalPath(play, pathIndex, D_80BF3318[scheduleOutput->result]);
|
||||
}
|
||||
|
||||
if ((this->timePath != NULL) && (this->timePath->count < 3)) {
|
||||
|
@ -635,7 +635,7 @@ s32 func_80BF1FA8(EnIg* this, PlayState* play, ScheduleOutput* scheduleOutput) {
|
|||
}
|
||||
|
||||
s32 func_80BF219C(EnIg* this, PlayState* play, ScheduleOutput* scheduleOutput) {
|
||||
u8 sp4F = ENIG_GET_FF(&this->actor);
|
||||
u8 pathIndex = ENIG_GET_PATH_INDEX(&this->actor);
|
||||
Vec3f sp40;
|
||||
Vec3f sp34;
|
||||
Vec3s* sp30;
|
||||
|
@ -645,7 +645,7 @@ s32 func_80BF219C(EnIg* this, PlayState* play, ScheduleOutput* scheduleOutput) {
|
|||
this->timePath = NULL;
|
||||
|
||||
if (D_80BF3318[scheduleOutput->result] >= 0) {
|
||||
this->timePath = SubS_GetAdditionalPath(play, sp4F, D_80BF3318[scheduleOutput->result]);
|
||||
this->timePath = SubS_GetAdditionalPath(play, pathIndex, D_80BF3318[scheduleOutput->result]);
|
||||
}
|
||||
|
||||
if ((this->timePath != 0) && (this->timePath->count >= 2)) {
|
||||
|
|
|
@ -9,7 +9,7 @@ typedef void (*EnIgActionFunc)(struct EnIg*, PlayState*);
|
|||
typedef s32 (*EnIgUnkFunc)(struct EnIg*, PlayState*);
|
||||
typedef void (*EnIgUnkFunc2)(struct EnIg*, PlayState*);
|
||||
|
||||
#define ENIG_GET_FF(thisx) ((thisx)->params & 0xFF)
|
||||
#define ENIG_GET_PATH_INDEX(thisx) ((thisx)->params & 0xFF)
|
||||
|
||||
typedef struct EnIg {
|
||||
/* 0x000 */ Actor actor;
|
||||
|
|
|
@ -274,10 +274,10 @@ void EnIn_DoNothing(EnIn* this, PlayState* play) {
|
|||
}
|
||||
|
||||
void func_808F3618(EnIn* this, PlayState* play) {
|
||||
if (ENIN_GET_PATH(&this->actor) != 0x3F) {
|
||||
if (ENIN_GET_PATH_INDEX(&this->actor) != ENIN_PATH_INDEX_NONE) {
|
||||
EnIn_ChangeAnim(&this->skelAnime, ENIN_ANIM_9);
|
||||
}
|
||||
if (ENIN_GET_PATH(&this->actor) != 0x3F) {
|
||||
if (ENIN_GET_PATH_INDEX(&this->actor) != ENIN_PATH_INDEX_NONE) {
|
||||
this->actionFunc = func_808F3690;
|
||||
} else {
|
||||
this->actionFunc = EnIn_DoNothing;
|
||||
|
@ -1517,7 +1517,7 @@ void EnIn_Init(Actor* thisx, PlayState* play) {
|
|||
Collider_SetJntSph(play, &this->colliderJntSph, &this->actor, &sJntSphInit, &this->colliderJntSphElement);
|
||||
Actor_SetScale(&this->actor, 0.01f);
|
||||
this->actor.gravity = -4.0f;
|
||||
this->path = SubS_GetPathByIndex(play, ENIN_GET_PATH(&this->actor), 0x3F);
|
||||
this->path = SubS_GetPathByIndex(play, ENIN_GET_PATH_INDEX(&this->actor), ENIN_PATH_INDEX_NONE);
|
||||
this->unk23D = 0;
|
||||
if ((type == ENIN_YELLOW_SHIRT) || (type == ENIN_BLUE_SHIRT)) {
|
||||
if ((GET_WEEKEVENTREG_HORSE_RACE_STATE == WEEKEVENTREG_HORSE_RACE_STATE_2) ||
|
||||
|
|
|
@ -37,7 +37,9 @@ typedef enum {
|
|||
} EnInAnimation;
|
||||
|
||||
#define ENIN_GET_TYPE(thisx) ((thisx)->params & 0x1FF)
|
||||
#define ENIN_GET_PATH(thisx) (((thisx)->params & 0x7E00) >> 9) // Only used with ENIN_UNK_TYPE
|
||||
#define ENIN_GET_PATH_INDEX(thisx) (((thisx)->params & 0x7E00) >> 9) // Only used with ENIN_UNK_TYPE
|
||||
|
||||
#define ENIN_PATH_INDEX_NONE 0x3F
|
||||
|
||||
typedef struct EnIn {
|
||||
/* 0x000 */ Actor actor;
|
||||
|
|
|
@ -957,7 +957,7 @@ void EnJg_Init(Actor* thisx, PlayState* play) {
|
|||
this->actionFunc = EnJg_LullabyIntroCutsceneAction;
|
||||
} else {
|
||||
// This is the elder that appears in Mountain Village or the Path to Goron Village in winter.
|
||||
this->path = SubS_GetPathByIndex(play, EN_JG_GET_PATH(thisx), 0x3F);
|
||||
this->path = SubS_GetPathByIndex(play, EN_JG_GET_PATH_INDEX(thisx), EN_JG_PATH_INDEX_NONE);
|
||||
this->animIndex = EN_JG_ANIM_SURPRISE_START;
|
||||
this->action = EN_JG_ACTION_SPAWNING;
|
||||
this->freezeTimer = 1000;
|
||||
|
|
|
@ -5,7 +5,9 @@
|
|||
#include "objects/object_jg/object_jg.h"
|
||||
|
||||
#define EN_JG_IS_IN_GORON_SHRINE(thisx) ((thisx)->params & 0x1)
|
||||
#define EN_JG_GET_PATH(thisx) (((thisx)->params & 0xFC00) >> 10)
|
||||
#define EN_JG_GET_PATH_INDEX(thisx) (((thisx)->params & 0xFC00) >> 10)
|
||||
|
||||
#define EN_JG_PATH_INDEX_NONE 0x3F
|
||||
|
||||
struct EnJg;
|
||||
|
||||
|
|
|
@ -119,7 +119,7 @@ void func_80C13A2C(EnJgameTsn* this, PlayState* play) {
|
|||
this->unk_1D8[i].points = Lib_SegmentedToVirtual(path->points);
|
||||
this->unk_1D8[i].count = path->count;
|
||||
|
||||
path = &play->setupPathList[path->unk1];
|
||||
path = &play->setupPathList[path->additionalPathIndex];
|
||||
if (path == NULL) {
|
||||
Actor_Kill(&this->actor);
|
||||
}
|
||||
|
@ -128,7 +128,7 @@ void func_80C13A2C(EnJgameTsn* this, PlayState* play) {
|
|||
this->unk_1F8.points = Lib_SegmentedToVirtual(path->points);
|
||||
this->unk_1F8.count = path->count;
|
||||
|
||||
path = &play->setupPathList[path->unk1];
|
||||
path = &play->setupPathList[path->additionalPathIndex];
|
||||
if (path == NULL) {
|
||||
Actor_Kill(&this->actor);
|
||||
}
|
||||
|
|
|
@ -194,7 +194,7 @@ s32 func_80968B8C(EnJs* this, PlayState* play) {
|
|||
f32 sp18 = 0.0f;
|
||||
Vec3s* points;
|
||||
|
||||
if (pathIndex != 0x3F) {
|
||||
if (pathIndex != ENJS_PATH_INDEX_NONE) {
|
||||
this->path = &play->setupPathList[pathIndex];
|
||||
if (this->path != NULL) {
|
||||
path = this->path;
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
#define ENJS_GET_PATH_INDEX(thisx) (((thisx)->params & 0xFC00) >> 10)
|
||||
#define ENJS_GET_EXIT_INDEX(thisx) (((thisx)->params & 0x3F0) >> 4)
|
||||
|
||||
#define ENJS_PATH_INDEX_NONE 0x3F
|
||||
|
||||
struct EnJs;
|
||||
|
||||
typedef void (*EnJsActionFunc)(struct EnJs*, PlayState*);
|
||||
|
|
|
@ -112,7 +112,7 @@ void EnLookNuts_Init(Actor* thisx, PlayState* play) {
|
|||
this->actor.targetMode = 1;
|
||||
Collider_InitAndSetCylinder(play, &this->collider, &this->actor, &sCylinderInit);
|
||||
this->actor.flags |= ACTOR_FLAG_CANT_LOCK_ON;
|
||||
this->pathLocation = LOOKNUTS_GET_PATROL_LOCATION(&this->actor);
|
||||
this->pathIndex = LOOKNUTS_GET_PATH_INDEX(&this->actor);
|
||||
this->switchFlag = LOOKNUTS_GET_SCENE_FLAG(&this->actor);
|
||||
this->spawnIndex = LOOKNUTS_GET_SPAWN_INDEX(&this->actor);
|
||||
|
||||
|
@ -123,7 +123,7 @@ void EnLookNuts_Init(Actor* thisx, PlayState* play) {
|
|||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
}
|
||||
if (this->pathLocation == 0x1F) {
|
||||
if (this->pathIndex == LOOKNUTS_PATH_INDEX_NONE) {
|
||||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
}
|
||||
|
@ -165,17 +165,17 @@ void EnLookNuts_Patrol(EnLookNuts* this, PlayState* play) {
|
|||
return;
|
||||
}
|
||||
|
||||
this->path = SubS_GetPathByIndex(play, this->pathLocation, 0x1F);
|
||||
this->path = SubS_GetPathByIndex(play, this->pathIndex, LOOKNUTS_PATH_INDEX_NONE);
|
||||
if (this->path != NULL) {
|
||||
sp34 = SubS_GetDistSqAndOrientPath(this->path, this->currentPathIndex, &this->actor.world.pos, &sp30);
|
||||
sp34 = SubS_GetDistSqAndOrientPath(this->path, this->waypointIndex, &this->actor.world.pos, &sp30);
|
||||
}
|
||||
|
||||
//! @bug sp30 is uninitialised if path == NULL. Fix by enclosing everything in the path NULL check.
|
||||
if (sp30 < 10.0f) {
|
||||
if (this->path != NULL) {
|
||||
this->currentPathIndex++;
|
||||
if (this->currentPathIndex >= this->path->count) {
|
||||
this->currentPathIndex = 0;
|
||||
this->waypointIndex++;
|
||||
if (this->waypointIndex >= this->path->count) {
|
||||
this->waypointIndex = 0;
|
||||
}
|
||||
if (Rand_ZeroOne() < 0.6f) {
|
||||
EnLookNuts_SetupStandAndWait(this);
|
||||
|
|
|
@ -10,7 +10,9 @@ typedef void (*EnLookNutsActionFunc)(struct EnLookNuts*, PlayState*);
|
|||
|
||||
#define LOOKNUTS_GET_SPAWN_INDEX(thisx) (((thisx)->params >> 0xC) & 0xF)
|
||||
#define LOOKNUTS_GET_SCENE_FLAG(thisx) ((thisx)->params & 0x7F)
|
||||
#define LOOKNUTS_GET_PATROL_LOCATION(thisx) (((thisx)->params >> 0x7) & 0x1F)
|
||||
#define LOOKNUTS_GET_PATH_INDEX(thisx) (((thisx)->params >> 0x7) & 0x1F)
|
||||
|
||||
#define LOOKNUTS_PATH_INDEX_NONE 0x1F
|
||||
|
||||
typedef struct EnLookNuts {
|
||||
/* 0x000 */ Actor actor;
|
||||
|
@ -19,13 +21,13 @@ typedef struct EnLookNuts {
|
|||
/* 0x1CA */ Vec3s morphTable[DEKU_PALACE_GUARD_LIMB_MAX];
|
||||
/* 0x20C */ EnLookNutsActionFunc actionFunc;
|
||||
/* 0x210 */ Path *path;
|
||||
/* 0x214 */ s16 currentPathIndex; // Index for the point where the deku guard is in its path
|
||||
/* 0x214 */ s16 waypointIndex; // Index for the point where the deku guard is in its path
|
||||
/* 0x216 */ s16 eyeState;
|
||||
/* 0x218 */ s16 blinkTimer;
|
||||
/* 0x21A */ s16 eventTimer; // Timer to trigger when another event within the actor will happen
|
||||
/* 0x21C */ s16 state;
|
||||
/* 0x21E */ s16 switchFlag;
|
||||
/* 0x220 */ s16 pathLocation; // Determines path that a guard will patrol
|
||||
/* 0x220 */ s16 pathIndex; // Determines path that a guard will patrol
|
||||
/* 0x222 */ s16 isPlayerDetected;
|
||||
/* 0x224 */ s16 waitTimer; // Timer for how long the deku guard will take a break for
|
||||
/* 0x226 */ s16 spawnIndex;
|
||||
|
|
|
@ -163,9 +163,9 @@ void EnMa4_InitPath(EnMa4* this, PlayState* play) {
|
|||
Path* path;
|
||||
Vec3f nextPoint;
|
||||
|
||||
path = &play->setupPathList[(this->actor.params & 0xFF00) >> 8];
|
||||
path = &play->setupPathList[ENMA_GET_PATH_INDEX(&this->actor)];
|
||||
this->pathPoints = Lib_SegmentedToVirtual(path->points);
|
||||
this->pathIndex = 0;
|
||||
this->waypointIndex = 0;
|
||||
this->pathPointsCount = path->count;
|
||||
|
||||
this->actor.home.pos.x = this->pathPoints[0].x;
|
||||
|
@ -272,9 +272,9 @@ void EnMa4_RunInCircles(EnMa4* this, PlayState* play) {
|
|||
Actor_PlaySfx(&this->actor, NA_SE_EV_ROMANI_BOW_FLICK);
|
||||
}
|
||||
|
||||
sp34.x = this->pathPoints[this->pathIndex].x;
|
||||
sp34.y = this->pathPoints[this->pathIndex].y;
|
||||
sp34.z = this->pathPoints[this->pathIndex].z;
|
||||
sp34.x = this->pathPoints[this->waypointIndex].x;
|
||||
sp34.y = this->pathPoints[this->waypointIndex].y;
|
||||
sp34.z = this->pathPoints[this->waypointIndex].z;
|
||||
sp2E = Math_Vec3f_Yaw(&this->actor.world.pos, &sp34);
|
||||
if (Math_Vec3f_DistXZ(&this->actor.world.pos, &sp34) > 50.0f) {
|
||||
Math_SmoothStepToS(&this->actor.world.rot.y, sp2E, 10, 0x3000, 0x100);
|
||||
|
@ -291,10 +291,10 @@ void EnMa4_RunInCircles(EnMa4* this, PlayState* play) {
|
|||
}
|
||||
}
|
||||
|
||||
if (this->pathIndex < (this->pathPointsCount - 1)) {
|
||||
this->pathIndex++;
|
||||
if (this->waypointIndex < (this->pathPointsCount - 1)) {
|
||||
this->waypointIndex++;
|
||||
} else {
|
||||
this->pathIndex = 0;
|
||||
this->waypointIndex = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -8,6 +8,8 @@ struct EnMa4;
|
|||
|
||||
typedef void (*EnMa4ActionFunc)(struct EnMa4*, PlayState*);
|
||||
|
||||
#define ENMA_GET_PATH_INDEX(thisx) (((thisx)->params & 0xFF00) >> 8)
|
||||
|
||||
typedef struct EnMa4 {
|
||||
/* 0x000 */ Actor actor;
|
||||
/* 0x144 */ SkelAnime skelAnime;
|
||||
|
@ -19,7 +21,7 @@ typedef struct EnMa4 {
|
|||
/* 0x28E */ UNK_TYPE1 unk28E[0x6];
|
||||
/* 0x294 */ Vec3s morphTable[ROMANI_LIMB_MAX];
|
||||
/* 0x31E */ UNK_TYPE1 unk31E[0x6];
|
||||
/* 0x324 */ s16 pathIndex;
|
||||
/* 0x324 */ s16 waypointIndex;
|
||||
/* 0x326 */ s16 pathPointsCount;
|
||||
/* 0x328 */ UNK_TYPE1 unk_328[0x2];
|
||||
/* 0x32A */ s16 blinkTimer;
|
||||
|
|
|
@ -167,9 +167,9 @@ void EnPamera_Init(Actor* thisx, PlayState* play) {
|
|||
}
|
||||
func_80BD8700(this);
|
||||
} else {
|
||||
this->pathIndex = this->pathPointsCount - 1;
|
||||
Math_Vec3s_ToVec3f(&this->actor.world.pos, &this->pathPoints[this->pathIndex]);
|
||||
Math_Vec3s_ToVec3f(&sp44, &this->pathPoints[this->pathIndex - 1]);
|
||||
this->waypointIndex = this->pathCount - 1;
|
||||
Math_Vec3s_ToVec3f(&this->actor.world.pos, &this->pathPoints[this->waypointIndex]);
|
||||
Math_Vec3s_ToVec3f(&sp44, &this->pathPoints[this->waypointIndex - 1]);
|
||||
this->actor.world.rot.y = this->actor.shape.rot.y = Math_Vec3f_Yaw(&sp44, &this->actor.world.pos);
|
||||
func_80BD8CCC(this);
|
||||
}
|
||||
|
@ -195,19 +195,19 @@ s32 func_80BD84F0(EnPamera* this, PlayState* play) {
|
|||
}
|
||||
|
||||
void func_80BD8588(EnPamera* this, PlayState* play) {
|
||||
Path* path = &play->setupPathList[((this->actor.params & 0xFF0) >> 4)];
|
||||
Path* path = &play->setupPathList[ENPAMERA_GET_PATH_INDEX(&this->actor)];
|
||||
Vec3f sp28;
|
||||
|
||||
if (path == NULL) {
|
||||
Actor_Kill(&this->actor);
|
||||
}
|
||||
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_61_04)) {
|
||||
path = &play->setupPathList[path->unk1];
|
||||
path = &play->setupPathList[path->additionalPathIndex];
|
||||
}
|
||||
this->pathPoints = Lib_SegmentedToVirtual(path->points);
|
||||
this->pathIndex = 0;
|
||||
this->pathPointsCount = path->count;
|
||||
this->pathId = path->unk1;
|
||||
this->waypointIndex = 0;
|
||||
this->pathCount = path->count;
|
||||
this->additionalPathIndex = path->additionalPathIndex;
|
||||
Math_Vec3s_ToVec3f(&sp28, this->pathPoints);
|
||||
this->actor.world.rot.y = this->actor.shape.rot.y = Math_Vec3f_Yaw(&this->actor.world.pos, &sp28);
|
||||
}
|
||||
|
@ -323,15 +323,15 @@ void func_80BD8B70(EnPamera* this, PlayState* play) {
|
|||
Vec3f vec;
|
||||
s16 sp32;
|
||||
|
||||
vec.x = this->pathPoints[this->pathIndex].x;
|
||||
vec.y = this->pathPoints[this->pathIndex].y;
|
||||
vec.z = this->pathPoints[this->pathIndex].z;
|
||||
vec.x = this->pathPoints[this->waypointIndex].x;
|
||||
vec.y = this->pathPoints[this->waypointIndex].y;
|
||||
vec.z = this->pathPoints[this->waypointIndex].z;
|
||||
sp32 = Math_Vec3f_Yaw(&this->actor.world.pos, &vec);
|
||||
if (Math_Vec3f_StepToXZ(&this->actor.world.pos, &vec, this->actor.speed) > 10.0f) {
|
||||
Math_SmoothStepToS(&this->actor.shape.rot.y, sp32, 0xA, 0x3000, 0x100);
|
||||
this->actor.world.rot.y = this->actor.shape.rot.y;
|
||||
} else if (this->pathIndex < (this->pathPointsCount - 1)) {
|
||||
this->pathIndex++;
|
||||
} else if (this->waypointIndex < (this->pathCount - 1)) {
|
||||
this->waypointIndex++;
|
||||
} else {
|
||||
func_80BD8CCC(this);
|
||||
}
|
||||
|
@ -356,8 +356,8 @@ void func_80BD8D1C(EnPamera* this, PlayState* play) {
|
|||
}
|
||||
|
||||
void func_80BD8D80(EnPamera* this) {
|
||||
if (this->pathIndex > 0) {
|
||||
this->pathIndex--;
|
||||
if (this->waypointIndex > 0) {
|
||||
this->waypointIndex--;
|
||||
}
|
||||
this->actor.gravity = -2.0f;
|
||||
this->actionFunc = func_80BD8DB0;
|
||||
|
@ -367,15 +367,15 @@ void func_80BD8DB0(EnPamera* this, PlayState* play) {
|
|||
Vec3f vec;
|
||||
s16 sp32;
|
||||
|
||||
vec.x = this->pathPoints[this->pathIndex].x;
|
||||
vec.y = this->pathPoints[this->pathIndex].y;
|
||||
vec.z = this->pathPoints[this->pathIndex].z;
|
||||
vec.x = this->pathPoints[this->waypointIndex].x;
|
||||
vec.y = this->pathPoints[this->waypointIndex].y;
|
||||
vec.z = this->pathPoints[this->waypointIndex].z;
|
||||
sp32 = Math_Vec3f_Yaw(&this->actor.world.pos, &vec);
|
||||
if (Math_Vec3f_StepToXZ(&this->actor.world.pos, &vec, this->actor.speed) > 10.0f) {
|
||||
Math_SmoothStepToS(&this->actor.shape.rot.y, sp32, 0xA, 0x3000, 0x100);
|
||||
this->actor.world.rot.y = this->actor.shape.rot.y;
|
||||
} else if (this->pathIndex > 0) {
|
||||
this->pathIndex--;
|
||||
} else if (this->waypointIndex > 0) {
|
||||
this->waypointIndex--;
|
||||
} else {
|
||||
func_80BD9338(this, play);
|
||||
func_80BD8A38(this);
|
||||
|
@ -404,9 +404,9 @@ void func_80BD8FF0(EnPamera* this) {
|
|||
Vec3f pameraPos;
|
||||
s16 pameraYaw;
|
||||
|
||||
this->pathIndex = this->pathPointsCount - 1;
|
||||
Math_Vec3s_ToVec3f(&this->actor.world.pos, &this->pathPoints[this->pathPointsCount - 1]);
|
||||
Math_Vec3s_ToVec3f(&pameraPos, &this->pathPoints[this->pathPointsCount - 2]);
|
||||
this->waypointIndex = this->pathCount - 1;
|
||||
Math_Vec3s_ToVec3f(&this->actor.world.pos, &this->pathPoints[this->pathCount - 1]);
|
||||
Math_Vec3s_ToVec3f(&pameraPos, &this->pathPoints[this->pathCount - 2]);
|
||||
pameraYaw = Math_Vec3f_Yaw(&pameraPos, &this->actor.world.pos);
|
||||
this->actor.shape.rot.y = pameraYaw;
|
||||
this->actor.world.rot.y = pameraYaw;
|
||||
|
@ -422,7 +422,7 @@ void func_80BD90AC(EnPamera* this, PlayState* play) {
|
|||
|
||||
if (Player_GetMask(play) != PLAYER_MASK_STONE && (this->actionFunc != func_80BD8758) &&
|
||||
(this->actionFunc != func_80BD8964) && (this->actionFunc != func_80BD8A7C) &&
|
||||
(this->actionFunc != func_80BD8F60) && ((this->actionFunc != func_80BD8B70) || (this->pathIndex != 0)) &&
|
||||
(this->actionFunc != func_80BD8F60) && ((this->actionFunc != func_80BD8B70) || (this->waypointIndex != 0)) &&
|
||||
((this->actionFunc != func_80BD8DB0) || (this->actor.speed != 3.0f)) &&
|
||||
((this->actor.xzDistToPlayer < 150.0f) ||
|
||||
((this->actionFunc == func_80BD909C) &&
|
||||
|
@ -456,14 +456,14 @@ s32 func_80BD9234(EnPamera* this, PlayState* play) {
|
|||
|
||||
void func_80BD92D0(EnPamera* this, PlayState* play) {
|
||||
Path* path;
|
||||
s32 pathId = this->pathId;
|
||||
s32 pathIndex = this->additionalPathIndex;
|
||||
|
||||
path = &play->setupPathList[pathId];
|
||||
if (pathId >= 0) {
|
||||
path = &play->setupPathList[pathIndex];
|
||||
if (pathIndex >= 0) {
|
||||
this->pathPoints = Lib_SegmentedToVirtual(path->points);
|
||||
this->pathIndex = 0;
|
||||
this->pathPointsCount = path->count;
|
||||
this->pathId = path->unk1;
|
||||
this->waypointIndex = 0;
|
||||
this->pathCount = path->count;
|
||||
this->additionalPathIndex = path->additionalPathIndex;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -9,6 +9,8 @@ struct EnPamera;
|
|||
typedef void (*EnPameraActionFunc)(struct EnPamera*, PlayState*);
|
||||
typedef void (*EnPameraSetupFunc)(struct EnPamera*, PlayState*);
|
||||
|
||||
#define ENPAMERA_GET_PATH_INDEX(thisx) (((thisx)->params & 0xFF0) >> 4)
|
||||
|
||||
typedef struct EnPamera {
|
||||
/* 0x000 */ Actor actor;
|
||||
/* 0x144 */ ColliderCylinder collider;
|
||||
|
@ -16,9 +18,9 @@ typedef struct EnPamera {
|
|||
/* 0x1D4 */ EnPameraActionFunc actionFunc;
|
||||
/* 0x1D8 */ EnPameraSetupFunc setupFunc;
|
||||
/* 0x1DC */ Vec3s* pathPoints;
|
||||
/* 0x1E0 */ s32 pathIndex;
|
||||
/* 0x1E4 */ s32 pathPointsCount;
|
||||
/* 0x1E8 */ s32 pathId;
|
||||
/* 0x1E0 */ s32 waypointIndex;
|
||||
/* 0x1E4 */ s32 pathCount;
|
||||
/* 0x1E8 */ s32 additionalPathIndex;
|
||||
/* 0x1EC */ s32 unk_1EC;
|
||||
/* 0x1F0 */ Vec3s jointTable[PAMELA_LIMB_MAX];
|
||||
/* 0x27A */ Vec3s morphTable[PAMELA_LIMB_MAX];
|
||||
|
|
|
@ -1197,7 +1197,7 @@ s32 func_80AF8DD4(EnPm* this, PlayState* play) {
|
|||
}
|
||||
|
||||
s32 func_80AF8ED4(EnPm* this, PlayState* play, ScheduleOutput* scheduleOutput, u8 actorCat, s16 actorId) {
|
||||
u8 sp4F = this->actor.params & 0xFF;
|
||||
u8 pathIndex = ENPM_GET_PATH_INDEX(&this->actor);
|
||||
Vec3s* sp48;
|
||||
Vec3f sp3C;
|
||||
Vec3f sp30;
|
||||
|
@ -1208,7 +1208,7 @@ s32 func_80AF8ED4(EnPm* this, PlayState* play, ScheduleOutput* scheduleOutput, u
|
|||
this->timePath = NULL;
|
||||
sp2C = func_80AF7CB0(this, play, actorCat, actorId);
|
||||
if (D_80AFB430[scheduleOutput->result] >= 0) {
|
||||
this->timePath = SubS_GetAdditionalPath(play, sp4F, D_80AFB430[scheduleOutput->result]);
|
||||
this->timePath = SubS_GetAdditionalPath(play, pathIndex, D_80AFB430[scheduleOutput->result]);
|
||||
}
|
||||
|
||||
if ((sp2C != NULL) && (sp2C->update != NULL)) {
|
||||
|
@ -1228,7 +1228,7 @@ s32 func_80AF8ED4(EnPm* this, PlayState* play, ScheduleOutput* scheduleOutput, u
|
|||
|
||||
s32 func_80AF9008(EnPm* this, PlayState* play, ScheduleOutput* scheduleOutput) {
|
||||
u16 sp56 = SCHEDULE_TIME_NOW;
|
||||
u8 sp55 = this->actor.params & 0xFF;
|
||||
u8 pathIndex = ENPM_GET_PATH_INDEX(&this->actor);
|
||||
EnDoor* door;
|
||||
Vec3s* sp4C;
|
||||
Vec3f sp40;
|
||||
|
@ -1239,7 +1239,7 @@ s32 func_80AF9008(EnPm* this, PlayState* play, ScheduleOutput* scheduleOutput) {
|
|||
this->timePath = NULL;
|
||||
door = func_80AF7D60(play, scheduleOutput->result);
|
||||
if (D_80AFB430[scheduleOutput->result] >= 0) {
|
||||
this->timePath = SubS_GetAdditionalPath(play, sp55, D_80AFB430[scheduleOutput->result]);
|
||||
this->timePath = SubS_GetAdditionalPath(play, pathIndex, D_80AFB430[scheduleOutput->result]);
|
||||
}
|
||||
|
||||
if ((door != NULL) && (door->knobDoor.dyna.actor.update != NULL)) {
|
||||
|
@ -1277,7 +1277,7 @@ s32 func_80AF9008(EnPm* this, PlayState* play, ScheduleOutput* scheduleOutput) {
|
|||
s32 func_80AF91E8(EnPm* this, PlayState* play, ScheduleOutput* scheduleOutput) {
|
||||
u16 sp2E = SCHEDULE_TIME_NOW;
|
||||
u16 phi_v1;
|
||||
u8 sp2B = this->actor.params & 0xFF;
|
||||
u8 pathIndex = ENPM_GET_PATH_INDEX(&this->actor);
|
||||
u16 tmp;
|
||||
s16 pad;
|
||||
s32 ret = false;
|
||||
|
@ -1285,7 +1285,7 @@ s32 func_80AF91E8(EnPm* this, PlayState* play, ScheduleOutput* scheduleOutput) {
|
|||
this->timePath = NULL;
|
||||
|
||||
if (D_80AFB430[scheduleOutput->result] >= 0) {
|
||||
this->timePath = SubS_GetAdditionalPath(play, sp2B, D_80AFB430[scheduleOutput->result]);
|
||||
this->timePath = SubS_GetAdditionalPath(play, pathIndex, D_80AFB430[scheduleOutput->result]);
|
||||
}
|
||||
|
||||
if ((this->timePath != NULL) && (this->timePath->count < 3)) {
|
||||
|
@ -1357,7 +1357,7 @@ s32 func_80AF91E8(EnPm* this, PlayState* play, ScheduleOutput* scheduleOutput) {
|
|||
}
|
||||
|
||||
s32 func_80AF94AC(EnPm* this, PlayState* play, ScheduleOutput* scheduleOutput) {
|
||||
u8 sp4F = this->actor.params & 0xFF;
|
||||
u8 pathIndex = ENPM_GET_PATH_INDEX(&this->actor);
|
||||
Vec3f sp40;
|
||||
Vec3f sp34;
|
||||
Vec3s* sp30;
|
||||
|
@ -1366,7 +1366,7 @@ s32 func_80AF94AC(EnPm* this, PlayState* play, ScheduleOutput* scheduleOutput) {
|
|||
|
||||
this->timePath = NULL;
|
||||
if (D_80AFB430[scheduleOutput->result] >= 0) {
|
||||
this->timePath = SubS_GetAdditionalPath(play, sp4F, D_80AFB430[scheduleOutput->result]);
|
||||
this->timePath = SubS_GetAdditionalPath(play, pathIndex, D_80AFB430[scheduleOutput->result]);
|
||||
}
|
||||
|
||||
if ((this->timePath != 0) && (this->timePath->count >= 2)) {
|
||||
|
@ -1390,7 +1390,7 @@ s32 func_80AF94AC(EnPm* this, PlayState* play, ScheduleOutput* scheduleOutput) {
|
|||
}
|
||||
|
||||
s32 func_80AF95E8(EnPm* this, PlayState* play, ScheduleOutput* scheduleOutput) {
|
||||
u8 sp4F = this->actor.params & 0xFF;
|
||||
u8 pathIndex = ENPM_GET_PATH_INDEX(&this->actor);
|
||||
Vec3f sp40;
|
||||
Vec3f sp34;
|
||||
Vec3s* sp30;
|
||||
|
@ -1419,7 +1419,7 @@ s32 func_80AF95E8(EnPm* this, PlayState* play, ScheduleOutput* scheduleOutput) {
|
|||
this->timePath = NULL;
|
||||
phi_a3 = D_80AFB430[scheduleOutput->result];
|
||||
if (phi_a3 >= 0) {
|
||||
this->timePath = SubS_GetAdditionalPath(play, sp4F, phi_a3);
|
||||
this->timePath = SubS_GetAdditionalPath(play, pathIndex, phi_a3);
|
||||
}
|
||||
|
||||
if ((this->timePath != 0) && (this->timePath->count >= 2)) {
|
||||
|
|
|
@ -9,6 +9,8 @@ typedef void (*EnPmActionFunc)(struct EnPm*, PlayState*);
|
|||
typedef s32 (*EnPmFunc)(struct EnPm*, PlayState*);
|
||||
typedef s32 (*EnPmFunc2)(struct EnPm*, PlayState*);
|
||||
|
||||
#define ENPM_GET_PATH_INDEX(thisx) ((thisx)->params & 0xFF)
|
||||
|
||||
typedef struct EnPm {
|
||||
/* 0x000 */ Actor actor;
|
||||
/* 0x144 */ SkelAnime skelAnime;
|
||||
|
|
|
@ -151,8 +151,8 @@ void EnPr2_Init(Actor* thisx, PlayState* play) {
|
|||
Actor* parent = this->actor.parent;
|
||||
|
||||
if (parent->update != NULL) {
|
||||
this->unk_1C8 = ((EnEncount1*)parent)->pathIndex;
|
||||
this->path = SubS_GetPathByIndex(play, this->unk_1C8, 0x3F);
|
||||
this->pathIndex = ((EnEncount1*)parent)->pathIndex;
|
||||
this->path = SubS_GetPathByIndex(play, this->pathIndex, ENPR2_PATH_INDEX_NONE);
|
||||
this->unk_208 = parent->world.rot.z * 20.0f;
|
||||
if (this->unk_208 < 20.0f) {
|
||||
this->unk_208 = 20.0f;
|
||||
|
@ -272,7 +272,7 @@ void func_80A745FC(EnPr2* this, PlayState* play) {
|
|||
Actor_PlaySfx(&this->actor, NA_SE_EN_PIRANHA_EXIST - SFX_FLAG);
|
||||
Math_ApproachF(&this->unk_204, 0.02f, 0.1f, 0.005f);
|
||||
|
||||
if (this->path->unk2 < this->unk_1D0) {
|
||||
if (this->path->customValue < this->unk_1D0) {
|
||||
Math_ApproachF(&this->actor.speed, 5.0f, 0.3f, 1.0f);
|
||||
} else {
|
||||
Math_ApproachF(&this->actor.speed, 10.0f, 0.3f, 1.0f);
|
||||
|
|
|
@ -10,6 +10,7 @@ typedef void (*EnPr2ActionFunc)(struct EnPr2*, PlayState*);
|
|||
#define ENPR2_GET_F(thisx) ((thisx)->params & 0xF)
|
||||
#define ENPR2_GET_FF0(thisx) (((thisx)->params >> 4) & 0xFF)
|
||||
|
||||
#define ENPR2_PATH_INDEX_NONE 0x3F
|
||||
#define ENPR2_PARAMS(paramF, paramFF0) (((paramF) & 0xF) | (((paramFF0) << 4) & 0xFF0))
|
||||
|
||||
typedef struct EnPr2 {
|
||||
|
@ -18,7 +19,7 @@ typedef struct EnPr2 {
|
|||
/* 0x188 */ Vec3s jointTable[5];
|
||||
/* 0x1A6 */ Vec3s morphtable[5];
|
||||
/* 0x1C4 */ EnPr2ActionFunc actionFunc;
|
||||
/* 0x1C8 */ s16 unk_1C8;
|
||||
/* 0x1C8 */ s16 pathIndex;
|
||||
/* 0x1CC */ Path* path;
|
||||
/* 0x1D0 */ s32 unk_1D0;
|
||||
/* 0x1D4 */ s16 unk_1D4;
|
||||
|
|
|
@ -313,7 +313,7 @@ void EnRacedog_Init(Actor* thisx, PlayState* play) {
|
|||
CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
|
||||
|
||||
Actor_ProcessInitChain(&this->actor, sInitChain);
|
||||
this->path = SubS_GetPathByIndex(play, ENRACEDOG_GET_PATH(&this->actor), 0x3F);
|
||||
this->path = SubS_GetPathByIndex(play, ENRACEDOG_GET_PATH_INDEX(&this->actor), ENRACEDOG_PATH_INDEX_NONE);
|
||||
Actor_SetScale(&this->actor, 0.0075f);
|
||||
this->actor.gravity = -3.0f;
|
||||
if (ENRACEDOG_GET_INDEX(&this->actor) < RACEDOG_COUNT) {
|
||||
|
|
|
@ -5,7 +5,10 @@
|
|||
#include "objects/object_dog/object_dog.h"
|
||||
|
||||
#define ENRACEDOG_GET_INDEX(thisx) (((thisx)->params & 0x3E0) >> 5)
|
||||
#define ENRACEDOG_GET_PATH(thisx) (((thisx)->params & 0xFC00) >> 10)
|
||||
#define ENRACEDOG_GET_PATH_INDEX(thisx) (((thisx)->params & 0xFC00) >> 10)
|
||||
|
||||
#define ENRACEDOG_PATH_INDEX_NONE 0x3F
|
||||
|
||||
#define ENRACEDOG_PARAMS(index, path) ((index << 5) | (path))
|
||||
|
||||
/**
|
||||
|
|
|
@ -196,7 +196,7 @@ void EnRailgibud_SpawnOtherGibdosAndSetPositionAndRotation(EnRailgibud* this, Pl
|
|||
static s32 currentGibdoIndex = 0;
|
||||
s32 nextPoint;
|
||||
Vec3f targetPos;
|
||||
Path* path = &play->setupPathList[ENRAILGIBUD_GET_PATH(&this->actor)];
|
||||
Path* path = &play->setupPathList[ENRAILGIBUD_GET_PATH_INDEX(&this->actor)];
|
||||
|
||||
this->points = Lib_SegmentedToVirtual(path->points);
|
||||
this->currentPoint = currentGibdoIndex;
|
||||
|
|
|
@ -10,7 +10,7 @@ typedef void (*EnRailgibudActionFunc)(struct EnRailgibud*, PlayState*);
|
|||
|
||||
#define ENRAILGIBUD_GET_CUTSCENE_TYPE(thisx) ((thisx)->params & 0x7F)
|
||||
#define ENRAILGIBUD_IS_CUTSCENE_TYPE(thisx) ((thisx)->params & 0x80)
|
||||
#define ENRAILGIBUD_GET_PATH(thisx) (((thisx)->params & 0xFF00) >> 8)
|
||||
#define ENRAILGIBUD_GET_PATH_INDEX(thisx) (((thisx)->params & 0xFF00) >> 8)
|
||||
|
||||
typedef struct EnRailgibud {
|
||||
/* 0x000 */ Actor actor;
|
||||
|
|
|
@ -373,11 +373,11 @@ s32 func_80BF43FC(EnRg* this) {
|
|||
f32 sp88;
|
||||
f32 sp84;
|
||||
f32 phi_f20 = 0.0f;
|
||||
s32 temp_s7 = ENRG_GET_7F80(&this->actor);
|
||||
s32 pathIndex = ENRG_GET_PATH_INDEX(&this->actor);
|
||||
s32 phi_s4 = -1;
|
||||
s32 temp_s5 = this->unk_344;
|
||||
s16 phi_s6 = 0;
|
||||
s32 phi_s0 = D_80BF57E4[this->unk_344][temp_s7];
|
||||
s32 phi_s0 = D_80BF57E4[this->unk_344][pathIndex];
|
||||
|
||||
do {
|
||||
SubS_CopyPointFromPathCheckBounds(this->path, phi_s0 - 1, &sp9C);
|
||||
|
@ -390,7 +390,7 @@ s32 func_80BF43FC(EnRg* this) {
|
|||
phi_s4 = phi_s0;
|
||||
}
|
||||
phi_s0++;
|
||||
} while ((temp_s5 != 18) && (phi_s0 < D_80BF57E4[temp_s5 + 1][temp_s7]));
|
||||
} while ((temp_s5 != 18) && (phi_s0 < D_80BF57E4[temp_s5 + 1][pathIndex]));
|
||||
|
||||
return phi_s4;
|
||||
}
|
||||
|
@ -741,7 +741,8 @@ void EnRg_Init(Actor* thisx, PlayState* play) {
|
|||
|
||||
Effect_Add(play, &this->unk_340, EFFECT_TIRE_MARK, 0, 0, &D_80BF59F0);
|
||||
|
||||
this->path = SubS_GetDayDependentPath(play, ENRG_GET_7F80(&this->actor), 255, &this->unk_33C);
|
||||
this->path =
|
||||
SubS_GetDayDependentPath(play, ENRG_GET_PATH_INDEX(&this->actor), ENRG_PATH_INDEX_NONE, &this->unk_33C);
|
||||
if (this->path != NULL) {
|
||||
this->unk_33C = 1;
|
||||
}
|
||||
|
|
|
@ -7,7 +7,9 @@ struct EnRg;
|
|||
|
||||
typedef void (*EnRgActionFunc)(struct EnRg*, PlayState*);
|
||||
|
||||
#define ENRG_GET_7F80(thisx) ((((thisx)->params & 0x7F80) >> 7) & 0xFF)
|
||||
#define ENRG_GET_PATH_INDEX(thisx) ((((thisx)->params & 0x7F80) >> 7) & 0xFF)
|
||||
|
||||
#define ENRG_PATH_INDEX_NONE 0xFF
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 unk_00;
|
||||
|
|
|
@ -35,7 +35,7 @@ void EnRiverSound_Init(Actor* thisx, PlayState* play) {
|
|||
this->playSound = false;
|
||||
pathIndex = RS_GET_PATH_INDEX(&this->actor);
|
||||
this->actor.params = RS_GET_TYPE(&this->actor);
|
||||
if (pathIndex == 0xFF) {
|
||||
if (pathIndex == RS_PATH_INDEX_NONE) {
|
||||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -8,6 +8,8 @@ struct EnRiverSound;
|
|||
#define RS_GET_TYPE(thisx) ((thisx)->params & 0xFF);
|
||||
#define RS_GET_PATH_INDEX(thisx) (((thisx)->params >> 8) & 0xFF);
|
||||
|
||||
#define RS_PATH_INDEX_NONE 0xFF
|
||||
|
||||
// Any param not as one of these values will result in UB
|
||||
typedef enum {
|
||||
/* 0x00 */ RS_RIVER_STREAM,
|
||||
|
|
|
@ -235,7 +235,7 @@ void EnRu_Init(Actor* thisx, PlayState* play) {
|
|||
Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit);
|
||||
CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
|
||||
|
||||
this->path = SubS_GetPathByIndex(play, RU_GET_PATH(thisx), 0x3F);
|
||||
this->path = SubS_GetPathByIndex(play, RU_GET_PATH_INDEX(thisx), RU_PATH_INDEX_NONE);
|
||||
Actor_SetScale(&this->actor, 0.01f);
|
||||
this->actionFunc = EnRu_DoNothing;
|
||||
this->actor.gravity = -4.0f;
|
||||
|
|
|
@ -4,7 +4,9 @@
|
|||
#include "global.h"
|
||||
#include "objects/object_ru2/object_ru2.h"
|
||||
|
||||
#define RU_GET_PATH(thisx) ((thisx->params & 0x7E00) >> 9)
|
||||
#define RU_GET_PATH_INDEX(thisx) ((thisx->params & 0x7E00) >> 9)
|
||||
|
||||
#define RU_PATH_INDEX_NONE 0x3F
|
||||
|
||||
struct EnRu;
|
||||
|
||||
|
|
|
@ -652,7 +652,7 @@ void EnRuppecrow_Init(Actor* thisx, PlayState* play2) {
|
|||
Actor_SetScale(&this->actor, 0.01f);
|
||||
this->actor.flags |= ACTOR_FLAG_2000000;
|
||||
|
||||
this->path = SubS_GetPathByIndex(play, ENRUPPECROW_GET_PATH(&this->actor), 0x3F);
|
||||
this->path = SubS_GetPathByIndex(play, ENRUPPECROW_GET_PATH_INDEX(&this->actor), ENRUPPECROW_PATH_INDEX_NONE);
|
||||
if (this->path != NULL) {
|
||||
this->actionFunc = EnRuppecrow_HandleSong;
|
||||
} else {
|
||||
|
|
|
@ -4,7 +4,9 @@
|
|||
#include "global.h"
|
||||
#include "objects/object_crow/object_crow.h"
|
||||
|
||||
#define ENRUPPECROW_GET_PATH(thisx) (((thisx)->params & 0xFC00) >> 0xA)
|
||||
#define ENRUPPECROW_GET_PATH_INDEX(thisx) (((thisx)->params & 0xFC00) >> 0xA)
|
||||
|
||||
#define ENRUPPECROW_PATH_INDEX_NONE 0x3F
|
||||
|
||||
#define ENRUPPECROW_RUPEE_COUNT 20
|
||||
#define ENRUPPECROW_LIMB_POS_COUNT 4
|
||||
|
|
|
@ -247,8 +247,8 @@ void func_80BFBA1C(PlayState* play, EnRz* this, s16 animIndex) {
|
|||
}
|
||||
|
||||
s32 EnRz_SetupPath(EnRz* this, PlayState* play) {
|
||||
if (EN_RZ_GET_PATH(&this->actor) != 0x3F) {
|
||||
this->path = &play->setupPathList[EN_RZ_GET_PATH(&this->actor)];
|
||||
if (EN_RZ_GET_PATH_INDEX(&this->actor) != EN_RZ_PATH_INDEX_NONE) {
|
||||
this->path = &play->setupPathList[EN_RZ_GET_PATH_INDEX(&this->actor)];
|
||||
if (this->path != NULL) {
|
||||
Path* path = this->path;
|
||||
Vec3s* points = (Vec3s*)Lib_SegmentedToVirtual(path->points);
|
||||
|
|
|
@ -6,7 +6,9 @@
|
|||
|
||||
#define EN_RZ_GET_SISTER(thisx) ((thisx)->params & 0x8000)
|
||||
#define EN_RZ_GET_TYPE(thisx) ((thisx)->params & 0xF)
|
||||
#define EN_RZ_GET_PATH(thisx) (((thisx)->params & 0x7E00) >> 9)
|
||||
#define EN_RZ_GET_PATH_INDEX(thisx) (((thisx)->params & 0x7E00) >> 9)
|
||||
|
||||
#define EN_RZ_PATH_INDEX_NONE 0x3F
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ EN_RZ_JUDO, // in red
|
||||
|
|
|
@ -276,7 +276,7 @@ void EnScopecrow_Init(Actor* thisx, PlayState* play) {
|
|||
}
|
||||
|
||||
if (func_80BCD09C(this->unk_260)) {
|
||||
this->path = SubS_GetPathByIndex(play, ENSCOPECROW_GET_PATH(&this->actor), 0x3F);
|
||||
this->path = SubS_GetPathByIndex(play, ENSCOPECROW_GET_PATH_INDEX(&this->actor), ENSCOPECROW_PATH_INDEX_NONE);
|
||||
this->unk_262 = ENSCOPECROW_GET_3E0(&this->actor);
|
||||
|
||||
if (this->path != NULL) {
|
||||
|
@ -316,7 +316,7 @@ void EnScopecrow_Init(Actor* thisx, PlayState* play) {
|
|||
this->collider.elements->dim.worldSphere.radius = sJntSphInit.elements[0].dim.modelSphere.radius;
|
||||
|
||||
Actor_SetScale(&this->actor, 0.03f);
|
||||
this->path = SubS_GetPathByIndex(play, ENSCOPECROW_GET_PATH(&this->actor), 0x3F);
|
||||
this->path = SubS_GetPathByIndex(play, ENSCOPECROW_GET_PATH_INDEX(&this->actor), ENSCOPECROW_PATH_INDEX_NONE);
|
||||
this->unk_262 = ENSCOPECROW_GET_3E0(&this->actor);
|
||||
|
||||
if (this->path != NULL) {
|
||||
|
|
|
@ -10,7 +10,9 @@ typedef void (*EnScopecrowActionFunc)(struct EnScopecrow*, PlayState*);
|
|||
|
||||
#define ENSCOPECROW_GET_1F(thisx) ((thisx)->params & 0x1F)
|
||||
#define ENSCOPECROW_GET_3E0(thisx) (((thisx)->params & 0x3E0) >> 5)
|
||||
#define ENSCOPECROW_GET_PATH(thisx) (((thisx)->params & 0xFC00) >> 0xA)
|
||||
#define ENSCOPECROW_GET_PATH_INDEX(thisx) (((thisx)->params & 0xFC00) >> 0xA)
|
||||
|
||||
#define ENSCOPECROW_PATH_INDEX_NONE 0x3F
|
||||
|
||||
typedef struct EnScopecrow {
|
||||
/* 0x000 */ Actor actor;
|
||||
|
|
|
@ -708,7 +708,8 @@ void EnScopenuts_Init(Actor* thisx, PlayState* play) {
|
|||
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_52_40)) {
|
||||
Actor_Kill(&this->actor);
|
||||
} else if (play->actorCtx.flags & ACTORCTX_FLAG_1) {
|
||||
this->path = SubS_GetPathByIndex(play, ENSCOPENUTS_GET_FC00(&this->actor), 0x3F);
|
||||
this->path =
|
||||
SubS_GetPathByIndex(play, ENSCOPENUTS_GET_PATH_INDEX(&this->actor), ENSCOPENUTS_PATH_INDEX_NONE);
|
||||
this->actor.draw = NULL;
|
||||
this->actionFunc = func_80BCAFA8;
|
||||
this->actor.gravity = 0.0f;
|
||||
|
@ -717,7 +718,8 @@ void EnScopenuts_Init(Actor* thisx, PlayState* play) {
|
|||
}
|
||||
} else if (ENSCOPENUTS_GET_3E0(&this->actor) == ENSCOPENUTS_3E0_1) {
|
||||
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_52_40)) {
|
||||
this->path = SubS_GetPathByIndex(play, ENSCOPENUTS_GET_FC00(&this->actor), 0x3F);
|
||||
this->path =
|
||||
SubS_GetPathByIndex(play, ENSCOPENUTS_GET_PATH_INDEX(&this->actor), ENSCOPENUTS_PATH_INDEX_NONE);
|
||||
if (this->path == NULL) {
|
||||
Actor_Kill(&this->actor);
|
||||
} else {
|
||||
|
|
|
@ -8,7 +8,9 @@ struct EnScopenuts;
|
|||
typedef void (*EnScopenutsActionFunc)(struct EnScopenuts*, PlayState*);
|
||||
|
||||
#define ENSCOPENUTS_GET_3E0(thisx) (((thisx)->params & 0x3E0) >> 5)
|
||||
#define ENSCOPENUTS_GET_FC00(thisx) (((thisx)->params & 0xFC00) >> 0xA)
|
||||
#define ENSCOPENUTS_GET_PATH_INDEX(thisx) (((thisx)->params & 0xFC00) >> 0xA)
|
||||
|
||||
#define ENSCOPENUTS_PATH_INDEX_NONE 0x3F
|
||||
|
||||
#define ENSCOPENUTS_3E0_0 0
|
||||
#define ENSCOPENUTS_3E0_1 1
|
||||
|
|
|
@ -958,7 +958,7 @@ void EnSellnuts_Init(Actor* thisx, PlayState* play) {
|
|||
Collider_InitCylinder(play, &this->collider);
|
||||
Collider_SetCylinderType1(play, &this->collider, &this->actor, &sCylinderInit);
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 35.0f);
|
||||
this->path = SubS_GetPathByIndex(play, ENSELLNUTS_GET_FC00(&this->actor), 0x3F);
|
||||
this->path = SubS_GetPathByIndex(play, ENSELLNUTS_GET_PATH_INDEX(&this->actor), ENSELLNUTS_PATH_INDEX_NONE);
|
||||
this->csId = this->actor.csId;
|
||||
Actor_SetScale(&this->actor, 0.01f);
|
||||
this->actor.colChkInfo.cylRadius = 0;
|
||||
|
|
|
@ -8,7 +8,9 @@ struct EnSellnuts;
|
|||
typedef void (*EnSellnutsActionFunc)(struct EnSellnuts*, PlayState*);
|
||||
|
||||
#define ENSELLNUTS_GET_1(thisx) ((thisx)->params & 1)
|
||||
#define ENSELLNUTS_GET_FC00(thisx) (((thisx)->params & 0xFC00) >> 0xA)
|
||||
#define ENSELLNUTS_GET_PATH_INDEX(thisx) (((thisx)->params & 0xFC00) >> 0xA)
|
||||
|
||||
#define ENSELLNUTS_PATH_INDEX_NONE 0x3F
|
||||
|
||||
typedef struct EnSellnuts {
|
||||
/* 0x000 */ Actor actor;
|
||||
|
|
|
@ -1416,7 +1416,7 @@ void EnSob1_InitShop(EnSob1* this, PlayState* play) {
|
|||
this->waypoint = 0;
|
||||
|
||||
if (this->shopType == BOMB_SHOP) {
|
||||
this->path = SubS_GetPathByIndex(play, ENSOB1_GET_PATH(&this->actor), 0x1F);
|
||||
this->path = SubS_GetPathByIndex(play, ENSOB1_GET_PATH_INDEX(&this->actor), ENSOB1_PATH_INDEX_NONE);
|
||||
}
|
||||
if (this->shopType == BOMB_SHOP) {
|
||||
EnSob1_SetupAction(this, EnSob1_SetupWalk);
|
||||
|
|
|
@ -15,7 +15,9 @@ typedef void (*EnSob1ActionFunc)(struct EnSob1*, PlayState*);
|
|||
typedef void (*EnSob1BlinkFunc)(struct EnSob1*);
|
||||
|
||||
#define ENSOB1_GET_SHOPTYPE(thisx) ((thisx)->params & 0x1F)
|
||||
#define ENSOB1_GET_PATH(thisx) (((thisx)->params & 0x3E0) >> 5)
|
||||
#define ENSOB1_GET_PATH_INDEX(thisx) (((thisx)->params & 0x3E0) >> 5)
|
||||
|
||||
#define ENSOB1_PATH_INDEX_NONE 0x1F
|
||||
|
||||
typedef struct EnSob1XZRange {
|
||||
/* 0x0 */ f32 xMin;
|
||||
|
|
|
@ -549,8 +549,9 @@ void func_80BAB434(EnSuttari* this) {
|
|||
}
|
||||
|
||||
void EnSuttari_GetPaths(EnSuttari* this, PlayState* play) {
|
||||
this->paths[0] = SubS_GetPathByIndex(play, ENSUTTARI_GET_PATH(&this->actor), 0x3F);
|
||||
this->paths[1] = SubS_GetPathByIndex(play, this->paths[0]->unk1, 0x3F);
|
||||
this->paths[0] = SubS_GetPathByIndex(play, ENSUTTARI_GET_PATH_INDEX(&this->actor), ENSUTTARI_PATH_INDEX_NONE);
|
||||
//! @bug: the additional path shouldn't use `ENSUTTARI_PATH_INDEX_NONE`, but `ADDITIONAL_PATH_INDEX_NONE`
|
||||
this->paths[1] = SubS_GetPathByIndex(play, this->paths[0]->additionalPathIndex, ENSUTTARI_PATH_INDEX_NONE);
|
||||
}
|
||||
|
||||
void func_80BAB4F0(EnSuttari* this, PlayState* play) {
|
||||
|
@ -712,11 +713,11 @@ void func_80BABB90(EnSuttari* this, s32 arg1) {
|
|||
s32 func_80BABC48(EnSuttari* this, PlayState* play, ScheduleOutput* scheduleOutput) {
|
||||
u16 sp26 = SCHEDULE_TIME_NOW;
|
||||
u16 phi_a0;
|
||||
u8 sp23 = ENSUTTARI_GET_PATH(&this->actor);
|
||||
u8 pathIndex = ENSUTTARI_GET_PATH_INDEX(&this->actor);
|
||||
u16 tmp;
|
||||
|
||||
if (D_80BAE8F8[scheduleOutput->result] >= 0) {
|
||||
this->timePath = SubS_GetAdditionalPath(play, sp23, D_80BAE8F8[scheduleOutput->result]);
|
||||
this->timePath = SubS_GetAdditionalPath(play, pathIndex, D_80BAE8F8[scheduleOutput->result]);
|
||||
}
|
||||
if (this->timePath == NULL) {
|
||||
return 0;
|
||||
|
@ -743,7 +744,7 @@ s32 func_80BABC48(EnSuttari* this, PlayState* play, ScheduleOutput* scheduleOutp
|
|||
s32 func_80BABDD8(EnSuttari* this, PlayState* play, ScheduleOutput* scheduleOutput) {
|
||||
s32 pad;
|
||||
EnDoor* sp48;
|
||||
u8 sp47 = ENSUTTARI_GET_PATH(&this->actor);
|
||||
u8 pathIndex = ENSUTTARI_GET_PATH_INDEX(&this->actor);
|
||||
u16 sp44 = SCHEDULE_TIME_NOW;
|
||||
Vec3f sp38;
|
||||
Vec3f sp2C;
|
||||
|
@ -756,7 +757,7 @@ s32 func_80BABDD8(EnSuttari* this, PlayState* play, ScheduleOutput* scheduleOutp
|
|||
sp48 = (EnDoor*)SubS_FindNearestActor(&this->actor, play, ACTORCAT_DOOR, ACTOR_EN_DOOR);
|
||||
sp24 = D_80BAE8F8[scheduleOutput->result];
|
||||
if ((sp48 != NULL) && (sp24 >= 0)) {
|
||||
this->timePath = SubS_GetAdditionalPath(play, sp47, sp24);
|
||||
this->timePath = SubS_GetAdditionalPath(play, pathIndex, sp24);
|
||||
}
|
||||
if ((sp48 == NULL) || (this->timePath == NULL)) {
|
||||
return false;
|
||||
|
@ -1313,7 +1314,7 @@ void func_80BAD5F8(EnSuttari* this, PlayState* play) {
|
|||
}
|
||||
this->unk428 = scheduleOutput.result;
|
||||
func_80BAC2FC(this, play);
|
||||
if ((this->unk430 == 1) && (this->timePath->unk1 == 0xFF)) {
|
||||
if ((this->unk430 == 1) && (this->timePath->additionalPathIndex == ADDITIONAL_PATH_INDEX_NONE)) {
|
||||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
}
|
||||
|
@ -1351,7 +1352,7 @@ void func_80BAD7F8(EnSuttari* this, PlayState* play) {
|
|||
}
|
||||
this->unk428 = scheduleOutput.result;
|
||||
func_80BAC2FC(this, play);
|
||||
if ((this->unk430 == 1) && (this->timePath->unk1 == 0xFF)) {
|
||||
if ((this->unk430 == 1) && (this->timePath->additionalPathIndex == ADDITIONAL_PATH_INDEX_NONE)) {
|
||||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -8,7 +8,9 @@ struct EnSuttari;
|
|||
|
||||
typedef void (*EnSuttariActionFunc)(struct EnSuttari*, PlayState*);
|
||||
|
||||
#define ENSUTTARI_GET_PATH(thisx) (((thisx)->params & 0x7E00) >> 9)
|
||||
#define ENSUTTARI_GET_PATH_INDEX(thisx) (((thisx)->params & 0x7E00) >> 9)
|
||||
|
||||
#define ENSUTTARI_PATH_INDEX_NONE 0x3F
|
||||
|
||||
typedef struct EnSuttari {
|
||||
/* 0x000 */ Actor actor;
|
||||
|
|
|
@ -901,13 +901,13 @@ void func_808DA89C(EnSw* this, PlayState* play) {
|
|||
}
|
||||
|
||||
void func_808DAA60(EnSw* this, PlayState* play) {
|
||||
Vec3s* sp44;
|
||||
Vec3s* points;
|
||||
s16 temp_v0;
|
||||
s16 sp40;
|
||||
Vec3f sp34;
|
||||
f32 temp_f16;
|
||||
|
||||
sp44 = Lib_SegmentedToVirtual(this->unk_1E4->points);
|
||||
points = Lib_SegmentedToVirtual(this->path->points);
|
||||
sp40 = 0;
|
||||
|
||||
if (DECR(this->unk_454) == 0) {
|
||||
|
@ -915,13 +915,13 @@ void func_808DAA60(EnSw* this, PlayState* play) {
|
|||
temp_f16 = this->skelAnime.endFrame - this->skelAnime.curFrame;
|
||||
sp40 = 80.0f * temp_f16;
|
||||
if (this->unk_45E == 0) {
|
||||
Math_Vec3s_ToVec3f(&sp34, &sp44[this->unk_4A0]);
|
||||
Math_Vec3s_ToVec3f(&sp34, &points[this->unk_4A0]);
|
||||
func_808D9894(this, &sp34);
|
||||
temp_v0 = Math_Atan2S_XY(sp34.z, sp34.x);
|
||||
if (ABS_ALT(temp_v0) < sp40) {
|
||||
this->skelAnime.curFrame = 0.0f;
|
||||
Actor_PlaySfx(&this->actor, NA_SE_EN_STALWALL_DASH);
|
||||
Math_Vec3s_ToVec3f(&this->unk_374, &sp44[this->unk_4A0]);
|
||||
Math_Vec3s_ToVec3f(&this->unk_374, &points[this->unk_4A0]);
|
||||
this->actionFunc = func_808DACF4;
|
||||
this->unk_414 = 0.0f;
|
||||
sp40 = ABS_ALT(temp_v0);
|
||||
|
@ -981,7 +981,7 @@ void func_808DACF4(EnSw* this, PlayState* play) {
|
|||
if (((s32)this->unk_414 != 0) && ((s32)this->unk_414 < (s32)sp4C)) {
|
||||
Math_Vec3f_Copy(&this->actor.world.pos, &this->unk_374);
|
||||
this->unk_4A0 += this->unk_49C;
|
||||
if ((this->unk_4A0 >= this->unk_1E4->count) || (this->unk_4A0 < 0)) {
|
||||
if ((this->unk_4A0 >= this->path->count) || (this->unk_4A0 < 0)) {
|
||||
this->unk_49C = -this->unk_49C;
|
||||
this->unk_4A0 += this->unk_49C * 2;
|
||||
}
|
||||
|
@ -1154,8 +1154,9 @@ void EnSw_Init(Actor* thisx, PlayState* play) {
|
|||
this->collider.info.toucher.damage = 16;
|
||||
}
|
||||
|
||||
this->unk_1E4 = SubS_GetDayDependentPath(play, ENSW_GET_FF00(&this->actor), 255, &this->unk_4A0);
|
||||
if (this->unk_1E4 != NULL) {
|
||||
this->path =
|
||||
SubS_GetDayDependentPath(play, ENSW_GET_PATH_INDEX(&this->actor), ENSW_PATH_INDEX_NONE, &this->unk_4A0);
|
||||
if (this->path != NULL) {
|
||||
this->unk_4A0 = 1;
|
||||
}
|
||||
|
||||
|
@ -1201,7 +1202,7 @@ void EnSw_Init(Actor* thisx, PlayState* play) {
|
|||
}
|
||||
|
||||
func_808D9F78(this, play, 1);
|
||||
if (this->unk_1E4 != NULL) {
|
||||
if (this->path != NULL) {
|
||||
this->unk_49C = 1;
|
||||
func_808D9F08(this);
|
||||
this->actionFunc = func_808DAA60;
|
||||
|
|
|
@ -11,14 +11,16 @@ typedef void (*EnSwActionFunc)(struct EnSw*, PlayState*);
|
|||
#define ENSW_GET_3(thisx) (ENSW_GETS_3((thisx)->params))
|
||||
#define ENSW_GETS_3FC(params) (((params & 0x3FC) >> 2) & 0xFF)
|
||||
#define ENSW_GET_3FC(thisx) (ENSW_GETS_3FC((thisx)->params))
|
||||
#define ENSW_GET_FF00(thisx) ((((thisx)->params & 0xFF00) >> 8) & 0xFF)
|
||||
#define ENSW_GET_PATH_INDEX(thisx) ((((thisx)->params & 0xFF00) >> 8) & 0xFF)
|
||||
|
||||
#define ENSW_PATH_INDEX_NONE 0xFF
|
||||
|
||||
typedef struct EnSw {
|
||||
/* 0x000 */ Actor actor;
|
||||
/* 0x144 */ SkelAnime skelAnime;
|
||||
/* 0x188 */ EnSwActionFunc actionFunc;
|
||||
/* 0x18C */ ColliderSphere collider;
|
||||
/* 0x1E4 */ Path* unk_1E4;
|
||||
/* 0x1E4 */ Path* path;
|
||||
/* 0x1E8 */ Vec3s jointTable[30];
|
||||
/* 0x29C */ Vec3s morphTable[30];
|
||||
/* 0x350 */ Vec3f unk_350;
|
||||
|
|
|
@ -79,12 +79,12 @@ void EnSyatekiCrow_Init(Actor* thisx, PlayState* play2) {
|
|||
s32 i;
|
||||
|
||||
path = syatekiMan->path;
|
||||
while (path->unk2 != 0) {
|
||||
path = &play->setupPathList[path->unk1];
|
||||
while (path->customValue != SG_PATH_TYPE_CROW) {
|
||||
path = &play->setupPathList[path->additionalPathIndex];
|
||||
}
|
||||
|
||||
for (i = 0; i < EN_SYATEKI_CROW_GET_INDEX(&this->actor); i++) {
|
||||
path = &play->setupPathList[path->unk1];
|
||||
path = &play->setupPathList[path->additionalPathIndex];
|
||||
}
|
||||
|
||||
Actor_ProcessInitChain(&this->actor, sInitChain);
|
||||
|
|
|
@ -103,7 +103,7 @@ void EnSyatekiDekunuts_Init(Actor* thisx, PlayState* play2) {
|
|||
static s32 sDrawFlowers = true; // This makes it so only one EnSyatekiDekunuts draws all the flowers.
|
||||
EnSyatekiDekunuts* this = THIS;
|
||||
PlayState* play = play2;
|
||||
s32 unkPathComparison;
|
||||
s32 pathType;
|
||||
Path* path;
|
||||
EnSyatekiMan* syatekiMan = (EnSyatekiMan*)this->actor.parent;
|
||||
s32 i;
|
||||
|
@ -115,18 +115,18 @@ void EnSyatekiDekunuts_Init(Actor* thisx, PlayState* play2) {
|
|||
if (EN_SYATEKI_DEKUNUTS_GET_TYPE(&this->actor) == EN_SYATEKI_DEKUNUTS_TYPE_BONUS) {
|
||||
Actor_SetScale(&this->actor, 0.01f);
|
||||
this->collider.dim = sBonusDekuScrubColliderDimensions[0];
|
||||
unkPathComparison = 3;
|
||||
pathType = SG_PATH_TYPE_SCRUB_BONUS;
|
||||
} else {
|
||||
Actor_SetScale(&this->actor, 0.02f);
|
||||
unkPathComparison = 1;
|
||||
pathType = SG_PATH_TYPE_SCRUB_NORMAL;
|
||||
}
|
||||
|
||||
while (path->unk2 != unkPathComparison) {
|
||||
path = &play->setupPathList[path->unk1];
|
||||
while (path->customValue != pathType) {
|
||||
path = &play->setupPathList[path->additionalPathIndex];
|
||||
}
|
||||
|
||||
for (i = 0; i < EN_SYATEKI_DEKUNUTS_GET_PARAM_FF00(&this->actor); i++) {
|
||||
path = &play->setupPathList[path->unk1];
|
||||
path = &play->setupPathList[path->additionalPathIndex];
|
||||
}
|
||||
|
||||
if (sDrawFlowers == true) {
|
||||
|
|
|
@ -183,7 +183,7 @@ void EnSyatekiMan_Swamp_SpawnTargetActors(EnSyatekiMan* this, PlayState* play2,
|
|||
void EnSyatekiMan_Init(Actor* thisx, PlayState* play) {
|
||||
EnSyatekiMan* this = THIS;
|
||||
s32 pad;
|
||||
Path* path = &play->setupPathList[EN_SYATEKI_MAN_GET_PATH(&this->actor)];
|
||||
Path* path = &play->setupPathList[EN_SYATEKI_MAN_GET_PATH_INDEX(&this->actor)];
|
||||
s32 actorListLength = sSwampTargetActorListLengths[this->swampTargetActorListIndex];
|
||||
|
||||
this->actor.targetMode = 1;
|
||||
|
|
|
@ -8,7 +8,7 @@ struct EnSyatekiMan;
|
|||
|
||||
typedef void (*EnSyatekiManActionFunc)(struct EnSyatekiMan*, PlayState*);
|
||||
|
||||
#define EN_SYATEKI_MAN_GET_PATH(thisx) (((thisx)->params & 0xFF00) >> 8)
|
||||
#define EN_SYATEKI_MAN_GET_PATH_INDEX(thisx) (((thisx)->params & 0xFF00) >> 8)
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ SG_GAME_STATE_NONE, // None of the states below apply.
|
||||
|
@ -18,22 +18,29 @@ typedef enum {
|
|||
/* 4 */ SG_GAME_STATE_ONE_MORE_GAME, // The player failed to get a new high score (Town) and/or perfect score (Swamp and Town).
|
||||
/* 5 */ SG_GAME_STATE_GIVING_BONUS, // The player gets bonus points at the end of the Swamp game if they get a perfect score.
|
||||
/* 6 */ SG_GAME_STATE_ENDED, // The player got a new high score and/or perfect score (Town), or the game is over (Swamp).
|
||||
/* 7 */ SG_GAME_STATE_MOVING_PLAYER, // The player is automatically moving towards the spot to play the game.
|
||||
/* 7 */ SG_GAME_STATE_MOVING_PLAYER // The player is automatically moving towards the spot to play the game.
|
||||
} ShootingGalleryGameState;
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ SG_OCTO_STATE_SPAWNING,
|
||||
/* 1 */ SG_OCTO_STATE_SPAWNED,
|
||||
/* 70 */ SG_OCTO_STATE_INITIAL = 70,
|
||||
/* 80 */ SG_OCTO_STATE_HIDING = 80,
|
||||
/* 80 */ SG_OCTO_STATE_HIDING = 80
|
||||
} ShootingGalleryOctorokState;
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ SG_OCTO_HIT_TYPE_NONE,
|
||||
/* 1 */ SG_OCTO_HIT_TYPE_RED,
|
||||
/* 2 */ SG_OCTO_HIT_TYPE_BLUE,
|
||||
/* 2 */ SG_OCTO_HIT_TYPE_BLUE
|
||||
} ShootingGalleryoctorokHitType;
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ SG_PATH_TYPE_CROW,
|
||||
/* 1 */ SG_PATH_TYPE_SCRUB_NORMAL,
|
||||
/* 2 */ SG_PATH_TYPE_WOLFOS,
|
||||
/* 3 */ SG_PATH_TYPE_SCRUB_BONUS
|
||||
} ShootingGalleryPathType;
|
||||
|
||||
typedef struct EnSyatekiMan {
|
||||
/* 0x000 */ Actor actor;
|
||||
/* 0x144 */ SkelAnime skelAnime;
|
||||
|
|
|
@ -146,12 +146,12 @@ void EnSyatekiWf_Init(Actor* thisx, PlayState* play) {
|
|||
s32 i;
|
||||
|
||||
path = syatekiMan->path;
|
||||
while (path->unk2 != 2) {
|
||||
path = &play->setupPathList[path->unk1];
|
||||
while (path->customValue != SG_PATH_TYPE_WOLFOS) {
|
||||
path = &play->setupPathList[path->additionalPathIndex];
|
||||
}
|
||||
|
||||
for (i = 0; i < EN_SYATEKI_WF_GET_INDEX(&this->actor); i++) {
|
||||
path = &play->setupPathList[path->unk1];
|
||||
path = &play->setupPathList[path->additionalPathIndex];
|
||||
}
|
||||
|
||||
if (path == NULL) {
|
||||
|
|
|
@ -533,17 +533,17 @@ void func_80A3F114(EnTest3* this, PlayState* play) {
|
|||
}
|
||||
|
||||
s32 func_80A3F15C(EnTest3* this, PlayState* play, struct_80A41828* arg2) {
|
||||
s32 pathIndex;
|
||||
s32 limit;
|
||||
Path* path;
|
||||
Vec3s* curPathPoint;
|
||||
Vec3s* nextPathPoint;
|
||||
Vec3f curPathPos;
|
||||
Vec3f nextPathPos;
|
||||
|
||||
pathIndex = ABS_ALT(arg2->unk_1_0) - 1;
|
||||
limit = ABS_ALT(arg2->unk_1_0) - 1;
|
||||
|
||||
if (pathIndex >= 0) {
|
||||
path = SubS_GetAdditionalPath(play, KAFEI_GET_PARAM_1F(&this->player.actor), pathIndex);
|
||||
if (limit >= 0) {
|
||||
path = SubS_GetAdditionalPath(play, KAFEI_GET_PATH_INDEX(&this->player.actor), limit);
|
||||
|
||||
curPathPoint = Lib_SegmentedToVirtual(path->points);
|
||||
if (arg2->unk_1_0 > 0) {
|
||||
|
@ -868,7 +868,7 @@ s32 func_80A40098(EnTest3* this, PlayState* play, struct_80A41828* arg2, Schedul
|
|||
u16 numWaypoints;
|
||||
|
||||
func_80A3F15C(this, play, arg2);
|
||||
this->unk_D7C = SubS_GetAdditionalPath(play, KAFEI_GET_PARAM_1F(&this->player.actor), ABS_ALT(arg2->unk_1_0) - 1);
|
||||
this->unk_D7C = SubS_GetAdditionalPath(play, KAFEI_GET_PATH_INDEX(&this->player.actor), ABS_ALT(arg2->unk_1_0) - 1);
|
||||
if ((this->unk_D88 < 7) && (this->unk_D88 != 0) && (this->unk_D80 >= 0)) {
|
||||
startTime = now;
|
||||
} else {
|
||||
|
|
|
@ -7,7 +7,7 @@ struct EnTest3;
|
|||
|
||||
typedef void (*EnTest3ActionFunc)(struct EnTest3*, PlayState*);
|
||||
|
||||
#define KAFEI_GET_PARAM_1F(thisx) ((thisx)->params & 0x1F)
|
||||
#define KAFEI_GET_PATH_INDEX(thisx) ((thisx)->params & 0x1F)
|
||||
#define KAFEI_GET_PARAM_1E0(thisx) (((thisx)->params >> 5) & 0xF)
|
||||
|
||||
typedef struct {
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue