mirror of
https://github.com/zeldaret/tww.git
synced 2026-09-10 03:52:05 -04:00
Some npc/ship inline fixes from debug map
This commit is contained in:
+36
-40
@@ -22,6 +22,7 @@
|
||||
#include "d/actor/d_a_bomb.h"
|
||||
#include "d/actor/d_a_grid.h"
|
||||
#include "res/Object/Ship.h"
|
||||
#include "cstdint.h"
|
||||
|
||||
static char l_arcName[] = "Ship";
|
||||
static Vec l_cannon_top = {85.0f, 0.0f, 10.0f};
|
||||
@@ -278,7 +279,7 @@ BOOL daShip_c::draw() {
|
||||
mDoMtx_stack_c::concat(MStack_50);
|
||||
mDoMtx_stack_c::revConcat(m02A8);
|
||||
m02A0->setEffectMtx(mDoMtx_stack_c::get());
|
||||
m02A4->setTranslationX(m03D4);
|
||||
m02A4->mTexMtxInfo.mSRT.mTranslationX = m03D4;
|
||||
}
|
||||
|
||||
if (
|
||||
@@ -2153,10 +2154,10 @@ BOOL daShip_c::procZevDemo() {
|
||||
}
|
||||
|
||||
if (dComIfGp_evmng_getMyIntegerP(mEvtStaffId, "tact")) {
|
||||
daPy_getPlayerLinkActorClass()->onNoResetFlg1(daPy_py_c::daPyFlg1_SHIP_TACT);
|
||||
daPy_getPlayerLinkActorClass()->onShipTact();
|
||||
}
|
||||
else {
|
||||
daPy_getPlayerLinkActorClass()->offNoResetFlg1(daPy_py_c::daPyFlg1_SHIP_TACT);
|
||||
daPy_getPlayerLinkActorClass()->offShipTact();
|
||||
}
|
||||
|
||||
if (m0351 == DEMO_INIT_e || m0351 == DEMO_OPEN_e) {
|
||||
@@ -2640,11 +2641,11 @@ BOOL daShip_c::procTornadoUp_init() {
|
||||
|
||||
/* 00006DE0-00006FDC .text procTornadoUp__8daShip_cFv */
|
||||
BOOL daShip_c::procTornadoUp() {
|
||||
daTornado_c* tornadoActor = mTornadoActor;
|
||||
daTornado_c* tornado = mTornadoActor;
|
||||
|
||||
cLib_addCalc(¤t.pos.x, tornadoActor->getJointXPos(m037A), 0.5f, 80.0f, 20.0f);
|
||||
cLib_addCalc(¤t.pos.x, tornado->getJointXPos(m037A), 0.5f, 80.0f, 20.0f);
|
||||
|
||||
cLib_addCalc(¤t.pos.z, tornadoActor->getJointZPos(m037A), 0.5f, 80.0f, 20.0f);
|
||||
cLib_addCalc(¤t.pos.z, tornado->getJointZPos(m037A), 0.5f, 80.0f, 20.0f);
|
||||
|
||||
current.pos.y += speed.y;
|
||||
speed.y += 2.0f;
|
||||
@@ -2653,17 +2654,17 @@ BOOL daShip_c::procTornadoUp() {
|
||||
speed.y = 50.0f;
|
||||
}
|
||||
|
||||
if (tornadoActor->getJointYPos(m037A) < current.pos.y && m037A < 11) {
|
||||
if (tornado->getJointYPos(m037A) < current.pos.y && m037A < 11) {
|
||||
m037A++;
|
||||
}
|
||||
|
||||
shape_angle.y += 0x1C25;
|
||||
|
||||
camera_class* camera = dComIfGp_getCamera(dComIfGp_getPlayerCameraID(0));
|
||||
cXyz local_3c(tornadoActor->current.pos.x, current.pos.y, tornadoActor->current.pos.z);
|
||||
cXyz local_3c(tornado->current.pos.x, current.pos.y, tornado->current.pos.z);
|
||||
camera->mCamera.Set(local_3c, camera->mCamera.Eye());
|
||||
|
||||
if (m03A6 == 0 && current.pos.y > tornadoActor->current.pos.y + 5000.0f) {
|
||||
if (m03A6 == 0 && current.pos.y > tornado->current.pos.y + 5000.0f) {
|
||||
m03A6 = 1;
|
||||
int exitId = (s32)cM_rndF(8.0f) + 0xC6;
|
||||
if (exitId >= 0xCE) {
|
||||
@@ -2704,29 +2705,29 @@ BOOL daShip_c::procStartModeWarp() {
|
||||
GXColor amb;
|
||||
cXyz local_30;
|
||||
|
||||
daTornado_c* pfVar2 = (daTornado_c*)fopAcM_SearchByID(mTactWarpID);
|
||||
daTornado_c* tornado = (daTornado_c*)fopAcM_SearchByID(mTactWarpID);
|
||||
camera_class* camera = dComIfGp_getCamera(dComIfGp_getPlayerCameraID(0));
|
||||
shape_angle.y += m03A6;
|
||||
current.angle.y = shape_angle.y;
|
||||
if (pfVar2) {
|
||||
if (tornado) {
|
||||
#if VERSION > VERSION_DEMO
|
||||
if (!checkStateFlg(daSFLG_UNK8_e)) {
|
||||
onStateFlg(daSFLG_UNK8_e);
|
||||
pfVar2->current.pos.x = current.pos.x;
|
||||
pfVar2->current.pos.z = current.pos.z;
|
||||
tornado->current.pos.x = current.pos.x;
|
||||
tornado->current.pos.z = current.pos.z;
|
||||
}
|
||||
#endif
|
||||
iVar5 = 0;
|
||||
for (int i = 0; i < 11; iVar5++, i++) {
|
||||
if (current.pos.y < pfVar2->getJointYPos(i)) break;
|
||||
if (current.pos.y < tornado->getJointYPos(i)) break;
|
||||
}
|
||||
if (iVar5 == 11) {
|
||||
iVar5 = 10;
|
||||
}
|
||||
cLib_chaseF(¤t.pos.x, pfVar2->getJointXPos(iVar5), 50.0f);
|
||||
cLib_chaseF(¤t.pos.z, pfVar2->getJointZPos(iVar5), 50.0f);
|
||||
local_30.x = pfVar2->current.pos.x;
|
||||
local_30.z = pfVar2->current.pos.z;
|
||||
cLib_chaseF(¤t.pos.x, tornado->getJointXPos(iVar5), 50.0f);
|
||||
cLib_chaseF(¤t.pos.z, tornado->getJointZPos(iVar5), 50.0f);
|
||||
local_30.x = tornado->current.pos.x;
|
||||
local_30.z = tornado->current.pos.z;
|
||||
}
|
||||
else {
|
||||
local_30.x = current.pos.x;
|
||||
@@ -2740,8 +2741,8 @@ BOOL daShip_c::procStartModeWarp() {
|
||||
speed.y = 0.0f;
|
||||
offStateFlg(daSFLG_FLY_e);
|
||||
m037A = 1;
|
||||
if (pfVar2 != NULL) {
|
||||
pfVar2->m31c = 1;
|
||||
if (tornado != NULL) {
|
||||
tornado->setScaleOn();
|
||||
}
|
||||
dKy_get_seacolor(&diff, &amb);
|
||||
m03BC.x = 0;
|
||||
@@ -2750,13 +2751,13 @@ BOOL daShip_c::procStartModeWarp() {
|
||||
dComIfGp_particle_set(dPa_name::ID_AK_JN_SHIPWARPSPLASH00, ¤t.pos, &shape_angle, NULL, 0xFF, &m1984, -1, &diff);
|
||||
dComIfGp_particle_set(dPa_name::ID_AK_JN_SHIPWARPSPLASH00, ¤t.pos, &m03BC, NULL, 0xFF, &m1998, -1, &diff);
|
||||
}
|
||||
if (pfVar2 != NULL) {
|
||||
pfVar2->current.pos.y = current.pos.y - 700.0f;
|
||||
if (tornado != NULL) {
|
||||
tornado->current.pos.y = current.pos.y - 700.0f;
|
||||
}
|
||||
}
|
||||
else if (pfVar2 == NULL || pfVar2->mJointScale[10] < 0.8f) {
|
||||
if (pfVar2 != NULL) {
|
||||
pfVar2->current.pos.y -= 12.0f;
|
||||
else if (tornado == NULL || tornado->getSmallScaleEnd() < 0.8f) {
|
||||
if (tornado != NULL) {
|
||||
tornado->current.pos.y -= 12.0f;
|
||||
}
|
||||
m03BC.y = shape_angle.y + 0x8000;
|
||||
cLib_chaseS(&m03A6, 0, 0x40);
|
||||
@@ -2818,7 +2819,7 @@ BOOL daShip_c::procTactWarp() {
|
||||
res = FALSE;
|
||||
}
|
||||
else {
|
||||
if (cLib_chaseS(&m03A6, 0x1C25, 0x40) && (tornado->mJointScale[10] > 0.8f)) {
|
||||
if (cLib_chaseS(&m03A6, 0x1C25, 0x40) && (tornado->getScaleEnd() > 0.8f)) {
|
||||
speed.y += 1.0f;
|
||||
if (speed.y > 50.0f) {
|
||||
speed.y = 50.0f;
|
||||
@@ -2831,7 +2832,7 @@ BOOL daShip_c::procTactWarp() {
|
||||
else {
|
||||
if ((!m037A) && (m03A6 > 0x1000)) {
|
||||
m037A = 1;
|
||||
tornado->m31c = 1;
|
||||
tornado->setScaleOn();
|
||||
}
|
||||
}
|
||||
if (m037A == 1) {
|
||||
@@ -3423,10 +3424,10 @@ void daShip_c::setTornadoActor() {
|
||||
if (m0404 < 0.0f) {
|
||||
m0404 = 0.0f;
|
||||
}
|
||||
daTornado_c* pfVar2 = mTornadoActor;
|
||||
float dx = pfVar2->getJointXPos(0) - current.pos.x;
|
||||
float dz = pfVar2->getJointZPos(0) - current.pos.z;
|
||||
float distXZ = std::sqrtf(dx * dx + dz * dz);
|
||||
daTornado_c* tornado = mTornadoActor;
|
||||
f32 dx = tornado->getJointXPos(0) - current.pos.x;
|
||||
f32 dz = tornado->getJointZPos(0) - current.pos.z;
|
||||
f32 distXZ = std::sqrtf(dx * dx + dz * dz);
|
||||
if (!checkStateFlg(daSFLG_UNK1000_e) && distXZ < 3500.0f) {
|
||||
if(daPy_getPlayerLinkActorClass()->shipSpecialDemoStart()) {
|
||||
procTornadoUp_init();
|
||||
@@ -4594,8 +4595,7 @@ cPhs_State daShip_c::create() {
|
||||
for (u16 mno = 0; mno < pModelData->getMaterialNum(); mno++) {
|
||||
pMaterial = pModelData->getMaterialNodePointer(mno);
|
||||
for(u32 i = 0; i < 8; i++) {
|
||||
J3DTexGenBlock* pTexGenBlock = pMaterial->getTexGenBlock();
|
||||
J3DTexMtx* pTexMtx = pTexGenBlock->getTexMtx(i);
|
||||
J3DTexMtx* pTexMtx = pMaterial->getTexMtx(i);
|
||||
if (pTexMtx && pTexMtx->getTexMtxInfo().mInfo == 8) {
|
||||
m02A0 = pTexMtx;
|
||||
m02A4 = pTexMtx;
|
||||
@@ -4720,14 +4720,10 @@ cPhs_State daShip_c::create() {
|
||||
mSph.Set(sph_src);
|
||||
mSph.SetStts(&mStts);
|
||||
|
||||
cull.box.min.x = -325.0f;
|
||||
cull.box.min.y = -50.0f;
|
||||
cull.box.min.z = -325.0f;
|
||||
cull.box.max.x = 325.0f;
|
||||
cull.box.max.y = 570.0f;
|
||||
cull.box.max.z = 240.0f;
|
||||
fopAcM_SetMin(this, -325.0f, -50.0f, -325.0f);
|
||||
fopAcM_SetMax(this, 325.0f, 570.0f, 240.0f);
|
||||
|
||||
fopKyM_create(fpcNm_WIND_ARROW_e, (s32)this, 0, 0, 0);
|
||||
fopKyM_create(fpcNm_WIND_ARROW_e, (std::intptr_t)this, 0, 0, 0);
|
||||
|
||||
offStateFlg(daSFLG_UNK2_e);
|
||||
mAcch.CrrPos(*dComIfG_Bgsp());
|
||||
|
||||
Reference in New Issue
Block a user