Skip to content

Commit

Permalink
More synced actions
Browse files Browse the repository at this point in the history
Co-authored-by: PurpleHato <[email protected]>
  • Loading branch information
garrettjoecox and PurpleHato committed Sep 4, 2023
1 parent 432cc7c commit 9c13368
Show file tree
Hide file tree
Showing 15 changed files with 64 additions and 17 deletions.
4 changes: 3 additions & 1 deletion soh/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,9 @@ void func_8086ED50(BgBombwall* this, PlayState* play) {
}

void func_8086ED70(BgBombwall* this, PlayState* play) {
if (this->collider.base.acFlags & AC_HIT) {
// #region SOH [Co-op]
if ((this->collider.base.acFlags & AC_HIT) || Flags_GetSwitch(play, this->dyna.actor.params & 0x3F)) {
// #endregion
this->collider.base.acFlags &= ~AC_HIT;
func_8086EDFC(this, play);
Flags_SetSwitch(play, this->dyna.actor.params & 0x3F);
Expand Down
4 changes: 3 additions & 1 deletion soh/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,9 @@ void func_80882E54(BgHakaZou* this, PlayState* play) {
}

void func_80883000(BgHakaZou* this, PlayState* play) {
if (this->collider.base.acFlags & AC_HIT) {
// #region SOH [Co-op]
if ((this->collider.base.acFlags & AC_HIT) || Flags_GetSwitch(play, this->switchFlag)) {
// #endregion
Flags_SetSwitch(play, this->switchFlag);

if (this->dyna.actor.params == STA_GIANT_BIRD_STATUE) {
Expand Down
6 changes: 4 additions & 2 deletions soh/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,10 @@ void BgHidanDalm_Destroy(Actor* thisx, PlayState* play) {
void BgHidanDalm_Wait(BgHidanDalm* this, PlayState* play) {
Player* player = GET_PLAYER(play);

if ((this->collider.base.acFlags & AC_HIT) && !Player_InCsMode(play) &&
(player->meleeWeaponAnimation == 22 || player->meleeWeaponAnimation == 23)) {
// #region SOH [Co-op]
if (((this->collider.base.acFlags & AC_HIT) && !Player_InCsMode(play) &&
(player->meleeWeaponAnimation == 22 || player->meleeWeaponAnimation == 23)) || Flags_GetSwitch(play, this->switchFlag)) {
// #endregion
this->collider.base.acFlags &= ~AC_HIT;
if ((this->collider.elements[0].info.bumperFlags & BUMP_HIT) ||
(this->collider.elements[1].info.bumperFlags & BUMP_HIT)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

#include "z_bg_hidan_firewall.h"
#include "objects/object_hidan_objects/object_hidan_objects.h"
#ifdef ENABLE_REMOTE_CONTROL
#include "soh/Enhancements/game-interactor/GameInteractor.h"
#include "soh/Enhancements/game-interactor/GameInteractor_Anchor.h"
#endif

#define FLAGS 0

Expand All @@ -21,6 +25,8 @@ void BgHidanFirewall_Erupt(BgHidanFirewall* this, PlayState* play);
void BgHidanFirewall_Collide(BgHidanFirewall* this, PlayState* play);
void BgHidanFirewall_ColliderFollowPlayer(BgHidanFirewall* this, PlayState* play);

extern s16 gEnPartnerId;

const ActorInit Bg_Hidan_Firewall_InitVars = {
ACTOR_BG_HIDAN_FIREWALL,
ACTORCAT_BG,
Expand Down Expand Up @@ -88,6 +94,20 @@ s32 BgHidanFirewall_CheckProximity(BgHidanFirewall* this, PlayState* play) {
player = GET_PLAYER(play);
func_8002DBD0(&this->actor, &distance, &player->actor.world.pos);

#ifdef ENABLE_REMOTE_CONTROL
Actor* actor = gPlayState->actorCtx.actorLists[ACTORCAT_ITEMACTION].head;
while (actor != NULL) {
if (gEnPartnerId == actor->id && Anchor_GetClientRoomIndex(actor->params - 3) == gPlayState->roomCtx.curRoom.num && Anchor_GetClientScene(actor->params - 3) == gPlayState->sceneNum) {
Vec3f actorDistance;
func_8002DBD0(&this->actor, &actorDistance, &actor->world.pos);
if (fabsf(actorDistance.x) < 100.0f && fabsf(actorDistance.z) < 120.0f) {
return 1;
}
}
actor = actor->next;
}
#endif

if (fabsf(distance.x) < 100.0f && fabsf(distance.z) < 120.0f) {
return 1;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,9 @@ void func_80888734(BgHidanHamstep* this) {
}

void func_808887C4(BgHidanHamstep* this, PlayState* play) {
if (this->collider.base.acFlags & AC_HIT) {
// #region SOH [Co-op]
if ((this->collider.base.acFlags & AC_HIT) || Flags_GetSwitch(play, (this->dyna.actor.params >> 8) & 0xFF)) {
// #endregion
OnePointCutscene_Init(play, 3310, 100, &this->dyna.actor, MAIN_CAM);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_HAMMER_SWITCH);
this->collider.base.acFlags = AC_NONE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,9 @@ void func_8088960C(BgHidanHrock* this, PlayState* play) {
}

void func_808896B8(BgHidanHrock* this, PlayState* play) {
if (this->collider.base.acFlags & 2) {
// #region SOH [Co-op]
if ((this->collider.base.acFlags & 2) || Flags_GetSwitch(play, this->unk_16A)) {
// #endregion
this->collider.base.acFlags &= ~2;
this->actionFunc = func_808894B0;
this->dyna.actor.flags |= ACTOR_FLAG_UPDATE_WHILE_CULLED;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,9 @@ void BgHidanKowarerukabe_Update(Actor* thisx, PlayState* play) {
BgHidanKowarerukabe* this = (BgHidanKowarerukabe*)thisx;
s32 pad;

if (Actor_GetCollidedExplosive(play, &this->collider.base) != NULL) {
// #region SOH [Co-op]
if ((Actor_GetCollidedExplosive(play, &this->collider.base) != NULL) || Flags_GetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F)) {
// #endregion
BgHidanKowarerukabe_Break(this, play);
Flags_SetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F);

Expand Down
6 changes: 4 additions & 2 deletions soh/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,10 +332,12 @@ void func_8089107C(BgIceShelter* this, PlayState* play) {
MeltOnIceArrowHit(this, this->cylinder2, type, play);
}
// Default blue fire check
if (this->cylinder1.base.acFlags & AC_HIT) {
// #region SOH [Co-op]
if ((this->cylinder1.base.acFlags & AC_HIT) || Flags_GetSwitch(play, this->dyna.actor.params & 0x3F)) {
this->cylinder1.base.acFlags &= ~AC_HIT;

if ((this->cylinder1.base.ac != NULL) && (this->cylinder1.base.ac->id == ACTOR_EN_ICE_HONO)) {
if (((this->cylinder1.base.ac != NULL) && (this->cylinder1.base.ac->id == ACTOR_EN_ICE_HONO)) || Flags_GetSwitch(play, this->dyna.actor.params & 0x3F)) {
// #endregion
if (type == 4) {
if (this->dyna.actor.parent != NULL) {
this->dyna.actor.parent->freezeTimer = 50;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ void BgJyaBombchuiwa_SetupWaitForExplosion(BgJyaBombchuiwa* this, PlayState* pla
}

void BgJyaBombchuiwa_WaitForExplosion(BgJyaBombchuiwa* this, PlayState* play) {
if ((this->collider.base.acFlags & AC_HIT) || (this->timer > 0)) {
// #region SOH [Co-op]
if (((this->collider.base.acFlags & AC_HIT) || (this->timer > 0)) || Flags_GetSwitch(play, this->actor.params & 0x3F)) {
// #endregion
if (this->timer == 0) {
OnePointCutscene_Init(play, 3410, -99, &this->actor, MAIN_CAM);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,9 @@ void BgJyaBombiwa_Break(BgJyaBombiwa* this, PlayState* play) {
void BgJyaBombiwa_Update(Actor* thisx, PlayState* play) {
BgJyaBombiwa* this = (BgJyaBombiwa*)thisx;

if (this->collider.base.acFlags & AC_HIT) {
// #region SOH [Co-op]
if ((this->collider.base.acFlags & AC_HIT) || Flags_GetSwitch(play, this->dyna.actor.params & 0x3F)) {
// #endregion
BgJyaBombiwa_Break(this, play);
Flags_SetSwitch(play, this->dyna.actor.params & 0x3F);
SoundSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 40, NA_SE_EV_WALL_BROKEN);
Expand Down
4 changes: 3 additions & 1 deletion soh/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,9 @@ void BgMizuBwall_SpawnDebris(BgMizuBwall* this, PlayState* play) {

void BgMizuBwall_Idle(BgMizuBwall* this, PlayState* play) {
BgMizuBwall_SetAlpha(this, play);
if (this->collider.base.acFlags & AC_HIT) {
// #region SOH [Co-op]
if ((this->collider.base.acFlags & AC_HIT) || Flags_GetSwitch(play, ((u16)this->dyna.actor.params >> 8) & 0x3F)) {
// #endregion
this->collider.base.acFlags &= ~AC_HIT;
Flags_SetSwitch(play, ((u16)this->dyna.actor.params >> 8) & 0x3F);
this->breakTimer = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,9 @@ void BgSpot08Bakudankabe_Destroy(Actor* thisx, PlayState* play) {
void BgSpot08Bakudankabe_Update(Actor* thisx, PlayState* play) {
BgSpot08Bakudankabe* this = (BgSpot08Bakudankabe*)thisx;

if (this->collider.base.acFlags & AC_HIT) {
// #region SOH [Co-op]
if ((this->collider.base.acFlags & AC_HIT) || Flags_GetSwitch(play, (this->dyna.actor.params & 0x3F))) {
// #endregion
func_808B0324(this, play);
Flags_SetSwitch(play, (this->dyna.actor.params & 0x3F));
SoundSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 40, NA_SE_EV_WALL_BROKEN);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,9 @@ void BgSpot11Bakudankabe_Destroy(Actor* thisx, PlayState* play) {

void BgSpot11Bakudankabe_Update(Actor* thisx, PlayState* play) {
BgSpot11Bakudankabe* this = (BgSpot11Bakudankabe*)thisx;

if (this->collider.base.acFlags & AC_HIT) {
// #region SOH [Co-op]
if ((this->collider.base.acFlags & AC_HIT) || Flags_GetSwitch(play, (this->dyna.actor.params & 0x3F))) {
// #endregion
func_808B2218(this, play);
Flags_SetSwitch(play, (this->dyna.actor.params & 0x3F));
SoundSource_PlaySfxAtFixedWorldPos(play, &D_808B2738, 40, NA_SE_EV_WALL_BROKEN);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ void BgSpot17Bakudankabe_Destroy(Actor* thisx, PlayState* play) {

void BgSpot17Bakudankabe_Update(Actor* thisx, PlayState* play) {
BgSpot17Bakudankabe* this = (BgSpot17Bakudankabe*)thisx;
if (this->dyna.actor.xzDistToPlayer < 650.0f && func_80033684(play, &this->dyna.actor) != NULL) {
// #region SOH [Co-op]
if ((this->dyna.actor.xzDistToPlayer < 650.0f && func_80033684(play, &this->dyna.actor) != NULL) || Flags_GetSwitch(play, (this->dyna.actor.params & 0x3F))) {
// #endregion
func_808B6BC0(this, play);
Flags_SetSwitch(play, (this->dyna.actor.params & 0x3F));
SoundSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 40, NA_SE_EV_WALL_BROKEN);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,9 @@ void func_808BEFF4(BgYdanMaruta* this, PlayState* play) {
}

void func_808BF078(BgYdanMaruta* this, PlayState* play) {
if (this->collider.base.acFlags & AC_HIT) {
// #region SOH [Co-op]
if ((this->collider.base.acFlags & AC_HIT) || Flags_GetSwitch(play, this->switchFlag)) {
// #endregion
this->unk_16A = 20;
Flags_SetSwitch(play, this->switchFlag);
func_80078884(NA_SE_SY_CORRECT_CHIME);
Expand Down

0 comments on commit 9c13368

Please sign in to comment.