mirror of
https://github.com/zeldaret/tp
synced 2026-05-22 22:44:28 -04:00
Big cast cleanup (#3076)
* Big cast cleanup * fix for name conflict * rename header * rename cast macros * fix rename mistake --------- Co-authored-by: roeming <roeming@users.noreply.github.com>
This commit is contained in:
@@ -2,33 +2,8 @@
|
||||
#define C_ANGLE_H
|
||||
|
||||
#include "SSystem/SComponent/c_xyz.h"
|
||||
#include "angle_utils.h"
|
||||
|
||||
#define ADD_VAR(x, y) ((x) += (y))
|
||||
#define SUB_VAR(x, y) ((x) -= (y))
|
||||
#define MULT_VAR(x, y) ((x) *= (y))
|
||||
|
||||
#define ADD_VAR_CAST(x, y, t) ((x) += (t)(y))
|
||||
#define SUB_VAR_CAST(x, y, t) ((x) -= (t)(y))
|
||||
#define MULT_VAR_CAST(x, y, t) ((x) *= (t)(y))
|
||||
|
||||
#define ADD_ANGLE(x, y) ADD_VAR_CAST(x, y, s16)
|
||||
#define SUB_ANGLE(x, y) SUB_VAR_CAST(x, y, s16)
|
||||
#define MULT_ANGLE(x, y) MULT_VAR_CAST(x, y, s16)
|
||||
|
||||
// There are some angles that weren't sign-extended until the shield version
|
||||
#if !PLATFORM_SHIELD
|
||||
#define ADD_ANGLE_2 ADD_VAR
|
||||
#define SUB_ANGLE_2 SUB_VAR
|
||||
#define MULT_ANGLE_2 MULT_VAR
|
||||
|
||||
#define ADD_S8_2 ADD_VAR
|
||||
#else
|
||||
#define ADD_ANGLE_2 ADD_ANGLE
|
||||
#define SUB_ANGLE_2 SUB_ANGLE
|
||||
#define MULT_ANGLE_2 MULT_ANGLE
|
||||
|
||||
#define ADD_S8_2(x, y) ADD_VAR_CAST(x, y, s8)
|
||||
#endif
|
||||
|
||||
#define DEG2S_CONSTANT (0x8000 / 180.0f)
|
||||
#define S2DEG_CONSTANT (180.0f / 0x8000)
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
#ifndef _ANGLE_UTILS_H_
|
||||
#define _ANGLE_UTILS_H_
|
||||
|
||||
#include "global.h"
|
||||
#include "types.h"
|
||||
|
||||
#define VAR_ADD(x, y) ((x) += (y))
|
||||
#define VAR_SUB(x, y) ((x) -= (y))
|
||||
#define VAR_MULT(x, y) ((x) *= (y))
|
||||
|
||||
#define VAR_ADD_CAST(x, y, t) ((x) += (t)(y))
|
||||
#define VAR_SUB_CAST(x, y, t) ((x) -= (t)(y))
|
||||
#define VAR_MULT_CAST(x, y, t) ((x) *= (t)(y))
|
||||
|
||||
#define S8_ADD(x, y) VAR_ADD_CAST(x, y, s8)
|
||||
#define U8_ADD(x, y) VAR_ADD_CAST(x, y, u8)
|
||||
#define S16_ADD(x, y) VAR_ADD_CAST(x, y, s16)
|
||||
#define U16_ADD(x, y) VAR_ADD_CAST(x, y, u16)
|
||||
#define S32_ADD(x, y) VAR_ADD_CAST(x, y, s32)
|
||||
#define U32_ADD(x, y) VAR_ADD_CAST(x, y, u32)
|
||||
|
||||
#define S8_SUB(x, y) VAR_SUB_CAST(x, y, s8)
|
||||
#define U8_SUB(x, y) VAR_SUB_CAST(x, y, u8)
|
||||
#define S16_SUB(x, y) VAR_SUB_CAST(x, y, s16)
|
||||
#define U16_SUB(x, y) VAR_SUB_CAST(x, y, u16)
|
||||
#define S32_SUB(x, y) VAR_SUB_CAST(x, y, s32)
|
||||
#define U32_SUB(x, y) VAR_SUB_CAST(x, y, u32)
|
||||
|
||||
#define S8_MULT(x, y) VAR_MULT_CAST(x, y, s8)
|
||||
#define U8_MULT(x, y) VAR_MULT_CAST(x, y, u8)
|
||||
#define S16_MULT(x, y) VAR_MULT_CAST(x, y, s16)
|
||||
#define U16_MULT(x, y) VAR_MULT_CAST(x, y, u16)
|
||||
#define S32_MULT(x, y) VAR_MULT_CAST(x, y, s32)
|
||||
#define U32_MULT(x, y) VAR_MULT_CAST(x, y, u32)
|
||||
|
||||
#define ANGLE_ADD S16_ADD
|
||||
#define ANGLE_SUB S16_SUB
|
||||
#define ANGLE_MULT S16_MULT
|
||||
|
||||
// There are some angles that weren't sign-extended until the shield version
|
||||
#if !PLATFORM_SHIELD
|
||||
#define S8_ADD_2 VAR_ADD
|
||||
#define U8_ADD_2 VAR_ADD
|
||||
#define S16_ADD_2 VAR_ADD
|
||||
#define U16_ADD_2 VAR_ADD
|
||||
#define S32_ADD_2 VAR_ADD
|
||||
#define U32_ADD_2 VAR_ADD
|
||||
|
||||
#define S8_SUB_2 VAR_SUB
|
||||
#define U8_SUB_2 VAR_SUB
|
||||
#define S16_SUB_2 VAR_SUB
|
||||
#define U16_SUB_2 VAR_SUB
|
||||
#define S32_SUB_2 VAR_SUB
|
||||
#define U32_SUB_2 VAR_SUB
|
||||
|
||||
#define S8_MULT_2 VAR_MULT
|
||||
#define U8_MULT_2 VAR_MULT
|
||||
#define S16_MULT_2 VAR_MULT
|
||||
#define U16_MULT_2 VAR_MULT
|
||||
#define S32_MULT_2 VAR_MULT
|
||||
#define U32_MULT_2 VAR_MULT
|
||||
#else
|
||||
#define S8_ADD_2 S8_ADD
|
||||
#define U8_ADD_2 U8_ADD
|
||||
#define S16_ADD_2 S16_ADD
|
||||
#define U16_ADD_2 U16_ADD
|
||||
#define S32_ADD_2 S32_ADD
|
||||
#define U32_ADD_2 U32_ADD
|
||||
|
||||
#define S8_SUB_2 S8_SUB
|
||||
#define U8_SUB_2 U8_SUB
|
||||
#define S16_SUB_2 S16_SUB
|
||||
#define U16_SUB_2 U16_SUB
|
||||
#define S32_SUB_2 S32_SUB
|
||||
#define U32_SUB_2 U32_SUB
|
||||
|
||||
#define S8_MULT_2 S8_MULT
|
||||
#define U8_MULT_2 U8_MULT
|
||||
#define S16_MULT_2 S16_MULT
|
||||
#define U16_MULT_2 U16_MULT
|
||||
#define S32_MULT_2 S32_MULT
|
||||
#define U32_MULT_2 U32_MULT
|
||||
#endif
|
||||
|
||||
#define ANGLE_ADD_2 S16_ADD_2
|
||||
#define ANGLE_SUB_2 S16_SUB_2
|
||||
#define ANGLE_MULT_2 S16_MULT_2
|
||||
|
||||
#endif // !_ANGLE_UTILS_H_
|
||||
@@ -276,7 +276,7 @@ public:
|
||||
cXyz cStack_50 = *mAttnPosP - param_1;
|
||||
sVar3 += cM_atan2s(cStack_50.x, cStack_50.z);
|
||||
sVar3 -= param_2;
|
||||
sVar3 -= (s16)(field_0x150.y - param_2);
|
||||
ANGLE_SUB(sVar3, field_0x150.y - param_2);
|
||||
sVar3 += param_5;
|
||||
}
|
||||
if (param_3) {
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "JSystem/JKernel/JKRAram.h"
|
||||
#include <dolphin/gx.h>
|
||||
#include <stdint.h>
|
||||
#include "angle_utils.h"
|
||||
|
||||
JUTCacheFont::JUTCacheFont(ResFONT const* p_fontRes, u32 cacheSize, JKRHeap* p_heap) {
|
||||
initialize_state();
|
||||
@@ -343,11 +344,7 @@ void JUTCacheFont::getGlyphFromAram(JUTCacheFont::TGlyphCacheInfo* param_0,
|
||||
prepend(pGylphCacheInfo);
|
||||
int iVar3 = pGylphCacheInfo->field_0x16 * pGylphCacheInfo->field_0x18;
|
||||
int iVar2 = *r30 / iVar3;
|
||||
#if PLATFORM_SHIELD
|
||||
pGylphCacheInfo->field_0x8 += (u16)(iVar2 * iVar3);
|
||||
#else
|
||||
pGylphCacheInfo->field_0x8 += iVar2 * iVar3;
|
||||
#endif
|
||||
U16_ADD_2(pGylphCacheInfo->field_0x8, iVar2 * iVar3);
|
||||
u16 local_30 = pGylphCacheInfo->field_0x8 + iVar3 - 1;
|
||||
pGylphCacheInfo->field_0xa = pGylphCacheInfo->field_0xa < local_30 ? pGylphCacheInfo->field_0xa : local_30;
|
||||
*param_3 = iVar2;
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <cstdio>
|
||||
#include <dolphin/os.h>
|
||||
#include "global.h"
|
||||
#include "angle_utils.h"
|
||||
|
||||
JUTDirectPrint* JUTDirectPrint::sDirectPrint;
|
||||
|
||||
@@ -160,11 +161,7 @@ void JUTDirectPrint::printSub(u16 position_x, u16 position_y, char const* format
|
||||
for (; 0 < buffer_length; buffer_length--, ptr++) {
|
||||
int codepoint = sAsciiTable[*ptr & 0x7f];
|
||||
if (codepoint == 0xfe) {
|
||||
#if PLATFORM_SHIELD
|
||||
position_y += (u16)7;
|
||||
#else
|
||||
position_y += 7;
|
||||
#endif
|
||||
U16_ADD_2(position_y, 7);
|
||||
position_x = x;
|
||||
} else if (codepoint == 0xfd) {
|
||||
position_x = position_x + 0x30 - ((position_x - x + 0x2f) % 0x30);
|
||||
@@ -172,11 +169,7 @@ void JUTDirectPrint::printSub(u16 position_x, u16 position_y, char const* format
|
||||
if (codepoint != 0xff) {
|
||||
drawChar(position_x, position_y, codepoint);
|
||||
}
|
||||
#if PLATFORM_SHIELD
|
||||
position_x += (u16)6;
|
||||
#else
|
||||
position_x += 6;
|
||||
#endif
|
||||
U16_ADD_2(position_x, 6);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+10
-10
@@ -2812,10 +2812,10 @@ void daAlink_c::setHairAngle(cXyz* param_0, f32 param_1, f32 param_2) {
|
||||
|
||||
var_f31 = 0.15f + (0.85f * var_f31);
|
||||
|
||||
field_0x3070 += (s16)(1000.0f + cM_rndF(500.0f) + (var_f31 * (3000.0f + cM_rndF(1000.0f))));
|
||||
field_0x3072 += (s16)(1000.0f + cM_rndF(500.0f) + (var_f31 * (3000.0f + cM_rndF(1000.0f))));
|
||||
field_0x3074 += (s16)(1000.0f + cM_rndF(500.0f) + (var_f31 * (5000.0f + cM_rndF(1500.0f))));
|
||||
field_0x3076 += (s16)(1000.0f + cM_rndF(500.0f) + (var_f31 * (5000.0f + cM_rndF(1500.0f))));
|
||||
ANGLE_ADD(field_0x3070, 1000.0f + cM_rndF(500.0f) + (var_f31 * (3000.0f + cM_rndF(1000.0f))));
|
||||
ANGLE_ADD(field_0x3072, 1000.0f + cM_rndF(500.0f) + (var_f31 * (3000.0f + cM_rndF(1000.0f))));
|
||||
ANGLE_ADD(field_0x3074, 1000.0f + cM_rndF(500.0f) + (var_f31 * (5000.0f + cM_rndF(1500.0f))));
|
||||
ANGLE_ADD(field_0x3076, 1000.0f + cM_rndF(500.0f) + (var_f31 * (5000.0f + cM_rndF(1500.0f))));
|
||||
|
||||
temp_f27 = 1.0f / temp_f27;
|
||||
param_0->x *= temp_f27;
|
||||
@@ -3148,7 +3148,7 @@ s16 daAlink_c::getNeckAimAngle(cXyz* param_0, s16* param_1, s16* param_2, s16* p
|
||||
s16 sp18;
|
||||
s16 sp16 = mPrevAngleY + mBodyAngle.y;
|
||||
if ((mProcID == PROC_GOAT_CATCH && mProcVar1.field_0x300a == 0) || (mProcID == PROC_HAND_PAT && mProcVar2.field_0x300c == 0)) {
|
||||
ADD_ANGLE_2(sp16, 0x8000);
|
||||
ANGLE_ADD_2(sp16, 0x8000);
|
||||
}
|
||||
|
||||
cXyz sp28 = eyePos - field_0x34e0;
|
||||
@@ -3233,8 +3233,8 @@ s16 daAlink_c::getNeckAimAngle(cXyz* param_0, s16* param_1, s16* param_2, s16* p
|
||||
*param_4 = sp8;
|
||||
}
|
||||
|
||||
*param_3 += (s16)(sp10 - temp_r24);
|
||||
*param_4 += (s16)(spE - var_r28);
|
||||
ANGLE_ADD(*param_3, sp10 - temp_r24);
|
||||
ANGLE_ADD(*param_4, spE - var_r28);
|
||||
|
||||
if (checkEndResetFlg0(ERFLG0_UNK_4000)) {
|
||||
*param_3 = (sp10 + 0x8000) - sp14;
|
||||
@@ -3302,7 +3302,7 @@ void daAlink_c::setEyeMove(cXyz* param_0, s16 param_1, s16 param_2) {
|
||||
field_0x341c = 0.0f;
|
||||
} else {
|
||||
s16 temp_r29_2 = cM_atan2s(field_0x3418, field_0x341c);
|
||||
temp_r29_2 += (s16)(((int)cM_rndF(3.0f) << 13) + 0x6000);
|
||||
ANGLE_ADD(temp_r29_2, ((int)cM_rndF(3.0f) << 13) + 0x6000);
|
||||
|
||||
field_0x3418 = cM_ssin(temp_r29_2);
|
||||
field_0x341c = cM_scos(temp_r29_2);
|
||||
@@ -3929,9 +3929,9 @@ void daAlink_c::footBgCheck() {
|
||||
|
||||
if ((sp10 * var_r29->field_0x6) < 0 && abs(sp10 - var_r29->field_0x6) >= 0x8000) {
|
||||
if (sp10 >= 0) {
|
||||
sp10 -= (s16)0x4000;
|
||||
ANGLE_SUB(sp10, 0x4000);
|
||||
} else {
|
||||
sp10 += (s16)0x4000;
|
||||
ANGLE_ADD(sp10, 0x4000);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -383,7 +383,7 @@ int daAlink_c::procCanoeRide() {
|
||||
if (checkAnmEnd(frameCtrl)) {
|
||||
procCanoeWaitInit(1);
|
||||
} else if (frameCtrl->getFrame() < 9.0f) {
|
||||
mProcVar3.field_0x300e += (s16)0x180;
|
||||
ANGLE_ADD(mProcVar3.field_0x300e, 0x180);
|
||||
|
||||
if (mProcVar0.field_0x3008 == 0) {
|
||||
canoe->incShapeAngleZ(-mProcVar3.field_0x300e);
|
||||
@@ -483,11 +483,11 @@ int daAlink_c::procCanoeGetOffInit() {
|
||||
}
|
||||
|
||||
if (var_r27) {
|
||||
shape_angle.y -= (s16)0x4000;
|
||||
ANGLE_SUB(shape_angle.y, 0x4000);
|
||||
setOldRootQuaternion(0, 0x4000, 0);
|
||||
var_r28->mTranslate.x -= 100.0f;
|
||||
} else {
|
||||
shape_angle.y += (s16)0x4000;
|
||||
ANGLE_ADD(shape_angle.y, 0x4000);
|
||||
setOldRootQuaternion(0, -0x4000, 0);
|
||||
var_r28->mTranslate.x += 100.0f;
|
||||
}
|
||||
|
||||
@@ -45,11 +45,11 @@ void daAlink_c::freezeTimerDamage() {
|
||||
}
|
||||
|
||||
if (escapeTrigger()) {
|
||||
mProcVar0.field_0x3008 -= (s16)2;
|
||||
S16_SUB(mProcVar0.field_0x3008, 2);
|
||||
}
|
||||
|
||||
if (checkInputOnR() && abs((s16)(mStickAngle - mPrevStickAngle)) > 0x1000) {
|
||||
mProcVar0.field_0x3008 -= (s16)2;
|
||||
S16_SUB(mProcVar0.field_0x3008, 2);
|
||||
}
|
||||
|
||||
if (mProcVar0.field_0x3008 < 0) {
|
||||
@@ -504,7 +504,7 @@ BOOL daAlink_c::checkDamageAction() {
|
||||
poly_dmg_flags = 0;
|
||||
}
|
||||
} else if (mIceDamageWaitTimer > 3) {
|
||||
mIceDamageWaitTimer -= (s16)3;
|
||||
S16_SUB(mIceDamageWaitTimer, 3);
|
||||
} else {
|
||||
mIceDamageWaitTimer = 0;
|
||||
}
|
||||
@@ -1656,7 +1656,7 @@ int daAlink_c::procCoElecDamageInit(fopAc_ac_c* i_tgHitActor, dCcD_GObjInf* i_tg
|
||||
|
||||
if (getZoraSwim()) {
|
||||
current.pos.y += 50.0f;
|
||||
field_0x3080 += (s16)0x4000;
|
||||
ANGLE_ADD(field_0x3080, 0x4000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4148,7 +4148,7 @@ int daAlink_c::procDungeonWarpInit() {
|
||||
}
|
||||
|
||||
int daAlink_c::procDungeonWarp() {
|
||||
mProcVar2.field_0x300c += (s16)0x200;
|
||||
ANGLE_ADD(mProcVar2.field_0x300c, 0x200);
|
||||
|
||||
if (mProcVar2.field_0x300c > 0x4000) {
|
||||
mProcVar2.field_0x300c = 0x4000;
|
||||
@@ -4157,7 +4157,7 @@ int daAlink_c::procDungeonWarp() {
|
||||
}
|
||||
|
||||
f32 sin = cM_ssin(mProcVar2.field_0x300c);
|
||||
shape_angle.y += (s16)(14336.0f * sin);
|
||||
ANGLE_ADD(shape_angle.y, 0x3800 * sin);
|
||||
mProcVar3.field_0x300e = 8.0f * sin + 24.0f * (1.0f - scale.x);
|
||||
|
||||
if (mProcVar5.field_0x3012 != 0) {
|
||||
@@ -4256,7 +4256,7 @@ int daAlink_c::procDungeonWarpSceneStart() {
|
||||
}
|
||||
|
||||
f32 sin = cM_ssin(mProcVar2.field_0x300c);
|
||||
shape_angle.y += (s16)(sin * 14336.0f);
|
||||
ANGLE_ADD(shape_angle.y, sin * (f32)0x3800);
|
||||
mProcVar3.field_0x300e = (sin * 8.0f) + ((1.0f - scale.x) * 24.0f);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -492,10 +492,10 @@ void daAlink_c::setCarryArmAngle(f32 param_0, f32 param_1) {
|
||||
field_0x3136[1].set(0, 0, temp_r29 - (3500.0f * param_1));
|
||||
|
||||
if (param_1 < 0.0f) {
|
||||
field_0x312a[0].z += (s16)(2500.0f * param_1);
|
||||
field_0x3136[0].y += (s16)(2000.0f * param_1);
|
||||
ANGLE_ADD(field_0x312a[0].z, 2500.0f * param_1);
|
||||
ANGLE_ADD(field_0x3136[0].y, 2000.0f * param_1);
|
||||
} else {
|
||||
field_0x3136[0].y += (s16)(4000.0f * param_1);
|
||||
ANGLE_ADD(field_0x3136[0].y, 4000.0f * param_1);
|
||||
}
|
||||
} else if (checkGrabRooster()) {
|
||||
field_0x3136[0].y = -5000.0f * param_1;
|
||||
|
||||
@@ -330,7 +330,7 @@ int daAlink_c::procGuardSlip() {
|
||||
setShapeAngleToAtnActor(0);
|
||||
|
||||
if (mProcVar1.field_0x300a != 0) {
|
||||
mProcVar1.field_0x300a -= (s16)1;
|
||||
S16_SUB(mProcVar1.field_0x300a, 1);
|
||||
mBodyAngle.y += mProcVar2.field_0x300c;
|
||||
mBodyAngle.x += mProcVar3.field_0x300e;
|
||||
}
|
||||
|
||||
@@ -1835,8 +1835,8 @@ int daAlink_c::setMoveBGClimbCorrect() {
|
||||
|
||||
current.pos.x = mLinkLinChk.GetCross().x;
|
||||
current.pos.z = mLinkLinChk.GetCross().z;
|
||||
current.angle.y += (s16)(shape_angle.y - temp_r28);
|
||||
field_0x308c += (s16)(temp_r28 - shape_angle.y);
|
||||
ANGLE_ADD(current.angle.y, shape_angle.y - temp_r28);
|
||||
ANGLE_ADD(field_0x308c, temp_r28 - shape_angle.y);
|
||||
|
||||
mPolyInfo1.SetPolyInfo(mLinkLinChk);
|
||||
}
|
||||
|
||||
@@ -732,7 +732,7 @@ int daAlink_c::setHookshotHangMoveBGCollect() {
|
||||
mDoMtx_stack_c::multVec(&field_0x37c8, &mIronBallBgChkPos);
|
||||
|
||||
current.pos += mIronBallBgChkPos - sp28;
|
||||
shape_angle.y += (s16)(mProcVar0.field_0x3008 - carry_actor->shape_angle.y);
|
||||
ANGLE_ADD(shape_angle.y, mProcVar0.field_0x3008 - carry_actor->shape_angle.y);
|
||||
current.angle.y = shape_angle.y;
|
||||
mProcVar0.field_0x3008 = carry_actor->shape_angle.y;
|
||||
} else if (dComIfG_Bgsp().ChkPolySafe(*polyinfo)) {
|
||||
|
||||
@@ -1135,11 +1135,11 @@ void daAlink_c::boarForceGetOff() {
|
||||
|
||||
void daAlink_c::horseGetOffEnd() {
|
||||
if (field_0x2fc0 == 0) {
|
||||
shape_angle.y -= (s16)0x4000;
|
||||
ANGLE_SUB(shape_angle.y, 0x4000);
|
||||
setOldRootQuaternion(0, 0x4000, 0);
|
||||
mDoMtx_stack_c::YrotS(-0x4000);
|
||||
} else {
|
||||
shape_angle.y += (s16)0x4000;
|
||||
ANGLE_ADD(shape_angle.y, 0x4000);
|
||||
setOldRootQuaternion(0, -0x4000, 0);
|
||||
mDoMtx_stack_c::YrotS(0x4000);
|
||||
}
|
||||
@@ -1587,7 +1587,7 @@ int daAlink_c::procHorseGetOff() {
|
||||
if (rideActor != NULL) {
|
||||
current.pos += rideActor->current.pos - field_0x37d4;
|
||||
field_0x37d4 = rideActor->current.pos;
|
||||
shape_angle.y += (s16)(mProcVar3.field_0x300e - rideActor->shape_angle.y);
|
||||
ANGLE_ADD(shape_angle.y, mProcVar3.field_0x300e - rideActor->shape_angle.y);
|
||||
mProcVar3.field_0x300e = rideActor->shape_angle.y;
|
||||
}
|
||||
|
||||
@@ -2706,9 +2706,9 @@ int daAlink_c::procHorseRun() {
|
||||
|
||||
if (horse->checkRodeoLeft()) {
|
||||
if (mProcVar3.field_0x300e != 0) {
|
||||
mProcVar5.field_0x3012 -= (s16)150;
|
||||
S16_SUB(mProcVar5.field_0x3012, 150);
|
||||
} else {
|
||||
mProcVar5.field_0x3012 -= (s16)600;
|
||||
S16_SUB(mProcVar5.field_0x3012, 600);
|
||||
}
|
||||
|
||||
if (mProcVar2.field_0x300c == 0) {
|
||||
@@ -2716,9 +2716,9 @@ int daAlink_c::procHorseRun() {
|
||||
}
|
||||
} else {
|
||||
if (mProcVar3.field_0x300e != 0) {
|
||||
mProcVar5.field_0x3012 += (s16)150;
|
||||
S16_ADD(mProcVar5.field_0x3012, 150);
|
||||
} else {
|
||||
mProcVar5.field_0x3012 += (s16)600;
|
||||
S16_ADD(mProcVar5.field_0x3012, 600);
|
||||
}
|
||||
|
||||
if (mProcVar2.field_0x300c == 0) {
|
||||
@@ -2744,7 +2744,7 @@ int daAlink_c::procHorseRun() {
|
||||
daPy_frameCtrl_c* framectrl = &mUnderFrameCtrl[0];
|
||||
f32 temp_f31 = framectrl->getFrame() / framectrl->getEnd();
|
||||
|
||||
mProcVar4.field_0x3010 = (field_0x3478 * (1.0f + cM_fsin((M_PI*2) * (temp_f31 - 0.69999999f)))) + (4000.0f * (1.0f - fabsf(0.000099999997f * mProcVar5.field_0x3012)));
|
||||
mProcVar4.field_0x3010 = (field_0x3478 * (1.0f + cM_fsin((M_PI*2) * (temp_f31 - 0.7f)))) + (4000.0f * (1.0f - fabsf(0.0001f * mProcVar5.field_0x3012)));
|
||||
field_0x3088 = field_0x3478 * (1.0f + cM_fsin((M_PI*2) * (temp_f31 - 1.0f)));
|
||||
|
||||
if (framectrl->checkPass(0.0f)) {
|
||||
|
||||
@@ -378,7 +378,7 @@ int daAlink_c::procMagneBootsFly() {
|
||||
|
||||
cLib_addCalcAngleS(&shape_angle.x, sp24.atan2sY_XZ() + -0x4000, 5, 0x1000, 0x100);
|
||||
cLib_addCalcAngleS(&shape_angle.y, sp24.atan2sX_Z(), 5, 0x1000, 0x100);
|
||||
mProcVar2.field_0x300c += (s16)0x1C00;
|
||||
ANGLE_ADD(mProcVar2.field_0x300c, 0x1C00);
|
||||
}
|
||||
|
||||
return 1;
|
||||
|
||||
@@ -875,7 +875,7 @@ BOOL daAlink_c::checkSwimNeckUpDown() const {
|
||||
}
|
||||
|
||||
void daAlink_c::setSwimUpDownOffset() {
|
||||
mProcVar2.field_0x300c += (s16)((cM_rndF(0.3f) + 0.85f) * 2330.0f);
|
||||
ANGLE_ADD(mProcVar2.field_0x300c, (cM_rndF(0.3f) + 0.85f) * 2330.0f);
|
||||
|
||||
f32 var_f1;
|
||||
if (checkWolf()) {
|
||||
|
||||
@@ -1774,9 +1774,9 @@ void daAlink_c::wolfBgCheck() {
|
||||
if (field_0x2fa6 == 0 && !checkEndResetFlg1(ERFLG1_UNK_200000)) {
|
||||
s16 var_r27 = field_0x3092 - shape_angle.y;
|
||||
if (var_r27 <= 0) {
|
||||
var_r27 += (s16)0x4000;
|
||||
ANGLE_ADD(var_r27, 0x4000);
|
||||
} else {
|
||||
var_r27 -= (s16)0x4000;
|
||||
ANGLE_SUB(var_r27, 0x4000);
|
||||
}
|
||||
|
||||
mPrevAngleY += var_r27;
|
||||
|
||||
@@ -357,7 +357,7 @@ void daArrow_c::clearNearActorData() {
|
||||
s16 daArrow_c::getVibAngle() {
|
||||
s16 angle;
|
||||
if (cLib_calcTimer(&field_0x952)) {
|
||||
field_0x954 += (s16)(21243.0f - cM_rndF(4096.0f));
|
||||
ANGLE_ADD(field_0x954, 21243.0f - cM_rndF(4096.0f));
|
||||
|
||||
f32 f = field_0x952 * 0.02f;
|
||||
angle = f * 1024.0f * f * cM_ssin(field_0x954);
|
||||
|
||||
@@ -2091,9 +2091,9 @@ bool daB_DR_c::mFeintBreath() {
|
||||
field_0x718++;
|
||||
} else {
|
||||
if (field_0x756 > 0) {
|
||||
temp_r30 += (s16)(l_HIO.feint_angle * 0xB6);
|
||||
ANGLE_ADD(temp_r30, l_HIO.feint_angle * 0xB6);
|
||||
} else {
|
||||
temp_r30 -= (s16)(l_HIO.feint_angle * 0xB6);
|
||||
ANGLE_SUB(temp_r30, l_HIO.feint_angle * 0xB6);
|
||||
}
|
||||
|
||||
if (abs((s16)(current.angle.y - temp_r30)) > 0x100) {
|
||||
@@ -3327,7 +3327,8 @@ void daB_DR_c::executeBullet() {
|
||||
if (parentActorID != 0) {
|
||||
daB_DR_c* dr_p = (daB_DR_c*)fopAcM_SearchByID(fopAcM_GetLinkId(this));
|
||||
if (dr_p != NULL) {
|
||||
current.angle.y -= (s16)((s16)(dr_p->mHeadAngle.y - home.angle.y) * (0.002f + JREG_F(13)));
|
||||
ANGLE_SUB(current.angle.y,
|
||||
(s16)(dr_p->mHeadAngle.y - home.angle.y) * (0.002f + JREG_F(13)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3357,7 +3358,7 @@ void daB_DR_c::executeParts() {
|
||||
switch (mMoveMode) {
|
||||
case 0:
|
||||
speedF = 20.0f + ZREG_F(13) + cM_rndF(10.0f + ZREG_F(14));
|
||||
current.angle.y += (s16)cM_rndFX(65536.0f);
|
||||
ANGLE_ADD(current.angle.y, cM_rndFX(65536.0f));
|
||||
speed.y = 30.0f + ZREG_F(10);
|
||||
speed.y += cM_rndFX(10.0f + ZREG_F(11));
|
||||
|
||||
@@ -3396,11 +3397,11 @@ void daB_DR_c::executeParts() {
|
||||
case 10:
|
||||
speedF = 40.0f + ZREG_F(13) + cM_rndF(10.0f + ZREG_F(14));
|
||||
mTimer[0] = 50;
|
||||
current.angle.x += (s16)cM_rndFX(16384.0f);
|
||||
ANGLE_ADD(current.angle.x, cM_rndFX(16384.0f));
|
||||
|
||||
mae = camera->lookat.center - current.pos;
|
||||
current.angle.y = mae.atan2sX_Z();
|
||||
current.angle.y += (s16)cM_rndFX(16384.0f);
|
||||
ANGLE_ADD(current.angle.y, cM_rndFX(16384.0f));
|
||||
|
||||
cMtx_YrotS(*calc_mtx, current.angle.y);
|
||||
cMtx_XrotM(*calc_mtx, current.angle.x);
|
||||
|
||||
@@ -590,7 +590,7 @@ void daB_DS_c::mZsMoveChk() {
|
||||
}
|
||||
|
||||
angle_y = fopAcM_searchPlayerAngleY(this);
|
||||
angle_y += (s16)cM_rndFX(0x2000);
|
||||
ANGLE_ADD(angle_y, cM_rndFX(0x2000));
|
||||
}
|
||||
|
||||
if (!daPy_getPlayerActorClass()->checkSpinnerRide() || mAction == ACT_DAMAGE ||
|
||||
@@ -1044,7 +1044,7 @@ void daB_DS_c::neck_set() {
|
||||
angl.x = -mae.atan2sY_XZ() * 2.0f;
|
||||
if (mAction == ACT_BREATH_ATTACK) {
|
||||
angl.x = mBh2AttackAngleF;
|
||||
angl.x += (s16)(mBackboneLevel * 200);
|
||||
ANGLE_ADD(angl.x, mBackboneLevel * 200);
|
||||
}
|
||||
|
||||
if (angl.x > 0x2000) {
|
||||
@@ -5156,7 +5156,7 @@ int daB_DS_c::execute() {
|
||||
|
||||
if (!mIsOpeningDemo) {
|
||||
s16 hand_x_ang_target = -6000;
|
||||
hand_x_ang_target += (s16)(mBackboneLevel * 1000);
|
||||
ANGLE_ADD(hand_x_ang_target, mBackboneLevel * 1000);
|
||||
if (handX_ang > -4000) {
|
||||
handX_ang = -4000;
|
||||
}
|
||||
@@ -5178,7 +5178,7 @@ int daB_DS_c::execute() {
|
||||
}
|
||||
|
||||
if (jnt_pos.y < chk_pos.y) {
|
||||
handL_ang += (s16)(fabsf(jnt_pos.y - chk_pos.y) * 10.0f);
|
||||
ANGLE_ADD(handL_ang, fabsf(jnt_pos.y - chk_pos.y) * 10.0f);
|
||||
var_r25 = true;
|
||||
|
||||
if (field_0x84d & 1) {
|
||||
@@ -5201,7 +5201,7 @@ int daB_DS_c::execute() {
|
||||
}
|
||||
|
||||
if (jnt_pos.y < chk_pos.y) {
|
||||
handR_ang += (s16)(fabsf(jnt_pos.y - chk_pos.y) * 10.0f);
|
||||
ANGLE_ADD(handR_ang, fabsf(jnt_pos.y - chk_pos.y) * 10.0f);
|
||||
var_r25 = true;
|
||||
if (field_0x84d & 2) {
|
||||
if ((int)mpMorf->getFrame() >= 34 && (int)mpMorf->getFrame() < 41) {
|
||||
|
||||
@@ -2905,7 +2905,7 @@ void daB_GG_c::G_DamageAction() {
|
||||
speedF = 0.0f;
|
||||
}
|
||||
|
||||
s_TargetAngle += (s16) 0x4000;
|
||||
ANGLE_ADD(s_TargetAngle, 0x4000);
|
||||
break;
|
||||
case 2:
|
||||
cXyz* tg_hit_pos;
|
||||
@@ -3789,7 +3789,7 @@ void daB_GG_c::At_Check() {
|
||||
mAtInfo.mAttackPower = 80;
|
||||
}
|
||||
|
||||
health -= (s16)mAtInfo.mAttackPower;
|
||||
S16_SUB(health, mAtInfo.mAttackPower);
|
||||
}
|
||||
|
||||
int pause_time;
|
||||
|
||||
@@ -865,7 +865,7 @@ static void b_gnd_h_run_a(b_gnd_class* i_this) {
|
||||
i_this->field_0xc92 = cM_rndF(600.0f) + 300.0f;
|
||||
}
|
||||
|
||||
i_this->field_0x5cc += (s16)(var_f30 * cM_ssin(i_this->field_0xc90));
|
||||
ANGLE_ADD(i_this->field_0x5cc, var_f30 * cM_ssin(i_this->field_0xc90));
|
||||
}
|
||||
|
||||
if (i_this->field_0xc72 != 0) {
|
||||
|
||||
@@ -840,9 +840,9 @@ void daB_MGN_c::checkDownBeforeBG() {
|
||||
s16 var_r28 = (s16)cM_atan2s(var_r29->x, var_r29->z);
|
||||
if (abs((s16)(var_r28 - shape_angle.y)) > 0x5000) {
|
||||
if ((s16)(var_r28 - shape_angle.y) != 0) {
|
||||
field_0xa92 -= (s16)0x300;
|
||||
ANGLE_SUB(field_0xa92, 0x300);
|
||||
} else {
|
||||
field_0xa92 += (s16)0x300;
|
||||
ANGLE_ADD(field_0xa92, 0x300);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1546,9 +1546,9 @@ void daB_MGN_c::executeDash() {
|
||||
}
|
||||
|
||||
if ((s16)(mAcchCir.GetWallAngleY() - shape_angle.y) < 0) {
|
||||
shape_angle.y += (s16) 0x100;
|
||||
ANGLE_ADD(shape_angle.y, 0x100);
|
||||
} else {
|
||||
shape_angle.y += (s16) -0x100;
|
||||
ANGLE_ADD(shape_angle.y, -0x100);
|
||||
}
|
||||
|
||||
current.angle.y = shape_angle.y;
|
||||
|
||||
@@ -256,7 +256,7 @@ static void attack(b_oh_class* i_this) {
|
||||
cLib_addCalcAngleS2(&i_this->field_0xca4, var3, 1, 500);
|
||||
|
||||
if (i_this->mTimers[1] == 0 || i_this->mTimers[1] > 10) {
|
||||
i_this->current.angle.y += (s16)(i_this->field_0xc88 * 300);
|
||||
ANGLE_ADD(i_this->current.angle.y, i_this->field_0xc88 * 300);
|
||||
}
|
||||
|
||||
if (i_this->mActionPhase == 2) {
|
||||
@@ -511,10 +511,10 @@ static void action(b_oh_class* i_this) {
|
||||
(-a_this->field_0x614 - a_this->field_0x60c) + cM_ssin(a_this->field_0x5cc * 200) * 100.0f;
|
||||
a_this->field_0x604 = ((100.0f - a_this->field_0x614) - a_this->field_0x60c) +
|
||||
cM_ssin(a_this->field_0x5cc * 200) * 100.0f;
|
||||
a_this->field_0x5f8 += (s16)a_this->field_0x600;
|
||||
a_this->field_0x5fa += (s16)a_this->field_0x604;
|
||||
ANGLE_ADD(a_this->field_0x5f8, a_this->field_0x600);
|
||||
ANGLE_ADD(a_this->field_0x5fa, a_this->field_0x604);
|
||||
a_this->field_0x5fc = a_this->field_0x60c + 2000.0f;
|
||||
a_this->field_0x5f6 += (s16)a_this->field_0x5fc;
|
||||
ANGLE_ADD(a_this->field_0x5f6, a_this->field_0x5fc);
|
||||
|
||||
cLib_addCalc0(&a_this->field_0x60c, 0.1f, 50.0f);
|
||||
cLib_addCalc2(&a_this->field_0x610, 0.2f, 0.1f, 0.01f);
|
||||
|
||||
@@ -1334,7 +1334,7 @@ void daB_YO_c::calcFreeMove(f32 param_0) {
|
||||
}
|
||||
|
||||
void daB_YO_c::setReflectAngle() {
|
||||
current.angle.y += (s16)cM_rndFX(4000.0f);
|
||||
ANGLE_ADD(current.angle.y, cM_rndFX(4000.0f));
|
||||
s16 angle_diff = current.angle.y - mWallAngle;
|
||||
if (abs(angle_diff) > 0x4800) {
|
||||
current.angle.y = mWallAngle * 2 - (current.angle.y + 0x8000);
|
||||
|
||||
@@ -918,8 +918,8 @@ int daBoomerang_c::procWait() {
|
||||
} else {
|
||||
offStateFlg0(FLG0_10);
|
||||
}
|
||||
|
||||
current.angle.y += (s16)0x1830;
|
||||
|
||||
ANGLE_ADD(current.angle.y, 0x1830);
|
||||
shape_angle.x = current.angle.x;
|
||||
shape_angle.y = current.angle.y;
|
||||
shape_angle.z = 0x1000;
|
||||
|
||||
@@ -1237,16 +1237,16 @@ void daCow_c::action_run() {
|
||||
|
||||
switch (mAction) {
|
||||
case daCow_c::Action_NadeNade:
|
||||
SUB_ANGLE_2(targetAngle, 0x1000);
|
||||
ANGLE_SUB_2(targetAngle, 0x1000);
|
||||
break;
|
||||
case daCow_c::Action_Cry:
|
||||
ADD_ANGLE_2(targetAngle, 0x1000);
|
||||
ANGLE_ADD_2(targetAngle, 0x1000);
|
||||
break;
|
||||
case daCow_c::Action_3:
|
||||
SUB_ANGLE_2(targetAngle, 0x4000);
|
||||
ANGLE_SUB_2(targetAngle, 0x4000);
|
||||
break;
|
||||
case daCow_c::Action_4:
|
||||
ADD_ANGLE_2(targetAngle, 0x4000);
|
||||
ANGLE_ADD_2(targetAngle, 0x4000);
|
||||
break;
|
||||
case daCow_c::Action_Wait:
|
||||
s16 cowshedAngle = getCowshedAngle();
|
||||
@@ -2174,11 +2174,11 @@ void daCow_c::executeCrazyThrow() {
|
||||
|
||||
if (mAction != daCow_c::Action_Wait) {
|
||||
setBck(daCow_c::Animation_DownR, J3DFrameCtrl::EMode_LOOP, 0.0f, 1.0f);
|
||||
mSavedAngle.y -= (s16)0x7000;
|
||||
ANGLE_SUB(mSavedAngle.y, 0x7000);
|
||||
mThrowIntensity = -1000;
|
||||
} else {
|
||||
setBck(daCow_c::Animation_DownL, J3DFrameCtrl::EMode_LOOP, 0.0f, 1.0f);
|
||||
mSavedAngle.y += (s16)0x7000;
|
||||
ANGLE_ADD(mSavedAngle.y, 0x7000);
|
||||
mThrowIntensity = 1000;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1043,7 +1043,7 @@ void daCstatue_c::initStartBrkBtk() {
|
||||
for (int iParticle = 0; iParticle < 2; iParticle++) {
|
||||
dComIfGp_particle_set(0x88bb, &mBallPos, &angle, NULL);
|
||||
dComIfGp_particle_set(0x88bc, &mBallPos, &angle, NULL);
|
||||
ADD_ANGLE_2(angle.y, 0x8000);
|
||||
ANGLE_ADD_2(angle.y, 0x8000);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -418,7 +418,7 @@ void daSpiral_c::initProc(int param_0) {
|
||||
void daSpiral_c::initOpenDemo(int param_0) {
|
||||
shape_angle.y = current.angle.y;
|
||||
if (field_0x62c == 1) {
|
||||
shape_angle.y += (s16)0x7FFF;
|
||||
ANGLE_ADD(shape_angle.y, 0x7FFF);
|
||||
}
|
||||
|
||||
mStaffId = dComIfGp_evmng_getMyStaffId("SHUTTER_DOOR", NULL, 0);
|
||||
@@ -559,7 +559,7 @@ int daSpiral_c::actionWait() {
|
||||
fopAc_ac_c* door = dComIfGp_event_getDoorPartner();
|
||||
if (door == this) {
|
||||
shape_angle.y = current.angle.y;
|
||||
shape_angle.y += (s16)0x7FFF;
|
||||
ANGLE_ADD(shape_angle.y, 0x7FFF);
|
||||
mStaffId = dComIfGp_evmng_getMyStaffId("PARTNER_DOOR", NULL, 0);
|
||||
setAction(daSpiral_ACT_DEMO_e);
|
||||
eventInfo.setEventId(mEventIds[mDemoMode]);
|
||||
@@ -573,7 +573,7 @@ int daSpiral_c::actionWait() {
|
||||
mStaffId = dComIfGp_evmng_getMyStaffId("SHUTTER_DOOR", NULL, 0);
|
||||
shape_angle.y = current.angle.y;
|
||||
if (field_0x62c == 1) {
|
||||
shape_angle.y += (s16)0x7FFF;
|
||||
ANGLE_ADD(shape_angle.y, 0x7FFF);
|
||||
}
|
||||
setAction(daSpiral_ACT_DEMO_e);
|
||||
demoProc();
|
||||
@@ -667,10 +667,10 @@ void daSpiral_c::setNextSpiral() {
|
||||
s16 pl_angle = (s16)door->current.angle.y;
|
||||
if (mType == daSpiral_TYPE_DOWN_e) {
|
||||
pl_pos = l_spiral_path_point_u[0];
|
||||
pl_angle += (s16)0x4000;
|
||||
ANGLE_ADD(pl_angle, 0x4000);
|
||||
} else {
|
||||
pl_pos = l_spiral_path_point_d[0];
|
||||
pl_angle -= (s16)0x4000;
|
||||
ANGLE_SUB(pl_angle, 0x4000);
|
||||
}
|
||||
|
||||
mDoMtx_stack_c::transS(door->current.pos.x, door->current.pos.y, door->current.pos.z);
|
||||
@@ -829,7 +829,7 @@ void daSpiral_c::debugDraw() {
|
||||
|
||||
s16 var_r25 = current.angle.y;
|
||||
if (field_0x62c == 1) {
|
||||
var_r25 += (s16)0x7FFF;
|
||||
ANGLE_ADD(var_r25, 0x7FFF);
|
||||
}
|
||||
|
||||
mDoMtx_stack_c::YrotS(var_r25);
|
||||
@@ -1083,7 +1083,7 @@ void dSpiral_stop_c::calcMtx(daSpiral_c* i_spiral) {
|
||||
|
||||
s16 angle = i_spiral->current.angle.y;
|
||||
if (field_0x72 == 1) {
|
||||
angle += (s16)0x7FFF;
|
||||
ANGLE_ADD(angle, 0x7FFF);
|
||||
}
|
||||
|
||||
mDoMtx_stack_c::transS(pos.x, pos.y, pos.z);
|
||||
|
||||
@@ -200,10 +200,10 @@ static void hit_check(e_arrow_class* i_this) {
|
||||
i_this->speedF *= 0.3f;
|
||||
|
||||
if (i_this->mCcTgSph.ChkTgHit()) {
|
||||
i_this->current.angle.y += (s16)(cM_rndFX(8000.0f) + 32768.0f);
|
||||
ANGLE_ADD(i_this->current.angle.y, cM_rndFX(8000.0f) + 32768.0f);
|
||||
i_this->mSound.startSound(Z2SE_COL_FLIP_ARROW, 0, -1);
|
||||
} else {
|
||||
i_this->current.angle.y += (s16)(cM_rndFX(4000.0f) + 32768.0f);
|
||||
ANGLE_ADD(i_this->current.angle.y, cM_rndFX(4000.0f) + 32768.0f);
|
||||
}
|
||||
|
||||
dKy_Sound_set(i_this->current.pos, 3, fopAcM_GetID(i_this), 10);
|
||||
@@ -470,7 +470,7 @@ static void e_arrow_demo_bound(e_arrow_class* i_this) {
|
||||
}
|
||||
|
||||
if (i_this->field_0xa0c > 0) {
|
||||
a_this->shape_angle.x += (s16)i_this->field_0xa10;
|
||||
ANGLE_ADD(a_this->shape_angle.x, i_this->field_0xa10);
|
||||
|
||||
if (a_this->shape_angle.x > i_this->field_0xa0c ||
|
||||
a_this->shape_angle.x < (s16)-i_this->field_0xa0c)
|
||||
|
||||
@@ -497,7 +497,7 @@ static void bee_control(e_bee_class* i_this) {
|
||||
} else {
|
||||
daPy_py_c* player = daPy_getPlayerActorClass();
|
||||
if (cc_pl_cut_bit_get() == 0x80) {
|
||||
i_this->mBoomerangAngle += (s16)0x1400;
|
||||
ANGLE_ADD(i_this->mBoomerangAngle, 0x1400);
|
||||
vec1.z = 150.0f + TREG_F(15);
|
||||
} else {
|
||||
vec1.z = 100.0f + TREG_F(12);
|
||||
|
||||
@@ -1227,11 +1227,11 @@ int daE_BG_c::execute() {
|
||||
mIsBomb = true;
|
||||
|
||||
if (field_0x694 < 30) {
|
||||
field_0x698 += (s16)0x1000;
|
||||
ANGLE_ADD(field_0x698, 0x1000);
|
||||
} else if (field_0x694 < 45) {
|
||||
field_0x698 += (s16)0x800;
|
||||
ANGLE_ADD(field_0x698, 0x800);
|
||||
} else {
|
||||
field_0x698 += (s16)0x300;
|
||||
ANGLE_ADD(field_0x698, 0x300);
|
||||
}
|
||||
|
||||
if (field_0x694 == 0) {
|
||||
|
||||
@@ -373,13 +373,13 @@ static void e_bi_ex(e_bi_class* i_this) {
|
||||
if (i_this->ignition_time != 0) {
|
||||
i_this->ignition_time--;
|
||||
i_this->sound.startCreatureSoundLevel(Z2SE_OBJ_BOMB_IGNITION, 0, -1);
|
||||
i_this->field_0x696 += (s16) 0x1100;
|
||||
ANGLE_ADD(i_this->field_0x696, 0x1100);
|
||||
|
||||
if (i_this->ignition_time < 45) {
|
||||
i_this->field_0x696 += (s16) 0x1100;
|
||||
ANGLE_ADD(i_this->field_0x696, 0x1100);
|
||||
|
||||
if (i_this->ignition_time < 30) {
|
||||
i_this->field_0x696 += (s16) 0x1100;
|
||||
ANGLE_ADD(i_this->field_0x696, 0x1100);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -628,7 +628,7 @@ static s8 e_bu_head(e_bu_class* i_this) {
|
||||
actor->speedF *= 0.5f;
|
||||
actor->speed.y = 30.0f;
|
||||
i_this->mode = 2;
|
||||
i_this->head_rot_y += (s16)cM_rndFX(10000.0f);
|
||||
ANGLE_ADD(i_this->head_rot_y, cM_rndFX(10000.0f));
|
||||
|
||||
if (cM_rndF(1.0f) < 0.5f) {
|
||||
i_this->field_0x6bc = 0x4000;
|
||||
@@ -641,7 +641,7 @@ static s8 e_bu_head(e_bu_class* i_this) {
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
i_this->head_rot_x += (s16)(actor->speedF * (400.0f + AREG_F(1)));
|
||||
ANGLE_ADD(i_this->head_rot_x, actor->speedF * (400.0f + AREG_F(1)));
|
||||
|
||||
if (!i_this->acch.ChkGroundHit()) {
|
||||
break;
|
||||
@@ -650,7 +650,7 @@ static s8 e_bu_head(e_bu_class* i_this) {
|
||||
i_this->mode = 3;
|
||||
actor->speed.y = 20.0f;
|
||||
case 3:
|
||||
i_this->head_rot_x += (s16)(actor->speedF * (400.0f + AREG_F(1)));
|
||||
ANGLE_ADD(i_this->head_rot_x, actor->speedF * (400.0f + AREG_F(1)));
|
||||
i_this->head_rot_y += i_this->field_0x6b8;
|
||||
|
||||
cLib_addCalc2(&actor->speedF, 10.0f, 1.0f, 2.0f + TREG_F(16));
|
||||
@@ -705,7 +705,7 @@ static s8 e_bu_head(e_bu_class* i_this) {
|
||||
i_this->mode = 0;
|
||||
anm_init(i_this, 7, 10.0f, 2, 1.0f + cM_rndF(0.1f));
|
||||
} else {
|
||||
actor->current.angle.y += (s16)cM_rndFX(8000.0f);
|
||||
ANGLE_ADD(actor->current.angle.y, cM_rndFX(8000.0f));
|
||||
i_this->mode = 11;
|
||||
actor->speed.y = JREG_F(7) + (20.0f + cM_rndF(10.0f));
|
||||
actor->speedF = 10.0f + cM_rndF(10.0f);
|
||||
|
||||
@@ -517,7 +517,7 @@ static void normal_move(e_bug_class* a_this, bug_s* i_this) {
|
||||
cLib_addCalcAngleS2(&i_this->field_0x3c.y, i_this->field_0x42 + (sVar1 + cM_atan2s(sp74.x, sp74.z)), 2, 0x800);
|
||||
i_this->field_0x3c.x = 0;
|
||||
} else {
|
||||
i_this->field_0x3c.x += (s16)((i_this->field_0x8 << 1) + 0xE00);
|
||||
ANGLE_ADD(i_this->field_0x3c.x, (i_this->field_0x8 << 1) + 0xE00);
|
||||
}
|
||||
|
||||
i_this->field_0x30.x = i_this->field_0x24 * cM_ssin(i_this->field_0x3c.y);
|
||||
|
||||
@@ -874,7 +874,7 @@ static void e_dn_normal(e_dn_class* i_this) {
|
||||
/* Calculate how much the actor turned */
|
||||
angle -= actor->current.angle.y;
|
||||
/* Scale turn strength */
|
||||
angle *= (s16)(YREG_S(5) + 2);
|
||||
ANGLE_MULT(angle, YREG_S(5) + 2);
|
||||
|
||||
/* Ensure the targeted angle is no more than ±22.5° */
|
||||
s16 max_turn = YREG_S(6) + 0x1000;
|
||||
@@ -957,7 +957,7 @@ static void e_dn_wolfbite(e_dn_class* i_this) {
|
||||
anm_init(i_this, ANM_HANGED, 3.0f, J3DFrameCtrl::EMode_NONE, 1.0f);
|
||||
i_this->mode = 1;
|
||||
i_this->sound.startCreatureVoice(Z2SE_EN_DN_V_DRAWBACK, -1);
|
||||
actor->health -= (s16)10;
|
||||
S16_SUB(actor->health, 10);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
@@ -977,7 +977,7 @@ static void e_dn_wolfbite(e_dn_class* i_this) {
|
||||
if (actor->health <= 0 || actor->checkWolfBiteDamage()) {
|
||||
actor->offWolfBiteDamage();
|
||||
anm_init(i_this, ANM_HANGED_DAMAGE, 2.0f, J3DFrameCtrl::EMode_NONE, 1.0f);
|
||||
actor->health -= (s16)10;
|
||||
S16_SUB(actor->health, 10);
|
||||
if (actor->health <= 0) {
|
||||
player->offWolfEnemyHangBite();
|
||||
i_this->field_0x750 = (actor->shape_angle.y - 0x8000) - player->shape_angle.y;
|
||||
@@ -1167,7 +1167,7 @@ static void e_dn_fight_run(e_dn_class* i_this) {
|
||||
sVar1 -= actor->shape_angle.y;
|
||||
}
|
||||
|
||||
sVar1 *= (s16)(YREG_S(5) + 2);
|
||||
ANGLE_MULT(sVar1, YREG_S(5) + 2);
|
||||
s16 sVar4 = YREG_S(6) + 0x1000;
|
||||
if (sVar1 > sVar4) {
|
||||
sVar1 = sVar4;
|
||||
@@ -1505,7 +1505,7 @@ static void e_dn_attack(e_dn_class* i_this) {
|
||||
sVar1 = actor->current.angle.y;
|
||||
cLib_addCalcAngleS2(&actor->current.angle.y, i_this->search_angle_y, 2, 0x800);
|
||||
sVar1 -= actor->current.angle.y;
|
||||
sVar1 *= (s16)(YREG_S(5) + 2);
|
||||
ANGLE_MULT(sVar1, YREG_S(5) + 2);
|
||||
s16 sVar3 = YREG_S(6) + 0x1000;
|
||||
if (sVar1 > sVar3) {
|
||||
sVar1 = sVar3;
|
||||
@@ -1950,7 +1950,7 @@ static void e_dn_damage(e_dn_class* i_this) {
|
||||
case 3:
|
||||
if (body_gake(i_this)) {
|
||||
i_this->field_0x704 = VREG_F(8) + -20.0f;
|
||||
i_this->field_0x724.x -= (s16)(VREG_S(7) + 0x300);
|
||||
ANGLE_SUB(i_this->field_0x724.x, VREG_S(7) + 0x300);
|
||||
}
|
||||
|
||||
if (actor->health <= 0 && i_this->timer[1] == 0) {
|
||||
|
||||
@@ -613,7 +613,7 @@ void daE_FK_c::At_Check(int i_sphIdx) {
|
||||
}
|
||||
|
||||
if ((s16)mAtInfo.mAttackPower > 0) {
|
||||
health -= (s16)mAtInfo.mAttackPower;
|
||||
S16_SUB(health, mAtInfo.mAttackPower);
|
||||
}
|
||||
|
||||
int unk_r29 = 0;
|
||||
|
||||
@@ -2756,7 +2756,7 @@ static void action(e_fm_class* i_this) {
|
||||
|
||||
for (int i = 0; i < create_num; i++) {
|
||||
fopAcM_createChild(PROC_E_BA, fopAcM_GetID(actor), 0xFFFF1F02, &actor->eyePos, fopAcM_GetRoomNo(actor), &rot, NULL, -1, NULL);
|
||||
rot.y += (s16)(0x10000 / create_num);
|
||||
ANGLE_ADD(rot.y, 0x10000 / create_num);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -396,9 +396,9 @@ static void e_gb_damage(e_gb_class* i_this) {
|
||||
case 0:
|
||||
i_this->mode = 1;
|
||||
if ((s16)(i_this->angleYTarget - actor->current.angle.y) < 0) {
|
||||
actor->current.angle.y += (s16)(KREG_S(6) + 0x2000);
|
||||
ANGLE_ADD(actor->current.angle.y, KREG_S(6) + 0x2000);
|
||||
} else {
|
||||
actor->current.angle.y -= (s16)(KREG_S(6) + 0x2000);
|
||||
ANGLE_SUB(actor->current.angle.y, KREG_S(6) + 0x2000);
|
||||
}
|
||||
|
||||
cMtx_YrotS(*calc_mtx, actor->current.angle.y);
|
||||
@@ -871,7 +871,7 @@ static void action(e_gb_class* i_this) {
|
||||
i_this->xRot = i_this->field_0x94c * cM_scos((s16)i_this->field_0x94a);
|
||||
}
|
||||
|
||||
i_this->field_0x94a += (s16)(10000 + VREG_S(2));
|
||||
ANGLE_ADD(i_this->field_0x94a, 10000 + VREG_S(2));
|
||||
cLib_addCalc0(&i_this->field_0x94c, 1.0f, VREG_F(2) + 150.0f);
|
||||
} else {
|
||||
i_this->xRot = 0;
|
||||
@@ -1449,7 +1449,7 @@ static int daE_GB_Execute(e_gb_class* i_this) {
|
||||
if (i_this->field_0x670 == 1) {
|
||||
i_this->keyPos.y += i_this->field_0x680;
|
||||
i_this->field_0x680 -= 3.0f;
|
||||
i_this->keyXRot += (s16)-0xC00;
|
||||
ANGLE_ADD(i_this->keyXRot, -0xC00);
|
||||
|
||||
if (i_this->keyPos.y < actor->home.pos.y) {
|
||||
i_this->keyXRot = 0;
|
||||
|
||||
@@ -1013,7 +1013,7 @@ void daE_GE_c::executeWind() {
|
||||
}
|
||||
|
||||
cXyz boomerangPos2(daPy_py_c::getThrowBoomerangActor()->current.pos);
|
||||
field_0xb8c += (s16)0x800;
|
||||
ANGLE_ADD(field_0xb8c, 0x800);
|
||||
current.pos.x = boomerangPos2.x + field_0xb58 * cM_ssin(field_0xb8c);
|
||||
current.pos.z = boomerangPos2.z + field_0xb58 * cM_scos(field_0xb8c);
|
||||
cLib_chaseF(&field_0xb58, field_0xb60, 2.0f);
|
||||
|
||||
@@ -395,7 +395,7 @@ int daE_HM_c::W_MoveCheckWall() {
|
||||
dComIfG_Bgsp().GetTriPla(linChk, &plane1);
|
||||
|
||||
if (!dComIfG_Bgsp().GetMagnetCode(linChk)) {
|
||||
field_0x5b4 += (s16)0x200;
|
||||
ANGLE_ADD(field_0x5b4, 0x200);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -438,7 +438,7 @@ int daE_HM_c::W_WallCheck() {
|
||||
cM3dGPla plane;
|
||||
dComIfG_Bgsp().GetTriPla(linChk, &plane);
|
||||
if (!dComIfG_Bgsp().GetMagnetCode(linChk)) {
|
||||
field_0x5b4 += (s16)0x200;
|
||||
ANGLE_ADD(field_0x5b4, 0x200);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@@ -841,7 +841,7 @@ void daE_HM_c::DeathMotion() {
|
||||
f32 frame = mAnm_p->getFrame();
|
||||
if (mAcch.ChkGroundHit() && (field_0x5da++, field_0x5da) == 1) {
|
||||
speed.y = yREG_F(11) + 35.0f;
|
||||
current.angle.y -= (s16)0x1000;
|
||||
ANGLE_SUB(current.angle.y, 0x1000);
|
||||
SetAnm(8, 0, nREG_F(9) + 1.0f, nREG_F(12) + 1.0f);
|
||||
mAnm_p->setPlaySpeed(yREG_F(12) + 2.0f);
|
||||
}
|
||||
@@ -1075,7 +1075,7 @@ void daE_HM_c::At_Check() {
|
||||
}
|
||||
|
||||
if ((s16)mAtInfo.mAttackPower > 0) {
|
||||
health -= (s16)mAtInfo.mAttackPower;
|
||||
S16_SUB(health, mAtInfo.mAttackPower);
|
||||
}
|
||||
|
||||
s8 unkByte1 = 0;
|
||||
|
||||
@@ -463,7 +463,7 @@ void daE_HZ_c::executeWait() {
|
||||
case 4:
|
||||
target = home.pos.y + 30.0f;
|
||||
if (cLib_chaseF(¤t.pos.y, target, 5.0f)) {
|
||||
field_0x6b4 += (s16)0x800;
|
||||
ANGLE_ADD(field_0x6b4, 0x800);
|
||||
current.pos.y += cM_ssin(field_0x6b4) * 1.5f;
|
||||
cLib_chaseAngleS(&shape_angle.y, mPlayerAngleY, 0x400);
|
||||
}
|
||||
@@ -896,7 +896,7 @@ void daE_HZ_c::executeWind() {
|
||||
}
|
||||
|
||||
current.pos.y += frame;
|
||||
shape_angle.y -= (s16)0x7D0;
|
||||
ANGLE_SUB(shape_angle.y, 0x7D0);
|
||||
|
||||
if (mpMorfSO->checkFrame(field_0x6cc) || mpBoomerangActor == NULL ||
|
||||
mpBoomerangActor->getReturnFlg())
|
||||
@@ -962,7 +962,7 @@ void daE_HZ_c::executeWind() {
|
||||
return;
|
||||
}
|
||||
|
||||
field_0x6b2 += (s16)0x800;
|
||||
ANGLE_ADD(field_0x6b2, 0x800);
|
||||
linChk.Set(¤t.pos, &position, NULL);
|
||||
if (!dComIfG_Bgsp().LineCross(&linChk)) {
|
||||
cLib_chaseF(¤t.pos.x, position.x + field_0x678.x * cM_ssin(field_0x6b2), 50.0f);
|
||||
@@ -991,7 +991,7 @@ void daE_HZ_c::executeWind() {
|
||||
cLib_chaseAngleS(&shape_angle.x, -0x8000, 0x400);
|
||||
}
|
||||
|
||||
shape_angle.y -= (s16)l_HIO.reeling_rotation_speed;
|
||||
ANGLE_SUB(shape_angle.y, l_HIO.reeling_rotation_speed);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
@@ -1277,7 +1277,7 @@ void daE_HZ_c::executeWindChance() {
|
||||
}
|
||||
|
||||
end = mpBoomerangActor->current.pos;
|
||||
field_0x6b6 += (s16)0x800;
|
||||
ANGLE_ADD(field_0x6b6, 0x800);
|
||||
start = current.pos;
|
||||
start.y += 50.0f;
|
||||
linChk.Set(&start, &end, NULL);
|
||||
@@ -1296,7 +1296,7 @@ void daE_HZ_c::executeWindChance() {
|
||||
}
|
||||
|
||||
shape_angle.y -= field_0x6b2;
|
||||
field_0x6b4 += (s16)0x1000;
|
||||
ANGLE_ADD(field_0x6b4, 0x1000);
|
||||
shape_angle.x = (s16)(cM_scos(field_0x6b4) * 6144.0f);
|
||||
break;
|
||||
|
||||
@@ -1307,12 +1307,12 @@ void daE_HZ_c::executeWindChance() {
|
||||
cLib_chaseAngleS(&field_0x6b2, 0, 0x100);
|
||||
cLib_chaseAngleS(&field_0x6b6, 0, 0x200);
|
||||
shape_angle.y -= field_0x6b2;
|
||||
field_0x6b4 += (s16)0x1000;
|
||||
ANGLE_ADD(field_0x6b4, 0x1000);
|
||||
shape_angle.x = (s16)(field_0x6b6 * cM_scos(field_0x6b4));
|
||||
|
||||
|
||||
if (mWaitTimer == 0) {
|
||||
if (mPiyoriTimer != 0) {
|
||||
mPiyoriTimer += (s16)20;
|
||||
S16_ADD(mPiyoriTimer, 20);
|
||||
}
|
||||
|
||||
setActionMode(ACTION_CHANCE);
|
||||
|
||||
@@ -516,7 +516,7 @@ static void action(e_mk_bo_class* i_this) {
|
||||
sound = Z2SE_EN_MK_BOOM_FLY;
|
||||
}
|
||||
|
||||
actor->shape_angle.y += (s16) 0x2000;
|
||||
ANGLE_ADD(actor->shape_angle.y, 0x2000);
|
||||
|
||||
if ((i_this->counter & 7) == 0) {
|
||||
i_this->sound.startSound(sound, 0, -1);
|
||||
|
||||
@@ -313,7 +313,7 @@ static void e_mm_mt_drop(e_mm_mt_class* i_this) {
|
||||
if (wall_angle != 0x23) {
|
||||
wall_angle = i_this->enemy.current.angle.y - wall_angle;
|
||||
i_this->m_spin = wall_angle * (TREG_F(6) + -0.3f);
|
||||
i_this->enemy.current.angle.y += (s16)(0x8000 - (wall_angle << 1));
|
||||
ANGLE_ADD(i_this->enemy.current.angle.y, 0x8000 - (wall_angle << 1));
|
||||
if (i_this->m_acch.ChkWaterHit()) {
|
||||
mDoAud_seStart(Z2SE_EN_MM_MET_BOUND_WTR, &i_this->enemy.current.pos, (u32)(i_this->enemy.speed.y), 0);
|
||||
} else {
|
||||
@@ -489,7 +489,7 @@ static void action(e_mm_mt_class* i_this) {
|
||||
s16 playerAngleY = fopAcM_searchPlayerAngleY(actor);
|
||||
s16 playerAngleDelta = i_this->m_rotation.y - playerAngleY;
|
||||
if (playerAngleDelta > 0x4000 || playerAngleDelta < -0x4000) {
|
||||
playerAngleY += (s16)0x8000;
|
||||
ANGLE_ADD(playerAngleY, 0x8000);
|
||||
}
|
||||
cLib_addCalcAngleS2(&i_this->m_rotation.y, playerAngleY, 4, 0x100);
|
||||
}
|
||||
|
||||
@@ -416,7 +416,7 @@ static void e_nest_drop(e_nest_class* i_this) {
|
||||
if (wall_angle != 0x23) {
|
||||
s16 angle_delta = i_this->current.angle.y - wall_angle;
|
||||
i_this->mSpin = angle_delta * -0.3f;
|
||||
i_this->current.angle.y += (s16)(0x8000 - (angle_delta << 1));
|
||||
ANGLE_ADD(i_this->current.angle.y, 0x8000 - (angle_delta << 1));
|
||||
i_this->speedF *= 0.5f;
|
||||
i_this->mTimers[1] = 10;
|
||||
i_this->mSound.startSound(Z2SE_OBJ_HACHINOSU_BOUND, 0, -1);
|
||||
|
||||
@@ -714,17 +714,17 @@ void daE_OC_c::damage_check() {
|
||||
} else if (mAtInfo.mpCollider->ChkAtType(AT_TYPE_IRON_BALL)) {
|
||||
my_val = 5;
|
||||
if (dComIfGp_checkPlayerStatus0(0,0x400)) {
|
||||
health += (s16) 140;
|
||||
S16_ADD(health, 140);
|
||||
} else {
|
||||
health += (s16) 80;
|
||||
S16_ADD(health, 80);
|
||||
}
|
||||
} else if (mAtInfo.mpCollider->ChkAtType(AT_TYPE_BOOMERANG)) {
|
||||
my_val = 4;
|
||||
} else if (mAtInfo.mpCollider->ChkAtType(AT_TYPE_40)) {
|
||||
health += (s16) 10;
|
||||
S16_ADD(health, 10);
|
||||
} else if (mAtInfo.mpCollider->ChkAtType(AT_TYPE_SLINGSHOT)) {
|
||||
if (mName == "E_OC") {
|
||||
health -= (s16) 5;
|
||||
S16_SUB(health, 5);
|
||||
if (health < 0) {
|
||||
health = 0;
|
||||
mSound.startCollisionSE(0x40007,0x20);
|
||||
|
||||
@@ -280,9 +280,9 @@ void daE_OT_c::executeEgg() {
|
||||
speed.y = 50.0f + cM_rndFX(10.0f);
|
||||
current.angle.y = mpToadActor->shape_angle.y;
|
||||
if (mChildNo < 5 || (mChildNo >= 10 && mChildNo < 15)) {
|
||||
current.angle.y += (s16)(0x4000 + cM_rndFX(0x1000));
|
||||
ANGLE_ADD(current.angle.y, 0x4000 + cM_rndFX(0x1000));
|
||||
} else {
|
||||
current.angle.y += (s16)(-0x4000 + cM_rndFX(0x1000));
|
||||
ANGLE_ADD(current.angle.y, -0x4000 + cM_rndFX(0x1000));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -617,9 +617,9 @@ void daE_PH_c::StopAction() {
|
||||
switch (mCAction) {
|
||||
case 0:
|
||||
if (mAnmID == ANM_HANG_WAIT || mAnmID == ANM_HANG_START) {
|
||||
mHeadRotX += (s16)(field_0x612 + 0x1000);
|
||||
ANGLE_ADD(mHeadRotX, field_0x612 + 0x1000);
|
||||
} else {
|
||||
mHeadRotX += (s16)(field_0x612 + 0x500);
|
||||
ANGLE_ADD(mHeadRotX, field_0x612 + 0x500);
|
||||
}
|
||||
|
||||
mSound.startCreatureSoundLevel(Z2SE_EN_PH_PROPELLER, field_0x612 + 0x500, -1);
|
||||
|
||||
@@ -2452,7 +2452,7 @@ void daE_PM_c::At_Check() {
|
||||
}
|
||||
|
||||
if ((s16)mAtInfo.mAttackPower > 0) {
|
||||
health -= (s16)mAtInfo.mAttackPower;
|
||||
S16_SUB(health, mAtInfo.mAttackPower);
|
||||
}
|
||||
|
||||
u32 pause_timer = 0;
|
||||
|
||||
+12
-12
@@ -1864,21 +1864,21 @@ static void e_po_holl_demo(e_po_class* i_this) {
|
||||
i_this->field_0x7DE += 1;
|
||||
i_this->field_0x7E2 += 1;
|
||||
if (mArg0Check(i_this, 7) != 0) {
|
||||
a_this->current.angle.x += (s16)(400.0f * cM_ssin(1000.0f * i_this->field_0x7DE));
|
||||
a_this->current.angle.y += (s16)(500.0f * cM_scos(1000.0f * i_this->field_0x7E2));
|
||||
a_this->current.angle.z += (s16)(500.0f * -cM_scos(1000.0f * i_this->field_0x7E2));
|
||||
ANGLE_ADD(a_this->current.angle.x, 400.0f * cM_ssin(1000.0f * i_this->field_0x7DE));
|
||||
ANGLE_ADD(a_this->current.angle.y, 500.0f * cM_scos(1000.0f * i_this->field_0x7E2));
|
||||
ANGLE_ADD(a_this->current.angle.z, 500.0f * -cM_scos(1000.0f * i_this->field_0x7E2));
|
||||
} else if (mArg0Check(i_this, 8) != 0) {
|
||||
a_this->current.angle.x += (s16)(-400.0f * cM_ssin(1000.0f * i_this->field_0x7DE));
|
||||
a_this->current.angle.y += (s16)(500.0f * cM_scos(1000.0f * i_this->field_0x7E2));
|
||||
a_this->current.angle.z += (s16)(500.0f * -cM_scos(1000.0f * i_this->field_0x7E2));
|
||||
ANGLE_ADD(a_this->current.angle.x, -400.0f * cM_ssin(1000.0f * i_this->field_0x7DE));
|
||||
ANGLE_ADD(a_this->current.angle.y, 500.0f * cM_scos(1000.0f * i_this->field_0x7E2));
|
||||
ANGLE_ADD(a_this->current.angle.z, 500.0f * -cM_scos(1000.0f * i_this->field_0x7E2));
|
||||
} else if (mArg0Check(i_this, 9) != 0) {
|
||||
a_this->current.angle.x -= (s16)(200.0f * cM_ssin(1000.0f * i_this->field_0x7DE));
|
||||
a_this->current.angle.y -= (s16)(1000.0f * cM_scos(1000.0f * i_this->field_0x7E2));
|
||||
a_this->current.angle.z -= (s16)(500.0f * -cM_scos(1000.0f * i_this->field_0x7E2));
|
||||
ANGLE_SUB(a_this->current.angle.x, 200.0f * cM_ssin(1000.0f * i_this->field_0x7DE));
|
||||
ANGLE_SUB(a_this->current.angle.y, 1000.0f * cM_scos(1000.0f * i_this->field_0x7E2));
|
||||
ANGLE_SUB(a_this->current.angle.z, 500.0f * -cM_scos(1000.0f * i_this->field_0x7E2));
|
||||
} else {
|
||||
a_this->current.angle.x -= (s16)(100.0f * cM_ssin(1000.0f * i_this->field_0x7DE));
|
||||
a_this->current.angle.y -= (s16)(100.0f * cM_scos(1000.0f * i_this->field_0x7E2));
|
||||
a_this->current.angle.z -= (s16)(500.0f * -cM_scos(1000.0f * i_this->field_0x7E2));
|
||||
ANGLE_SUB(a_this->current.angle.x, 100.0f * cM_ssin(1000.0f * i_this->field_0x7DE));
|
||||
ANGLE_SUB(a_this->current.angle.y, 100.0f * cM_scos(1000.0f * i_this->field_0x7E2));
|
||||
ANGLE_SUB(a_this->current.angle.z, 500.0f * -cM_scos(1000.0f * i_this->field_0x7E2));
|
||||
}
|
||||
if (i_this->field_0x74A[2] != 0) {
|
||||
break;
|
||||
|
||||
@@ -626,7 +626,7 @@ static void e_rb_base_1(e_rb_class* i_this) {
|
||||
}
|
||||
|
||||
if (i_this->field_0xa64 != 0) {
|
||||
i_this->field_0xa4e += (s16)(AREG_S(6) + 300);
|
||||
ANGLE_ADD(i_this->field_0xa4e, AREG_S(6) + 300);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
+16
-15
@@ -1038,7 +1038,7 @@ static BOOL way_check(e_rd_class* i_this) {
|
||||
dBgS_LinChk lin_chk;
|
||||
lin_chk.Set(&start, &end, a_this);
|
||||
if (dComIfG_Bgsp().LineCross(&lin_chk)) {
|
||||
sVar1 += (s16) 0x1000;
|
||||
ANGLE_ADD(sVar1, 0x1000);
|
||||
} else {
|
||||
i_this->field_0x5cc = sVar1;
|
||||
return TRUE;
|
||||
@@ -1581,7 +1581,7 @@ static void e_rd_bow_run(e_rd_class* i_this) {
|
||||
|
||||
case 1:
|
||||
fVar1 = fVar2;
|
||||
ADD_ANGLE_2(playerAngleY, 0x8000);
|
||||
ANGLE_ADD_2(playerAngleY, 0x8000);
|
||||
if (i_this->mPlayerDistance > l_HIO.attack_range || i_this->field_0x990[0] == 0 || i_this->mObjAcch.ChkWallHit() || move_gake_check(i_this, 100.0f)) {
|
||||
bVar1 = 1;
|
||||
}
|
||||
@@ -2608,7 +2608,7 @@ static void e_rd_bomb_action(e_rd_class* i_this) {
|
||||
}
|
||||
}
|
||||
|
||||
ADD_ANGLE_2(sVar1, 0x8000);
|
||||
ANGLE_ADD_2(sVar1, 0x8000);
|
||||
fVar1 = l_HIO.dash_speed;
|
||||
if (JMAFastSqrt(sp48.x * sp48.x + sp48.z * sp48.z) > 600.0f) {
|
||||
i_this->mMode = 3;
|
||||
@@ -2879,10 +2879,10 @@ static void e_rd_damage(e_rd_class* i_this) {
|
||||
OS_REPORT(" ..KADO KABE ..%x\n", kado_kabe);
|
||||
if (kado_kabe == 2) {
|
||||
i_this->field_0x9f6 = 0x1000;
|
||||
i_this->field_0xa0c.y += (s16) (TREG_S(8) - 7000);
|
||||
ANGLE_ADD(i_this->field_0xa0c.y, TREG_S(8) - 7000);
|
||||
} else {
|
||||
i_this->field_0x9f6 = -0x1000;
|
||||
i_this->field_0xa0c.y += (s16) -(TREG_S(8) - 7000);
|
||||
ANGLE_ADD(i_this->field_0xa0c.y, -(TREG_S(8) - 7000));
|
||||
}
|
||||
|
||||
i_this->field_0xab8 = 8000.0f + BREG_F(10);
|
||||
@@ -2895,7 +2895,7 @@ static void e_rd_damage(e_rd_class* i_this) {
|
||||
i_this->mMode = 10;
|
||||
a_this->speed.y = 0.0f;
|
||||
i_this->field_0x9ec *= 0.2f;
|
||||
ADD_ANGLE_2(i_this->field_0xa0c.y, 0x8000);
|
||||
ANGLE_ADD_2(i_this->field_0xa0c.y, 0x8000);
|
||||
i_this->field_0xaf0 = 5 + BREG_S(7);
|
||||
i_this->field_0xa24 = 100.0f + BREG_F(4);
|
||||
i_this->field_0xa2c = 100.0f + BREG_F(5);
|
||||
@@ -3163,7 +3163,7 @@ static s16 gake_check(e_rd_class* i_this, f32 param_2) {
|
||||
}
|
||||
}
|
||||
|
||||
sVar1 += (s16) 0x1000;
|
||||
ANGLE_ADD(sVar1, 0x1000);
|
||||
}
|
||||
|
||||
return a_this->shape_angle.y;
|
||||
@@ -5322,7 +5322,8 @@ static void action(e_rd_class* i_this) {
|
||||
sp25c.x = 10.0f;
|
||||
MtxPosition(&sp25c, &sp268);
|
||||
sp25c = sp268 - i_this->field_0x9b0;
|
||||
a_this->current.angle.x += (s16)-cM_atan2s(sp25c.y, JMAFastSqrt(sp25c.x * sp25c.x + sp25c.z * sp25c.z));
|
||||
ANGLE_ADD(a_this->current.angle.x,
|
||||
-cM_atan2s(sp25c.y, JMAFastSqrt(sp25c.x * sp25c.x + sp25c.z * sp25c.z)));
|
||||
a_this->shape_angle.x = a_this->current.angle.x;
|
||||
|
||||
if (i_this->field_0x9be == 1) {
|
||||
@@ -6857,8 +6858,8 @@ static int daE_RD_Execute(e_rd_class* i_this) {
|
||||
|
||||
// NOT Hyrule Field
|
||||
if (strcmp(dComIfGp_getStartStageName(), "F_SP121") != 0 && i_this->field_0x1296 == 0) {
|
||||
local_148.x += (s16)(cM_rndFX(200.0f) + -500.0f);
|
||||
local_148.y += (s16)cM_rndFX(100.0f);
|
||||
ANGLE_ADD(local_148.x, cM_rndFX(200.0f) + -500.0f);
|
||||
ANGLE_ADD(local_148.y, cM_rndFX(100.0f));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6912,8 +6913,8 @@ static int daE_RD_Execute(e_rd_class* i_this) {
|
||||
} else {
|
||||
i_this->field_0x71c[i] += i_this->field_0x7c4[i];
|
||||
i_this->field_0x7c4[i].y -= 3.0f;
|
||||
i_this->field_0x86c[i].y += (s16) 0x900;
|
||||
i_this->field_0x86c[i].x += (s16) 0xB00;
|
||||
ANGLE_ADD(i_this->field_0x86c[i].y, 0x900);
|
||||
ANGLE_ADD(i_this->field_0x86c[i].x, 0xB00);
|
||||
|
||||
mDoMtx_stack_c::transS(i_this->field_0x71c[i].x, i_this->field_0x71c[i].y, i_this->field_0x71c[i].z);
|
||||
mDoMtx_stack_c::YrotM(i_this->field_0x86c[i].y);
|
||||
@@ -6951,8 +6952,8 @@ static int daE_RD_Execute(e_rd_class* i_this) {
|
||||
cMtx_XrotM(*calc_mtx, 0x7FFF);
|
||||
cMtx_ZrotM(*calc_mtx, i_this->field_0x6bc.z);
|
||||
MtxTrans(-(BREG_F(5) + 80.0f), -(BREG_F(6) + 50.0f), -(BREG_F(7) + 0.0f), 1);
|
||||
i_this->field_0x6bc.y += (s16) 0x200;
|
||||
i_this->field_0x6bc.z += (s16) 0xF00;
|
||||
ANGLE_ADD(i_this->field_0x6bc.y, 0x200);
|
||||
ANGLE_ADD(i_this->field_0x6bc.z, 0xF00);
|
||||
}
|
||||
|
||||
i_this->mpMorfHornAnm->getModel()->setBaseTRMtx(*calc_mtx);
|
||||
@@ -7073,7 +7074,7 @@ static void ride_game_actor_set(e_rd_class* i_this) {
|
||||
gnd_chk.SetPos(&i_pos);
|
||||
i_pos.y = dComIfG_Bgsp().GroundCross(&gnd_chk);
|
||||
i_angle = player->shape_angle;
|
||||
i_angle.y += (s16) 0x4000;
|
||||
ANGLE_ADD(i_angle.y, 0x4000);
|
||||
i_parameters = 0x80000005;
|
||||
} else if (i_this->mBossMode == 2) {
|
||||
i_pos.set(34789.0f, -290.0f, -36177.0f);
|
||||
|
||||
+13
-13
@@ -683,7 +683,7 @@ static BOOL way_check(e_rdy_class* i_this) {
|
||||
dBgS_LinChk lin_chk;
|
||||
lin_chk.Set(&start, &end, _this);
|
||||
if (dComIfG_Bgsp().LineCross(&lin_chk)) {
|
||||
ADD_ANGLE_2(angle, 0x1000);
|
||||
ANGLE_ADD_2(angle, 0x1000);
|
||||
} else {
|
||||
i_this->mTargetAngleY = angle;
|
||||
return TRUE;
|
||||
@@ -1165,7 +1165,7 @@ static void e_rdy_bow_run(e_rdy_class* i_this) {
|
||||
|
||||
case 1:
|
||||
target_speed = run_speed;
|
||||
ADD_ANGLE_2(target_angle, 0x8000);
|
||||
ANGLE_ADD_2(target_angle, 0x8000);
|
||||
if (i_this->mPlayerDist > l_HIO.field_0x28 || i_this->mTimer[0] == 0
|
||||
|| i_this->mAcch.ChkWallHit())
|
||||
{
|
||||
@@ -1933,7 +1933,7 @@ static void e_rdy_bomb_action(e_rdy_class* i_this) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
ADD_ANGLE_2(target_angle, 0x8000);
|
||||
ANGLE_ADD_2(target_angle, 0x8000);
|
||||
target_speed = l_HIO.mRunSpeed;
|
||||
if (JMAFastSqrt(vec1.x * vec1.x + vec1.z * vec1.z) > 600.0f) {
|
||||
i_this->mMode = 3;
|
||||
@@ -2158,10 +2158,10 @@ static void e_rdy_damage(e_rdy_class* i_this) {
|
||||
OS_REPORT(" ..KADO KABE ..%x\n", check);
|
||||
if (check == 2) {
|
||||
i_this->field_0xac6 = 0x1000;
|
||||
i_this->field_0xadc.y += (s16)(TREG_S(8) - 7000);
|
||||
ANGLE_ADD(i_this->field_0xadc.y, TREG_S(8) - 7000);
|
||||
} else {
|
||||
i_this->field_0xac6 = -0x1000;
|
||||
i_this->field_0xadc.y += (s16)-(TREG_S(8) - 7000);
|
||||
ANGLE_ADD(i_this->field_0xadc.y, -(TREG_S(8) - 7000));
|
||||
}
|
||||
i_this->field_0xb88 = 8000.0f + BREG_F(10);
|
||||
i_this->field_0xaf4 = 100.0f + BREG_F(4);
|
||||
@@ -2171,7 +2171,7 @@ static void e_rdy_damage(e_rdy_class* i_this) {
|
||||
i_this->mMode = 10;
|
||||
a_this->speed.y = 0.0f;
|
||||
i_this->field_0xabc *= 0.2f;
|
||||
ADD_ANGLE_2(i_this->field_0xadc.y, 0x8000);
|
||||
ANGLE_ADD_2(i_this->field_0xadc.y, 0x8000);
|
||||
i_this->field_0xbc0 = 5 + BREG_S(7);
|
||||
i_this->field_0xaf4 = 100.0f + BREG_F(4);
|
||||
i_this->field_0xafc = 100.0f + BREG_F(5);
|
||||
@@ -2261,7 +2261,7 @@ static void e_rdy_damage(e_rdy_class* i_this) {
|
||||
case 3:
|
||||
if (body_gake(i_this)) {
|
||||
i_this->field_0xabc = -20.0f + VREG_F(8);
|
||||
i_this->field_0xadc.x -= (s16)(VREG_S(7) + 0x300);
|
||||
ANGLE_SUB(i_this->field_0xadc.x, VREG_S(7) + 0x300);
|
||||
}
|
||||
if (a_this->health <= 0 && i_this->mTimer[1] == 0) {
|
||||
rd_disappear(i_this);
|
||||
@@ -2416,7 +2416,7 @@ static s16 gake_check(e_rdy_class* i_this, f32 i_dist) {
|
||||
return angle_y;
|
||||
}
|
||||
}
|
||||
angle_y += (s16)0x1000;
|
||||
ANGLE_ADD(angle_y, 0x1000);
|
||||
}
|
||||
return _this->shape_angle.y;
|
||||
}
|
||||
@@ -3526,13 +3526,13 @@ static void action(e_rdy_class* i_this) {
|
||||
i_this->field_0xb44[1].x = i_this->field_0xafc * cM_scos(i_this->field_0xb00) * (70.0f + BREG_F(0));
|
||||
i_this->field_0xb44[2].x += i_this->field_0xb44[1].x;
|
||||
cLib_addCalc0(&i_this->field_0xafc, 1.0f, 3.0f + BREG_F(1));
|
||||
i_this->field_0xb00 += (s16)(4000 + BREG_S(0));
|
||||
ANGLE_ADD(i_this->field_0xb00, 4000 + BREG_S(0));
|
||||
}
|
||||
|
||||
if (fabsf(i_this->field_0xaf4) > 1.0f) {
|
||||
i_this->field_0xb44[0].x = i_this->field_0xaf4 * cM_scos(i_this->field_0xaf8) * (70.0f + BREG_F(2));
|
||||
cLib_addCalc0(&i_this->field_0xaf4, 1.0f, 3.0f + BREG_F(3));
|
||||
i_this->field_0xaf8 += (s16)(4000 + BREG_S(1));
|
||||
ANGLE_ADD(i_this->field_0xaf8, 4000 + BREG_S(1));
|
||||
}
|
||||
|
||||
if (a_this->speed.y < 0.0f && i_this->mAcch.ChkGroundHit()) {
|
||||
@@ -4218,7 +4218,7 @@ static void demo_camera(e_rdy_class* i_this) {
|
||||
i_this->mCamEye += player->current.pos;
|
||||
i_this->mCamCenter = player->current.pos;
|
||||
i_this->mCamCenter.y += 100.0f + NREG_F(10);
|
||||
i_this->field_0x13d4 += (s16)(230 + NREG_S(2));
|
||||
ANGLE_ADD(i_this->field_0x13d4, 230 + NREG_S(2));
|
||||
if (i_this->mDemoTimer >= 30) {
|
||||
if (i_this->mDemoTimer == 30) {
|
||||
i_this->mMsgFlow.init(a_this, 0x7d1, 0, NULL);
|
||||
@@ -4687,8 +4687,8 @@ static int daE_RDY_Execute(e_rdy_class* i_this) {
|
||||
arrow_angle.x = -cM_atan2s(vec1.y, JMAFastSqrt(vec1.x * vec1.x + vec1.z * vec1.z));
|
||||
if (strcmp(dComIfGp_getStartStageName(), "F_SP121") && !i_this->field_0x1366) {
|
||||
// Not Hyrule Field
|
||||
arrow_angle.x += (s16)(cM_rndFX(200.0f) + -500.0f);
|
||||
arrow_angle.y += (s16)cM_rndFX(100.0f);
|
||||
ANGLE_ADD(arrow_angle.x, cM_rndFX(200.0f) + -500.0f);
|
||||
ANGLE_ADD(arrow_angle.y, cM_rndFX(100.0f));
|
||||
}
|
||||
}
|
||||
arrow_angle.z = 0;
|
||||
|
||||
@@ -700,7 +700,7 @@ static void e_sg_drop(e_sg_class* i_this) {
|
||||
i_this->mRotationTarget = -0x8000;
|
||||
}
|
||||
|
||||
i_this->current.angle.y += (s16)cM_rndFX(15000.0f);
|
||||
ANGLE_ADD(i_this->current.angle.y, cM_rndFX(15000.0f));
|
||||
i_this->mSound.startCreatureSound(Z2SE_EN_SG_BOUND, 0, -1);
|
||||
}
|
||||
|
||||
|
||||
@@ -242,7 +242,7 @@ void daE_SM_c::ArrowCheck() {
|
||||
}
|
||||
|
||||
void daE_SM_c::E_SM_Damage() {
|
||||
field_0x6bc += (s16)((field_0x980 + 1000.0f) / field_0x6f0);
|
||||
ANGLE_ADD(field_0x6bc, (field_0x980 + 1000.0f) / field_0x6f0);
|
||||
mCoSm.OffAtSetBit();
|
||||
|
||||
if (field_0x6c0[0] != 0) {
|
||||
@@ -254,7 +254,7 @@ void daE_SM_c::E_SM_Damage() {
|
||||
fVar1 = field_0x978;
|
||||
}
|
||||
|
||||
field_0x6be += (s16)(3000.0f / field_0x6f0);
|
||||
ANGLE_ADD(field_0x6be, 3000.0f / field_0x6f0);
|
||||
cLib_addCalc2(&field_0x6e4, field_0x974, 0.3f, 1.0f);
|
||||
cLib_addCalc2(&field_0x6e0, fVar1 + 1.0f, 0.3f, 1.0f);
|
||||
cLib_addCalc2(&field_0x6dc, field_0x97c + 0.005f, 0.05f, 0.5f);
|
||||
|
||||
@@ -1276,7 +1276,8 @@ static void action(e_sm2_class* i_this) {
|
||||
static f32 asp[] = {500.0f, 400.0f, 300.0f, 200.0f, 100.0f};
|
||||
static f32 asp2[] = {3500.0f, 3000.0f, 2500.0f, 2000.0f, 1500.0f};
|
||||
|
||||
i_this->field_0x828 += (s16)(asp2[i_this->sizetype] + (i_this->field_0x82c * asp[i_this->sizetype]));
|
||||
ANGLE_ADD(i_this->field_0x828,
|
||||
asp2[i_this->sizetype] + (i_this->field_0x82c * asp[i_this->sizetype]));
|
||||
|
||||
for (int i = 0; i < 8; i++) {
|
||||
if (i_this->action != ACTION_FAIL) {
|
||||
|
||||
@@ -35,7 +35,7 @@ static void chain_draw(e_th_ball_class* i_this) {
|
||||
|
||||
rot_z = var_r28 * 3000;
|
||||
if (var_r28 & 1) {
|
||||
rot_z += (s16)0x4000;
|
||||
ANGLE_ADD(rot_z, 0x4000);
|
||||
}
|
||||
cMtx_ZrotM(*calc_mtx, rot_z);
|
||||
MtxScale(size, size, size, 1);
|
||||
@@ -57,7 +57,7 @@ static void chain_draw(e_th_ball_class* i_this) {
|
||||
|
||||
rot_z = var_r28 * 3000;
|
||||
if (var_r28 & 1) {
|
||||
rot_z += (s16)0x4000;
|
||||
ANGLE_ADD(rot_z, 0x4000);
|
||||
}
|
||||
cMtx_ZrotM(*calc_mtx, rot_z);
|
||||
MtxScale(size, size, size, 1);
|
||||
@@ -78,7 +78,7 @@ static void chain_draw(e_th_ball_class* i_this) {
|
||||
|
||||
rot_z = var_r28 * 3000;
|
||||
if (var_r28 & 1) {
|
||||
rot_z += (s16)0x4000;
|
||||
ANGLE_ADD(rot_z, 0x4000);
|
||||
}
|
||||
cMtx_ZrotM(*calc_mtx, rot_z);
|
||||
MtxScale(size, size, size, 1);
|
||||
@@ -462,7 +462,7 @@ static void normal_move(e_th_ball_class* i_this, s8 param_1) {
|
||||
|
||||
a_this->speed.y -= 5.0f;
|
||||
if (param_1 != 0) {
|
||||
a_this->current.angle.x += (s16)(200.0f * a_this->speedF);
|
||||
ANGLE_ADD(a_this->current.angle.x, 200.0f * a_this->speedF);
|
||||
}
|
||||
|
||||
f32 y_speed = a_this->speed.y;
|
||||
@@ -655,7 +655,7 @@ static void e_th_ball_shot(e_th_ball_class* i_this) {
|
||||
cLib_addCalcAngleS2(&i_this->shape_angle.y, spE, 1, 0x4000);
|
||||
cLib_addCalcAngleS2(&i_this->shape_angle.x, 0, 1, 0x4000);
|
||||
} else if (temp_f31 > 0.0f) {
|
||||
i_this->current.angle.y += (s16)cM_rndFX(4000.0f);
|
||||
ANGLE_ADD(i_this->current.angle.y, cM_rndFX(4000.0f));
|
||||
i_this->speed.y = 20.0f + AREG_F(5);
|
||||
}
|
||||
|
||||
@@ -674,7 +674,7 @@ static void e_th_ball_shot(e_th_ball_class* i_this) {
|
||||
|
||||
if (wall_angle != 35) {
|
||||
s16 spA = i_this->current.angle.y - wall_angle;
|
||||
i_this->current.angle.y += (s16)(0x8000 - (spA * 2));
|
||||
ANGLE_ADD(i_this->current.angle.y, 0x8000 - (spA * 2));
|
||||
i_this->speedF *= 0.3f + AREG_F(14);
|
||||
} else {
|
||||
i_this->current.angle.y -= 0x8000;
|
||||
@@ -738,7 +738,7 @@ static void e_th_ball_return(e_th_ball_class* i_this) {
|
||||
i_this->speed.y = 0.0f;
|
||||
i_this->speedF = 10.0f;
|
||||
i_this->mMode = 3;
|
||||
i_this->current.angle.y += (s16)cM_rndFX(6000.0f);
|
||||
ANGLE_ADD(i_this->current.angle.y, cM_rndFX(6000.0f));
|
||||
} else if (fabsf(i_this->speedF) < 0.1f) {
|
||||
i_this->mMode = 3;
|
||||
}
|
||||
|
||||
@@ -317,7 +317,7 @@ static void e_tk_find(e_tk_class* i_this) {
|
||||
break;
|
||||
|
||||
case MODE_TK_SWIM:
|
||||
ADD_ANGLE(i_this->mPlayerAngleY, 0x8000);
|
||||
ANGLE_ADD(i_this->mPlayerAngleY, 0x8000);
|
||||
i_this->mAttentionOFF = true;
|
||||
if (i_this->mpMorf->isStop()) {
|
||||
i_this->mAnimSpeed = 4.0f;
|
||||
@@ -343,7 +343,7 @@ static void e_tk_find(e_tk_class* i_this) {
|
||||
}
|
||||
}
|
||||
if (i_this->mActionTimer[1] == 0) {
|
||||
ADD_ANGLE(i_this->mPlayerAngleY, 0x8000);
|
||||
ANGLE_ADD(i_this->mPlayerAngleY, 0x8000);
|
||||
} else {
|
||||
i_this->mPlayerAngleY = i_this->mSomeAngle;
|
||||
}
|
||||
|
||||
@@ -242,7 +242,7 @@ static void e_tk2_find(e_tk2_class* i_this) {
|
||||
break;
|
||||
|
||||
case MODE_TK2_SWIM:
|
||||
ADD_ANGLE(i_this->mPlayerAngleY, 0x8000);
|
||||
ANGLE_ADD(i_this->mPlayerAngleY, 0x8000);
|
||||
i_this->mAttentionOFF = true;
|
||||
if (i_this->mpMorf->isStop()) {
|
||||
i_this->mAnimSpeed = 4.0f;
|
||||
@@ -268,7 +268,7 @@ static void e_tk2_find(e_tk2_class* i_this) {
|
||||
}
|
||||
}
|
||||
if (i_this->mActionTimer[1] == 0) {
|
||||
ADD_ANGLE(i_this->mPlayerAngleY, 0x8000);
|
||||
ANGLE_ADD(i_this->mPlayerAngleY, 0x8000);
|
||||
} else {
|
||||
i_this->mPlayerAngleY = i_this->mSomeAngle;
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ static void impact_eff_set(e_tk_ball_class* i_this) {
|
||||
cXyz scale(2.0f + TREG_F(8), 2.0f + TREG_F(8), 2.0f + TREG_F(8));
|
||||
|
||||
csXyz rotation = actor->current.angle;
|
||||
ADD_ANGLE(rotation.y, 0x8000);
|
||||
ANGLE_ADD(rotation.y, 0x8000);
|
||||
|
||||
if (i_this->mType == TYPE_TK_BALL_WATER) {
|
||||
dComIfGp_particle_set(0x819B, &pos, &rotation, &scale);
|
||||
@@ -157,7 +157,7 @@ static void e_tk_ball_move(e_tk_ball_class* i_this) {
|
||||
if (actor_lockon && daPy_getPlayerActorClass()->getCutType() != daPy_py_c::CUT_TYPE_NONE) {
|
||||
i_this->mAction = ACT_TK_BALL_RETURN;
|
||||
i_this->mMode = MODE_TK_BALL_INIT;
|
||||
ADD_ANGLE(actor->current.angle.y, 0x8000);
|
||||
ANGLE_ADD(actor->current.angle.y, 0x8000);
|
||||
} else {
|
||||
i_this->mAction = ACT_TK_BALL_DROP;
|
||||
i_this->mMode = MODE_TK_BALL_INIT;
|
||||
@@ -335,8 +335,8 @@ static int daE_TK_BALL_Execute(e_tk_ball_class* i_this) {
|
||||
|
||||
action(i_this);
|
||||
|
||||
ADD_ANGLE(actor->shape_angle.y, 0x1000);
|
||||
ADD_ANGLE(actor->shape_angle.x, 0xE00);
|
||||
ANGLE_ADD(actor->shape_angle.y, 0x1000);
|
||||
ANGLE_ADD(actor->shape_angle.x, 0xE00);
|
||||
|
||||
mDoMtx_stack_c::transS(actor->current.pos.x, actor->current.pos.y + i_this->mArcHeight,
|
||||
actor->current.pos.z);
|
||||
|
||||
@@ -1271,9 +1271,9 @@ void daE_VA_c::onRopeCutStatus(int param_0, int param_1, int param_2) {
|
||||
}
|
||||
|
||||
void daE_VA_c::setVibRope(f32 param_0, f32 param_1) {
|
||||
field_0x1336 += (s16)(param_1 * 7168.0f);
|
||||
field_0x122c.y += (s16)(param_0 * cM_ssin(field_0x1336));
|
||||
field_0x123e += (s16)(param_0 * 50.0f * cM_ssin(field_0x1336));
|
||||
ANGLE_ADD(field_0x1336, param_1 * 7168.0f);
|
||||
ANGLE_ADD(field_0x122c.y, param_0 * cM_ssin(field_0x1336));
|
||||
ANGLE_ADD(field_0x123e, param_0 * 50.0f * cM_ssin(field_0x1336));
|
||||
}
|
||||
|
||||
static s16 TAG_VIB_ANGLE[] = {
|
||||
|
||||
+10
-10
@@ -1939,7 +1939,7 @@ static void e_wb_b_ikki(e_wb_class* i_this) {
|
||||
} else if (a_this->speedF < 1.0f) {
|
||||
anm_init(i_this, 0x2a, 10.0f, 2, 1.0f);
|
||||
i_this->mActionMode = 6;
|
||||
i_this->mTargetFacingAngle += (s16)0x8000;
|
||||
ANGLE_ADD(i_this->mTargetFacingAngle, 0x8000);
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
@@ -2201,7 +2201,7 @@ static void e_wb_b_ikki2(e_wb_class* i_this) {
|
||||
} else if (a_this->speedF < 1.0f) {
|
||||
anm_init(i_this, 0x2a, 10.0f, 2, 1.0f);
|
||||
i_this->mActionMode = 6;
|
||||
i_this->mTargetFacingAngle += (s16)0x8000;
|
||||
ANGLE_ADD(i_this->mTargetFacingAngle, 0x8000);
|
||||
}
|
||||
} break;
|
||||
|
||||
@@ -2374,7 +2374,7 @@ static void e_wb_a_run(e_wb_class* i_this) {
|
||||
|
||||
if (i_this->field_0x698[0] == 0) {
|
||||
i_this->field_0x698[0] = cM_rndF(30.0f) + 10.0f;
|
||||
i_this->mTargetFacingAngle += (s16)cM_rndFX(10000.0f);
|
||||
ANGLE_ADD(i_this->mTargetFacingAngle, cM_rndFX(10000.0f));
|
||||
}
|
||||
|
||||
if (i_this->field_0x698[1] == 1 || i_this->mSpeedCapTimer == 2) {
|
||||
@@ -2457,7 +2457,7 @@ static int e_wb_damage(e_wb_class* i_this) {
|
||||
i_this->mActionMode = 1;
|
||||
a_this->speedF = -15.0f + YREG_F(0);
|
||||
a_this->speed.y = 50.0f + YREG_F(1) + cM_rndF(20.0f);
|
||||
a_this->current.angle.y += (s16)cM_rndFX(3000.0f);
|
||||
ANGLE_ADD(a_this->current.angle.y, cM_rndFX(3000.0f));
|
||||
i_this->mStatusFlags |= (u16)0x40;
|
||||
break;
|
||||
|
||||
@@ -2778,7 +2778,7 @@ static void damage_check(e_wb_class* i_this) {
|
||||
if (!daAlink_getAlinkActorClass()->checkBoarRideOwn(a_this) &&
|
||||
i_this->field_0x6a0 == 0 && a_this->speedF < 1.0f &&
|
||||
fopAcM_GetName(hit_actor) == PROC_ALINK) {
|
||||
i_this->field_0x6ba += (s16)2;
|
||||
ANGLE_ADD(i_this->field_0x6ba, 2);
|
||||
if (i_this->field_0x6ba >= 150) {
|
||||
i_this->field_0x692 = i_this->mActionID;
|
||||
i_this->mActionID = ACT_S_DAMAGE;
|
||||
@@ -2823,10 +2823,10 @@ static void damage_check(e_wb_class* i_this) {
|
||||
|
||||
if (angle < 0) {
|
||||
i_this->field_0x5de = 0x1000;
|
||||
a_this->current.angle.y += (s16)0x800;
|
||||
ANGLE_ADD(a_this->current.angle.y, 0x800);
|
||||
} else {
|
||||
i_this->field_0x5de = -0x1000;
|
||||
a_this->current.angle.y -= (s16)0x800;
|
||||
ANGLE_SUB(a_this->current.angle.y, 0x800);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3341,11 +3341,11 @@ static s8 e_wb_c_run(e_wb_class* i_this) {
|
||||
i_this->mTargetFacingAngle = cM_atan2s(sp94.x, sp94.z);
|
||||
|
||||
if (rider && rider->mAnmID == 0x27) {
|
||||
i_this->mTargetFacingAngle += static_cast<s16>(
|
||||
(BREG_F(16) + 5000.0f) * cM_ssin(i_this->field_0x68e * (BREG_S(7) + 1000)));
|
||||
ANGLE_ADD(i_this->mTargetFacingAngle,
|
||||
(BREG_F(16) + 5000.0f) * cM_ssin(i_this->field_0x68e * (BREG_S(7) + 1000)));
|
||||
turn_speed = 0x400;
|
||||
} else if (wall_check != 0) {
|
||||
i_this->mTargetFacingAngle += (s16)((BREG_S(8) + -8000) * wall_check);
|
||||
ANGLE_ADD(i_this->mTargetFacingAngle, (BREG_S(8) + -8000) * wall_check);
|
||||
}
|
||||
|
||||
cLib_addCalcAngleS2(&a_this->current.angle.y, i_this->mTargetFacingAngle, 8, turn_speed);
|
||||
|
||||
@@ -320,9 +320,9 @@ void daE_WW_c::damage_check() {
|
||||
mAtInfo.mpCollider = var_r29;
|
||||
if (mAtInfo.mpCollider->ChkAtType(AT_TYPE_IRON_BALL) != 0) {
|
||||
if (fopAcM_GetName(dCc_GetAc(mAtInfo.mpCollider->GetAc())) == PROC_Obj_Carry) {
|
||||
health += (s16) 150;
|
||||
S16_ADD(health, 150);
|
||||
} else if (dComIfGp_checkPlayerStatus0(0, 0x400) != 0) {
|
||||
health += (s16) 180;
|
||||
S16_ADD(health, 180);
|
||||
} else {
|
||||
health = 0;
|
||||
}
|
||||
|
||||
@@ -314,7 +314,7 @@ static BOOL way_set(e_yg_class* i_this) {
|
||||
dBgS_LinChk lin_chk;
|
||||
lin_chk.Set(&start, &end, actor);
|
||||
if (dComIfG_Bgsp().LineCross(&lin_chk)) {
|
||||
y_rot += (s16)0x1000;
|
||||
ANGLE_ADD(y_rot, 0x1000);
|
||||
} else {
|
||||
i_this->mCurrentAngleYTarget = y_rot;
|
||||
return TRUE;
|
||||
@@ -346,7 +346,7 @@ static s8 e_yg_normal(e_yg_class* i_this) {
|
||||
target = l_HIO.movement_spd;
|
||||
|
||||
if (i_this->mpMorf->checkFrame(1.0f)) {
|
||||
i_this->mCurrentAngleYTarget += (s16)cM_rndFX(2000.0f);
|
||||
ANGLE_ADD(i_this->mCurrentAngleYTarget, cM_rndFX(2000.0f));
|
||||
}
|
||||
|
||||
if (i_this->mTimers[0] == 0 || (i_this->mTimers[2] == 0 && fopAcM_wayBgCheck(actor, 200.0f, 50.0f))) {
|
||||
@@ -382,7 +382,7 @@ static s8 e_yg_normal(e_yg_class* i_this) {
|
||||
target = l_HIO.movement_spd * 1.5f;
|
||||
|
||||
if (i_this->mpMorf->checkFrame(1.0f)) {
|
||||
i_this->mCurrentAngleYTarget += (s16)cM_rndFX(4000.0f);
|
||||
ANGLE_ADD(i_this->mCurrentAngleYTarget, cM_rndFX(4000.0f));
|
||||
}
|
||||
|
||||
if (i_this->mTimers[2] == 0 && fopAcM_wayBgCheck(actor, 200.0f, 50.0f)) {
|
||||
@@ -560,7 +560,7 @@ static void search_ground_1(e_yg_class* i_this) {
|
||||
}
|
||||
}
|
||||
|
||||
y_rot += (s16)0x1000;
|
||||
ANGLE_ADD(y_rot, 0x1000);
|
||||
}
|
||||
|
||||
if (line_cross_flag) {
|
||||
|
||||
+14
-14
@@ -964,13 +964,13 @@ void daE_YM_c::executeEscape() {
|
||||
cLib_chaseF(&speedF, 20.0f, 1.0f);
|
||||
setMoveSound(0);
|
||||
if (mAcch.ChkWallHit()) {
|
||||
field_0x6e4 += (s16) 0x800;
|
||||
ANGLE_ADD(field_0x6e4, 0x800);
|
||||
}
|
||||
|
||||
if (field_0x6e8 >= 0) {
|
||||
field_0x6e6 -= (s16) 200;
|
||||
ANGLE_SUB(field_0x6e6, 200);
|
||||
} else {
|
||||
field_0x6e6 += (s16) 200;
|
||||
ANGLE_ADD(field_0x6e6, 200);
|
||||
}
|
||||
|
||||
field_0x6e8 += field_0x6e6;
|
||||
@@ -1971,9 +1971,9 @@ void daE_YM_c::executeFly() {
|
||||
current.angle.y = cLib_targetAngleY(¤t.pos, &mPrevPos);
|
||||
current.angle.x = cLib_targetAngleX(¤t.pos, &mPrevPos);
|
||||
if ((s16)(cLib_targetAngleY(¤t.pos, &player_pos) - current.angle.y) < 0) {
|
||||
current.angle.y += (s16) 0x3000;
|
||||
ANGLE_ADD(current.angle.y, 0x3000);
|
||||
} else {
|
||||
current.angle.y -= (s16) 0x3000;
|
||||
ANGLE_SUB(current.angle.y, 0x3000);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2080,9 +2080,9 @@ void daE_YM_c::executeFly() {
|
||||
} else {
|
||||
tgt_ang_y = cLib_targetAngleY(¤t.pos, &mPrevPos);
|
||||
if (s16(cLib_targetAngleY(¤t.pos, &player_pos) - tgt_ang_y) < 0) {
|
||||
tgt_ang_y += (s16) 0x3000;
|
||||
ANGLE_ADD(tgt_ang_y, 0x3000);
|
||||
} else {
|
||||
tgt_ang_y -= (s16) 0x3000;
|
||||
ANGLE_SUB(tgt_ang_y, 0x3000);
|
||||
}
|
||||
|
||||
cLib_chaseAngleS(¤t.angle.y, tgt_ang_y, 0x400);
|
||||
@@ -2100,7 +2100,7 @@ void daE_YM_c::executeFly() {
|
||||
}
|
||||
}
|
||||
|
||||
field_0x6e4 += (s16) 0x800;
|
||||
ANGLE_ADD(field_0x6e4, 0x800);
|
||||
current.pos.y += cM_ssin(field_0x6e4) * 3.0f;
|
||||
}
|
||||
|
||||
@@ -2176,7 +2176,7 @@ void daE_YM_c::executeFlyAttack() {
|
||||
|
||||
case 4:
|
||||
case 5: {
|
||||
field_0x6e4 += (s16) 0x800;
|
||||
ANGLE_ADD(field_0x6e4, 0x800);
|
||||
current.pos.y += cM_ssin(field_0x6e4) * 3.0f;
|
||||
cLib_chaseF(&speed.y, 0.0f, 3.0f);
|
||||
cLib_chaseF(&speedF, 0.0f, 3.0f);
|
||||
@@ -2537,12 +2537,12 @@ void daE_YM_c::executeSwitch() {
|
||||
cLib_chaseF(&field_0x6dc, 0.0f, 15.0f);
|
||||
setMoveSound(0);
|
||||
if (mAcch.ChkWallHit()) {
|
||||
field_0x6e4 += (s16) 0x800;
|
||||
ANGLE_ADD(field_0x6e4, 0x800);
|
||||
}
|
||||
if (field_0x6e8 >= 0) {
|
||||
field_0x6e6 -= (s16) 200;
|
||||
ANGLE_SUB(field_0x6e6, 200);
|
||||
} else {
|
||||
field_0x6e6 += (s16) 200;
|
||||
ANGLE_ADD(field_0x6e6, 200);
|
||||
}
|
||||
field_0x6e8 += field_0x6e6;
|
||||
cLib_addCalcAngleS(&shape_angle.y, field_0x6e4 + field_0x6e8, 4, 0x1000, 0x100);
|
||||
@@ -2742,7 +2742,7 @@ void daE_YM_c::executeFire() {
|
||||
default:
|
||||
break;
|
||||
}
|
||||
field_0x6e4 += (s16) 0x2000;
|
||||
ANGLE_ADD(field_0x6e4, 0x2000);
|
||||
current.pos.y += cM_ssin(field_0x6e4) * 3.0f;
|
||||
if (mMode) {
|
||||
mSound.startCreatureSoundLevel(Z2SE_EN_YM_FLY, 0, -1);
|
||||
@@ -2851,7 +2851,7 @@ void daE_YM_c::executeRiver() {
|
||||
|
||||
case 2: {
|
||||
setRiverAttention();
|
||||
field_0x6e8 += (s16) 0x200;
|
||||
ANGLE_ADD(field_0x6e8, 0x200);
|
||||
current.pos.y += cM_ssin(field_0x6e8 << 1) * 15.0f;
|
||||
f32 my_float_val = cM_scos(field_0x6e8) * 15.0f;
|
||||
current.pos.x += my_float_val * cM_ssin(shape_angle.y);
|
||||
|
||||
@@ -902,16 +902,16 @@ void daE_YMB_c::executeFly() {
|
||||
if (fVar1 > 1800.0f) {
|
||||
adj_angle = playerAngleY + 0x8000 + cM_rndFX(2048.0f);
|
||||
if ((s16)(cLib_targetAngleY(¤t.pos, &field_0x69c) - playerAngleY) > 0) {
|
||||
adj_angle -= (s16) 0x1800;
|
||||
ANGLE_SUB(adj_angle, 0x1800);
|
||||
} else {
|
||||
adj_angle += (s16) 0x1800;
|
||||
ANGLE_ADD(adj_angle, 0x1800);
|
||||
}
|
||||
} else {
|
||||
adj_angle = playerAngleY + 0x8000 + cM_rndFX(2048.0f);
|
||||
if (cM_rnd() < 0.5f) {
|
||||
adj_angle += (s16) 0x1800;
|
||||
ANGLE_ADD(adj_angle, 0x1800);
|
||||
} else {
|
||||
adj_angle -= (s16) 0x1800;
|
||||
ANGLE_SUB(adj_angle, 0x1800);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -578,7 +578,7 @@ void daE_ZM_c::executeDead() {
|
||||
break;
|
||||
|
||||
case MODE_1: {
|
||||
shape_angle.y += (s16)(field_0x722 * (JREG_S(1) + 100));
|
||||
ANGLE_ADD(shape_angle.y, field_0x722 * (JREG_S(1) + 100));
|
||||
cLib_addCalc0(&speedF, 0.8f, 2.0f);
|
||||
field_0x72b += 10;
|
||||
field_0x700.x = field_0x714 * cM_ssin(field_0x72b * field_0x718);
|
||||
|
||||
@@ -148,7 +148,7 @@ static void fr_normal(fr_class* i_this) {
|
||||
cXyz sp0c;
|
||||
switch (i_this->field_0x5d4) {
|
||||
case 0:
|
||||
i_this->field_0x5d4 += (s16)1;
|
||||
S16_ADD(i_this->field_0x5d4, 1);
|
||||
anm_init(i_this, 11, 5.0f, 2, cM_rndF(0.3f) + 0.8f);
|
||||
i_this->field_0x5dc[0] = cM_rndF(50.0f) + 20.0f;
|
||||
i_this->speedF = 0.0f;
|
||||
@@ -200,7 +200,7 @@ static void fr_away(fr_class* i_this) {
|
||||
cXyz sp08;
|
||||
switch (i_this->field_0x5d4) {
|
||||
case 0:
|
||||
i_this->field_0x5d4 += (s16)1;
|
||||
S16_ADD(i_this->field_0x5d4, 1);
|
||||
i_this->speedF = 0.0f;
|
||||
anm_init(i_this, 7, 3.0f, 0, 4.0f);
|
||||
break;
|
||||
|
||||
@@ -2668,9 +2668,9 @@ int daHorse_c::setLegAngle(f32 param_0, int param_1, int param_2, s16* param_3)
|
||||
sp8C = *sp18 - *sp1C;
|
||||
sp80 = *sp14 - *sp18;
|
||||
|
||||
param_3[i] += (s16)(cM_atan2s(spA4.y, spA4.z) - cM_atan2s(sp8C.y, sp8C.z));
|
||||
ANGLE_ADD(param_3[i], cM_atan2s(spA4.y, spA4.z) - cM_atan2s(sp8C.y, sp8C.z));
|
||||
// i don't like this, but it matches debug and release, param_3[i+1] does not match debug
|
||||
(param_3 + 1)[i] += (s16)(cM_atan2s(sp98.y, sp98.z) - cM_atan2s(sp80.y, sp80.z));
|
||||
ANGLE_ADD((param_3 + 1)[i], cM_atan2s(sp98.y, sp98.z) - cM_atan2s(sp80.y, sp80.z));
|
||||
|
||||
if (i == 0) {
|
||||
spC0[3].y += param_0 * var_f27;
|
||||
@@ -3813,7 +3813,7 @@ int daHorse_c::procTurnInit(int param_0) {
|
||||
field_0x171e = shape_angle.y + 0x8000;
|
||||
|
||||
if (!dComIfGp_event_runCheck() && !checkStateFlg0(FLG0_UNK_4000000)) {
|
||||
field_0x170a += (s16)(f32)0x8000;
|
||||
ANGLE_ADD(field_0x170a, (f32)0x8000);
|
||||
} else if (checkStateFlg0(FLG0_UNK_4000000)) {
|
||||
field_0x171e = shape_angle.y;
|
||||
}
|
||||
@@ -3949,7 +3949,7 @@ int daHorse_c::procTurn() {
|
||||
break;
|
||||
}
|
||||
|
||||
shape_angle.y += (s16)0x2000;
|
||||
ANGLE_ADD(shape_angle.y, 0x2000);
|
||||
current.angle.y = shape_angle.y;
|
||||
}
|
||||
|
||||
@@ -4344,8 +4344,7 @@ int daHorse_c::execute() {
|
||||
current.pos -= *m_cc_stts.GetCCMoveP();
|
||||
break;
|
||||
}
|
||||
|
||||
shape_angle.y += (s16)0x2000;
|
||||
ANGLE_ADD(shape_angle.y, 0x2000);
|
||||
current.angle.y = shape_angle.y;
|
||||
}
|
||||
|
||||
|
||||
@@ -825,8 +825,8 @@ void daHoZelda_c::setNeckAngle() {
|
||||
angle_x_target = var_r27;
|
||||
angle_y_target = var_r26;
|
||||
|
||||
var_r27 += (s16)(spA - spE);
|
||||
var_r26 += (s16)(sp8 - spC);
|
||||
ANGLE_ADD(var_r27, spA - spE);
|
||||
ANGLE_ADD(var_r26, sp8 - spC);
|
||||
}
|
||||
|
||||
daPy_addCalcShort(&mNeckAngle.x, angle_x_target, 3, 0x1000, 0x100);
|
||||
|
||||
@@ -135,7 +135,7 @@ int daItemBase_c::DrawBase() {
|
||||
}
|
||||
|
||||
void daItemBase_c::RotateYBase() {
|
||||
shape_angle.y += (s16)(0xFFFF / getData().mRotateYSpeed);
|
||||
ANGLE_ADD(shape_angle.y, 0xFFFF / getData().mRotateYSpeed);
|
||||
}
|
||||
|
||||
void daItemBase_c::setListStart() {
|
||||
|
||||
@@ -1290,13 +1290,13 @@ void daKago_c::executeStagger() {
|
||||
|
||||
if (field_0x744 == 1) {
|
||||
shape_angle.z = 0x3000;
|
||||
current.angle.y += (s16)-0x2000;
|
||||
ANGLE_ADD(current.angle.y, -0x2000);
|
||||
if (abs((s16)(current.angle.y - field_0x714)) > 0x2000) {
|
||||
current.angle.y = field_0x714 + -0x2000;
|
||||
}
|
||||
} else {
|
||||
shape_angle.z = -0x3000;
|
||||
current.angle.y += (s16)0x2000;
|
||||
ANGLE_ADD(current.angle.y, 0x2000);
|
||||
if (abs((s16)(current.angle.y - field_0x714)) > 0x2000) {
|
||||
current.angle.y = field_0x714 + 0x2000;
|
||||
}
|
||||
|
||||
@@ -425,7 +425,7 @@ static void joint_control(mant_class* i_this, mant_j_s* param_2, int param_3, f3
|
||||
sp08 *= -1;
|
||||
}
|
||||
|
||||
sp08 *= (s16)(-4000 + VREG_S(5));
|
||||
ANGLE_MULT(sp08, -4000 + VREG_S(5));
|
||||
spFC.x = 0.0f;
|
||||
spFC.y = 0.0f;
|
||||
spFC.z = i_this->field_0x394c;
|
||||
@@ -438,7 +438,7 @@ static void joint_control(mant_class* i_this, mant_j_s* param_2, int param_3, f3
|
||||
spB4 = spC0 * (d_p[sp34 - 1] + NREG_F(sp34));
|
||||
|
||||
sp18 = i_this->field_0x3958;
|
||||
sp18 *= 1.0f + VREG_F(0) - sp34 * (0.07f + VREG_F(1));
|
||||
sp18 *= 1.0f + VREG_F(0) - sp34 * (0.07f + VREG_F(1));
|
||||
|
||||
sp84.zero();
|
||||
|
||||
|
||||
@@ -2308,7 +2308,7 @@ static void mf_esa_search(mg_fish_class* i_this) {
|
||||
i_this->field_0x5ec > 10000.0f) {
|
||||
i_this->mActionPhase = 3;
|
||||
i_this->mMovementPitch = i_this->mMovementPitch + 0x2000;
|
||||
i_this->mMovementYaw += (s16)cM_rndFX(32768.0f);
|
||||
ANGLE_ADD(i_this->mMovementYaw, cM_rndFX(32768.0f));
|
||||
rod->field_0x10a5 = fVar10 * (cM_rndF(20.0f) + 15.0f);
|
||||
i_this->field_0x659 = rod->field_0x10a5;
|
||||
} else {
|
||||
@@ -3007,7 +3007,7 @@ static void action(mg_fish_class* i_this) {
|
||||
}
|
||||
} else {
|
||||
f32 unkFloat0 = -1000.0f * i_this->field_0x5d4 * i_this->field_0x660;
|
||||
i_this->jointYaws2[1] += (s16)(i_this->field_0x5d4 * 2500.0f / i_this->mJointScale);
|
||||
ANGLE_ADD(i_this->jointYaws2[1], i_this->field_0x5d4 * 2500.0f / i_this->mJointScale);
|
||||
if (i_this->mGedouKind >= GEDOU_KIND_BG) {
|
||||
i_this->jointYaws2[1] += 2000;
|
||||
}
|
||||
|
||||
@@ -409,8 +409,8 @@ static void lure_set(fshop_class* i_this) {
|
||||
pLure->field_0x3c = cM_rndF(1000.0f) + 500.0f;
|
||||
}
|
||||
|
||||
pLure->field_0x34 += (s16) 4000;
|
||||
pLure->field_0x36 += (s16) 4000;
|
||||
ANGLE_ADD(pLure->field_0x34, 4000);
|
||||
ANGLE_ADD(pLure->field_0x36, 4000);
|
||||
pLure->field_0x32 = pLure->field_0x3c * cM_ssin(pLure->field_0x36);
|
||||
pLure->field_0x30 = pLure->field_0x38 * cM_ssin(pLure->field_0x34);
|
||||
|
||||
@@ -559,7 +559,7 @@ static void tsubo_set(fshop_class* i_this) {
|
||||
xrot = cM_ssin(pTsubo->field_0x20) * pTsubo->field_0x1c;
|
||||
zrot = cM_ssin(pTsubo->field_0x22) * pTsubo->field_0x1c;
|
||||
pTsubo->field_0x20 += pTsubo->field_0x24;
|
||||
ADD_ANGLE_2(pTsubo->field_0x22, pTsubo->field_0x24 + 700);
|
||||
ANGLE_ADD_2(pTsubo->field_0x22, pTsubo->field_0x24 + 700);
|
||||
cLib_addCalcAngleS2(&pTsubo->field_0x24, 9000 + TREG_S(8), 1, 200);
|
||||
|
||||
mDoMtx_stack_c::transS(pTsubo->field_0x00.x, pTsubo->field_0x00.y, pTsubo->field_0x00.z);
|
||||
@@ -589,7 +589,7 @@ static void weed_control(fshop_class* i_this, fs_weed_s* i_weed) {
|
||||
f32 reg_f26;
|
||||
f32 reg_f31;
|
||||
f32 reg_f30;
|
||||
i_weed->field_0xbc += (s16)(i_weed->field_0xb8 * 600.0f + 200.0f);
|
||||
ANGLE_ADD(i_weed->field_0xbc, i_weed->field_0xb8 * 600.0f + 200.0f);
|
||||
cLib_addCalc0(&i_weed->field_0xb8, 0.05f, 0.02f);
|
||||
|
||||
for (i = 1; i < 15; i++, pfVar7++) {
|
||||
@@ -731,9 +731,9 @@ static void koro2_game(fshop_class* i_this) {
|
||||
(mDoCPd_c::getSubStickX(PAD_1) <= -0.8f && old_stick_x > -0.8f))
|
||||
{
|
||||
if (mDoCPd_c::getSubStickX(PAD_1) > 0.0f) {
|
||||
i_this->field_0x4062 += (s16) 0x4000;
|
||||
ANGLE_ADD(i_this->field_0x4062, 0x4000);
|
||||
} else {
|
||||
i_this->field_0x4062 += (s16) -0x4000;
|
||||
ANGLE_ADD(i_this->field_0x4062, -0x4000);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1099,8 +1099,8 @@ static int daFshop_Execute(fshop_class* i_this) {
|
||||
i_this->field_0x4000 = cM_rndF(600.0f) + 1300.0f;
|
||||
}
|
||||
|
||||
i_this->field_0x3ff8 += (s16) 4000;
|
||||
i_this->field_0x3ffa += (s16) 4000;
|
||||
ANGLE_ADD(i_this->field_0x3ff8, 4000);
|
||||
ANGLE_ADD(i_this->field_0x3ffa, 4000);
|
||||
s16 iVar10 = i_this->field_0x4000 * cM_ssin(i_this->field_0x3ffa);
|
||||
s16 iVar11 = i_this->field_0x3ffc * cM_ssin(i_this->field_0x3ff8);
|
||||
cLib_addCalc0(&i_this->field_0x3ffc, 1.0f, 40.0f);
|
||||
|
||||
+19
-19
@@ -1318,13 +1318,13 @@ static void lure_cast(dmg_rod_class* i_this) {
|
||||
actor->speedF *= 0.95f + VREG_F(11);
|
||||
sp40.x = 50.0f + VREG_F(12);
|
||||
sp40.y = (0.0105f + TREG_F(10)) * sp4C.abs();
|
||||
i_this->field_0x75c += (s16)0x1100;
|
||||
i_this->field_0x75e += (s16)0x880;
|
||||
ANGLE_ADD(i_this->field_0x75c, 0x1100);
|
||||
ANGLE_ADD(i_this->field_0x75e, 0x880);
|
||||
} else {
|
||||
sp40.x = 0.0f;
|
||||
sp40.y = (0.011f + TREG_F(11)) * sp4C.abs();
|
||||
i_this->field_0x75c += (s16)0x2200;
|
||||
i_this->field_0x75e += (s16)0x1100;
|
||||
ANGLE_ADD(i_this->field_0x75c, 0x2200);
|
||||
ANGLE_ADD(i_this->field_0x75e, 0x1100);
|
||||
}
|
||||
|
||||
cLib_addCalc2(&i_this->field_0x6f8, sp40.x, 0.1f, 5.0f);
|
||||
@@ -1677,7 +1677,7 @@ static void po_action(dmg_rod_class* i_this, f32 param_1) {
|
||||
}
|
||||
|
||||
if (i_this->timers[0] == 1) {
|
||||
i_this->lure_yaw_target += (s16)cM_rndFX(5000.0f);
|
||||
ANGLE_ADD(i_this->lure_yaw_target, cM_rndFX(5000.0f));
|
||||
}
|
||||
|
||||
cLib_addCalcAngleS2(&i_this->lure_yaw_offset, i_this->lure_yaw_target, 4, var_r26);
|
||||
@@ -1891,8 +1891,8 @@ static void ground_action(dmg_rod_class* i_this) {
|
||||
}
|
||||
}
|
||||
} else if (i_this->field_0x10a8 == 1) {
|
||||
i_this->lure_yaw_offset += (s16)3200;
|
||||
i_this->lure_pitch_offset += (s16)4000;
|
||||
ANGLE_ADD(i_this->lure_yaw_offset, 3200);
|
||||
ANGLE_ADD(i_this->lure_pitch_offset, 4000);
|
||||
}
|
||||
|
||||
cLib_addCalc2(&actor->speedF, reelSpeed, 1.0f, 5.0f + BREG_F(12));
|
||||
@@ -1972,9 +1972,9 @@ static void wd_action(dmg_rod_class* i_this, f32 param_1, wd_ss* i_wd_s) {
|
||||
sp8 -= actor->shape_angle.y;
|
||||
|
||||
if (sp8 < 0) {
|
||||
i_wd_s->field_0x38 += (s16)200;
|
||||
ANGLE_ADD(i_wd_s->field_0x38, 200);
|
||||
} else {
|
||||
i_wd_s->field_0x38 -= (s16)200;
|
||||
ANGLE_SUB(i_wd_s->field_0x38, 200);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2525,7 +2525,7 @@ static void lure_catch(dmg_rod_class* i_this) {
|
||||
if (mgfish->mActionPhase < 2 && i_this->play_cam_timer > 25) {
|
||||
s16 target = DREG_S(6) + 2000;
|
||||
if (mgfish->mJointScale > 0.5f) {
|
||||
target += (s16)((mgfish->mJointScale - 0.5f) * (20000.0f + DREG_F(19)));
|
||||
ANGLE_ADD(target, (mgfish->mJointScale - 0.5f) * (20000.0f + DREG_F(19)));
|
||||
}
|
||||
|
||||
if (target > 6000) {
|
||||
@@ -3634,15 +3634,15 @@ static void uki_pl_arm_calc(dmg_rod_class* i_this) {
|
||||
sp10.y = WREG_S(4) - 5000;
|
||||
sp10.z = WREG_S(5) + 2000;
|
||||
|
||||
sp8.y += (s16)(-15000.0f * i_this->field_0x1508);
|
||||
sp8.z += (s16)(3500.0f * i_this->field_0x1508);
|
||||
ANGLE_ADD(sp8.y, -15000.0f * i_this->field_0x1508);
|
||||
ANGLE_ADD(sp8.z, 3500.0f * i_this->field_0x1508);
|
||||
|
||||
sp10.y += (s16)(-4000.0f * i_this->field_0x1508);
|
||||
sp10.z += (s16)((3500.0f * i_this->field_0x1508) + ((-11000.0f + WREG_F(8)) * (i_this->field_0x150c * i_this->field_0x1508)));
|
||||
ANGLE_ADD(sp10.y, -4000.0f * i_this->field_0x1508);
|
||||
ANGLE_ADD(sp10.z, (3500.0f * i_this->field_0x1508) + ((-11000.0f + WREG_F(8)) * (i_this->field_0x150c * i_this->field_0x1508)));
|
||||
|
||||
if (i_this->action == ACTION_UKI_HIT && i_this->field_0xf60 > 140.0f + JREG_F(14)) {
|
||||
sp8.y += (s16)((50.0f + nREG_F(0)) * cM_ssin(i_this->counter * 0x6200));
|
||||
sp8.z += (s16)((50.0f + nREG_F(0)) * cM_ssin(i_this->counter * 0x6500));
|
||||
ANGLE_ADD(sp8.y, (50.0f + nREG_F(0)) * cM_ssin(i_this->counter * 0x6200));
|
||||
ANGLE_ADD(sp8.z, (50.0f + nREG_F(0)) * cM_ssin(i_this->counter * 0x6500));
|
||||
daAlink_getAlinkActorClass()->seStartOnlyReverbLevel(Z2SE_AL_ROD_BEND);
|
||||
}
|
||||
|
||||
@@ -3668,7 +3668,7 @@ static void uki_standby(dmg_rod_class* i_this) {
|
||||
cLib_addCalc2(&i_this->field_0x150c, substickX, 0.5f, 0.2f);
|
||||
|
||||
if (i_this->field_0x1508 > 0.3f && i_this->play_cam_mode < 5) {
|
||||
i_this->field_0x1418 += (s16)((-500.0f + VREG_F(3)) * mDoCPd_c::getStickX3D(PAD_1));
|
||||
ANGLE_ADD(i_this->field_0x1418, (-500.0f + VREG_F(3)) * mDoCPd_c::getStickX3D(PAD_1));
|
||||
}
|
||||
|
||||
cMtx_YrotS(*calc_mtx, i_this->field_0x1418);
|
||||
@@ -4638,7 +4638,7 @@ static void play_camera(dmg_rod_class* i_this) {
|
||||
f32 sp40 = i_this->field_0x13ac;
|
||||
sp40 *= 1000.0f + BREG_F(3);
|
||||
|
||||
i_this->field_0x141a += (s16)sp40;
|
||||
ANGLE_ADD(i_this->field_0x141a, sp40);
|
||||
if (i_this->field_0x141a > 0x1000) {
|
||||
i_this->field_0x141a = 0x1000;
|
||||
} else if (i_this->field_0x141a < -0x1000) {
|
||||
@@ -6012,7 +6012,7 @@ static int dmg_rod_Execute(dmg_rod_class* i_this) {
|
||||
|
||||
s16 sp8 = 500.0f * cM_ssin(i_this->counter * 1100);
|
||||
if (i_this->reel_btn_flags != 0) {
|
||||
sp8 += (s16)0x2000;
|
||||
ANGLE_ADD(sp8, 0x2000);
|
||||
}
|
||||
|
||||
cLib_addCalcAngleS2(&obj_life->shape_angle.x, sp8, 15, 0x200);
|
||||
|
||||
@@ -2420,8 +2420,8 @@ s16 daMidna_c::getNeckAimAngle(cXyz const* i_atnPos, s16* o_neckX, s16* o_neckY,
|
||||
*o_eyeY = (s16)(sVar8 - sVar2) >> 1;
|
||||
*o_neckX = *o_eyeX;
|
||||
*o_neckY = *o_eyeY;
|
||||
*o_eyeX += (s16)(atn_angle_x - sVar7);
|
||||
*o_eyeY += (s16)(atn_angle_y - sVar8);
|
||||
ANGLE_ADD(*o_eyeX, atn_angle_x - sVar7);
|
||||
ANGLE_ADD(*o_eyeY, atn_angle_y - sVar8);
|
||||
} else {
|
||||
*o_neckX = daAlink_getAlinkActorClass()->getProcNeckX();
|
||||
*o_neckY = daAlink_getAlinkActorClass()->getMidnaProcNeckY();
|
||||
|
||||
@@ -689,17 +689,17 @@ static void __THPDecompressYUV(void* tileY, void* tileU, void* tileV) {
|
||||
if (__THPInfo->xPixelSize == 512 && targetY == 448) {
|
||||
while (currentY < targetY) {
|
||||
__THPDecompressiMCURow512x448();
|
||||
currentY += (u16)16;
|
||||
U16_ADD(currentY, 16);
|
||||
}
|
||||
} else if (__THPInfo->xPixelSize == 640 && targetY == 480) {
|
||||
while (currentY < targetY) {
|
||||
__THPDecompressiMCURow640x480();
|
||||
currentY += (u16)16;
|
||||
U16_ADD(currentY, 16);
|
||||
}
|
||||
} else {
|
||||
while (currentY < targetY) {
|
||||
__THPDecompressiMCURowNxN();
|
||||
currentY += (u16)16;
|
||||
U16_ADD(currentY, 16);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1243,7 +1243,7 @@ static void play_camera(ni_class* i_this) {
|
||||
temp = i_this->mPadSubStickX;
|
||||
|
||||
temp *= TREG_F(3) + 5000.0f;
|
||||
i_this->field_0xaf4 += (s16)temp;
|
||||
S16_ADD(i_this->field_0xaf4, temp);
|
||||
i_this->field_0xafc += i_this->mPadSubStickY * (TREG_F(7) + -25.0f);
|
||||
|
||||
if (i_this->field_0xafc > (TREG_F(8) + 800.0f)) {
|
||||
|
||||
@@ -2435,7 +2435,7 @@ BOOL daNpcT_c::turn(s16 i_angle, int i_count, int i_direction) {
|
||||
}
|
||||
|
||||
s16 turn = angle_diff * cM_ssin((s16)mTurnAmount);
|
||||
mTurnAmount += (s16)(0x4000 / mTurnCount);
|
||||
ANGLE_ADD(mTurnAmount, 0x4000 / mTurnCount);
|
||||
|
||||
if ((u16)mTurnAmount < 0x4000) {
|
||||
mCurAngle.y = mStartAngle + turn;
|
||||
@@ -2645,7 +2645,7 @@ void daNpcT_c::setHitodamaPrtcl() {
|
||||
field_0xe00.y = cM_ssin(field_0xe18) * 4.0f;
|
||||
field_0xe00.z = field_0xe00.x * -cM_ssin(shape_angle.y);
|
||||
field_0xe00.x = field_0xe00.x * cM_scos(shape_angle.y);
|
||||
field_0xe1a += (s16)0x400;
|
||||
ANGLE_ADD(field_0xe1a, 0x400);
|
||||
|
||||
pos.x = eyePos.x + field_0xe00.x + field_0xe0c.x;
|
||||
pos.y = eyePos.y + field_0xe00.y + field_0xe0c.y;
|
||||
|
||||
@@ -1710,7 +1710,7 @@ void daNpcF_c::setHitodamaPrtcl() {
|
||||
field_0x9b8.z = field_0x9b8.x * -cM_ssin(shape_angle.y);
|
||||
|
||||
field_0x9b8.x *= cM_scos(shape_angle.y);
|
||||
field_0x9d2 += (s16)0x400;
|
||||
ANGLE_ADD(field_0x9d2, 0x400);
|
||||
|
||||
pos.x = eyePos.x + field_0x9b8.x + field_0x9c4.x;
|
||||
pos.y = eyePos.y + field_0x9b8.y + field_0x9c4.y;
|
||||
|
||||
@@ -1402,19 +1402,19 @@ int daNpc_Aru_c::duck(int param_1) {
|
||||
|
||||
switch (field_0xfca) {
|
||||
case 1:
|
||||
sVar1 -= (s16) 0x1000;
|
||||
ANGLE_SUB(sVar1, 0x1000);
|
||||
break;
|
||||
|
||||
case 7:
|
||||
sVar1 += (s16) 0x1000;
|
||||
ANGLE_ADD(sVar1, 0x1000);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
sVar1 -= (s16) 0x4000;
|
||||
ANGLE_SUB(sVar1, 0x4000);
|
||||
break;
|
||||
|
||||
case 6:
|
||||
sVar1 += (s16) 0x4000;
|
||||
ANGLE_ADD(sVar1, 0x4000);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -826,7 +826,7 @@ static void action(npc_henna_class* i_this) {
|
||||
i_this->field_0x6b6 = i_this->field_0x6b0 * (TREG_F(3) + -0.65f);
|
||||
}
|
||||
|
||||
i_this->field_0x6b6 += (s16)((0.15f + TREG_F(13)) * fabsf(i_this->field_0x6ac));
|
||||
ANGLE_ADD(i_this->field_0x6b6, (0.15f + TREG_F(13)) * fabsf(i_this->field_0x6ac));
|
||||
s16 sp_0x8 = 0; // unused
|
||||
}
|
||||
|
||||
|
||||
@@ -4994,22 +4994,14 @@ int daNpc_Kn_c::setSlipPrtcl() {
|
||||
mDoMtx_stack_c::multVecZero(&mParticleMngr[0].mPos);
|
||||
mParticleMngr[0].mPos.y -= 20.0f;
|
||||
mParticleMngr[0].mAngle = current.angle;
|
||||
#if DEBUG
|
||||
mParticleMngr[0].mAngle.y -= (s16) 0x8000;
|
||||
#else
|
||||
mParticleMngr[0].mAngle.y -= 0x8000;
|
||||
#endif
|
||||
ANGLE_SUB_2(mParticleMngr[0].mAngle.y, 0x8000);
|
||||
mParticleMngr[0].mpModel = true;
|
||||
|
||||
mDoMtx_stack_c::copy(mpModelMorf[0]->getModel()->getAnmMtx(0x1b));
|
||||
mDoMtx_stack_c::multVecZero(&mParticleMngr[1].mPos);
|
||||
mParticleMngr[1].mPos.y -= 20.0f;
|
||||
mParticleMngr[1].mAngle = current.angle;
|
||||
#if DEBUG
|
||||
mParticleMngr[1].mAngle.y -= (s16) 0x8000;
|
||||
#else
|
||||
mParticleMngr[1].mAngle.y -= 0x8000;
|
||||
#endif
|
||||
ANGLE_SUB_2(mParticleMngr[1].mAngle.y, 0x8000);
|
||||
mParticleMngr[1].mpModel = true;
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -1033,7 +1033,7 @@ BOOL daNpc_Kn_c::turn(s16 i_angle, int i_count, int i_direction) {
|
||||
}
|
||||
|
||||
int offset = angle_diff * cM_ssin((s16)mTurnAmount);
|
||||
mTurnAmount += (s16)(16384.0f / mTurnCount);
|
||||
ANGLE_ADD(mTurnAmount, 16384.0f / mTurnCount);
|
||||
|
||||
if ((u16)mTurnAmount < 0x4000) {
|
||||
mCurAngle.y = mStartAngle + offset;
|
||||
|
||||
+12
-12
@@ -681,7 +681,7 @@ static int npc_ks_ori(npc_ks_class* i_this) {
|
||||
if (i_this->timer[0] == 1) {
|
||||
anm_init(i_this, 32, 2.0f, 0, 1.0f);
|
||||
if (fopAcM_GetRoomNo(actor) == 11) {
|
||||
ADD_ANGLE_2(actor->current.angle.y, 0x1600);
|
||||
ANGLE_ADD_2(actor->current.angle.y, 0x1600);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -829,7 +829,7 @@ static int npc_ks_ori2(npc_ks_class* i_this) {
|
||||
break;
|
||||
|
||||
case 2:
|
||||
ADD_ANGLE_2(sVar1, -0x8000);
|
||||
ANGLE_ADD_2(sVar1, -0x8000);
|
||||
if (i_this->timer[0] == 0) {
|
||||
if (cage_p->partBreak()) {
|
||||
anm_init(i_this, 22, 5.0f, 2, 1.0f);
|
||||
@@ -901,7 +901,7 @@ static int npc_ks_ori2(npc_ks_class* i_this) {
|
||||
case 6:
|
||||
i_this->field_0x5fc = 0;
|
||||
fVar1 = -20.0f;
|
||||
ADD_ANGLE_2(sVar1, 0x2000);
|
||||
ANGLE_ADD_2(sVar1, 0x2000);
|
||||
if (i_this->model->isStop()) {
|
||||
anm_init(i_this, 33, 1.0f, 0, 1.0f);
|
||||
actor->speedF = 40.0f;
|
||||
@@ -916,7 +916,7 @@ static int npc_ks_ori2(npc_ks_class* i_this) {
|
||||
|
||||
case 7:
|
||||
i_this->field_0x5fc = 0;
|
||||
ADD_ANGLE_2(sVar1, 0x4000);
|
||||
ANGLE_ADD_2(sVar1, 0x4000);
|
||||
actor->gravity = -5.0f;
|
||||
break;
|
||||
|
||||
@@ -2018,7 +2018,7 @@ static void npc_ks_hang(npc_ks_class* i_this) {
|
||||
s16 sVar2 = i_this->field_0x602;
|
||||
cLib_addCalcAngleS2(&i_this->field_0x602, i_this->field_0x60c * cM_ssin(i_this->field_0x5fa), 4, 0x1000);
|
||||
i_this->field_0x604 = i_this->field_0x602 - sVar2;
|
||||
i_this->field_0x5fa += (s16) 0x800;
|
||||
ANGLE_ADD(i_this->field_0x5fa, 0x800);
|
||||
actor->current.angle.z = -(i_this->field_0x602 / 4);
|
||||
|
||||
if (i_this->mode != 4) {
|
||||
@@ -2162,7 +2162,7 @@ static void npc_ks_hang_s(npc_ks_class* i_this) {
|
||||
s16 sVar2 = i_this->field_0x602;
|
||||
cLib_addCalcAngleS2(&i_this->field_0x602, i_this->field_0x60c * cM_ssin(i_this->field_0x5fa), 4, 0x1000);
|
||||
i_this->field_0x604 = i_this->field_0x602 - sVar2;
|
||||
ADD_ANGLE_2(i_this->field_0x5fa, 0x800);
|
||||
ANGLE_ADD_2(i_this->field_0x5fa, 0x800);
|
||||
actor->current.angle.z = -(i_this->field_0x602 / 4);
|
||||
|
||||
if (i_this->field_0x620 != 2) {
|
||||
@@ -2242,7 +2242,7 @@ static void npc_ks_e_hang(npc_ks_class* i_this) {
|
||||
|
||||
actor->current.pos = sw_p->field_0x920[i_this->field_0x630];
|
||||
cLib_addCalcAngleS2(&i_this->field_0x602, i_this->field_0x60c * cM_ssin(i_this->field_0x5fa), 4, 0x1000);
|
||||
ADD_ANGLE_2(i_this->field_0x5fa, 0x800);
|
||||
ANGLE_ADD_2(i_this->field_0x5fa, 0x800);
|
||||
actor->current.angle.z = -(i_this->field_0x602 / 4);
|
||||
cLib_addCalc0(&i_this->field_0x60c, 0.5f, 100.0f + TREG_F(3));
|
||||
}
|
||||
@@ -3877,7 +3877,7 @@ static int npc_ks_option(npc_ks_class* i_this) {
|
||||
|
||||
case 30:
|
||||
target_speed = l_HIO.holding_speed_h;
|
||||
ADD_ANGLE_2(i_this->current_angle.y, 0x8000);
|
||||
ANGLE_ADD_2(i_this->current_angle.y, 0x8000);
|
||||
if (fVar2 > 400.0f) {
|
||||
i_this->mode = 31;
|
||||
anm_init(i_this, 51, 5.0f, 2, 1.0f);
|
||||
@@ -3898,7 +3898,7 @@ static int npc_ks_option(npc_ks_class* i_this) {
|
||||
anm_init(i_this, 39, 5.0f, 2, 1.0f);
|
||||
i_this->mode = 41;
|
||||
i_this->timer[0] = cM_rndF(80.0f) + 100.0f;
|
||||
ADD_ANGLE_2(i_this->current_angle.y, 0x8000);
|
||||
ANGLE_ADD_2(i_this->current_angle.y, 0x8000);
|
||||
break;
|
||||
|
||||
case 41:
|
||||
@@ -5865,7 +5865,7 @@ static int npc_ks_fsdemo(npc_ks_class* i_this) {
|
||||
if (i_this->path_no == 0) {
|
||||
anm_init(i_this, 45, 3.0f, 0, 1.0f);
|
||||
i_this->mode = 3;
|
||||
ADD_ANGLE_2(i_this->current_angle.y, 0x8000);
|
||||
ANGLE_ADD_2(i_this->current_angle.y, 0x8000);
|
||||
actor->speedF = 0.0f;
|
||||
} else {
|
||||
i_this->mode = 1;
|
||||
@@ -5878,7 +5878,7 @@ static int npc_ks_fsdemo(npc_ks_class* i_this) {
|
||||
|
||||
case 3:
|
||||
if (i_this->model->isStop()) {
|
||||
ADD_ANGLE_2(i_this->current_angle.y, 0x8000);
|
||||
ANGLE_ADD_2(i_this->current_angle.y, 0x8000);
|
||||
i_this->mode = 1;
|
||||
}
|
||||
break;
|
||||
@@ -5916,7 +5916,7 @@ static int npc_ks_fsdemo(npc_ks_class* i_this) {
|
||||
if (i_this->timer[2] != 0) {
|
||||
i_this->search_time = 10;
|
||||
i_this->find_pos.set(-37799.0f, 815.0f, -22323.0f);
|
||||
i_this->current_angle.y -= (s16) 0x3000;
|
||||
ANGLE_SUB(i_this->current_angle.y, 0x3000);
|
||||
sVar1 = 0x800;
|
||||
}
|
||||
|
||||
|
||||
@@ -615,7 +615,7 @@ static void npc_ne_away(npc_ne_class* i_this) {
|
||||
way_check(i_this, i_this->mTargetAngleY);
|
||||
}
|
||||
if (i_this->mTimers[0] == 0) {
|
||||
i_this->mTargetAngleY += (s16)cM_rndFX(4000.0f);
|
||||
ANGLE_ADD(i_this->mTargetAngleY, cM_rndFX(4000.0f));
|
||||
i_this->mTimers[0] = cM_rndF(25.0f) + 20.0f;
|
||||
}
|
||||
if (i_this->mDistToTarget > 400.0f && i_this->mTimers[2] == 0) {
|
||||
|
||||
@@ -456,7 +456,7 @@ void daNPC_TK_c::initPerchDemo(int param_0) {
|
||||
mPathStep2 = cM_rndFX(5.0f);
|
||||
|
||||
if (mPathStep2 < 0) {
|
||||
ADD_S8_2(mPathStep2, mpPath1->m_num);
|
||||
S8_ADD_2(mPathStep2, mpPath1->m_num);
|
||||
}
|
||||
|
||||
if (mPathStep2 >= mpPath1->m_num || mPathStep2 < 0) {
|
||||
@@ -1128,8 +1128,8 @@ void daNPC_TK_c::executeAway() {
|
||||
}
|
||||
|
||||
void daNPC_TK_c::setCarryActorMtx() {
|
||||
field_0x6a8 += (s16)0x6bc;
|
||||
field_0x6a6 = cM_ssin(field_0x6a8) * 2048.0f + 4096.0f;
|
||||
ANGLE_ADD(field_0x6a8, 0x6bc);
|
||||
field_0x6a6 = cM_ssin(field_0x6a8) * (f32)0x800 + (f32)0x1000;
|
||||
if (field_0x634 == NULL) {
|
||||
return;
|
||||
}
|
||||
@@ -1310,8 +1310,7 @@ void daNPC_TK_c::executeBack() {
|
||||
|
||||
shape_angle.y += field_0x69e;
|
||||
current.angle.y = shape_angle.y;
|
||||
|
||||
shape_angle.x -= (s16)(0x300 + nREG_S(0));
|
||||
ANGLE_SUB(shape_angle.x, 0x300 + nREG_S(0));
|
||||
|
||||
if (shape_angle.x < -0x3000) {
|
||||
shape_angle.x = -0x3000;
|
||||
|
||||
@@ -2675,7 +2675,7 @@ int daNpc_ykM_c::cutLv5DungeonClear(int i_cutIndex) {
|
||||
|
||||
if (rv != 0) {
|
||||
angleY = fopAcM_searchActorAngleY(this, player);
|
||||
angleY += (s16)0x4000;
|
||||
ANGLE_ADD(angleY, 0x4000);
|
||||
daPy_getPlayerActorClass()->setPlayerPosAndAngle(&player->current.pos, angleY, 0);
|
||||
field_0x1580 = 1;
|
||||
}
|
||||
|
||||
@@ -1936,7 +1936,7 @@ BOOL daNpc_zrA_c::swimRiverDescend(void* param_0) {
|
||||
}
|
||||
|
||||
if ((player_r26->current.pos - current.pos).absXZ() < 500.0f) {
|
||||
angle_sp44.x += (s16)0x1000;
|
||||
ANGLE_ADD(angle_sp44.x, 0x1000);
|
||||
}
|
||||
|
||||
if (field_0x153c) {
|
||||
|
||||
@@ -156,7 +156,7 @@ void daObjYtaihou_c::setMtx() {
|
||||
static f32 l_wheelMinR;
|
||||
static u8 lbl_396_bss_4C;
|
||||
|
||||
home.angle.z += (s16) ((s16)(shape_angle.y - old.angle.y) * 0.8f);
|
||||
ANGLE_ADD(home.angle.z, (s16)(shape_angle.y - old.angle.y) * 0.8f);
|
||||
if ((s8)lbl_396_bss_4C == 0) {
|
||||
l_wheelMinR = cM_scos(0xccc) * 60.0f;
|
||||
lbl_396_bss_4C = 1;
|
||||
|
||||
@@ -316,8 +316,8 @@ void Hahen_c::Roll_Set(cXyz* i_pos, f32 param_1, s16 i_no) {
|
||||
|
||||
rot_speed.x = cM_rndFX(5000.0f + nREG_F(6));
|
||||
rot_speed.y = cM_rndFX(5000.0f + nREG_F(6));
|
||||
rotation.x += (s16)0x1000;
|
||||
rotation.y += (s16)0x1000;
|
||||
ANGLE_ADD(rotation.x, 0x1000);
|
||||
ANGLE_ADD(rotation.y, 0x1000);
|
||||
}
|
||||
|
||||
void daObjBHASHI_c::setBaseMtx() {
|
||||
|
||||
@@ -674,7 +674,7 @@ static void obj_brg_move(obj_brg_class* i_this) {
|
||||
i_this->field_0xaf1c = 3;
|
||||
/* fallthrough */
|
||||
case 3: {
|
||||
i_this->field_0xaf1e += (s16) 3000;
|
||||
ANGLE_ADD(i_this->field_0xaf1e, 3000);
|
||||
part->field_0x0b0 = a_this->home.pos;
|
||||
|
||||
if ((i_this->mType & 1) == 1) {
|
||||
@@ -871,7 +871,7 @@ static void obj_brg_move(obj_brg_class* i_this) {
|
||||
}
|
||||
|
||||
cLib_addCalc0(&i_this->field_0xaef4, 0.05f, 80.0f);
|
||||
i_this->field_0xaf2e += (s16) 4500;
|
||||
ANGLE_ADD(i_this->field_0xaf2e, 4500);
|
||||
|
||||
if (i_this->field_0xb1ec) {
|
||||
spDC = i_this->mEndPos;
|
||||
|
||||
@@ -3917,8 +3917,8 @@ void daObjCarry_c::calc_rot_axis_tsubo() {
|
||||
mDoMtx_stack_c::YrotS(current.angle.y);
|
||||
mDoMtx_stack_c::multVec(&mRotAxis, &mRotAxis);
|
||||
}
|
||||
|
||||
mRotation += (s16)(((0.5f * field_0xd70) + data().m_urnRotateFactor) * (std::fabs(speedF) + std::fabs(speed.y)));
|
||||
ANGLE_ADD(mRotation, ((0.5f * field_0xd70) + data().m_urnRotateFactor) *
|
||||
(std::fabs(speedF) + std::fabs(speed.y)));
|
||||
break;
|
||||
case 3:
|
||||
sp20 = current.pos - old.pos;
|
||||
@@ -3930,8 +3930,8 @@ void daObjCarry_c::calc_rot_axis_tsubo() {
|
||||
mDoMtx_stack_c::multVec(&mRotAxis, &mRotAxis);
|
||||
}
|
||||
}
|
||||
|
||||
mRotation += (s16)(((0.5f * field_0xd70) + data().m_urnRotateFactor) * (std::fabs(speedF) + std::fabs(speed.y)));
|
||||
ANGLE_ADD(mRotation, ((0.5f * field_0xd70) + data().m_urnRotateFactor) *
|
||||
(std::fabs(speedF) + std::fabs(speed.y)));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -3951,7 +3951,7 @@ void daObjCarry_c::calc_rot_axis_kibako() {
|
||||
cXyz sp8 = current.pos - old.pos;
|
||||
|
||||
if (mMode == MODE_DROP) {
|
||||
mRotation += (s16)(speedF * ((field_0xd70 * 0.5f) + data().m_urnRotateFactor));
|
||||
ANGLE_ADD(mRotation, speedF * ((field_0xd70 * 0.5f) + data().m_urnRotateFactor));
|
||||
} else {
|
||||
mRotation = 0;
|
||||
}
|
||||
@@ -3984,7 +3984,8 @@ void daObjCarry_c::calc_rot_axis_bokkuri() {
|
||||
mDoMtx_stack_c::multVec(&mRotAxis, &mRotAxis);
|
||||
}
|
||||
|
||||
mRotation += (s16)(((0.5f * field_0xd70) + data().m_urnRotateFactor) * (std::fabs(speedF) + std::fabs(speed.y)));
|
||||
ANGLE_ADD(mRotation, ((0.5f * field_0xd70) + data().m_urnRotateFactor) *
|
||||
(std::fabs(speedF) + std::fabs(speed.y)));
|
||||
}
|
||||
} else if (mMode == MODE_WALK || mMode == MODE_WAIT) {
|
||||
mRotAxis = cXyz::Zero;
|
||||
|
||||
@@ -182,8 +182,8 @@ void daObjChandelier_c::setModelMtx() {
|
||||
|
||||
void daObjChandelier_c::moveSwing(f32 param_0, f32 param_1, f32 param_2, f32 param_3) {
|
||||
f32 f1 = -param_1 + param_0 * field_0x5fc;
|
||||
shape_angle.z += (s16)(field_0x608 * (f1 * field_0x5ec));
|
||||
shape_angle.y += (s16)(field_0x608 * field_0x604 * field_0x5ec);
|
||||
ANGLE_ADD(shape_angle.z, field_0x608 * (f1 * field_0x5ec));
|
||||
ANGLE_ADD(shape_angle.y, field_0x608 * field_0x604 * field_0x5ec);
|
||||
if (f1 > param_1) {
|
||||
field_0x5fc = 0;
|
||||
field_0x608 *= -1;
|
||||
@@ -209,7 +209,7 @@ void daObjChandelier_c::moveSwingFall() {
|
||||
cLib_chaseF(&field_0x5ec, 0.0f, 0.04f);
|
||||
field_0x608 *= -1;
|
||||
shape_angle.z = field_0x608 * 50.0f * field_0x5ec;
|
||||
shape_angle.y += (s16)cM_rndFX(50.0f);
|
||||
ANGLE_ADD(shape_angle.y, cM_rndFX(50.0f));
|
||||
cXyz vec1 = field_0x5a8;
|
||||
mDoMtx_stack_c::transS(vec1);
|
||||
mDoMtx_stack_c::ZXYrotM(shape_angle);
|
||||
|
||||
@@ -170,8 +170,7 @@ void daObjCRVGATE_c::actionDemoEvent() {
|
||||
}
|
||||
} else {
|
||||
cLib_chaseAngleS(&mDoorOpenAngle.x, 0x4000, mMoveAngle.z);
|
||||
|
||||
mMoveAngle.z += (s16)0x300;
|
||||
ANGLE_ADD(mMoveAngle.z, 0x300);
|
||||
if (mDoorOpenAngle.x == 0x4000) {
|
||||
mEventID = 3;
|
||||
camera_class* camera = dComIfGp_getCamera(dComIfGp_getPlayerCameraID(0));
|
||||
@@ -224,7 +223,7 @@ int daObjCRVGATE_c::CheckVec() {
|
||||
}
|
||||
|
||||
void daObjCRVGATE_c::KeyVib() {
|
||||
mMoveAngle.x -= (s16)0x21;
|
||||
ANGLE_SUB(mMoveAngle.x, 0x21);
|
||||
mMoveAngle.z += mMoveAngle.x;
|
||||
cLib_chaseAngleS(&mMoveAngle.y, 0, 0x150);
|
||||
|
||||
@@ -249,7 +248,7 @@ void daObjCRVGATE_c::KeyVib() {
|
||||
}
|
||||
|
||||
void daObjCRVGATE_c::DoorVib() {
|
||||
mDoorVib.y -= (s16)(KREG_S(1) + 0x100);
|
||||
ANGLE_SUB(mDoorVib.y, KREG_S(1) + 0x100);
|
||||
mDoorVib.z += mDoorVib.y;
|
||||
cLib_chaseAngleS(&mDoorVib.x, 0, 0x40);
|
||||
|
||||
|
||||
@@ -106,8 +106,7 @@ void daObjFlag_c::calcJointAngle() {
|
||||
} else {
|
||||
param_0->mJoint1.z = (attr().field_0x0e * cM_ssin(param_0->mRv));
|
||||
}
|
||||
|
||||
param_0->mRv += (s16)(param_1 * attr().field_0x30);
|
||||
ANGLE_ADD(param_0->mRv, param_1 * attr().field_0x30);
|
||||
}
|
||||
|
||||
void daObjFlag_c::calcAngleSwingX(FlagJoint_c* param_0, f32 param_1) {
|
||||
|
||||
@@ -170,8 +170,7 @@ static void food_normal(obj_food_class* i_this) {
|
||||
|
||||
Z2GetAudioMgr()->seStart(Z2SE_OBJ_TOY_BONE_BOUND, &i_this->current.pos,
|
||||
fabsf(i_this->mOldSpeedY), 0, 1.0f, 1.0f, -1.0f, -1.0f, 0);
|
||||
|
||||
i_this->current.angle.y += (s16)cM_rndFX(8000.0f);
|
||||
ANGLE_ADD(i_this->current.angle.y, cM_rndFX(8000.0f));
|
||||
|
||||
if (i_this->mBounces == 3) {
|
||||
i_this->mRotSpeed.z = 0;
|
||||
@@ -271,7 +270,7 @@ static void action(obj_food_class* i_this) {
|
||||
}
|
||||
|
||||
if (i_this->mType == obj_food_class::TYPE_BALL) {
|
||||
i_this->current.angle.x += (s16)(i_this->speedF * 700.0f);
|
||||
ANGLE_ADD(i_this->current.angle.x, i_this->speedF * 700.0f);
|
||||
cMtx_YrotS(*calc_mtx, i_this->current.angle.y);
|
||||
vec1.x = 0.0f;
|
||||
vec1.y = 0.0f;
|
||||
|
||||
@@ -305,7 +305,8 @@ int daObj_Gadget_c::Execute() {
|
||||
if (getWallAngle(current.angle.y, &wallAngle)) {
|
||||
field_0x9f4 = 10;
|
||||
s16 angleDiff = current.angle.y - wallAngle;
|
||||
current.angle.y += (s16)((0x8000 - (angleDiff * 2)) + (s16)cM_rndFX(2000.0f));
|
||||
ANGLE_ADD(current.angle.y,
|
||||
(0x8000 - (angleDiff * 2)) + (s16)cM_rndFX(2000.0f));
|
||||
field_0x9ec.y = -field_0x9ec.y / 2;
|
||||
speedF *= 0.3f;
|
||||
}
|
||||
@@ -318,7 +319,8 @@ int daObj_Gadget_c::Execute() {
|
||||
if (mAcch.ChkWallHit()) {
|
||||
if (getWallAngle(current.angle.y, &wallAngle)) {
|
||||
s16 angleDiff = current.angle.y - wallAngle;
|
||||
current.angle.y += (s16)((0x8000 - (angleDiff << 1)) + (s16)cM_rndFX(1000.0f));
|
||||
ANGLE_ADD(current.angle.y,
|
||||
(0x8000 - (angleDiff << 1)) + (s16)cM_rndFX(1000.0f));
|
||||
speedF *= 0.5f;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -437,7 +437,8 @@ static void drop(obj_gm_class* i_this) {
|
||||
i_this->mTimers[0] = 10;
|
||||
s16 wallAngle = wall_angle_get(i_this);
|
||||
if (a_this->speedF > 5.0f && wallAngle != 35) {
|
||||
i_this->field_0x720 += (s16)(0x8000 - ((s16)(i_this->field_0x720 - wallAngle) << 1));
|
||||
ANGLE_ADD(i_this->field_0x720, 0x8000 - ((s16)(i_this->field_0x720 - wallAngle) << 1));
|
||||
|
||||
i_this->field_0x722 *= -1;
|
||||
i_this->mTimers[0] = 10;
|
||||
a_this->speedF *= AREG_F(4) + 0.35f;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user