Quake & Distortion Cleanup (#1102)

* quake cleanup

* cleanup

* more cleanup

* remove cast

* q comes before r...

* unname goron function, leave it to another PR

* PR Suggestions
This commit is contained in:
engineer124
2022-09-30 23:01:39 -03:00
committed by GitHub
parent b080fb3700
commit ab5fd663cc
40 changed files with 496 additions and 389 deletions
+3 -34
View File
@@ -745,8 +745,8 @@ s16 Actor_TestFloorInDirection(Actor* actor, PlayState* play, f32 distance, s16
s32 Actor_IsTargeted(PlayState* play, Actor* actor);
s32 Actor_OtherIsTargeted(PlayState* play, Actor* actor);
void func_800BC620(Vec3f* arg0, Vec3f* arg1, u8 alpha, PlayState* play);
void func_800BC770(PlayState* play, s16 y, s16 countdown);
void func_800BC7D8(PlayState* play, s16 y, s16 countdown, s16 speed);
void Actor_AddQuake(PlayState* play, s16 verticalMag, s16 countdown);
void Actor_AddQuakeWithSpeed(PlayState* play, s16 verticalMag, s16 countdown, s16 speed);
void func_800BC848(Actor* actor, PlayState* play, s16 y, s16 countdown);
void Actor_DrawDoorLock(PlayState* play, s32 frame, s32 type);
void Actor_SetColorFilter(Actor* actor, u16 colorFlag, u16 colorIntensityMax, u16 xluFlag, u16 duration);
@@ -923,7 +923,7 @@ u32 SurfaceType_GetEcho(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId)
u32 SurfaceType_IsHookshotSurface(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId);
s32 SurfaceType_IsIgnoredByEntities(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId);
s32 SurfaceType_IsIgnoredByProjectiles(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId);
s32 SurfaceType_GetConveyorType(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId);
s32 SurfaceType_IsFloorConveyor(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId);
s32 func_800C9DDC(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId);
u32 SurfaceType_GetConveyorSpeed(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId);
u32 SurfaceType_GetConveyorDirection(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId);
@@ -1958,37 +1958,6 @@ s32 func_80128640(PlayState* play, Player* player, Gfx* dlist);
void func_80128B74(PlayState* play, Player* player, s32 limbIndex);
void func_80128BD0(PlayState* play, s32 limbIndex, Gfx** dList1, Gfx** dList2, Vec3s* rot, Actor* actor);
f32 Quake_Random(void);
void Quake_UpdateShakeInfo(QuakeRequest* req, ShakeInfo* shake, f32 verticalPertubation, f32 horizontalPertubation);
s16 Quake_Callback1(QuakeRequest* req, ShakeInfo* shake);
s16 Quake_Callback5(QuakeRequest* req, ShakeInfo* shake);
s16 Quake_Callback6(QuakeRequest* req, ShakeInfo* shake);
s16 Quake_Callback3(QuakeRequest* req, ShakeInfo* shake);
s16 Quake_Callback2(QuakeRequest* req, ShakeInfo* shake);
s16 Quake_Callback4(QuakeRequest* req, ShakeInfo* shake);
s16 Quake_GetFreeIndex(void);
QuakeRequest* Quake_AddImpl(Camera* camera, u32 callbackIdx);
void Quake_Remove(QuakeRequest* req);
QuakeRequest* Quake_GetRequest(s16 idx);
u32 Quake_SetValue(s16 idx, s16 valueType, s16 value);
u32 Quake_SetSpeed(s16 idx, s16 value);
u32 Quake_SetCountdown(s16 idx, s16 value);
s16 Quake_GetCountdown(s16 idx);
u32 Quake_SetQuakeValues(s16 idx, s16 verticalMag, s16 horizontalMag, s16 zoom, s16 rollOffset);
u32 Quake_SetQuakeValues2(s16 idx, s16 isShakePerpendicular, Vec3s shakePlaneOffset);
void Quake_Init(void);
s16 Quake_Add(Camera* camera, u32 callbackIdx);
u32 Quake_RemoveFromIdx(s16 idx);
s16 Quake_Calc(Camera* camera, QuakeCamCalc* camData);
void Distortion_Init(PlayState* play);
void Distortion_SetCountdown(s16 countdown);
s16 Distortion_GetCountdown(void);
s16 Distortion_GetType(void);
void Distortion_SetType(s32 type);
void Distortion_ClearType(s32 type);
s32 Distortion_GetUnderwaterCurrentSpeed(Player* player);
void Distortion_Update(void);
s32 Quake_NumActiveQuakes(void);
Gfx* Gfx_SetFog(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 n, s32 f);
Gfx* Gfx_SetFogWithSync(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 n, s32 f);
Gfx* Gfx_SetFog2(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 n, s32 f);
-57
View File
@@ -896,63 +896,6 @@ typedef s32 (*ColChkLineFunc)(PlayState*, CollisionCheckContext*, Collider*, Vec
typedef void(*room_draw_func)(PlayState* play, Room* room, u32 flags);
typedef struct {
/* 0x00 */ Vec3f atOffset;
/* 0x0C */ Vec3f eyeOffset;
/* 0x18 */ s16 rollOffset;
/* 0x1A */ s16 zoom;
} ShakeInfo; // size = 0x1C
typedef struct {
/* 0x00 */ s16 randIdx;
/* 0x02 */ s16 countdownMax;
/* 0x04 */ Camera* camera;
/* 0x08 */ u32 callbackIdx;
/* 0x0C */ s16 verticalMag;
/* 0x0E */ s16 horizontalMag;
/* 0x10 */ s16 zoom;
/* 0x12 */ s16 rollOffset;
/* 0x14 */ Vec3s shakePlaneOffset; // angle deviations from shaking in the perpendicular plane
/* 0x1A */ s16 speed;
/* 0x1C */ s16 isShakePerpendicular;
/* 0x1E */ s16 countdown;
/* 0x20 */ s16 camId;
} QuakeRequest; // size = 0x24
typedef struct {
/* 0x00 */ Vec3f atOffset;
/* 0x0C */ Vec3f eyeOffset;
/* 0x18 */ s16 rollOffset;
/* 0x1A */ s16 zoom;
/* 0x1C */ f32 max; // Set to scaled max data of struct (mag for Vec3f), never used
} QuakeCamCalc; // size = 0x20
typedef s16 (*QuakeCallbackFunc)(QuakeRequest*, ShakeInfo*);
#define QUAKE_SPEED (1 << 0)
#define QUAKE_VERTICAL_MAG (1 << 1)
#define QUAKE_HORIZONTAL_MAG (1 << 2)
#define QUAKE_ZOOM (1 << 3)
#define QUAKE_ROLL_OFFSET (1 << 4)
#define QUAKE_SHAKE_PLANE_OFFSET_X (1 << 5)
#define QUAKE_SHAKE_PLANE_OFFSET_Y (1 << 6)
#define QUAKE_SHAKE_PLANE_OFFSET_Z (1 << 7)
#define QUAKE_COUNTDOWN (1 << 8)
#define QUAKE_IS_SHAKE_PERPENDICULAR (1 << 9)
typedef struct {
/* 0x0 */ PlayState* play;
/* 0x4 */ s32 type; // bitfield, highest set bit determines type
/* 0x8 */ s16 countdown;
/* 0xA */ s16 state;
} DistortionContext; // size = 0xC
typedef enum {
/* 0 */ DISTORTION_INACTIVE,
/* 1 */ DISTORTION_ACTIVE,
/* 2 */ DISTORTION_SETUP
} DistortionState;
typedef struct {
/* 0x000 */ u8 controllers; // bit 0 is set if controller 1 is plugged in, etc.
/* 0x001 */ UNK_TYPE1 pad1[0x13];
-5
View File
@@ -56,11 +56,6 @@ struct DynaPolyActor;
// CollisionContext flags
#define BGCHECK_FLAG_REVERSE_CONVEYOR_FLOW 1
typedef enum {
/* 0 */ CONVEYOR_WATER,
/* 1 */ CONVEYOR_FLOOR
} ConveyorType;
typedef struct {
/* 0x0 */ Vec3s pos;
} BgVertex; // size = 0x6
+69
View File
@@ -0,0 +1,69 @@
#ifndef Z64QUAKE_H
#define Z64QUAKE_H
#include "z64math.h"
struct PlayState;
struct Camera;
typedef struct {
/* 0x00 */ Vec3f atOffset;
/* 0x0C */ Vec3f eyeOffset;
/* 0x18 */ s16 rollOffset;
/* 0x1A */ s16 zoom;
/* 0x1C */ f32 max; // Set to scaled max data of struct (mag for Vec3f), never used
} QuakeCamCalc; // size = 0x20
#define QUAKE_SPEED (1 << 0)
#define QUAKE_VERTICAL_MAG (1 << 1)
#define QUAKE_HORIZONTAL_MAG (1 << 2)
#define QUAKE_ZOOM (1 << 3)
#define QUAKE_ROLL_OFFSET (1 << 4)
#define QUAKE_SHAKE_PLANE_OFFSET_X (1 << 5)
#define QUAKE_SHAKE_PLANE_OFFSET_Y (1 << 6)
#define QUAKE_SHAKE_PLANE_OFFSET_Z (1 << 7)
#define QUAKE_COUNTDOWN (1 << 8)
#define QUAKE_IS_SHAKE_PERPENDICULAR (1 << 9)
typedef enum {
/* 1 */ QUAKE_TYPE_1 = 1,
/* 2 */ QUAKE_TYPE_2,
/* 3 */ QUAKE_TYPE_3,
/* 4 */ QUAKE_TYPE_4,
/* 5 */ QUAKE_TYPE_5,
/* 6 */ QUAKE_TYPE_6
} QuakeType;
u32 Quake_SetValue(s16 quakeIndex, s16 valueType, s16 value);
u32 Quake_SetSpeed(s16 quakeIndex, s16 speed);
u32 Quake_SetCountdown(s16 quakeIndex, s16 countdown);
s16 Quake_GetCountdown(s16 quakeIndex);
u32 Quake_SetQuakeValues(s16 quakeIndex, s16 verticalMag, s16 horizontalMag, s16 zoom, s16 rollOffset);
u32 Quake_SetQuakeValues2(s16 quakeIndex, s16 isShakePerpendicular, Vec3s shakePlaneOffset);
s16 Quake_Add(Camera* camera, u32 type);
s16 Quake_Calc(Camera* camera, QuakeCamCalc* camData);
u32 Quake_Remove(s16 quakeIndex);
s32 Quake_NumActiveQuakes(void);
void Quake_Init(void);
#define DISTORTION_TYPE_0 (1 << 0)
#define DISTORTION_TYPE_2 (1 << 2)
#define DISTORTION_TYPE_3 (1 << 3)
#define DISTORTION_TYPE_4 (1 << 4)
#define DISTORTION_TYPE_5 (1 << 5)
#define DISTORTION_TYPE_6 (1 << 6)
#define DISTORTION_TYPE_7 (1 << 7)
#define DISTORTION_TYPE_8 (1 << 8)
#define DISTORTION_TYPE_9 (1 << 9)
#define DISTORTION_TYPE_A (1 << 10)
#define DISTORTION_TYPE_B (1 << 11)
void Distortion_SetCountdown(s16 countdown);
s16 Distortion_GetCountdown(void);
s16 Distortion_GetType(void);
void Distortion_SetType(s32 type);
void Distortion_ClearType(s32 type);
void Distortion_Init(PlayState* play);
void Distortion_Update(void);
#endif
+12 -11
View File
@@ -5,6 +5,7 @@
#include "global.h"
#include "z64load.h"
#include "z64quake.h"
#include "z64rumble.h"
#include "overlays/actors/ovl_En_Horse/z_en_horse.h"
#include "overlays/actors/ovl_En_Part/z_en_part.h"
@@ -3777,20 +3778,20 @@ void func_800BC620(Vec3f* arg0, Vec3f* arg1, u8 alpha, PlayState* play) {
CLOSE_DISPS(play->state.gfxCtx);
}
void func_800BC770(PlayState* play, s16 y, s16 countdown) {
s16 idx = Quake_Add(&play->mainCamera, 3);
void Actor_AddQuake(PlayState* play, s16 verticalMag, s16 countdown) {
s16 quakeIndex = Quake_Add(&play->mainCamera, QUAKE_TYPE_3);
Quake_SetSpeed(idx, 20000);
Quake_SetQuakeValues(idx, y, 0, 0, 0);
Quake_SetCountdown(idx, countdown);
Quake_SetSpeed(quakeIndex, 20000);
Quake_SetQuakeValues(quakeIndex, verticalMag, 0, 0, 0);
Quake_SetCountdown(quakeIndex, countdown);
}
void func_800BC7D8(PlayState* play, s16 y, s16 countdown, s16 speed) {
s16 idx = Quake_Add(&play->mainCamera, 3);
void Actor_AddQuakeWithSpeed(PlayState* play, s16 verticalMag, s16 countdown, s16 speed) {
s16 quakeIndex = Quake_Add(&play->mainCamera, QUAKE_TYPE_3);
Quake_SetSpeed(idx, speed);
Quake_SetQuakeValues(idx, y, 0, 0, 0);
Quake_SetCountdown(idx, countdown);
Quake_SetSpeed(quakeIndex, speed);
Quake_SetQuakeValues(quakeIndex, verticalMag, 0, 0, 0);
Quake_SetCountdown(quakeIndex, countdown);
}
// Actor_RequestRumble?
@@ -3800,7 +3801,7 @@ void func_800BC848(Actor* actor, PlayState* play, s16 y, s16 countdown) {
} else {
Rumble_Request(actor->xyzDistToPlayerSq, 180, 20, 100);
}
func_800BC770(play, y, countdown);
Actor_AddQuake(play, y, countdown);
}
typedef struct {
+10 -6
View File
@@ -4331,18 +4331,22 @@ s32 SurfaceType_IsIgnoredByProjectiles(CollisionContext* colCtx, CollisionPoly*
}
/**
* SurfaceType Get Conveyor Surface Type
* Return type 0 (CONVEYOR_WATER) if 'poly' is a surface that will only move player underwater
* Return type 1 (CONVEYOR_FLOOR) if `poly` is a surface that must be stood on to move player
* Checks if poly is a floor conveyor
*
* A conveyor surface is enabled with non-zero speed.
* When enabled, the conveyor will exhibit two types of behaviour depending on the return value:
*
* If true, then it is a floor conveyor and will push player only while being stood on
* If false, then it is a water conveyor and will push player only while in water
*/
s32 SurfaceType_GetConveyorType(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId) {
s32 SurfaceType_IsFloorConveyor(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId) {
u32 flags;
if (BgCheck_GetCollisionHeader(colCtx, bgId) == NULL) {
return CONVEYOR_FLOOR;
return true;
}
if (poly == NULL) {
return CONVEYOR_WATER;
return false;
}
flags = poly->flags_vIB & 0x2000;
return !!flags;
+1
View File
@@ -1,4 +1,5 @@
#include "global.h"
#include "z64quake.h"
/**
* Returns the absolute value for floats
+4 -3
View File
@@ -1,4 +1,5 @@
#include "global.h"
#include "z64quake.h"
#include "z64rumble.h"
#include "overlays/gamestates/ovl_daytelop/z_daytelop.h"
@@ -191,7 +192,7 @@ void Cutscene_Command_Misc(PlayState* play, CutsceneContext* csCtx, CsCmdBase* c
case 0x8:
func_8019F128(NA_SE_EV_EARTHQUAKE_LAST - SFX_FLAG);
if (isStartFrame) {
sCutsceneQuakeIndex = Quake_Add(GET_ACTIVE_CAM(play), 6);
sCutsceneQuakeIndex = Quake_Add(GET_ACTIVE_CAM(play), QUAKE_TYPE_6);
Quake_SetSpeed(sCutsceneQuakeIndex, 22000);
Quake_SetQuakeValues(sCutsceneQuakeIndex, 6, 4, 0, 0);
Quake_SetCountdown(sCutsceneQuakeIndex, 800);
@@ -281,7 +282,7 @@ void Cutscene_Command_Misc(PlayState* play, CutsceneContext* csCtx, CsCmdBase* c
case 0x1A:
func_8019F128(NA_SE_EV_EARTHQUAKE_LAST2 - SFX_FLAG);
if (isStartFrame) {
sCutsceneQuakeIndex = Quake_Add(GET_ACTIVE_CAM(play), 6);
sCutsceneQuakeIndex = Quake_Add(GET_ACTIVE_CAM(play), QUAKE_TYPE_6);
Quake_SetSpeed(sCutsceneQuakeIndex, 30000);
Quake_SetQuakeValues(sCutsceneQuakeIndex, 20, 10, 0, 0);
Quake_SetCountdown(sCutsceneQuakeIndex, 800);
@@ -333,7 +334,7 @@ void Cutscene_Command_Misc(PlayState* play, CutsceneContext* csCtx, CsCmdBase* c
case 0x24:
func_8019F128(NA_SE_EV_EARTHQUAKE_LAST - SFX_FLAG);
if (isStartFrame) {
sCutsceneQuakeIndex = Quake_Add(GET_ACTIVE_CAM(play), 6);
sCutsceneQuakeIndex = Quake_Add(GET_ACTIVE_CAM(play), QUAKE_TYPE_6);
Quake_SetSpeed(sCutsceneQuakeIndex, 22000);
Quake_SetQuakeValues(sCutsceneQuakeIndex, 2, 1, 0, 0);
Quake_SetCountdown(sCutsceneQuakeIndex, 800);
+1
View File
@@ -1,4 +1,5 @@
#include "global.h"
#include "z64quake.h"
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_80165460.s")
+181 -117
View File
File diff suppressed because it is too large Load Diff
@@ -6,6 +6,7 @@
#include "prevent_bss_reordering.h"
#include "z_bg_hakugin_post.h"
#include "z64quake.h"
#include "z64rumble.h"
#include "objects/object_hakugin_obj/object_hakugin_obj.h"
@@ -509,7 +510,7 @@ void func_80A9C058(BgHakuginPost* this, PlayState* play, BgHakuginPostUnkStruct*
s32 pad;
Vec3f sp44;
s32 pad2[2];
s16 quake;
s16 quakeIndex;
if (this->unk_170 == 0) {
for (i = 0; i < unkStruct->count; i++) {
@@ -520,10 +521,12 @@ void func_80A9C058(BgHakuginPost* this, PlayState* play, BgHakuginPostUnkStruct*
sp44.y = this->unk_16C + unkStruct1->unk_14.y;
sp44.z = this->dyna.actor.home.pos.z + unkStruct1->unk_14.z;
Rumble_Request(Math3D_Vec3fDistSq(&sp44, &GET_PLAYER(play)->actor.world.pos), 255, 20, 150);
quake = Quake_Add(GET_ACTIVE_CAM(play), 3);
Quake_SetSpeed(quake, 20000);
Quake_SetQuakeValues(quake, 7, 0, 0, 0);
Quake_SetCountdown(quake, 12);
quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
Quake_SetSpeed(quakeIndex, 20000);
Quake_SetQuakeValues(quakeIndex, 7, 0, 0, 0);
Quake_SetCountdown(quakeIndex, 12);
if (this->unk_179 <= 0) {
func_8019F128(NA_SE_EV_STONEDOOR_STOP);
this->unk_179 = 40;
@@ -538,15 +541,16 @@ void func_80A9C18C(BgHakuginPost* this, PlayState* play) {
s32 pad;
Player* player = GET_PLAYER(play);
Camera* activeCam = GET_ACTIVE_CAM(play);
s16 quake;
s16 quakeIndex;
Rumble_Request(Math3D_XZDistanceSquared(player->actor.world.pos.x, player->actor.world.pos.z,
this->dyna.actor.home.pos.x, this->dyna.actor.home.pos.z),
255, 20, 150);
quake = Quake_Add(activeCam, 3);
Quake_SetSpeed(quake, 17232);
Quake_SetQuakeValues(quake, 6, 0, 0, 0);
Quake_SetCountdown(quake, 20);
quakeIndex = Quake_Add(activeCam, QUAKE_TYPE_3);
Quake_SetSpeed(quakeIndex, 17232);
Quake_SetQuakeValues(quakeIndex, 6, 0, 0, 0);
Quake_SetCountdown(quakeIndex, 20);
}
void func_80A9C228(BgHakuginPost* this, PlayState* play, BgHakuginPostUnkStruct* unkStruct) {
@@ -5,6 +5,7 @@
*/
#include "z_bg_ikana_dharma.h"
#include "z64quake.h"
#include "assets/objects/object_ikana_obj/object_ikana_obj.h"
#define FLAGS (ACTOR_FLAG_10)
@@ -226,11 +227,12 @@ void BgIkanaDharma_Update(Actor* thisx, PlayState* play) {
Actor_MoveWithGravity(&this->dyna.actor);
Actor_UpdateBgCheckInfo(play, &this->dyna.actor, 0.0f, 0.0f, 0.0f, 4);
if (this->dyna.actor.bgCheckFlags & 2) {
s16 quake = Quake_Add(GET_ACTIVE_CAM(play), 3);
s16 quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
Quake_SetSpeed(quakeIndex, 21536);
Quake_SetQuakeValues(quakeIndex, 4, 0, 0, 0);
Quake_SetCountdown(quakeIndex, 12);
Quake_SetSpeed(quake, 21536);
Quake_SetQuakeValues(quake, 4, 0, 0, 0);
Quake_SetCountdown(quake, 12);
Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND);
}
} else {
@@ -5,6 +5,7 @@
*/
#include "z_bg_ikana_rotaryroom.h"
#include "z64quake.h"
#include "overlays/actors/ovl_Bg_Ikana_Block/z_bg_ikana_block.h"
#include "overlays/actors/ovl_En_Torch2/z_en_torch2.h"
#include "overlays/actors/ovl_En_Water_Effect/z_en_water_effect.h"
@@ -831,11 +832,11 @@ void func_80B81A80(Actor* thisx, PlayState* play) {
func_80B81B84(this);
} else if (this->unk_584 == 15) {
s16 sp26 = Quake_Add(GET_ACTIVE_CAM(play), 3);
s16 quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
Quake_SetSpeed(sp26, 0x7B30);
Quake_SetQuakeValues(sp26, 6, 0, 100, 0);
Quake_SetCountdown(sp26, 22);
Quake_SetSpeed(quakeIndex, 31536);
Quake_SetQuakeValues(quakeIndex, 6, 0, 100, 0);
Quake_SetCountdown(quakeIndex, 22);
}
}
@@ -858,11 +859,11 @@ void func_80B81BA0(Actor* thisx, PlayState* play) {
thisx->shape.rot.x += 0x1F4;
if (!(this->unk_584 & 7)) {
s16 quake = Quake_Add(GET_ACTIVE_CAM(play), 3);
s16 quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
Quake_SetSpeed(quake, 0x7B30);
Quake_SetQuakeValues(quake, (s32)(Rand_ZeroOne() * 2.5f) + 3, 0, 10, 0);
Quake_SetCountdown(quake, 15);
Quake_SetSpeed(quakeIndex, 31536);
Quake_SetQuakeValues(quakeIndex, (s32)(Rand_ZeroOne() * 2.5f) + 3, 0, 10, 0);
Quake_SetCountdown(quakeIndex, 15);
}
if (Flags_GetSwitch(play, BGIKANAROTARYROOM_GET_FE(&this->dyna.actor))) {
@@ -928,11 +929,11 @@ void func_80B81DC8(Actor* thisx, PlayState* play) {
ActorCutscene_Stop(this->dyna.actor.cutscene);
func_80B818B4(this);
} else if (this->unk_584 == 19) {
s16 quake = Quake_Add(GET_ACTIVE_CAM(play), 3);
s16 quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
Quake_SetSpeed(quake, 0x4E20);
Quake_SetQuakeValues(quake, 5, 0, 40, 60);
Quake_SetCountdown(quake, 17);
Quake_SetSpeed(quakeIndex, 20000);
Quake_SetQuakeValues(quakeIndex, 5, 0, 40, 60);
Quake_SetCountdown(quakeIndex, 17);
}
}
@@ -5,6 +5,7 @@
*/
#include "z_bg_ikana_shutter.h"
#include "z64quake.h"
#include "objects/object_ikana_obj/object_ikana_obj.h"
#define FLAGS (ACTOR_FLAG_10)
@@ -144,16 +145,17 @@ void func_80BD59F8(BgIkanaShutter* this) {
void func_80BD5A18(BgIkanaShutter* this, PlayState* play) {
s32 pad[2];
s16 quake;
s16 quakeIndex;
this->dyna.actor.velocity.y += -5.0f;
this->dyna.actor.velocity.y *= 0.978f;
this->dyna.actor.world.pos.y += this->dyna.actor.velocity.y;
if (this->dyna.actor.world.pos.y <= this->dyna.actor.home.pos.y) {
quake = Quake_Add(GET_ACTIVE_CAM(play), 3);
Quake_SetSpeed(quake, 0x5420);
Quake_SetQuakeValues(quake, 4, 0, 0, 0);
Quake_SetCountdown(quake, 12);
quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
Quake_SetSpeed(quakeIndex, 21536);
Quake_SetQuakeValues(quakeIndex, 4, 0, 0, 0);
Quake_SetCountdown(quakeIndex, 12);
func_80BD5828(this);
}
}
@@ -5,6 +5,7 @@
*/
#include "z_bg_iknin_susceil.h"
#include "z64quake.h"
#include "z64rumble.h"
#include "objects/object_ikninside_obj/object_ikninside_obj.h"
@@ -70,11 +71,12 @@ void func_80C0A838(BgIkninSusceil* this, PlayState* play) {
void func_80C0A86C(BgIkninSusceil* this, PlayState* play, s16 verticalMag, s16 countdown, s32 arg4) {
s32 pad;
s16 quake = Quake_Add(GET_ACTIVE_CAM(play), 3);
s16 quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
Quake_SetSpeed(quakeIndex, 31536);
Quake_SetQuakeValues(quakeIndex, verticalMag, 0, 0, 0);
Quake_SetCountdown(quakeIndex, countdown);
Quake_SetSpeed(quake, 0x7B30);
Quake_SetQuakeValues(quake, verticalMag, 0, 0, 0);
Quake_SetCountdown(quake, countdown);
if (arg4 == 1) {
Rumble_Request(SQ(100.0f), 255, 20, 150);
} else if (arg4 == 2) {
@@ -6,6 +6,7 @@
#include "z_bg_open_shutter.h"
#include "objects/object_open_obj/object_open_obj.h"
#include "z64quake.h"
#include "z64rumble.h"
#define FLAGS (ACTOR_FLAG_10)
@@ -105,7 +106,7 @@ void BgOpenShutter_Destroy(Actor* thisx, PlayState* play) {
}
void func_80ACAD88(BgOpenShutter* this, PlayState* play) {
s32 quake;
s32 doorDirection;
if (this->unk_15C != 0) {
Player* player = GET_PLAYER(play);
@@ -118,10 +119,10 @@ void func_80ACAD88(BgOpenShutter* this, PlayState* play) {
} else {
Player* player = GET_PLAYER(play);
quake = func_80ACABA8(this, play);
if (quake > 0) {
doorDirection = func_80ACABA8(this, play);
if (doorDirection > 0) {
player->doorType = 2;
player->doorDirection = quake;
player->doorDirection = doorDirection;
player->doorActor = &this->dyna.actor;
func_80122F28(player);
}
@@ -142,18 +143,21 @@ void func_80ACAE5C(BgOpenShutter* this, PlayState* play) {
void func_80ACAEF0(BgOpenShutter* this, PlayState* play) {
s32 pad;
s16 quake;
s16 quakeIndex;
Math_StepToF(&this->dyna.actor.velocity.y, 20.0f, 8.0f);
if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, this->dyna.actor.velocity.y)) {
this->dyna.actor.floorHeight = this->dyna.actor.home.pos.y;
Actor_SpawnFloorDustRing(play, &this->dyna.actor, &this->dyna.actor.world.pos, 60.0f, 10, 8.0f, 500, 10, true);
Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_BIGWALL_BOUND);
quake = Quake_Add(Play_GetCamera(play, CAM_ID_MAIN), 3);
Quake_SetSpeed(quake, -0x7F18);
Quake_SetQuakeValues(quake, 2, 0, 0, 0);
Quake_SetCountdown(quake, 10);
quakeIndex = Quake_Add(Play_GetCamera(play, CAM_ID_MAIN), QUAKE_TYPE_3);
Quake_SetSpeed(quakeIndex, -32536);
Quake_SetQuakeValues(quakeIndex, 2, 0, 0, 0);
Quake_SetCountdown(quakeIndex, 10);
Rumble_Request(this->dyna.actor.xyzDistToPlayerSq, 180, 20, 100);
this->unk_15C = 0;
this->actionFunc = func_80ACAD88;
}
@@ -5,6 +5,7 @@
*/
#include "z_boss_hakugin.h"
#include "z64quake.h"
#include "z64rumble.h"
#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10 | ACTOR_FLAG_20)
@@ -5,6 +5,7 @@
*/
#include "z_door_shutter.h"
#include "z64quake.h"
#include "z64rumble.h"
#include "objects/gameplay_keep/gameplay_keep.h"
#include "objects/object_bdoor/object_bdoor.h"
@@ -599,7 +600,7 @@ s32 func_808A1A70(DoorShutter* this) {
}
void func_808A1B48(DoorShutter* this, PlayState* play) {
s16 quake;
s16 quakeIndex;
if (func_808A1A70(this)) {
if (this->actor.velocity.y > 20.0f) {
@@ -607,11 +608,14 @@ void func_808A1B48(DoorShutter* this, PlayState* play) {
Actor_SpawnFloorDustRing(play, &this->actor, &this->actor.world.pos, 45.0f, 10, 8.0f, 500, 10, 0);
}
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BIGWALL_BOUND);
quake = Quake_Add(Play_GetCamera(play, CAM_ID_MAIN), 3);
Quake_SetSpeed(quake, -32536);
Quake_SetQuakeValues(quake, 2, 0, 0, 0);
Quake_SetCountdown(quake, 10);
quakeIndex = Quake_Add(Play_GetCamera(play, CAM_ID_MAIN), QUAKE_TYPE_3);
Quake_SetSpeed(quakeIndex, -32536);
Quake_SetQuakeValues(quakeIndex, 2, 0, 0, 0);
Quake_SetCountdown(quakeIndex, 10);
Rumble_Request(this->actor.xyzDistToPlayerSq, 180, 20, 100);
func_808A1884(this, play);
}
}
+8 -5
View File
@@ -6,6 +6,7 @@
*/
#include "z_en_ani.h"
#include "z64quake.h"
#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
@@ -209,7 +210,7 @@ void EnAni_LandOnFoot(EnAni* this, PlayState* play) {
void EnAni_FallToGround(EnAni* this, PlayState* play) {
s32 pad;
s16 quakeValue;
s16 quakeIndex;
if (this->actor.bgCheckFlags & 1) { // hit the ground
this->actor.flags &= ~ACTOR_FLAG_10;
@@ -219,10 +220,12 @@ void EnAni_FallToGround(EnAni* this, PlayState* play) {
// the animation gets cut short, (first 16 frames only) only the landing part is seen
Animation_Change(&this->skelAnime, &gAniLandingThenStandingUpAnim, 1.0f, 0.0f, 16.0f, ANIMMODE_ONCE, 0.0f);
this->stateFlags |= ANI_STATE_WRITHING;
quakeValue = Quake_Add(play->cameraPtrs[CAM_ID_MAIN], 3);
Quake_SetSpeed(quakeValue, 0x6978);
Quake_SetQuakeValues(quakeValue, 7, 0, 0, 0);
Quake_SetCountdown(quakeValue, 0x14);
quakeIndex = Quake_Add(play->cameraPtrs[CAM_ID_MAIN], QUAKE_TYPE_3);
Quake_SetSpeed(quakeIndex, 27000);
Quake_SetQuakeValues(quakeIndex, 7, 0, 0, 0);
Quake_SetCountdown(quakeIndex, 20);
Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_HAMMER_HIT);
}
@@ -5,6 +5,7 @@
*/
#include "z_en_bigpamet.h"
#include "z64quake.h"
#include "z64rumble.h"
#include "overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.h"
#include "objects/gameplay_keep/gameplay_keep.h"
@@ -518,7 +519,7 @@ void func_80A28760(EnBigpamet* this) {
}
void func_80A287E8(EnBigpamet* this, PlayState* play) {
s16 quake;
s16 quakeIndex;
this->actor.shape.rot.y += 0x3B00;
func_800B9010(&this->actor, NA_SE_EN_B_PAMET_ROLL - SFX_FLAG);
@@ -538,12 +539,16 @@ void func_80A287E8(EnBigpamet* this, PlayState* play) {
}
if (this->actor.bgCheckFlags & 8) {
quake = Quake_Add(GET_ACTIVE_CAM(play), 3);
quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
this->actor.velocity.y = this->unk_29E * 0.375f;
Quake_SetSpeed(quake, 0x4E20);
Quake_SetQuakeValues(quake, 15, 0, 0, 0);
Quake_SetCountdown(quake, 10);
Quake_SetSpeed(quakeIndex, 20000);
Quake_SetQuakeValues(quakeIndex, 15, 0, 0, 0);
Quake_SetCountdown(quakeIndex, 10);
Rumble_Request(this->actor.xyzDistToPlayerSq, 180, 20, 100);
func_80A27B58(this);
func_80A27DD8(this, play);
func_80A28970(this);

Some files were not shown because too many files have changed in this diff Show More