summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEblo <7004497+Eblo@users.noreply.github.com>2025-05-05 23:49:34 -0400
committerGitHub <noreply@github.com>2025-05-05 22:49:34 -0500
commit9fe15819232f738bae3f82891813f0b20e2cc0cd (patch)
tree780ffa2bbf796c29725d0ab139cf96be4919a6d4
parent59fd8636aa7a8ab98c586962119b75d7f1c4bc44 (diff)
Speed up Ikana block (#1127)
* Speed up Ikana block * Use VB_PUSH_BLOCK_SET_TIMER for Ikana block
-rw-r--r--mm/2s2h/Enhancements/Cutscenes/SkipOnePointCutscenes.cpp1
-rw-r--r--mm/2s2h/Enhancements/Player/FasterPushAndPull.cpp9
-rw-r--r--mm/src/overlays/actors/ovl_Bg_Ikana_Block/z_bg_ikana_block.c11
3 files changed, 16 insertions, 5 deletions
diff --git a/mm/2s2h/Enhancements/Cutscenes/SkipOnePointCutscenes.cpp b/mm/2s2h/Enhancements/Cutscenes/SkipOnePointCutscenes.cpp
index c51fadfab..721c2f51e 100644
--- a/mm/2s2h/Enhancements/Cutscenes/SkipOnePointCutscenes.cpp
+++ b/mm/2s2h/Enhancements/Cutscenes/SkipOnePointCutscenes.cpp
@@ -83,6 +83,7 @@ void RegisterSkipOnePointCutscenes() {
case ACTOR_OBJ_LIGHTBLOCK:
case ACTOR_OBJ_LIGHTSWITCH:
case ACTOR_BG_IKANA_BOMBWALL:
+ case ACTOR_BG_IKANA_BLOCK:
case ACTOR_BG_HAKUGIN_BOMBWALL:
case ACTOR_EN_SW:
case ACTOR_OBJ_CHAN:
diff --git a/mm/2s2h/Enhancements/Player/FasterPushAndPull.cpp b/mm/2s2h/Enhancements/Player/FasterPushAndPull.cpp
index 3e16bce17..fb1350752 100644
--- a/mm/2s2h/Enhancements/Player/FasterPushAndPull.cpp
+++ b/mm/2s2h/Enhancements/Player/FasterPushAndPull.cpp
@@ -4,6 +4,7 @@
extern "C" {
#include "overlays/actors/ovl_Bg_Dblue_Movebg/z_bg_dblue_movebg.h"
+#include "overlays/actors/ovl_Bg_Ikana_Block/z_bg_ikana_block.h"
#include "overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.h"
}
@@ -24,8 +25,12 @@ void RegisterFasterPushAndPull() {
});
COND_VB_SHOULD(VB_PUSH_BLOCK_SET_TIMER, CVAR, {
- ObjOshihiki* objOshihiki = va_arg(args, ObjOshihiki*);
- objOshihiki->timer = 2;
+ Actor* actor = va_arg(args, Actor*);
+ if (actor->id == ACTOR_OBJ_OSHIHIKI) {
+ ((ObjOshihiki*)actor)->timer = 2;
+ } else if (actor->id == ACTOR_BG_IKANA_BLOCK) {
+ ((BgIkanaBlock*)actor)->unk_17B = 11;
+ }
*should = false;
});
diff --git a/mm/src/overlays/actors/ovl_Bg_Ikana_Block/z_bg_ikana_block.c b/mm/src/overlays/actors/ovl_Bg_Ikana_Block/z_bg_ikana_block.c
index 8b0ba1217..1edb509b1 100644
--- a/mm/src/overlays/actors/ovl_Bg_Ikana_Block/z_bg_ikana_block.c
+++ b/mm/src/overlays/actors/ovl_Bg_Ikana_Block/z_bg_ikana_block.c
@@ -7,6 +7,8 @@
#include "z_bg_ikana_block.h"
#include "objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h"
+#include "2s2h/GameInteractor/GameInteractor.h"
+
#define FLAGS (ACTOR_FLAG_10)
#define THIS ((BgIkanaBlock*)thisx)
@@ -70,8 +72,10 @@ void func_80B7EA60(BgIkanaBlock* this) {
void func_80B7EB30(BgIkanaBlock* this) {
if (this->unk_17A & (0x8 | 0x4 | 0x2 | 0x1)) {
- if (this->unk_17B < 127) {
- this->unk_17B++;
+ if (GameInteractor_Should(VB_PUSH_BLOCK_SET_TIMER, true, this)) {
+ if (this->unk_17B < 127) {
+ this->unk_17B++;
+ }
}
} else {
this->unk_17B = 0;
@@ -290,7 +294,8 @@ void func_80B7F290(BgIkanaBlock* this, PlayState* play) {
Math_StepToF(&this->unk_16C, 2.0f, 0.4f);
- if (Math_StepToF(this->unk_164, this->unk_168, this->unk_16C)) {
+ if (GameInteractor_Should(VB_BLOCK_BE_FINISHED_PULLING, Math_StepToF(this->unk_164, this->unk_168, this->unk_16C),
+ this->unk_164, this->unk_168, this->unk_16C, this->unk_16C)) {
Player* player = GET_PLAYER(play);
if (!func_80B7EB94(this, play)) {