1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-11-25 09:45:02 +00:00

Rename RoomBehaviorType2 (#2270)

* Rename RoomBehavior2

* fig proposal

* fig comment
This commit is contained in:
mzxrules 2024-10-12 22:28:55 -04:00 committed by GitHub
parent 44460eeaec
commit eee7ba9bd5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 24 additions and 23 deletions

View file

@ -161,20 +161,20 @@ typedef enum RoomBehaviorType1 {
/* 5 */ ROOM_BEHAVIOR_TYPE1_5
} RoomBehaviorType1;
typedef enum RoomBehaviorType2 {
/* 0 */ ROOM_BEHAVIOR_TYPE2_0,
/* 1 */ ROOM_BEHAVIOR_TYPE2_1,
/* 2 */ ROOM_BEHAVIOR_TYPE2_2,
/* 3 */ ROOM_BEHAVIOR_TYPE2_3,
/* 4 */ ROOM_BEHAVIOR_TYPE2_4,
/* 5 */ ROOM_BEHAVIOR_TYPE2_5,
/* 6 */ ROOM_BEHAVIOR_TYPE2_6
} RoomBehaviorType2;
typedef enum RoomEnvironmentType {
/* 0 */ ROOM_ENV_DEFAULT,
/* 1 */ ROOM_ENV_COLD,
/* 2 */ ROOM_ENV_WARM,
/* 3 */ ROOM_ENV_HOT, // Enables hot room timer for the current room
/* 4 */ ROOM_ENV_UNK_STRETCH_1,
/* 5 */ ROOM_ENV_UNK_STRETCH_2,
/* 6 */ ROOM_ENV_UNK_STRETCH_3
} RoomEnvironmentType;
typedef struct Room {
/* 0x00 */ s8 num; // -1 is invalid room
/* 0x01 */ u8 unk_01;
/* 0x02 */ u8 behaviorType2;
/* 0x02 */ u8 environmentType;
/* 0x03 */ u8 behaviorType1;
/* 0x04 */ s8 echo;
/* 0x05 */ u8 lensMode;

View file

@ -7881,7 +7881,7 @@ s32 Camera_UpdateWater(Camera* camera) {
s32 Camera_UpdateHotRoom(Camera* camera) {
camera->distortionFlags &= ~DISTORTION_HOT_ROOM;
if (camera->play->roomCtx.curRoom.behaviorType2 == ROOM_BEHAVIOR_TYPE2_3) {
if (camera->play->roomCtx.curRoom.environmentType == ROOM_ENV_HOT) {
camera->distortionFlags |= DISTORTION_HOT_ROOM;
}

View file

@ -928,7 +928,7 @@ s32 Player_GetEnvironmentalHazard(PlayState* play) {
EnvHazardTextTriggerEntry* triggerEntry;
s32 envHazard;
if (play->roomCtx.curRoom.behaviorType2 == ROOM_BEHAVIOR_TYPE2_3) { // Room is hot
if (play->roomCtx.curRoom.environmentType == ROOM_ENV_HOT) { // Room is hot
envHazard = PLAYER_ENV_HAZARD_HOTROOM - 1;
} else if ((this->underwaterTimer > 80) &&
((this->currentBoots == PLAYER_BOOTS_IRON) || (this->underwaterTimer >= 300))) {

View file

@ -262,7 +262,7 @@ BAD_RETURN(s32) Scene_CommandSpecialFiles(PlayState* play, SceneCmd* cmd) {
BAD_RETURN(s32) Scene_CommandRoomBehavior(PlayState* play, SceneCmd* cmd) {
play->roomCtx.curRoom.behaviorType1 = cmd->roomBehavior.gpFlag1;
play->roomCtx.curRoom.behaviorType2 = cmd->roomBehavior.gpFlag2 & 0xFF;
play->roomCtx.curRoom.environmentType = cmd->roomBehavior.gpFlag2 & 0xFF;
play->roomCtx.curRoom.lensMode = (cmd->roomBehavior.gpFlag2 >> 8) & 1;
play->msgCtx.disableWarpSongs = (cmd->roomBehavior.gpFlag2 >> 0xA) & 1;
}

View file

@ -1105,13 +1105,13 @@ static LinkAnimationHeader* D_80853D4C[][3] = {
};
typedef enum FidgetType {
/* 0x00 */ FIDGET_LOOK_AROUND,
/* 0x01 */ FIDGET_COLD,
/* 0x02 */ FIDGET_WARM,
/* 0x03 */ FIDGET_HOT, // same animations as FIDGET_WARM
/* 0x04 */ FIDGET_STRETCH_1,
/* 0x05 */ FIDGET_STRETCH_2, // same animations as FIDGET_STRETCH_1
/* 0x06 */ FIDGET_STRETCH_3, // same animations as FIDGET_STRETCH_1
/* 0x00 */ FIDGET_LOOK_AROUND, // ROOM_ENV_DEFAULT
/* 0x01 */ FIDGET_COLD, // ROOM_ENV_COLD
/* 0x02 */ FIDGET_WARM, // ROOM_ENV_WARM
/* 0x03 */ FIDGET_HOT, // ROOM_ENV_HOT (same animations as FIDGET_WARM)
/* 0x04 */ FIDGET_STRETCH_1, // ROOM_ENV_UNK_STRETCH_1
/* 0x05 */ FIDGET_STRETCH_2, // ROOM_ENV_UNK_STRETCH_1 (same animations as FIDGET_STRETCH_1)
/* 0x06 */ FIDGET_STRETCH_3, // ROOM_ENV_UNK_STRETCH_1 (same animations as FIDGET_STRETCH_1)
/* 0x07 */ FIDGET_CRIT_HEALTH_START,
/* 0x08 */ FIDGET_CRIT_HEALTH_LOOP,
/* 0x09 */ FIDGET_SWORD_SWING,
@ -8190,7 +8190,7 @@ void Player_ChooseNextIdleAnim(PlayState* play, Player* this) {
} else {
// Pick fidget type based on room behavior.
// This may be changed below.
fidgetType = play->roomCtx.curRoom.behaviorType2;
fidgetType = play->roomCtx.curRoom.environmentType;
if (heathIsCritical) {
if (this->idleType >= PLAYER_IDLE_DEFAULT) {
@ -8208,7 +8208,8 @@ void Player_ChooseNextIdleAnim(PlayState* play, Player* this) {
// There is a 4/5 chance that a common fidget type will be considered.
// However it may get rejected by the conditions below.
// The type determined by `curRoom.behaviorType2` will be used if a common type is rejected.
// The type determined by `curRoom.environmentType` will be used if a common type is
// rejected.
if (commonType < 4) {
// `FIDGET_ADJUST_TUNIC` and `FIDGET_TAP_FEET` are accepted unconditionally.
// The sword and shield related common types have extra restrictions.
@ -9410,7 +9411,7 @@ static AnimSfxEntry D_808545F0[] = {
void Player_Action_80843CEC(Player* this, PlayState* play) {
if (this->currentTunic != PLAYER_TUNIC_GORON) {
if ((play->roomCtx.curRoom.behaviorType2 == ROOM_BEHAVIOR_TYPE2_3) || (sFloorType == FLOOR_TYPE_9) ||
if ((play->roomCtx.curRoom.environmentType == ROOM_ENV_HOT) || (sFloorType == FLOOR_TYPE_9) ||
((func_80838144(sFloorType) >= 0) &&
!func_80042108(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId))) {
func_8083821C(this);