dyna switches (#1731)

This commit is contained in:
engineer124
2024-10-23 12:48:01 +11:00
committed by GitHub
parent 961899ca91
commit 19495ba8e9
15 changed files with 43 additions and 39 deletions
+12 -8
View File
@@ -166,8 +166,8 @@ typedef enum {
#define DYNA_INTERACT_ACTOR_ON_TOP (1 << 0) // There is an actor standing on the collision of the dynapoly actor
#define DYNA_INTERACT_PLAYER_ON_TOP (1 << 1) // The player actor is standing on the collision of the dynapoly actor
#define DYNA_INTERACT_PLAYER_ABOVE (1 << 2) // The player is directly above the collision of the dynapoly actor (any distance above)
#define DYNA_INTERACT_ACTOR_ON_SWITCH (1 << 3) // Like the ACTOR_ON_TOP flag but only actors with ACTOR_FLAG_CAN_PRESS_SWITCH
#define DYNA_INTERACT_ACTOR_ON_HEAVY_SWITCH (1 << 4) // Like the ACTOR_ON_TOP flag but only actors with ACTOR_FLAG_CAN_PRESS_HEAVY_SWITCH
#define DYNA_INTERACT_ACTOR_SWITCH_PRESSED (1 << 3) // An actor that is capable of pressing switches is on top of the dynapoly actor
#define DYNA_INTERACT_ACTOR_HEAVY_SWITCH_PRESSED (1 << 4) // An actor that is capable of pressing heavy switches is on top of the dynapoly actor
typedef struct DynaPolyActor {
/* 0x000 */ Actor actor;
@@ -491,8 +491,10 @@ typedef enum DoorLockType {
#define ACTOR_FLAG_8000 (1 << 15)
//
#define ACTOR_FLAG_10000 (1 << 16)
// actor can press and hold down heavy switches
#define ACTOR_FLAG_CAN_PRESS_HEAVY_SWITCH (1 << 17)
// Actor can press and hold down heavy switches.
// See usages of `DynaPolyActor_SetHeavySwitchPressed` and `DynaPolyActor_IsHeavySwitchPressed` for more context on how switches work.
#define ACTOR_FLAG_CAN_PRESS_HEAVY_SWITCHES (1 << 17)
//
#define ACTOR_FLAG_40000 (1 << 18)
//
@@ -512,8 +514,10 @@ typedef enum DoorLockType {
// Typically an actor will halt while the ocarina is active (depending on category).
// This flag allows a given actor to be an exception.
#define ACTOR_FLAG_UPDATE_DURING_OCARINA (1 << 25)
// actor can press and hold down switches
#define ACTOR_FLAG_CAN_PRESS_SWITCH (1 << 26)
// Actor can press and hold down switches.
// See usages of `DynaPolyActor_SetSwitchPressed` and `DynaPolyActor_IsSwitchPressed` for more context on how switches work.
#define ACTOR_FLAG_CAN_PRESS_SWITCHES (1 << 26)
// Player is not able to lock onto the actor.
// Tatl will still be able to hover over the actor, assuming `ACTOR_FLAG_ATTENTION_ENABLED` is set.
@@ -891,8 +895,8 @@ void DynaPolyActor_SetPlayerOnTop(DynaPolyActor* dynaActor);
void DynaPoly_SetPlayerOnTop(struct CollisionContext* colCtx, s32 bgId);
void DynaPolyActor_SetPlayerAbove(DynaPolyActor* dynaActor);
void DynaPoly_SetPlayerAbove(struct CollisionContext* colCtx, s32 bgId);
void DynaPolyActor_SetActorOnSwitch(DynaPolyActor* dynaActor);
void DynaPolyActor_SetActorOnHeavySwitch(DynaPolyActor* dynaActor);
void DynaPolyActor_SetSwitchPressed(DynaPolyActor* dynaActor);
void DynaPolyActor_SetHeavySwitchPressed(DynaPolyActor* dynaActor);
s32 DynaPolyActor_IsActorOnTop(DynaPolyActor* dynaActor);
s32 DynaPolyActor_IsPlayerOnTop(DynaPolyActor* dynaActor);
s32 DynaPolyActor_IsPlayerAbove(DynaPolyActor* dynaActor);