Fix issues with faster heavy block lift (#4335)
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#include "z_bg_heavy_block.h"
|
||||
#include "objects/object_heavy_object/object_heavy_object.h"
|
||||
#include "vt.h"
|
||||
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
||||
|
||||
#define FLAGS 0
|
||||
|
||||
@@ -320,18 +321,16 @@ void BgHeavyBlock_Wait(BgHeavyBlock* this, PlayState* play) {
|
||||
if (Actor_HasParent(&this->dyna.actor, play)) {
|
||||
this->timer = 0;
|
||||
|
||||
if (!CVarGetInteger(CVAR_ENHANCEMENT("FasterHeavyBlockLift"), 0)) {
|
||||
switch (this->dyna.actor.params & 0xFF) {
|
||||
case HEAVYBLOCK_BREAKABLE:
|
||||
OnePointCutscene_Init(play, 4020, 270, &this->dyna.actor, MAIN_CAM);
|
||||
break;
|
||||
case HEAVYBLOCK_UNBREAKABLE:
|
||||
OnePointCutscene_Init(play, 4021, 220, &this->dyna.actor, MAIN_CAM);
|
||||
break;
|
||||
case HEAVYBLOCK_UNBREAKABLE_OUTSIDE_CASTLE:
|
||||
OnePointCutscene_Init(play, 4022, 210, &this->dyna.actor, MAIN_CAM);
|
||||
break;
|
||||
}
|
||||
switch (this->dyna.actor.params & 0xFF) {
|
||||
case HEAVYBLOCK_BREAKABLE:
|
||||
OnePointCutscene_Init(play, 4020, 270, &this->dyna.actor, MAIN_CAM);
|
||||
break;
|
||||
case HEAVYBLOCK_UNBREAKABLE:
|
||||
OnePointCutscene_Init(play, 4021, 220, &this->dyna.actor, MAIN_CAM);
|
||||
break;
|
||||
case HEAVYBLOCK_UNBREAKABLE_OUTSIDE_CASTLE:
|
||||
OnePointCutscene_Init(play, 4022, 210, &this->dyna.actor, MAIN_CAM);
|
||||
break;
|
||||
}
|
||||
|
||||
quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), 3);
|
||||
@@ -369,7 +368,7 @@ void BgHeavyBlock_LiftedUp(BgHeavyBlock* this, PlayState* play) {
|
||||
|
||||
this->timer++;
|
||||
|
||||
if (!CVarGetInteger(CVAR_ENHANCEMENT("FasterHeavyBlockLift"), 0)) {
|
||||
if (GameInteractor_Should(VB_FREEZE_LINK_FOR_BLOCK_THROW, true, this)) {
|
||||
Player_SetCsActionWithHaltedActors(play, &player->actor, 8);
|
||||
}
|
||||
|
||||
@@ -408,13 +407,10 @@ void BgHeavyBlock_Fly(BgHeavyBlock* this, PlayState* play) {
|
||||
Quake_SetQuakeValues(quakeIndex, 14, 2, 100, 0);
|
||||
Quake_SetCountdown(quakeIndex, 30);
|
||||
|
||||
// We don't want this arbitrarily long quake with the enhancement enabled
|
||||
if (!CVarGetInteger(CVAR_ENHANCEMENT("FasterHeavyBlockLift"), 0)) {
|
||||
quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), 2);
|
||||
Quake_SetSpeed(quakeIndex, 12000);
|
||||
Quake_SetQuakeValues(quakeIndex, 5, 0, 0, 0);
|
||||
Quake_SetCountdown(quakeIndex, 999);
|
||||
}
|
||||
quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), 2);
|
||||
Quake_SetSpeed(quakeIndex, 12000);
|
||||
Quake_SetQuakeValues(quakeIndex, 5, 0, 0, 0);
|
||||
Quake_SetCountdown(quakeIndex, 999);
|
||||
|
||||
SoundSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 30,
|
||||
NA_SE_EV_ELECTRIC_EXPLOSION);
|
||||
|
||||
@@ -5096,11 +5096,7 @@ void func_8083A0F4(PlayState* play, Player* this) {
|
||||
anim = GET_PLAYER_ANIM(PLAYER_ANIMGROUP_carryB, this->modelAnimType);
|
||||
}
|
||||
|
||||
// Same actor is used for small and large silver rocks, use actor params to identify large ones
|
||||
bool isLargeSilverRock = interactActorId == ACTOR_EN_ISHI && interactRangeActor->params & 1 == 1;
|
||||
if (CVarGetInteger(CVAR_ENHANCEMENT("FasterHeavyBlockLift"), 0) && (isLargeSilverRock || interactActorId == ACTOR_BG_HEAVY_BLOCK)) {
|
||||
LinkAnimation_PlayOnceSetSpeed(play, &this->skelAnime, anim, 5.0f);
|
||||
} else {
|
||||
if (GameInteractor_Should(VB_PLAY_THROW_ANIMATION, true, anim)) {
|
||||
LinkAnimation_PlayOnce(play, &this->skelAnime, anim);
|
||||
}
|
||||
}
|
||||
@@ -9842,14 +9838,12 @@ void Player_Action_80846120(Player* this, PlayState* play) {
|
||||
if (LinkAnimation_OnFrame(&this->skelAnime, 229.0f)) {
|
||||
Actor* heldActor = this->heldActor;
|
||||
|
||||
if (CVarGetInteger(CVAR_ENHANCEMENT("FasterHeavyBlockLift"), 0)) {
|
||||
// This is the difference in rotation when the animation is sped up 5x
|
||||
heldActor->shape.rot.x -= 3510;
|
||||
if (GameInteractor_Should(VB_MOVE_THROWN_ACTOR, true, heldActor)) {
|
||||
heldActor->speedXZ = Math_SinS(heldActor->shape.rot.x) * 40.0f;
|
||||
heldActor->velocity.y = Math_CosS(heldActor->shape.rot.x) * 40.0f;
|
||||
heldActor->gravity = -2.0f;
|
||||
heldActor->minVelocityY = -30.0f;
|
||||
}
|
||||
heldActor->speedXZ = Math_SinS(heldActor->shape.rot.x) * 40.0f;
|
||||
heldActor->velocity.y = Math_CosS(heldActor->shape.rot.x) * 40.0f;
|
||||
heldActor->gravity = -2.0f;
|
||||
heldActor->minVelocityY = -30.0f;
|
||||
Player_DetachHeldActor(play, this);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user