mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-22 06:13:45 -07:00
put timer condition as should when convenient
This commit is contained in:
parent
e2671e7f2b
commit
b53b742fd9
6 changed files with 16 additions and 29 deletions
|
@ -1994,7 +1994,7 @@ typedef enum {
|
|||
|
||||
// #### `result`
|
||||
// ```c
|
||||
// true
|
||||
// varies, never set should to true
|
||||
// ```
|
||||
// #### `args`
|
||||
// - `*Actor`
|
||||
|
|
|
@ -166,11 +166,9 @@ void BgHidanFwbig_Lower(BgHidanFwbig* this, PlayState* play) {
|
|||
}
|
||||
|
||||
void BgHidanFwbig_WaitForTimer(BgHidanFwbig* this, PlayState* play) {
|
||||
if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, true, this, &this->timer)) {
|
||||
if (this->timer != 0) {
|
||||
if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, this->timer != 0, this, &this->timer)) {
|
||||
this->timer--;
|
||||
}
|
||||
}
|
||||
|
||||
if (this->timer == 0) {
|
||||
this->actionFunc = BgHidanFwbig_Rise;
|
||||
|
|
|
@ -91,11 +91,10 @@ void BgMenkuriEye_Update(Actor* thisx, PlayState* play) {
|
|||
|
||||
if (!Flags_GetSwitch(play, this->actor.params)) {
|
||||
if (this->framesUntilDisable != -1) {
|
||||
if (this->framesUntilDisable != 0) {
|
||||
if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, true, this, &this->framesUntilDisable)) {
|
||||
if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, this->framesUntilDisable != 0, this,
|
||||
&this->framesUntilDisable)) {
|
||||
this->framesUntilDisable -= 1;
|
||||
}
|
||||
}
|
||||
if (this->framesUntilDisable == 0) {
|
||||
this->framesUntilDisable = -1;
|
||||
D_8089C1A0 -= 1;
|
||||
|
|
|
@ -134,11 +134,9 @@ void func_808A90F4(BgRelayObjects* this, PlayState* play) {
|
|||
|
||||
void func_808A91AC(BgRelayObjects* this, PlayState* play) {
|
||||
if (this->unk_169 != 5) {
|
||||
if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, true, this, &this->timer)) {
|
||||
if (this->timer != 0) {
|
||||
if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, this->timer != 0, this, &this->timer)) {
|
||||
this->timer--;
|
||||
}
|
||||
}
|
||||
func_8002F994(&this->dyna.actor, this->timer);
|
||||
}
|
||||
if ((this->timer == 0) || (this->unk_169 == play->roomCtx.curRoom.num)) {
|
||||
|
@ -171,11 +169,9 @@ void BgRelayObjects_DoNothing(BgRelayObjects* this, PlayState* play) {
|
|||
}
|
||||
|
||||
void func_808A932C(BgRelayObjects* this, PlayState* play) {
|
||||
if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, true, &this->timer)) {
|
||||
if (this->timer != 0) {
|
||||
if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, this->timer != 0, &this->timer)) {
|
||||
this->timer--;
|
||||
}
|
||||
}
|
||||
if (this->timer == 0) {
|
||||
if (!Player_InCsMode(play)) {
|
||||
Sfx_PlaySfxCentered(NA_SE_OC_ABYSS);
|
||||
|
|
|
@ -127,11 +127,9 @@ void BgYdanHasi_MoveWater(BgYdanHasi* this, PlayState* play) {
|
|||
}
|
||||
|
||||
void BgYdanHasi_DecWaterTimer(BgYdanHasi* this, PlayState* play) {
|
||||
if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, true, this, &this->timer)) {
|
||||
if (this->timer != 0) {
|
||||
if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, this->timer != 0, this, &this->timer)) {
|
||||
this->timer--;
|
||||
}
|
||||
}
|
||||
|
||||
func_8002F994(&this->dyna.actor, this->timer);
|
||||
if (this->timer == 0) {
|
||||
|
@ -149,11 +147,9 @@ void BgYdanHasi_SetupThreeBlocks(BgYdanHasi* this, PlayState* play) {
|
|||
}
|
||||
|
||||
void BgYdanHasi_UpdateThreeBlocks(BgYdanHasi* this, PlayState* play) {
|
||||
if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, true, this, &this->timer)) {
|
||||
if (this->timer != 0) {
|
||||
if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, this->timer != 0, this, &this->timer)) {
|
||||
this->timer--;
|
||||
}
|
||||
}
|
||||
|
||||
if (this->timer == 0) {
|
||||
if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, 3.0f) != 0) {
|
||||
|
|
|
@ -240,10 +240,8 @@ void ObjSyokudai_Update(Actor* thisx, PlayState* play2) {
|
|||
Collider_UpdateCylinder(&this->actor, &this->colliderFlame);
|
||||
CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderFlame.base);
|
||||
|
||||
if (this->litTimer > 0) {
|
||||
if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, true, this, &this->litTimer)) {
|
||||
if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, this->litTimer > 0, this, &this->litTimer)) {
|
||||
this->litTimer--;
|
||||
}
|
||||
if ((this->litTimer == 0) && (torchType != 0)) {
|
||||
sLitTorchCount--;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue