mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-22 14:23:44 -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`
|
// #### `result`
|
||||||
// ```c
|
// ```c
|
||||||
// true
|
// varies, never set should to true
|
||||||
// ```
|
// ```
|
||||||
// #### `args`
|
// #### `args`
|
||||||
// - `*Actor`
|
// - `*Actor`
|
||||||
|
|
|
@ -166,11 +166,9 @@ void BgHidanFwbig_Lower(BgHidanFwbig* this, PlayState* play) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void BgHidanFwbig_WaitForTimer(BgHidanFwbig* this, PlayState* play) {
|
void BgHidanFwbig_WaitForTimer(BgHidanFwbig* this, PlayState* play) {
|
||||||
if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, true, this, &this->timer)) {
|
if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, this->timer != 0, this, &this->timer)) {
|
||||||
if (this->timer != 0) {
|
|
||||||
this->timer--;
|
this->timer--;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (this->timer == 0) {
|
if (this->timer == 0) {
|
||||||
this->actionFunc = BgHidanFwbig_Rise;
|
this->actionFunc = BgHidanFwbig_Rise;
|
||||||
|
|
|
@ -91,11 +91,10 @@ void BgMenkuriEye_Update(Actor* thisx, PlayState* play) {
|
||||||
|
|
||||||
if (!Flags_GetSwitch(play, this->actor.params)) {
|
if (!Flags_GetSwitch(play, this->actor.params)) {
|
||||||
if (this->framesUntilDisable != -1) {
|
if (this->framesUntilDisable != -1) {
|
||||||
if (this->framesUntilDisable != 0) {
|
if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, this->framesUntilDisable != 0, this,
|
||||||
if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, true, this, &this->framesUntilDisable)) {
|
&this->framesUntilDisable)) {
|
||||||
this->framesUntilDisable -= 1;
|
this->framesUntilDisable -= 1;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (this->framesUntilDisable == 0) {
|
if (this->framesUntilDisable == 0) {
|
||||||
this->framesUntilDisable = -1;
|
this->framesUntilDisable = -1;
|
||||||
D_8089C1A0 -= 1;
|
D_8089C1A0 -= 1;
|
||||||
|
|
|
@ -134,11 +134,9 @@ void func_808A90F4(BgRelayObjects* this, PlayState* play) {
|
||||||
|
|
||||||
void func_808A91AC(BgRelayObjects* this, PlayState* play) {
|
void func_808A91AC(BgRelayObjects* this, PlayState* play) {
|
||||||
if (this->unk_169 != 5) {
|
if (this->unk_169 != 5) {
|
||||||
if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, true, this, &this->timer)) {
|
if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, this->timer != 0, this, &this->timer)) {
|
||||||
if (this->timer != 0) {
|
|
||||||
this->timer--;
|
this->timer--;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
func_8002F994(&this->dyna.actor, this->timer);
|
func_8002F994(&this->dyna.actor, this->timer);
|
||||||
}
|
}
|
||||||
if ((this->timer == 0) || (this->unk_169 == play->roomCtx.curRoom.num)) {
|
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) {
|
void func_808A932C(BgRelayObjects* this, PlayState* play) {
|
||||||
if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, true, &this->timer)) {
|
if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, this->timer != 0, &this->timer)) {
|
||||||
if (this->timer != 0) {
|
|
||||||
this->timer--;
|
this->timer--;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (this->timer == 0) {
|
if (this->timer == 0) {
|
||||||
if (!Player_InCsMode(play)) {
|
if (!Player_InCsMode(play)) {
|
||||||
Sfx_PlaySfxCentered(NA_SE_OC_ABYSS);
|
Sfx_PlaySfxCentered(NA_SE_OC_ABYSS);
|
||||||
|
|
|
@ -127,11 +127,9 @@ void BgYdanHasi_MoveWater(BgYdanHasi* this, PlayState* play) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void BgYdanHasi_DecWaterTimer(BgYdanHasi* this, PlayState* play) {
|
void BgYdanHasi_DecWaterTimer(BgYdanHasi* this, PlayState* play) {
|
||||||
if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, true, this, &this->timer)) {
|
if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, this->timer != 0, this, &this->timer)) {
|
||||||
if (this->timer != 0) {
|
|
||||||
this->timer--;
|
this->timer--;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
func_8002F994(&this->dyna.actor, this->timer);
|
func_8002F994(&this->dyna.actor, this->timer);
|
||||||
if (this->timer == 0) {
|
if (this->timer == 0) {
|
||||||
|
@ -149,11 +147,9 @@ void BgYdanHasi_SetupThreeBlocks(BgYdanHasi* this, PlayState* play) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void BgYdanHasi_UpdateThreeBlocks(BgYdanHasi* this, PlayState* play) {
|
void BgYdanHasi_UpdateThreeBlocks(BgYdanHasi* this, PlayState* play) {
|
||||||
if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, true, this, &this->timer)) {
|
if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, this->timer != 0, this, &this->timer)) {
|
||||||
if (this->timer != 0) {
|
|
||||||
this->timer--;
|
this->timer--;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (this->timer == 0) {
|
if (this->timer == 0) {
|
||||||
if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, 3.0f) != 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);
|
Collider_UpdateCylinder(&this->actor, &this->colliderFlame);
|
||||||
CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderFlame.base);
|
CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderFlame.base);
|
||||||
|
|
||||||
if (this->litTimer > 0) {
|
if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, this->litTimer > 0, this, &this->litTimer)) {
|
||||||
if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, true, this, &this->litTimer)) {
|
|
||||||
this->litTimer--;
|
this->litTimer--;
|
||||||
}
|
|
||||||
if ((this->litTimer == 0) && (torchType != 0)) {
|
if ((this->litTimer == 0) && (torchType != 0)) {
|
||||||
sLitTorchCount--;
|
sLitTorchCount--;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue