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