Add QoL feature: Faster Block Pushing (#275)

This commit is contained in:
Marcelo20XX 2022-05-12 09:08:37 -04:00 committed by GitHub
parent 9eb5ff6136
commit fdd613f41e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 22 additions and 14 deletions

View File

@ -670,6 +670,7 @@ namespace SohImGui {
EnhancementCheckbox("Animated Link in Pause Menu", "gPauseLiveLink");
EnhancementCheckbox("Enable 3D Dropped items", "gNewDrops");
EnhancementCheckbox("Faster Block Push", "gFasterBlockPush");
EnhancementCheckbox("Dynamic Wallet Icon", "gDynamicWalletIcon");
EnhancementCheckbox("Always show dungeon entrances", "gAlwaysShowDungeonMinimapIcon");

View File

@ -192,7 +192,12 @@ void BgHakaGate_StatueTurn(BgHakaGate* this, GlobalContext* globalCtx) {
s16 turnAngle;
this->vTurnRateDeg10++;
this->vTurnRateDeg10 = CLAMP_MAX(this->vTurnRateDeg10, 5);
if (CVar_GetS32("gFasterBlockPush", 0) != 0) {
this->vTurnRateDeg10 = 10;
CLAMP_MAX(this->vTurnRateDeg10, 5);
} else {
this->vTurnRateDeg10 = CLAMP_MAX(this->vTurnRateDeg10, 5);
}
turnFinished = Math_StepToS(&this->vTurnAngleDeg10, 600, this->vTurnRateDeg10);
turnAngle = this->vTurnAngleDeg10 * this->vTurnDirection;
this->dyna.actor.shape.rot.y = (this->vRotYDeg10 + turnAngle) * 0.1f * (0x10000 / 360.0f);
@ -212,7 +217,7 @@ void BgHakaGate_StatueTurn(BgHakaGate* this, GlobalContext* globalCtx) {
this->vRotYDeg10 = (this->vRotYDeg10 + turnAngle) % 3600;
this->vTurnRateDeg10 = 0;
this->vTurnAngleDeg10 = 0;
this->vTimer = 5;
this->vTimer = CVar_GetS32("gFasterBlockPush", 0) != 0 ? 2 : 5;
this->actionFunc = BgHakaGate_StatueIdle;
this->dyna.unk_150 = 0.0f;
}

View File

@ -137,7 +137,7 @@ void func_8088B268(BgHidanRock* this, GlobalContext* globalCtx) {
}
}
this->dyna.actor.speedXZ += 0.05f;
this->dyna.actor.speedXZ += CVar_GetS32("gFasterBlockPush", 0) != 0 ? 0.5f : 0.05f;
this->dyna.actor.speedXZ = CLAMP_MAX(this->dyna.actor.speedXZ, 2.0f);
if (D_8088BFC0 > 0.0f) {
@ -156,7 +156,7 @@ void func_8088B268(BgHidanRock* this, GlobalContext* globalCtx) {
this->dyna.actor.home.pos.z = this->dyna.actor.world.pos.z;
D_8088BFC0 = 0.0f;
this->dyna.actor.speedXZ = 0.0f;
this->timer = 5;
this->timer = CVar_GetS32("gFasterBlockPush", 0) != 0 ? 2 : 5;
}
func_8002F974(&this->dyna.actor, NA_SE_EV_ROCK_SLIDE - SFX_FLAG);

View File

@ -444,7 +444,7 @@ void func_80896950(BgJyaCobra* this, GlobalContext* globalCtx) {
if (this->dyna.unk_150 > 0.001f) {
this->unk_168++;
if (this->unk_168 >= 15) {
if (this->unk_168 >= CVar_GetS32("gFasterBlockPush", 0) != 0 ? 5 : 15) {
func_808969F8(this, globalCtx);
}
} else {
@ -484,9 +484,11 @@ void func_808969F8(BgJyaCobra* this, GlobalContext* globalCtx) {
void func_80896ABC(BgJyaCobra* this, GlobalContext* globalCtx) {
s16 temp_v0;
Player* player = GET_PLAYER(globalCtx);
if (CVar_GetS32("gFasterBlockPush", 0) != 0)
this->unk_16E = 150.0f;
temp_v0 = (s16)((this->unk_16C * 0x2000) + this->dyna.actor.home.rot.y) - this->dyna.actor.world.rot.y;
if (ABS(temp_v0) < 7424) {
if (ABS(temp_v0) < CVar_GetS32("gFasterBlockPush", 0) != 0 ? 3712 : 7424) {
Math_StepToS(&this->unk_16E, 106, 4);
} else {
Math_StepToS(&this->unk_16E, 21, 10);

View File

@ -94,7 +94,7 @@ void BgMoriKaitenkabe_Wait(BgMoriKaitenkabe* this, GlobalContext* globalCtx) {
if (this->dyna.unk_150 > 0.001f) {
this->timer++;
if ((this->timer > 28) && !Player_InCsMode(globalCtx)) {
if ((this->timer > CVar_GetS32("gFasterBlockPush", 0) != 0 ? 14 : 28) && !Player_InCsMode(globalCtx)) {
BgMoriKaitenkabe_SetupRotate(this);
func_8002DF54(globalCtx, &this->dyna.actor, 8);
Math_Vec3f_Copy(&this->lockedPlayerPos, &player->actor.world.pos);
@ -118,7 +118,7 @@ void BgMoriKaitenkabe_Wait(BgMoriKaitenkabe* this, GlobalContext* globalCtx) {
void BgMoriKaitenkabe_SetupRotate(BgMoriKaitenkabe* this) {
this->actionFunc = BgMoriKaitenkabe_Rotate;
this->rotSpeed = 0.0f;
this->rotSpeed = CVar_GetS32("gFasterBlockPush", 0) != 0 ? 0.5f : 0.0f;
this->rotYdeg = 0.0f;
}

View File

@ -388,7 +388,7 @@ void BgPoEvent_BlockPush(BgPoEvent* this, GlobalContext* globalCtx) {
s32 blockStop;
Player* player = GET_PLAYER(globalCtx);
this->dyna.actor.speedXZ += 0.1f;
this->dyna.actor.speedXZ += CVar_GetS32("gFasterBlockPush", 0) != 0 ? 0.5f : 0.1f;
this->dyna.actor.speedXZ = CLAMP_MAX(this->dyna.actor.speedXZ, 2.0f);
blockStop = Math_StepToF(&blockPushDist, 20.0f, this->dyna.actor.speedXZ);
displacement = this->direction * blockPushDist;
@ -404,7 +404,7 @@ void BgPoEvent_BlockPush(BgPoEvent* this, GlobalContext* globalCtx) {
this->dyna.actor.home.pos.z = this->dyna.actor.world.pos.z;
blockPushDist = 0.0f;
this->dyna.actor.speedXZ = 0.0f;
this->direction = 5;
this->direction = CVar_GetS32("gFasterBlockPush", 0) != 0 ? 3 : 5;
sBlocksAtRest++;
this->actionFunc = BgPoEvent_BlockIdle;
if (this->type == 1) {

View File

@ -260,7 +260,7 @@ void func_808B4194(BgSpot15Rrbox* this, GlobalContext* globalCtx) {
s32 approxFResult;
Actor* actor = &this->dyna.actor;
this->unk_174 += 0.5f;
this->unk_174 += CVar_GetS32("gFasterBlockPush", 0) != 0 ? 1.0f : 0.5f;
this->unk_174 = CLAMP_MAX(this->unk_174, 2.0f);
@ -294,7 +294,7 @@ void func_808B4194(BgSpot15Rrbox* this, GlobalContext* globalCtx) {
this->dyna.unk_150 = 0.0f;
this->unk_178 = 0.0f;
this->unk_174 = 0.0f;
this->unk_168 = 10;
this->unk_168 = CVar_GetS32("gFasterBlockPush", 0) != 0 ? 3 : 10;
func_808B4084(this, globalCtx);
}
Audio_PlayActorSound2(actor, NA_SE_EV_ROCK_SLIDE - SFX_FLAG);

View File

@ -558,7 +558,7 @@ void ObjOshihiki_Push(ObjOshihiki* this, GlobalContext* globalCtx) {
f32 pushDistSigned;
s32 stopFlag;
this->pushSpeed += 0.5f;
this->pushSpeed += CVar_GetS32("gFasterBlockPush", 0) != 0 ? 1.0f : 0.5f;
this->stateFlags |= PUSHBLOCK_PUSH;
this->pushSpeed = CLAMP_MAX(this->pushSpeed, 2.0f);
stopFlag = Math_StepToF(&this->pushDist, 20.0f, this->pushSpeed);
@ -586,7 +586,7 @@ void ObjOshihiki_Push(ObjOshihiki* this, GlobalContext* globalCtx) {
this->dyna.unk_150 = 0.0f;
this->pushDist = 0.0f;
this->pushSpeed = 0.0f;
this->timer = 10;
this->timer = CVar_GetS32("gFasterBlockPush", 0) != 0 ? 3 : 10;
if (this->floorBgIds[this->highestFloor] == BGCHECK_SCENE) {
ObjOshihiki_SetupOnScene(this, globalCtx);
} else {