mirror of
https://github.com/zeldaret/tww.git
synced 2026-08-19 13:24:12 -04:00
Use named constants instead of literals in some places
This commit is contained in:
+43
-42
@@ -32,17 +32,18 @@ static Vec l_cannon_top = {85.0f, 0.0f, 10.0f};
|
||||
static Vec l_tiller_top_offset = {34.0f, 0.0f, 15.0f};
|
||||
|
||||
|
||||
const s16 daShip_HIO_c0::tiller_speed = 0x02BC;
|
||||
const s16 daShip_HIO_c0::cannon_no_gravity_timer = 0x0008;
|
||||
const s16 daShip_HIO_c0::throw_start_angle_speed = 0x1194;
|
||||
const s16 daShip_HIO_c0::throw_return_angle_speed = 0x0E10;
|
||||
const f32 daShip_HIO_c0::paddle_speed = 10.0f;
|
||||
const f32 daShip_HIO_c0::min_speed = 0.0f;
|
||||
const f32 daShip_HIO_c0::wind_inc_speed = 55.0f;
|
||||
const f32 daShip_HIO_c0::r_inc_speed = 0.0f;
|
||||
const f32 daShip_HIO_c0::r_wind_inc_speed = 0.0f;
|
||||
const f32 daShip_HIO_c0::fly_rate = 0.6f;
|
||||
const f32 daShip_HIO_c0::wind_rate = 0.5f;
|
||||
// TODO: Use these named constants in the code instead of literals
|
||||
const s16 daShip_HIO_c0::tiller_speed = 700;
|
||||
const s16 daShip_HIO_c0::cannon_no_gravity_timer = 8;
|
||||
const s16 daShip_HIO_c0::throw_start_angle_speed = 4500;
|
||||
const s16 daShip_HIO_c0::throw_return_angle_speed = 3600;
|
||||
const f32 daShip_HIO_c0::paddle_speed = 10.0f; // TODO
|
||||
const f32 daShip_HIO_c0::min_speed = 0.0f; // TODO
|
||||
const f32 daShip_HIO_c0::wind_inc_speed = 55.0f; // TODO
|
||||
const f32 daShip_HIO_c0::r_inc_speed = 0.0f; // TODO
|
||||
const f32 daShip_HIO_c0::r_wind_inc_speed = 0.0f; // TODO
|
||||
const f32 daShip_HIO_c0::fly_rate = 0.6f; // TODO
|
||||
const f32 daShip_HIO_c0::wind_rate = 0.5f; // TODO
|
||||
const f32 daShip_HIO_c0::ef_dis_speed = 2.0f;
|
||||
const f32 daShip_HIO_c0::ef_speed_rate = 0.7f;
|
||||
const f32 daShip_HIO_c0::ef_front_x = -80.0f;
|
||||
@@ -52,18 +53,18 @@ const f32 daShip_HIO_c0::ef_back_x = -40.0f;
|
||||
const f32 daShip_HIO_c0::ef_back_y = -100.0f;
|
||||
const f32 daShip_HIO_c0::ef_back_z = -350.0f;
|
||||
const f32 daShip_HIO_c0::ef_sp_max_speed = 30.0f;
|
||||
const f32 daShip_HIO_c0::ef_pitch = 1.0f;
|
||||
const f32 daShip_HIO_c0::ef_pitch = 1.0f; // TODO
|
||||
const f32 daShip_HIO_c0::ef_ind_scroll = -0.04f;
|
||||
const f32 daShip_HIO_c0::ef_ind_scale = 4.0f;
|
||||
const f32 daShip_HIO_c0::cannon_speed = 110.0f;
|
||||
const f32 daShip_HIO_c0::cannon_gravity = -2.5f;
|
||||
const f32 daShip_HIO_c0::whirl_init_speed = 10.0f;
|
||||
const f32 daShip_HIO_c0::whirl_inc_speed = 30.0f;
|
||||
const f32 daShip_HIO_c0::whirl_init_speed = 10.0f; // TODO
|
||||
const f32 daShip_HIO_c0::whirl_inc_speed = 30.0f; // TODO
|
||||
const f32 daShip_HIO_c0::whirl_distance = 4000.0f;
|
||||
const f32 daShip_HIO_c0::tornado_init_speed = 30.0f;
|
||||
const f32 daShip_HIO_c0::tornado_inc_speed = 40.0f;
|
||||
const f32 daShip_HIO_c0::tornado_init_speed = 30.0f; // TODO
|
||||
const f32 daShip_HIO_c0::tornado_inc_speed = 40.0f; // TODO
|
||||
const f32 daShip_HIO_c0::tornado_distance = 6000.0f;
|
||||
const f32 daShip_HIO_c0::tornado_pull_speed = 5.0f;
|
||||
const f32 daShip_HIO_c0::tornado_pull_speed = 5.0f; // TODO
|
||||
const f32 daShip_HIO_c0::throw_start_speedF = 150.0f;
|
||||
const f32 daShip_HIO_c0::throw_start_speed_y = 50.0f;
|
||||
|
||||
@@ -1353,7 +1354,7 @@ void daShip_c::setSelfMove(int param_1) {
|
||||
else {
|
||||
sVar2 = 0;
|
||||
}
|
||||
cLib_addCalcAngleS(&m0366, sVar2, 4, 700, 0x100);
|
||||
cLib_addCalcAngleS(&m0366, sVar2, 4, l_HIO.tiller_speed, 0x100);
|
||||
setMoveAngle(m0366);
|
||||
if (!checkStateFlg(daSFLG_FLY_e)) {
|
||||
if (dComIfGp_checkPlayerStatus0(0, daPyStts0_UNK2000_e) || dComIfGp_event_runCheck() || daPy_getPlayerLinkActorClass()->checkNoControll()) {
|
||||
@@ -1579,7 +1580,7 @@ BOOL daShip_c::procSteerMove() {
|
||||
if (checkNextMode(MODE_STEER_MOVE_e)) {
|
||||
return TRUE;
|
||||
}
|
||||
cLib_addCalcAngleS(&m0366, mStickMVal * 8192.0f * -cM_ssin(mStickMAng), 4, 700, 0x100);
|
||||
cLib_addCalcAngleS(&m0366, mStickMVal * 8192.0f * -cM_ssin(mStickMAng), 4, l_HIO.tiller_speed, 0x100);
|
||||
if (!checkStateFlg(daSFLG_FLY_e)) {
|
||||
setMoveAngle(m0366);
|
||||
}
|
||||
@@ -2048,7 +2049,7 @@ BOOL daShip_c::procToolDemo() {
|
||||
else {
|
||||
angleDiff = 0;
|
||||
}
|
||||
cLib_addCalcAngleS(&m0366, angleDiff, 4, 700, 0x100);
|
||||
cLib_addCalcAngleS(&m0366, angleDiff, 4, l_HIO.tiller_speed, 0x100);
|
||||
setControllAngle(getAimControllAngle(prevShapeAngleY));
|
||||
}
|
||||
}
|
||||
@@ -2250,7 +2251,7 @@ BOOL daShip_c::procZevDemo() {
|
||||
sVar5 = 0;
|
||||
}
|
||||
|
||||
cLib_addCalcAngleS(&m0366, sVar5, 4, 700, 0x100);
|
||||
cLib_addCalcAngleS(&m0366, sVar5, 4, l_HIO.tiller_speed, 0x100);
|
||||
setControllAngle(getAimControllAngle(sVar15));
|
||||
}
|
||||
else {
|
||||
@@ -2313,20 +2314,20 @@ BOOL daShip_c::procZevDemo() {
|
||||
}
|
||||
}
|
||||
else if (m0351 == DEMO_THROW_e) {
|
||||
speedF = 150.0f;
|
||||
speedF = l_HIO.throw_start_speedF;
|
||||
speedP = dComIfGp_evmng_getMyFloatP(mEvtStaffId, "gravity");
|
||||
if (speedP) {
|
||||
gravity = *speedP;
|
||||
}
|
||||
|
||||
speed.y = 50.0f;
|
||||
speed.y = l_HIO.throw_start_speed_y;
|
||||
onStateFlg(daSFLG_FLY_e);
|
||||
|
||||
if (angleP) {
|
||||
current.angle.y = (s16)*angleP;
|
||||
}
|
||||
|
||||
shape_angle.y += 4500;
|
||||
shape_angle.y += l_HIO.throw_start_angle_speed;
|
||||
dComIfGp_evmng_cutEnd(mEvtStaffId);
|
||||
}
|
||||
else if (m0351 == DEMO_HWARP_UP_e) {
|
||||
@@ -2866,7 +2867,7 @@ BOOL daShip_c::procStartModeThrow_init() {
|
||||
if (m0392 != SHIP_BCK_FN_MAST_OFF2) {
|
||||
setPartOffAnime();
|
||||
}
|
||||
m03A6 = 3600;
|
||||
m03A6 = l_HIO.throw_return_angle_speed;
|
||||
camera_class* camera = dComIfGp_getCamera(dComIfGp_getPlayerCameraID(0));
|
||||
camera->mCamera.Stop();
|
||||
cXyz local_38(current.pos.x + cM_scos(current.angle.y) * 300.0f,
|
||||
@@ -2992,19 +2993,19 @@ void daShip_c::setEffectData(float param_1, short param_2) {
|
||||
}
|
||||
}
|
||||
|
||||
mTrack.setIndirectTexData(-0.04f, 4.0f);
|
||||
mTrack.setIndirectTexData(l_HIO.ef_ind_scroll, l_HIO.ef_ind_scale);
|
||||
mTrack.setSpeed(mFwdVel);
|
||||
|
||||
if (mFwdVel >= 0.0f) {
|
||||
mWaveR.setSpeed(0.7f);
|
||||
mWaveL.setSpeed(0.7f);
|
||||
mWaveR.setSpeed(l_HIO.ef_speed_rate);
|
||||
mWaveL.setSpeed(l_HIO.ef_speed_rate);
|
||||
}
|
||||
else {
|
||||
mWaveR.setSpeed(-0.7f);
|
||||
mWaveL.setSpeed(-0.7f);
|
||||
mWaveR.setSpeed(-l_HIO.ef_speed_rate);
|
||||
mWaveL.setSpeed(-l_HIO.ef_speed_rate);
|
||||
}
|
||||
|
||||
fVar1 = (s16)(shape_angle.z - param_2) / 16384.0f;
|
||||
fVar1 = (s16)(shape_angle.z - param_2) / (f32)0x4000;
|
||||
|
||||
if (fVar1 > 0.3f) {
|
||||
fVar1 = 0.3f;
|
||||
@@ -3017,21 +3018,21 @@ void daShip_c::setEffectData(float param_1, short param_2) {
|
||||
mWaveL.setPitch(1.0f - fVar1);
|
||||
|
||||
mSplash.setSpeed(mFwdVel);
|
||||
mSplash.setMaxSpeed(30.0f);
|
||||
mSplash.setMaxSpeed(l_HIO.ef_sp_max_speed);
|
||||
|
||||
cXyz anchorPos1;
|
||||
cXyz anchorPos2;
|
||||
|
||||
anchorPos1.set(-80.0f, -50.0f, -150.0f);
|
||||
anchorPos2.set(-40.0f, -100.0f, -350.0f);
|
||||
anchorPos1.set(l_HIO.ef_front_x, l_HIO.ef_front_y, l_HIO.ef_front_z);
|
||||
anchorPos2.set(l_HIO.ef_back_x, l_HIO.ef_back_y, l_HIO.ef_back_z);
|
||||
mWaveR.setAnchor(&anchorPos1, &anchorPos2);
|
||||
|
||||
anchorPos1.x *= -1.0f;
|
||||
anchorPos2.x *= -1.0f;
|
||||
mWaveL.setAnchor(&anchorPos1, &anchorPos2);
|
||||
|
||||
mWaveL.setMaxDisSpeed(2.0f);
|
||||
mWaveR.setMaxDisSpeed(2.0f);
|
||||
mWaveL.setMaxDisSpeed(l_HIO.ef_dis_speed);
|
||||
mWaveR.setMaxDisSpeed(l_HIO.ef_dis_speed);
|
||||
|
||||
mWaveL.setMaxSpeed(40.0f);
|
||||
mWaveR.setMaxSpeed(40.0f);
|
||||
@@ -3387,7 +3388,7 @@ void daShip_c::setTornadoActor() {
|
||||
m040C = cM_atan2f(local_20.x, local_20.z);
|
||||
|
||||
dCam_getBody()->SetTypeForce("Tornado", mTornadoActor);
|
||||
m0404 = (6000.0f - m0400) * 0.0004f;
|
||||
m0404 = (l_HIO.tornado_distance - m0400) * 0.0004f;
|
||||
if (m0404 < 0.0f) {
|
||||
m0404 = 0.0f;
|
||||
}
|
||||
@@ -3416,7 +3417,7 @@ void daShip_c::setWhirlActor() {
|
||||
m0400 = local_20.absXZ();
|
||||
m040C = cM_atan2f(local_20.x, local_20.z);
|
||||
dCam_getBody()->SetTypeForce("Tornado", mWhirlActor);
|
||||
m0404 = (4000.0f - m0400) * 0.00028571428f;
|
||||
m0404 = (l_HIO.whirl_distance - m0400) * (1.0f / 3500.0f);
|
||||
if (m0404 < 0.0f) {
|
||||
m0404 = 0.0f;
|
||||
}
|
||||
@@ -4000,12 +4001,12 @@ BOOL daShip_c::execute() {
|
||||
if (bomb) {
|
||||
dCam_getBody()->ForceLockOn(fpcM_GetID(bomb));
|
||||
|
||||
bomb->setNoGravityTime(8);
|
||||
bomb->setNoGravityTime(l_HIO.cannon_no_gravity_timer);
|
||||
|
||||
bomb->speedF = cM_scos(sp1C.x) * 110.0f;
|
||||
bomb->speed.y = -(cM_ssin(sp1C.x) * 110.0f);
|
||||
bomb->speedF = cM_scos(sp1C.x) * l_HIO.cannon_speed;
|
||||
bomb->speed.y = -(cM_ssin(sp1C.x) * l_HIO.cannon_speed);
|
||||
|
||||
bomb->gravity = -2.5f;
|
||||
bomb->gravity = l_HIO.cannon_gravity;
|
||||
|
||||
seStart(JA_SE_LK_SHIP_CANNON_FIRE, &m1038);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user