Polishing, climb everything door opening + sloped ledge climb up (#6936)

Allow player to try opening doors while climbing. Player can't open anything if a door doesn't offer it, so it's ok to try. Handle doors don't change player y position (player walks in the air), so manually lower it.
    Increase y height limit for doors to offer open from 15.0f/20.0f to 50.0f (normal door height). (For shutter doors height could be individualized depending on shutter door type in the future.)
    Make climbing up animation play even for sloped ledges. The animation/action breaks because game thinks player is not on ground. So, at the end of Player_ProcessSceneCollision, if player is in climbing up action, manually set BGCHECKFLAG_GROUND.
This commit is contained in:
djevangelia
2026-07-19 19:04:32 +02:00
committed by GitHub
parent 8cb0c74592
commit e579e7b9a4
7 changed files with 82 additions and 3 deletions
@@ -335,7 +335,9 @@ f32 DoorShutter_GetPlayerDistance(PlayState* play, DoorShutter* this, f32 arg2,
sp28.y = player->actor.world.pos.y + arg2;
sp28.z = player->actor.world.pos.z;
Actor_WorldToActorCoords(&this->dyna.actor, &sp1C, &sp28);
if (GameInteractor_Should(VB_BE_NEAR_DOOR_SHUTTER, arg3 < fabsf(sp1C.x) || arg4 < fabsf(sp1C.y), this, &sp1C)) {
if (GameInteractor_Should(VB_BE_NEAR_DOOR_SHUTTER, (arg3 < fabsf(sp1C.x) || arg4 < fabsf(sp1C.y)), this, &sp1C,
&arg3)) {
return FLT_MAX;
} else {
return sp1C.z;
@@ -212,8 +212,10 @@ void EnDoor_Idle(EnDoor* this, PlayState* play) {
GameInteractor_ExecuteOnDungeonKeyUsedHooks(gSaveContext.mapIndex);
}
} else if (!Player_InCsMode(play)) {
if (fabsf(playerPosRelToDoor.y) < 20.0f && fabsf(playerPosRelToDoor.x) < 20.0f &&
fabsf(playerPosRelToDoor.z) < 50.0f) {
if (GameInteractor_Should(VB_EN_DOOR_OFFER_OPEN,
(fabsf(playerPosRelToDoor.y) < 20.0f && fabsf(playerPosRelToDoor.x) < 20.0f &&
fabsf(playerPosRelToDoor.z) < 50.0f),
&playerPosRelToDoor)) {
phi_v0 = player->actor.shape.rot.y - this->actor.shape.rot.y;
if (playerPosRelToDoor.z > 0.0f) {
phi_v0 = 0x8000 - phi_v0;
@@ -11437,6 +11437,8 @@ void Player_ProcessSceneCollision(PlayState* play, Player* this) {
this->prevFloorType = sFloorType;
this->floorTypeTimer = 0;
}
GameInteractor_Should(VB_AFTER_PROCESS_SCENE_COLLISION, true);
}
void Player_UpdateCamAndSeqModes(PlayState* play, Player* this) {