Fix dark link ice floors (#5808)
This commit is contained in:
@@ -619,6 +619,7 @@ void FixClubMoblinScale(void* ptr) {
|
||||
|
||||
void RegisterEnemyRandomizer() {
|
||||
COND_ID_HOOK(OnActorInit, ACTOR_EN_MB, CVAR_ENEMY_RANDOMIZER_VALUE, FixClubMoblinScale);
|
||||
|
||||
// prevent dark link from triggering a voidout
|
||||
COND_VB_SHOULD(VB_TRIGGER_VOIDOUT, CVAR_ENEMY_RANDOMIZER_VALUE != CVAR_ENEMY_RANDOMIZER_DEFAULT, {
|
||||
Actor* actor = va_arg(args, Actor*);
|
||||
@@ -647,6 +648,24 @@ void RegisterEnemyRandomizer() {
|
||||
}
|
||||
});
|
||||
|
||||
// prevent dark link from interfering with ice floors
|
||||
COND_VB_SHOULD(VB_SET_STATIC_PREV_FLOOR_TYPE, CVAR_ENEMY_RANDOMIZER_VALUE != CVAR_ENEMY_RANDOMIZER_DEFAULT, {
|
||||
Player* playerOrDarkLink = va_arg(args, Player*);
|
||||
|
||||
if (playerOrDarkLink->actor.id != ACTOR_PLAYER) {
|
||||
*should = false;
|
||||
}
|
||||
});
|
||||
|
||||
// prevent dark link from interfering with ice floors
|
||||
COND_VB_SHOULD(VB_SET_STATIC_FLOOR_TYPE, CVAR_ENEMY_RANDOMIZER_VALUE != CVAR_ENEMY_RANDOMIZER_DEFAULT, {
|
||||
Player* playerOrDarkLink = va_arg(args, Player*);
|
||||
|
||||
if (playerOrDarkLink->actor.id != ACTOR_PLAYER) {
|
||||
*should = false;
|
||||
}
|
||||
});
|
||||
|
||||
// prevent dark link from being grabbed by like likes and therefore grabbing the player
|
||||
COND_VB_SHOULD(VB_LIKE_LIKE_GRAB_PLAYER, CVAR_ENEMY_RANDOMIZER_VALUE != CVAR_ENEMY_RANDOMIZER_DEFAULT, {
|
||||
EnRr* likeLike = va_arg(args, EnRr*);
|
||||
|
||||
@@ -2239,6 +2239,7 @@ typedef enum {
|
||||
// #### `args`
|
||||
// - `*PlayState`
|
||||
VB_SHOW_GAMEPLAY_TIMER,
|
||||
|
||||
// (this->dyna.actor.params >> 5 & 0x7F) == GI_ICE_TRAP && this->actionFunc == EnBox_Open &&
|
||||
// this->skelanime.curFrame > 45 && this->iceSmokeTimer < 100
|
||||
// ```
|
||||
@@ -2253,6 +2254,22 @@ typedef enum {
|
||||
// #### `args`
|
||||
// - `*DoorShutter`
|
||||
VB_BE_NEAR_DOOR_SHUTTER,
|
||||
|
||||
// #### `result`
|
||||
// ```c
|
||||
// true
|
||||
// ```
|
||||
// #### `args`
|
||||
// - `*Player`
|
||||
VB_SET_STATIC_PREV_FLOOR_TYPE,
|
||||
|
||||
// #### `result`
|
||||
// ```c
|
||||
// true
|
||||
// ```
|
||||
// #### `args`
|
||||
// - `*Player`
|
||||
VB_SET_STATIC_FLOOR_TYPE,
|
||||
} GIVanillaBehavior;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -5796,7 +5796,10 @@ void func_8083AA10(Player* this, PlayState* play) {
|
||||
|
||||
if (this->hoverBootsTimer != 0) {
|
||||
this->actor.velocity.y = 1.0f;
|
||||
sPrevFloorProperty = 9;
|
||||
|
||||
if (GameInteractor_Should(VB_SET_STATIC_PREV_FLOOR_TYPE, true, this)) {
|
||||
sPrevFloorProperty = 9;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -11151,7 +11154,9 @@ s32 Player_UpdateHoverBoots(Player* this) {
|
||||
}
|
||||
return false;
|
||||
} else {
|
||||
sFloorType = 0;
|
||||
if (GameInteractor_Should(VB_SET_STATIC_FLOOR_TYPE, true, this)) {
|
||||
sFloorType = 0;
|
||||
}
|
||||
this->floorPitch = this->floorPitchAlt = sFloorShapePitch = 0;
|
||||
|
||||
return true;
|
||||
@@ -11182,7 +11187,9 @@ void Player_ProcessSceneCollision(PlayState* play, Player* this) {
|
||||
f32 ceilingCheckHeight;
|
||||
u32 flags;
|
||||
|
||||
sPrevFloorProperty = this->floorProperty;
|
||||
if (GameInteractor_Should(VB_SET_STATIC_PREV_FLOOR_TYPE, true, this)) {
|
||||
sPrevFloorProperty = this->floorProperty;
|
||||
}
|
||||
|
||||
#define vWallCheckRadius float0
|
||||
#define vWallCheckHeight float1
|
||||
@@ -11453,7 +11460,9 @@ void Player_ProcessSceneCollision(PlayState* play, Player* this) {
|
||||
}
|
||||
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
sFloorType = func_80041D4C(&play->colCtx, floorPoly, this->actor.floorBgId);
|
||||
if (GameInteractor_Should(VB_SET_STATIC_FLOOR_TYPE, true, this)) {
|
||||
sFloorType = func_80041D4C(&play->colCtx, floorPoly, this->actor.floorBgId);
|
||||
}
|
||||
|
||||
if (!Player_UpdateHoverBoots(this)) {
|
||||
f32 floorPolyNormalX;
|
||||
@@ -12100,7 +12109,9 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) {
|
||||
Actor_UpdatePos(&this->actor);
|
||||
Player_ProcessSceneCollision(play, this);
|
||||
} else {
|
||||
sFloorType = 0;
|
||||
if (GameInteractor_Should(VB_SET_STATIC_FLOOR_TYPE, true, this)) {
|
||||
sFloorType = 0;
|
||||
}
|
||||
this->floorProperty = 0;
|
||||
|
||||
if (!(this->stateFlags1 & PLAYER_STATE1_LOADING) && (this->stateFlags1 & PLAYER_STATE1_ON_HORSE)) {
|
||||
|
||||
Reference in New Issue
Block a user