Player Docs: Rename Init Mode to Start Mode (#1744)

* rename to start mode

* cleanup

* rm declarations
This commit is contained in:
engineer124 2024-11-23 12:04:34 +11:00 committed by GitHub
parent 0b51a16453
commit a448168d37
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
16 changed files with 114 additions and 133 deletions

View File

@ -13,6 +13,31 @@
struct Player;
struct PlayState;
#define PLAYER_GET_BG_CAM_INDEX(thisx) ((thisx)->params & 0xFF)
#define PLAYER_GET_START_MODE(thisx) (((thisx)->params & 0xF00) >> 8)
typedef enum PlayerStartMode {
/* 0x0 */ PLAYER_START_MODE_0,
/* 0x1 */ PLAYER_START_MODE_1, // Spawning after pulling/putting-back Master sword // OoT leftover
/* 0x2 */ PLAYER_START_MODE_2,
/* 0x3 */ PLAYER_START_MODE_3,
/* 0x4 */ PLAYER_START_MODE_4,
/* 0x5 */ PLAYER_START_MODE_5,
/* 0x6 */ PLAYER_START_MODE_6,
/* 0x7 */ PLAYER_START_MODE_7,
/* 0x8 */ PLAYER_START_MODE_8,
/* 0x9 */ PLAYER_START_MODE_9,
/* 0xA */ PLAYER_START_MODE_A,
/* 0xB */ PLAYER_START_MODE_B,
/* 0xC */ PLAYER_START_MODE_TELESCOPE,
/* 0xD */ PLAYER_START_MODE_D,
/* 0xE */ PLAYER_START_MODE_E,
/* 0xF */ PLAYER_START_MODE_F,
/* 0x10 */ PLAYER_START_MODE_MAX // Must not exceed 0x10 as `PLAYER_GET_START_MODE` is limited to a nibble in player params
} PlayerStartMode;
#define PLAYER_PARAMS(startBgCamIndex, startMode) ((startBgCamIndex & 0xFF) | ((startMode & 0xF) << 8))
typedef enum PlayerShield {
/* 0 */ PLAYER_SHIELD_NONE,
/* 1 */ PLAYER_SHIELD_HEROS_SHIELD,
@ -1074,32 +1099,6 @@ typedef enum PlayerCueId {
// Currently locked onto a hostile actor. Triggers a "battle" variant of many actions.
#define PLAYER_STATE3_HOSTILE_LOCK_ON (1 << 31)
#define PLAYER_GET_BG_CAM_INDEX(thisx) ((thisx)->params & 0xFF)
#define PLAYER_GET_INITMODE(thisx) (((thisx)->params & 0xF00) >> 8)
typedef enum PlayerInitMode {
/* 0x0 */ PLAYER_INITMODE_0,
/* 0x1 */ PLAYER_INITMODE_1, // Spawning after pulling/putting-back Master sword // OoT leftover
/* 0x2 */ PLAYER_INITMODE_2,
/* 0x3 */ PLAYER_INITMODE_3,
/* 0x4 */ PLAYER_INITMODE_4,
/* 0x5 */ PLAYER_INITMODE_5,
/* 0x6 */ PLAYER_INITMODE_6,
/* 0x7 */ PLAYER_INITMODE_7,
/* 0x8 */ PLAYER_INITMODE_8,
/* 0x9 */ PLAYER_INITMODE_9,
/* 0xA */ PLAYER_INITMODE_A,
/* 0xB */ PLAYER_INITMODE_B,
/* 0xC */ PLAYER_INITMODE_TELESCOPE,
/* 0xD */ PLAYER_INITMODE_D,
/* 0xE */ PLAYER_INITMODE_E,
/* 0xF */ PLAYER_INITMODE_F,
/* 0x10 */ PLAYER_INITMODE_MAX // Must not exceed 0x10 as `PLAYER_GET_INITMODE` is limited to a nibble in player params
} PlayerInitMode;
#define PLAYER_PARAMS(startBgCamIndex, initMode) ((startBgCamIndex & 0xFF) | ((initMode & 0xF) << 8))
typedef enum PlayerUnkAA5 {
/* 0 */ PLAYER_UNKAA5_0,
/* 1 */ PLAYER_UNKAA5_1,

View File

@ -80,7 +80,7 @@ void func_80127B64(struct_801F58B0 arg0[], s32 count, Vec3f* arg2);
s32 func_801226E0(PlayState* play, s32 arg1) {
if (arg1 == 0) {
Play_SetupRespawnPoint(play, RESPAWN_MODE_DOWN, PLAYER_PARAMS(0xFF, PLAYER_INITMODE_B));
Play_SetupRespawnPoint(play, RESPAWN_MODE_DOWN, PLAYER_PARAMS(0xFF, PLAYER_START_MODE_B));
if (play->sceneId == SCENE_KAKUSIANA) {
return 1;
}

View File

@ -162,9 +162,9 @@ void Scene_CommandSpawnList(PlayState* play, SceneCmd* cmd) {
play->linkActorEntry =
(ActorEntry*)Lib_SegmentedToVirtual(cmd->spawnList.segment) + play->setupEntranceList[play->curSpawn].spawn;
if ((PLAYER_GET_INITMODE(play->linkActorEntry) == PLAYER_INITMODE_TELESCOPE) ||
((gSaveContext.respawnFlag == 2) &&
(gSaveContext.respawn[RESPAWN_MODE_RETURN].playerParams == PLAYER_PARAMS(0xFF, PLAYER_INITMODE_TELESCOPE)))) {
if ((PLAYER_GET_START_MODE(play->linkActorEntry) == PLAYER_START_MODE_TELESCOPE) ||
((gSaveContext.respawnFlag == 2) && (gSaveContext.respawn[RESPAWN_MODE_RETURN].playerParams ==
PLAYER_PARAMS(0xFF, PLAYER_START_MODE_TELESCOPE)))) {
// Skull Kid Object
Object_SpawnPersistent(&play->objectCtx, OBJECT_STK);
return;

View File

@ -141,7 +141,7 @@ void DoorAna_WaitOpen(DoorAna* this, PlayState* play) {
} else {
s32 destinationIdx = DOORANA_GET_ENTRANCE(&this->actor);
Play_SetupRespawnPoint(play, RESPAWN_MODE_UNK_3, PLAYER_PARAMS(0xFF, PLAYER_INITMODE_4));
Play_SetupRespawnPoint(play, RESPAWN_MODE_UNK_3, PLAYER_PARAMS(0xFF, PLAYER_START_MODE_4));
gSaveContext.respawn[RESPAWN_MODE_UNK_3].pos.y = this->actor.world.pos.y;
gSaveContext.respawn[RESPAWN_MODE_UNK_3].yaw = this->actor.home.rot.y;

View File

@ -953,7 +953,7 @@ void EnKakasi_DancingNightAway(EnKakasi* this, PlayState* play) {
player = GET_PLAYER(play);
Play_SetRespawnData(play, RESPAWN_MODE_DOWN, Entrance_CreateFromSpawn(0), player->unk_3CE,
PLAYER_PARAMS(0xFF, PLAYER_INITMODE_B), &player->unk_3C0, player->unk_3CC);
PLAYER_PARAMS(0xFF, PLAYER_START_MODE_B), &player->unk_3C0, player->unk_3CC);
func_80169EFC(play);
if ((CURRENT_TIME > CLOCK_TIME(18, 0)) || (CURRENT_TIME < CLOCK_TIME(6, 0))) {

View File

@ -454,7 +454,7 @@ void EnTest4_HandleEvents(EnTest4* this, PlayState* play) {
// Turn day with DayTelop cutscene
gSaveContext.screenScale = 0.0f;
Play_SetRespawnData(play, RESPAWN_MODE_DOWN, Entrance_CreateFromSpawn(0), player->unk_3CE,
PLAYER_PARAMS(0xFF, PLAYER_INITMODE_B), &player->unk_3C0, player->unk_3CC);
PLAYER_PARAMS(0xFF, PLAYER_START_MODE_B), &player->unk_3C0, player->unk_3CC);
func_80169EFC(play);
if (player->stateFlags1 & PLAYER_STATE1_800000) {
EnHorse* rideActor = (EnHorse*)player->rideActor;
@ -507,9 +507,9 @@ void EnTest4_HandleEvents(EnTest4* this, PlayState* play) {
u32 entrance = gSaveContext.save.entrance;
if (play->actorCtx.flags & ACTORCTX_FLAG_TELESCOPE_ON) {
playerParams = PLAYER_PARAMS(0xFF, PLAYER_INITMODE_TELESCOPE);
playerParams = PLAYER_PARAMS(0xFF, PLAYER_START_MODE_TELESCOPE);
} else {
playerParams = PLAYER_PARAMS(0xFF, PLAYER_INITMODE_B);
playerParams = PLAYER_PARAMS(0xFF, PLAYER_START_MODE_B);
}
Play_SetRespawnData(play, RESPAWN_MODE_RETURN, entrance, player->unk_3CE, playerParams,

View File

@ -1082,7 +1082,7 @@ void EnTest6_SharedSoTCutscene(EnTest6* this, PlayState* play) {
case SOTCS_CUEID_DOUBLE_END:
Play_SetRespawnData(play, RESPAWN_MODE_RETURN, ((void)0, gSaveContext.save.entrance), player->unk_3CE,
PLAYER_PARAMS(0xFF, PLAYER_INITMODE_B), &player->unk_3C0, player->unk_3CC);
PLAYER_PARAMS(0xFF, PLAYER_START_MODE_B), &player->unk_3C0, player->unk_3CC);
this->drawType = SOTCS_DRAW_TYPE_NONE;
play->transitionTrigger = TRANS_TRIGGER_START;
play->nextEntrance = gSaveContext.respawn[RESPAWN_MODE_RETURN].entrance;
@ -1164,7 +1164,7 @@ void EnTest6_SharedSoTCutscene(EnTest6* this, PlayState* play) {
case SOTCS_CUEID_DOUBLE_END:
if (CURRENT_TIME > CLOCK_TIME(12, 0)) {
Play_SetRespawnData(play, RESPAWN_MODE_RETURN, ((void)0, gSaveContext.save.entrance),
player->unk_3CE, PLAYER_PARAMS(0xFF, PLAYER_INITMODE_B), &player->unk_3C0,
player->unk_3CE, PLAYER_PARAMS(0xFF, PLAYER_START_MODE_B), &player->unk_3C0,
player->unk_3CC);
this->drawType = SOTCS_DRAW_TYPE_NONE;
play->transitionTrigger = TRANS_TRIGGER_START;

View File

@ -662,7 +662,7 @@ void EnTest7_WarpCsWarp(EnTest7* this, PlayState* play) {
} else if (OWL_WARP_CS_GET_OCARINA_MODE(&this->actor) == OCARINA_MODE_WARP_TO_ENTRANCE) {
func_80169F78(play);
gSaveContext.respawn[RESPAWN_MODE_TOP].playerParams =
PLAYER_PARAMS(gSaveContext.respawn[RESPAWN_MODE_TOP].playerParams, PLAYER_INITMODE_6);
PLAYER_PARAMS(gSaveContext.respawn[RESPAWN_MODE_TOP].playerParams, PLAYER_START_MODE_6);
gSaveContext.respawnFlag = -6;
} else {
play->nextEntrance =

View File

@ -81,7 +81,7 @@ void EnTorch2_Destroy(Actor* thisx, PlayState* play) {
Collider_DestroyCylinder(play, &this->collider);
Play_SetRespawnData(play, this->actor.params + RESPAWN_MODE_GORON - 1, 0xFF, 0,
PLAYER_PARAMS(0xFF, PLAYER_INITMODE_B), &this->actor.world.pos, this->actor.shape.rot.y);
PLAYER_PARAMS(0xFF, PLAYER_START_MODE_B), &this->actor.world.pos, this->actor.shape.rot.y);
play->actorCtx.elegyShells[this->actor.params] = NULL;
}

View File

@ -571,7 +571,7 @@ s32 func_80BA47E0(EnToto* this, PlayState* play) {
Math_Vec3s_ToVec3f(&spawnPos, &D_80BA50DC[i].unk6);
Actor_Spawn(&play->actorCtx, play, ACTOR_PLAYER, spawnPos.x, spawnPos.y, spawnPos.z, i + 2, 0, 0,
PLAYER_PARAMS(0xFF, PLAYER_INITMODE_F) | 0xFFFFF000);
PLAYER_PARAMS(0xFF, PLAYER_START_MODE_F) | 0xFFFFF000);
}
}
func_80BA402C(this, play);

View File

@ -205,9 +205,9 @@ void EnWarpTag_RespawnPlayer(EnWarptag* this, PlayState* play) {
newRespawnPos.z = playerActorEntry->pos.z;
if (WARPTAG_GET_3C0_MAX(&this->dyna.actor) == WARPTAG_3C0_MAX) {
playerParams = PLAYER_PARAMS(0xFF, PLAYER_INITMODE_9);
playerParams = PLAYER_PARAMS(0xFF, PLAYER_START_MODE_9);
} else { // not used by any known variant
playerParams = PLAYER_PARAMS(0xFF, PLAYER_INITMODE_8);
playerParams = PLAYER_PARAMS(0xFF, PLAYER_START_MODE_8);
}
// why are we getting player home rotation from the room data? doesnt player have home.rot.y?

View File

@ -60,11 +60,11 @@ static s16 sSpawnActorIds[OBJMURE_TYPE_MAX] = {
};
static s16 sSpawnParams[OBJMURE_TYPE_MAX] = {
KUSA_BUSH_PARAMS(false, 0, false), // OBJMURE_TYPE_GRASS
PLAYER_PARAMS(2, PLAYER_INITMODE_0), // OBJMURE_TYPE_UNDEFINED
FISH_PARAMS(ENFISH_MINUS1), // OBJMURE_TYPE_FISH
ENINSECT_PARAMS(false), // OBJMURE_TYPE_BUGS
BUTTERFLY_PARAMS(BUTTERFLY_MINUS1), // OBJMURE_TYPE_BUTTERFLY
KUSA_BUSH_PARAMS(false, 0, false), // OBJMURE_TYPE_GRASS
PLAYER_PARAMS(2, PLAYER_START_MODE_0), // OBJMURE_TYPE_UNDEFINED
FISH_PARAMS(ENFISH_MINUS1), // OBJMURE_TYPE_FISH
ENINSECT_PARAMS(false), // OBJMURE_TYPE_BUGS
BUTTERFLY_PARAMS(BUTTERFLY_MINUS1), // OBJMURE_TYPE_BUTTERFLY
};
static InitChainEntry sInitChain[] = {

View File

@ -455,7 +455,7 @@ void ObjTokeidai_TowerOpening_EndCutscene(ObjTokeidai* this, PlayState* play) {
play->nextEntrance = gSaveContext.respawn[RESPAWN_MODE_RETURN].entrance;
play->transitionType = TRANS_TYPE_FADE_BLACK;
if (gSaveContext.respawn[RESPAWN_MODE_RETURN].playerParams ==
PLAYER_PARAMS(0xFF, PLAYER_INITMODE_TELESCOPE)) {
PLAYER_PARAMS(0xFF, PLAYER_START_MODE_TELESCOPE)) {
gSaveContext.nextTransitionType = TRANS_TYPE_CIRCLE;
} else {
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_BLACK;

View File

@ -253,24 +253,6 @@ s32 Player_ActionHandler_12(Player* this, PlayState* play);
s32 Player_ActionHandler_13(Player* this, PlayState* play);
s32 Player_ActionHandler_14(Player* this, PlayState* play);
/* Init Mode functions */
void Player_InitMode_0(PlayState* play, Player* this);
void Player_InitMode_1(PlayState* play, Player* this);
void Player_InitMode_2(PlayState* play, Player* this);
void Player_InitMode_3(PlayState* play, Player* this);
void Player_InitMode_4(PlayState* play, Player* this);
void Player_InitMode_5(PlayState* play, Player* this);
void Player_InitMode_6(PlayState* play, Player* this);
void Player_InitMode_7(PlayState* play, Player* this);
void func_80841744(PlayState* play, Player* this);
void func_80841744(PlayState* play, Player* this);
void func_8083ADF0(PlayState* play, Player* this);
void Player_InitMode_B(PlayState* play, Player* this);
void Player_InitMode_Telescope(PlayState* play, Player* this);
void Player_InitMode_D(PlayState* play, Player* this);
void func_8083ADF0(PlayState* play, Player* this);
void Player_InitMode_F(PlayState* play, Player* this);
/* Cutscene functions */
void Player_CsAction_0(PlayState* play, Player* this, CsCmdActorCue* cue);
void Player_CsAction_1(PlayState* play, Player* this, CsCmdActorCue* cue);
@ -8648,7 +8630,7 @@ void func_8083A98C(Actor* thisx, PlayState* play2) {
}
// Set up using a telescope
void Player_InitMode_Telescope(PlayState* play, Player* this) {
void Player_StartMode_Telescope(PlayState* play, Player* this) {
this->actor.update = func_8083A98C;
this->actor.draw = NULL;
if (play->sceneId == SCENE_00KEIKOKU) {
@ -8667,18 +8649,17 @@ void Player_InitMode_Telescope(PlayState* play, Player* this) {
play->actorCtx.flags |= ACTORCTX_FLAG_TELESCOPE_ON;
}
void Player_InitMode_B(PlayState* play, Player* this) {
void Player_StartMode_B(PlayState* play, Player* this) {
func_8085B384(this, play);
}
void Player_InitMode_D(PlayState* play, Player* this) {
void Player_StartMode_D(PlayState* play, Player* this) {
if (func_8083A878(play, this, 180.0f)) {
this->av2.actionVar2 = -20;
}
}
// InitModes 0xA and 0xE
void func_8083ADF0(PlayState* play, Player* this) {
void Player_StartMode_E(PlayState* play, Player* this) {
this->speedXZ = 2.0f;
gSaveContext.entranceSpeed = 2.0f;
@ -8687,7 +8668,7 @@ void func_8083ADF0(PlayState* play, Player* this) {
}
}
void Player_InitMode_F(PlayState* play, Player* this) {
void Player_StartMode_F(PlayState* play, Player* this) {
if (gSaveContext.entranceSpeed < 0.1f) {
gSaveContext.entranceSpeed = 0.1f;
}
@ -10870,12 +10851,12 @@ s32 func_808411D4(PlayState* play, Player* this, f32* arg2, s32 arg3) {
return sp2C;
}
void Player_InitMode_0(PlayState* play, Player* this) {
void Player_StartMode_0(PlayState* play, Player* this) {
this->actor.update = func_801229EC;
this->actor.draw = NULL;
}
void Player_InitMode_2(PlayState* play, Player* this) {
void Player_StartMode_2(PlayState* play, Player* this) {
Player_SetAction(play, this, Player_Action_76, 0);
this->stateFlags1 |= PLAYER_STATE1_20000000;
PlayerAnimation_Change(play, &this->skelAnime, &gPlayerAnim_link_okarina_warp_goal, PLAYER_ANIM_ADJUSTED_SPEED,
@ -10909,7 +10890,7 @@ void func_80841358(PlayState* play, Player* this, s32 arg2) {
Vec3f D_8085D2B4 = { -1.0f, 69.0f, 20.0f };
void Player_InitMode_1(PlayState* play, Player* this) {
void Player_StartMode_1(PlayState* play, Player* this) {
Player_SetAction(play, this, Player_Action_66, 0);
this->stateFlags1 |= PLAYER_STATE1_20000000;
Math_Vec3f_Copy(&this->actor.world.pos, &D_8085D2B4);
@ -10924,30 +10905,30 @@ void Player_InitMode_1(PlayState* play, Player* this) {
this->av2.actionVar2 = 20;
}
void Player_InitMode_3(PlayState* play, Player* this) {
void Player_StartMode_3(PlayState* play, Player* this) {
Player_SetAction(play, this, Player_Action_78, 0);
Player_AnimReplace_Setup(play, this,
ANIM_FLAG_1 | ANIM_FLAG_UPDATE_Y | ANIM_FLAG_8 | ANIM_FLAG_NOMOVE | ANIM_FLAG_80);
}
void Player_InitMode_4(PlayState* play, Player* this) {
void Player_StartMode_4(PlayState* play, Player* this) {
func_80834DB8(this, &gPlayerAnim_link_normal_jump, 12.0f, play);
Player_SetAction(play, this, Player_Action_79, 0);
this->stateFlags1 |= PLAYER_STATE1_20000000;
this->fallStartHeight = this->actor.world.pos.y;
}
void Player_InitMode_7(PlayState* play, Player* this) {
void Player_StartMode_7(PlayState* play, Player* this) {
func_80833B18(play, this, 1, 2.0f, 2.0f, this->actor.shape.rot.y + 0x8000, 0);
}
void Player_InitMode_5(PlayState* play, Player* this) {
void Player_StartMode_5(PlayState* play, Player* this) {
Player_SetAction(play, this, Player_Action_75, 0);
this->actor.draw = NULL;
this->stateFlags1 |= PLAYER_STATE1_20000000;
}
void Player_InitMode_6(PlayState* play, Player* this) {
void Player_StartMode_6(PlayState* play, Player* this) {
if (gSaveContext.save.isOwlSave) {
Player_SetAction(play, this, Player_Action_0, 0);
Player_Anim_PlayLoopMorph(play, this, D_8085BE84[PLAYER_ANIMGROUP_nwait][this->modelAnimType]);
@ -10964,10 +10945,9 @@ void Player_InitMode_6(PlayState* play, Player* this) {
}
}
// InitModes 0x8 and 0x9
void func_80841744(PlayState* play, Player* this) {
void Player_StartMode_WarpTag(PlayState* play, Player* this) {
Player_SetAction(play, this, Player_Action_91, 0);
if (PLAYER_GET_INITMODE(&this->actor) == PLAYER_INITMODE_8) {
if (PLAYER_GET_START_MODE(&this->actor) == PLAYER_START_MODE_8) {
Player_Anim_PlayOnceAdjustedReverse(play, this, D_8085D17C[this->transformation]);
this->itemAction = PLAYER_IA_OCARINA;
Player_SetModels(this, Player_ActionToModelGroup(this, this->itemAction));
@ -10990,9 +10970,9 @@ void Player_InitCommon(Player* this, PlayState* play, FlexSkeletonHeader* skelHe
Actor_ProcessInitChain(&this->actor, sInitChain);
this->yaw = this->actor.world.rot.y;
if ((PLAYER_GET_INITMODE(&this->actor) != PLAYER_INITMODE_TELESCOPE) &&
((gSaveContext.respawnFlag != 2) ||
(gSaveContext.respawn[RESPAWN_MODE_RETURN].playerParams != PLAYER_PARAMS(0xFF, PLAYER_INITMODE_TELESCOPE)))) {
if ((PLAYER_GET_START_MODE(&this->actor) != PLAYER_START_MODE_TELESCOPE) &&
((gSaveContext.respawnFlag != 2) || (gSaveContext.respawn[RESPAWN_MODE_RETURN].playerParams !=
PLAYER_PARAMS(0xFF, PLAYER_START_MODE_TELESCOPE)))) {
func_808309CC(play, this);
SkelAnime_InitPlayer(play, &this->skelAnime, skelHeader, D_8085BE84[PLAYER_ANIMGROUP_wait][this->modelAnimType],
1 | 8, this->jointTableBuffer, this->morphTableBuffer, PLAYER_LIMB_MAX);
@ -11027,27 +11007,27 @@ void func_80841A50(PlayState* play, Player* this) {
}
}
typedef void (*PlayerInitModeFunc)(PlayState*, Player*);
typedef void (*PlayerStartModeFunc)(PlayState*, Player*);
// Initialisation functions for various gameplay modes depending on spawn params.
// There may be at most 0x10 due to it using a single nybble.
PlayerInitModeFunc sPlayerInitModeFuncs[PLAYER_INITMODE_MAX] = {
Player_InitMode_0, // PLAYER_INITMODE_0
Player_InitMode_1, // PLAYER_INITMODE_1
Player_InitMode_2, // PLAYER_INITMODE_2
Player_InitMode_3, // PLAYER_INITMODE_3
Player_InitMode_4, // PLAYER_INITMODE_4
Player_InitMode_5, // PLAYER_INITMODE_5
Player_InitMode_6, // PLAYER_INITMODE_6
Player_InitMode_7, // PLAYER_INITMODE_7
func_80841744, // PLAYER_INITMODE_8
func_80841744, // PLAYER_INITMODE_9
func_8083ADF0, // PLAYER_INITMODE_A
Player_InitMode_B, // PLAYER_INITMODE_B
Player_InitMode_Telescope, // PLAYER_INITMODE_TELESCOPE
Player_InitMode_D, // PLAYER_INITMODE_D
func_8083ADF0, // PLAYER_INITMODE_E
Player_InitMode_F, // PLAYER_INITMODE_F
PlayerStartModeFunc sStartModeFuncs[PLAYER_START_MODE_MAX] = {
Player_StartMode_0, // PLAYER_START_MODE_0
Player_StartMode_1, // PLAYER_START_MODE_1
Player_StartMode_2, // PLAYER_START_MODE_2
Player_StartMode_3, // PLAYER_START_MODE_3
Player_StartMode_4, // PLAYER_START_MODE_4
Player_StartMode_5, // PLAYER_START_MODE_5
Player_StartMode_6, // PLAYER_START_MODE_6
Player_StartMode_7, // PLAYER_START_MODE_7
Player_StartMode_WarpTag, // PLAYER_START_MODE_8
Player_StartMode_WarpTag, // PLAYER_START_MODE_9
Player_StartMode_E, // PLAYER_START_MODE_A
Player_StartMode_B, // PLAYER_START_MODE_B
Player_StartMode_Telescope, // PLAYER_START_MODE_TELESCOPE
Player_StartMode_D, // PLAYER_START_MODE_D
Player_StartMode_E, // PLAYER_START_MODE_E
Player_StartMode_F, // PLAYER_START_MODE_F
};
// sBlureInit
@ -11074,7 +11054,6 @@ EffectTireMarkInit D_8085D330 = { 0, 63, { 0, 0, 15, 100 } };
Color_RGBA8 D_8085D338 = { 0, 0, 15, 100 };
// sTireMarkOtherColor ?
Color_RGBA8 D_8085D33C = { 0, 0, 0, 150 };
Vec3f D_8085D340 = { 0.0f, 50.0f, 0.0f };
void Player_Init(Actor* thisx, PlayState* play) {
s32 pad;
@ -11082,7 +11061,7 @@ void Player_Init(Actor* thisx, PlayState* play) {
s8 objectSlot;
s32 respawnFlag;
s32 var_a1;
PlayerInitMode initMode;
PlayerStartMode startMode;
play->playerInit = Player_InitCommon;
play->playerUpdate = Player_UpdateCommon;
@ -11281,7 +11260,7 @@ void Player_Init(Actor* thisx, PlayState* play) {
var_a1 = ((respawnFlag == 4) || (gSaveContext.respawnFlag == -4)) ? 1 : 0;
if (func_801226E0(play, var_a1) == 0) {
gSaveContext.respawn[RESPAWN_MODE_DOWN].playerParams = PLAYER_PARAMS(thisx->params, PLAYER_INITMODE_D);
gSaveContext.respawn[RESPAWN_MODE_DOWN].playerParams = PLAYER_PARAMS(thisx->params, PLAYER_START_MODE_D);
}
gSaveContext.respawn[RESPAWN_MODE_DOWN].data = 1;
@ -11289,21 +11268,24 @@ void Player_Init(Actor* thisx, PlayState* play) {
gSaveContext.respawn[RESPAWN_MODE_TOP] = gSaveContext.respawn[RESPAWN_MODE_DOWN];
}
gSaveContext.respawn[RESPAWN_MODE_TOP].playerParams =
PLAYER_PARAMS(gSaveContext.respawn[RESPAWN_MODE_TOP].playerParams, PLAYER_INITMODE_D);
PLAYER_PARAMS(gSaveContext.respawn[RESPAWN_MODE_TOP].playerParams, PLAYER_START_MODE_D);
initMode = PLAYER_GET_INITMODE(&this->actor);
if (((initMode == PLAYER_INITMODE_5) || (initMode == PLAYER_INITMODE_6)) &&
startMode = PLAYER_GET_START_MODE(&this->actor);
if (((startMode == PLAYER_START_MODE_5) || (startMode == PLAYER_START_MODE_6)) &&
(gSaveContext.save.cutsceneIndex >= 0xFFF0)) {
initMode = PLAYER_INITMODE_D;
startMode = PLAYER_START_MODE_D;
}
sPlayerInitModeFuncs[initMode](play, this);
sStartModeFuncs[startMode](play, this);
if ((this->actor.draw != NULL) && gSaveContext.save.hasTatl &&
((gSaveContext.gameMode == GAMEMODE_NORMAL) || (gSaveContext.gameMode == GAMEMODE_END_CREDITS)) &&
(play->sceneId != SCENE_SPOT00)) {
this->tatlActor =
Player_SpawnFairy(play, this, &this->actor.world.pos, &D_8085D340, FAIRY_PARAMS(FAIRY_TYPE_0, false, 0));
static Vec3f sTatlSpawnPosOffset = { 0.0f, 50.0f, 0.0f };
this->tatlActor = Player_SpawnFairy(play, this, &this->actor.world.pos, &sTatlSpawnPosOffset,
FAIRY_PARAMS(FAIRY_TYPE_0, false, 0));
if (gSaveContext.dogParams != 0) {
gSaveContext.dogParams |= 0x8000;
@ -13721,7 +13703,7 @@ void func_80848640(PlayState* play, Player* this) {
if (torch2 != NULL) {
play->actorCtx.elegyShells[this->transformation] = torch2;
Play_SetupRespawnPoint(play, this->transformation + 3, PLAYER_PARAMS(0xFF, PLAYER_INITMODE_B));
Play_SetupRespawnPoint(play, this->transformation + 3, PLAYER_PARAMS(0xFF, PLAYER_START_MODE_B));
}
effChange = Actor_Spawn(&play->actorCtx, play, ACTOR_EFF_CHANGE, this->actor.world.pos.x, this->actor.world.pos.y,
@ -15851,7 +15833,7 @@ void Player_Action_36(Player* this, PlayState* play) {
}
Camera_SetFinishedFlag(Play_GetCamera(play, CAM_ID_MAIN));
Play_SetupRespawnPoint(play, RESPAWN_MODE_DOWN, PLAYER_PARAMS(0xFF, PLAYER_INITMODE_B));
Play_SetupRespawnPoint(play, RESPAWN_MODE_DOWN, PLAYER_PARAMS(0xFF, PLAYER_START_MODE_B));
}
}
} else if (!(this->stateFlags1 & PLAYER_STATE1_20000000) && PlayerAnimation_OnFrame(&this->skelAnime, 15.0f)) {
@ -18746,7 +18728,7 @@ void Player_Action_91(Player* this, PlayState* play) {
if (BINANG_SUB(this->actor.shape.rot.y, this->actor.world.rot.y) >= 0) {
this->actor.shape.rot.y = this->actor.world.rot.y;
Player_StopCutscene(this);
if (PLAYER_GET_INITMODE(&this->actor) == PLAYER_INITMODE_8) {
if (PLAYER_GET_START_MODE(&this->actor) == PLAYER_START_MODE_8) {
anim = D_8085D17C[this->transformation];
func_80836A5C(this, play);
PlayerAnimation_Change(play, &this->skelAnime, anim, -PLAYER_ANIM_ADJUSTED_SPEED,

View File

@ -4500,11 +4500,11 @@
0x8083A844:("func_8083A844",),
0x8083A878:("func_8083A878",),
0x8083A98C:("func_8083A98C",),
0x8083AD04:("Player_InitMode_Telescope",),
0x8083AD8C:("Player_InitMode_B",),
0x8083ADB8:("Player_InitMode_D",),
0x8083ADF0:("func_8083ADF0",),
0x8083AE38:("Player_InitMode_F",),
0x8083AD04:("Player_StartMode_Telescope",),
0x8083AD8C:("Player_StartMode_B",),
0x8083ADB8:("Player_StartMode_D",),
0x8083ADF0:("Player_StartMode_E",),
0x8083AE38:("Player_StartMode_F",),
0x8083AECC:("func_8083AECC",),
0x8083AF30:("func_8083AF30",),
0x8083AF8C:("func_8083AF8C",),
@ -4590,16 +4590,16 @@
0x80840F34:("func_80840F34",),
0x80840F90:("func_80840F90",),
0x808411D4:("func_808411D4",),
0x808412A0:("Player_InitMode_0",),
0x808412BC:("Player_InitMode_2",),
0x808412A0:("Player_StartMode_0",),
0x808412BC:("Player_StartMode_2",),
0x80841358:("func_80841358",),
0x80841408:("Player_InitMode_1",),
0x808414E0:("Player_InitMode_3",),
0x80841528:("Player_InitMode_4",),
0x808415A0:("Player_InitMode_7",),
0x808415E4:("Player_InitMode_5",),
0x80841624:("Player_InitMode_6",),
0x80841744:("func_80841744",),
0x80841408:("Player_StartMode_1",),
0x808414E0:("Player_StartMode_3",),
0x80841528:("Player_StartMode_4",),
0x808415A0:("Player_StartMode_7",),
0x808415E4:("Player_StartMode_5",),
0x80841624:("Player_StartMode_6",),
0x80841744:("Player_StartMode_WarpTag",),
0x8084182C:("Player_InitCommon",),
0x80841A50:("func_80841A50",),
0x80841AC4:("Player_Init",),

View File

@ -4900,12 +4900,12 @@
0x8085D2B4:("D_8085D2B4","UNK_TYPE1","",0x1),
0x8085D2C0:("sInitChain","ActorInitVar","",0x4),
0x8085D2C4:("sPlayerSkeletonBaseTransl","UNK_TYPE4","",0x4),
0x8085D2CC:("sPlayerInitModeFuncs","UNK_PTR","",0x4),
0x8085D2CC:("sStartModeFuncs","UNK_PTR","",0x4),
0x8085D30C:("D_8085D30C","EffectBlureInit2","",0x24),
0x8085D330:("D_8085D330","EffectTireMarkInit","",0x8),
0x8085D338:("D_8085D338","UNK_TYPE4","",0x4),
0x8085D33C:("D_8085D33C","UNK_TYPE4","",0x4),
0x8085D340:("D_8085D340","UNK_TYPE1","",0x1),
0x8085D340:("sTatlSpawnPosOffset","UNK_TYPE1","",0x1),
0x8085D34C:("D_8085D34C","UNK_TYPE1","",0x1),
0x8085D354:("D_8085D354","UNK_TYPE1","",0x1),
0x8085D358:("sInteractWallCheckOffset","Vec3f","",0xC),