mirror of
https://github.com/ACreTeam/ac-decomp
synced 2026-05-23 06:34:18 -04:00
renaming some fish variables
This commit is contained in:
+26
-23
@@ -5,6 +5,7 @@
|
||||
#include "m_actor.h"
|
||||
#include "c_keyframe.h"
|
||||
#include "libu64/u64types.h"
|
||||
#include "ac_gyoei.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -23,7 +24,7 @@ typedef void (*PRIV_FISH_PROCESS)(struct _FISH_PRIVATE_DATA*, GAME*);
|
||||
// unsure temp structs
|
||||
|
||||
typedef struct _MUSEUM_FISH_INIT_DATA {
|
||||
f32 _00;
|
||||
f32 renderScale;
|
||||
f32 _04;
|
||||
f32 _08;
|
||||
f32 _0C;
|
||||
@@ -34,8 +35,8 @@ typedef struct _MUSEUM_FISH_INIT_DATA {
|
||||
f32 _20;
|
||||
f32 _24;
|
||||
f32 _28;
|
||||
s16 _2C;
|
||||
s16 _2E;
|
||||
s16 activeFramesMin;
|
||||
s16 activeFramesRange;
|
||||
s16 _30;
|
||||
} MUSEUM_FISH_INIT_DATA; // size: 0x34
|
||||
|
||||
@@ -81,17 +82,19 @@ typedef struct _YET_SKELETON_2 {
|
||||
s16 _56C;
|
||||
} YET_SKELETON_2;
|
||||
|
||||
typedef enum fish_type MUSEUM_FISH_TYPE;
|
||||
|
||||
typedef struct _FISH_PRIVATE_DATA {
|
||||
MUSEUM_FISH_INIT_DATA init_data;
|
||||
PRIV_FISH_PROCESS _34; // size:4
|
||||
PRIV_FISH_PROCESS currentProcess; // size:4
|
||||
YET_SKELETON _38;
|
||||
|
||||
YET_SKELETON_2* _590;
|
||||
struct _FISH_PRIVATE_DATA* _594;
|
||||
struct _FISH_PRIVATE_DATA* _598;
|
||||
|
||||
s32 _59C; // fish num
|
||||
xyz_t _5A0;
|
||||
MUSEUM_FISH_TYPE fishIDEnum;
|
||||
xyz_t position;
|
||||
xyz_t _5AC;
|
||||
xyz_t _5B8;
|
||||
artificial_padding(0x5B8, 0x5D0, xyz_t);
|
||||
@@ -113,12 +116,12 @@ typedef struct _FISH_PRIVATE_DATA {
|
||||
s16 _620;
|
||||
s16 _622;
|
||||
s16 _624;
|
||||
s16 _626;
|
||||
s16 _628;
|
||||
s16 activityFrameCount;
|
||||
s16 savedActivityFrameCount;
|
||||
s16 _62A;
|
||||
s16 _62C;
|
||||
s16 _62E;
|
||||
s16 _630;
|
||||
s16 _62E_flags;
|
||||
s16 group;
|
||||
s16 _632;
|
||||
s16 _634;
|
||||
s16 _636;
|
||||
@@ -143,13 +146,13 @@ typedef struct _FISH_DISPLAY_MSG_INFO {
|
||||
typedef struct _MUSEUM_FISH_ACTOR {
|
||||
ACTOR actor; // offset: 0, size: 0x174
|
||||
int _174;
|
||||
MUSEUM_FISH_PRIVATE_DATA prvFish[40]; // offset: 0x178 size: 0xFB48
|
||||
MUSEUM_FISH_KUSA_DATA prvKusa[14]; // offset: 0xFCB8 size: 0x4AD0
|
||||
YET_SKELETON_2 _14788; // offset: 0x14788 size: 0x570
|
||||
MUSEUM_FISH_PRIVATE_DATA prvFish[aGYO_TYPE_NUM]; // offset: 0x178 size: 0xFB48
|
||||
MUSEUM_FISH_KUSA_DATA prvKusa[14]; // offset: 0xFCB8 size: 0x4AD0
|
||||
YET_SKELETON_2 _14788; // offset: 0x14788 size: 0x570
|
||||
|
||||
u8 _14cf8[16]; // temp
|
||||
|
||||
xyz_t _14d08[2];
|
||||
xyz_t lightPosition[2];
|
||||
int numFishDisplayed; // offset: 0x14d20, size: 4
|
||||
int fishDisplayMsgIter; // offset: 0x14d24, size: 4
|
||||
FISH_DISPLAY_MSG_INFO fishDisplayMsgInfo[10]; // offset: 0x14d28, size: 4*10
|
||||
@@ -160,15 +163,15 @@ typedef struct _MUSEUM_FISH_ACTOR {
|
||||
|
||||
s16 _14daa[5];
|
||||
s16 _14db4;
|
||||
s16 _14db6; // offset: 0x14db6, size: 2
|
||||
s16 _14db8; // offset: 0x14db8, size: 2
|
||||
s16 _14dba; // offset: 0x14dba, size: 2
|
||||
s16 _14dbc[2]; // offset: 0x14dbc, size: 4
|
||||
s16 _14dc0; // offset: 0x14dc0, size: 2
|
||||
s16 _14dc2; // offset: 0x14dc2, size: 2
|
||||
s16 _14dc4; // offset: 0x14dc4, size: 2
|
||||
s16 _14dc8; // offset: 0x14dc8, size: 2
|
||||
} MUSEUM_FISH_ACTOR; // size 14DCA
|
||||
s16 _14db6; // offset: 0x14db6, size: 2
|
||||
s16 lightID1; // offset: 0x14db8, size: 2
|
||||
s16 lightID2; // offset: 0x14dba, size: 2
|
||||
s16 lightPower[2]; // offset: 0x14dbc, size: 4
|
||||
s16 _14dc0; // offset: 0x14dc0, size: 2
|
||||
s16 _14dc2; // offset: 0x14dc2, size: 2
|
||||
s16 _14dc4; // offset: 0x14dc4, size: 2
|
||||
s16 _14dc8; // offset: 0x14dc8, size: 2
|
||||
} MUSEUM_FISH_ACTOR; // size 14DCA
|
||||
|
||||
// ac_museum_fish.c_inc
|
||||
void Museum_Fish_Prv_data_init(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game, int fishNum, int r6);
|
||||
|
||||
+106
-109
@@ -670,22 +670,22 @@ float kusa_start_frame[14] = {
|
||||
// clang-format on
|
||||
|
||||
void Museum_Fish_Prv_data_init(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game, int fishNum, int r6) {
|
||||
actor->_59C = fishNum;
|
||||
actor->fishIDEnum = fishNum;
|
||||
actor->init_data = mfish_init_data[fishNum];
|
||||
actor->_630 = mfish_group_tbl[fishNum];
|
||||
actor->group = mfish_group_tbl[fishNum];
|
||||
|
||||
if (actor->_630 >= 0) {
|
||||
actor->_5A0 = suisou_pos[actor->_630];
|
||||
if (actor->group >= 0) {
|
||||
actor->position = suisou_pos[actor->group];
|
||||
} else {
|
||||
actor->_5A0 = ZeroVec;
|
||||
actor->position = ZeroVec;
|
||||
}
|
||||
|
||||
actor->_5A0.y = mfish_init_data[fishNum]._0C + RANDOM2_F(10);
|
||||
actor->position.y = mfish_init_data[fishNum]._0C + RANDOM2_F(10);
|
||||
if (r6 == 1) {
|
||||
actor->_5A0.x += RANDOM2_F(90);
|
||||
actor->_5A0.z += RANDOM2_F(90);
|
||||
actor->position.x += RANDOM2_F(90);
|
||||
actor->position.z += RANDOM2_F(90);
|
||||
}
|
||||
actor->_34 = &mfish_normal_process;
|
||||
actor->currentProcess = &mfish_normal_process;
|
||||
mfish_ct[fishNum](actor, game);
|
||||
}
|
||||
|
||||
@@ -714,19 +714,19 @@ void Museum_Fish_Actor_ct(ACTOR* actorx, GAME* gamex) {
|
||||
// actor->_101f0[i * 2 + 2] = qrand();
|
||||
}
|
||||
|
||||
if (mMmd_FishInfo(0x21)) {
|
||||
actor->prvFish[0x21]._590 = &actor->_14788;
|
||||
if (mMmd_FishInfo(aGYO_TYPE_FROG)) {
|
||||
actor->prvFish[aGYO_TYPE_FROG]._590 = &actor->_14788;
|
||||
} else {
|
||||
mfish_hasu_ct(&actor->_14788, gamex);
|
||||
}
|
||||
|
||||
prv = actor->prvFish;
|
||||
for (i = 0; i < 40; i++, prv++) {
|
||||
prv->_62E &= ~1;
|
||||
for (i = 0; i < aGYO_TYPE_NUM; i++, prv++) {
|
||||
prv->_62E_flags &= ~1;
|
||||
if (mMmd_FishInfo(i)) {
|
||||
prv->_38._54C = mfish_model_tbl[i];
|
||||
prv->_38._550[0] = mfish_anime_init_tbl[i];
|
||||
prv->_62E |= 1;
|
||||
prv->_62E_flags |= 1;
|
||||
Museum_Fish_Prv_data_init(prv, gamex, i, 1);
|
||||
}
|
||||
}
|
||||
@@ -871,20 +871,15 @@ void Museum_Fish_Talk_process(ACTOR* actorx, GAME* game) {
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (chkTrigger(BUTTON_A) != 0 && mDemo_Get_talk_actor() == 0) {
|
||||
int i;
|
||||
for (i = 0; i < 5; i++) {
|
||||
if (Museum_Fish_Check_Talk_Distance(game, i)) {
|
||||
Museum_Fish_Set_MsgFishInfo(actorx, i);
|
||||
mDemo_Request(8, actorx, &Museum_Fish_set_talk_info);
|
||||
}
|
||||
} else if (chkTrigger(BUTTON_A) != 0 && mDemo_Get_talk_actor() == 0) {
|
||||
int i;
|
||||
for (i = 0; i < 5; i++) {
|
||||
if (Museum_Fish_Check_Talk_Distance(game, i)) {
|
||||
Museum_Fish_Set_MsgFishInfo(actorx, i);
|
||||
mDemo_Request(8, actorx, &Museum_Fish_set_talk_info);
|
||||
}
|
||||
}
|
||||
}
|
||||
// line 16C
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void Museum_Fish_Actor_move(ACTOR* actorx, GAME* game) {
|
||||
@@ -908,18 +903,18 @@ void Museum_Fish_Actor_move(ACTOR* actorx, GAME* game) {
|
||||
p = player->actor_class.world.position;
|
||||
|
||||
if (actor->_14db4 == 3) {
|
||||
actor->prvFish[0x17]._626 = 0;
|
||||
actor->prvFish[0x1e]._626 = 0;
|
||||
actor->prvFish[0x18]._626 = 0;
|
||||
actor->prvFish[aGYO_TYPE_GOLDFISH].activityFrameCount = 0;
|
||||
actor->prvFish[aGYO_TYPE_POPEYED_GOLDFISH].activityFrameCount = 0;
|
||||
actor->prvFish[aGYO_TYPE_PIRANHA].activityFrameCount = 0;
|
||||
} else if (actor->_14db4 == 0) {
|
||||
actor->prvFish[2]._626 = 20;
|
||||
actor->prvFish[3]._626 = 20;
|
||||
actor->prvFish[aGYO_TYPE_CARP].activityFrameCount = 20;
|
||||
actor->prvFish[aGYO_TYPE_KOI].activityFrameCount = 20;
|
||||
}
|
||||
|
||||
for (i = 0; i < 40; i++, prv++) {
|
||||
f32 v = search_position_distanceXZ(&p, &prv->_5A0);
|
||||
if (actor->_14db4 == prv->_630 && v < 60.0f) {
|
||||
prv->_626 = RANDOM_F(60);
|
||||
for (i = 0; i < aGYO_TYPE_NUM; i++, prv++) {
|
||||
f32 v = search_position_distanceXZ(&p, &prv->position);
|
||||
if (actor->_14db4 == prv->group && v < 60.0f) {
|
||||
prv->activityFrameCount = RANDOM_F(60);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -964,14 +959,14 @@ void Museum_Fish_Actor_move(ACTOR* actorx, GAME* game) {
|
||||
{
|
||||
// needs a new variable
|
||||
MUSEUM_FISH_PRIVATE_DATA* prv = actor->prvFish;
|
||||
for (i = 0; i < 40; i++, prv++) {
|
||||
if (prv->_62E & 1) {
|
||||
for (i = 0; i < aGYO_TYPE_NUM; i++, prv++) {
|
||||
if (prv->_62E_flags & 1) {
|
||||
mfish_mv[i](prv, game);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((actor->prvFish[0x21]._62E & 1) == 0) {
|
||||
if ((actor->prvFish[aGYO_TYPE_FROG]._62E_flags & 1) == 0) {
|
||||
mfish_hasu_mv(&actor->_14788, game);
|
||||
}
|
||||
|
||||
@@ -1014,7 +1009,7 @@ void Museum_Fish_Suisou_draw(ACTOR* actorx, GAME* game, int r5) {
|
||||
|
||||
CLOSE_DISP(graph);
|
||||
|
||||
if ((actor->prvFish[0x21]._62E & 1) == 0) {
|
||||
if ((actor->prvFish[aGYO_TYPE_FROG]._62E_flags & 1) == 0) {
|
||||
mfish_hasu_dw(&actor->_14788, game);
|
||||
}
|
||||
}
|
||||
@@ -1076,6 +1071,7 @@ void Museum_Fish_Kusa_Draw(ACTOR* actorx, GAME* game, int r5) {
|
||||
|
||||
extern EVW_ANIME_DATA obj_suisou1_evw_anime, obj_museum5_evw_anime;
|
||||
extern Gfx act_mus_fish_set_mode;
|
||||
|
||||
void Museum_Fish_Actor_draw(ACTOR* actorx, GAME* game) {
|
||||
MUSEUM_FISH_ACTOR* actor = (MUSEUM_FISH_ACTOR*)actorx;
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
@@ -1099,26 +1095,28 @@ void Museum_Fish_Actor_draw(ACTOR* actorx, GAME* game) {
|
||||
CLOSE_DISP(graph);
|
||||
|
||||
prv = actor->prvFish;
|
||||
for (i = 0; i < 40; i++, prv++) {
|
||||
if (prv->_62E & 1 && prv->_59C != 0x23 && prv->_59C != 0x21 &&
|
||||
for (i = 0; i < aGYO_TYPE_NUM; i++, prv++) {
|
||||
if (prv->_62E_flags & 1 && prv->fishIDEnum != aGYO_TYPE_JELLYFISH && prv->fishIDEnum != aGYO_TYPE_FROG &&
|
||||
mfish_cull_check(game, &prv->_5B8, prv->init_data._08 + 50.0f, prv->init_data._08 + 10.0f,
|
||||
prv->init_data._08 + 10.0f)) {
|
||||
mfish_dw[i](prv, game);
|
||||
}
|
||||
}
|
||||
|
||||
if (actor->prvFish[0x23]._62E & 1 &&
|
||||
mfish_cull_check(game, &actor->prvFish[0x23]._5A0, actor->prvFish[0x23].init_data._08 + 10.0f,
|
||||
actor->prvFish[0x23].init_data._04, actor->prvFish[0x23].init_data._04)) {
|
||||
mfish_dw[0x23](&actor->prvFish[0x23], game);
|
||||
if (actor->prvFish[aGYO_TYPE_JELLYFISH]._62E_flags & 1 &&
|
||||
mfish_cull_check(game, &actor->prvFish[aGYO_TYPE_JELLYFISH].position,
|
||||
actor->prvFish[aGYO_TYPE_JELLYFISH].init_data._08 + 10.0f,
|
||||
actor->prvFish[aGYO_TYPE_JELLYFISH].init_data._04,
|
||||
actor->prvFish[aGYO_TYPE_JELLYFISH].init_data._04)) {
|
||||
mfish_dw[0x23](&actor->prvFish[aGYO_TYPE_JELLYFISH], game);
|
||||
}
|
||||
|
||||
if (!GETREG(TAKREG, 82)) {
|
||||
mfish_normal_light_set(actorx, game);
|
||||
}
|
||||
|
||||
if (actor->prvFish[0x21]._62E & 1) {
|
||||
mfish_dw[0x21](&actor->prvFish[0x21], game);
|
||||
if (actor->prvFish[aGYO_TYPE_FROG]._62E_flags & 1) {
|
||||
mfish_dw[aGYO_TYPE_FROG](&actor->prvFish[aGYO_TYPE_FROG], game);
|
||||
}
|
||||
|
||||
if (GETREG(TAKREG, 82) == 1) {
|
||||
@@ -1148,88 +1146,87 @@ BOOL mfish_cull_check(GAME* game, xyz_t* worldPos, f32 x, f32 y, f32 _y) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void mfish_point_ligh_pos_get(ACTOR* actorx, GAME* game, int r5) {
|
||||
void mfish_point_ligh_pos_get(ACTOR* actorx, GAME* game, int lightIndex) {
|
||||
MUSEUM_FISH_ACTOR* actor = (MUSEUM_FISH_ACTOR*)actorx;
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
f32 a, b, c, d;
|
||||
xyz_t _30;
|
||||
xyz_t _24;
|
||||
xyz_t _18;
|
||||
xyz_t _0c;
|
||||
f32 extentRight, extentLeft, extentUp, extentDown;
|
||||
xyz_t playerPosition, vecToPlayer, lightPos, tankPos;
|
||||
|
||||
int r;
|
||||
f32 v;
|
||||
int tankIndex;
|
||||
f32 distLightToPlayer;
|
||||
PLAYER_ACTOR* player = get_player_actor_withoutCheck(play);
|
||||
|
||||
_30 = player->actor_class.world.position;
|
||||
playerPosition = player->actor_class.world.position;
|
||||
|
||||
if (_30.z < 100.0f) {
|
||||
r = 4;
|
||||
} else if (_30.z > 100.0f && _30.z < 340.0f) {
|
||||
if (r5 == 0) {
|
||||
r = 0;
|
||||
if (playerPosition.z < 100.0f) {
|
||||
tankIndex = 4;
|
||||
} else if (playerPosition.z > 100.0f && playerPosition.z < 340.0f) {
|
||||
if (lightIndex == 0) {
|
||||
tankIndex = 0;
|
||||
} else {
|
||||
r = 1;
|
||||
tankIndex = 1;
|
||||
}
|
||||
} else if (_30.z > 340.0f && _30.z < 580.0f) {
|
||||
if (r5 == 0) {
|
||||
r = 2;
|
||||
} else if (playerPosition.z > 340.0f && playerPosition.z < 580.0f) {
|
||||
if (lightIndex == 0) {
|
||||
tankIndex = 2;
|
||||
} else {
|
||||
r = 3;
|
||||
tankIndex = 3;
|
||||
}
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
if (r < 4) {
|
||||
a = 60.0f;
|
||||
b = 60.0f;
|
||||
c = 60.0f;
|
||||
d = 60.0f;
|
||||
_0c = suisou_pos[r];
|
||||
_18 = _30;
|
||||
if (tankIndex < 4) {
|
||||
extentRight = 60.0f;
|
||||
extentLeft = 60.0f;
|
||||
extentUp = 60.0f;
|
||||
extentDown = 60.0f;
|
||||
tankPos = suisou_pos[tankIndex];
|
||||
lightPos = playerPosition;
|
||||
} else {
|
||||
a = 200.0f;
|
||||
c = 35.0f;
|
||||
d = 20.0f;
|
||||
b = 200.0f;
|
||||
_0c = suisou_pos[r];
|
||||
_18 = _30;
|
||||
if (r5 == 0) {
|
||||
_18.x -= d;
|
||||
extentRight = 200.0f;
|
||||
extentLeft = 200.0f;
|
||||
extentUp = 35.0f;
|
||||
extentDown = 20.0f;
|
||||
tankPos = suisou_pos[tankIndex];
|
||||
lightPos = playerPosition;
|
||||
if (lightIndex == 0) {
|
||||
lightPos.x -= extentDown;
|
||||
} else {
|
||||
_18.x += d;
|
||||
lightPos.x += extentDown;
|
||||
}
|
||||
}
|
||||
|
||||
if (_18.x > _0c.x + a) {
|
||||
_18.x = _0c.x + a;
|
||||
} else if (_18.x < _0c.x - b) {
|
||||
_18.x = _0c.x - b;
|
||||
if (lightPos.x > tankPos.x + extentRight) {
|
||||
lightPos.x = tankPos.x + extentRight;
|
||||
} else if (lightPos.x < tankPos.x - extentLeft) {
|
||||
lightPos.x = tankPos.x - extentLeft;
|
||||
}
|
||||
|
||||
if (_18.z > _0c.z + c) {
|
||||
_18.z = _0c.z + c;
|
||||
} else if (_18.z < _0c.z - d) {
|
||||
_18.z = _0c.z - d;
|
||||
if (lightPos.z > tankPos.z + extentUp) {
|
||||
lightPos.z = tankPos.z + extentUp;
|
||||
} else if (lightPos.z < tankPos.z - extentDown) {
|
||||
lightPos.z = tankPos.z - extentDown;
|
||||
}
|
||||
|
||||
actor->_14d08[r5] = _18;
|
||||
actor->lightPosition[lightIndex] = lightPos;
|
||||
|
||||
xyz_t_sub(&_18, &_30, &_24);
|
||||
xyz_t_sub(&lightPos, &playerPosition, &vecToPlayer);
|
||||
|
||||
v = sqrtf(_24.x * _24.x + _24.z * _24.z);
|
||||
distLightToPlayer = sqrtf(SQ(vecToPlayer.x) + SQ(vecToPlayer.z));
|
||||
|
||||
actor->_14dbc[r5] = (u8)(((60.0f - CLAMP(v, 0.0f, 60.0f)) / 60.0f) * 55.0f);
|
||||
actor->lightPower[lightIndex] = (u8)(((60.0f - CLAMP(distLightToPlayer, 0.0f, 60.0f)) / 60.0f) * 55.0f);
|
||||
}
|
||||
|
||||
void mfish_point_light_ct(ACTOR* actorx, GAME* game) {
|
||||
MUSEUM_FISH_ACTOR* actor = (MUSEUM_FISH_ACTOR*)actorx;
|
||||
void mfish_point_light_ct(ACTOR* _actor, GAME* game) {
|
||||
MUSEUM_FISH_ACTOR* actor = (MUSEUM_FISH_ACTOR*)_actor;
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
// fill in the light positions
|
||||
mfish_point_ligh_pos_get(&actor->actor, game, 0);
|
||||
mfish_point_ligh_pos_get(&actor->actor, game, 1);
|
||||
actor->_14db8 = mEnv_ReservePointLight(play, &actor->_14d08[0], 0, 0x96, 0xff, (u8)actor->_14dbc[0]);
|
||||
actor->_14dba = mEnv_ReservePointLight(play, &actor->_14d08[1], 0, 0x96, 0xff, (u8)actor->_14dbc[1]);
|
||||
// make the lights
|
||||
actor->lightID1 = mEnv_ReservePointLight(play, &actor->lightPosition[0], 0, 150, 255, (u8)actor->lightPower[0]);
|
||||
actor->lightID2 = mEnv_ReservePointLight(play, &actor->lightPosition[1], 0, 150, 255, (u8)actor->lightPower[1]);
|
||||
actor->_14dc0 = 0;
|
||||
}
|
||||
|
||||
@@ -1237,12 +1234,12 @@ void mfish_point_light_dt(ACTOR* actorx, GAME* game) {
|
||||
MUSEUM_FISH_ACTOR* actor = (MUSEUM_FISH_ACTOR*)actorx;
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
|
||||
if (actor->_14db8 != -1) {
|
||||
mEnv_CancelReservedPointLight(actor->_14db8, (GAME_PLAY*)game);
|
||||
if (actor->lightID1 != -1) {
|
||||
mEnv_CancelReservedPointLight(actor->lightID1, (GAME_PLAY*)game);
|
||||
}
|
||||
|
||||
if (actor->_14dba != -1) {
|
||||
mEnv_CancelReservedPointLight(actor->_14dba, (GAME_PLAY*)game);
|
||||
if (actor->lightID2 != -1) {
|
||||
mEnv_CancelReservedPointLight(actor->lightID2, (GAME_PLAY*)game);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1252,27 +1249,27 @@ void mfish_point_light_mv(MUSEUM_FISH_ACTOR* actor, GAME* game) {
|
||||
mfish_point_ligh_pos_get(&actor->actor, game, 0);
|
||||
mfish_point_ligh_pos_get(&actor->actor, game, 1);
|
||||
|
||||
mEnv_OperateReservedPointLight(actor->_14db8, &actor->_14d08[0], 0, 0x96, 0xff, (u8)actor->_14dbc[0]);
|
||||
mEnv_OperateReservedPointLight(actor->_14dba, &actor->_14d08[1], 0, 0x96, 0xff, (u8)actor->_14dbc[1]);
|
||||
actor->actor.world.position = actor->_14d08[0];
|
||||
mEnv_OperateReservedPointLight(actor->lightID1, &actor->lightPosition[0], 0, 150, 255, (u8)actor->lightPower[0]);
|
||||
mEnv_OperateReservedPointLight(actor->lightID2, &actor->lightPosition[1], 0, 150, 255, (u8)actor->lightPower[1]);
|
||||
actor->actor.world.position = actor->lightPosition[0];
|
||||
actor->actor.world.position.x = sin_s(actor->_14dc0) * 200.0f;
|
||||
actor->actor.world.position.y = sin_s(actor->_14dc0 * 2) * 10.0f;
|
||||
actor->actor.world.position.z = cos_s(actor->_14dc0) * 200.0f;
|
||||
actor->_14dc0 += DEG2SHORT_ANGLE(1.5f);
|
||||
}
|
||||
|
||||
void mfish_normal_light_set(ACTOR* actor, GAME* _game) {
|
||||
void mfish_normal_light_set(ACTOR* actor, GAME* game) {
|
||||
LightsN* lights;
|
||||
GAME_PLAY* game = (GAME_PLAY*)_game;
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
|
||||
xyz_t lightPos;
|
||||
lightPos.x = 320;
|
||||
lightPos.y = 0;
|
||||
lightPos.z = 240;
|
||||
|
||||
lights = Global_light_read(&game->global_light, game->game.graph);
|
||||
LightsN_list_check(lights, game->global_light.list, &lightPos);
|
||||
LightsN_disp(lights, game->game.graph);
|
||||
lights = Global_light_read(&play->global_light, play->game.graph);
|
||||
LightsN_list_check(lights, play->global_light.list, &lightPos);
|
||||
LightsN_disp(lights, play->game.graph);
|
||||
}
|
||||
|
||||
#include "../src/actor/ac_museum_fish_base.c_inc"
|
||||
|
||||
@@ -4,14 +4,14 @@ void mfish_afish_ct(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
mfish_base_ct(actor, gamex);
|
||||
actor->_5EC = 0.0f;
|
||||
actor->_5E8 = actor->init_data._10;
|
||||
actor->_34 = mfish_afish_normal_process;
|
||||
actor->currentProcess = mfish_afish_normal_process;
|
||||
actor->_624 = 0;
|
||||
}
|
||||
|
||||
void mfish_afish_dummy_process_init(MUSEUM_FISH_PRIVATE_DATA* actor) {
|
||||
f32 v;
|
||||
actor->_634 = mfish_get_hide_camera_angle(actor);
|
||||
if (actor->_62E & 0x1e) {
|
||||
if (actor->_62E_flags & 0x1e) {
|
||||
if ((s16)(actor->_612.y - actor->_62C) > 0) {
|
||||
actor->_634 = actor->_62C + DEG2SHORT_ANGLE(90);
|
||||
} else {
|
||||
@@ -24,7 +24,7 @@ void mfish_afish_dummy_process_init(MUSEUM_FISH_PRIVATE_DATA* actor) {
|
||||
|
||||
actor->_5F0 = MIN(MAX(actor->init_data._10, 0.1f), actor->_5E8);
|
||||
actor->_5EC = 0.0f;
|
||||
actor->_34 = mfish_afish_dummy_process;
|
||||
actor->currentProcess = mfish_afish_dummy_process;
|
||||
}
|
||||
|
||||
void mfish_afish_dummy_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
@@ -43,7 +43,7 @@ void mfish_afish_normal_process_init(MUSEUM_FISH_PRIVATE_DATA* actor) {
|
||||
actor->_5F0 = v;
|
||||
}
|
||||
actor->_5F4 = Rnd_EX_fx(10.0f) * v2;
|
||||
actor->_612.x = DEG2SHORT_ANGLE((actor->_5F4 + actor->init_data._0C - actor->_5A0.y) * -12.0f);
|
||||
actor->_612.x = DEG2SHORT_ANGLE((actor->_5F4 + actor->init_data._0C - actor->position.y) * -12.0f);
|
||||
actor->_612.x = CLAMP(actor->_612.x, DEG2SHORT_ANGLE(-60), DEG2SHORT_ANGLE(60));
|
||||
actor->_5D0.y = 0.0f;
|
||||
|
||||
@@ -73,9 +73,9 @@ void mfish_afish_normal_process_init(MUSEUM_FISH_PRIVATE_DATA* actor) {
|
||||
actor->_636 = DEG2SHORT_ANGLE(-180);
|
||||
}
|
||||
|
||||
actor->_62E &= ~0xC0;
|
||||
actor->_62E_flags &= ~0xC0;
|
||||
actor->_5EC = 0.0f;
|
||||
actor->_34 = mfish_afish_normal_process;
|
||||
actor->currentProcess = mfish_afish_normal_process;
|
||||
}
|
||||
|
||||
void mfish_afish_normal_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
@@ -95,7 +95,7 @@ void mfish_afish_normal_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
|
||||
if (actor->_5E8 < 0.01f && actor->_632 < DEG2SHORT_ANGLE(1)) {
|
||||
mfish_afish_dummy_process_init(actor);
|
||||
} else if (actor->_5E8 > 1.0f && actor->_62E & 0x1e) {
|
||||
} else if (actor->_5E8 > 1.0f && actor->_62E_flags & 0x1e) {
|
||||
if ((s16)(actor->_60C.y - actor->_62C) > 0) {
|
||||
actor->_612.y = actor->_62C + DEG2SHORT_ANGLE(112.5f);
|
||||
} else {
|
||||
@@ -108,24 +108,24 @@ void mfish_afish_normal_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
void mfish_afish_turn_process_init(MUSEUM_FISH_PRIVATE_DATA* actor) {
|
||||
s16 s3 = DEG2SHORT_ANGLE(RANDOM_F(75.0f)) + DEG2SHORT_ANGLE(45.0f);
|
||||
actor->_618.y = ABS(DEG2SHORT_ANGLE2((SHORT2DEG_ANGLE2(s3) / 120.0f) * 4.0f + 2.5f));
|
||||
if (actor->_62E & 0x1e) {
|
||||
if (actor->_62E_flags & 0x1e) {
|
||||
if ((s16)(actor->_60C.y - actor->_62C) < 0) {
|
||||
s3 = -s3;
|
||||
}
|
||||
} else if (actor->_62E & 0xC0) {
|
||||
if (actor->_62E & 0x40) {
|
||||
} else if (actor->_62E_flags & 0xC0) {
|
||||
if (actor->_62E_flags & 0x40) {
|
||||
s3 = ABS(s3);
|
||||
} else {
|
||||
s3 = -ABS(s3);
|
||||
}
|
||||
} else if (actor->_62E & 0x20 && (actor->_62A - actor->_60C.y) < 0) {
|
||||
} else if (actor->_62E_flags & 0x20 && (actor->_62A - actor->_60C.y) < 0) {
|
||||
s3 = -s3;
|
||||
}
|
||||
|
||||
if (s3 > 0) {
|
||||
actor->_62E |= 0x40;
|
||||
actor->_62E_flags |= 0x40;
|
||||
} else {
|
||||
actor->_62E |= 0x80;
|
||||
actor->_62E_flags |= 0x80;
|
||||
}
|
||||
|
||||
actor->_612.y += s3;
|
||||
@@ -138,7 +138,7 @@ void mfish_afish_turn_process_init(MUSEUM_FISH_PRIVATE_DATA* actor) {
|
||||
|
||||
actor->_5EC = 0.0f;
|
||||
actor->_5F0 = actor->init_data._10 + actor->init_data._14 * 0.5f;
|
||||
actor->_34 = mfish_afish_turn_process;
|
||||
actor->currentProcess = mfish_afish_turn_process;
|
||||
}
|
||||
|
||||
void mfish_afish_turn_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
@@ -170,7 +170,7 @@ void mfish_afish_turn_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
|
||||
void mfish_afish_base_FishMove(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
xyz_t p;
|
||||
if (actor->_34 != mfish_afish_turn_process && actor->_622 < DEG2SHORT_ANGLE(20)) {
|
||||
if (actor->currentProcess != mfish_afish_turn_process && actor->_622 < DEG2SHORT_ANGLE(20)) {
|
||||
add_calc2(&actor->_5E8, 0.08f, 1.0f - actor->init_data._18, 0.005f);
|
||||
} else {
|
||||
add_calc2(&actor->_5E8, 0.05f, 1.0f - actor->init_data._18, 0.001f);
|
||||
@@ -179,24 +179,25 @@ void mfish_afish_base_FishMove(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
actor->_5D0.x = actor->_5E8 * cos_s(actor->_60C.x) * sin_s(actor->_60C.y);
|
||||
actor->_5D0.z = actor->_5E8 * cos_s(actor->_60C.x) * cos_s(actor->_60C.y);
|
||||
add_calc(&actor->_5D0.y, MAX(ABS(actor->_5E8 * sin_s(actor->_60C.x)), 0.1f), 0.1f, 0.1f, 0.005f);
|
||||
add_calc2(&actor->_5A0.y, actor->_5F4 + actor->init_data._0C, 0.1f, actor->_5D0.y);
|
||||
add_calc2(&actor->position.y, actor->_5F4 + actor->init_data._0C, 0.1f, actor->_5D0.y);
|
||||
mfish_move_smooth(actor, gamex);
|
||||
mfish_get_flow_vec(&p, actor, gamex);
|
||||
actor->_5A0.x += actor->_5D0.x + actor->_5DC.x;
|
||||
actor->_5A0.z += actor->_5D0.z + actor->_5DC.z;
|
||||
actor->_5A0.y += actor->_5DC.y;
|
||||
actor->_5A0.y = MAX(60.f, MIN(110.f, actor->_5A0.y));
|
||||
actor->position.x += actor->_5D0.x + actor->_5DC.x;
|
||||
actor->position.z += actor->_5D0.z + actor->_5DC.z;
|
||||
actor->position.y += actor->_5DC.y;
|
||||
actor->position.y = MAX(60.f, MIN(110.f, actor->position.y));
|
||||
}
|
||||
|
||||
void mfish_afish_base_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
if (actor->_5F8 > actor->init_data._08 * 20.f) {
|
||||
actor->_5F8 = 0.0f;
|
||||
actor->_626 = 0;
|
||||
actor->activityFrameCount = 0;
|
||||
}
|
||||
|
||||
if (actor->_626-- <= 0) {
|
||||
actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E);
|
||||
actor->_628 = actor->_626;
|
||||
if (actor->activityFrameCount-- <= 0) {
|
||||
actor->activityFrameCount =
|
||||
actor->init_data.activeFramesMin + (s16)RANDOM_F(actor->init_data.activeFramesRange);
|
||||
actor->savedActivityFrameCount = actor->activityFrameCount;
|
||||
if (mfish_WallCheck(actor)) {
|
||||
actor->_640 = 10;
|
||||
mfish_afish_turn_process_init(actor);
|
||||
@@ -204,12 +205,13 @@ void mfish_afish_base_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
actor->_640 = 10;
|
||||
mfish_afish_normal_process_init(actor);
|
||||
}
|
||||
} else if (actor->_34 == mfish_afish_normal_process) {
|
||||
if ((actor->_62E & 0x1e && ABS((s16)(actor->_62C - actor->_60C.y)) < DEG2SHORT_ANGLE(30)) ||
|
||||
(actor->_62E & 0x20 &&
|
||||
} else if (actor->currentProcess == mfish_afish_normal_process) {
|
||||
if ((actor->_62E_flags & 0x1e && ABS((s16)(actor->_62C - actor->_60C.y)) < DEG2SHORT_ANGLE(30)) ||
|
||||
(actor->_62E_flags & 0x20 &&
|
||||
ABS((s16)(DEG2SHORT_ANGLE(180) + actor->_62A - actor->_60C.y)) < DEG2SHORT_ANGLE(30))) {
|
||||
actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E);
|
||||
actor->_628 = actor->_626;
|
||||
actor->activityFrameCount =
|
||||
actor->init_data.activeFramesMin + (s16)RANDOM_F(actor->init_data.activeFramesRange);
|
||||
actor->savedActivityFrameCount = actor->activityFrameCount;
|
||||
actor->_640 = 10;
|
||||
mfish_afish_turn_process_init(actor);
|
||||
}
|
||||
@@ -217,7 +219,7 @@ void mfish_afish_base_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
|
||||
actor->_5AC.y = 0.0f;
|
||||
actor->_638 += DEG2SHORT_ANGLE(10);
|
||||
actor->_34(actor, gamex);
|
||||
actor->currentProcess(actor, gamex);
|
||||
if (ABS(actor->_618.z) > ABS(actor->_622) && ABS(actor->_622) > DEG2SHORT_ANGLE(2)) {
|
||||
add_calc2(&actor->_5E8, MIN(0.2f, actor->_5E8), 0.2f, 0.5f);
|
||||
}
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
void mfish_aroana_ct(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
mfish_onefish_ct(actor, gamex);
|
||||
mfish_base_ct(actor, gamex);
|
||||
actor->_34 = mfish_aroana_normal_process;
|
||||
actor->currentProcess = mfish_aroana_normal_process;
|
||||
actor->_624 = 0;
|
||||
}
|
||||
|
||||
void mfish_aroana_dummy_process_init(MUSEUM_FISH_PRIVATE_DATA* actor) {
|
||||
actor->_5F0 = actor->_5E8;
|
||||
actor->_5EC = 0.0f;
|
||||
actor->_34 = mfish_aroana_dummy_process;
|
||||
actor->currentProcess = mfish_aroana_dummy_process;
|
||||
}
|
||||
|
||||
void mfish_aroana_dummy_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
@@ -31,7 +31,7 @@ void mfish_aroana_normal_process_init(MUSEUM_FISH_PRIVATE_DATA* actor) {
|
||||
actor->_5F0 = v;
|
||||
}
|
||||
actor->_5F4 = Rnd_EX_fx(10.0f) * v2;
|
||||
actor->_612.x = atans_table(actor->_5E8, actor->_5F4 + actor->init_data._0C - actor->_5A0.y) >> 4;
|
||||
actor->_612.x = atans_table(actor->_5E8, actor->_5F4 + actor->init_data._0C - actor->position.y) >> 4;
|
||||
actor->_5D0.y = 0.0f;
|
||||
|
||||
if (RANDOM_F(1.0f) > actor->init_data._1C) {
|
||||
@@ -60,9 +60,9 @@ void mfish_aroana_normal_process_init(MUSEUM_FISH_PRIVATE_DATA* actor) {
|
||||
actor->_636 = DEG2SHORT_ANGLE(-180);
|
||||
}
|
||||
|
||||
actor->_62E &= ~0xC0;
|
||||
actor->_62E_flags &= ~0xC0;
|
||||
actor->_5EC = 0.0f;
|
||||
actor->_34 = mfish_aroana_normal_process;
|
||||
actor->currentProcess = mfish_aroana_normal_process;
|
||||
}
|
||||
|
||||
void mfish_aroana_normal_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) {
|
||||
@@ -71,7 +71,7 @@ void mfish_aroana_normal_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) {
|
||||
add_calc2(&actor->_5EC, ((actor->_632 - DEG2SHORT_ANGLE(20)) / DEG2SHORT_ANGLE(2)) * 0.002f + 0.03f, 0.25f,
|
||||
0.02f);
|
||||
add_calc2(&actor->_5E8, actor->_5F0, CALC_EASE(0.2f), actor->_5EC * 0.5f);
|
||||
} else if (actor->_626 > actor->_628 - 10) {
|
||||
} else if (actor->activityFrameCount > actor->savedActivityFrameCount - 10) {
|
||||
add_calc2(&actor->_5EC, 0.25f, 0.2f, 0.5f);
|
||||
add_calc2(&actor->_5E8, actor->_5F0, CALC_EASE(0.05f), actor->_5EC * 0.5f);
|
||||
}
|
||||
@@ -90,7 +90,7 @@ void mfish_aroana_normal_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) {
|
||||
} else {
|
||||
mfish_aroana_dummy_process_init(actor);
|
||||
}
|
||||
} else if (actor->_5E8 > 1.f && actor->_62E & 0x1e) {
|
||||
} else if (actor->_5E8 > 1.f && actor->_62E_flags & 0x1e) {
|
||||
if ((s16)(actor->_60C.y - actor->_62C) > 0) {
|
||||
actor->_612.y = actor->_62C + DEG2SHORT_ANGLE(112.5f);
|
||||
} else {
|
||||
@@ -103,24 +103,24 @@ void mfish_aroana_normal_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) {
|
||||
void mfish_aroana_turn_process_init(MUSEUM_FISH_PRIVATE_DATA* actor) {
|
||||
s16 s3 = DEG2SHORT_ANGLE(RANDOM_F(55.0f)) + DEG2SHORT_ANGLE(45.0f);
|
||||
actor->_618.y = ABS(DEG2SHORT_ANGLE2((SHORT2DEG_ANGLE2(s3) / 120.0f) * 2.5f + 2.0f));
|
||||
if (actor->_62E & 0x1e) {
|
||||
if (actor->_62E_flags & 0x1e) {
|
||||
if ((s16)(actor->_60C.y - actor->_62C) < 0) {
|
||||
s3 = -s3;
|
||||
}
|
||||
} else if (actor->_62E & 0xC0) {
|
||||
if (actor->_62E & 0x40) {
|
||||
} else if (actor->_62E_flags & 0xC0) {
|
||||
if (actor->_62E_flags & 0x40) {
|
||||
s3 = ABS(s3);
|
||||
} else {
|
||||
s3 = -ABS(s3);
|
||||
}
|
||||
} else if (actor->_62E & 0x20 && (actor->_62A - actor->_60C.y) < 0) {
|
||||
} else if (actor->_62E_flags & 0x20 && (actor->_62A - actor->_60C.y) < 0) {
|
||||
s3 = -s3;
|
||||
}
|
||||
|
||||
if (s3 > 0) {
|
||||
actor->_62E |= 0x40;
|
||||
actor->_62E_flags |= 0x40;
|
||||
} else {
|
||||
actor->_62E |= 0x80;
|
||||
actor->_62E_flags |= 0x80;
|
||||
}
|
||||
|
||||
actor->_612.y += s3;
|
||||
@@ -133,7 +133,7 @@ void mfish_aroana_turn_process_init(MUSEUM_FISH_PRIVATE_DATA* actor) {
|
||||
|
||||
actor->_5EC = 0.0f;
|
||||
actor->_5F0 = actor->init_data._10 + actor->init_data._14 * 0.2f;
|
||||
actor->_34 = mfish_aroana_turn_process;
|
||||
actor->currentProcess = mfish_aroana_turn_process;
|
||||
}
|
||||
|
||||
void mfish_aroana_turn_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) {
|
||||
@@ -171,7 +171,7 @@ void mfish_aroana_turn_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) {
|
||||
void mfish_aroana_long_move_process_init(MUSEUM_FISH_PRIVATE_DATA* actor) {
|
||||
actor->_5F0 = MAX(actor->_5E8, 0.2f);
|
||||
actor->_5EC = 0.0f;
|
||||
actor->_34 = mfish_aroana_long_move_process;
|
||||
actor->currentProcess = mfish_aroana_long_move_process;
|
||||
}
|
||||
|
||||
void mfish_aroana_long_move_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) {
|
||||
@@ -189,7 +189,7 @@ void mfish_aroana_long_move_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game)
|
||||
|
||||
void mfish_aroana_base_FishMove(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) {
|
||||
xyz_t p;
|
||||
if (actor->_34 != mfish_aroana_turn_process && actor->_34 != mfish_aroana_long_move_process &&
|
||||
if (actor->currentProcess != mfish_aroana_turn_process && actor->currentProcess != mfish_aroana_long_move_process &&
|
||||
actor->_622 < DEG2SHORT_ANGLE(20)) {
|
||||
add_calc0(&actor->_5E8, 1.0f - actor->init_data._18, GETREG(TAKREG, 0x13) * 0.001f + 0.02f);
|
||||
} else {
|
||||
@@ -200,42 +200,44 @@ void mfish_aroana_base_FishMove(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) {
|
||||
actor->_5D0.x = actor->_5E8 * sin_s(actor->_60C.y);
|
||||
actor->_5D0.z = actor->_5E8 * cos_s(actor->_60C.y);
|
||||
add_calc(&actor->_5D0.y, MAX(ABS(actor->_5E8 * sin_s(actor->_60C.x)), 0.1f), 0.1f, 0.1f, 0.005f);
|
||||
add_calc2(&actor->_5A0.y, actor->_5F4 + actor->init_data._0C, 0.1f, actor->_5D0.y);
|
||||
add_calc2(&actor->position.y, actor->_5F4 + actor->init_data._0C, 0.1f, actor->_5D0.y);
|
||||
mfish_move_smooth(actor, game);
|
||||
mfish_get_flow_vec(&p, actor, game);
|
||||
actor->_5A0.x += actor->_5D0.x + actor->_5DC.x;
|
||||
actor->_5A0.z += actor->_5D0.z + actor->_5DC.z;
|
||||
actor->_5A0.y += actor->_5DC.y;
|
||||
actor->_5A0.y = MAX(60.f, MIN(110.f, actor->_5A0.y));
|
||||
actor->position.x += actor->_5D0.x + actor->_5DC.x;
|
||||
actor->position.z += actor->_5D0.z + actor->_5DC.z;
|
||||
actor->position.y += actor->_5DC.y;
|
||||
actor->position.y = MAX(60.f, MIN(110.f, actor->position.y));
|
||||
}
|
||||
|
||||
void mfish_aroana_base_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
if (actor->_5F8 > actor->init_data._08 * 20.f) {
|
||||
actor->_5F8 = 0.0f;
|
||||
actor->_626 = 0;
|
||||
actor->activityFrameCount = 0;
|
||||
}
|
||||
|
||||
if (actor->_626-- <= 0) {
|
||||
actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E);
|
||||
actor->_628 = actor->_626;
|
||||
if (actor->activityFrameCount-- <= 0) {
|
||||
actor->activityFrameCount =
|
||||
actor->init_data.activeFramesMin + (s16)RANDOM_F(actor->init_data.activeFramesRange);
|
||||
actor->savedActivityFrameCount = actor->activityFrameCount;
|
||||
if (mfish_WallCheck(actor)) {
|
||||
mfish_aroana_turn_process_init(actor);
|
||||
} else {
|
||||
mfish_aroana_normal_process_init(actor);
|
||||
}
|
||||
} else if (actor->_34 == mfish_aroana_normal_process) {
|
||||
if ((actor->_62E & 0x1e && ABS((s16)(actor->_62C - actor->_60C.y)) < DEG2SHORT_ANGLE(30)) ||
|
||||
(actor->_62E & 0x20 &&
|
||||
} else if (actor->currentProcess == mfish_aroana_normal_process) {
|
||||
if ((actor->_62E_flags & 0x1e && ABS((s16)(actor->_62C - actor->_60C.y)) < DEG2SHORT_ANGLE(30)) ||
|
||||
(actor->_62E_flags & 0x20 &&
|
||||
ABS((s16)(DEG2SHORT_ANGLE(180) + actor->_62A - actor->_60C.y)) < DEG2SHORT_ANGLE(30))) {
|
||||
actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E);
|
||||
actor->_628 = actor->_626;
|
||||
actor->activityFrameCount =
|
||||
actor->init_data.activeFramesMin + (s16)RANDOM_F(actor->init_data.activeFramesRange);
|
||||
actor->savedActivityFrameCount = actor->activityFrameCount;
|
||||
mfish_aroana_turn_process_init(actor);
|
||||
}
|
||||
}
|
||||
|
||||
actor->_5AC.y = 0.0f;
|
||||
actor->_638 += DEG2SHORT_ANGLE(5);
|
||||
actor->_34(actor, gamex);
|
||||
actor->currentProcess(actor, gamex);
|
||||
if (ABS(actor->_618.z) > ABS(actor->_622) && ABS(actor->_622) > DEG2SHORT_ANGLE(2)) {
|
||||
add_calc2(&actor->_5E8, MIN(0.2f, actor->_5E8), 0.2f, 0.5f);
|
||||
}
|
||||
@@ -279,10 +281,10 @@ void mfish_aroana_dw(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
mtxp = &skele->_2b0;
|
||||
}
|
||||
OPEN_DISP(gamex->graph);
|
||||
Matrix_translate(actor->_5A0.x, actor->_5A0.y + actor->_5AC.y, actor->_5A0.z, 0);
|
||||
Matrix_translate(actor->position.x, actor->position.y + actor->_5AC.y, actor->position.z, 0);
|
||||
Matrix_rotateXYZ(actor->_60C.x, actor->_60C.y, actor->_60C.z, 1);
|
||||
Matrix_translate(0.0f, 0.0f, actor->init_data._24, 1);
|
||||
Matrix_scale(actor->init_data._00, actor->init_data._00, actor->init_data._00, 1);
|
||||
Matrix_scale(actor->init_data.renderScale, actor->init_data.renderScale, actor->init_data.renderScale, 1);
|
||||
gSPMatrix(NEXT_POLY_OPA_DISP, _Matrix_to_Mtx_new(gamex->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
cKF_Si3_draw_R_SV(gamex, &skele->_00, mtxp, mfish_aroana_before_disp, NULL, actor);
|
||||
CLOSE_DISP(play->game.graph);
|
||||
|
||||
+210
-205
@@ -1,5 +1,3 @@
|
||||
// pretty sure all the floats in this file are correct
|
||||
|
||||
f32 Rnd_EX_f(f32 v) {
|
||||
f32 rand1 = RANDOM2_F(2);
|
||||
f32 rand2 = RANDOM_F(1);
|
||||
@@ -31,7 +29,7 @@ f32 Rnd_EX_fx(f32 v) {
|
||||
void mfish_base_FishMove(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) {
|
||||
f32 t;
|
||||
xyz_t pos;
|
||||
if (actor->_59C == 0x18 && actor->_34 != mfish_peck_process) {
|
||||
if (actor->fishIDEnum == aGYO_TYPE_PIRANHA && actor->currentProcess != mfish_peck_process) {
|
||||
actor->_5E8 *= actor->init_data._18;
|
||||
} else {
|
||||
add_calc0(&actor->_5E8, 1.0f - actor->init_data._18, 0.025f);
|
||||
@@ -41,22 +39,22 @@ void mfish_base_FishMove(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) {
|
||||
actor->_5D0.z = actor->_5E8 * cos_s(actor->_60C.y);
|
||||
|
||||
add_calc(&actor->_5D0.y, MAX(ABS(actor->_5E8 * sin_s(actor->_60C.x)), 0.1f), 0.1f, 0.1f, 0.005f);
|
||||
add_calc2(&actor->_5A0.y, actor->_5F4 + actor->init_data._0C, 0.1f, actor->_5D0.y);
|
||||
add_calc2(&actor->position.y, actor->_5F4 + actor->init_data._0C, 0.1f, actor->_5D0.y);
|
||||
|
||||
mfish_move_smooth(actor, game);
|
||||
mfish_get_flow_vec(&pos, actor, game);
|
||||
actor->_5A0.x += actor->_5D0.x + actor->_5DC.x;
|
||||
actor->_5A0.z += actor->_5D0.z + actor->_5DC.z;
|
||||
actor->_5A0.y = actor->_5A0.y + actor->_5DC.y;
|
||||
actor->_5A0.y = MAX(60, MIN(110, actor->_5A0.y));
|
||||
actor->position.x += actor->_5D0.x + actor->_5DC.x;
|
||||
actor->position.z += actor->_5D0.z + actor->_5DC.z;
|
||||
actor->position.y = actor->position.y + actor->_5DC.y;
|
||||
actor->position.y = MAX(60, MIN(110, actor->position.y));
|
||||
}
|
||||
|
||||
int mfish_PosWallCheck(MUSEUM_FISH_PRIVATE_DATA* priv, xyz_t* pos) {
|
||||
u32 flag = 0;
|
||||
xyz_t p = suisou_pos[priv->_630];
|
||||
xyz_t p = suisou_pos[priv->group];
|
||||
f32 a, b, c, d;
|
||||
|
||||
if (priv->_630 < 4) {
|
||||
if (priv->group < 4) {
|
||||
a = priv->init_data._28 + 45;
|
||||
b = priv->init_data._28 + 45;
|
||||
c = priv->init_data._28 + 45;
|
||||
@@ -86,7 +84,7 @@ int mfish_PosWallCheck(MUSEUM_FISH_PRIVATE_DATA* priv, xyz_t* pos) {
|
||||
BOOL mfish_WallCheck(MUSEUM_FISH_PRIVATE_DATA* prv) {
|
||||
xyz_t p, p1;
|
||||
|
||||
p = prv->_5A0;
|
||||
p = prv->position;
|
||||
|
||||
p.x += sin_s(prv->_60C.y) * (GETREG(TAKREG, 70) + 30.0f);
|
||||
p.z += cos_s(prv->_60C.y) * (GETREG(TAKREG, 70) + 30.0f);
|
||||
@@ -98,7 +96,7 @@ BOOL mfish_WallCheck(MUSEUM_FISH_PRIVATE_DATA* prv) {
|
||||
|
||||
s16 mfish_get_hide_camera_angle(MUSEUM_FISH_PRIVATE_DATA* priv) {
|
||||
s16 v = priv->_60C.y;
|
||||
if (v > 0 || (priv->_630 == 2 && RANDOM_F(1) < 0.8f)) {
|
||||
if (v > 0 || (priv->group == 2 && RANDOM_F(1) < 0.8f)) {
|
||||
if (v > DEG2SHORT_ANGLE(90)) {
|
||||
v = DEG2SHORT_ANGLE(90) + DEG2SHORT_ANGLE(RANDOM_F(45));
|
||||
} else {
|
||||
@@ -116,10 +114,10 @@ s16 mfish_get_hide_camera_angle(MUSEUM_FISH_PRIVATE_DATA* priv) {
|
||||
|
||||
void mfish_dummy_process_init(MUSEUM_FISH_PRIVATE_DATA* prv) {
|
||||
prv->_634 = mfish_get_hide_camera_angle(prv);
|
||||
if (prv->_630 == 2 && prv->_60C.y < 0 && prv->_634 > 0) {
|
||||
if (prv->group == 2 && prv->_60C.y < 0 && prv->_634 > 0) {
|
||||
prv->_5F0 = MAX(prv->init_data._10, GETREG(TAKREG, 80) * 0.1f + 1.2f);
|
||||
}
|
||||
prv->_34 = mfish_dummy_process;
|
||||
prv->currentProcess = mfish_dummy_process;
|
||||
}
|
||||
|
||||
void mfish_dummy_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) {
|
||||
@@ -130,9 +128,9 @@ void mfish_dummy_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) {
|
||||
DEG2SHORT_ANGLE(0.25f));
|
||||
add_calc_short_angle2(&actor->_618.z, actor->_622, CALC_EASE2(0.5f), DEG2SHORT_ANGLE(5.0f), DEG2SHORT_ANGLE(0.25f));
|
||||
|
||||
if (actor->_630 == 2) {
|
||||
if (actor->group == 2) {
|
||||
if (actor->_612.y < 0) {
|
||||
actor->_626--;
|
||||
actor->activityFrameCount--;
|
||||
} else {
|
||||
add_calc2(&actor->_5E8, actor->_5F0, 0.1f, 0.05f);
|
||||
add_calc0(&actor->_5F0, 0.05f, 0.1f);
|
||||
@@ -155,7 +153,7 @@ void mfish_normal_process_init(MUSEUM_FISH_PRIVATE_DATA* fishActor) {
|
||||
fishActor->_5F4 = Rnd_EX_fx(10.0f) * t;
|
||||
|
||||
fishActor->_612.x =
|
||||
atans_table(fishActor->_5E8, fishActor->_5F4 + fishActor->init_data._0C - fishActor->_5A0.y) >> 4;
|
||||
atans_table(fishActor->_5E8, fishActor->_5F4 + fishActor->init_data._0C - fishActor->position.y) >> 4;
|
||||
fishActor->_5D0.y = 0;
|
||||
|
||||
if (RANDOM_F(1) > fishActor->init_data._1C) {
|
||||
@@ -187,15 +185,15 @@ void mfish_normal_process_init(MUSEUM_FISH_PRIVATE_DATA* fishActor) {
|
||||
fishActor->_636 = DEG2SHORT_ANGLE(-180);
|
||||
}
|
||||
|
||||
fishActor->_62E &= ~0xC0;
|
||||
fishActor->_34 = mfish_normal_process;
|
||||
fishActor->_62E_flags &= ~0xC0;
|
||||
fishActor->currentProcess = mfish_normal_process;
|
||||
}
|
||||
|
||||
void mfish_normal_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) {
|
||||
if (actor->_632 > DEG2SHORT_ANGLE(20)) {
|
||||
add_calc(&actor->_5E8, actor->_5F0, CALC_EASE(0.2f),
|
||||
(((actor->_632 - DEG2SHORT_ANGLE(20)) / DEG2SHORT_ANGLE(2)) * 0.04f + 0.1f) * 0.5f, 0.05f);
|
||||
} else if (actor->_626 > actor->_628 - 10) {
|
||||
} else if (actor->activityFrameCount > actor->savedActivityFrameCount - 10) {
|
||||
add_calc(&actor->_5E8, actor->_5F0, CALC_EASE(0.5f), 0.75f, 0.05f);
|
||||
}
|
||||
add_calc_short_angle2(&actor->_632, 0, CALC_EASE2(0.5f), DEG2SHORT_ANGLE(1.25f), DEG2SHORT_ANGLE(0.25f));
|
||||
@@ -204,9 +202,9 @@ void mfish_normal_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) {
|
||||
CALC_EASE2(0.5f), DEG2SHORT_ANGLE(6.25f), 45);
|
||||
add_calc_short_angle2(&actor->_618.z, actor->_622, CALC_EASE2(0.5f), DEG2SHORT_ANGLE(3.75f), 45);
|
||||
|
||||
if (actor->_5E8 < 0.01f || actor->_630 == 2 && actor->_5E8 < 0.05f) {
|
||||
if (actor->_5E8 < 0.01f || actor->group == 2 && actor->_5E8 < 0.05f) {
|
||||
mfish_dummy_process_init(actor);
|
||||
} else if (actor->_5E8 > 1.0f && actor->_62E & 0x1e) {
|
||||
} else if (actor->_5E8 > 1.0f && actor->_62E_flags & 0x1e) {
|
||||
if ((s16)(actor->_60C.y - actor->_62C) > 0) {
|
||||
actor->_612.y = actor->_62C + DEG2SHORT_ANGLE(112.5f);
|
||||
} else {
|
||||
@@ -221,19 +219,19 @@ void mfish_turn_process_init(MUSEUM_FISH_PRIVATE_DATA* actor) {
|
||||
actor->_618.y =
|
||||
DEG2SHORT_ANGLE(((actor->_5E8 + 0.5f) / (actor->init_data._10 + actor->init_data._14 + 0.5f)) * 7.5f + 7.5f);
|
||||
|
||||
if (actor->_62E & 0xC0) {
|
||||
if (actor->_62E & 0x40) {
|
||||
if (actor->_62E_flags & 0xC0) {
|
||||
if (actor->_62E_flags & 0x40) {
|
||||
v = ABS(v);
|
||||
} else {
|
||||
v = -ABS(v);
|
||||
}
|
||||
} else if (actor->_62E & 0x1e) {
|
||||
} else if (actor->_62E_flags & 0x1e) {
|
||||
if ((s16)(actor->_60C.y - actor->_62C) < 0) {
|
||||
v = -v;
|
||||
} else {
|
||||
v = v;
|
||||
}
|
||||
} else if (actor->_62E & 0x20) {
|
||||
} else if (actor->_62E_flags & 0x20) {
|
||||
if ((s16)(actor->_62A - actor->_60C.y) < 0) {
|
||||
v = -v;
|
||||
} else {
|
||||
@@ -242,14 +240,14 @@ void mfish_turn_process_init(MUSEUM_FISH_PRIVATE_DATA* actor) {
|
||||
}
|
||||
|
||||
if (v > 0) {
|
||||
actor->_62E |= 0x40;
|
||||
actor->_62E_flags |= 0x40;
|
||||
} else {
|
||||
actor->_62E |= 0x80;
|
||||
actor->_62E_flags |= 0x80;
|
||||
}
|
||||
|
||||
actor->_612.y += v;
|
||||
|
||||
if (actor->_630 == 2) {
|
||||
if (actor->group == 2) {
|
||||
s16 tmp = actor->_612.y + DEG2SHORT_ANGLE(90);
|
||||
if (tmp > DEG2SHORT_ANGLE(135)) {
|
||||
actor->_612.y = DEG2SHORT_ANGLE(-45);
|
||||
@@ -265,7 +263,7 @@ void mfish_turn_process_init(MUSEUM_FISH_PRIVATE_DATA* actor) {
|
||||
} else {
|
||||
actor->_63E = 0;
|
||||
}
|
||||
actor->_34 = mfish_turn_process;
|
||||
actor->currentProcess = mfish_turn_process;
|
||||
}
|
||||
|
||||
void mfish_turn_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) {
|
||||
@@ -341,8 +339,8 @@ void mfish_peck_process_init(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) {
|
||||
actor->_636 = DEG2SHORT_ANGLE(-90);
|
||||
}
|
||||
|
||||
actor->_62E &= ~0xC0;
|
||||
actor->_34 = mfish_peck_process;
|
||||
actor->_62E_flags &= ~0xC0;
|
||||
actor->currentProcess = mfish_peck_process;
|
||||
}
|
||||
|
||||
void mfish_peck_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
@@ -355,7 +353,7 @@ void mfish_peck_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
if (actor->_632 > DEG2SHORT_ANGLE(15)) {
|
||||
add_calc(&actor->_5E8, actor->_5F0, CALC_EASE(0.25f),
|
||||
(((actor->_632 - DEG2SHORT_ANGLE(20)) / DEG2SHORT_ANGLE(2)) * 0.04f + 0.1f) * 0.5f, 0.05f);
|
||||
} else if (actor->_626 > actor->_628 - 16) {
|
||||
} else if (actor->activityFrameCount > actor->savedActivityFrameCount - 16) {
|
||||
add_calc(&actor->_5E8, actor->_5F0, CALC_EASE(0.1f), 0.5f, 0.05f);
|
||||
} else if (dist > 20) {
|
||||
add_calc2(&actor->_5E8, MAX(actor->_5E8, 0.4f), 0.25f, 0.05f);
|
||||
@@ -371,46 +369,47 @@ void mfish_peck_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
if (mfish_peck_wall_check(actor, gamex)) {
|
||||
if (RANDOM_F(1.0f) < 0.9f) {
|
||||
actor->_5E8 = -0.3f - RANDOM_F(0.3f);
|
||||
actor->_626 = 10;
|
||||
actor->activityFrameCount = 10;
|
||||
} else {
|
||||
actor->_5E8 = -0.5f;
|
||||
actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E);
|
||||
actor->_626 >>= 3;
|
||||
actor->activityFrameCount =
|
||||
actor->init_data.activeFramesMin + (s16)RANDOM_F(actor->init_data.activeFramesRange);
|
||||
actor->activityFrameCount >>= 3;
|
||||
}
|
||||
actor->_628 = actor->_626;
|
||||
actor->savedActivityFrameCount = actor->activityFrameCount;
|
||||
actor->_5F0 = 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
void mfish_ground_peck_process_init(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
xyz_t p = suisou_pos[actor->_630];
|
||||
xyz_t_sub(&p, &actor->_5A0, &p);
|
||||
xyz_t p = suisou_pos[actor->group];
|
||||
xyz_t_sub(&p, &actor->position, &p);
|
||||
|
||||
actor->_5F4 = ((actor->init_data._08 * 0.3f + 65.0f) - MAX(ABS(p.x), ABS(p.z)) * 0.15f) - actor->init_data._0C;
|
||||
actor->_612.x = DEG2SHORT_ANGLE(60);
|
||||
actor->_626 = (int)(Rnd_EX_f(30.0f) + 15.0f) << 1;
|
||||
actor->activityFrameCount = (int)(Rnd_EX_f(30.0f) + 15.0f) << 1;
|
||||
|
||||
if (actor->_34 != mfish_ground_peck_process) {
|
||||
if (actor->currentProcess != mfish_ground_peck_process) {
|
||||
actor->_63E = RANDOM_F(2.0f) + 3.0f;
|
||||
} else {
|
||||
actor->_63E--;
|
||||
}
|
||||
|
||||
actor->_5F0 = 0.5f;
|
||||
actor->_34 = mfish_ground_peck_process;
|
||||
actor->currentProcess = mfish_ground_peck_process;
|
||||
}
|
||||
|
||||
void mfish_ground_peck_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
xyz_t p = suisou_pos[actor->_630];
|
||||
xyz_t_sub(&p, &actor->_5A0, &p);
|
||||
xyz_t p = suisou_pos[actor->group];
|
||||
xyz_t_sub(&p, &actor->position, &p);
|
||||
actor->_5F4 = ((actor->init_data._08 * 0.3f + 65.0f) - (MAX(ABS(p.x), ABS(p.z)) * 0.15f)) - actor->init_data._0C;
|
||||
xyz_t_mult_v(&actor->_5DC, 0.1f);
|
||||
|
||||
if (actor->_5A0.y > actor->_5F4 + actor->init_data._0C + 4.0f) {
|
||||
if (actor->position.y > actor->_5F4 + actor->init_data._0C + 4.0f) {
|
||||
if (actor->_612.x < DEG2SHORT_ANGLE(40)) {
|
||||
actor->_612.x = DEG2SHORT_ANGLE(40);
|
||||
}
|
||||
actor->_626++;
|
||||
actor->activityFrameCount++;
|
||||
add_calc2(&actor->_5F0, 0.5f, 0.6f, 0.5f);
|
||||
} else if ((s16)(actor->_612.x - actor->_60C.x) > 0) {
|
||||
add_calc2(&actor->_5F0, 0.2f, 0.5f, 0.4f);
|
||||
@@ -441,9 +440,9 @@ void mfish_base_ct(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
actor->_5D0.z = sin_s(q) * f;
|
||||
actor->_60C.y = q;
|
||||
actor->_612.y = actor->_60C.y;
|
||||
if (actor->_59C == 4 || actor->_59C == 9) {
|
||||
if (actor->fishIDEnum == aGYO_TYPE_CATFISH || actor->fishIDEnum == aGYO_TYPE_GIANT_CATFISH) {
|
||||
actor->_5F4 = 0.0f;
|
||||
} else if (actor->_59C == 0x1b) {
|
||||
} else if (actor->fishIDEnum == aGYO_TYPE_FRESHWATER_GOBY) {
|
||||
actor->_5F4 = RANDOM_F(5.0f);
|
||||
} else {
|
||||
actor->_5F4 = RANDOM_F(10.0f);
|
||||
@@ -459,15 +458,16 @@ void mfish_base_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
|
||||
if (actor->_5F8 > actor->init_data._08 * 20.0f) {
|
||||
actor->_5F8 = 0.0f;
|
||||
actor->_626 = 0;
|
||||
actor->activityFrameCount = 0;
|
||||
}
|
||||
|
||||
if (actor->_626-- <= 0) {
|
||||
actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E);
|
||||
actor->_628 = actor->_626;
|
||||
if (actor->activityFrameCount-- <= 0) {
|
||||
actor->activityFrameCount =
|
||||
actor->init_data.activeFramesMin + (s16)RANDOM_F(actor->init_data.activeFramesRange);
|
||||
actor->savedActivityFrameCount = actor->activityFrameCount;
|
||||
if (mfish_peck_check(actor, gamex)) {
|
||||
actor->_626 >>= 2;
|
||||
actor->_628 = actor->_626;
|
||||
actor->activityFrameCount >>= 2;
|
||||
actor->savedActivityFrameCount = actor->activityFrameCount;
|
||||
mfish_peck_process_init(actor, gamex);
|
||||
} else if (mfish_WallCheck(actor)) {
|
||||
mfish_turn_process_init(actor);
|
||||
@@ -476,27 +476,28 @@ void mfish_base_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
} else {
|
||||
mfish_normal_process_init(actor);
|
||||
}
|
||||
} else if (actor->_34 == mfish_normal_process) {
|
||||
if ((actor->_62E & 0x1E && ABS((s16)(actor->_62C - actor->_60C.y)) < DEG2SHORT_ANGLE(30)) ||
|
||||
(actor->_62E & 0x20 &&
|
||||
} else if (actor->currentProcess == mfish_normal_process) {
|
||||
if ((actor->_62E_flags & 0x1E && ABS((s16)(actor->_62C - actor->_60C.y)) < DEG2SHORT_ANGLE(30)) ||
|
||||
(actor->_62E_flags & 0x20 &&
|
||||
ABS((s16)(actor->_62A + DEG2SHORT_ANGLE(180) - actor->_60C.y)) < DEG2SHORT_ANGLE(30))) {
|
||||
actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E);
|
||||
actor->_628 = actor->_626;
|
||||
actor->activityFrameCount =
|
||||
actor->init_data.activeFramesMin + (s16)RANDOM_F(actor->init_data.activeFramesRange);
|
||||
actor->savedActivityFrameCount = actor->activityFrameCount;
|
||||
mfish_turn_process_init(actor);
|
||||
}
|
||||
}
|
||||
|
||||
if (actor->_624 == 10) {
|
||||
actor->_5AC.y = 0;
|
||||
actor->_5A0.y = actor->init_data._0C;
|
||||
} else if (actor->_630 == 2) {
|
||||
actor->position.y = actor->init_data._0C;
|
||||
} else if (actor->group == 2) {
|
||||
actor->_5AC.y = sin_s(actor->_638) * 0.2f;
|
||||
} else {
|
||||
actor->_5AC.y = 0;
|
||||
}
|
||||
|
||||
actor->_638 += DEG2SHORT_ANGLE(10);
|
||||
actor->_34(actor, gamex);
|
||||
actor->currentProcess(actor, gamex);
|
||||
|
||||
if (ABS(actor->_618.z) > ABS(actor->_622)) {
|
||||
add_calc2(&actor->_5E8, MIN(GETREG(TAKREG, 19) * 0.1f + 0.2f, actor->_5E8), 0.2f, 0.5f);
|
||||
@@ -512,8 +513,8 @@ void mfish_onefish_ct(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
YET_SKELETON* s = &actor->_38;
|
||||
cKF_SkeletonInfo_R_ct(&s->_00, s->_54C, s->_550[0], &s->_4F0, &s->_514);
|
||||
cKF_SkeletonInfo_R_init_standard_repeat_speedsetandmorph(&s->_00, s->_550[0], NULL, 1.0f, 0.0f);
|
||||
actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E);
|
||||
actor->_628 = actor->_626;
|
||||
actor->activityFrameCount = actor->init_data.activeFramesMin + (s16)RANDOM_F(actor->init_data.activeFramesRange);
|
||||
actor->savedActivityFrameCount = actor->activityFrameCount;
|
||||
actor->_60C.x = DEG2SHORT_ANGLE(0);
|
||||
actor->_60C.y = DEG2SHORT_ANGLE(-90);
|
||||
actor->_60C.z = DEG2SHORT_ANGLE(0);
|
||||
@@ -531,7 +532,7 @@ int mfish_before_disp(GAME* game, cKF_SkeletonInfo_R_c* keyframe, int joint_num,
|
||||
if (joint_num == 2) {
|
||||
int v, t;
|
||||
|
||||
if (actor->_630 != 4) {
|
||||
if (actor->group != 4) {
|
||||
v = 2;
|
||||
} else if (actor->init_data._20 > 0.7f) {
|
||||
v = 1;
|
||||
@@ -566,14 +567,14 @@ void mfish_onefish_dw(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
|
||||
graph = play->game.graph;
|
||||
|
||||
Matrix_translate(actor->_5A0.x, actor->_5A0.y + actor->_5AC.y, actor->_5A0.z, 0);
|
||||
Matrix_translate(actor->position.x, actor->position.y + actor->_5AC.y, actor->position.z, 0);
|
||||
Matrix_RotateY(actor->_60C.y, 1);
|
||||
|
||||
Matrix_translate(0.0f, 0.25f * actor->init_data._04, 1.5f * actor->init_data._24, 1);
|
||||
Matrix_RotateX(actor->_60C.x, 1);
|
||||
Matrix_RotateZ(MY_CLAMP(-(actor->_618.z >> 1), DEG2SHORT_ANGLE(-20), DEG2SHORT_ANGLE(20)), 1);
|
||||
Matrix_translate(0.0f, 0.25f * -actor->init_data._04, 0.5f * -actor->init_data._24, 1);
|
||||
Matrix_scale(actor->init_data._00, actor->init_data._00, actor->init_data._00, 1);
|
||||
Matrix_scale(actor->init_data.renderScale, actor->init_data.renderScale, actor->init_data.renderScale, 1);
|
||||
|
||||
OPEN_DISP(graph);
|
||||
gSPMatrix(NEXT_POLY_OPA_DISP, _Matrix_to_Mtx_new(play->game.graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
@@ -585,7 +586,7 @@ void mfish_onefish_dw(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
void mfish_ani_base_ct(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
mfish_onefish_ct(actor, gamex);
|
||||
mfish_base_ct(actor, gamex);
|
||||
actor->_34 = mfish_normal_process;
|
||||
actor->currentProcess = mfish_normal_process;
|
||||
actor->_624 = 0;
|
||||
}
|
||||
|
||||
@@ -595,18 +596,20 @@ void mfish_ani_base_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
mfish_base_mv(actor, gamex);
|
||||
Museum_Fish_BGCheck(actor, gamex);
|
||||
|
||||
if (actor->_630 == 2) {
|
||||
if (actor->group == 2) {
|
||||
actor->_38._00.frame_control.speed =
|
||||
(actor->_5E8 * 3.0f) / (actor->init_data._10 + actor->init_data._14) + 1.0f;
|
||||
} else if (actor->_59C == 0xe || actor->_59C == 0x1 || actor->_59C == 0) {
|
||||
if (actor->_5F0 - 0.1f > actor->_5E8 && actor->_34 == mfish_normal_process && actor->_626 > actor->_628 - 10) {
|
||||
} else if (actor->fishIDEnum == aGYO_TYPE_BITTERLING || actor->fishIDEnum == aGYO_TYPE_BROOK_TROUT ||
|
||||
actor->fishIDEnum == aGYO_TYPE_CRUCIAN_CARP) {
|
||||
if (actor->_5F0 - 0.1f > actor->_5E8 && actor->currentProcess == mfish_normal_process &&
|
||||
actor->activityFrameCount > actor->savedActivityFrameCount - 10) {
|
||||
actor->_38._00.frame_control.speed =
|
||||
((actor->_5F0 - actor->_5E8) * 3.0f) / (actor->init_data._10 + actor->init_data._14) + 1.5f;
|
||||
} else {
|
||||
add_calc2(&actor->_38._00.frame_control.speed, 2.0f * actor->_5E8 + 0.5f, 0.2f, 0.1f);
|
||||
}
|
||||
} else {
|
||||
if (actor->_626 > actor->_628 - 10 && actor->_5F0 > 0) {
|
||||
if (actor->activityFrameCount > actor->savedActivityFrameCount - 10 && actor->_5F0 > 0) {
|
||||
actor->_38._00.frame_control.speed =
|
||||
(actor->_5E8 * 4.0f) / (actor->init_data._10 + actor->init_data._14) + 1.25f;
|
||||
} else {
|
||||
@@ -642,33 +645,33 @@ void Museum_Fish_BigFishObjCheck(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) {
|
||||
f25 -= ABS(op.y);
|
||||
if (f25 < MIN(f27, f26)) {
|
||||
if (op.y < 0) {
|
||||
actor->_5A0.y -= MIN(f25, 0.25f);
|
||||
fish[i]->_5A0.y += MIN(f25, 0.05f);
|
||||
actor->position.y -= MIN(f25, 0.25f);
|
||||
fish[i]->position.y += MIN(f25, 0.05f);
|
||||
} else {
|
||||
actor->_5A0.y += MIN(f25, 0.25f);
|
||||
fish[i]->_5A0.y -= MIN(f25, 0.05f);
|
||||
actor->position.y += MIN(f25, 0.25f);
|
||||
fish[i]->position.y -= MIN(f25, 0.05f);
|
||||
}
|
||||
} else if (f26 < f27) {
|
||||
v = ABS(cos_s(actor->_60C.y) * actor->_5E8);
|
||||
if (op.z < 0) {
|
||||
actor->_5A0.z -= MIN(f26, MAX(0.5f, v));
|
||||
actor->position.z -= MIN(f26, MAX(0.5f, v));
|
||||
if (fish[i]->_5B8.z < max[i] + 10.0f) {
|
||||
fish[i]->_5A0.z += MIN(f26, 0.05f);
|
||||
fish[i]->position.z += MIN(f26, 0.05f);
|
||||
}
|
||||
} else {
|
||||
actor->_5A0.z += MIN(f26, MAX(0.5f, v));
|
||||
actor->position.z += MIN(f26, MAX(0.5f, v));
|
||||
if (fish[i]->_5B8.z > max[i] - 10.0f) {
|
||||
fish[i]->_5A0.z -= MIN(f26, 0.05f);
|
||||
fish[i]->position.z -= MIN(f26, 0.05f);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
v = ABS(sin_s(actor->_60C.y) * actor->_5E8);
|
||||
if (op.x < 0) {
|
||||
actor->_5A0.x -= MIN(f27, MAX(0.5f, v));
|
||||
fish[i]->_5A0.x += MIN(f27, 0.05f);
|
||||
actor->position.x -= MIN(f27, MAX(0.5f, v));
|
||||
fish[i]->position.x += MIN(f27, 0.05f);
|
||||
} else {
|
||||
actor->_5A0.x += MIN(f27, MAX(0.5f, v));
|
||||
fish[i]->_5A0.x -= MIN(f27, 0.05f);
|
||||
actor->position.x += MIN(f27, MAX(0.5f, v));
|
||||
fish[i]->position.x -= MIN(f27, 0.05f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -676,10 +679,10 @@ void Museum_Fish_BigFishObjCheck(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) {
|
||||
}
|
||||
|
||||
void Museum_Fish_ObjBGCheck(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex, f32 f1, f32 f2) {
|
||||
xyz_t p = suisou_pos[actor->_630];
|
||||
xyz_t p = suisou_pos[actor->group];
|
||||
f32 a, b, c, d, e;
|
||||
|
||||
switch (actor->_630) {
|
||||
switch (actor->group) {
|
||||
case 0:
|
||||
e = 85.0f;
|
||||
a = -20.0f + p.x;
|
||||
@@ -714,43 +717,43 @@ void Museum_Fish_ObjBGCheck(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex, f32 f1
|
||||
return;
|
||||
}
|
||||
|
||||
e -= actor->_5A0.y;
|
||||
e -= actor->position.y;
|
||||
if (e > 0.0f) {
|
||||
f32 v1, v2;
|
||||
b -= (actor->_5A0.x + (actor->init_data._28 * f1));
|
||||
a -= (actor->_5A0.x - (actor->init_data._28 * f1));
|
||||
c -= (actor->_5A0.z + (actor->init_data._28 * f2));
|
||||
d -= (actor->_5A0.z - (actor->init_data._28 * f2));
|
||||
b -= (actor->position.x + (actor->init_data._28 * f1));
|
||||
a -= (actor->position.x - (actor->init_data._28 * f1));
|
||||
c -= (actor->position.z + (actor->init_data._28 * f2));
|
||||
d -= (actor->position.z - (actor->init_data._28 * f2));
|
||||
if (b > 0.0f && c > 0.0f && a < 0.0f && d < 0.0f) {
|
||||
if (b > -a) {
|
||||
if ((actor->_62E & 2) == 0) {
|
||||
actor->_62E |= 4;
|
||||
if ((actor->_62E_flags & 2) == 0) {
|
||||
actor->_62E_flags |= 4;
|
||||
}
|
||||
v1 = a;
|
||||
} else {
|
||||
if ((actor->_62E & 4) == 0) {
|
||||
actor->_62E |= 2;
|
||||
if ((actor->_62E_flags & 4) == 0) {
|
||||
actor->_62E_flags |= 2;
|
||||
}
|
||||
v1 = b;
|
||||
}
|
||||
|
||||
if (c > -d) {
|
||||
if ((actor->_62E & 8) == 0) {
|
||||
actor->_62E |= 0x10;
|
||||
if ((actor->_62E_flags & 8) == 0) {
|
||||
actor->_62E_flags |= 0x10;
|
||||
}
|
||||
v2 = d;
|
||||
} else {
|
||||
if ((actor->_62E & 0x10) == 0) {
|
||||
actor->_62E |= 8;
|
||||
if ((actor->_62E_flags & 0x10) == 0) {
|
||||
actor->_62E_flags |= 8;
|
||||
}
|
||||
v2 = c;
|
||||
}
|
||||
|
||||
if (e < MIN(ABS(v2), ABS(v1)) && actor->_624 != 10) {
|
||||
actor->_5A0.y += e;
|
||||
actor->position.y += e;
|
||||
if (actor->_624 == 3) {
|
||||
actor->_612.x = DEG2SHORT_ANGLE(45);
|
||||
} else if (actor->_59C == 15) {
|
||||
} else if (actor->fishIDEnum == aGYO_TYPE_LOACH) {
|
||||
if (actor->_612.x > DEG2SHORT_ANGLE(30)) {
|
||||
actor->_612.x -= DEG2SHORT_ANGLE(2);
|
||||
} else if (actor->_612.x < DEG2SHORT_ANGLE(-30)) {
|
||||
@@ -759,9 +762,9 @@ void Museum_Fish_ObjBGCheck(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex, f32 f1
|
||||
}
|
||||
} else {
|
||||
if (ABS(v2) < ABS(v1)) {
|
||||
actor->_5A0.z += v2;
|
||||
actor->position.z += v2;
|
||||
} else {
|
||||
actor->_5A0.x += v1;
|
||||
actor->position.x += v1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -774,10 +777,10 @@ void Museum_Fish_DonkoBGCheck(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
f32 f24;
|
||||
f32 f25;
|
||||
f32 f26;
|
||||
xyz_t p = suisou_pos[actor->_630];
|
||||
xyz_t p = suisou_pos[actor->group];
|
||||
f32 v = (sin_s(actor->_60C.y) * 0.7f) * (ABS(cos_s(actor->_618.z)) * 0.5f + 0.5f) + 0.3f;
|
||||
f32 v2 = (cos_s(actor->_60C.y) * 0.7f) * (ABS(cos_s(actor->_618.z)) * 0.5f + 0.5f) + 0.3f;
|
||||
actor->_62E &= ~0x1e;
|
||||
actor->_62E_flags &= ~0x1e;
|
||||
actor->_62C = 0;
|
||||
Museum_Fish_objchk_pos_set(actor, gamex);
|
||||
// asm 17C
|
||||
@@ -789,10 +792,10 @@ void Museum_Fish_DonkoBGCheck(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
f27 = 76.0f - 6.0f * cos_s(DEG2SHORT_ANGLE2(180.0f * (actor->_5B8.x - p.x) / 55.0f));
|
||||
f26 = 76.0f - 6.0f * cos_s(DEG2SHORT_ANGLE2((actor->_5B8.x + sin_s(actor->_60C.y) - p.x) * 180.0f / 55.0f));
|
||||
|
||||
a -= (actor->_5A0.x + actor->init_data._28 * v);
|
||||
b -= (actor->_5A0.x - actor->init_data._28 * v);
|
||||
c -= (actor->_5A0.z + actor->init_data._28 * v2);
|
||||
d -= (actor->_5A0.z - actor->init_data._28 * v2);
|
||||
a -= (actor->position.x + actor->init_data._28 * v);
|
||||
b -= (actor->position.x - actor->init_data._28 * v);
|
||||
c -= (actor->position.z + actor->init_data._28 * v2);
|
||||
d -= (actor->position.z - actor->init_data._28 * v2);
|
||||
|
||||
/*
|
||||
f31 = a
|
||||
@@ -807,42 +810,42 @@ void Museum_Fish_DonkoBGCheck(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
actor->_608 = d;
|
||||
|
||||
// asm 2E8
|
||||
f27 -= actor->_5A0.y;
|
||||
f26 -= actor->_5A0.y;
|
||||
f27 -= actor->position.y;
|
||||
f26 -= actor->position.y;
|
||||
if (a > 0.0f) {
|
||||
actor->_5FC = 0.0f;
|
||||
actor->_5A0.x += a;
|
||||
actor->_62E |= 2;
|
||||
actor->position.x += a;
|
||||
actor->_62E_flags |= 2;
|
||||
} else if (b < 0.0f) {
|
||||
actor->_600 = 0.0f;
|
||||
actor->_5A0.x += b;
|
||||
actor->_62E |= 4;
|
||||
actor->position.x += b;
|
||||
actor->_62E_flags |= 4;
|
||||
}
|
||||
|
||||
if (c > 0.0f) {
|
||||
actor->_604 = 0.0f;
|
||||
actor->_5A0.z += c;
|
||||
actor->_62E |= 0x8;
|
||||
actor->position.z += c;
|
||||
actor->_62E_flags |= 0x8;
|
||||
} else if (d < 0.0f) {
|
||||
actor->_608 = 0.0f;
|
||||
actor->_5A0.z += d;
|
||||
actor->_62E |= 0x10;
|
||||
actor->position.z += d;
|
||||
actor->_62E_flags |= 0x10;
|
||||
}
|
||||
|
||||
if (actor->_62E & 2) {
|
||||
if (actor->_62E_flags & 2) {
|
||||
actor->_62C = DEG2SHORT_ANGLE(-90);
|
||||
} else if (actor->_62E & 4) {
|
||||
} else if (actor->_62E_flags & 4) {
|
||||
actor->_62C = DEG2SHORT_ANGLE(90);
|
||||
}
|
||||
|
||||
if (actor->_62E & 8) {
|
||||
if (actor->_62E & 6) {
|
||||
if (actor->_62E_flags & 8) {
|
||||
if (actor->_62E_flags & 6) {
|
||||
actor->_62C = DEG2SHORT_ANGLE(180) - (actor->_62C >> 1);
|
||||
} else {
|
||||
actor->_62C = DEG2SHORT_ANGLE(-180);
|
||||
}
|
||||
} else if (actor->_62E & 0x10) {
|
||||
if (actor->_62E & 6) {
|
||||
} else if (actor->_62E_flags & 0x10) {
|
||||
if (actor->_62E_flags & 6) {
|
||||
actor->_62C = (actor->_62C >> 1);
|
||||
} else {
|
||||
actor->_62C = 0;
|
||||
@@ -863,19 +866,19 @@ void Museum_Fish_DonkoBGCheck(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
f26 -= f27;
|
||||
actor->_612.x = atans_table(1.0f, -f26);
|
||||
if (f27 > 0.0f) {
|
||||
actor->_5A0.y += f27;
|
||||
actor->position.y += f27;
|
||||
actor->_5D0.y *= 0.95f;
|
||||
}
|
||||
}
|
||||
|
||||
void Museum_Fish_objchk_pos_set(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) {
|
||||
actor->_5B8 = actor->_5A0;
|
||||
actor->_5B8 = actor->position;
|
||||
actor->_5B8.x += (actor->init_data._24 * sin_s(actor->_60C.y));
|
||||
actor->_5B8.z += (actor->init_data._24 * cos_s(actor->_60C.y));
|
||||
}
|
||||
|
||||
void Museum_Fish_BGCheck(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) {
|
||||
xyz_t p = suisou_pos[actor->_630];
|
||||
xyz_t p = suisou_pos[actor->group];
|
||||
f32 f29, f30, f28, f27, f31, f26, f25;
|
||||
s32 r31 = 0;
|
||||
|
||||
@@ -899,7 +902,7 @@ void Museum_Fish_BGCheck(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) {
|
||||
f25 = 1.0f;
|
||||
}
|
||||
|
||||
if (actor->_630 < 4) {
|
||||
if (actor->group < 4) {
|
||||
f30 = 54.0f + actor->init_data._28 * f26;
|
||||
f29 = 54.0f + actor->init_data._28 * f26;
|
||||
f28 = 54.0f + actor->init_data._28 * f25;
|
||||
@@ -915,24 +918,24 @@ void Museum_Fish_BGCheck(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) {
|
||||
r31 = DEG2SHORT_ANGLE(sin_s(f31 * 32768.0f / 180.0f) * -10.0f);
|
||||
}
|
||||
|
||||
actor->_62E &= ~0x1e;
|
||||
actor->_62E_flags &= ~0x1e;
|
||||
actor->_62C = 0;
|
||||
Museum_Fish_objchk_pos_set(actor, game);
|
||||
|
||||
if (actor->_5B8.x > (p.x + f30)) {
|
||||
actor->_5A0.x += (p.x + f30) - actor->_5B8.x;
|
||||
actor->_62E |= 0x4;
|
||||
actor->position.x += (p.x + f30) - actor->_5B8.x;
|
||||
actor->_62E_flags |= 0x4;
|
||||
} else if (actor->_5B8.x < p.x - f29) {
|
||||
actor->_5A0.x += (p.x - f29) - actor->_5B8.x;
|
||||
actor->_62E |= 0x2;
|
||||
actor->position.x += (p.x - f29) - actor->_5B8.x;
|
||||
actor->_62E_flags |= 0x2;
|
||||
}
|
||||
|
||||
if (actor->_5B8.z > (p.z + f28)) {
|
||||
actor->_5A0.z += (p.z + f28) - actor->_5B8.z;
|
||||
actor->_62E |= 0x10;
|
||||
actor->position.z += (p.z + f28) - actor->_5B8.z;
|
||||
actor->_62E_flags |= 0x10;
|
||||
} else if (actor->_5B8.z < (p.z - f27)) {
|
||||
actor->_5A0.z += (p.z - f27) - actor->_5B8.z;
|
||||
actor->_62E |= 0x8;
|
||||
actor->position.z += (p.z - f27) - actor->_5B8.z;
|
||||
actor->_62E_flags |= 0x8;
|
||||
}
|
||||
|
||||
// asm 468
|
||||
@@ -942,24 +945,24 @@ void Museum_Fish_BGCheck(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) {
|
||||
actor->_604 = actor->_5B8.z - (p.z - f27);
|
||||
actor->_608 = (p.z + f28) - actor->_5B8.z;
|
||||
|
||||
if (actor->_630 < 4 && actor->_59C != 26) {
|
||||
if (actor->group < 4 && actor->fishIDEnum != aGYO_TYPE_EEL) {
|
||||
Museum_Fish_ObjBGCheck(actor, game, f26, f25);
|
||||
}
|
||||
|
||||
if (actor->_62E & 2) {
|
||||
if (actor->_62E_flags & 2) {
|
||||
actor->_62C = DEG2SHORT_ANGLE(-90);
|
||||
} else if (actor->_62E & 4) {
|
||||
} else if (actor->_62E_flags & 4) {
|
||||
actor->_62C = DEG2SHORT_ANGLE(90);
|
||||
}
|
||||
|
||||
if (actor->_62E & 8) {
|
||||
if (actor->_62E & 6) {
|
||||
if (actor->_62E_flags & 8) {
|
||||
if (actor->_62E_flags & 6) {
|
||||
actor->_62C = (DEG2SHORT_ANGLE(180) - (actor->_62C >> 1) + ((s16)r31 >> 1));
|
||||
} else {
|
||||
actor->_62C = r31 + DEG2SHORT_ANGLE(180);
|
||||
}
|
||||
} else if (actor->_62E & 0x10) {
|
||||
if (actor->_62E & 6) {
|
||||
} else if (actor->_62E_flags & 0x10) {
|
||||
if (actor->_62E_flags & 6) {
|
||||
actor->_62C >>= 1;
|
||||
} else {
|
||||
actor->_62C = DEG2SHORT_ANGLE(0);
|
||||
@@ -970,7 +973,7 @@ void Museum_Fish_BGCheck(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) {
|
||||
void Museum_Fish_Kusa_Check(MUSEUM_FISH_ACTOR* actor, GAME* game) {
|
||||
static int kusa_group_tbl[14] = { 0, 2, 1, 3, 3, 4, 4, 4, 4, 4, 0, 2, 1, 3 };
|
||||
MUSEUM_FISH_KUSA_DATA* k;
|
||||
MUSEUM_FISH_PRIVATE_DATA* f = &actor->prvFish[0];
|
||||
MUSEUM_FISH_PRIVATE_DATA* f = actor->prvFish;
|
||||
int i;
|
||||
int j;
|
||||
f32 sq;
|
||||
@@ -978,16 +981,17 @@ void Museum_Fish_Kusa_Check(MUSEUM_FISH_ACTOR* actor, GAME* game) {
|
||||
f32 f29 = 0.0f;
|
||||
f32 f28 = 0.0f;
|
||||
|
||||
for (i = 0; i < 40; i++, f++) {
|
||||
f->_62E &= ~0x100;
|
||||
for (i = 0; i < aGYO_TYPE_NUM; i++, f++) {
|
||||
f->_62E_flags &= ~0x100;
|
||||
|
||||
// this if statement salso works as a continue statement
|
||||
if (f->_59C != 0x1a && f->_59C != 0x1f && f->_59C != 0x21) {
|
||||
if (f->fishIDEnum != aGYO_TYPE_EEL && f->fishIDEnum != aGYO_TYPE_COELACANTH &&
|
||||
f->fishIDEnum != aGYO_TYPE_FROG) {
|
||||
|
||||
for (j = 0; j < 14; j++) {
|
||||
f32 f1 = (j < 5) ? 90.0f : (j < 10) ? 115.0f : 80.0f;
|
||||
|
||||
if (kusa_group_tbl[j] == f->_630 && f->_5B8.y < f1) {
|
||||
if (kusa_group_tbl[j] == f->group && f->_5B8.y < f1) {
|
||||
f32 z;
|
||||
f32 x;
|
||||
f32 d;
|
||||
@@ -996,7 +1000,7 @@ void Museum_Fish_Kusa_Check(MUSEUM_FISH_ACTOR* actor, GAME* game) {
|
||||
f32 dy;
|
||||
|
||||
if (kusa_group_tbl[j] == 4) {
|
||||
if (f->_59C == 0x1f) {
|
||||
if (f->fishIDEnum == aGYO_TYPE_COELACANTH) {
|
||||
d = 5.0f + f->init_data._08;
|
||||
} else {
|
||||
d = 10.0f + f->init_data._08;
|
||||
@@ -1045,9 +1049,9 @@ void Museum_Fish_Kusa_Check(MUSEUM_FISH_ACTOR* actor, GAME* game) {
|
||||
}
|
||||
// asm 414
|
||||
if (f28 > 0.0f) {
|
||||
f->_62E |= 0x100;
|
||||
f->_5A0.x += (f30 / f28);
|
||||
f->_5A0.z += (f29 / f28);
|
||||
f->_62E_flags |= 0x100;
|
||||
f->position.x += (f30 / f28);
|
||||
f->position.z += (f29 / f28);
|
||||
}
|
||||
f28 = 0.0f;
|
||||
f29 = 0.0f;
|
||||
@@ -1076,19 +1080,19 @@ void Museum_Fish_Object_Check(MUSEUM_FISH_ACTOR* actor, GAME* game) {
|
||||
f32 sq_xz;
|
||||
f32 sq_xzy;
|
||||
|
||||
fj = f = &actor->prvFish[0];
|
||||
fj = f = actor->prvFish;
|
||||
|
||||
for (i = 0; i < 40; i++, f++) {
|
||||
f->_62E &= ~0x20;
|
||||
for (i = 0; i < aGYO_TYPE_NUM; i++, f++) {
|
||||
f->_62E_flags &= ~0x20;
|
||||
}
|
||||
|
||||
f = &actor->prvFish[0];
|
||||
for (i = 0; i < 40; i++, f++) {
|
||||
f = actor->prvFish;
|
||||
for (i = 0; i < aGYO_TYPE_NUM; i++, f++) {
|
||||
// asm b8
|
||||
if (i != 0x21 && i != 0x20 && i != 0x1a && i != 0x27 && i != 0xa && f->_62E & 1) {
|
||||
for (j = 0; j < 40; j++, fj++) {
|
||||
if (f->_630 == fj->_630 && i != j && j != 0x21 && j != 0x1a && j != 0x27 && j != 10 &&
|
||||
fj->_62E & 1 != 0) {
|
||||
if (i != 0x21 && i != 0x20 && i != 0x1a && i != 0x27 && i != 0xa && f->_62E_flags & 1) {
|
||||
for (j = 0; j < aGYO_TYPE_NUM; j++, fj++) {
|
||||
if (f->group == fj->group && i != j && j != 0x21 && j != 0x1a && j != 0x27 && j != 10 &&
|
||||
fj->_62E_flags & 1 != 0) {
|
||||
|
||||
test.x = f->_5B8.x - fj->_5B8.x; // f31
|
||||
test.y = f->_5B8.y - fj->_5B8.y; // f29
|
||||
@@ -1116,11 +1120,11 @@ void Museum_Fish_Object_Check(MUSEUM_FISH_ACTOR* actor, GAME* game) {
|
||||
test.y *= 0.2f + (GETREG(TAKREG, 0x11)) * 0.0001f;
|
||||
f22 *= 0.2f + (GETREG(TAKREG, 0x12)) * 0.0001f;
|
||||
f->_62A = atans_table(test.z, test.x);
|
||||
f->_62E |= 0x20;
|
||||
f->_62E_flags |= 0x20;
|
||||
fj->_62A = f->_62A + DEG2SHORT_ANGLE(180);
|
||||
f->_62E |= 0x20;
|
||||
f->_62E_flags |= 0x20;
|
||||
f->_594 = fj;
|
||||
if ((fj->_62E & 0x1e) == 0 || ABS((s16)(fj->_62C - f->_62A)) >= DEG2SHORT_ANGLE(90)) {
|
||||
if ((fj->_62E_flags & 0x1e) == 0 || ABS((s16)(fj->_62C - f->_62A)) >= DEG2SHORT_ANGLE(90)) {
|
||||
f32 v = (fj->init_data._20 / (f->init_data._20 + fj->init_data._20));
|
||||
v *= (1.0f - f->init_data._20);
|
||||
f22 *= v;
|
||||
@@ -1132,7 +1136,7 @@ void Museum_Fish_Object_Check(MUSEUM_FISH_ACTOR* actor, GAME* game) {
|
||||
test.y *= v;
|
||||
}
|
||||
|
||||
if (f22 < ABS(test.y) || f->_624 == 0xa || f->_59C == 0x1f) {
|
||||
if (f22 < ABS(test.y) || f->_624 == 0xa || f->fishIDEnum == aGYO_TYPE_COELACANTH) {
|
||||
f28 += sin_s(f->_62A) * f22;
|
||||
f27 += cos_s(f->_62A) * f22;
|
||||
f25 += 1.0f;
|
||||
@@ -1152,12 +1156,12 @@ void Museum_Fish_Object_Check(MUSEUM_FISH_ACTOR* actor, GAME* game) {
|
||||
}
|
||||
|
||||
if (f25 > 0.0f) {
|
||||
f->_5A0.x += f28 / f25;
|
||||
f->_5A0.z += f27 / f25;
|
||||
f->position.x += f28 / f25;
|
||||
f->position.z += f27 / f25;
|
||||
}
|
||||
|
||||
if (f24 > 0) {
|
||||
f->_5A0.y += MAX(MIN(f26 / f24, 0.5f), -0.5f);
|
||||
f->position.y += MAX(MIN(f26 / f24, 0.5f), -0.5f);
|
||||
|
||||
if (f->_624 == 0 || f->_624 == 0xb) {
|
||||
f->_5F4 += f26 / f24;
|
||||
@@ -1166,7 +1170,7 @@ void Museum_Fish_Object_Check(MUSEUM_FISH_ACTOR* actor, GAME* game) {
|
||||
|
||||
if (f24 > 0 && f25 > 0) {
|
||||
xyz_t r;
|
||||
xyz_t_sub(&f->_594->_5A0, &f->_5A0, &r);
|
||||
xyz_t_sub(&f->_594->position, &f->position, &r);
|
||||
f->_62A = atans_table(r.z, r.x);
|
||||
}
|
||||
|
||||
@@ -1176,9 +1180,9 @@ void Museum_Fish_Object_Check(MUSEUM_FISH_ACTOR* actor, GAME* game) {
|
||||
f28 = 0.0f;
|
||||
f26 = 0.0f;
|
||||
f23 = FLT_MAX;
|
||||
fj = &actor->prvFish[0];
|
||||
fj = actor->prvFish;
|
||||
}
|
||||
if (f->_630 == 3 && f->_624 != 7) {
|
||||
if (f->group == 3 && f->_624 != 7) {
|
||||
Museum_Fish_BigFishObjCheck(f, game);
|
||||
}
|
||||
// asm 728
|
||||
@@ -1201,7 +1205,7 @@ void mfish_get_player_angle(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game, s16* at
|
||||
f32 v;
|
||||
p = playerActor->actor_class.world.position;
|
||||
p.y += 40.0f;
|
||||
xyz_t_sub(&p, &actor->_5A0, &p1);
|
||||
xyz_t_sub(&p, &actor->position, &p1);
|
||||
v = SQ(p1.x) + SQ(p1.z);
|
||||
v = sqrtf(v);
|
||||
if (atanx) {
|
||||
@@ -1218,15 +1222,15 @@ void mfish_get_player_angle(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game, s16* at
|
||||
BOOL mfish_peck_check(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
Private_c* commonData_prv = common_data.now_private;
|
||||
|
||||
if (MF_Control_Actor->_14db4 == actor->_630) {
|
||||
if (actor->_59C == 0x18) {
|
||||
if (MF_Control_Actor->_14db4 == actor->group) {
|
||||
if (actor->fishIDEnum == aGYO_TYPE_PIRANHA) {
|
||||
return TRUE;
|
||||
} else if (mPr_GetPossessionItemIdx(commonData_prv, 0x2806) != -1) {
|
||||
if (actor->_59C == 2 || actor->_59C == 3) {
|
||||
if (actor->fishIDEnum == aGYO_TYPE_CARP || actor->fishIDEnum == aGYO_TYPE_KOI) {
|
||||
return TRUE;
|
||||
}
|
||||
} else if (mPr_GetPossessionItemIdxItem1Category(commonData_prv, 8) != -1 &&
|
||||
(actor->_59C == 0x17 || actor->_59C == 0x1e)) {
|
||||
(actor->fishIDEnum == aGYO_TYPE_GOLDFISH || actor->fishIDEnum == aGYO_TYPE_POPEYED_GOLDFISH)) {
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@@ -1236,10 +1240,10 @@ BOOL mfish_peck_check(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
|
||||
BOOL mfish_peck_wall_check(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
s16 temp = (actor->_60C.y - actor->_62C);
|
||||
if (actor->_62E & 0x1E && ABS(temp) < DEG2SHORT_ANGLE(45)) {
|
||||
if (actor->_62E_flags & 0x1E && ABS(temp) < DEG2SHORT_ANGLE(45)) {
|
||||
PLAYER_ACTOR* playerActor = get_player_actor_withoutCheck((GAME_PLAY*)gamex);
|
||||
xyz_t target = playerActor->actor_class.world.position;
|
||||
return search_position_distance(&actor->_5A0, &target) < 60.0f;
|
||||
return search_position_distance(&actor->position, &target) < 60.0f;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
@@ -1248,16 +1252,16 @@ BOOL mfish_ground_peck_before_check(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex
|
||||
xyz_t p, p2;
|
||||
f32 v;
|
||||
|
||||
p2 = p = suisou_pos[actor->_630];
|
||||
p2 = p = suisou_pos[actor->group];
|
||||
|
||||
xyz_t_sub(&p2, &actor->_5A0, &p2);
|
||||
xyz_t_sub(&p2, &actor->position, &p2);
|
||||
|
||||
v = MAX(ABS(p2.x), ABS(p2.z));
|
||||
|
||||
if (actor->_34 == mfish_ground_peck_process) {
|
||||
if (actor->currentProcess == mfish_ground_peck_process) {
|
||||
return actor->_63E > 0;
|
||||
} else if ((actor->_630 == 2) && (actor->_5A0.x < p.x + 20.0f) && (actor->_5A0.z > p.z - 10.0f) &&
|
||||
(actor->_5A0.y < (actor->init_data._08 * 0.5f + 75.0f) - (v * 0.15f)) && (RANDOM_F(1.0f) > 0.2f)) {
|
||||
} else if ((actor->group == 2) && (actor->position.x < p.x + 20.0f) && (actor->position.z > p.z - 10.0f) &&
|
||||
(actor->position.y < (actor->init_data._08 * 0.5f + 75.0f) - (v * 0.15f)) && (RANDOM_F(1.0f) > 0.2f)) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -1303,7 +1307,7 @@ void mfish_get_player_area(MUSEUM_FISH_ACTOR* actor, GAME* gamex) {
|
||||
void mfish_get_flow_vec(xyz_t* pos, MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) {
|
||||
f32 v;
|
||||
xyz_t p2;
|
||||
xyz_t p = suisou_pos[actor->_630];
|
||||
xyz_t p = suisou_pos[actor->group];
|
||||
xyz_t t;
|
||||
xyz_t p3;
|
||||
|
||||
@@ -1314,18 +1318,18 @@ void mfish_get_flow_vec(xyz_t* pos, MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game)
|
||||
f32 d;
|
||||
f32 dSQ;
|
||||
|
||||
if (actor->_630 == 0) {
|
||||
if (actor->group == 0) {
|
||||
v = 0.05f;
|
||||
} else if (actor->_630 == 1) {
|
||||
} else if (actor->group == 1) {
|
||||
v = 0.06f;
|
||||
} else if (actor->_630 == 2) {
|
||||
} else if (actor->group == 2) {
|
||||
v = 0.2f;
|
||||
} else if (actor->_630 == 3) {
|
||||
} else if (actor->group == 3) {
|
||||
v = 0.05f;
|
||||
} else if (actor->_630 == 4) {
|
||||
} else if (actor->group == 4) {
|
||||
v = 0.08f;
|
||||
}
|
||||
xyz_t_sub(&actor->_5A0, &p, &t);
|
||||
xyz_t_sub(&actor->position, &p, &t);
|
||||
xy = SQ(t.x) + SQ(t.z);
|
||||
s = (sin_s(DEG2SHORT_ANGLE2(360.0f * sqrtf(xy) / 720.0f)) * 0.1f + 0.2f);
|
||||
p2.x = s * cos_s(DEG2SHORT_ANGLE2(360.0f * t.x / 60.0f));
|
||||
@@ -1333,9 +1337,9 @@ void mfish_get_flow_vec(xyz_t* pos, MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game)
|
||||
p2.y = (s * 0.5f) * cos_s(DEG2SHORT_ANGLE2(180.0f * t.y / 70.0f));
|
||||
|
||||
s2 = atans_table(t.z, t.x);
|
||||
s2 += MF_Control_Actor->_14daa[actor->_630];
|
||||
s2 += MF_Control_Actor->_14daa[actor->group];
|
||||
|
||||
if (actor->_630 == 2) {
|
||||
if (actor->group == 2) {
|
||||
p2.x += (GETREG(TAKREG, 0xc) * 0.01f + 2.0f) * cos_s(s2);
|
||||
p2.z += (GETREG(TAKREG, 0xc) * 0.01f + 2.0f) * sin_s(s2);
|
||||
} else {
|
||||
@@ -1351,9 +1355,9 @@ void mfish_get_flow_vec(xyz_t* pos, MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game)
|
||||
p2.z *= cos_s(actor->_618.z);
|
||||
}
|
||||
|
||||
if (actor->_630 == 4) {
|
||||
if (actor->group == 4) {
|
||||
p2.z += (GETREG(TAKREG, 0xb) * 0.01f + 0.5f) * cos_s(actor->_60C.y + DEG2SHORT_ANGLE(90));
|
||||
} else if (actor->_630 == 2) {
|
||||
} else if (actor->group == 2) {
|
||||
p2.x -= ABS(cos_s(actor->_60C.y)) * 0.02f;
|
||||
if (ABS((s16)(actor->_60C.y - DEG2SHORT_ANGLE(270))) < DEG2SHORT_ANGLE(100)) {
|
||||
p2.x = MIN(-1.0f + GETREG(TAKREG, 0x48) * 0.001f, p2.x);
|
||||
@@ -1361,12 +1365,12 @@ void mfish_get_flow_vec(xyz_t* pos, MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game)
|
||||
}
|
||||
|
||||
if (actor->_598 != NULL) {
|
||||
if (actor->_630 == 4) {
|
||||
if (actor->group == 4) {
|
||||
s = actor->_598->init_data._08 * 10.0f + actor->init_data._08 * 2.0f;
|
||||
} else {
|
||||
s = actor->_598->init_data._08 * 5.0f + actor->init_data._08 * 2.0f;
|
||||
}
|
||||
xyz_t_sub(&actor->_5A0, &actor->_598->_5A0, &p3);
|
||||
xyz_t_sub(&actor->position, &actor->_598->position, &p3);
|
||||
dSQ = SQ(p3.x) + SQ(p3.y) + SQ(p3.z);
|
||||
d = sqrtf(dSQ);
|
||||
|
||||
@@ -1379,7 +1383,7 @@ void mfish_get_flow_vec(xyz_t* pos, MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game)
|
||||
}
|
||||
}
|
||||
|
||||
if (actor->_630 == 2 && p2.x < 0.0f) {
|
||||
if (actor->group == 2 && p2.x < 0.0f) {
|
||||
p2.x *= 1.1f;
|
||||
}
|
||||
|
||||
@@ -1391,7 +1395,7 @@ void mfish_get_flow_vec(xyz_t* pos, MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game)
|
||||
}
|
||||
|
||||
s16 mfish_get_escape_angle(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) {
|
||||
s16 v1 = atans_table(actor->_594->_5A0.z - actor->_5A0.z, actor->_594->_5A0.x - actor->_5A0.x);
|
||||
s16 v1 = atans_table(actor->_594->position.z - actor->position.z, actor->_594->position.x - actor->position.x);
|
||||
s16 v = actor->_60C.y - v1;
|
||||
if (ABS(v) < DEG2SHORT_ANGLE(90)) {
|
||||
if (actor->_624 == 1 || actor->_624 == 2) {
|
||||
@@ -1447,15 +1451,16 @@ void mfish_move_smooth(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) {
|
||||
|
||||
if ((actor->_5E8 > 0.0f || actor->_608 < 5.0f || actor->_604 < 5.0f || actor->_600 < 5.0f ||
|
||||
actor->_5FC < 5.0f) &&
|
||||
(actor->_34 != mfish_peck_process && actor->_34 != mfish_koi_peck_process)) {
|
||||
(actor->currentProcess != mfish_peck_process && actor->currentProcess != mfish_koi_peck_process)) {
|
||||
vv = actor->_60C.y - (s16)v;
|
||||
if (ABS(vv) < DEG2SHORT_ANGLE(45)) {
|
||||
add_calc0(&actor->_5E8, 0.1f * cos_s(vv << 1), 0.02f);
|
||||
}
|
||||
|
||||
if ((actor->_630 == 0 || actor->_624 == 10 || actor->_624 == 11 || actor->_59C == 25) &&
|
||||
if ((actor->group == 0 || actor->_624 == 10 || actor->_624 == 11 ||
|
||||
actor->fishIDEnum == aGYO_TYPE_AROWANA) &&
|
||||
ABS(vv) < DEG2SHORT_ANGLE(90) && ABS(actor->_622) < DEG2SHORT_ANGLE(10)) {
|
||||
if (actor->_34 == mfish_afish_dummy_process) {
|
||||
if (actor->currentProcess == mfish_afish_dummy_process) {
|
||||
o = &actor->_634;
|
||||
} else {
|
||||
o = &actor->_612.y;
|
||||
@@ -1480,8 +1485,8 @@ void mfish_move_smooth(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) {
|
||||
void mfish_hamon_make(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) {
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
if ((play->game_frame & 7) == 0 &&
|
||||
((actor->_62E & 0x1e) == 0 || ABS((s16)(actor->_62C - actor->_60C.y)) < DEG2SHORT_ANGLE(80))) {
|
||||
xyz_t p = actor->_5A0;
|
||||
((actor->_62E_flags & 0x1e) == 0 || ABS((s16)(actor->_62C - actor->_60C.y)) < DEG2SHORT_ANGLE(80))) {
|
||||
xyz_t p = actor->position;
|
||||
p.y = 115.0f;
|
||||
Common_Get(clip.effect_clip)
|
||||
->effect_make_proc(0x45, p, 2, DEG2SHORT_ANGLE(180) + actor->_60C.y, game, -1, 7, 0);
|
||||
|
||||
@@ -18,23 +18,23 @@ void mfish_bass_base_FishMove(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) {
|
||||
actor->_5D0.z = actor->_5E8 * cos_s(actor->_60C.y);
|
||||
|
||||
add_calc(&actor->_5D0.y, MAX(ABS(actor->_5E8 * sin_s(actor->_60C.x)), 0.1f), 0.1f, 0.1f, 0.005f);
|
||||
t = add_calc(&actor->_5A0.y, actor->_5F4 + actor->init_data._0C, 0.1f, actor->_5D0.y, 0);
|
||||
t = add_calc(&actor->position.y, actor->_5F4 + actor->init_data._0C, 0.1f, actor->_5D0.y, 0);
|
||||
if (fabsf(t) < 0.008f) {
|
||||
add_calc_short_angle2(&actor->_612.x, 0, CALC_EASE(0.03f), DEG2SHORT_ANGLE(1.0f + (0.5f * actor->_5AC.y)) >> 1,
|
||||
9);
|
||||
}
|
||||
mfish_move_smooth(actor, game);
|
||||
mfish_get_flow_vec(&pos, actor, game);
|
||||
actor->_5A0.x += actor->_5D0.x + actor->_5DC.x;
|
||||
actor->_5A0.z += actor->_5D0.z + actor->_5DC.z;
|
||||
actor->_5A0.y = actor->_5A0.y + actor->_5DC.y;
|
||||
actor->_5A0.y = MAX(60, MIN(110, actor->_5A0.y));
|
||||
actor->position.x += actor->_5D0.x + actor->_5DC.x;
|
||||
actor->position.z += actor->_5D0.z + actor->_5DC.z;
|
||||
actor->position.y = actor->position.y + actor->_5DC.y;
|
||||
actor->position.y = MAX(60, MIN(110, actor->position.y));
|
||||
}
|
||||
|
||||
void mfish_bass_dummy_process_init(MUSEUM_FISH_PRIVATE_DATA* actor) {
|
||||
actor->_634 = mfish_get_hide_camera_angle(actor);
|
||||
|
||||
if ((actor->_62E & 0x1E) != 0) {
|
||||
if ((actor->_62E_flags & 0x1E) != 0) {
|
||||
// works with temp instead of cast
|
||||
if ((s16)(actor->_612.y - actor->_62C) > 0) {
|
||||
actor->_634 = actor->_62C + DEG2SHORT_ANGLE(90);
|
||||
@@ -47,7 +47,7 @@ void mfish_bass_dummy_process_init(MUSEUM_FISH_PRIVATE_DATA* actor) {
|
||||
}
|
||||
|
||||
actor->_5EC = 0.0f;
|
||||
actor->_34 = &mfish_bass_dummy_process;
|
||||
actor->currentProcess = &mfish_bass_dummy_process;
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -70,10 +70,10 @@ void mfish_bass_normal_process_init(MUSEUM_FISH_PRIVATE_DATA* fishActor) {
|
||||
ra = RANDOM_F(fishActor->init_data._14) + fishActor->init_data._10;
|
||||
t = (ra) / MAX(fishActor->init_data._14 + fishActor->init_data._10, 1);
|
||||
|
||||
if (RANDOM_F(1.0f) > 0.25f && (fishActor->_62E & 0x200) == 0) {
|
||||
fishActor->_62E |= 0x200;
|
||||
if (RANDOM_F(1.0f) > 0.25f && (fishActor->_62E_flags & 0x200) == 0) {
|
||||
fishActor->_62E_flags |= 0x200;
|
||||
} else {
|
||||
fishActor->_62E &= ~0x200;
|
||||
fishActor->_62E_flags &= ~0x200;
|
||||
}
|
||||
|
||||
if (ra > fishActor->_5E8) {
|
||||
@@ -84,7 +84,7 @@ void mfish_bass_normal_process_init(MUSEUM_FISH_PRIVATE_DATA* fishActor) {
|
||||
}
|
||||
|
||||
fishActor->_5F4 = t * Rnd_EX_fx(10);
|
||||
temp = (fishActor->_5F4 + fishActor->init_data._0C - fishActor->_5A0.y);
|
||||
temp = (fishActor->_5F4 + fishActor->init_data._0C - fishActor->position.y);
|
||||
fishActor->_612.x = DEG2SHORT_ANGLE2(temp * -(2 * fishActor->_5AC.y + 10));
|
||||
|
||||
fishActor->_612.x = CLAMP(fishActor->_612.x, DEG2SHORT_ANGLE(-50), DEG2SHORT_ANGLE(50));
|
||||
@@ -103,7 +103,7 @@ void mfish_bass_normal_process_init(MUSEUM_FISH_PRIVATE_DATA* fishActor) {
|
||||
}
|
||||
}
|
||||
|
||||
if ((fishActor->_62E & 0x200) == 0) {
|
||||
if ((fishActor->_62E_flags & 0x200) == 0) {
|
||||
fishActor->_632 = DEG2SHORT_ANGLE(t * 15 + 20);
|
||||
} else {
|
||||
fishActor->_632 = DEG2SHORT_ANGLE(t * 30 + 20);
|
||||
@@ -115,7 +115,7 @@ void mfish_bass_normal_process_init(MUSEUM_FISH_PRIVATE_DATA* fishActor) {
|
||||
fishActor->_612.y += DEG2SHORT_ANGLE(-15);
|
||||
}
|
||||
|
||||
if ((fishActor->_62E & 0x200) == 0) {
|
||||
if ((fishActor->_62E_flags & 0x200) == 0) {
|
||||
fishActor->_632 = DEG2SHORT_ANGLE(t * 10 + 30);
|
||||
} else {
|
||||
fishActor->_632 = DEG2SHORT_ANGLE((GETREG(TAKREG, 42) + 40.0f) * t + 30);
|
||||
@@ -127,21 +127,21 @@ void mfish_bass_normal_process_init(MUSEUM_FISH_PRIVATE_DATA* fishActor) {
|
||||
fishActor->_636 = DEG2SHORT_ANGLE(-180);
|
||||
}
|
||||
|
||||
fishActor->_62E &= ~0xC0;
|
||||
fishActor->_62E_flags &= ~0xC0;
|
||||
fishActor->_5EC = 0;
|
||||
fishActor->_34 = mfish_bass_normal_process;
|
||||
fishActor->currentProcess = mfish_bass_normal_process;
|
||||
}
|
||||
|
||||
void mfish_bass_normal_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) {
|
||||
//! NOTE: wrong floats in this file, based on objdiff
|
||||
if (((actor->_62E & 0x200) != 0 && actor->_632 > DEG2SHORT_ANGLE(20)) || actor->_640 > 0) {
|
||||
if (((actor->_62E_flags & 0x200) != 0 && actor->_632 > DEG2SHORT_ANGLE(20)) || actor->_640 > 0) {
|
||||
f32 v = (actor->_5AC.y * 0.03f + 0.02f);
|
||||
add_calc2(&actor->_5EC,
|
||||
v + (actor->_5AC.y * 0.02f + 0.03f) * (float)((actor->_632 - DEG2SHORT_ANGLE(20)) / 364),
|
||||
actor->_5AC.y * 0.04f + 0.01f, actor->_5AC.y * 0.02f + 0.01f);
|
||||
add_calc(&actor->_5E8, actor->_5F0, CALC_EASE(v), actor->_5EC * 0.5f, 0.025f);
|
||||
}
|
||||
if (actor->_62E & 0x200) {
|
||||
if (actor->_62E_flags & 0x200) {
|
||||
add_calc_short_angle2(&actor->_632, 0, CALC_EASE2(GETREG(TAKREG, 73) * 0.01f + 0.5f),
|
||||
(s16)(DEG2SHORT_ANGLE(GETREG(TAKREG, 74) * 0.1f + 4.0f) >> 1) >> 1, 45);
|
||||
actor->_636 = actor->_636 + (s16)DEG2SHORT_ANGLE2(
|
||||
@@ -158,7 +158,7 @@ void mfish_bass_normal_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) {
|
||||
|
||||
if (actor->_5E8 < 0.01f) {
|
||||
mfish_bass_dummy_process_init(actor);
|
||||
} else if (actor->_5E8 > 1.0f && actor->_62E & 0x1e) {
|
||||
} else if (actor->_5E8 > 1.0f && actor->_62E_flags & 0x1e) {
|
||||
if ((s16)(actor->_60C.y - actor->_62C) > 0) {
|
||||
actor->_612.y = actor->_62C + DEG2SHORT_ANGLE(112.5f);
|
||||
} else {
|
||||
@@ -175,37 +175,37 @@ void mfish_bass_turn_process_init(MUSEUM_FISH_PRIVATE_DATA* actor) {
|
||||
b = a = DEG2SHORT_ANGLE(45) + DEG2SHORT_ANGLE(RANDOM_F(75));
|
||||
actor->_618.y =
|
||||
DEG2SHORT_ANGLE((actor->_5AC.y * 4.0f + 4.0f) * (SHORT2DEG_ANGLE2(a) / 120.0f) + 2.0f + actor->_5AC.y);
|
||||
if (actor->_62E & 0x1e) {
|
||||
if (actor->_62E_flags & 0x1e) {
|
||||
if ((s16)(actor->_60C.y - actor->_62C) < 0) {
|
||||
b = -a;
|
||||
}
|
||||
} else if (actor->_62E & 0xC0) {
|
||||
if (actor->_62E & 0x40) {
|
||||
} else if (actor->_62E_flags & 0xC0) {
|
||||
if (actor->_62E_flags & 0x40) {
|
||||
b = ABS(a);
|
||||
} else {
|
||||
b = -ABS(a);
|
||||
}
|
||||
} else if (actor->_62E & 0x20) {
|
||||
} else if (actor->_62E_flags & 0x20) {
|
||||
if ((s16)(actor->_62A - actor->_60C.y) < 0) {
|
||||
b = -a;
|
||||
}
|
||||
}
|
||||
|
||||
if (b > 0) {
|
||||
actor->_62E |= 0x40;
|
||||
actor->_62E_flags |= 0x40;
|
||||
} else {
|
||||
actor->_62E |= 0x80;
|
||||
actor->_62E_flags |= 0x80;
|
||||
}
|
||||
|
||||
actor->_612.y += b;
|
||||
|
||||
if ((RANDOM_F(1) < 0.25f) && (actor->_62E & 0x200) == 0) {
|
||||
actor->_62E |= 0x200;
|
||||
if ((RANDOM_F(1) < 0.25f) && (actor->_62E_flags & 0x200) == 0) {
|
||||
actor->_62E_flags |= 0x200;
|
||||
} else {
|
||||
actor->_62E &= ~0x200;
|
||||
actor->_62E_flags &= ~0x200;
|
||||
}
|
||||
|
||||
if ((actor->_62E & 0x200) == 0) {
|
||||
if ((actor->_62E_flags & 0x200) == 0) {
|
||||
actor->_5F0 = 1.75f;
|
||||
actor->_5AC.x = Rnd_EX_fx(0.1f) + 0.15f;
|
||||
} else {
|
||||
@@ -220,7 +220,7 @@ void mfish_bass_turn_process_init(MUSEUM_FISH_PRIVATE_DATA* actor) {
|
||||
}
|
||||
|
||||
actor->_5EC = 0.0f;
|
||||
actor->_34 = mfish_bass_turn_process;
|
||||
actor->currentProcess = mfish_bass_turn_process;
|
||||
}
|
||||
|
||||
void mfish_bass_turn_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) {
|
||||
@@ -267,11 +267,11 @@ void mfish_bass_ct(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
mfish_onefish_ct(actor, gamex);
|
||||
mfish_base_ct(actor, gamex);
|
||||
|
||||
actor->_34 = mfish_bass_normal_process;
|
||||
actor->currentProcess = mfish_bass_normal_process;
|
||||
|
||||
if (actor->_59C == 7) {
|
||||
if (actor->fishIDEnum == aGYO_TYPE_LARGE_BASS) {
|
||||
actor->_5AC.y = 0;
|
||||
} else if (actor->_59C == 6) {
|
||||
} else if (actor->fishIDEnum == aGYO_TYPE_BASS) {
|
||||
actor->_5AC.y = 0.5f;
|
||||
} else {
|
||||
actor->_5AC.y = 1;
|
||||
@@ -288,12 +288,13 @@ void mfish_bass_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
|
||||
if (actor->_5F8 > actor->init_data._08 * 20.0f) {
|
||||
actor->_5F8 = 0.0f;
|
||||
actor->_626 = 0;
|
||||
actor->activityFrameCount = 0;
|
||||
}
|
||||
|
||||
if (actor->_626-- <= 0) {
|
||||
actor->_626 = actor->init_data._2C + (s16)(RANDOM_F(actor->init_data._2E));
|
||||
actor->_628 = actor->_626;
|
||||
if (actor->activityFrameCount-- <= 0) {
|
||||
actor->activityFrameCount =
|
||||
actor->init_data.activeFramesMin + (s16)(RANDOM_F(actor->init_data.activeFramesRange));
|
||||
actor->savedActivityFrameCount = actor->activityFrameCount;
|
||||
|
||||
if (mfish_WallCheck(actor)) {
|
||||
mfish_bass_tail_anim_set(actor, 1);
|
||||
@@ -302,18 +303,19 @@ void mfish_bass_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
mfish_bass_tail_anim_set(actor, 0);
|
||||
mfish_bass_normal_process_init(actor);
|
||||
}
|
||||
} else if (actor->_34 == &mfish_bass_normal_process) {
|
||||
if (((actor->_62E & 0x1e) && ABS((s16)(actor->_62C - actor->_60C.y)) < DEG2SHORT_ANGLE(30)) ||
|
||||
((actor->_62E & 0x20) &&
|
||||
} else if (actor->currentProcess == &mfish_bass_normal_process) {
|
||||
if (((actor->_62E_flags & 0x1e) && ABS((s16)(actor->_62C - actor->_60C.y)) < DEG2SHORT_ANGLE(30)) ||
|
||||
((actor->_62E_flags & 0x20) &&
|
||||
ABS((s16)((actor->_62A - DEG2SHORT_ANGLE(-180)) - actor->_60C.y)) < DEG2SHORT_ANGLE(30))) {
|
||||
actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E);
|
||||
actor->_628 = actor->_626;
|
||||
actor->activityFrameCount =
|
||||
actor->init_data.activeFramesMin + (s16)RANDOM_F(actor->init_data.activeFramesRange);
|
||||
actor->savedActivityFrameCount = actor->activityFrameCount;
|
||||
mfish_bass_tail_anim_set(actor, 1);
|
||||
mfish_bass_turn_process_init(actor);
|
||||
}
|
||||
}
|
||||
actor->_638 += DEG2SHORT_ANGLE(10);
|
||||
actor->_34(actor, gamex);
|
||||
actor->currentProcess(actor, gamex);
|
||||
|
||||
if (ABS(actor->_618.z) > ABS(actor->_622)) {
|
||||
add_calc2(&actor->_5E8, MIN(GETREG(TAKREG, 19) * 0.1f + 1.0f, actor->_5E8), GETREG(TAKREG, 18) * 0.01f + 0.2f,
|
||||
@@ -359,14 +361,14 @@ void mfish_bass_dw(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
|
||||
graph = play->game.graph;
|
||||
|
||||
Matrix_translate(actor->_5A0.x, actor->_5A0.y, actor->_5A0.z, 0);
|
||||
Matrix_translate(actor->position.x, actor->position.y, actor->position.z, 0);
|
||||
Matrix_RotateY(actor->_60C.y, 1);
|
||||
|
||||
Matrix_translate(0, 0.25f * actor->init_data._04, 1.5f * actor->init_data._24, 1);
|
||||
Matrix_RotateX(actor->_60C.x, 1);
|
||||
Matrix_RotateZ(MY_CLAMP(-(actor->_618.z >> 1), DEG2SHORT_ANGLE(-20), DEG2SHORT_ANGLE(20)), 1);
|
||||
Matrix_translate(0, 0.25f * -actor->init_data._04, 0.5f * -actor->init_data._24, 1);
|
||||
Matrix_scale(actor->init_data._00, actor->init_data._00, actor->init_data._00, 1);
|
||||
Matrix_scale(actor->init_data.renderScale, actor->init_data.renderScale, actor->init_data.renderScale, 1);
|
||||
|
||||
OPEN_DISP(graph);
|
||||
gSPMatrix(NEXT_POLY_OPA_DISP, _Matrix_to_Mtx_new(play->game.graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
|
||||
void mfish_big_fish_ct(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
qrand();
|
||||
actor->_5A0.y = actor->init_data._0C;
|
||||
actor->position.y = actor->init_data._0C;
|
||||
mfish_onefish_ct(actor, gamex);
|
||||
actor->_5E8 = 0.0f;
|
||||
actor->_5AC = ZeroVec;
|
||||
actor->_5F0 = actor->_5E8;
|
||||
actor->_60C.y = DEG2SHORT_ANGLE(90);
|
||||
if (actor->_59C == 0x27) {
|
||||
if (actor->fishIDEnum == aGYO_TYPE_ARAPAIMA) {
|
||||
actor->_60C.y = -actor->_60C.y;
|
||||
actor->_5A0.z = 430.0f;
|
||||
actor->_5A0.x += 40.0f;
|
||||
actor->position.z = 430.0f;
|
||||
actor->position.x += 40.0f;
|
||||
actor->_640 = 0;
|
||||
} else if (actor->_59C == 10) {
|
||||
actor->_5A0.z = 530.0f;
|
||||
actor->_5A0.x -= 40.0f;
|
||||
} else if (actor->fishIDEnum == aGYO_TYPE_GIANT_SNAKEHEAD) {
|
||||
actor->position.z = 530.0f;
|
||||
actor->position.x -= 40.0f;
|
||||
}
|
||||
|
||||
actor->_612.y = actor->_60C.y;
|
||||
@@ -31,7 +31,7 @@ void mfish_big_fish_ct(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
actor->_5AC.x = 0.0f;
|
||||
actor->_5AC.z = 0.0f;
|
||||
|
||||
actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E);
|
||||
actor->activityFrameCount = actor->init_data.activeFramesMin + (s16)RANDOM_F(actor->init_data.activeFramesRange);
|
||||
}
|
||||
|
||||
void mfish_big_fish_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
@@ -39,7 +39,7 @@ void mfish_big_fish_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
xyz_t p;
|
||||
mfish_onefish_mv(actor, gamex);
|
||||
mfish_body_wind_anime_play(actor, gamex);
|
||||
if (actor->_59C == 0x27) {
|
||||
if (actor->fishIDEnum == aGYO_TYPE_ARAPAIMA) {
|
||||
actor->_38._00.frame_control.speed = (sin_s(actor->_63A) * 0.2f + 1.0f) * 0.5f;
|
||||
} else {
|
||||
actor->_38._00.frame_control.speed =
|
||||
@@ -49,7 +49,7 @@ void mfish_big_fish_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
add_calc2(&actor->_5E8, actor->_5F0, 0.1f, 0.02f);
|
||||
actor->_5D0.x = actor->_5E8 * sin_s(actor->_60C.y);
|
||||
actor->_5D0.z = actor->_5E8 * cos_s(actor->_60C.y);
|
||||
if (actor->_59C == 0x27) {
|
||||
if (actor->fishIDEnum == aGYO_TYPE_ARAPAIMA) {
|
||||
if (actor->_600 > 35.0f) {
|
||||
if (actor->_632 > DEG2SHORT_ANGLE(10)) {
|
||||
add_calc0(&actor->_5F0, 1.0f - actor->init_data._18, 0.005f);
|
||||
@@ -74,8 +74,8 @@ void mfish_big_fish_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
}
|
||||
|
||||
mfish_get_flow_vec(&p, actor, gamex);
|
||||
actor->_5A0.x += actor->_5D0.x + p.x * 0.1f;
|
||||
actor->_5A0.z += actor->_5D0.z + p.z * 0.1f;
|
||||
actor->position.x += actor->_5D0.x + p.x * 0.1f;
|
||||
actor->position.z += actor->_5D0.z + p.z * 0.1f;
|
||||
|
||||
actor->_622 = add_calc_short_angle2(&actor->_60C.y, actor->_612.y + actor->_632 * sin_s(actor->_636),
|
||||
CALC_EASE2(0.2f), DEG2SHORT_ANGLE(1.875f), DEG2SHORT_ANGLE(0.05f));
|
||||
@@ -84,8 +84,8 @@ void mfish_big_fish_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
add_calc_short_angle2(&actor->_632, DEG2SHORT_ANGLE(0), CALC_EASE(0.05f), DEG2SHORT_ANGLE(0.5f),
|
||||
DEG2SHORT_ANGLE(0.05f));
|
||||
actor->_636 += DEG2SHORT_ANGLE(GETREG(TAKREG, 0x47) * 0.1f + 3.0f);
|
||||
add_calc(&actor->_5A0.y, actor->init_data._0C + actor->_5F4, CALC_EASE(0.05f), 0.15f, 0.05f);
|
||||
if (actor->_630 == 2) {
|
||||
add_calc(&actor->position.y, actor->init_data._0C + actor->_5F4, CALC_EASE(0.05f), 0.15f, 0.05f);
|
||||
if (actor->group == 2) {
|
||||
actor->_636 += DEG2SHORT_ANGLE(10);
|
||||
} else {
|
||||
actor->_646 += actor->_642;
|
||||
@@ -101,8 +101,9 @@ void mfish_big_fish_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
DEG2SHORT_ANGLE(0.025f));
|
||||
}
|
||||
add_calc2(&actor->_5AC.x, actor->_5AC.z, 0.25f, 0.02f);
|
||||
if (actor->_626-- < 0) {
|
||||
if ((actor->_59C == 0x27 && actor->_600 < 10.0f) || (actor->_59C == 10 && actor->_5FC < 10.0f)) {
|
||||
if (actor->activityFrameCount-- < 0) {
|
||||
if ((actor->fishIDEnum == aGYO_TYPE_ARAPAIMA && actor->_600 < 10.0f) ||
|
||||
(actor->fishIDEnum == aGYO_TYPE_GIANT_SNAKEHEAD && actor->_5FC < 10.0f)) {
|
||||
if (actor->_60C.y > 0) {
|
||||
actor->_612.y = DEG2SHORT_ANGLE(90);
|
||||
} else {
|
||||
@@ -113,7 +114,7 @@ void mfish_big_fish_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
|
||||
if (RANDOM_F(1.0f) < GETREG(TAKREG, 0x46) * 0.01f + 0.5f) {
|
||||
actor->_642 = DEG2SHORT_ANGLE(RANDOM2_F(2.0f) + 3.0f);
|
||||
if (actor->_59C == 0x27 || GETREG(TAKREG, 0x39) == 1) {
|
||||
if (actor->fishIDEnum == aGYO_TYPE_ARAPAIMA || GETREG(TAKREG, 0x39) == 1) {
|
||||
actor->_634 = DEG2SHORT_ANGLE(RANDOM_F(10.f) + 20.f);
|
||||
actor->_640 = DEG2SHORT_ANGLE(RANDOM_F(10.f));
|
||||
actor->_5AC.z = Rnd_EX_f(1.0f);
|
||||
@@ -139,7 +140,8 @@ void mfish_big_fish_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
actor->_640 = 0;
|
||||
actor->_5AC.z = 0.0f;
|
||||
}
|
||||
actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E);
|
||||
actor->activityFrameCount =
|
||||
actor->init_data.activeFramesMin + (s16)RANDOM_F(actor->init_data.activeFramesRange);
|
||||
}
|
||||
Museum_Fish_BGCheck(actor, gamex);
|
||||
}
|
||||
@@ -152,7 +154,7 @@ BOOL mfish_bfish_before_disp(GAME* game, cKF_SkeletonInfo_R_c* keyframe, int joi
|
||||
if (joint_num == 1) {
|
||||
f32 v;
|
||||
int i;
|
||||
if (actor->_59C == 0x27) {
|
||||
if (actor->fishIDEnum == aGYO_TYPE_ARAPAIMA) {
|
||||
v = 0.015f;
|
||||
} else {
|
||||
v = 0.02f;
|
||||
@@ -166,7 +168,7 @@ BOOL mfish_bfish_before_disp(GAME* game, cKF_SkeletonInfo_R_c* keyframe, int joi
|
||||
} else if (joint_num == 2) {
|
||||
f32 v;
|
||||
int i;
|
||||
if (actor->_59C == 0x27) {
|
||||
if (actor->fishIDEnum == aGYO_TYPE_ARAPAIMA) {
|
||||
v = 0.025f;
|
||||
} else {
|
||||
v = 0.035f;
|
||||
@@ -179,7 +181,7 @@ BOOL mfish_bfish_before_disp(GAME* game, cKF_SkeletonInfo_R_c* keyframe, int joi
|
||||
joint1->x = MY_CLAMP(i, DEG2SHORT_ANGLE(-20), DEG2SHORT_ANGLE(20));
|
||||
Matrix_scale(1.0f, 1.0f + v * sin_s(actor->_63A + DEG2SHORT_ANGLE(270)),
|
||||
1.0f + v * sin_s(actor->_63A + DEG2SHORT_ANGLE(90)), 1);
|
||||
} else if (joint_num == 3 && actor->_59C == 0x27) {
|
||||
} else if (joint_num == 3 && actor->fishIDEnum == aGYO_TYPE_ARAPAIMA) {
|
||||
int i = joint1->y - actor->_618.z +
|
||||
(int)(actor->_644 * (1.0f + 0.01f * GETREG(TAKREG, 0x16)) *
|
||||
sin_s(actor->_646 + DEG2SHORT_ANGLE(-180.f + GETREG(TAKREG, 0x18))));
|
||||
@@ -198,10 +200,10 @@ void mfish_big_fish_dw(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
mtxp = &skele->_2b0;
|
||||
}
|
||||
OPEN_DISP(gamex->graph);
|
||||
Matrix_translate(actor->_5A0.x, actor->_5A0.y, actor->_5A0.z, 0);
|
||||
Matrix_translate(actor->position.x, actor->position.y, actor->position.z, 0);
|
||||
Matrix_rotateXYZ(actor->_60C.x, actor->_60C.y, actor->_60C.z, 1);
|
||||
Matrix_translate(0.0f, 0.0f, actor->init_data._24, 1);
|
||||
Matrix_scale(actor->init_data._00, actor->init_data._00, actor->init_data._00, 1);
|
||||
Matrix_scale(actor->init_data.renderScale, actor->init_data.renderScale, actor->init_data.renderScale, 1);
|
||||
gSPMatrix(NEXT_POLY_OPA_DISP, _Matrix_to_Mtx_new(gamex->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
cKF_Si3_draw_R_SV(gamex, &skele->_00, mtxp, mfish_bfish_before_disp, NULL, actor);
|
||||
CLOSE_DISP(gamex->graph);
|
||||
|
||||
@@ -13,7 +13,7 @@ void mfish_dojou_ct(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
actor->_5AC = ZeroVec;
|
||||
actor->_638 = qrand();
|
||||
actor->_622 = 0;
|
||||
actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E);
|
||||
actor->activityFrameCount = actor->init_data.activeFramesMin + (s16)RANDOM_F(actor->init_data.activeFramesRange);
|
||||
actor->_624 = 6;
|
||||
actor->_5AC.x = 0.0f;
|
||||
mfish_dojou_normal_init(actor, gamex);
|
||||
@@ -21,7 +21,7 @@ void mfish_dojou_ct(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
|
||||
void mfish_dojou_normal_init(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
actor->_5F0 = RANDOM_F(actor->init_data._14) + actor->init_data._10;
|
||||
actor->_34 = mfish_dojou_normal;
|
||||
actor->currentProcess = mfish_dojou_normal;
|
||||
}
|
||||
|
||||
void mfish_dojou_normal(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
@@ -32,15 +32,16 @@ void mfish_dojou_normal(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
CALC_EASE2(0.3f), DEG2SHORT_ANGLE(3.75f), DEG2SHORT_ANGLE(0.25f));
|
||||
add_calc_short_angle2(&actor->_618.z, actor->_622, CALC_EASE2(0.25f), DEG2SHORT_ANGLE(2.5f),
|
||||
DEG2SHORT_ANGLE(0.25f));
|
||||
if (actor->_62E & 0x1e) {
|
||||
if (actor->_62E_flags & 0x1e) {
|
||||
mfish_dojou_turn_init(actor, gamex);
|
||||
} else if (actor->_62E & 0x20) {
|
||||
} else if (actor->_62E_flags & 0x20) {
|
||||
add_calc_short_angle2(&actor->_612.y, mfish_get_escape_angle(actor, gamex), CALC_EASE(0.5f),
|
||||
DEG2SHORT_ANGLE(15), DEG2SHORT_ANGLE(0.5f));
|
||||
} else if (actor->_626 < 0) {
|
||||
} else if (actor->activityFrameCount < 0) {
|
||||
f32 v = RANDOM_F(1.0f);
|
||||
actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E);
|
||||
actor->_628 = actor->_626;
|
||||
actor->activityFrameCount =
|
||||
actor->init_data.activeFramesMin + (s16)RANDOM_F(actor->init_data.activeFramesRange);
|
||||
actor->savedActivityFrameCount = actor->activityFrameCount;
|
||||
actor->_5F0 = actor->init_data._10 + Rnd_EX_f(actor->init_data._14);
|
||||
if (RANDOM_F(1.0f) < 0.5f) {
|
||||
actor->_612.y += DEG2SHORT_ANGLE((v - 0.3f) * 90.f);
|
||||
@@ -60,7 +61,7 @@ void mfish_dojou_turn_init(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
actor->_612.y = actor->_62C - DEG2SHORT_ANGLE(115);
|
||||
}
|
||||
actor->_5F0 = actor->init_data._14 + actor->init_data._10;
|
||||
actor->_34 = mfish_dojou_turn;
|
||||
actor->currentProcess = mfish_dojou_turn;
|
||||
}
|
||||
|
||||
void mfish_dojou_turn(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
@@ -81,7 +82,7 @@ void mfish_dojou_turn(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
void mfish_dojou_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
f32 v;
|
||||
xyz_t p;
|
||||
actor->_34(actor, gamex);
|
||||
actor->currentProcess(actor, gamex);
|
||||
actor->_61E = add_calc_short_angle2(&actor->_60C.x,
|
||||
actor->_612.x + (s16)(actor->_632 * sin_s(actor->_636) * sin_s(actor->_60C.x)),
|
||||
CALC_EASE(0.1f), DEG2SHORT_ANGLE(5), DEG2SHORT_ANGLE(0.5f));
|
||||
@@ -107,9 +108,9 @@ void mfish_dojou_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
actor->_5D0.z = v * cos_s(actor->_60C.y);
|
||||
actor->_5D0.y = -actor->_5E8 * sin_s(actor->_60C.x);
|
||||
mfish_get_flow_vec(&p, actor, gamex);
|
||||
actor->_5A0.x += actor->_5D0.x + p.x;
|
||||
actor->_5A0.y += actor->_5D0.y + p.y;
|
||||
actor->_5A0.z += actor->_5D0.z + p.z;
|
||||
actor->position.x += actor->_5D0.x + p.x;
|
||||
actor->position.y += actor->_5D0.y + p.y;
|
||||
actor->position.z += actor->_5D0.z + p.z;
|
||||
mfish_onefish_mv(actor, gamex);
|
||||
if (ABS(actor->_612.x) > DEG2SHORT_ANGLE(15)) {
|
||||
add_calc2(&actor->_38._00.frame_control.speed,
|
||||
@@ -120,10 +121,10 @@ void mfish_dojou_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
add_calc2(&actor->_38._00.frame_control.speed, actor->_5E8 * 1.5f + 0.5f, 0.2f, 0.1f);
|
||||
add_calc0(&actor->_5AC.x, 0.1f, 0.02f);
|
||||
}
|
||||
actor->_5B8 = actor->_5A0;
|
||||
actor->_5B8 = actor->position;
|
||||
Museum_Fish_BGCheck(actor, gamex);
|
||||
if (actor->_5A0.y < actor->init_data._08 + 50.f) {
|
||||
actor->_5A0.y = actor->init_data._08 + 50.f;
|
||||
if (actor->position.y < actor->init_data._08 + 50.f) {
|
||||
actor->position.y = actor->init_data._08 + 50.f;
|
||||
if (actor->_612.x > 0) {
|
||||
if ((RANDOM_F(1.0f) < 0.5f && actor->_63E < 0) || actor->_63E > 0) {
|
||||
actor->_612.x = DEG2SHORT_ANGLE(-80);
|
||||
@@ -141,8 +142,8 @@ void mfish_dojou_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
actor->_5F4 = 75.0f;
|
||||
}
|
||||
}
|
||||
} else if (actor->_5A0.y > actor->_5F4 - actor->init_data._08) {
|
||||
actor->_5A0.y = actor->_5F4 - actor->init_data._08;
|
||||
} else if (actor->position.y > actor->_5F4 - actor->init_data._08) {
|
||||
actor->position.y = actor->_5F4 - actor->init_data._08;
|
||||
if (actor->_5F4 > 100.0f) {
|
||||
actor->_612.x = DEG2SHORT_ANGLE(80);
|
||||
mfish_hamon_make(actor, gamex);
|
||||
@@ -159,7 +160,7 @@ void mfish_dojou_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
DEG2SHORT_ANGLE(0.0f));
|
||||
}
|
||||
}
|
||||
actor->_626--;
|
||||
actor->activityFrameCount--;
|
||||
}
|
||||
actor->_612.x = MAX((s16)-actor->init_data._30, MIN(actor->init_data._30, actor->_612.x));
|
||||
}
|
||||
@@ -197,12 +198,12 @@ void mfish_dojou_dw(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
}
|
||||
s = actor->_60C.x;
|
||||
OPEN_DISP(gamex->graph);
|
||||
Matrix_translate(actor->_5A0.x, actor->_5A0.y, actor->_5A0.z, 0);
|
||||
Matrix_translate(actor->position.x, actor->position.y, actor->position.z, 0);
|
||||
Matrix_RotateY(actor->_60C.y, 1);
|
||||
Matrix_translate(0.0f, 0.0f, actor->init_data._24 * (0.5f * cos_s(s) + ABS(cos_s(s))), 1);
|
||||
Matrix_RotateX(s, 1);
|
||||
Matrix_translate(0.0f, 0.0f, -actor->init_data._24 * 0.5f * cos_s(s), 1);
|
||||
Matrix_scale(actor->init_data._00, actor->init_data._00, actor->init_data._00, 1);
|
||||
Matrix_scale(actor->init_data.renderScale, actor->init_data.renderScale, actor->init_data.renderScale, 1);
|
||||
gSPMatrix(NEXT_POLY_OPA_DISP, _Matrix_to_Mtx_new(gamex->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
cKF_Si3_draw_R_SV(gamex, &skele->_00, mtxp, mfish_dojou_before_disp, NULL, actor);
|
||||
CLOSE_DISP(gamex->graph);
|
||||
|
||||
@@ -3,9 +3,9 @@ void mfish_donko_ct(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
//! BUG: ?
|
||||
qrand();
|
||||
mfish_onefish_ct(actor, gamex);
|
||||
actor->_5A0.x = GETREG(TAKREG, 0x32) + 450.f;
|
||||
actor->_5A0.y = GETREG(TAKREG, 0x33) + 60.f;
|
||||
actor->_5A0.z = GETREG(TAKREG, 0x34) + 180.f;
|
||||
actor->position.x = GETREG(TAKREG, 0x32) + 450.f;
|
||||
actor->position.y = GETREG(TAKREG, 0x33) + 60.f;
|
||||
actor->position.z = GETREG(TAKREG, 0x34) + 180.f;
|
||||
actor->_5E8 = 0.0f;
|
||||
actor->_5AC = ZeroVec;
|
||||
actor->_5F0 = actor->_5E8;
|
||||
@@ -18,7 +18,7 @@ void mfish_donko_ct(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
actor->_624 = 0;
|
||||
actor->_63A = qrand();
|
||||
actor->_63C = qrand();
|
||||
actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E);
|
||||
actor->activityFrameCount = actor->init_data.activeFramesMin + (s16)RANDOM_F(actor->init_data.activeFramesRange);
|
||||
}
|
||||
|
||||
void mfish_donko_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
@@ -27,7 +27,7 @@ void mfish_donko_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
mfish_onefish_mv(actor, gamex);
|
||||
mfish_body_wind_anime_play(actor, gamex);
|
||||
|
||||
if (actor->_626 > actor->_628 - 10) {
|
||||
if (actor->activityFrameCount > actor->savedActivityFrameCount - 10) {
|
||||
actor->_38._00.frame_control.speed = (actor->_5E8 * 3.0f + 1.0f) * 0.5f;
|
||||
} else {
|
||||
add_calc2(&actor->_38._00.frame_control.speed, actor->_5E8 * 2.0f + 0.125f, 0.2f, 0.1f);
|
||||
@@ -36,8 +36,8 @@ void mfish_donko_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
actor->_5AC.y = 0.0f;
|
||||
actor->_5D0.x = actor->_5E8 * sin_s(actor->_60C.y);
|
||||
actor->_5D0.z = actor->_5E8 * cos_s(actor->_60C.y);
|
||||
x = (actor->_5A0.x - (suisou_pos[actor->_630].x + 22.5f));
|
||||
z = (actor->_5A0.z - (suisou_pos[actor->_630].z - 31.25f));
|
||||
x = (actor->position.x - (suisou_pos[actor->group].x + 22.5f));
|
||||
z = (actor->position.z - (suisou_pos[actor->group].z - 31.25f));
|
||||
actor->_5D0.x -= x * 0.002f;
|
||||
actor->_5D0.z -= z * 0.002f;
|
||||
|
||||
@@ -45,18 +45,18 @@ void mfish_donko_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
actor->_5D0.y *= 0.95f;
|
||||
mfish_get_flow_vec(&p, actor, gamex);
|
||||
mfish_move_smooth(actor, gamex);
|
||||
actor->_5A0.x += actor->_5D0.x + actor->_5DC.x * 0.1f;
|
||||
actor->_5A0.z += actor->_5D0.z + actor->_5DC.z * 0.1f;
|
||||
actor->_5A0.y += actor->_5D0.y;
|
||||
actor->position.x += actor->_5D0.x + actor->_5DC.x * 0.1f;
|
||||
actor->position.z += actor->_5D0.z + actor->_5DC.z * 0.1f;
|
||||
actor->position.y += actor->_5D0.y;
|
||||
actor->_622 = add_calc_short_angle2(&actor->_60C.y, actor->_612.y, CALC_EASE2(0.25f), DEG2SHORT_ANGLE(3.75f),
|
||||
DEG2SHORT_ANGLE(0.25f));
|
||||
add_calc_short_angle2(&actor->_618.z, actor->_622, CALC_EASE2(0.2f), DEG2SHORT_ANGLE(2.5f), DEG2SHORT_ANGLE(0.25f));
|
||||
add_calc_short_angle2(&actor->_60C.x, actor->_612.x >> 1, CALC_EASE2(0.25f), DEG2SHORT_ANGLE(3.75f),
|
||||
DEG2SHORT_ANGLE(0.25f));
|
||||
|
||||
if (actor->_626-- < 0) {
|
||||
if (actor->activityFrameCount-- < 0) {
|
||||
s16 s = RANDOM_F(actor->init_data._30);
|
||||
if (actor->_62E & 0x1e) {
|
||||
if (actor->_62E_flags & 0x1e) {
|
||||
if ((s16)(actor->_60C.y - actor->_62C) > 0) {
|
||||
actor->_612.y = actor->_60C.y + s;
|
||||
} else {
|
||||
@@ -70,15 +70,16 @@ void mfish_donko_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
}
|
||||
}
|
||||
actor->_5F0 = actor->init_data._10 + RANDOM_F(actor->init_data._14);
|
||||
actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E);
|
||||
actor->_628 = actor->_626;
|
||||
} else if (actor->_626 > actor->_628 - 20) {
|
||||
actor->activityFrameCount =
|
||||
actor->init_data.activeFramesMin + (s16)RANDOM_F(actor->init_data.activeFramesRange);
|
||||
actor->savedActivityFrameCount = actor->activityFrameCount;
|
||||
} else if (actor->activityFrameCount > actor->savedActivityFrameCount - 20) {
|
||||
add_calc2(&actor->_5E8, actor->_5F0, 0.1f, 0.025f);
|
||||
} else {
|
||||
actor->_5E8 *= actor->init_data._18;
|
||||
}
|
||||
|
||||
if (actor->_62E & 0x1e && actor->_5E8 > 0.05f) {
|
||||
if (actor->_62E_flags & 0x1e && actor->_5E8 > 0.05f) {
|
||||
s16 s = actor->_62C;
|
||||
if ((s16)(actor->_612.y - actor->_62C) > DEG2SHORT_ANGLE(-1) &&
|
||||
ABS((s16)(actor->_612.y - actor->_62C)) < DEG2SHORT_ANGLE(95)) {
|
||||
@@ -118,12 +119,12 @@ void mfish_donko_dw(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
mtxp = &skele->_2b0;
|
||||
}
|
||||
OPEN_DISP(gamex->graph);
|
||||
Matrix_translate(actor->_5A0.x, actor->_5A0.y, actor->_5A0.z, 0);
|
||||
Matrix_translate(actor->position.x, actor->position.y, actor->position.z, 0);
|
||||
Matrix_RotateY(actor->_60C.y, 1);
|
||||
Matrix_translate(0.0f, 0.0f, actor->init_data._24 * 1.5f, 1);
|
||||
Matrix_RotateX(actor->_60C.x, 1);
|
||||
Matrix_translate(0.0f, 0.0f, -actor->init_data._24 * 0.5f, 1);
|
||||
Matrix_scale(actor->init_data._00, actor->init_data._00, actor->init_data._00, 1);
|
||||
Matrix_scale(actor->init_data.renderScale, actor->init_data.renderScale, actor->init_data.renderScale, 1);
|
||||
gSPMatrix(NEXT_POLY_OPA_DISP, _Matrix_to_Mtx_new(gamex->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
cKF_Si3_draw_R_SV(gamex, &skele->_00, mtxp, mfish_donko_before_disp, NULL, actor);
|
||||
CLOSE_DISP(gamex->graph);
|
||||
|
||||
@@ -13,14 +13,14 @@ void mfish_gupi_ct(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
actor->_5AC = ZeroVec;
|
||||
actor->_638 = qrand();
|
||||
actor->_622 = 0;
|
||||
actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E);
|
||||
actor->activityFrameCount = actor->init_data.activeFramesMin + (s16)RANDOM_F(actor->init_data.activeFramesRange);
|
||||
actor->_624 = 6;
|
||||
mfish_gupi_normal_init(actor, gamex);
|
||||
}
|
||||
|
||||
void mfish_gupi_normal_init(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
actor->_5F0 = RANDOM_F(actor->init_data._14) + actor->init_data._10;
|
||||
actor->_34 = mfish_gupi_normal;
|
||||
actor->currentProcess = mfish_gupi_normal;
|
||||
}
|
||||
|
||||
void mfish_gupi_normal(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
@@ -30,15 +30,16 @@ void mfish_gupi_normal(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
CALC_EASE2(GETREG(TAKREG, 0x17) * 0.01f + 0.5f), DEG2SHORT_ANGLE(7.5f),
|
||||
DEG2SHORT_ANGLE(0.25f));
|
||||
add_calc_short_angle2(&actor->_618.z, actor->_622, CALC_EASE2(0.3f), DEG2SHORT_ANGLE(5), DEG2SHORT_ANGLE(0.25f));
|
||||
if (actor->_62E & 0x1e) {
|
||||
if (actor->_62E_flags & 0x1e) {
|
||||
mfish_gupi_turn_init(actor, gamex);
|
||||
} else if (actor->_62E & 0x20) {
|
||||
} else if (actor->_62E_flags & 0x20) {
|
||||
add_calc_short_angle2(&actor->_612.y, mfish_get_escape_angle(actor, gamex), CALC_EASE(0.5f),
|
||||
DEG2SHORT_ANGLE(15), DEG2SHORT_ANGLE(0.5f));
|
||||
} else if (actor->_626 < 0) {
|
||||
} else if (actor->activityFrameCount < 0) {
|
||||
f32 v = RANDOM_F(1.0f);
|
||||
actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E);
|
||||
actor->_628 = actor->_626;
|
||||
actor->activityFrameCount =
|
||||
actor->init_data.activeFramesMin + (s16)RANDOM_F(actor->init_data.activeFramesRange);
|
||||
actor->savedActivityFrameCount = actor->activityFrameCount;
|
||||
actor->_5F0 = actor->init_data._10 + Rnd_EX_f(actor->init_data._14);
|
||||
|
||||
if (RANDOM_F(1.0f) < 0.5f) {
|
||||
@@ -60,12 +61,13 @@ void mfish_gupi_normal(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
s16 s;
|
||||
//! BUG: unused?
|
||||
RANDOM_F(1.0f);
|
||||
s = search_position_angleY(&suisou_pos[actor->_630], &actor->_5A0);
|
||||
s = search_position_angleY(&suisou_pos[actor->group], &actor->position);
|
||||
actor->_5F8 = 0.0f;
|
||||
actor->_612.y = s + DEG2SHORT_ANGLE(RANDOM2_F(90.0));
|
||||
actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E);
|
||||
actor->_626 >>= 1;
|
||||
actor->_628 = actor->_626;
|
||||
actor->activityFrameCount =
|
||||
actor->init_data.activeFramesMin + (s16)RANDOM_F(actor->init_data.activeFramesRange);
|
||||
actor->activityFrameCount >>= 1;
|
||||
actor->savedActivityFrameCount = actor->activityFrameCount;
|
||||
actor->_5F0 = actor->init_data._14 + actor->init_data._10;
|
||||
}
|
||||
}
|
||||
@@ -77,7 +79,7 @@ void mfish_gupi_turn_init(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
actor->_612.y = actor->_62C - DEG2SHORT_ANGLE(115);
|
||||
}
|
||||
actor->_5F0 = actor->init_data._14 + actor->init_data._10;
|
||||
actor->_34 = mfish_gupi_turn;
|
||||
actor->currentProcess = mfish_gupi_turn;
|
||||
}
|
||||
|
||||
void mfish_gupi_turn(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
@@ -96,7 +98,7 @@ void mfish_gupi_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
f32 v;
|
||||
xyz_t p;
|
||||
int s;
|
||||
actor->_34(actor, gamex);
|
||||
actor->currentProcess(actor, gamex);
|
||||
actor->_61E = add_calc_short_angle2(&actor->_60C.x, actor->_612.x, CALC_EASE2(0.2f), DEG2SHORT_ANGLE(1.75f),
|
||||
DEG2SHORT_ANGLE(0.25f));
|
||||
add_calc_short_angle2(&actor->_618.x, actor->_61E, CALC_EASE2(0.3f), DEG2SHORT_ANGLE(1.25f),
|
||||
@@ -120,9 +122,9 @@ void mfish_gupi_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
actor->_5D0.z = v * cos_s(actor->_60C.y);
|
||||
actor->_5D0.y = -actor->_5E8 * sin_s(actor->_60C.x);
|
||||
mfish_get_flow_vec(&p, actor, gamex);
|
||||
actor->_5A0.x += actor->_5D0.x + p.x;
|
||||
actor->_5A0.y += actor->_5D0.y + p.y;
|
||||
actor->_5A0.z += actor->_5D0.z + p.z;
|
||||
actor->position.x += actor->_5D0.x + p.x;
|
||||
actor->position.y += actor->_5D0.y + p.y;
|
||||
actor->position.z += actor->_5D0.z + p.z;
|
||||
|
||||
mfish_onefish_mv(actor, gamex);
|
||||
if (actor->_5F0 - 0.01f > actor->_5E8 && actor->_5F0 > 0.1f) {
|
||||
@@ -132,11 +134,11 @@ void mfish_gupi_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
add_calc2(&actor->_38._00.frame_control.speed, actor->_5E8 * 2.0f + 0.5f, 0.2f, 0.1f);
|
||||
}
|
||||
actor->_63A += (s16)DEG2SHORT_ANGLE2(GETREG(TAKREG, 0x47) + 3.0f);
|
||||
actor->_5B8 = actor->_5A0;
|
||||
actor->_5B8 = actor->position;
|
||||
Museum_Fish_BGCheck(actor, gamex);
|
||||
|
||||
if (actor->_5A0.y < (actor->_5F4 - 30.f) + actor->init_data._08) {
|
||||
actor->_5A0.y = (actor->_5F4 - 30.f) + actor->init_data._08;
|
||||
if (actor->position.y < (actor->_5F4 - 30.f) + actor->init_data._08) {
|
||||
actor->position.y = (actor->_5F4 - 30.f) + actor->init_data._08;
|
||||
if (actor->_612.x > 0) {
|
||||
if (RANDOM_F(1.0f) < 0.1f) {
|
||||
actor->_5F4 -= RANDOM_F(10.f) + 5.0f;
|
||||
@@ -145,8 +147,8 @@ void mfish_gupi_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
actor->_612.x = DEG2SHORT_ANGLE(-30);
|
||||
}
|
||||
}
|
||||
} else if (actor->_5A0.y > actor->_5F4 - actor->init_data._08) {
|
||||
actor->_5A0.y = actor->_5F4 - actor->init_data._08;
|
||||
} else if (actor->position.y > actor->_5F4 - actor->init_data._08) {
|
||||
actor->position.y = actor->_5F4 - actor->init_data._08;
|
||||
if (actor->_612.x <= 0) {
|
||||
if (RANDOM_F(1.0f) < 0.1f) {
|
||||
actor->_5F4 += RANDOM_F(10.f) + 5.0f;
|
||||
@@ -155,11 +157,11 @@ void mfish_gupi_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
actor->_612.x = DEG2SHORT_ANGLE(30);
|
||||
}
|
||||
}
|
||||
if (actor->_5F4 > 110.f || actor->_5A0.y >= 114.5f - actor->init_data._08) {
|
||||
if (actor->_5F4 > 110.f || actor->position.y >= 114.5f - actor->init_data._08) {
|
||||
mfish_hamon_make(actor, gamex);
|
||||
}
|
||||
} else {
|
||||
actor->_626--;
|
||||
actor->activityFrameCount--;
|
||||
}
|
||||
|
||||
actor->_612.x = MAX((s16)-actor->init_data._30, MIN(actor->init_data._30, actor->_612.x));
|
||||
@@ -200,12 +202,12 @@ void mfish_gupi_dw(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
}
|
||||
v = actor->_60C.x * 0.7f;
|
||||
OPEN_DISP(gamex->graph);
|
||||
Matrix_translate(actor->_5A0.x, actor->_5A0.y, actor->_5A0.z, 0);
|
||||
Matrix_translate(actor->position.x, actor->position.y, actor->position.z, 0);
|
||||
Matrix_RotateY(actor->_60C.y, 1);
|
||||
Matrix_translate(0.0f, 0.0f, actor->init_data._24 * 1.5f, 1);
|
||||
Matrix_RotateX(v, 1);
|
||||
Matrix_translate(0.0f, 0.0f, -actor->init_data._24 * 0.5f, 1);
|
||||
Matrix_scale(actor->init_data._00, actor->init_data._00, actor->init_data._00, 1);
|
||||
Matrix_scale(actor->init_data.renderScale, actor->init_data.renderScale, actor->init_data.renderScale, 1);
|
||||
gSPMatrix(NEXT_POLY_OPA_DISP, _Matrix_to_Mtx_new(gamex->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
cKF_Si3_draw_R_SV(gamex, &skele->_00, mtxp, mfish_gupi_before_disp, NULL, actor);
|
||||
CLOSE_DISP(gamex->graph);
|
||||
|
||||
@@ -41,11 +41,11 @@ void mfish_kaeru_ct(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
&keyframe->_00._4F0, &keyframe->_00._526);
|
||||
cKF_SkeletonInfo_R_init_standard_repeat_speedsetandmorph(&keyframe->_00._00, &cKF_ba_r_obj_museum5_hasu, NULL, 0.5f,
|
||||
0.0f);
|
||||
actor->_5A0.x = 453.9f;
|
||||
actor->_5A0.y = 116.0f;
|
||||
actor->_5A0.z = 250.4f;
|
||||
actor->position.x = 453.9f;
|
||||
actor->position.y = 116.0f;
|
||||
actor->position.z = 250.4f;
|
||||
actor->_5AC = ZeroVec;
|
||||
actor->_626 = 0;
|
||||
actor->activityFrameCount = 0;
|
||||
actor->_612.x = 0;
|
||||
actor->_612.y = 0;
|
||||
actor->_612.z = 0;
|
||||
@@ -84,7 +84,7 @@ void mfish_kaeru_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
cKF_SkeletonInfo_R_init_standard_repeat_morph(&skele1->_00, skele1->_550[actor->_640], NULL, 0.f);
|
||||
}
|
||||
if (actor->_640 == 1) {
|
||||
sAdo_OngenTrgStart(0x77, &actor->_5A0);
|
||||
sAdo_OngenTrgStart(0x77, &actor->position);
|
||||
actor->_612.x = 1;
|
||||
}
|
||||
}
|
||||
@@ -178,8 +178,8 @@ BOOL hasu_after_disp(GAME* game, cKF_SkeletonInfo_R_c* keyframe, int joint_num,
|
||||
MUSEUM_FISH_PRIVATE_DATA* actor = (MUSEUM_FISH_PRIVATE_DATA*)arg;
|
||||
YET_SKELETON_2* skele = actor->_590;
|
||||
if (joint_num == 9) {
|
||||
Matrix_Position_Zero(&actor->_5A0);
|
||||
actor->_5A0.y = skele->_564 * actor->init_data._00 * sin_s(skele->_56C) + 116.0f;
|
||||
Matrix_Position_Zero(&actor->position);
|
||||
actor->position.y = skele->_564 * actor->init_data.renderScale * sin_s(skele->_56C) + 116.0f;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
@@ -203,10 +203,10 @@ void mfish_kaeru_dw(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
gSPMatrix(NEXT_POLY_OPA_DISP, _Matrix_to_Mtx_new(gamex->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
cKF_Si3_draw_R_SV(gamex, &keyframe->_00._00, mtxp2, hasu_before_disp, hasu_after_disp, actor);
|
||||
|
||||
Matrix_translate(actor->_5A0.x + actor->_5AC.x, actor->_5A0.y, actor->_5A0.z + actor->_5AC.z, 0);
|
||||
Matrix_translate(actor->position.x + actor->_5AC.x, actor->position.y, actor->position.z + actor->_5AC.z, 0);
|
||||
Matrix_rotateXYZ(actor->_60C.x, actor->_60C.y, actor->_60C.z, 1);
|
||||
Matrix_translate(0.0f, 0.0f, actor->init_data._24, 1);
|
||||
Matrix_scale(actor->init_data._00, actor->init_data._00, actor->init_data._00, 1);
|
||||
Matrix_scale(actor->init_data.renderScale, actor->init_data.renderScale, actor->init_data.renderScale, 1);
|
||||
gSPMatrix(NEXT_POLY_OPA_DISP, _Matrix_to_Mtx_new(gamex->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
cKF_Si3_draw_R_SV(gamex, &skele->_00, mtxp, NULL, NULL, actor);
|
||||
CLOSE_DISP(gamex->graph);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
void mfish_ito_ct(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
//! BUG: unused
|
||||
s16 s = qrand();
|
||||
actor->_5A0.y = actor->init_data._0C;
|
||||
actor->position.y = actor->init_data._0C;
|
||||
mfish_onefish_ct(actor, gamex);
|
||||
actor->_5E8 = 0.0f;
|
||||
actor->_5AC = ZeroVec;
|
||||
@@ -21,7 +21,7 @@ void mfish_ito_ct(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
actor->_644 = 0;
|
||||
actor->_5AC.x = 0.0f;
|
||||
actor->_5AC.z = 0.0f;
|
||||
actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E);
|
||||
actor->activityFrameCount = actor->init_data.activeFramesMin + (s16)RANDOM_F(actor->init_data.activeFramesRange);
|
||||
}
|
||||
|
||||
void mfish_ito_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
@@ -41,13 +41,13 @@ void mfish_ito_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
}
|
||||
}
|
||||
mfish_get_flow_vec(&p, actor, gamex);
|
||||
actor->_5A0.x += actor->_5D0.x + p.x * 0.1f;
|
||||
actor->_5A0.z += actor->_5D0.z + p.z * 0.1f;
|
||||
actor->position.x += actor->_5D0.x + p.x * 0.1f;
|
||||
actor->position.z += actor->_5D0.z + p.z * 0.1f;
|
||||
actor->_622 = add_calc_short_angle2(&actor->_60C.y, actor->_612.y, CALC_EASE2(0.2f), DEG2SHORT_ANGLE(1.875f),
|
||||
DEG2SHORT_ANGLE(0.05f));
|
||||
add_calc_short_angle2(&actor->_618.z, actor->_622, CALC_EASE2(0.2f), DEG2SHORT_ANGLE(1.25f),
|
||||
DEG2SHORT_ANGLE(0.025f));
|
||||
add_calc(&actor->_5A0.y, actor->init_data._0C + actor->_5F4, CALC_EASE(0.05f), 0.15f, 0.05f);
|
||||
add_calc(&actor->position.y, actor->init_data._0C + actor->_5F4, CALC_EASE(0.05f), 0.15f, 0.05f);
|
||||
actor->_646 += DEG2SHORT_ANGLE(10);
|
||||
add_calc_short_angle2(&actor->_634, actor->_640, CALC_EASE2(0.1f),
|
||||
(s16)(DEG2SHORT_ANGLE(GETREG(TAKREG, 0x3d) * 0.1f + 0.8f) >> 1) >> 1,
|
||||
@@ -55,7 +55,7 @@ void mfish_ito_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
add_calc_short_angle2(&actor->_644, actor->_634, CALC_EASE2(0.1f), DEG2SHORT_ANGLE(0.625f),
|
||||
DEG2SHORT_ANGLE(0.025f));
|
||||
add_calc2(&actor->_5AC.x, actor->_5AC.z, 0.25f, 0.001f);
|
||||
if (actor->_626-- < 0) {
|
||||
if (actor->activityFrameCount-- < 0) {
|
||||
if (RANDOM_F(1.0f) > 0.5f && actor->_600 > 5.0f) {
|
||||
if (actor->_60C.y > 0) {
|
||||
actor->_612.y = DEG2SHORT_ANGLE(90);
|
||||
@@ -75,7 +75,8 @@ void mfish_ito_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
actor->_640 = 0;
|
||||
actor->_5AC.z = 0.0f;
|
||||
}
|
||||
actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E);
|
||||
actor->activityFrameCount =
|
||||
actor->init_data.activeFramesMin + (s16)RANDOM_F(actor->init_data.activeFramesRange);
|
||||
}
|
||||
Museum_Fish_BGCheck(actor, gamex);
|
||||
}
|
||||
@@ -116,10 +117,10 @@ void mfish_ito_dw(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
mtxp = &skele->_2b0;
|
||||
}
|
||||
OPEN_DISP(gamex->graph);
|
||||
Matrix_translate(actor->_5A0.x, actor->_5A0.y + actor->_5AC.y, actor->_5A0.z, 0);
|
||||
Matrix_translate(actor->position.x, actor->position.y + actor->_5AC.y, actor->position.z, 0);
|
||||
Matrix_rotateXYZ(actor->_60C.x, actor->_60C.y, actor->_60C.z, 1);
|
||||
Matrix_translate(0.0f, 0.0f, actor->init_data._24, 1);
|
||||
Matrix_scale(actor->init_data._00, actor->init_data._00, actor->init_data._00, 1);
|
||||
Matrix_scale(actor->init_data.renderScale, actor->init_data.renderScale, actor->init_data.renderScale, 1);
|
||||
gSPMatrix(NEXT_POLY_OPA_DISP, _Matrix_to_Mtx_new(gamex->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
cKF_Si3_draw_R_SV(gamex, &skele->_00, mtxp, mfish_ito_before_disp, NULL, actor);
|
||||
CLOSE_DISP(gamex->graph);
|
||||
|
||||
@@ -14,7 +14,7 @@ void mfish_kaseki_ct(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
actor->_638 = qrand();
|
||||
actor->_622 = 0;
|
||||
actor->_634 = 0;
|
||||
actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E);
|
||||
actor->activityFrameCount = actor->init_data.activeFramesMin + (s16)RANDOM_F(actor->init_data.activeFramesRange);
|
||||
actor->_624 = 1;
|
||||
actor->_594 = NULL;
|
||||
actor->_598 = NULL;
|
||||
@@ -23,9 +23,9 @@ void mfish_kaseki_ct(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
}
|
||||
|
||||
void mfish_kaseki_normal_init(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E);
|
||||
actor->activityFrameCount = actor->init_data.activeFramesMin + (s16)RANDOM_F(actor->init_data.activeFramesRange);
|
||||
actor->_5F0 = actor->init_data._10 + RANDOM_F(actor->init_data._14);
|
||||
actor->_34 = mfish_kaseki_normal;
|
||||
actor->currentProcess = mfish_kaseki_normal;
|
||||
}
|
||||
|
||||
void mfish_kaseki_normal(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
@@ -64,9 +64,9 @@ void mfish_kaseki_normal(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
add_calc_short_angle2(&actor->_612.y, DEG2SHORT_ANGLE(-90), CALC_EASE(GETREG(TAKREG, 0x21) * 0.01f + 0.25f),
|
||||
DEG2SHORT_ANGLE(GETREG(TAKREG, 0x22) + 25.0f) >> 1, DEG2SHORT_ANGLE(0.5f));
|
||||
}
|
||||
} else if (actor->_62E & 0x1e) {
|
||||
} else if (actor->_62E_flags & 0x1e) {
|
||||
mfish_kaseki_move_wall_smooth(actor, gamex);
|
||||
} else if (actor->_626 < 0) {
|
||||
} else if (actor->activityFrameCount < 0) {
|
||||
f32 r = RANDOM_F(1.0f);
|
||||
actor->_612.y = actor->_60C.y;
|
||||
if ((actor->_608 - actor->_604) * cos_s(actor->_60C.y) < 0) {
|
||||
@@ -74,7 +74,8 @@ void mfish_kaseki_normal(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
} else {
|
||||
actor->_612.y -= (s16)(r * actor->init_data._30);
|
||||
}
|
||||
actor->_626 = actor->init_data._2C + (s16)(RANDOM_F(actor->init_data._2E));
|
||||
actor->activityFrameCount =
|
||||
actor->init_data.activeFramesMin + (s16)(RANDOM_F(actor->init_data.activeFramesRange));
|
||||
actor->_5F0 = actor->init_data._10 + RANDOM_F(actor->init_data._14);
|
||||
}
|
||||
}
|
||||
@@ -105,8 +106,8 @@ void mfish_kaseki_move_wall_smooth(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex)
|
||||
void mfish_kaseki_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) {
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
f32 v;
|
||||
actor->_34(actor, game);
|
||||
add_calc2(&actor->_5A0.y, actor->init_data._0C, 0.5f, 0.1f);
|
||||
actor->currentProcess(actor, game);
|
||||
add_calc2(&actor->position.y, actor->init_data._0C, 0.5f, 0.1f);
|
||||
if (ABS(actor->_622) > DEG2SHORT_ANGLE(10)) {
|
||||
add_calc_short_angle2(&actor->_634, DEG2SHORT_ANGLE(20), CALC_EASE(0.25f), DEG2SHORT_ANGLE(0.25f),
|
||||
DEG2SHORT_ANGLE(0));
|
||||
@@ -134,16 +135,16 @@ void mfish_kaseki_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) {
|
||||
v = actor->_5E8 * (1.0f - ((sin_s(actor->_63A) * 0.2f + 0.2f) * MAX(cos_s(actor->_618.z), 0.5f)));
|
||||
actor->_5D0.x = v * sin_s(actor->_60C.y);
|
||||
actor->_5D0.z = v * cos_s(actor->_60C.y);
|
||||
actor->_5A0.x += actor->_5D0.x;
|
||||
actor->_5A0.z += actor->_5D0.z;
|
||||
actor->position.x += actor->_5D0.x;
|
||||
actor->position.z += actor->_5D0.z;
|
||||
mfish_onefish_mv(actor, game);
|
||||
actor->_38._00.frame_control.speed = actor->_5E8 * 0.75f + 0.25f;
|
||||
mfish_body_wind_anime_play(actor, game);
|
||||
Museum_Fish_BGCheck(actor, game);
|
||||
if (actor->_5A0.y < 55.0f - actor->init_data._04) {
|
||||
actor->_5A0.y = 55.0f - actor->init_data._04;
|
||||
if (actor->position.y < 55.0f - actor->init_data._04) {
|
||||
actor->position.y = 55.0f - actor->init_data._04;
|
||||
}
|
||||
actor->_626--;
|
||||
actor->activityFrameCount--;
|
||||
}
|
||||
|
||||
BOOL mfish_kaseki_before_disp(GAME* game, cKF_SkeletonInfo_R_c* keyframe, int joint_num, Gfx** joint_m, u8* joint_f,
|
||||
@@ -180,10 +181,10 @@ void mfish_kaseki_dw(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
mtxp = &skele->_2b0;
|
||||
}
|
||||
OPEN_DISP(gamex->graph);
|
||||
Matrix_translate(actor->_5A0.x, actor->_5A0.y, actor->_5A0.z, 0);
|
||||
Matrix_translate(actor->position.x, actor->position.y, actor->position.z, 0);
|
||||
Matrix_rotateXYZ(actor->_60C.x, actor->_60C.y, actor->_60C.z, 1);
|
||||
Matrix_translate(0.0f, 0.0f, actor->init_data._24, 1);
|
||||
Matrix_scale(actor->init_data._00, actor->init_data._00, actor->init_data._00, 1);
|
||||
Matrix_scale(actor->init_data.renderScale, actor->init_data.renderScale, actor->init_data.renderScale, 1);
|
||||
gSPMatrix(NEXT_POLY_OPA_DISP, _Matrix_to_Mtx_new(gamex->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
cKF_Si3_draw_R_SV(gamex, &skele->_00, mtxp, mfish_kaseki_before_disp, NULL, actor);
|
||||
CLOSE_DISP(gamex->graph);
|
||||
|
||||
@@ -12,8 +12,8 @@ void mfish_kingyo_ct(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
actor->_5D0.y = 0.0f;
|
||||
actor->_5AC = ZeroVec;
|
||||
actor->_622 = 0;
|
||||
actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E);
|
||||
actor->_628 = actor->_626;
|
||||
actor->activityFrameCount = actor->init_data.activeFramesMin + (s16)RANDOM_F(actor->init_data.activeFramesRange);
|
||||
actor->savedActivityFrameCount = actor->activityFrameCount;
|
||||
actor->_640 = RANDOM_F(130.f);
|
||||
actor->_624 = 6;
|
||||
mfish_kingyo_normal_init(actor, gamex);
|
||||
@@ -21,7 +21,7 @@ void mfish_kingyo_ct(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
|
||||
void mfish_kingyo_normal_init(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
actor->_5F0 = RANDOM_F(actor->init_data._14) + actor->init_data._10;
|
||||
actor->_34 = mfish_kingyo_normal;
|
||||
actor->currentProcess = mfish_kingyo_normal;
|
||||
}
|
||||
|
||||
void mfish_kingyo_normal(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
@@ -34,15 +34,16 @@ void mfish_kingyo_normal(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
|
||||
if (mfish_peck_check(actor, gamex)) {
|
||||
mfish_kingyo_peck_init(actor, gamex);
|
||||
} else if (actor->_62E & 0x1e) {
|
||||
} else if (actor->_62E_flags & 0x1e) {
|
||||
mfish_kingyo_turn_init(actor, gamex);
|
||||
} else if (actor->_62E & 0x20) {
|
||||
} else if (actor->_62E_flags & 0x20) {
|
||||
add_calc_short_angle2(&actor->_612.y, mfish_get_escape_angle(actor, gamex), CALC_EASE(0.5f),
|
||||
DEG2SHORT_ANGLE(15), DEG2SHORT_ANGLE(0.5f));
|
||||
} else if (actor->_626 < 0) {
|
||||
} else if (actor->activityFrameCount < 0) {
|
||||
f32 v = RANDOM_F(1.0f);
|
||||
actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E);
|
||||
actor->_628 = actor->_626;
|
||||
actor->activityFrameCount =
|
||||
actor->init_data.activeFramesMin + (s16)RANDOM_F(actor->init_data.activeFramesRange);
|
||||
actor->savedActivityFrameCount = actor->activityFrameCount;
|
||||
actor->_640 = RANDOM_F(130.f);
|
||||
actor->_5F0 = actor->init_data._10 + Rnd_EX_f(actor->init_data._14);
|
||||
if (RANDOM_F(1.0f) < 0.5f) {
|
||||
@@ -55,12 +56,13 @@ void mfish_kingyo_normal(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
}
|
||||
} else if (actor->_5F8 > actor->init_data._08 * 30.f) {
|
||||
f32 v = RANDOM_F(1.0f);
|
||||
s16 s = search_position_angleY(&suisou_pos[actor->_630], &actor->_5A0);
|
||||
s16 s = search_position_angleY(&suisou_pos[actor->group], &actor->position);
|
||||
actor->_5F8 = 0.0f;
|
||||
actor->_612.y = s + DEG2SHORT_ANGLE(RANDOM2_F(90));
|
||||
actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E);
|
||||
actor->_626 >>= 1;
|
||||
actor->_628 = actor->_626;
|
||||
actor->activityFrameCount =
|
||||
actor->init_data.activeFramesMin + (s16)RANDOM_F(actor->init_data.activeFramesRange);
|
||||
actor->activityFrameCount >>= 1;
|
||||
actor->savedActivityFrameCount = actor->activityFrameCount;
|
||||
actor->_640 = RANDOM_F(130.f);
|
||||
actor->_5F0 = actor->init_data._14 + actor->init_data._10;
|
||||
}
|
||||
@@ -73,7 +75,7 @@ void mfish_kingyo_turn_init(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
actor->_612.y = actor->_62C - DEG2SHORT_ANGLE(115);
|
||||
}
|
||||
actor->_5F0 = actor->init_data._14 + actor->init_data._10;
|
||||
actor->_34 = mfish_kingyo_turn;
|
||||
actor->currentProcess = mfish_kingyo_turn;
|
||||
}
|
||||
|
||||
void mfish_kingyo_turn(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
@@ -91,11 +93,11 @@ void mfish_kingyo_turn(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
void mfish_kingyo_peck_init(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
f32 dist;
|
||||
mfish_get_player_angle(actor, gamex, &actor->_612.y, &actor->_612.x, &dist);
|
||||
actor->_626 = 120;
|
||||
actor->_628 = actor->_626;
|
||||
actor->activityFrameCount = 120;
|
||||
actor->savedActivityFrameCount = actor->activityFrameCount;
|
||||
actor->_640 = RANDOM_F(130.f);
|
||||
actor->_5F0 = RANDOM_F(actor->init_data._14) + actor->init_data._10;
|
||||
actor->_34 = mfish_kingyo_peck;
|
||||
actor->currentProcess = mfish_kingyo_peck;
|
||||
}
|
||||
|
||||
void mfish_kingyo_peck(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
@@ -105,7 +107,7 @@ void mfish_kingyo_peck(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
CALC_EASE2(GETREG(TAKREG, 0x17) * 0.01f + 0.5f), DEG2SHORT_ANGLE(10),
|
||||
DEG2SHORT_ANGLE(0.25f));
|
||||
add_calc_short_angle2(&actor->_618.z, actor->_622, CALC_EASE2(0.3f), DEG2SHORT_ANGLE(5), DEG2SHORT_ANGLE(0.25f));
|
||||
if (actor->_626 < 0) {
|
||||
if (actor->activityFrameCount < 0) {
|
||||
f32 dist;
|
||||
mfish_get_player_angle(actor, gamex, &actor->_612.y, &actor->_612.x, &dist);
|
||||
if (ABS(actor->_612.y) < DEG2SHORT_ANGLE(15)) {
|
||||
@@ -122,7 +124,7 @@ void mfish_kingyo_peck(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
}
|
||||
}
|
||||
|
||||
if (actor->_62E & 0x20 && dist > 40.f) {
|
||||
if (actor->_62E_flags & 0x20 && dist > 40.f) {
|
||||
if ((s16)(actor->_612.y - actor->_62A) > 0) {
|
||||
actor->_612.y += DEG2SHORT_ANGLE(90);
|
||||
} else {
|
||||
@@ -135,15 +137,16 @@ void mfish_kingyo_peck(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
actor->_5F0 = 0.1f;
|
||||
}
|
||||
if (dist > 40.0f) {
|
||||
actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E);
|
||||
actor->_628 = actor->_626;
|
||||
actor->activityFrameCount =
|
||||
actor->init_data.activeFramesMin + (s16)RANDOM_F(actor->init_data.activeFramesRange);
|
||||
actor->savedActivityFrameCount = actor->activityFrameCount;
|
||||
actor->_640 = RANDOM_F(130.f);
|
||||
} else {
|
||||
actor->_626 = 60;
|
||||
actor->_628 = actor->_626;
|
||||
actor->activityFrameCount = 60;
|
||||
actor->savedActivityFrameCount = actor->activityFrameCount;
|
||||
actor->_640 = RANDOM_F(130.f);
|
||||
}
|
||||
} else if (MF_Control_Actor->_14db4 != actor->_630) {
|
||||
} else if (MF_Control_Actor->_14db4 != actor->group) {
|
||||
mfish_kingyo_turn_init(actor, gamex);
|
||||
} else if (mfish_peck_wall_check(actor, gamex)) {
|
||||
actor->_5F0 = 0.0f;
|
||||
@@ -156,7 +159,7 @@ void mfish_kingyo_peck(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
void mfish_kingyo_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
f32 v;
|
||||
xyz_t p;
|
||||
actor->_34(actor, gamex);
|
||||
actor->currentProcess(actor, gamex);
|
||||
actor->_61E = add_calc_short_angle2(&actor->_60C.x, actor->_612.x, CALC_EASE2(0.2f), DEG2SHORT_ANGLE(1.75f),
|
||||
DEG2SHORT_ANGLE(0.25f));
|
||||
add_calc_short_angle2(&actor->_618.x, actor->_61E, CALC_EASE2(0.3f), DEG2SHORT_ANGLE(1.25f),
|
||||
@@ -179,11 +182,12 @@ void mfish_kingyo_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
actor->_5D0.z = v * cos_s(actor->_60C.y);
|
||||
actor->_5D0.y = -actor->_5E8 * sin_s(actor->_60C.x);
|
||||
mfish_get_flow_vec(&p, actor, gamex);
|
||||
actor->_5A0.x += actor->_5D0.x + p.x;
|
||||
actor->_5A0.y += actor->_5D0.y + p.y;
|
||||
actor->_5A0.z += actor->_5D0.z + p.z;
|
||||
actor->position.x += actor->_5D0.x + p.x;
|
||||
actor->position.y += actor->_5D0.y + p.y;
|
||||
actor->position.z += actor->_5D0.z + p.z;
|
||||
mfish_onefish_mv(actor, gamex);
|
||||
if ((((actor->_5F0 - 0.01f) > actor->_5E8) || (actor->_626 > (s16)(actor->_628 - actor->_640))) &&
|
||||
if ((((actor->_5F0 - 0.01f) > actor->_5E8) ||
|
||||
(actor->activityFrameCount > (s16)(actor->savedActivityFrameCount - actor->_640))) &&
|
||||
actor->_5F0 > 0.1f) {
|
||||
actor->_38._00.frame_control.speed =
|
||||
(5.0f + GETREG(TAKREG, 0x28) * 0.1f) * 0.5f + (4.0f + GETREG(TAKREG, 0x29) * 0.1f) * actor->_5E8;
|
||||
@@ -193,19 +197,19 @@ void mfish_kingyo_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
add_calc2(&actor->_38._00.frame_control.speed, actor->_5E8 * 2.0f + 0.5f, 0.2f, 0.1f);
|
||||
}
|
||||
actor->_63A += (s16)DEG2SHORT_ANGLE2(GETREG(TAKREG, 0x47) + 3.0f);
|
||||
actor->_5B8 = actor->_5A0;
|
||||
actor->_5B8 = actor->position;
|
||||
Museum_Fish_BGCheck(actor, gamex);
|
||||
if (actor->_5A0.y < 60.f + actor->init_data._08) {
|
||||
actor->_5A0.y = 60.f + actor->init_data._08;
|
||||
if (actor->position.y < 60.f + actor->init_data._08) {
|
||||
actor->position.y = 60.f + actor->init_data._08;
|
||||
if (actor->_612.x > 0) {
|
||||
actor->_612.x = DEG2SHORT_ANGLE(-30);
|
||||
}
|
||||
} else if (actor->_5A0.y > 115.f - actor->init_data._08) {
|
||||
actor->_5A0.y = 115.f - actor->init_data._08;
|
||||
} else if (actor->position.y > 115.f - actor->init_data._08) {
|
||||
actor->position.y = 115.f - actor->init_data._08;
|
||||
actor->_612.x = DEG2SHORT_ANGLE(30);
|
||||
mfish_hamon_make(actor, gamex);
|
||||
} else {
|
||||
actor->_626--;
|
||||
actor->activityFrameCount--;
|
||||
}
|
||||
|
||||
actor->_612.x = MAX((s16)-actor->init_data._30, MIN(actor->init_data._30, actor->_612.x));
|
||||
@@ -247,12 +251,12 @@ void mfish_kingyo_dw(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
}
|
||||
s = actor->_60C.x * (GETREG(TAKREG, 0x41) * 0.01f + 0.75f);
|
||||
OPEN_DISP(gamex->graph);
|
||||
Matrix_translate(actor->_5A0.x, actor->_5A0.y, actor->_5A0.z, 0);
|
||||
Matrix_translate(actor->position.x, actor->position.y, actor->position.z, 0);
|
||||
Matrix_RotateY(actor->_60C.y, 1);
|
||||
Matrix_translate(0.0f, 0.0f, actor->init_data._24 * 1.5f, 1);
|
||||
Matrix_RotateX(s, 1);
|
||||
Matrix_translate(0.0f, 0.0f, -actor->init_data._24 * 0.5f, 1);
|
||||
Matrix_scale(actor->init_data._00, actor->init_data._00, actor->init_data._00, 1);
|
||||
Matrix_scale(actor->init_data.renderScale, actor->init_data.renderScale, actor->init_data.renderScale, 1);
|
||||
gSPMatrix(NEXT_POLY_OPA_DISP, _Matrix_to_Mtx_new(gamex->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
cKF_Si3_draw_R_SV(gamex, &skele->_00, mtxp, mfish_kingyo_before_disp, NULL, actor);
|
||||
CLOSE_DISP(gamex->graph);
|
||||
|
||||
@@ -45,14 +45,14 @@ void mfish_koi_move_smooth(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) {
|
||||
|
||||
if ((actor->_5E8 > 0.0f || actor->_608 < 10.0f || actor->_604 < 10.0f || actor->_600 < 10.0f ||
|
||||
actor->_5FC < 10.0f) &&
|
||||
(actor->_34 != mfish_koi_peck_process)) {
|
||||
(actor->currentProcess != mfish_koi_peck_process)) {
|
||||
vv = actor->_60C.y - (s16)v;
|
||||
if (ABS(vv) < DEG2SHORT_ANGLE(45)) {
|
||||
add_calc0(&actor->_5E8, 0.05f * cos_s(vv << 1), 0.0025f);
|
||||
}
|
||||
|
||||
if (ABS(vv) < DEG2SHORT_ANGLE(90) && ABS(actor->_622) < DEG2SHORT_ANGLE(15)) {
|
||||
if (actor->_34 == mfish_koi_dummy_process) {
|
||||
if (actor->currentProcess == mfish_koi_dummy_process) {
|
||||
o = &actor->_634;
|
||||
} else {
|
||||
o = &actor->_612.y;
|
||||
@@ -80,7 +80,7 @@ void mfish_koi_ct(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
mfish_onefish_ct(actor, gamex);
|
||||
mfish_base_ct(actor, gamex);
|
||||
|
||||
actor->_34 = mfish_koi_normal_process;
|
||||
actor->currentProcess = mfish_koi_normal_process;
|
||||
actor->_5E8 = actor->init_data._10;
|
||||
actor->_5AC.z = 1.0f;
|
||||
actor->_624 = 9;
|
||||
@@ -88,7 +88,7 @@ void mfish_koi_ct(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
|
||||
void mfish_koi_dummy_process_init(MUSEUM_FISH_PRIVATE_DATA* actor) {
|
||||
actor->_634 = mfish_get_hide_camera_angle(actor);
|
||||
if (actor->_62E & 0x1e) {
|
||||
if (actor->_62E_flags & 0x1e) {
|
||||
if ((s16)(actor->_612.y - actor->_62C) > 0) {
|
||||
actor->_634 = actor->_62C + DEG2SHORT_ANGLE(90);
|
||||
} else {
|
||||
@@ -100,7 +100,7 @@ void mfish_koi_dummy_process_init(MUSEUM_FISH_PRIVATE_DATA* actor) {
|
||||
}
|
||||
actor->_5F0 = MIN(MAX(actor->init_data._10, 0.1f), actor->_5E8);
|
||||
actor->_5EC = 0.0f;
|
||||
actor->_34 = mfish_koi_dummy_process;
|
||||
actor->currentProcess = mfish_koi_dummy_process;
|
||||
}
|
||||
|
||||
void mfish_koi_dummy_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) {
|
||||
@@ -124,7 +124,7 @@ void mfish_koi_normal_process_init(MUSEUM_FISH_PRIVATE_DATA* actor) {
|
||||
actor->_5F0 = v;
|
||||
}
|
||||
actor->_5F4 = Rnd_EX_fx(10.0f) * v2;
|
||||
actor->_612.x = DEG2SHORT_ANGLE(-10 * (actor->_5F4 + actor->init_data._0C - actor->_5A0.y));
|
||||
actor->_612.x = DEG2SHORT_ANGLE(-10 * (actor->_5F4 + actor->init_data._0C - actor->position.y));
|
||||
actor->_612.x = CLAMP(actor->_612.x, DEG2SHORT_ANGLE(-50), DEG2SHORT_ANGLE(50));
|
||||
|
||||
actor->_5D0.y = 0.0f;
|
||||
@@ -155,9 +155,9 @@ void mfish_koi_normal_process_init(MUSEUM_FISH_PRIVATE_DATA* actor) {
|
||||
actor->_636 = 0;
|
||||
}
|
||||
|
||||
actor->_62E &= ~0xC0;
|
||||
actor->_62E_flags &= ~0xC0;
|
||||
actor->_5EC = 0.0f;
|
||||
actor->_34 = mfish_koi_normal_process;
|
||||
actor->currentProcess = mfish_koi_normal_process;
|
||||
}
|
||||
|
||||
void mfish_koi_normal_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) {
|
||||
@@ -183,7 +183,7 @@ void mfish_koi_normal_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) {
|
||||
} else {
|
||||
mfish_koi_dummy_process_init(actor);
|
||||
}
|
||||
} else if (actor->_5E8 > 1.0f && actor->_62E & 0x1e) {
|
||||
} else if (actor->_5E8 > 1.0f && actor->_62E_flags & 0x1e) {
|
||||
if ((s16)(actor->_60C.y - actor->_62C) > 0) {
|
||||
actor->_612.y = actor->_62C + DEG2SHORT_ANGLE(112.5f);
|
||||
} else {
|
||||
@@ -196,25 +196,25 @@ void mfish_koi_normal_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) {
|
||||
void mfish_koi_turn_process_init(MUSEUM_FISH_PRIVATE_DATA* actor) {
|
||||
s16 s3 = DEG2SHORT_ANGLE(RANDOM_F(30.0f)) + DEG2SHORT_ANGLE(60.0f);
|
||||
actor->_618.y = ABS(DEG2SHORT_ANGLE2((SHORT2DEG_ANGLE2(s3) / 120.0f) * 3.0f + 2.0f));
|
||||
if (actor->_62E & 0x1e) {
|
||||
if (actor->_62E_flags & 0x1e) {
|
||||
if ((s16)(actor->_60C.y - actor->_62C) < 0) {
|
||||
s3 = -s3;
|
||||
}
|
||||
} else if (actor->_62E & 0xC0) {
|
||||
if (actor->_62E & 0x40) {
|
||||
} else if (actor->_62E_flags & 0xC0) {
|
||||
if (actor->_62E_flags & 0x40) {
|
||||
s3 = ABS(s3);
|
||||
} else {
|
||||
s3 = -ABS(s3);
|
||||
}
|
||||
actor->_62E &= ~0xC0;
|
||||
} else if (actor->_62E & 0x20 && (actor->_62A - actor->_60C.y) < 0) {
|
||||
actor->_62E_flags &= ~0xC0;
|
||||
} else if (actor->_62E_flags & 0x20 && (actor->_62A - actor->_60C.y) < 0) {
|
||||
s3 = -s3;
|
||||
}
|
||||
|
||||
if (s3 > 0) {
|
||||
actor->_62E |= 0x40;
|
||||
actor->_62E_flags |= 0x40;
|
||||
} else {
|
||||
actor->_62E |= 0x80;
|
||||
actor->_62E_flags |= 0x80;
|
||||
}
|
||||
|
||||
actor->_612.y += s3;
|
||||
@@ -227,7 +227,7 @@ void mfish_koi_turn_process_init(MUSEUM_FISH_PRIVATE_DATA* actor) {
|
||||
|
||||
actor->_5EC = 0.0f;
|
||||
actor->_5F0 = actor->init_data._10;
|
||||
actor->_34 = mfish_koi_turn_process;
|
||||
actor->currentProcess = mfish_koi_turn_process;
|
||||
}
|
||||
|
||||
void mfish_koi_turn_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) {
|
||||
@@ -309,9 +309,9 @@ void mfish_koi_peck_process_init(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) {
|
||||
actor->_636 = DEG2SHORT_ANGLE(-90);
|
||||
}
|
||||
|
||||
actor->_62E &= ~0xC0;
|
||||
actor->_62E_flags &= ~0xC0;
|
||||
actor->_5EC = 0.0f;
|
||||
actor->_34 = mfish_koi_peck_process;
|
||||
actor->currentProcess = mfish_koi_peck_process;
|
||||
}
|
||||
|
||||
void mfish_koi_peck_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
@@ -337,14 +337,15 @@ void mfish_koi_peck_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
if (RANDOM_F(1.0f) < 0.8f) {
|
||||
actor->_5E8 = -0.05f - RANDOM_F(0.1f);
|
||||
actor->_5F0 = 0.05f;
|
||||
actor->_626 = DEG2SHORT_ANGLE(0.33f);
|
||||
actor->activityFrameCount = DEG2SHORT_ANGLE(0.33f);
|
||||
} else {
|
||||
actor->_5E8 = -0.1f - RANDOM_F(0.05f);
|
||||
actor->_5F0 = 0.05f;
|
||||
actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E);
|
||||
actor->activityFrameCount =
|
||||
actor->init_data.activeFramesMin + (s16)RANDOM_F(actor->init_data.activeFramesRange);
|
||||
// actor->_626 >>= 3;
|
||||
}
|
||||
actor->_628 = actor->_626;
|
||||
actor->savedActivityFrameCount = actor->activityFrameCount;
|
||||
// actor->_5F0 = 0.0f;
|
||||
}
|
||||
}
|
||||
@@ -352,7 +353,7 @@ void mfish_koi_peck_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
void mfish_koi_long_move_process_init(MUSEUM_FISH_PRIVATE_DATA* actor) {
|
||||
actor->_5F0 = MAX(MIN(actor->_5E8, 0.5f), 0.05f);
|
||||
actor->_5EC = 0.0f;
|
||||
actor->_34 = mfish_koi_long_move_process;
|
||||
actor->currentProcess = mfish_koi_long_move_process;
|
||||
}
|
||||
|
||||
void mfish_koi_long_move_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) {
|
||||
@@ -367,7 +368,7 @@ void mfish_koi_long_move_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) {
|
||||
|
||||
void mfish_koi_base_FishMove(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) {
|
||||
xyz_t p;
|
||||
if ((actor->_34 != mfish_koi_turn_process && actor->_34 != mfish_koi_long_move_process) ||
|
||||
if ((actor->currentProcess != mfish_koi_turn_process && actor->currentProcess != mfish_koi_long_move_process) ||
|
||||
actor->_640 > DEG2SHORT_ANGLE(0)) {
|
||||
add_calc0(&actor->_5E8, 1.0f - actor->init_data._18, GETREG(TAKREG, 0x13) * 0.001f + 0.01f);
|
||||
} else {
|
||||
@@ -378,28 +379,29 @@ void mfish_koi_base_FishMove(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) {
|
||||
actor->_5D0.x = actor->_5E8 * sin_s(actor->_60C.y) * cos_s(actor->_60C.x);
|
||||
actor->_5D0.z = actor->_5E8 * cos_s(actor->_60C.y) * cos_s(actor->_60C.x);
|
||||
add_calc(&actor->_5D0.y, MAX(ABS(actor->_5E8 * sin_s(actor->_60C.x)), 0.1f), 0.1f, 0.1f, 0.005f);
|
||||
add_calc2(&actor->_5A0.y, actor->_5F4 + actor->init_data._0C, 0.1f, actor->_5D0.y);
|
||||
add_calc2(&actor->position.y, actor->_5F4 + actor->init_data._0C, 0.1f, actor->_5D0.y);
|
||||
mfish_koi_move_smooth(actor, game);
|
||||
mfish_get_flow_vec(&p, actor, game);
|
||||
actor->_5A0.x += actor->_5D0.x + actor->_5DC.x;
|
||||
actor->_5A0.z += actor->_5D0.z + actor->_5DC.z;
|
||||
actor->_5A0.y += actor->_5DC.y * 0.05f;
|
||||
actor->_5A0.y = MAX(60.f, MIN(110.f, actor->_5A0.y));
|
||||
actor->position.x += actor->_5D0.x + actor->_5DC.x;
|
||||
actor->position.z += actor->_5D0.z + actor->_5DC.z;
|
||||
actor->position.y += actor->_5DC.y * 0.05f;
|
||||
actor->position.y = MAX(60.f, MIN(110.f, actor->position.y));
|
||||
}
|
||||
|
||||
void mfish_koi_base_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
//! NOTE: wrong floats in this file, based on objdiff
|
||||
if (actor->_5F8 > actor->init_data._08 * 20.f) {
|
||||
actor->_5F8 = 0.0f;
|
||||
actor->_626 = 0;
|
||||
actor->activityFrameCount = 0;
|
||||
}
|
||||
|
||||
if (actor->_626-- <= 0) {
|
||||
actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E);
|
||||
actor->_628 = actor->_626;
|
||||
if (actor->activityFrameCount-- <= 0) {
|
||||
actor->activityFrameCount =
|
||||
actor->init_data.activeFramesMin + (s16)RANDOM_F(actor->init_data.activeFramesRange);
|
||||
actor->savedActivityFrameCount = actor->activityFrameCount;
|
||||
if (mfish_peck_check(actor, gamex)) {
|
||||
actor->_626 >>= 1;
|
||||
actor->_628 = actor->_626;
|
||||
actor->activityFrameCount >>= 1;
|
||||
actor->savedActivityFrameCount = actor->activityFrameCount;
|
||||
mfish_koi_tail_anim_set(actor, 0);
|
||||
mfish_koi_peck_process_init(actor, gamex);
|
||||
} else if (mfish_WallCheck(actor)) {
|
||||
@@ -409,12 +411,13 @@ void mfish_koi_base_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
mfish_koi_tail_anim_set(actor, 0);
|
||||
mfish_koi_normal_process_init(actor);
|
||||
}
|
||||
} else if (actor->_34 == mfish_koi_normal_process) {
|
||||
if ((actor->_62E & 0x1e && ABS((s16)(actor->_62C - actor->_60C.y)) < DEG2SHORT_ANGLE(30)) ||
|
||||
(actor->_62E & 0x20 &&
|
||||
} else if (actor->currentProcess == mfish_koi_normal_process) {
|
||||
if ((actor->_62E_flags & 0x1e && ABS((s16)(actor->_62C - actor->_60C.y)) < DEG2SHORT_ANGLE(30)) ||
|
||||
(actor->_62E_flags & 0x20 &&
|
||||
ABS((s16)(DEG2SHORT_ANGLE(180) + actor->_62A - actor->_60C.y)) < DEG2SHORT_ANGLE(30))) {
|
||||
actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E);
|
||||
actor->_628 = actor->_626;
|
||||
actor->activityFrameCount =
|
||||
actor->init_data.activeFramesMin + (s16)RANDOM_F(actor->init_data.activeFramesRange);
|
||||
actor->savedActivityFrameCount = actor->activityFrameCount;
|
||||
mfish_koi_tail_anim_set(actor, 1);
|
||||
mfish_koi_turn_process_init(actor);
|
||||
}
|
||||
@@ -422,7 +425,7 @@ void mfish_koi_base_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
|
||||
// actor->_5AC.y = 0.0f;
|
||||
actor->_638 += DEG2SHORT_ANGLE(10);
|
||||
actor->_34(actor, gamex);
|
||||
actor->currentProcess(actor, gamex);
|
||||
if (ABS(actor->_618.z) < ABS(actor->_622) && ABS(actor->_622) > DEG2SHORT_ANGLE(2)) {
|
||||
add_calc2(&actor->_5E8, MAX(0.1f, actor->_5E8), 0.2f, 0.25f);
|
||||
}
|
||||
@@ -437,13 +440,13 @@ void mfish_koi_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) {
|
||||
mfish_onefish_mv(actor, game);
|
||||
mfish_koi_base_mv(actor, game);
|
||||
Museum_Fish_BGCheck(actor, game);
|
||||
if ((actor->_34 == mfish_koi_dummy_process || actor->_34 == mfish_koi_long_move_process) &&
|
||||
if ((actor->currentProcess == mfish_koi_dummy_process || actor->currentProcess == mfish_koi_long_move_process) &&
|
||||
(play->game_frame & 0xff) == 0 && RANDOM_F(1) < 0.3f) {
|
||||
mfish_koi_tail_anim_set(actor, 2);
|
||||
}
|
||||
if (actor->_640 > 0) {
|
||||
actor->_640--;
|
||||
if (actor->_34 == mfish_koi_dummy_process || actor->_34 == mfish_koi_long_move_process) {
|
||||
if (actor->currentProcess == mfish_koi_dummy_process || actor->currentProcess == mfish_koi_long_move_process) {
|
||||
add_calc2(&actor->_38._00.frame_control.speed,
|
||||
(actor->_5AC.x * MAX(actor->_5F0 - actor->_5E8, 0.0f)) /
|
||||
(actor->init_data._10 + actor->init_data._14) +
|
||||
@@ -500,13 +503,13 @@ void mfish_koi_dw(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
mtxp = &skele->_2b0;
|
||||
}
|
||||
OPEN_DISP(gamex->graph);
|
||||
Matrix_translate(actor->_5A0.x, actor->_5A0.y, actor->_5A0.z, 0);
|
||||
Matrix_translate(actor->position.x, actor->position.y, actor->position.z, 0);
|
||||
Matrix_RotateY(actor->_60C.y, 1);
|
||||
Matrix_translate(0.0f, actor->init_data._04 * 0.25f, actor->init_data._24 * 1.5f, 1);
|
||||
Matrix_RotateX(actor->_60C.x, 1);
|
||||
Matrix_RotateZ(MY_CLAMP(-(actor->_618.z >> 2), DEG2SHORT_ANGLE(-20), DEG2SHORT_ANGLE(20)), 1);
|
||||
Matrix_translate(0.0f, -actor->init_data._04 * 0.25f, -actor->init_data._24 * 0.5f, 1);
|
||||
Matrix_scale(actor->init_data._00, actor->init_data._00, actor->init_data._00, 1);
|
||||
Matrix_scale(actor->init_data.renderScale, actor->init_data.renderScale, actor->init_data.renderScale, 1);
|
||||
gSPMatrix(NEXT_POLY_OPA_DISP, _Matrix_to_Mtx_new(gamex->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
cKF_Si3_draw_R_SV(gamex, &skele->_00, mtxp, mfish_koi_before_disp, NULL, actor);
|
||||
CLOSE_DISP(gamex->graph);
|
||||
|
||||
@@ -14,8 +14,8 @@ void mfish_kurage_ct(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
actor->_638 = qrand();
|
||||
actor->_618 = ZeroSVec;
|
||||
actor->_622 = 0;
|
||||
actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E);
|
||||
actor->_628 = actor->_626;
|
||||
actor->activityFrameCount = actor->init_data.activeFramesMin + (s16)RANDOM_F(actor->init_data.activeFramesRange);
|
||||
actor->savedActivityFrameCount = actor->activityFrameCount;
|
||||
actor->_594 = NULL;
|
||||
actor->_598 = NULL;
|
||||
actor->_624 = 3;
|
||||
@@ -23,16 +23,16 @@ void mfish_kurage_ct(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
}
|
||||
|
||||
void mfish_kurage_normal_init(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E);
|
||||
actor->_628 = actor->_626;
|
||||
actor->activityFrameCount = actor->init_data.activeFramesMin + (s16)RANDOM_F(actor->init_data.activeFramesRange);
|
||||
actor->savedActivityFrameCount = actor->activityFrameCount;
|
||||
actor->_5F0 = actor->init_data._10 + RANDOM_F(actor->init_data._14);
|
||||
actor->_34 = mfish_kurage_normal;
|
||||
actor->currentProcess = mfish_kurage_normal;
|
||||
}
|
||||
|
||||
void mfish_kurage_normal(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
if (actor->_62E & 0x1e) {
|
||||
if (actor->_62E_flags & 0x1e) {
|
||||
mfish_kurage_turn_init(actor, gamex);
|
||||
} else if (actor->_626 < 0) {
|
||||
} else if (actor->activityFrameCount < 0) {
|
||||
actor->_612.y = qrand();
|
||||
actor->_612.x = qrand();
|
||||
|
||||
@@ -49,8 +49,9 @@ void mfish_kurage_normal(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
actor->_612.x > (s16)(actor->_60C.x + DEG2SHORT_ANGLE(180))) {
|
||||
actor->_612.x = actor->_60C.x - (DEG2SHORT_ANGLE(180) - 1);
|
||||
}
|
||||
actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E);
|
||||
actor->_628 = actor->_626;
|
||||
actor->activityFrameCount =
|
||||
actor->init_data.activeFramesMin + (s16)RANDOM_F(actor->init_data.activeFramesRange);
|
||||
actor->savedActivityFrameCount = actor->activityFrameCount;
|
||||
actor->_5F0 = actor->init_data._10 + RANDOM_F(actor->init_data._14);
|
||||
} else if (actor->_5F8 > actor->init_data._08 * 10.0f) {
|
||||
f32 v = RANDOM_F(0.5f) + 0.5f;
|
||||
@@ -67,9 +68,10 @@ void mfish_kurage_normal(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
actor->_612.x = DEG2SHORT_ANGLE(-90.0f + RANDOM2_F(60.0f));
|
||||
}
|
||||
|
||||
actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E);
|
||||
actor->_626 >>= 1;
|
||||
actor->_628 = actor->_626;
|
||||
actor->activityFrameCount =
|
||||
actor->init_data.activeFramesMin + (s16)RANDOM_F(actor->init_data.activeFramesRange);
|
||||
actor->activityFrameCount >>= 1;
|
||||
actor->savedActivityFrameCount = actor->activityFrameCount;
|
||||
actor->_5F0 = actor->init_data._10 + RANDOM_F(actor->init_data._14);
|
||||
}
|
||||
}
|
||||
@@ -83,17 +85,18 @@ void mfish_kurage_turn_init(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
actor->_612.y = actor->_62C + DEG2SHORT_ANGLE(-135);
|
||||
}
|
||||
actor->_5F0 = actor->init_data._14 + actor->init_data._10;
|
||||
actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E);
|
||||
actor->_628 = actor->_626;
|
||||
actor->_34 = mfish_kurage_turn;
|
||||
actor->activityFrameCount = actor->init_data.activeFramesMin + (s16)RANDOM_F(actor->init_data.activeFramesRange);
|
||||
actor->savedActivityFrameCount = actor->activityFrameCount;
|
||||
actor->currentProcess = mfish_kurage_turn;
|
||||
}
|
||||
|
||||
void mfish_kurage_turn(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
if ((s16)(actor->_612.x - actor->_60C.x) == 0 && (s16)(actor->_612.y - actor->_60C.y) == 0) {
|
||||
mfish_kurage_normal_init(actor, gamex);
|
||||
} else if (actor->_626 < 0) {
|
||||
actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E);
|
||||
actor->_628 = actor->_626;
|
||||
} else if (actor->activityFrameCount < 0) {
|
||||
actor->activityFrameCount =
|
||||
actor->init_data.activeFramesMin + (s16)RANDOM_F(actor->init_data.activeFramesRange);
|
||||
actor->savedActivityFrameCount = actor->activityFrameCount;
|
||||
actor->_5F0 = actor->init_data._14 + actor->init_data._10;
|
||||
}
|
||||
}
|
||||
@@ -104,11 +107,11 @@ void mfish_kurage_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
xyz_t p;
|
||||
f32 t;
|
||||
|
||||
actor->_34(actor, gamex);
|
||||
actor->currentProcess(actor, gamex);
|
||||
actor->_5F4 = GETREG(TAKREG, 0x55) * 0.001f + 0.035f;
|
||||
actor->_632 += actor->_63A;
|
||||
actor->_63C += actor->_618.y;
|
||||
if (actor->_62E & 0x20) {
|
||||
if (actor->_62E_flags & 0x20) {
|
||||
add_calc_short_angle2(&actor->_618.y, DEG2SHORT_ANGLE(8), CALC_EASE(0.5f), DEG2SHORT_ANGLE(0.5f),
|
||||
DEG2SHORT_ANGLE(0.05f));
|
||||
} else {
|
||||
@@ -116,7 +119,7 @@ void mfish_kurage_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
DEG2SHORT_ANGLE(0.05f));
|
||||
}
|
||||
actor->_622 = DEG2SHORT_ANGLE(actor->_5E8 * 12.0f + 0.2f + GETREG(TAKREG, 0x1a) * 0.1f);
|
||||
if (actor->_626 > actor->_628 - 20) {
|
||||
if (actor->activityFrameCount > actor->savedActivityFrameCount - 20) {
|
||||
add_calc2(&actor->_5EC, 0.1f, 0.5f, 0.02f);
|
||||
}
|
||||
add_calc2(&actor->_5E8, actor->_5F0, 0.1f, actor->_5EC);
|
||||
@@ -152,37 +155,37 @@ void mfish_kurage_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
GETREG(TAKREG, 0x3d) * 0.01f + 0.25f, GETREG(TAKREG, 0x3e) * 0.01f + 0.2f);
|
||||
}
|
||||
|
||||
if (actor->_5A0.y < (55.0f + actor->init_data._08) + 10.0f) {
|
||||
t = (10.f - (actor->_5A0.y - (55.0f + actor->init_data._08)));
|
||||
if (actor->position.y < (55.0f + actor->init_data._08) + 10.0f) {
|
||||
t = (10.f - (actor->position.y - (55.0f + actor->init_data._08)));
|
||||
t *= (GETREG(TAKREG, 0x3C) * 0.0001f + 0.01f);
|
||||
|
||||
add_calc2(&actor->_5DC.y, t, GETREG(TAKREG, 0x3D) * 0.01f + 0.25f, GETREG(TAKREG, 0x3E) * 0.01f + 0.2f);
|
||||
} else if (actor->_5A0.y > (110.0f - actor->init_data._08) - 10.0f) {
|
||||
t = -(10.f - ((110.0f - actor->init_data._08) - actor->_5A0.y));
|
||||
} else if (actor->position.y > (110.0f - actor->init_data._08) - 10.0f) {
|
||||
t = -(10.f - ((110.0f - actor->init_data._08) - actor->position.y));
|
||||
t *= (GETREG(TAKREG, 0x3C) * 0.0001f + 0.01f);
|
||||
|
||||
add_calc2(&actor->_5DC.y, t, GETREG(TAKREG, 0x3D) * 0.01f + 0.25f, GETREG(TAKREG, 0x3E) * 0.01f + 0.2f);
|
||||
}
|
||||
|
||||
actor->_5A0.x += actor->_5D0.x + actor->_5DC.x;
|
||||
actor->_5A0.y += actor->_5D0.y + actor->_5DC.y;
|
||||
actor->_5A0.z += actor->_5D0.z + actor->_5DC.z;
|
||||
actor->position.x += actor->_5D0.x + actor->_5DC.x;
|
||||
actor->position.y += actor->_5D0.y + actor->_5DC.y;
|
||||
actor->position.z += actor->_5D0.z + actor->_5DC.z;
|
||||
|
||||
actor->_5B8 = actor->_5A0;
|
||||
actor->_5B8 = actor->position;
|
||||
|
||||
Museum_Fish_BGCheck(actor, gamex);
|
||||
if (actor->_5A0.y < 55.0f + actor->init_data._08) {
|
||||
actor->_5A0.y = 55.0f + actor->init_data._08;
|
||||
if (actor->position.y < 55.0f + actor->init_data._08) {
|
||||
actor->position.y = 55.0f + actor->init_data._08;
|
||||
actor->_612.x = DEG2SHORT_ANGLE(-30);
|
||||
} else if (actor->_5A0.y > 110.f - actor->init_data._08 - actor->_608 * 0.2f) {
|
||||
actor->_5A0.y = 110.f - actor->init_data._08 - actor->_608 * 0.2f;
|
||||
} else if (actor->position.y > 110.f - actor->init_data._08 - actor->_608 * 0.2f) {
|
||||
actor->position.y = 110.f - actor->init_data._08 - actor->_608 * 0.2f;
|
||||
if (actor->_612.x > 0) {
|
||||
actor->_612.x = DEG2SHORT_ANGLE(120);
|
||||
} else {
|
||||
actor->_612.x = DEG2SHORT_ANGLE(-120);
|
||||
}
|
||||
}
|
||||
actor->_626--;
|
||||
actor->activityFrameCount--;
|
||||
}
|
||||
|
||||
extern Gfx act_mus_kurage_sakana_body_model[];
|
||||
@@ -193,9 +196,10 @@ void mfish_kurage_dw(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
a += (actor->_5F4 * sin_s(actor->_632) + 1.0f);
|
||||
|
||||
OPEN_DISP(gamex->graph);
|
||||
Matrix_translate(actor->_5A0.x, actor->_5A0.y, actor->_5A0.z, 0);
|
||||
Matrix_translate(actor->position.x, actor->position.y, actor->position.z, 0);
|
||||
Matrix_rotateXYZ(actor->_60C.x, actor->_60C.y, actor->_60C.z, 1);
|
||||
Matrix_scale(actor->init_data._00 * a, actor->init_data._00 * (1.0f / SQ(a)), actor->init_data._00 * a, 1);
|
||||
Matrix_scale(actor->init_data.renderScale * a, actor->init_data.renderScale * (1.0f / SQ(a)),
|
||||
actor->init_data.renderScale * a, 1);
|
||||
Matrix_push();
|
||||
|
||||
Matrix_RotateY(actor->_63C, 1);
|
||||
|
||||
@@ -13,20 +13,20 @@ void mfish_medaka_ct(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
actor->_5AC = ZeroVec;
|
||||
actor->_638 = qrand();
|
||||
actor->_622 = 0;
|
||||
actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E);
|
||||
actor->activityFrameCount = actor->init_data.activeFramesMin + (s16)RANDOM_F(actor->init_data.activeFramesRange);
|
||||
actor->_624 = 6;
|
||||
mfish_medaka_normal_init(actor, gamex);
|
||||
}
|
||||
|
||||
void mfish_medaka_normal_init(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
if (actor->_630 == 2) {
|
||||
if (actor->_626 < 0) {
|
||||
if (actor->group == 2) {
|
||||
if (actor->activityFrameCount < 0) {
|
||||
actor->_5F0 = actor->init_data._10 + Rnd_EX_f(actor->init_data._14);
|
||||
}
|
||||
} else {
|
||||
actor->_5F0 = RANDOM_F(actor->init_data._14) + actor->init_data._10;
|
||||
}
|
||||
actor->_34 = mfish_medaka_normal;
|
||||
actor->currentProcess = mfish_medaka_normal;
|
||||
}
|
||||
|
||||
void mfish_medaka_normal(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
@@ -36,15 +36,16 @@ void mfish_medaka_normal(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
CALC_EASE2(GETREG(TAKREG, 0x17) * 0.01f + 0.5f), DEG2SHORT_ANGLE(7.5f),
|
||||
DEG2SHORT_ANGLE(0.25f));
|
||||
add_calc_short_angle2(&actor->_618.z, actor->_622, CALC_EASE2(0.3f), DEG2SHORT_ANGLE(5), DEG2SHORT_ANGLE(0.25f));
|
||||
if (actor->_62E & 0x1e) {
|
||||
if (actor->_62E_flags & 0x1e) {
|
||||
mfish_medaka_turn_init(actor, gamex);
|
||||
} else if (actor->_62E & 0x20) {
|
||||
} else if (actor->_62E_flags & 0x20) {
|
||||
add_calc_short_angle2(&actor->_612.y, mfish_get_escape_angle(actor, gamex), CALC_EASE(0.5f),
|
||||
DEG2SHORT_ANGLE(15), DEG2SHORT_ANGLE(0.5f));
|
||||
} else if (actor->_626 < 0) {
|
||||
} else if (actor->activityFrameCount < 0) {
|
||||
f32 v = RANDOM_F(1.0f);
|
||||
actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E);
|
||||
actor->_628 = actor->_626;
|
||||
actor->activityFrameCount =
|
||||
actor->init_data.activeFramesMin + (s16)RANDOM_F(actor->init_data.activeFramesRange);
|
||||
actor->savedActivityFrameCount = actor->activityFrameCount;
|
||||
actor->_5F0 = actor->init_data._10 + Rnd_EX_f(actor->init_data._14);
|
||||
if (RANDOM_F(1.0f) < 0.5f) {
|
||||
actor->_612.y += DEG2SHORT_ANGLE((v - 0.3f) * 90.f);
|
||||
@@ -56,12 +57,13 @@ void mfish_medaka_normal(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
}
|
||||
} else if (actor->_5F8 > actor->init_data._08 * 30.f) {
|
||||
f32 v = RANDOM_F(1.0f);
|
||||
s16 s = search_position_angleY(&suisou_pos[actor->_630], &actor->_5A0);
|
||||
s16 s = search_position_angleY(&suisou_pos[actor->group], &actor->position);
|
||||
actor->_5F8 = 0.0f;
|
||||
actor->_612.y = s + DEG2SHORT_ANGLE(RANDOM2_F(90));
|
||||
actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E);
|
||||
actor->_626 >>= 1;
|
||||
actor->_628 = actor->_626;
|
||||
actor->activityFrameCount =
|
||||
actor->init_data.activeFramesMin + (s16)RANDOM_F(actor->init_data.activeFramesRange);
|
||||
actor->activityFrameCount >>= 1;
|
||||
actor->savedActivityFrameCount = actor->activityFrameCount;
|
||||
actor->_5F0 = actor->init_data._14 + actor->init_data._10;
|
||||
}
|
||||
}
|
||||
@@ -73,7 +75,7 @@ void mfish_medaka_turn_init(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
actor->_612.y = actor->_62C - DEG2SHORT_ANGLE(115);
|
||||
}
|
||||
actor->_5F0 = actor->init_data._14 + actor->init_data._10;
|
||||
actor->_34 = mfish_medaka_turn;
|
||||
actor->currentProcess = mfish_medaka_turn;
|
||||
}
|
||||
|
||||
void mfish_medaka_turn(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
@@ -92,7 +94,7 @@ void mfish_medaka_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
f32 v;
|
||||
xyz_t p;
|
||||
|
||||
actor->_34(actor, gamex);
|
||||
actor->currentProcess(actor, gamex);
|
||||
actor->_61E = add_calc_short_angle2(&actor->_60C.x, actor->_612.x, CALC_EASE2(0.2f), DEG2SHORT_ANGLE(1.75f),
|
||||
DEG2SHORT_ANGLE(0.25f));
|
||||
add_calc_short_angle2(&actor->_618.x, actor->_61E, CALC_EASE2(0.3f), DEG2SHORT_ANGLE(1.25f),
|
||||
@@ -113,23 +115,23 @@ void mfish_medaka_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
actor->_5D0.z = v * cos_s(actor->_60C.y);
|
||||
actor->_5D0.y = -actor->_5E8 * sin_s(actor->_60C.x);
|
||||
mfish_get_flow_vec(&p, actor, gamex);
|
||||
actor->_5A0.x += actor->_5D0.x + p.x;
|
||||
actor->_5A0.y += actor->_5D0.y + p.y;
|
||||
actor->_5A0.z += actor->_5D0.z + p.z;
|
||||
actor->position.x += actor->_5D0.x + p.x;
|
||||
actor->position.y += actor->_5D0.y + p.y;
|
||||
actor->position.z += actor->_5D0.z + p.z;
|
||||
mfish_onefish_mv(actor, gamex);
|
||||
add_calc2(&actor->_38._00.frame_control.speed, actor->_5E8 * 2.0f + 0.5f, 0.2f, 0.1f);
|
||||
actor->_5B8 = actor->_5A0;
|
||||
actor->_5B8 = actor->position;
|
||||
Museum_Fish_BGCheck(actor, gamex);
|
||||
if (actor->_5A0.y < 70.f + actor->init_data._08) {
|
||||
actor->_5A0.y = 70.f + actor->init_data._08;
|
||||
if (actor->position.y < 70.f + actor->init_data._08) {
|
||||
actor->position.y = 70.f + actor->init_data._08;
|
||||
if (actor->_612.x > 0) {
|
||||
actor->_612.x = DEG2SHORT_ANGLE(-30);
|
||||
}
|
||||
} else if (actor->_5A0.y > 100.f - actor->init_data._08) {
|
||||
actor->_5A0.y = 100.f - actor->init_data._08;
|
||||
} else if (actor->position.y > 100.f - actor->init_data._08) {
|
||||
actor->position.y = 100.f - actor->init_data._08;
|
||||
actor->_612.x = DEG2SHORT_ANGLE(30);
|
||||
} else {
|
||||
actor->_626--;
|
||||
actor->activityFrameCount--;
|
||||
}
|
||||
|
||||
actor->_612.x = MAX((s16)-actor->init_data._30, MIN(actor->init_data._30, actor->_612.x));
|
||||
@@ -163,12 +165,12 @@ void mfish_medaka_dw(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
}
|
||||
s = actor->_60C.x * (GETREG(TAKREG, 0x41) * 0.01f + 0.75f);
|
||||
OPEN_DISP(gamex->graph);
|
||||
Matrix_translate(actor->_5A0.x, actor->_5A0.y, actor->_5A0.z, 0);
|
||||
Matrix_translate(actor->position.x, actor->position.y, actor->position.z, 0);
|
||||
Matrix_RotateY(actor->_60C.y, 1);
|
||||
Matrix_translate(0.0f, 0.0f, actor->init_data._24 * 1.5f, 1);
|
||||
Matrix_RotateX(s, 1);
|
||||
Matrix_translate(0.0f, 0.0f, -actor->init_data._24 * 0.5f, 1);
|
||||
Matrix_scale(actor->init_data._00, actor->init_data._00, actor->init_data._00, 1);
|
||||
Matrix_scale(actor->init_data.renderScale, actor->init_data.renderScale, actor->init_data.renderScale, 1);
|
||||
gSPMatrix(NEXT_POLY_OPA_DISP, _Matrix_to_Mtx_new(gamex->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
cKF_Si3_draw_R_SV(gamex, &skele->_00, mtxp, mfish_medaka_before_disp, NULL, actor);
|
||||
CLOSE_DISP(gamex->graph);
|
||||
|
||||
@@ -7,14 +7,14 @@ void mfish_namazu_ct(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
actor->_612.y = actor->_60C.y;
|
||||
actor->_5F4 = 0.0f;
|
||||
actor->_5AC = ZeroVec;
|
||||
if (actor->_59C == 4) {
|
||||
if (actor->fishIDEnum == aGYO_TYPE_CATFISH) {
|
||||
actor->_5AC.y = 1500.f;
|
||||
} else {
|
||||
actor->_5AC.y = 1700.f;
|
||||
}
|
||||
actor->_638 = qrand();
|
||||
actor->_622 = actor->_60C.y;
|
||||
actor->_5A0.z += 40.0f;
|
||||
actor->position.z += 40.0f;
|
||||
actor->_624 = 10;
|
||||
// maybe s_xyz? but because we're not assigning a ZeroSVec, i'm thinking not?
|
||||
actor->_640 = 0;
|
||||
@@ -66,8 +66,8 @@ void mfish_namazu_normal_process_init(MUSEUM_FISH_PRIVATE_DATA* actor) {
|
||||
actor->_636 = DEG2SHORT_ANGLE(-180);
|
||||
}
|
||||
|
||||
actor->_62E &= ~0xC0;
|
||||
actor->_34 = mfish_namazu_normal_process;
|
||||
actor->_62E_flags &= ~0xC0;
|
||||
actor->currentProcess = mfish_namazu_normal_process;
|
||||
}
|
||||
|
||||
void mfish_namazu_normal_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
@@ -85,7 +85,7 @@ void mfish_namazu_normal_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
|
||||
if (actor->_5E8 < 0.01f) {
|
||||
mfish_namazu_dummy_process_init(actor);
|
||||
} else if (actor->_5E8 > 1.0f && actor->_62E & 0x1e) {
|
||||
} else if (actor->_5E8 > 1.0f && actor->_62E_flags & 0x1e) {
|
||||
if ((s16)(actor->_60C.y - actor->_62C) > 0) {
|
||||
actor->_612.y = actor->_62C + DEG2SHORT_ANGLE(112.5f);
|
||||
} else {
|
||||
@@ -98,7 +98,7 @@ void mfish_namazu_normal_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
void mfish_namazu_dummy_process_init(MUSEUM_FISH_PRIVATE_DATA* actor) {
|
||||
actor->_634 = mfish_get_hide_camera_angle(actor);
|
||||
add_calc_short_angle2(&actor->_634, actor->_612.y, CALC_EASE(0.5f), DEG2SHORT_ANGLE(10), DEG2SHORT_ANGLE(0.5f));
|
||||
actor->_34 = mfish_namazu_dummy_process;
|
||||
actor->currentProcess = mfish_namazu_dummy_process;
|
||||
}
|
||||
|
||||
void mfish_namazu_dummy_process(MUSEUM_FISH_PRIVATE_DATA* actor) {
|
||||
@@ -116,31 +116,31 @@ void mfish_namazu_turn_process_init(MUSEUM_FISH_PRIVATE_DATA* actor) {
|
||||
s16 angle = DEG2SHORT_ANGLE(RANDOM_F(60.0f)) + DEG2SHORT_ANGLE(30);
|
||||
actor->_618.y = DEG2SHORT_ANGLE(0.5f + SHORT2DEG_ANGLE2(angle) / 90.f);
|
||||
|
||||
if (actor->_62E & 0x1e) {
|
||||
if (actor->_62E_flags & 0x1e) {
|
||||
if ((s16)(actor->_60C.y - actor->_62C) < 0) {
|
||||
angle = -angle;
|
||||
}
|
||||
} else if (actor->_62E & 0xc0) {
|
||||
if (actor->_62E & 0x40) {
|
||||
} else if (actor->_62E_flags & 0xc0) {
|
||||
if (actor->_62E_flags & 0x40) {
|
||||
angle = ABS(angle);
|
||||
} else {
|
||||
angle = -ABS(angle);
|
||||
}
|
||||
} else if (actor->_62E & 0x20) {
|
||||
} else if (actor->_62E_flags & 0x20) {
|
||||
if ((s16)(actor->_62A - actor->_60C.y) < 0) {
|
||||
angle = -angle;
|
||||
}
|
||||
}
|
||||
|
||||
if (angle > 0) {
|
||||
actor->_62E |= 0x40;
|
||||
actor->_62E_flags |= 0x40;
|
||||
} else {
|
||||
actor->_62E |= 0x80;
|
||||
actor->_62E_flags |= 0x80;
|
||||
}
|
||||
|
||||
actor->_612.y += angle;
|
||||
actor->_5F0 = 0.06f;
|
||||
actor->_34 = mfish_namazu_turn_process;
|
||||
actor->currentProcess = mfish_namazu_turn_process;
|
||||
}
|
||||
|
||||
void mfish_namazu_turn_process(MUSEUM_FISH_PRIVATE_DATA* actor) {
|
||||
@@ -180,8 +180,8 @@ void mfish_namazu_ground_sweep_process_init(MUSEUM_FISH_PRIVATE_DATA* actor) {
|
||||
} else {
|
||||
actor->_636 = DEG2SHORT_ANGLE(-180);
|
||||
}
|
||||
actor->_62E &= ~0xc0;
|
||||
actor->_34 = mfish_namazu_ground_sweep_process;
|
||||
actor->_62E_flags &= ~0xc0;
|
||||
actor->currentProcess = mfish_namazu_ground_sweep_process;
|
||||
}
|
||||
|
||||
void mfish_namazu_ground_sweep_process(MUSEUM_FISH_PRIVATE_DATA* actor) {
|
||||
@@ -199,7 +199,7 @@ void mfish_namazu_ground_sweep_process(MUSEUM_FISH_PRIVATE_DATA* actor) {
|
||||
|
||||
if (actor->_5E8 < 0.01f) {
|
||||
mfish_namazu_dummy_process_init(actor);
|
||||
} else if (actor->_5E8 > 1.0f && actor->_62E & 0x1e) {
|
||||
} else if (actor->_5E8 > 1.0f && actor->_62E_flags & 0x1e) {
|
||||
if ((s16)(actor->_612.y - actor->_62C) > 0) {
|
||||
actor->_612.y = actor->_62C + DEG2SHORT_ANGLE(112.5f);
|
||||
} else {
|
||||
@@ -213,25 +213,26 @@ void mfish_namazu_base_FishMove(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
actor->_5D0.x = actor->_5E8 * sin_s(actor->_60C.y);
|
||||
actor->_5D0.z = actor->_5E8 * cos_s(actor->_60C.y);
|
||||
add_calc(&actor->_5D0.y, MAX(ABS(sin_s(actor->_60C.x) * actor->_5E8), 0.1f), 0.1f, 0.1f, 0.005f);
|
||||
add_calc2(&actor->_5A0.y, actor->_5F4 + actor->init_data._0C, 0.1f, actor->_5D0.y);
|
||||
add_calc2(&actor->position.y, actor->_5F4 + actor->init_data._0C, 0.1f, actor->_5D0.y);
|
||||
mfish_move_smooth(actor, gamex);
|
||||
actor->_5A0.x += actor->_5D0.x;
|
||||
actor->_5A0.z += actor->_5D0.z;
|
||||
actor->_5A0.y = MAX(60.f, MIN(110.f, actor->_5A0.y));
|
||||
actor->position.x += actor->_5D0.x;
|
||||
actor->position.z += actor->_5D0.z;
|
||||
actor->position.y = MAX(60.f, MIN(110.f, actor->position.y));
|
||||
}
|
||||
|
||||
void mfish_namazu_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
xyz_t p = suisou_pos[actor->_630];
|
||||
xyz_t p = suisou_pos[actor->group];
|
||||
f32 v;
|
||||
int s;
|
||||
mfish_onefish_mv(actor, gamex);
|
||||
if (actor->_5F8 > actor->init_data._08 * 10.0f) {
|
||||
actor->_5F8 = 0.0f;
|
||||
actor->_626 = 0;
|
||||
actor->activityFrameCount = 0;
|
||||
}
|
||||
if (actor->_626-- <= 0) {
|
||||
actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E);
|
||||
actor->_628 = actor->_626;
|
||||
if (actor->activityFrameCount-- <= 0) {
|
||||
actor->activityFrameCount =
|
||||
actor->init_data.activeFramesMin + (s16)RANDOM_F(actor->init_data.activeFramesRange);
|
||||
actor->savedActivityFrameCount = actor->activityFrameCount;
|
||||
if (actor->_644 <= 0 && RANDOM_F(1.0f) < 0.2f) {
|
||||
actor->_644 = (s16)RANDOM_F(300.f) + 300;
|
||||
mfish_namazu_ground_sweep_process_init(actor);
|
||||
@@ -240,18 +241,19 @@ void mfish_namazu_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
} else {
|
||||
mfish_namazu_normal_process_init(actor);
|
||||
}
|
||||
} else if (actor->_34 == mfish_namazu_normal_process) {
|
||||
if ((actor->_62E & 0x1e && ABS((s16)(actor->_62C - actor->_60C.y)) < DEG2SHORT_ANGLE(45)) ||
|
||||
(actor->_62E & 0x20 &&
|
||||
} else if (actor->currentProcess == mfish_namazu_normal_process) {
|
||||
if ((actor->_62E_flags & 0x1e && ABS((s16)(actor->_62C - actor->_60C.y)) < DEG2SHORT_ANGLE(45)) ||
|
||||
(actor->_62E_flags & 0x20 &&
|
||||
ABS((s16)(actor->_62A + DEG2SHORT_ANGLE(180) - actor->_60C.y)) < DEG2SHORT_ANGLE(30))) {
|
||||
actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E);
|
||||
actor->_628 = actor->_626;
|
||||
actor->activityFrameCount =
|
||||
actor->init_data.activeFramesMin + (s16)RANDOM_F(actor->init_data.activeFramesRange);
|
||||
actor->savedActivityFrameCount = actor->activityFrameCount;
|
||||
mfish_namazu_turn_process_init(actor);
|
||||
}
|
||||
}
|
||||
|
||||
actor->_638 += DEG2SHORT_ANGLE(10);
|
||||
actor->_34(actor, gamex);
|
||||
actor->currentProcess(actor, gamex);
|
||||
if (ABS(actor->_618.z) > DEG2SHORT_ANGLE(20) && ABS(actor->_622 - actor->_618.z) < DEG2SHORT_ANGLE(30)) {
|
||||
add_calc2(&actor->_5E8, 0.2f + 0.01f * GETREG(TAKREG, 0x2d), 0.25f + 0.01f * GETREG(TAKREG, 0x2e),
|
||||
0.05f + 0.01f * GETREG(TAKREG, 0x2f));
|
||||
@@ -274,9 +276,9 @@ void mfish_namazu_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
actor->_38._00.frame_control.speed = (actor->_5E8 * 0.75f) / (actor->init_data._10 + actor->init_data._14) + 0.125f;
|
||||
mfish_namazu_base_FishMove(actor, gamex);
|
||||
Museum_Fish_BGCheck(actor, gamex);
|
||||
xyz_t_sub(&p, &actor->_5A0, &p);
|
||||
xyz_t_sub(&p, &actor->position, &p);
|
||||
v = 60.f + MAX(ABS(p.x), ABS(p.z)) * -0.15f;
|
||||
actor->_5A0.y = v + actor->init_data._04;
|
||||
actor->position.y = v + actor->init_data._04;
|
||||
mfish_namazu_body_wind_anime_play(actor, gamex);
|
||||
}
|
||||
|
||||
@@ -314,10 +316,10 @@ void mfish_namazu_dw(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
mtxp = &skele->_2b0;
|
||||
}
|
||||
OPEN_DISP(gamex->graph);
|
||||
Matrix_translate(actor->_5A0.x, actor->_5A0.y, actor->_5A0.z, 0);
|
||||
Matrix_translate(actor->position.x, actor->position.y, actor->position.z, 0);
|
||||
Matrix_rotateXYZ(actor->_60C.x, actor->_60C.y, actor->_60C.z, 1);
|
||||
Matrix_translate(0.0f, 0.0f, actor->init_data._24, 1);
|
||||
Matrix_scale(actor->init_data._00, actor->init_data._00, actor->init_data._00, 1);
|
||||
Matrix_scale(actor->init_data.renderScale, actor->init_data.renderScale, actor->init_data.renderScale, 1);
|
||||
gSPMatrix(NEXT_POLY_OPA_DISP, _Matrix_to_Mtx_new(gamex->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
cKF_Si3_draw_R_SV(gamex, &skele->_00, mtxp, mfish_namazu_before_disp, NULL, actor);
|
||||
CLOSE_DISP(gamex->graph);
|
||||
|
||||
@@ -11,8 +11,8 @@ void mfish_seafish_ct(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) {
|
||||
actor->_5AC = ZeroVec;
|
||||
actor->_638 = qrand();
|
||||
actor->_622 = 0;
|
||||
actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E);
|
||||
actor->_628 = actor->_626;
|
||||
actor->activityFrameCount = actor->init_data.activeFramesMin + (s16)RANDOM_F(actor->init_data.activeFramesRange);
|
||||
actor->savedActivityFrameCount = actor->activityFrameCount;
|
||||
actor->_624 = 2;
|
||||
actor->_594 = NULL;
|
||||
actor->_598 = NULL;
|
||||
@@ -23,11 +23,11 @@ void mfish_seafish_ct(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) {
|
||||
}
|
||||
|
||||
void mfish_seafish_normal_init(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E);
|
||||
actor->_628 = actor->_626;
|
||||
actor->activityFrameCount = actor->init_data.activeFramesMin + (s16)RANDOM_F(actor->init_data.activeFramesRange);
|
||||
actor->savedActivityFrameCount = actor->activityFrameCount;
|
||||
actor->_5F0 = actor->init_data._10 + RANDOM_F(actor->init_data._14);
|
||||
actor->_5EC = Rnd_EX_f(0.15f) + 0.15f;
|
||||
actor->_34 = mfish_seafish_normal;
|
||||
actor->currentProcess = mfish_seafish_normal;
|
||||
}
|
||||
|
||||
void mfish_seafish_normal(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
@@ -44,36 +44,36 @@ void mfish_seafish_normal(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
(s16)DEG2SHORT_ANGLE(0.25f));
|
||||
add_calc_short_angle2(&actor->_618.z, actor->_622, CALC_EASE2(0.3f), DEG2SHORT_ANGLE(2.5f), DEG2SHORT_ANGLE(0.25f));
|
||||
if (actor->_598 != NULL) {
|
||||
o_5a0_z = actor->_598->_5A0.z;
|
||||
o_5a0_y = actor->_598->_5A0.y;
|
||||
o_5a0_z = actor->_598->position.z;
|
||||
o_5a0_y = actor->_598->position.y;
|
||||
sum_i_8 = (actor->_598->init_data._08 + actor->init_data._08);
|
||||
abs_diff_sum = MAX(sum_i_8 - ABS(actor->_598->_5A0.z - actor->_5A0.z), 0.f);
|
||||
abs_diff_sum = MAX(sum_i_8 - ABS(actor->_598->position.z - actor->position.z), 0.f);
|
||||
|
||||
abs_diff_sum /= sum_i_8;
|
||||
|
||||
if (actor->_598->_59C != 0x23) {
|
||||
f32 this_5a0_y = actor->_5A0.y;
|
||||
if (o_5a0_y < actor->_5A0.y) {
|
||||
if (actor->_598->fishIDEnum != aGYO_TYPE_JELLYFISH) {
|
||||
f32 this_5a0_y = actor->position.y;
|
||||
if (o_5a0_y < actor->position.y) {
|
||||
t = o_5a0_y + (actor->_598->init_data._04 + actor->init_data._04);
|
||||
if (this_5a0_y < t) {
|
||||
add_calc2(&actor->_5A0.y, t + 2.0f, 0.2f, abs_diff_sum * 0.1f);
|
||||
add_calc2(&actor->position.y, t + 2.0f, 0.2f, abs_diff_sum * 0.1f);
|
||||
}
|
||||
} else {
|
||||
t = o_5a0_y - (actor->_598->init_data._04 + actor->init_data._04);
|
||||
if (this_5a0_y > t) {
|
||||
add_calc2(&actor->_5A0.y, t - 2.0f, 0.2f, abs_diff_sum * 0.1f);
|
||||
add_calc2(&actor->position.y, t - 2.0f, 0.2f, abs_diff_sum * 0.1f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (actor->_598->_5A0.z < actor->_5A0.z) {
|
||||
if (actor->_598->position.z < actor->position.z) {
|
||||
// swap here
|
||||
o_5a0_z += sum_i_8;
|
||||
add_calc2(&actor->_5A0.z, o_5a0_z, 0.1f, abs_diff_sum * 0.1f);
|
||||
add_calc2(&actor->position.z, o_5a0_z, 0.1f, abs_diff_sum * 0.1f);
|
||||
} else {
|
||||
// swap here
|
||||
o_5a0_z -= sum_i_8;
|
||||
add_calc2(&actor->_5A0.z, o_5a0_z, 0.1f, abs_diff_sum * 0.1f);
|
||||
add_calc2(&actor->position.z, o_5a0_z, 0.1f, abs_diff_sum * 0.1f);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,8 +105,8 @@ void mfish_seafish_normal(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
add_calc_short_angle2(&actor->_612.y, DEG2SHORT_ANGLE(-90), CALC_EASE(0.5f), DEG2SHORT_ANGLE(7.5f),
|
||||
DEG2SHORT_ANGLE(0.5f));
|
||||
}
|
||||
} else if (actor->_62E & 0x100) {
|
||||
actor->_5A0.z += 0.05f;
|
||||
} else if (actor->_62E_flags & 0x100) {
|
||||
actor->position.z += 0.05f;
|
||||
if (ABS((s16)(actor->_612.y - DEG2SHORT_ANGLE(180))) < DEG2SHORT_ANGLE(110)) {
|
||||
if (actor->_612.y > 0) {
|
||||
actor->_612.y -= DEG2SHORT_ANGLE(1.5f);
|
||||
@@ -114,15 +114,15 @@ void mfish_seafish_normal(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
actor->_612.y += DEG2SHORT_ANGLE(1.5f);
|
||||
}
|
||||
}
|
||||
} else if (actor->_62E & 0x1e) {
|
||||
} else if (actor->_62E_flags & 0x1e) {
|
||||
mfish_seafish_turn_init(actor, gamex);
|
||||
} else if (actor->_62E & 0x20 && actor->_5F8 > actor->init_data._08 * 0.5f) {
|
||||
} else if (actor->_62E_flags & 0x20 && actor->_5F8 > actor->init_data._08 * 0.5f) {
|
||||
if (actor->init_data._20 > actor->_594->init_data._20) {
|
||||
s16 escAngle = mfish_get_escape_angle(actor, gamex);
|
||||
add_calc_short_angle2(&actor->_612.y, escAngle, CALC_EASE(0.25f), DEG2SHORT_ANGLE(2.5f),
|
||||
DEG2SHORT_ANGLE(0));
|
||||
}
|
||||
} else if (actor->_626 < 0) {
|
||||
} else if (actor->activityFrameCount < 0) {
|
||||
// r in wrong register here
|
||||
r = RANDOM_F(1.0f);
|
||||
actor->_612.y = actor->_60C.y;
|
||||
@@ -131,8 +131,9 @@ void mfish_seafish_normal(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
} else {
|
||||
actor->_612.y -= (s16)(r * actor->init_data._30);
|
||||
}
|
||||
actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E);
|
||||
actor->_628 = actor->_626;
|
||||
actor->activityFrameCount =
|
||||
actor->init_data.activeFramesMin + (s16)RANDOM_F(actor->init_data.activeFramesRange);
|
||||
actor->savedActivityFrameCount = actor->activityFrameCount;
|
||||
actor->_5F0 = actor->init_data._10 + Rnd_EX_f(actor->init_data._14);
|
||||
}
|
||||
}
|
||||
@@ -148,13 +149,13 @@ void mfish_seafish_turn_init(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) {
|
||||
}
|
||||
|
||||
if ((s16)(actor->_60C.y - s) > 0) {
|
||||
if (actor->_62E & 6) {
|
||||
if (actor->_62E_flags & 6) {
|
||||
s = s + DEG2SHORT_ANGLE(170);
|
||||
} else {
|
||||
s = s + DEG2SHORT_ANGLE(95);
|
||||
}
|
||||
} else {
|
||||
if (actor->_62E & 6) {
|
||||
if (actor->_62E_flags & 6) {
|
||||
s = s - DEG2SHORT_ANGLE(170);
|
||||
} else {
|
||||
s = s - DEG2SHORT_ANGLE(95);
|
||||
@@ -162,7 +163,7 @@ void mfish_seafish_turn_init(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) {
|
||||
}
|
||||
|
||||
if (ABS((s16)(s - actor->_612.y)) > DEG2SHORT_ANGLE(45)) {
|
||||
actor->_34 = mfish_seafish_turn;
|
||||
actor->currentProcess = mfish_seafish_turn;
|
||||
}
|
||||
actor->_612.y = s;
|
||||
}
|
||||
@@ -180,19 +181,19 @@ void mfish_seafish_turn(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) {
|
||||
void mfish_seafish_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
//! NOTE: wrong floats in this file, based on objdiff
|
||||
xyz_t p;
|
||||
actor->_34(actor, gamex);
|
||||
actor->currentProcess(actor, gamex);
|
||||
actor->_618.x += DEG2SHORT_ANGLE(actor->_5E8 * RANDOM_F(3.0f));
|
||||
actor->_5F4 = sin_s(actor->_618.x) * 5.0f;
|
||||
if (actor->_62E & 0x20) {
|
||||
add_calc2(&actor->_5A0.y, actor->_5F4 + actor->init_data._0C, 0.02f, 0.05f);
|
||||
if (actor->_62E_flags & 0x20) {
|
||||
add_calc2(&actor->position.y, actor->_5F4 + actor->init_data._0C, 0.02f, 0.05f);
|
||||
} else {
|
||||
add_calc2(&actor->_5A0.y, actor->_5F4 + actor->init_data._0C, 0.1f, 0.1f);
|
||||
add_calc2(&actor->position.y, actor->_5F4 + actor->init_data._0C, 0.1f, 0.1f);
|
||||
}
|
||||
add_calc0(&actor->_5F8, 0.25f, 0.05f);
|
||||
actor->_5F8 = MIN(1.0f, actor->_5F8);
|
||||
if (ABS(actor->_618.z) > DEG2SHORT_ANGLE(15) && ABS(actor->_622) - ABS(actor->_618.z) < 0) {
|
||||
add_calc2(&actor->_5E8, MAX(actor->_5F0, 0.8f), 0.5f, 0.25f);
|
||||
} else if (actor->_626 < actor->_628 - 80) {
|
||||
} else if (actor->activityFrameCount < actor->savedActivityFrameCount - 80) {
|
||||
add_calc2(&actor->_5E8, actor->_5EC, 1.0f - actor->init_data._18, 0.0025f);
|
||||
} else if (actor->_5E8 > actor->_5F0) {
|
||||
add_calc2(&actor->_5E8, actor->_5F0, 0.1f, 0.01f);
|
||||
@@ -204,15 +205,15 @@ void mfish_seafish_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
actor->_5D0.x = actor->_5E8 * sin_s(actor->_60C.y);
|
||||
actor->_5D0.z = actor->_5E8 * cos_s(actor->_60C.y);
|
||||
mfish_get_flow_vec(&p, actor, gamex);
|
||||
actor->_5A0.x += actor->_5D0.x + p.x;
|
||||
actor->_5A0.z += actor->_5D0.z + p.z;
|
||||
actor->position.x += actor->_5D0.x + p.x;
|
||||
actor->position.z += actor->_5D0.z + p.z;
|
||||
mfish_onefish_mv(actor, gamex);
|
||||
mfish_body_wind_anime_play(actor, gamex);
|
||||
Museum_Fish_BGCheck(actor, gamex);
|
||||
if (actor->_5A0.y < GETREG(TAKREG, 0x47) + 55.0f - actor->init_data._04) {
|
||||
actor->_5A0.y = GETREG(TAKREG, 0x47) + 55.0f - actor->init_data._04;
|
||||
if (actor->position.y < GETREG(TAKREG, 0x47) + 55.0f - actor->init_data._04) {
|
||||
actor->position.y = GETREG(TAKREG, 0x47) + 55.0f - actor->init_data._04;
|
||||
}
|
||||
actor->_626--;
|
||||
actor->activityFrameCount--;
|
||||
}
|
||||
|
||||
BOOL mfish_seafish_before_disp(GAME* game, cKF_SkeletonInfo_R_c* keyframe, int joint_num, Gfx** joint_m, u8* joint_f,
|
||||
@@ -241,10 +242,10 @@ void mfish_seafish_dw(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
mtxp = &skele->_2b0;
|
||||
}
|
||||
OPEN_DISP(gamex->graph);
|
||||
Matrix_translate(actor->_5A0.x, actor->_5A0.y, actor->_5A0.z, 0);
|
||||
Matrix_translate(actor->position.x, actor->position.y, actor->position.z, 0);
|
||||
Matrix_rotateXYZ(actor->_60C.x, actor->_60C.y, actor->_60C.z, 1);
|
||||
Matrix_translate(0.0f, 0.0f, actor->init_data._24, 1);
|
||||
Matrix_scale(actor->init_data._00, actor->init_data._00, actor->init_data._00, 1);
|
||||
Matrix_scale(actor->init_data.renderScale, actor->init_data.renderScale, actor->init_data.renderScale, 1);
|
||||
gSPMatrix(NEXT_POLY_OPA_DISP, _Matrix_to_Mtx_new(gamex->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
cKF_Si3_draw_R_SV(gamex, &skele->_00, mtxp, mfish_seafish_before_disp, NULL, actor);
|
||||
CLOSE_DISP(gamex->graph);
|
||||
|
||||
@@ -13,20 +13,20 @@ void mfish_small_fish_ct(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
actor->_5AC = ZeroVec;
|
||||
actor->_638 = qrand();
|
||||
actor->_622 = 0;
|
||||
actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E);
|
||||
actor->activityFrameCount = actor->init_data.activeFramesMin + (s16)RANDOM_F(actor->init_data.activeFramesRange);
|
||||
actor->_624 = 6;
|
||||
mfish_sfish_normal_init(actor, gamex);
|
||||
}
|
||||
|
||||
void mfish_sfish_normal_init(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
if (actor->_630 == 2) {
|
||||
if (actor->_626 < 0) {
|
||||
if (actor->group == 2) {
|
||||
if (actor->activityFrameCount < 0) {
|
||||
actor->_5F0 = actor->init_data._10 + Rnd_EX_f(actor->init_data._14);
|
||||
}
|
||||
} else {
|
||||
actor->_5F0 = RANDOM_F(actor->init_data._14) + actor->init_data._10;
|
||||
}
|
||||
actor->_34 = mfish_sfish_normal;
|
||||
actor->currentProcess = mfish_sfish_normal;
|
||||
}
|
||||
|
||||
void mfish_sfish_normal(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
@@ -36,19 +36,20 @@ void mfish_sfish_normal(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
CALC_EASE2(GETREG(TAKREG, 0x17) * 0.01f + 0.5f), DEG2SHORT_ANGLE(7.5f),
|
||||
DEG2SHORT_ANGLE(0.25f));
|
||||
add_calc_short_angle2(&actor->_618.z, actor->_622, CALC_EASE2(0.3f), DEG2SHORT_ANGLE(5), DEG2SHORT_ANGLE(0.25f));
|
||||
if (actor->_62E & 0x1e) {
|
||||
if (actor->_62E_flags & 0x1e) {
|
||||
mfish_sfish_turn_init(actor, gamex);
|
||||
} else if (actor->_62E & 0x20) {
|
||||
} else if (actor->_62E_flags & 0x20) {
|
||||
add_calc_short_angle2(&actor->_612.y, mfish_get_escape_angle(actor, gamex), CALC_EASE(0.5f),
|
||||
DEG2SHORT_ANGLE(15), DEG2SHORT_ANGLE(0.5f));
|
||||
} else if (actor->_626 < 0) {
|
||||
} else if (actor->activityFrameCount < 0) {
|
||||
f32 v = RANDOM_F(1.0f);
|
||||
actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E);
|
||||
actor->_628 = actor->_626;
|
||||
actor->activityFrameCount =
|
||||
actor->init_data.activeFramesMin + (s16)RANDOM_F(actor->init_data.activeFramesRange);
|
||||
actor->savedActivityFrameCount = actor->activityFrameCount;
|
||||
actor->_5F0 = actor->init_data._10 + Rnd_EX_f(actor->init_data._14);
|
||||
if (actor->_630 == 2 && actor->_5F0 < actor->init_data._10 + actor->init_data._14 * 0.5f) {
|
||||
if (actor->group == 2 && actor->_5F0 < actor->init_data._10 + actor->init_data._14 * 0.5f) {
|
||||
actor->_612.y = atans_table(-actor->_5DC.z, -actor->_5DC.x);
|
||||
actor->_626 *= 5;
|
||||
actor->activityFrameCount *= 5;
|
||||
}
|
||||
|
||||
if (RANDOM_F(1.0f) < 0.5f) {
|
||||
@@ -64,12 +65,13 @@ void mfish_sfish_normal(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
s16 s;
|
||||
//! BUG: unused?
|
||||
RANDOM_F(1.0f);
|
||||
s = search_position_angleY(&suisou_pos[actor->_630], &actor->_5A0);
|
||||
s = search_position_angleY(&suisou_pos[actor->group], &actor->position);
|
||||
actor->_5F8 = 0.0f;
|
||||
actor->_612.y = s + DEG2SHORT_ANGLE(RANDOM2_F(90.0));
|
||||
actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E);
|
||||
actor->_626 >>= 1;
|
||||
actor->_628 = actor->_626;
|
||||
actor->activityFrameCount =
|
||||
actor->init_data.activeFramesMin + (s16)RANDOM_F(actor->init_data.activeFramesRange);
|
||||
actor->activityFrameCount >>= 1;
|
||||
actor->savedActivityFrameCount = actor->activityFrameCount;
|
||||
actor->_5F0 = actor->init_data._14 + actor->init_data._10;
|
||||
}
|
||||
}
|
||||
@@ -81,14 +83,14 @@ void mfish_sfish_turn_init(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
actor->_612.y = actor->_62C - DEG2SHORT_ANGLE(115);
|
||||
}
|
||||
|
||||
if (actor->_630 == 2) {
|
||||
if (actor->group == 2) {
|
||||
if (actor->_5F0 < 0.0f) {
|
||||
actor->_5F0 = actor->init_data._10 + MAX(-actor->init_data._10, RANDOM_F(actor->init_data._14));
|
||||
}
|
||||
} else {
|
||||
actor->_5F0 = actor->init_data._14 + actor->init_data._10;
|
||||
}
|
||||
actor->_34 = mfish_sfish_turn;
|
||||
actor->currentProcess = mfish_sfish_turn;
|
||||
}
|
||||
|
||||
void mfish_sfish_turn(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
@@ -107,7 +109,7 @@ void mfish_small_fish_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
f32 v;
|
||||
xyz_t p;
|
||||
int s;
|
||||
actor->_34(actor, gamex);
|
||||
actor->currentProcess(actor, gamex);
|
||||
actor->_61E = add_calc_short_angle2(&actor->_60C.x, actor->_612.x, CALC_EASE2(0.2f), DEG2SHORT_ANGLE(1.75f),
|
||||
DEG2SHORT_ANGLE(0.25f));
|
||||
add_calc_short_angle2(&actor->_618.x, actor->_61E, CALC_EASE2(0.3f), DEG2SHORT_ANGLE(1.25f),
|
||||
@@ -131,30 +133,30 @@ void mfish_small_fish_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
actor->_5D0.z = v * cos_s(actor->_60C.y);
|
||||
actor->_5D0.y = -actor->_5E8 * sin_s(actor->_60C.x);
|
||||
mfish_get_flow_vec(&p, actor, gamex);
|
||||
actor->_5A0.x += actor->_5D0.x + p.x;
|
||||
actor->_5A0.y += actor->_5D0.y + p.y;
|
||||
actor->_5A0.z += actor->_5D0.z + p.z;
|
||||
actor->position.x += actor->_5D0.x + p.x;
|
||||
actor->position.y += actor->_5D0.y + p.y;
|
||||
actor->position.z += actor->_5D0.z + p.z;
|
||||
mfish_onefish_mv(actor, gamex);
|
||||
if (actor->_630 == 2) {
|
||||
if (actor->group == 2) {
|
||||
actor->_38._00.frame_control.speed = actor->_5E8 * 2.0f + 1.0f;
|
||||
} else {
|
||||
add_calc2(&actor->_38._00.frame_control.speed, actor->_5E8 * 2.0f + 0.5f, 0.2f, 0.1f);
|
||||
}
|
||||
|
||||
actor->_5B8 = actor->_5A0;
|
||||
actor->_5B8 = actor->position;
|
||||
Museum_Fish_BGCheck(actor, gamex);
|
||||
|
||||
if (actor->_5A0.y < 55.0f + actor->init_data._08) {
|
||||
actor->_5A0.y = 55.0f + actor->init_data._08;
|
||||
if (actor->position.y < 55.0f + actor->init_data._08) {
|
||||
actor->position.y = 55.0f + actor->init_data._08;
|
||||
if (actor->_612.x > 0) {
|
||||
actor->_612.x = DEG2SHORT_ANGLE(-30);
|
||||
}
|
||||
} else if (actor->_5A0.y > 115.0f - actor->init_data._08) {
|
||||
actor->_5A0.y = 115.0f - actor->init_data._08;
|
||||
} else if (actor->position.y > 115.0f - actor->init_data._08) {
|
||||
actor->position.y = 115.0f - actor->init_data._08;
|
||||
mfish_hamon_make(actor, gamex);
|
||||
actor->_612.x = DEG2SHORT_ANGLE(30);
|
||||
} else {
|
||||
actor->_626--;
|
||||
actor->activityFrameCount--;
|
||||
}
|
||||
|
||||
actor->_612.x = MAX((s16)-actor->init_data._30, MIN(actor->init_data._30, actor->_612.x));
|
||||
@@ -188,12 +190,12 @@ void mfish_small_fish_dw(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
}
|
||||
v = actor->_60C.x * 0.7f;
|
||||
OPEN_DISP(gamex->graph);
|
||||
Matrix_translate(actor->_5A0.x, actor->_5A0.y, actor->_5A0.z, 0);
|
||||
Matrix_translate(actor->position.x, actor->position.y, actor->position.z, 0);
|
||||
Matrix_RotateY(actor->_60C.y, 1);
|
||||
Matrix_translate(0.0f, 0.0f, actor->init_data._24 * 1.5f, 1);
|
||||
Matrix_RotateX(v, 1);
|
||||
Matrix_translate(0.0f, 0.0f, -actor->init_data._24 * 0.5f, 1);
|
||||
Matrix_scale(actor->init_data._00, actor->init_data._00, actor->init_data._00, 1);
|
||||
Matrix_scale(actor->init_data.renderScale, actor->init_data.renderScale, actor->init_data.renderScale, 1);
|
||||
gSPMatrix(NEXT_POLY_OPA_DISP, _Matrix_to_Mtx_new(gamex->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
cKF_Si3_draw_R_SV(gamex, &skele->_00, mtxp, mfish_sfish_before_disp, NULL, actor);
|
||||
CLOSE_DISP(gamex->graph);
|
||||
|
||||
@@ -11,8 +11,8 @@ void mfish_tai_ct(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
actor->_5AC = ZeroVec;
|
||||
actor->_638 = qrand();
|
||||
actor->_622 = 0;
|
||||
actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E);
|
||||
actor->_628 = actor->_626;
|
||||
actor->activityFrameCount = actor->init_data.activeFramesMin + (s16)RANDOM_F(actor->init_data.activeFramesRange);
|
||||
actor->savedActivityFrameCount = actor->activityFrameCount;
|
||||
actor->_624 = 2;
|
||||
actor->_594 = NULL;
|
||||
actor->_598 = NULL;
|
||||
@@ -22,12 +22,13 @@ void mfish_tai_ct(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
}
|
||||
|
||||
void mfish_tai_normal_init(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
if (actor->_34 == mfish_tai_turn) {
|
||||
actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E);
|
||||
actor->_628 = actor->_626;
|
||||
if (actor->currentProcess == mfish_tai_turn) {
|
||||
actor->activityFrameCount =
|
||||
actor->init_data.activeFramesMin + (s16)RANDOM_F(actor->init_data.activeFramesRange);
|
||||
actor->savedActivityFrameCount = actor->activityFrameCount;
|
||||
actor->_5F0 = RANDOM_F(actor->init_data._14) + actor->init_data._10;
|
||||
}
|
||||
actor->_34 = mfish_tai_normal;
|
||||
actor->currentProcess = mfish_tai_normal;
|
||||
}
|
||||
|
||||
void mfish_tai_normal(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
@@ -43,28 +44,28 @@ void mfish_tai_normal(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
|
||||
if (actor->_598) {
|
||||
f32 d = (actor->_598->init_data._08 + actor->init_data._08);
|
||||
f32 o_y = actor->_598->_5A0.y;
|
||||
f32 o_z = actor->_598->_5A0.z;
|
||||
f32 v = MAX(d - ABS(actor->_598->_5A0.z - actor->_5A0.z), 0.0f);
|
||||
f32 o_y = actor->_598->position.y;
|
||||
f32 o_z = actor->_598->position.z;
|
||||
f32 v = MAX(d - ABS(actor->_598->position.z - actor->position.z), 0.0f);
|
||||
v = v / d;
|
||||
if (actor->_598->_59C != 0x23) {
|
||||
if (actor->_598->_5A0.y < actor->_5A0.y) {
|
||||
if (actor->_5A0.y < (o_y + (actor->_598->init_data._04 + actor->init_data._04))) {
|
||||
add_calc2(&actor->_5A0.y, (o_y + (actor->_598->init_data._04 + actor->init_data._04)) + 2.0f, 0.2f,
|
||||
v * 0.1f);
|
||||
if (actor->_598->fishIDEnum != aGYO_TYPE_JELLYFISH) {
|
||||
if (actor->_598->position.y < actor->position.y) {
|
||||
if (actor->position.y < (o_y + (actor->_598->init_data._04 + actor->init_data._04))) {
|
||||
add_calc2(&actor->position.y, (o_y + (actor->_598->init_data._04 + actor->init_data._04)) + 2.0f,
|
||||
0.2f, v * 0.1f);
|
||||
}
|
||||
} else {
|
||||
if (actor->_5A0.y > o_y - (actor->_598->init_data._04 + actor->init_data._04)) {
|
||||
add_calc2(&actor->_5A0.y, (o_y - (actor->_598->init_data._04 + actor->init_data._04)) - 2.0f, 0.2f,
|
||||
v * 0.1f);
|
||||
if (actor->position.y > o_y - (actor->_598->init_data._04 + actor->init_data._04)) {
|
||||
add_calc2(&actor->position.y, (o_y - (actor->_598->init_data._04 + actor->init_data._04)) - 2.0f,
|
||||
0.2f, v * 0.1f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (actor->_598->_5A0.z < actor->_5A0.z) {
|
||||
add_calc2(&actor->_5A0.z, o_z + d, 0.05f, v * 0.1f);
|
||||
if (actor->_598->position.z < actor->position.z) {
|
||||
add_calc2(&actor->position.z, o_z + d, 0.05f, v * 0.1f);
|
||||
} else {
|
||||
add_calc2(&actor->_5A0.z, o_z - d, 0.05f, v * 0.1f);
|
||||
add_calc2(&actor->position.z, o_z - d, 0.05f, v * 0.1f);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,8 +97,8 @@ void mfish_tai_normal(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
add_calc_short_angle2(&actor->_612.y, DEG2SHORT_ANGLE(-90), CALC_EASE(0.5f), DEG2SHORT_ANGLE(7.5f),
|
||||
DEG2SHORT_ANGLE(0.5f));
|
||||
}
|
||||
} else if (actor->_62E & 0x100) {
|
||||
actor->_5A0.z += 0.05f;
|
||||
} else if (actor->_62E_flags & 0x100) {
|
||||
actor->position.z += 0.05f;
|
||||
if (ABS((s16)(actor->_612.y - DEG2SHORT_ANGLE(180))) < DEG2SHORT_ANGLE(110)) {
|
||||
if (actor->_612.y > DEG2SHORT_ANGLE(0)) {
|
||||
actor->_612.y -= DEG2SHORT_ANGLE(1.5f);
|
||||
@@ -105,15 +106,15 @@ void mfish_tai_normal(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
actor->_612.y += DEG2SHORT_ANGLE(1.5f);
|
||||
}
|
||||
}
|
||||
} else if (actor->_62E & 0x1e) {
|
||||
} else if (actor->_62E_flags & 0x1e) {
|
||||
mfish_tai_turn_init(actor, gamex);
|
||||
} else if (actor->_62E & 0x20 && actor->_5F8 > actor->init_data._08 * 0.5f) {
|
||||
} else if (actor->_62E_flags & 0x20 && actor->_5F8 > actor->init_data._08 * 0.5f) {
|
||||
if (actor->init_data._20 < actor->_594->init_data._20) {
|
||||
s16 escAngle = mfish_get_escape_angle(actor, gamex);
|
||||
add_calc_short_angle2(&actor->_612.y, escAngle, CALC_EASE(0.25f), DEG2SHORT_ANGLE(2.5f),
|
||||
DEG2SHORT_ANGLE(0));
|
||||
}
|
||||
} else if (actor->_626 < 0) {
|
||||
} else if (actor->activityFrameCount < 0) {
|
||||
f32 f = RANDOM_F(1.0f);
|
||||
actor->_612.y = actor->_60C.y;
|
||||
if (RANDOM_F(1.0f) < GETREG(TAKREG, 0x1c) * 0.1f + 0.1f) {
|
||||
@@ -137,8 +138,9 @@ void mfish_tai_normal(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
actor->_612.y -= (s16)(f * actor->init_data._30);
|
||||
}
|
||||
}
|
||||
actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E);
|
||||
actor->_628 = actor->_626;
|
||||
actor->activityFrameCount =
|
||||
actor->init_data.activeFramesMin + (s16)RANDOM_F(actor->init_data.activeFramesRange);
|
||||
actor->savedActivityFrameCount = actor->activityFrameCount;
|
||||
actor->_5F0 = actor->init_data._10 + Rnd_EX_f(actor->init_data._14);
|
||||
}
|
||||
}
|
||||
@@ -151,13 +153,13 @@ void mfish_tai_turn_init(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
}
|
||||
|
||||
if ((s16)(actor->_60C.y - b) > 0) {
|
||||
if (actor->_62E & 6) {
|
||||
if (actor->_62E_flags & 6) {
|
||||
b = b + DEG2SHORT_ANGLE(170);
|
||||
} else {
|
||||
b = b + DEG2SHORT_ANGLE(95);
|
||||
}
|
||||
} else {
|
||||
if (actor->_62E & 6) {
|
||||
if (actor->_62E_flags & 6) {
|
||||
b = b - DEG2SHORT_ANGLE(170);
|
||||
} else {
|
||||
b = b - DEG2SHORT_ANGLE(95);
|
||||
@@ -165,7 +167,7 @@ void mfish_tai_turn_init(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
}
|
||||
|
||||
if (ABS((s16)(b - actor->_612.y)) > DEG2SHORT_ANGLE(45)) {
|
||||
actor->_34 = mfish_tai_turn;
|
||||
actor->currentProcess = mfish_tai_turn;
|
||||
}
|
||||
|
||||
actor->_612.y = b;
|
||||
@@ -189,19 +191,19 @@ void mfish_tai_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
xyz_t p;
|
||||
f32 v;
|
||||
|
||||
actor->_34(actor, gamex);
|
||||
actor->currentProcess(actor, gamex);
|
||||
actor->_618.x += DEG2SHORT_ANGLE(RANDOM_F(3.0f) * actor->_5E8 + 0.1f);
|
||||
actor->_5F4 = sin_s(actor->_618.x) * 5.0f;
|
||||
if (actor->_62E & 0x20) {
|
||||
add_calc2(&actor->_5A0.y, actor->_5F4 + actor->init_data._0C, 0.02f, 0.05f);
|
||||
if (actor->_62E_flags & 0x20) {
|
||||
add_calc2(&actor->position.y, actor->_5F4 + actor->init_data._0C, 0.02f, 0.05f);
|
||||
} else {
|
||||
add_calc2(&actor->_5A0.y, actor->_5F4 + actor->init_data._0C, 0.1f, 0.125f);
|
||||
add_calc2(&actor->position.y, actor->_5F4 + actor->init_data._0C, 0.1f, 0.125f);
|
||||
}
|
||||
|
||||
if (ABS(actor->_622) > DEG2SHORT_ANGLE(20)) {
|
||||
add_calc_short_angle2(&actor->_632, MAX(DEG2SHORT_ANGLE2((GETREG(TAKREG, 0x27) + 5.0f) * actor->_5E8), 0),
|
||||
CALC_EASE(0.25f), DEG2SHORT_ANGLE(2.5f), DEG2SHORT_ANGLE(0.5f));
|
||||
} else if ((actor->_62E & 0x20) == 0) {
|
||||
} else if ((actor->_62E_flags & 0x20) == 0) {
|
||||
add_calc_short_angle2(&actor->_632, MAX(DEG2SHORT_ANGLE2((GETREG(TAKREG, 0x28) + 30.0f) * actor->_5E8), 0),
|
||||
CALC_EASE(0.25f), DEG2SHORT_ANGLE(5.0f), DEG2SHORT_ANGLE(0.5f));
|
||||
} else {
|
||||
@@ -225,8 +227,8 @@ void mfish_tai_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
|
||||
mfish_get_flow_vec(&p, actor, gamex);
|
||||
|
||||
actor->_5A0.x += actor->_5D0.x + p.x;
|
||||
actor->_5A0.z += actor->_5D0.z + p.z;
|
||||
actor->position.x += actor->_5D0.x + p.x;
|
||||
actor->position.z += actor->_5D0.z + p.z;
|
||||
|
||||
mfish_onefish_mv(actor, gamex);
|
||||
actor->_38._00.frame_control.speed =
|
||||
@@ -236,11 +238,11 @@ void mfish_tai_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
mfish_body_wind_anime_play(actor, gamex);
|
||||
Museum_Fish_BGCheck(actor, gamex);
|
||||
|
||||
if (actor->_5A0.y < (GETREG(TAKREG, 0x47) + 55.0f) - actor->init_data._04) {
|
||||
actor->_5A0.y = (GETREG(TAKREG, 0x47) + 55.0f) - actor->init_data._04;
|
||||
if (actor->position.y < (GETREG(TAKREG, 0x47) + 55.0f) - actor->init_data._04) {
|
||||
actor->position.y = (GETREG(TAKREG, 0x47) + 55.0f) - actor->init_data._04;
|
||||
}
|
||||
|
||||
actor->_626--;
|
||||
actor->activityFrameCount--;
|
||||
}
|
||||
|
||||
BOOL mfish_tai_before_disp(GAME* game, cKF_SkeletonInfo_R_c* keyframe, int joint_num, Gfx** joint_m, u8* joint_f,
|
||||
@@ -265,10 +267,10 @@ void mfish_tai_dw(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
mtxp = &skele->_2b0;
|
||||
}
|
||||
OPEN_DISP(gamex->graph);
|
||||
Matrix_translate(actor->_5A0.x, actor->_5A0.y, actor->_5A0.z, 0);
|
||||
Matrix_translate(actor->position.x, actor->position.y, actor->position.z, 0);
|
||||
Matrix_rotateXYZ(actor->_60C.x, actor->_60C.y, actor->_60C.z, 1);
|
||||
Matrix_translate(0.0f, 0.0f, actor->init_data._24, 1);
|
||||
Matrix_scale(actor->init_data._00, actor->init_data._00, actor->init_data._00, 1);
|
||||
Matrix_scale(actor->init_data.renderScale, actor->init_data.renderScale, actor->init_data.renderScale, 1);
|
||||
gSPMatrix(NEXT_POLY_OPA_DISP, _Matrix_to_Mtx_new(gamex->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
cKF_Si3_draw_R_SV(gamex, &skele->_00, mtxp, mfish_tai_before_disp, NULL, actor);
|
||||
CLOSE_DISP(gamex->graph);
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
void mfish_unagi_ct(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
mfish_onefish_ct(actor, gamex);
|
||||
actor->_624 = 8;
|
||||
actor->_5A0.x = 225.0f;
|
||||
actor->_5A0.y = 55.0f;
|
||||
actor->_5A0.z = 185.0f;
|
||||
actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E);
|
||||
actor->position.x = 225.0f;
|
||||
actor->position.y = 55.0f;
|
||||
actor->position.z = 185.0f;
|
||||
actor->activityFrameCount = actor->init_data.activeFramesMin + (s16)RANDOM_F(actor->init_data.activeFramesRange);
|
||||
actor->_640 = 0;
|
||||
actor->_642 = 1;
|
||||
actor->_5AC = ZeroVec;
|
||||
@@ -33,9 +33,9 @@ s16 mfish_unagi_get_next_rail_type(MUSEUM_FISH_PRIVATE_DATA* actor) {
|
||||
|
||||
void mfish_unagi_aim_wind_angle_calc(MUSEUM_FISH_PRIVATE_DATA* actor) {
|
||||
s16 s;
|
||||
if (actor->_34 == mfish_unagi_normal_to_reverse) {
|
||||
if (actor->currentProcess == mfish_unagi_normal_to_reverse) {
|
||||
s = 12;
|
||||
} else if (actor->_34 == mfish_unagi_reverse_to_normal) {
|
||||
} else if (actor->currentProcess == mfish_unagi_reverse_to_normal) {
|
||||
s = 19;
|
||||
} else {
|
||||
s = unagi_rail_num_tbl[actor->_646];
|
||||
@@ -52,12 +52,12 @@ void mfish_unagi_aim_wind_angle_calc(MUSEUM_FISH_PRIVATE_DATA* actor) {
|
||||
}
|
||||
|
||||
void mfish_unagi_rail_move_init(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
s16 target = search_position_angleY(&actor->_5A0, &unagi_rail_tbl[actor->_646][actor->_642]);
|
||||
s16 target = search_position_angleY(&actor->position, &unagi_rail_tbl[actor->_646][actor->_642]);
|
||||
actor->_640 = 0;
|
||||
actor->_642 = 1;
|
||||
add_calc_short_angle2(&actor->_612.y, target, CALC_EASE(GETREG(TAKREG, 0x24) * 0.01f + 0.5f),
|
||||
DEG2SHORT_ANGLE(GETREG(TAKREG, 0x25) + 5.0f) >> 1, DEG2SHORT_ANGLE(0.25f));
|
||||
actor->_34 = mfish_unagi_rail_move;
|
||||
actor->currentProcess = mfish_unagi_rail_move;
|
||||
}
|
||||
|
||||
void mfish_unagi_rail_move(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
@@ -69,8 +69,8 @@ void mfish_unagi_rail_move(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
if (v < 0.0f) {
|
||||
v = 0.0f;
|
||||
}
|
||||
v3 = search_position_distance(&actor->_5A0, &pp[actor->_642]);
|
||||
if ((f32)(__fabs(chase_xyz_t(&actor->_5A0, &pp[actor->_642], v2))) < 0.008f) {
|
||||
v3 = search_position_distance(&actor->position, &pp[actor->_642]);
|
||||
if ((f32)(__fabs(chase_xyz_t(&actor->position, &pp[actor->_642], v2))) < 0.008f) {
|
||||
if (actor->_640 < unagi_rail_num_tbl[actor->_646] - 1) {
|
||||
actor->_640++;
|
||||
} else {
|
||||
@@ -88,24 +88,24 @@ void mfish_unagi_rail_move(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
}
|
||||
v2 -= v3;
|
||||
if (v2 > 0.0f) {
|
||||
chase_xyz_t(&actor->_5A0, &pp[actor->_642], v2);
|
||||
chase_xyz_t(&actor->position, &pp[actor->_642], v2);
|
||||
}
|
||||
}
|
||||
|
||||
mfish_unagi_aim_wind_angle_calc(actor);
|
||||
s = search_position_angleY(&actor->_5A0, &pp[actor->_642]);
|
||||
s = search_position_angleY(&actor->position, &pp[actor->_642]);
|
||||
add_calc_short_angle2(&actor->_612.y, s, CALC_EASE(0.5f), DEG2SHORT_ANGLE(2.5f), DEG2SHORT_ANGLE(0.25f));
|
||||
add_calc_short_angle2(&actor->_632, actor->_612.x * v, CALC_EASE(0.2f), DEG2SHORT_ANGLE(1.5f), DEG2SHORT_ANGLE(0));
|
||||
add_calc_short_angle2(&actor->_644, actor->_612.z * v, CALC_EASE(0.1f), DEG2SHORT_ANGLE(0.1f), DEG2SHORT_ANGLE(0));
|
||||
}
|
||||
|
||||
void mfish_unagi_normal_to_reverse_init(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
s16 target = search_position_angleY(&actor->_5A0, &unagi_normal_to_reverse_rail_pos[actor->_642]);
|
||||
s16 target = search_position_angleY(&actor->position, &unagi_normal_to_reverse_rail_pos[actor->_642]);
|
||||
actor->_640 = 0;
|
||||
actor->_642 = 1;
|
||||
add_calc_short_angle2(&actor->_612.y, target, CALC_EASE(GETREG(TAKREG, 0x24) * 0.01f + 0.5f),
|
||||
DEG2SHORT_ANGLE(GETREG(TAKREG, 0x25) + 5.0f) >> 1, 0x2d);
|
||||
actor->_34 = mfish_unagi_normal_to_reverse;
|
||||
actor->currentProcess = mfish_unagi_normal_to_reverse;
|
||||
}
|
||||
|
||||
void mfish_unagi_normal_to_reverse(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
@@ -118,8 +118,8 @@ void mfish_unagi_normal_to_reverse(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex)
|
||||
c = 0.0f;
|
||||
}
|
||||
|
||||
v1 = search_position_distance(&actor->_5A0, &p[actor->_642]);
|
||||
if ((f32)__fabs(chase_xyz_t(&actor->_5A0, &p[actor->_642], v0)) < 0.008f) {
|
||||
v1 = search_position_distance(&actor->position, &p[actor->_642]);
|
||||
if ((f32)__fabs(chase_xyz_t(&actor->position, &p[actor->_642], v0)) < 0.008f) {
|
||||
if (actor->_640 < 11) {
|
||||
actor->_640++;
|
||||
} else {
|
||||
@@ -135,11 +135,11 @@ void mfish_unagi_normal_to_reverse(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex)
|
||||
}
|
||||
v0 -= v1;
|
||||
if (v0 > 0.0f) {
|
||||
chase_xyz_t(&actor->_5A0, &p[actor->_642], v0);
|
||||
chase_xyz_t(&actor->position, &p[actor->_642], v0);
|
||||
}
|
||||
}
|
||||
mfish_unagi_aim_wind_angle_calc(actor);
|
||||
s2 = search_position_angleY(&actor->_5A0, &p[actor->_642]);
|
||||
s2 = search_position_angleY(&actor->position, &p[actor->_642]);
|
||||
add_calc_short_angle2(&actor->_612.y, s2, CALC_EASE(0.5f), DEG2SHORT_ANGLE(2.5f), DEG2SHORT_ANGLE(0.25f));
|
||||
add_calc_short_angle2(&actor->_632, actor->_612.x * c, CALC_EASE(0.1f), DEG2SHORT_ANGLE(0.75f), DEG2SHORT_ANGLE(0));
|
||||
add_calc_short_angle2(&actor->_644, actor->_612.z * c, CALC_EASE(0.1f), DEG2SHORT_ANGLE(0.1f), DEG2SHORT_ANGLE(0));
|
||||
@@ -150,10 +150,10 @@ void mfish_unagi_rail_move_reverse_init(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* g
|
||||
s16 target;
|
||||
actor->_640 = 0;
|
||||
actor->_642 = unagi_rail_num_tbl[actor->_646] - 1;
|
||||
target = search_position_angleY(&actor->_5A0, &p[actor->_642]);
|
||||
target = search_position_angleY(&actor->position, &p[actor->_642]);
|
||||
add_calc_short_angle2(&actor->_612.y, target, CALC_EASE(0.5f + 0.01f * GETREG(TAKREG, 0x24)),
|
||||
DEG2SHORT_ANGLE(GETREG(TAKREG, 0x25) + 5.0f) >> 1, DEG2SHORT_ANGLE(0.25f));
|
||||
actor->_34 = mfish_unagi_rail_move_reverse;
|
||||
actor->currentProcess = mfish_unagi_rail_move_reverse;
|
||||
}
|
||||
|
||||
void mfish_unagi_rail_move_reverse(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
@@ -165,8 +165,8 @@ void mfish_unagi_rail_move_reverse(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex)
|
||||
if (c < 0.0f) {
|
||||
c = 0.0f;
|
||||
}
|
||||
v1 = search_position_distance(&actor->_5A0, &p[actor->_642]);
|
||||
if ((f32)__fabs(chase_xyz_t(&actor->_5A0, &p[actor->_642], v0)) < 0.008f) {
|
||||
v1 = search_position_distance(&actor->position, &p[actor->_642]);
|
||||
if ((f32)__fabs(chase_xyz_t(&actor->position, &p[actor->_642], v0)) < 0.008f) {
|
||||
if (actor->_640 > 1) {
|
||||
actor->_640--;
|
||||
} else if (actor->_640 == 1) {
|
||||
@@ -187,11 +187,11 @@ void mfish_unagi_rail_move_reverse(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex)
|
||||
}
|
||||
v0 -= v1;
|
||||
if (v0 > 0.0f) {
|
||||
chase_xyz_t(&actor->_5A0, &p[actor->_642], v0);
|
||||
chase_xyz_t(&actor->position, &p[actor->_642], v0);
|
||||
}
|
||||
}
|
||||
mfish_unagi_aim_wind_angle_calc(actor);
|
||||
s2 = search_position_angleY(&actor->_5A0, &p[actor->_642]);
|
||||
s2 = search_position_angleY(&actor->position, &p[actor->_642]);
|
||||
add_calc_short_angle2(&actor->_612.y, s2, CALC_EASE(0.5f), DEG2SHORT_ANGLE(2.5f), DEG2SHORT_ANGLE(0.25f));
|
||||
add_calc_short_angle2(&actor->_632, actor->_612.x * c, CALC_EASE(0.2f), DEG2SHORT_ANGLE(1.5f), DEG2SHORT_ANGLE(0));
|
||||
add_calc_short_angle2(&actor->_644, actor->_612.z * c, CALC_EASE(0.1f), DEG2SHORT_ANGLE(0.1f), DEG2SHORT_ANGLE(0));
|
||||
@@ -201,10 +201,10 @@ void mfish_unagi_reverse_to_normal_init(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* g
|
||||
s16 target;
|
||||
actor->_640 = 0;
|
||||
actor->_642 = 0x12;
|
||||
target = search_position_angleY(&actor->_5A0, &unagi_reverse_to_normal_rail_pos[actor->_642]);
|
||||
target = search_position_angleY(&actor->position, &unagi_reverse_to_normal_rail_pos[actor->_642]);
|
||||
add_calc_short_angle2(&actor->_612.y, target, CALC_EASE(0.5f + 0.01f * GETREG(TAKREG, 0x24)),
|
||||
DEG2SHORT_ANGLE(GETREG(TAKREG, 0x25) + 5.0f) >> 1, DEG2SHORT_ANGLE(0.25f));
|
||||
actor->_34 = mfish_unagi_reverse_to_normal;
|
||||
actor->currentProcess = mfish_unagi_reverse_to_normal;
|
||||
}
|
||||
|
||||
void mfish_unagi_reverse_to_normal(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
@@ -216,8 +216,8 @@ void mfish_unagi_reverse_to_normal(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex)
|
||||
if (c < 0.0f) {
|
||||
c = 0.0f;
|
||||
}
|
||||
v1 = search_position_distance(&actor->_5A0, &p[actor->_642]);
|
||||
if ((f32)__fabs(chase_xyz_t(&actor->_5A0, &p[actor->_642], v0)) < 0.008f) {
|
||||
v1 = search_position_distance(&actor->position, &p[actor->_642]);
|
||||
if ((f32)__fabs(chase_xyz_t(&actor->position, &p[actor->_642], v0)) < 0.008f) {
|
||||
if (actor->_640 > 1) {
|
||||
actor->_640--;
|
||||
} else if (actor->_640 == 1) {
|
||||
@@ -236,11 +236,11 @@ void mfish_unagi_reverse_to_normal(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex)
|
||||
}
|
||||
v0 -= v1;
|
||||
if (v0 > 0.0f) {
|
||||
chase_xyz_t(&actor->_5A0, &p[actor->_642], v0);
|
||||
chase_xyz_t(&actor->position, &p[actor->_642], v0);
|
||||
}
|
||||
}
|
||||
mfish_unagi_aim_wind_angle_calc(actor);
|
||||
s2 = search_position_angleY(&actor->_5A0, &p[actor->_642]);
|
||||
s2 = search_position_angleY(&actor->position, &p[actor->_642]);
|
||||
add_calc_short_angle2(&actor->_612.y, s2, CALC_EASE(0.5f), DEG2SHORT_ANGLE(2.5f), DEG2SHORT_ANGLE(0.25f));
|
||||
add_calc_short_angle2(&actor->_632, actor->_612.x * c, CALC_EASE(0.2f), DEG2SHORT_ANGLE(1.5f), DEG2SHORT_ANGLE(0));
|
||||
add_calc_short_angle2(&actor->_644, actor->_612.z * c, CALC_EASE(0.1f), DEG2SHORT_ANGLE(0.1f), DEG2SHORT_ANGLE(0));
|
||||
@@ -252,18 +252,19 @@ void mfish_unagi_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
p1 = ZeroVec;
|
||||
p2 = ZeroVec;
|
||||
mfish_onefish_mv(actor, gamex);
|
||||
if (actor->_626-- < 0) {
|
||||
if (actor->activityFrameCount-- < 0) {
|
||||
f32 v;
|
||||
actor->_5F0 = Rnd_EX_f(actor->init_data._14) + actor->init_data._10;
|
||||
actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E);
|
||||
actor->_628 = actor->_626;
|
||||
actor->activityFrameCount =
|
||||
actor->init_data.activeFramesMin + (s16)RANDOM_F(actor->init_data.activeFramesRange);
|
||||
actor->savedActivityFrameCount = actor->activityFrameCount;
|
||||
v = (actor->_5F0 / (actor->init_data._14 + actor->init_data._10));
|
||||
actor->_612.x = DEG2SHORT_ANGLE((GETREG(TAKREG, 0x35) + 75.0f) * v);
|
||||
actor->_612.z = DEG2SHORT_ANGLE(-(GETREG(TAKREG, 0x36) * 0.1f + 9.0f) * v);
|
||||
actor->_5AC.y = (GETREG(TAKREG, 0x11) * 0.01f + 0.05f) + RANDOM_F(GETREG(TAKREG, 0x12) * 0.01f + 0.1f);
|
||||
}
|
||||
|
||||
if (actor->_626 > actor->_628 - 40) {
|
||||
if (actor->activityFrameCount > actor->savedActivityFrameCount - 40) {
|
||||
actor->_5EC = cos_s(actor->_622) * 0.1f;
|
||||
add_calc2(&actor->_5E8, actor->_5F0, 0.15f, actor->_5EC);
|
||||
} else {
|
||||
@@ -297,7 +298,7 @@ void mfish_unagi_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
DEG2SHORT_ANGLE(0.125f));
|
||||
add_calc_short_angle2(&actor->_38._538.y, actor->_38._538.x, CALC_EASE2(0.15f), DEG2SHORT_ANGLE(1.25f),
|
||||
DEG2SHORT_ANGLE(0.125f));
|
||||
actor->_34(actor, gamex);
|
||||
actor->currentProcess(actor, gamex);
|
||||
add_calc2(&actor->_5F4, actor->_632 * (GETREG(TAKREG, 0x47) * 0.001f + 0.04f), 0.25f, 91.0f);
|
||||
Museum_Fish_objchk_pos_set(actor, gamex);
|
||||
}
|
||||
@@ -344,10 +345,10 @@ void mfish_unagi_dw(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
mtxp = &skele->_2b0;
|
||||
}
|
||||
OPEN_DISP(gamex->graph);
|
||||
Matrix_translate(actor->_5A0.x + actor->_5AC.x, actor->_5A0.y, actor->_5A0.z + actor->_5AC.z, 0);
|
||||
Matrix_translate(actor->position.x + actor->_5AC.x, actor->position.y, actor->position.z + actor->_5AC.z, 0);
|
||||
Matrix_rotateXYZ(actor->_60C.x, actor->_60C.y, actor->_60C.z, 1);
|
||||
Matrix_translate(0.0f, 0.0f, actor->init_data._24, 1);
|
||||
Matrix_scale(actor->init_data._00, actor->init_data._00, actor->init_data._00, 1);
|
||||
Matrix_scale(actor->init_data.renderScale, actor->init_data.renderScale, actor->init_data.renderScale, 1);
|
||||
gSPMatrix(NEXT_POLY_OPA_DISP, _Matrix_to_Mtx_new(gamex->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
cKF_Si3_draw_R_SV(gamex, &skele->_00, mtxp, mfish_unagi_before_disp, NULL, actor);
|
||||
CLOSE_DISP(gamex->graph);
|
||||
|
||||
@@ -3,11 +3,11 @@ void mfish_zarigani_ct(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
YET_SKELETON* skele = &actor->_38;
|
||||
cKF_SkeletonInfo_R_ct(&skele->_00, skele->_54C, skele->_550[0], &skele->_4F0, &skele->_514);
|
||||
cKF_SkeletonInfo_R_init_standard_repeat_speedsetandmorph(&skele->_00, skele->_550[0], NULL, 0.5f, 0.0f);
|
||||
actor->_5A0 = suisou_pos[actor->_630];
|
||||
actor->_5A0.y = 53.0f;
|
||||
actor->position = suisou_pos[actor->group];
|
||||
actor->position.y = 53.0f;
|
||||
actor->_60C.y = qrand();
|
||||
actor->_612.y = actor->_60C.y;
|
||||
actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E);
|
||||
actor->activityFrameCount = actor->init_data.activeFramesMin + (s16)RANDOM_F(actor->init_data.activeFramesRange);
|
||||
actor->_5E8 = 0.0f;
|
||||
actor->_5F0 = actor->init_data._10 + RANDOM_F(actor->init_data._14);
|
||||
actor->_5AC = ZeroVec;
|
||||
@@ -16,11 +16,11 @@ void mfish_zarigani_ct(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
}
|
||||
|
||||
void mfish_zarigani_normal_process_init(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
actor->_34 = mfish_zarigani_normal_process;
|
||||
actor->currentProcess = mfish_zarigani_normal_process;
|
||||
}
|
||||
|
||||
void mfish_zarigani_normal_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
actor->_626--;
|
||||
actor->activityFrameCount--;
|
||||
cKF_SkeletonInfo_R_play(&actor->_38._00);
|
||||
if (actor->_5F0 > 0.0f) {
|
||||
add_calc_short_angle2(&actor->_644, (s16)DEG2SHORT_ANGLE2(actor->_5F0 * 30.0f + 1.0f), CALC_EASE(0.25f),
|
||||
@@ -39,19 +39,20 @@ void mfish_zarigani_normal_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex)
|
||||
if (ABS((s16)(actor->_612.y - actor->_60C.y)) < DEG2SHORT_ANGLE(10) | actor->_638 > 0) {
|
||||
//! BUG: someone forgot a `|` ^
|
||||
f32 v = actor->_5E8 * (ABS(sin_s(actor->_638)) * 0.5f + 0.5f);
|
||||
actor->_5A0.x += v * sin_s(actor->_60C.y);
|
||||
actor->_5A0.z += v * cos_s(actor->_60C.y);
|
||||
actor->position.x += v * sin_s(actor->_60C.y);
|
||||
actor->position.z += v * cos_s(actor->_60C.y);
|
||||
}
|
||||
|
||||
if (actor->_626 < 0) {
|
||||
if (actor->activityFrameCount < 0) {
|
||||
actor->_5F0 = 0.0f;
|
||||
actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E);
|
||||
actor->activityFrameCount =
|
||||
actor->init_data.activeFramesMin + (s16)RANDOM_F(actor->init_data.activeFramesRange);
|
||||
mfish_zarigani_wait_process_init(actor, gamex);
|
||||
}
|
||||
|
||||
if (actor->_62E & 0x1e) {
|
||||
if (actor->_62E_flags & 0x1e) {
|
||||
if (ABS((s16)(actor->_60C.y - actor->_62C)) < DEG2SHORT_ANGLE(90)) {
|
||||
if (ABS((s16)(actor->_612.y - actor->_62C)) < DEG2SHORT_ANGLE(35) && (actor->_62E & 0x10) == 0) {
|
||||
if (ABS((s16)(actor->_612.y - actor->_62C)) < DEG2SHORT_ANGLE(35) && (actor->_62E_flags & 0x10) == 0) {
|
||||
mfish_zarigani_stand_process_init(actor, gamex);
|
||||
} else if ((s16)(actor->_612.y - actor->_62C) > 0) {
|
||||
actor->_612.y = actor->_62C;
|
||||
@@ -68,18 +69,20 @@ void mfish_zarigani_normal_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex)
|
||||
}
|
||||
|
||||
void mfish_zarigani_wait_process_init(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
actor->_34 = mfish_zarigani_wait_process;
|
||||
actor->currentProcess = mfish_zarigani_wait_process;
|
||||
}
|
||||
|
||||
void mfish_zarigani_wait_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
actor->_626--;
|
||||
actor->activityFrameCount--;
|
||||
add_calc_short_angle2(&actor->_644, 0, CALC_EASE(0.25f), DEG2SHORT_ANGLE(0.125f), DEG2SHORT_ANGLE(0.5f));
|
||||
if (actor->_626 < 0) {
|
||||
if (actor->activityFrameCount < 0) {
|
||||
if (mfish_WallCheck(actor) && RANDOM_F(1) < 0.2f) {
|
||||
actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E);
|
||||
actor->activityFrameCount =
|
||||
actor->init_data.activeFramesMin + (s16)RANDOM_F(actor->init_data.activeFramesRange);
|
||||
mfish_zarigani_jump_process_init(actor, gamex);
|
||||
} else {
|
||||
actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E);
|
||||
actor->activityFrameCount =
|
||||
actor->init_data.activeFramesMin + (s16)RANDOM_F(actor->init_data.activeFramesRange);
|
||||
actor->_5F0 = actor->init_data._10 + RANDOM_F(actor->init_data._14);
|
||||
actor->_612.y += (s16)RANDOM2_F(actor->init_data._30 * 2.0f);
|
||||
mfish_zarigani_normal_process_init(actor, gamex);
|
||||
@@ -88,8 +91,8 @@ void mfish_zarigani_wait_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
}
|
||||
|
||||
void mfish_zarigani_stand_process_init(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
actor->_34 = mfish_zarigani_stand_process;
|
||||
if (actor->_62E & 0x1e) {
|
||||
actor->currentProcess = mfish_zarigani_stand_process;
|
||||
if (actor->_62E_flags & 0x1e) {
|
||||
actor->_612.y = actor->_62C;
|
||||
if ((s16)(actor->_60C.y - actor->_62C) != DEG2SHORT_ANGLE(0)) {
|
||||
actor->_612.y += DEG2SHORT_ANGLE(90);
|
||||
@@ -97,15 +100,15 @@ void mfish_zarigani_stand_process_init(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* ga
|
||||
actor->_612.y += DEG2SHORT_ANGLE(-90);
|
||||
}
|
||||
}
|
||||
actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E);
|
||||
actor->activityFrameCount = actor->init_data.activeFramesMin + (s16)RANDOM_F(actor->init_data.activeFramesRange);
|
||||
}
|
||||
|
||||
void mfish_zarigani_stand_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
f32 v;
|
||||
|
||||
cKF_SkeletonInfo_R_play(&actor->_38._00);
|
||||
if (actor->_626 > 0) {
|
||||
actor->_626--;
|
||||
if (actor->activityFrameCount > 0) {
|
||||
actor->activityFrameCount--;
|
||||
if (add_calc_short_angle2(&actor->_60C.x, (s16)DEG2SHORT_ANGLE2(-45.0f + GETREG(TAKREG, 0x1a)), CALC_EASE(0.1),
|
||||
DEG2SHORT_ANGLE(0.5f), DEG2SHORT_ANGLE(0.05f)) == 0) {
|
||||
add_calc_short_angle2(&actor->_644, DEG2SHORT_ANGLE(0.5f), CALC_EASE(0.01f), DEG2SHORT_ANGLE(0.05f),
|
||||
@@ -117,7 +120,8 @@ void mfish_zarigani_stand_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex)
|
||||
if (add_calc_short_angle2(&actor->_60C.x, DEG2SHORT_ANGLE(0), CALC_EASE(0.25f), DEG2SHORT_ANGLE(0.75f),
|
||||
DEG2SHORT_ANGLE(0.05f)) == 0) {
|
||||
actor->_5AC = ZeroVec;
|
||||
actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E);
|
||||
actor->activityFrameCount =
|
||||
actor->init_data.activeFramesMin + (s16)RANDOM_F(actor->init_data.activeFramesRange);
|
||||
mfish_zarigani_wait_process_init(actor, gamex);
|
||||
}
|
||||
}
|
||||
@@ -133,7 +137,7 @@ void mfish_zarigani_jump_process_init(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gam
|
||||
actor->_5E8 = 0.0f;
|
||||
actor->_5D0.y = 0.25f + GETREG(TAKREG, 0x1d) * 0.01f;
|
||||
actor->_644 = 0;
|
||||
actor->_34 = mfish_zarigani_jump_process;
|
||||
actor->currentProcess = mfish_zarigani_jump_process;
|
||||
}
|
||||
|
||||
void mfish_zarigani_jump_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
@@ -141,17 +145,18 @@ void mfish_zarigani_jump_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
actor->_5D0.y *= 0.99f;
|
||||
actor->_5F0 *= 0.95f;
|
||||
add_calc2(&actor->_5E8, actor->_5F0, 0.25f, 0.05f);
|
||||
actor->_5A0.x += actor->_5E8 * sin_s(actor->_60C.y);
|
||||
actor->_5A0.y += actor->_5D0.y * MAX(sin_s(actor->_60C.x), 0.1f);
|
||||
actor->_5A0.z += actor->_5E8 * cos_s(actor->_60C.y);
|
||||
actor->position.x += actor->_5E8 * sin_s(actor->_60C.y);
|
||||
actor->position.y += actor->_5D0.y * MAX(sin_s(actor->_60C.x), 0.1f);
|
||||
actor->position.z += actor->_5E8 * cos_s(actor->_60C.y);
|
||||
if (actor->_5D0.y > 0.0f) {
|
||||
add_calc_short_angle2(&actor->_60C.x, (s16)DEG2SHORT_ANGLE2(30.f + GETREG(TAKREG, 0x21)), CALC_EASE(0.5),
|
||||
DEG2SHORT_ANGLE(7.5f), DEG2SHORT_ANGLE(0));
|
||||
} else if ((add_calc_short_angle2(&actor->_60C.x, 0, CALC_EASE(0.1), DEG2SHORT_ANGLE(1.5f),
|
||||
DEG2SHORT_ANGLE(0.25f)) == 0) &&
|
||||
(actor->_62E & 0x200)) {
|
||||
(actor->_62E_flags & 0x200)) {
|
||||
actor->_5AC.y = 0.0f;
|
||||
actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E);
|
||||
actor->activityFrameCount =
|
||||
actor->init_data.activeFramesMin + (s16)RANDOM_F(actor->init_data.activeFramesRange);
|
||||
mfish_zarigani_wait_process_init(actor, gamex);
|
||||
return;
|
||||
}
|
||||
@@ -161,18 +166,18 @@ void mfish_zarigani_jump_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
|
||||
void mfish_zarigani_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
f32 v;
|
||||
xyz_t p = suisou_pos[actor->_630];
|
||||
xyz_t p = suisou_pos[actor->group];
|
||||
add_calc(&actor->_5E8, actor->_5F0, 0.1f, 0.2f, 0.01f);
|
||||
actor->_34(actor, gamex);
|
||||
actor->currentProcess(actor, gamex);
|
||||
actor->_638 += actor->_644;
|
||||
Museum_Fish_objchk_pos_set(actor, gamex);
|
||||
Museum_Fish_BGCheck(actor, gamex);
|
||||
xyz_t_sub(&p, &actor->_5A0, &p);
|
||||
xyz_t_sub(&p, &actor->position, &p);
|
||||
v = 58.0f + MAX(ABS(p.x), ABS(p.z)) * -0.15f;
|
||||
actor->_62E &= ~0x200;
|
||||
if (actor->_5A0.y < v || actor->_34 != mfish_zarigani_jump_process) {
|
||||
actor->_62E |= 0x200;
|
||||
actor->_5A0.y = v;
|
||||
actor->_62E_flags &= ~0x200;
|
||||
if (actor->position.y < v || actor->currentProcess != mfish_zarigani_jump_process) {
|
||||
actor->_62E_flags |= 0x200;
|
||||
actor->position.y = v;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -212,11 +217,12 @@ void mfish_zarigani_dw(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
mtxp = &skele->_2b0;
|
||||
}
|
||||
OPEN_DISP(gamex->graph);
|
||||
Matrix_translate(actor->_5A0.x + actor->_5AC.x, actor->_5A0.y + actor->_5AC.y, actor->_5A0.z + actor->_5AC.z, 0);
|
||||
Matrix_translate(actor->position.x + actor->_5AC.x, actor->position.y + actor->_5AC.y,
|
||||
actor->position.z + actor->_5AC.z, 0);
|
||||
Matrix_rotateXYZ(actor->_60C.x, actor->_60C.y, actor->_60C.z, 1);
|
||||
Matrix_translate(0.0f, 0.0f, actor->init_data._24, 1);
|
||||
Matrix_rotateXYZ(DEG2SHORT_ANGLE(-90), DEG2SHORT_ANGLE(-180), DEG2SHORT_ANGLE(0), 1);
|
||||
Matrix_scale(actor->init_data._00, actor->init_data._00, actor->init_data._00, 1);
|
||||
Matrix_scale(actor->init_data.renderScale, actor->init_data.renderScale, actor->init_data.renderScale, 1);
|
||||
gSPMatrix(NEXT_POLY_OPA_DISP, _Matrix_to_Mtx_new(gamex->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
cKF_Si3_draw_R_SV(gamex, &skele->_00, mtxp, mfish_zarigani_before_disp, NULL, actor);
|
||||
CLOSE_DISP(gamex->graph);
|
||||
|
||||
Reference in New Issue
Block a user