mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-04 11:19:58 -04:00
Compare commits
12 Commits
v1.2.0
...
rando/new-item
| Author | SHA1 | Date | |
|---|---|---|---|
| 957ab06fc2 | |||
| fe270d976d | |||
| 9e0966e069 | |||
| b51e672540 | |||
| c844eb2b4a | |||
| 416bfaa90b | |||
| 365a0a2188 | |||
| 4ff41fce4e | |||
| a470b73b1b | |||
| 120864a5c9 | |||
| ba7fc14e87 | |||
| c42d10a74b |
@@ -1733,6 +1733,9 @@ public:
|
||||
int checkNewItemChange(u8 i_selItemIdx);
|
||||
void deleteEquipItem(BOOL i_isPlaySound, BOOL i_isDeleteKantera);
|
||||
void setLight();
|
||||
#if TARGET_PC
|
||||
void setGhostLanternLight();
|
||||
#endif
|
||||
void setFrontRollCrashShock(u8);
|
||||
void changeWarpMaterial(daAlink_c::daAlink_WARP_MAT_MODE i_matMode);
|
||||
void commonProcInit(daAlink_c::daAlink_PROC i_procID);
|
||||
@@ -2656,8 +2659,14 @@ public:
|
||||
void checkWaterInKandelaar(f32);
|
||||
void offKandelaarModel();
|
||||
int kandelaarModelCallBack();
|
||||
int ghostLanternModelCallBack();
|
||||
BOOL checkKandelaarEquipAnime() const;
|
||||
void preKandelaarDraw();
|
||||
void preGhostLanternDraw();
|
||||
static void* srchPoe(void*, void*);
|
||||
#if TARGET_PC
|
||||
void setGhostLanternModel();
|
||||
#endif
|
||||
void setKandelaarModel();
|
||||
void resetOilBottleModel();
|
||||
void commonKandelaarPourInit();
|
||||
@@ -3977,6 +3986,9 @@ public:
|
||||
/* 0x006FC */ J3DModel* mpKanteraModel;
|
||||
/* 0x00700 */ J3DModel* mpKanteraGlowModel;
|
||||
/* 0x00704 */ J3DAnmTextureSRTKey* mpKanteraGlowBtk;
|
||||
/* 0x006FC */ J3DModel* mpGhostLanternModel;
|
||||
/* 0x00700 */ J3DModel* mpGhostLanternGlowModel;
|
||||
/* 0x00704 */ J3DAnmTextureSRTKey* mpGhostLanternGlowBtk;
|
||||
/* 0x00708 */ J3DModel* mHeldItemModel;
|
||||
/* 0x0070C */ J3DModel* mpHookTipModel; // related to held item
|
||||
/* 0x00710 */ J3DModel* field_0x0710; // related to held item
|
||||
@@ -4373,6 +4385,7 @@ public:
|
||||
/* 0x03194 */ int field_0x3194;
|
||||
/* 0x03198 */ int field_0x3198;
|
||||
/* 0x0319C */ int field_0x319c;
|
||||
/* 0x0319C */ s32 ghostLanternFlameEffect[2];
|
||||
/* 0x031A0 */ u32 mModeFlg;
|
||||
/* 0x031A4 */ int field_0x31a4;
|
||||
/* 0x031A8 */ u32 field_0x31a8[2];
|
||||
@@ -4442,6 +4455,9 @@ public:
|
||||
/* 0x033F4 */ f32 field_0x33f4;
|
||||
/* 0x033F8 */ f32 field_0x33f8;
|
||||
/* 0x033FC */ f32 field_0x33fc;
|
||||
#if TARGET_PC
|
||||
/* 0x033FC */ f32 current_ghost_lantern_light_power;
|
||||
#endif
|
||||
/* 0x03400 */ f32 field_0x3400;
|
||||
/* 0x03404 */ f32 field_0x3404;
|
||||
/* 0x03408 */ f32 field_0x3408;
|
||||
@@ -4509,9 +4525,13 @@ public:
|
||||
/* 0x035F4 */ cXyz mMidnaAtnPos;
|
||||
/* 0x03600 */ cXyz mMidnaHairAtnPos;
|
||||
/* 0x0360C */ cXyz mKandelaarFlamePos;
|
||||
/* 0x0360C */ cXyz mGhostLanternFlamePos;
|
||||
/* 0x03618 */ cXyz field_0x3618;
|
||||
/* 0x03624 */ cXyz field_0x3624;
|
||||
/* 0x03630 */ cXyz field_0x3630;
|
||||
/* 0x03618 */ cXyz ghost_lantern_0x3618;
|
||||
/* 0x03624 */ cXyz ghost_lantern_0x3624;
|
||||
/* 0x03630 */ cXyz ghost_lantern_0x3630;
|
||||
/* 0x0363C */ cXyz field_0x363c[4];
|
||||
/* 0x0366C */ cXyz field_0x366c[4];
|
||||
/* 0x0369C */ cXyz field_0x369c;
|
||||
@@ -6821,6 +6841,9 @@ public:
|
||||
static daAlinkHIO_boom_c0 const mBoomerang;
|
||||
static daAlinkHIO_bomb_c0 const mBomb;
|
||||
static daAlinkHIO_huLight_c0 const mLanternPL;
|
||||
#if TARGET_PC
|
||||
static daAlinkHIO_huLight_c0 const mGhostLanternPL;
|
||||
#endif
|
||||
static daAlinkHIO_kandelaar_c0 const mLantern;
|
||||
static daAlinkHIO_fmChain_c0 const mFmChain;
|
||||
static daAlinkHIO_magneBoots_c0 const mIronBoots;
|
||||
|
||||
@@ -71,6 +71,7 @@ void item_func_WOOD_STICK();
|
||||
void item_func_BOOMERANG();
|
||||
void item_func_SPINNER();
|
||||
void item_func_IRONBALL();
|
||||
void item_func_GHOST_LANTERN();
|
||||
void item_func_BOW();
|
||||
void item_func_HOOKSHOT();
|
||||
void item_func_HVY_BOOTS();
|
||||
@@ -260,6 +261,7 @@ int item_getcheck_func_WOOD_STICK();
|
||||
int item_getcheck_func_BOOMERANG();
|
||||
int item_getcheck_func_SPINNER();
|
||||
int item_getcheck_func_IRONBALL();
|
||||
int item_getcheck_func_GHOST_LANTERN();
|
||||
int item_getcheck_func_BOW();
|
||||
int item_getcheck_func_HOOKSHOT();
|
||||
int item_getcheck_func_HVY_BOOTS();
|
||||
|
||||
@@ -317,7 +317,7 @@ enum {
|
||||
/* 0xDE */ dItemNo_NOENTRY_222_e,
|
||||
/* 0xDF */ dItemNo_NOENTRY_223_e,
|
||||
/* 0xE0 */ dItemNo_POU_SPIRIT_e,
|
||||
/* 0xE1 */ dItemNo_NOENTRY_225_e,
|
||||
/* 0xE1 */ dItemNo_GHOST_LANTERN_e,
|
||||
/* 0xE2 */ dItemNo_NOENTRY_226_e,
|
||||
/* 0xE3 */ dItemNo_NOENTRY_227_e,
|
||||
/* 0xE4 */ dItemNo_NOENTRY_228_e,
|
||||
|
||||
@@ -86,8 +86,8 @@ public:
|
||||
/* 0x047 */ u8 field_0x47;
|
||||
/* 0x048 */ u8 mPoes;
|
||||
/* 0x049 */ u8 mPoesCopy;
|
||||
/* 0x04A */ u8 mItems[24];
|
||||
/* 0x062 */ u8 mItemsCopy[24];
|
||||
/* 0x04A */ u8 mItems[25];
|
||||
/* 0x062 */ u8 mItemsCopy[25];
|
||||
/* 0x07A */ u8 field_0x7a[24];
|
||||
/* 0x092 */ u8 mSwords[4];
|
||||
/* 0x096 */ u8 mShields[3];
|
||||
|
||||
+115
-4
@@ -6100,6 +6100,21 @@ void daAlink_c::setItemMatrix(int param_0) {
|
||||
modelCalc(mpKanteraGlowModel);
|
||||
}
|
||||
|
||||
if (mEquipItem == dItemNo_GHOST_LANTERN_e) {
|
||||
simpleAnmPlay(mpGhostLanternGlowBtk);
|
||||
|
||||
mDoMtx_stack_c::copy(mpLinkModel->getAnmMtx(mLeftItemJntNo));
|
||||
mDoMtx_stack_c::transM(-2.0f, -0.1f, -0.7f);
|
||||
mDoMtx_stack_c::XYZrotM(cM_deg2s(100.0f), cM_deg2s(9.3f), cM_deg2s(183.0f));
|
||||
mDoMtx_stack_c::scaleM(0.75f, 0.75f, 0.75f);
|
||||
mpGhostLanternModel->setBaseTRMtx(mDoMtx_stack_c::get());
|
||||
|
||||
modelCalc(mpGhostLanternModel);
|
||||
mDoMtx_stack_c::transS(mGhostLanternFlamePos);
|
||||
mpGhostLanternGlowModel->setBaseTRMtx(mDoMtx_stack_c::get());
|
||||
modelCalc(mpGhostLanternGlowModel);
|
||||
}
|
||||
|
||||
setSwordPos();
|
||||
simpleAnmPlay(m_mSwordBtk);
|
||||
simpleAnmPlay(m_mSwordBrk);
|
||||
@@ -6920,7 +6935,7 @@ const daAlink_BckData* daAlink_c::getMainBckData(daAlink_c::daAlink_ANM i_anmID)
|
||||
{dRes_ID_ALANM_BCK_WAITHS_e, dRes_ID_ALANM_BCK_WAITHK_e},
|
||||
};
|
||||
|
||||
if (mEquipItem == dItemNo_KANTERA_e) {
|
||||
if (mEquipItem == dItemNo_KANTERA_e || mEquipItem == dItemNo_GHOST_LANTERN_e) {
|
||||
if (i_anmID == ANM_WAIT) {
|
||||
return &kandelaarAnm[0];
|
||||
}
|
||||
@@ -12067,7 +12082,8 @@ void daAlink_c::itemUnequip(u16 i_itemID, f32 i_playSpeed) {
|
||||
u16 anm_id;
|
||||
const daAlinkHIO_anm_c* anm_data;
|
||||
|
||||
if (i_itemID == dItemNo_BOOMERANG_e || i_itemID == dItemNo_COPY_ROD_e || i_itemID == dItemNo_KANTERA_e ||
|
||||
if (i_itemID == dItemNo_BOOMERANG_e || i_itemID == dItemNo_COPY_ROD_e ||
|
||||
i_itemID == dItemNo_KANTERA_e || i_itemID == dItemNo_GHOST_LANTERN_e ||
|
||||
i_itemID == dItemNo_HOOKSHOT_e || checkBottleItem(i_itemID))
|
||||
{
|
||||
anm_id = dRes_ID_ALANM_BCK_TAKEL_e;
|
||||
@@ -14157,6 +14173,11 @@ BOOL daAlink_c::setItemModel() {
|
||||
}
|
||||
}
|
||||
|
||||
if (mEquipItem == dItemNo_GHOST_LANTERN_e) {
|
||||
setGhostLanternModel();
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (mEquipItem == dItemNo_KANTERA_e) {
|
||||
setKandelaarModel();
|
||||
return 1;
|
||||
@@ -14498,6 +14519,7 @@ enum daAlink_ItemProc {
|
||||
/* 13 */ ITEM_PROC_BOTTLE_SWING,
|
||||
/* 14 */ ITEM_PROC_NOT_USE_ITEM,
|
||||
/* 15 */ ITEM_PROC_GRASS_WHISTLE,
|
||||
/* 16 */ ITEM_PROC_GHOST_LANTERN,
|
||||
};
|
||||
|
||||
int daAlink_c::changeItemTriggerKeepProc(u8 i_selItemIdx, int i_procType) {
|
||||
@@ -14522,7 +14544,8 @@ int daAlink_c::changeItemTriggerKeepProc(u8 i_selItemIdx, int i_procType) {
|
||||
} else {
|
||||
procKandelaarPourInit();
|
||||
}
|
||||
} else if (i_procType == ITEM_PROC_FISHING_FOOD) {
|
||||
}
|
||||
else if (i_procType == ITEM_PROC_FISHING_FOOD) {
|
||||
procFishingFoodInit();
|
||||
} else if (i_procType == ITEM_PROC_BOOTS_EQUIP) {
|
||||
procBootsEquipInit();
|
||||
@@ -14827,6 +14850,43 @@ void daAlink_c::deleteEquipItem(BOOL i_isPlaySound, BOOL i_isDeleteKantera) {
|
||||
}
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
void daAlink_c::setGhostLanternLight() {
|
||||
const daAlinkHIO_huLight_c1* light_m = &mpHIO->mItem.mGhostLanternPL.m;
|
||||
|
||||
BOOL var_r28 = false;
|
||||
|
||||
f32 lightPower = 0.0f;
|
||||
daE_HP_c* foundPoe = (daE_HP_c*)fopAcM_Search(srchPoe, this);
|
||||
if (mEquipItem == dItemNo_GHOST_LANTERN_e && foundPoe != NULL) {
|
||||
lightPower = 1.0f;
|
||||
}
|
||||
|
||||
cLib_chaseF(¤t_ghost_lantern_light_power, lightPower, 0.25f);
|
||||
|
||||
cXyz spB8;
|
||||
f32 var_f27;
|
||||
if (current_ghost_lantern_light_power > 0.0f) {
|
||||
GXColor sp30 = {(u8)light_m->mColorR, (u8)light_m->mColorG, (u8)light_m->mColorB, 0xFF};
|
||||
sp30.r = 120;
|
||||
sp30.g = 150;
|
||||
sp30.b = 150;
|
||||
|
||||
Vec sp5C = {0.0f, light_m->mYOffset, light_m->mZOffset};
|
||||
|
||||
f32 var_f26;
|
||||
spB8 = mGhostLanternFlamePos;
|
||||
var_f27 = 0.0f;
|
||||
var_f26 = cM_sht2d(-shape_angle.y);
|
||||
|
||||
dKy_WolfEyeLight_set(&spB8, var_f27 + light_m->mXAngle, var_f26,
|
||||
(light_m->mWidth * current_ghost_lantern_light_power) / light_m->mPower, &sp30, current_ghost_lantern_light_power,
|
||||
light_m->mAngleAttenuationType,
|
||||
light_m->mDistanceAttenuationType);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void daAlink_c::setLight() {
|
||||
const daAlinkHIO_huLight_c1* light_m = &mpHIO->mItem.mLanternPL.m;
|
||||
BOOL var_r28 = false;
|
||||
@@ -18265,7 +18325,8 @@ int daAlink_c::execute() {
|
||||
resetUpperAnime(UPPER_2, 5.0f);
|
||||
}
|
||||
|
||||
if (mEquipItem == dItemNo_KANTERA_e && checkNoUpperAnime() && !checkKandelaarEquipAnime() &&
|
||||
if ((mEquipItem == dItemNo_KANTERA_e || mEquipItem == dItemNo_GHOST_LANTERN_e) &&
|
||||
checkNoUpperAnime() && !checkKandelaarEquipAnime() &&
|
||||
(checkModeFlg(MODE_UNK_1000) || mProcID == PROC_CROUCH))
|
||||
{
|
||||
if (checkReinRide()) {
|
||||
@@ -18616,8 +18677,29 @@ int daAlink_c::execute() {
|
||||
setCollision();
|
||||
setAttentionPos();
|
||||
setLight();
|
||||
#if TARGET_PC
|
||||
setGhostLanternLight();
|
||||
#endif
|
||||
setEffect();
|
||||
|
||||
if (mEquipItem == dItemNo_GHOST_LANTERN_e) {
|
||||
cXyz effscale(0.75f, 0.75f, 0.75f);
|
||||
|
||||
static u16 particleNmaeDt[2] = {
|
||||
0x8789,
|
||||
0x878A,
|
||||
};
|
||||
|
||||
for (s32 i = 0; i < 2; i++) {
|
||||
ghostLanternFlameEffect[i] = dComIfGp_particle_set(ghostLanternFlameEffect[i], particleNmaeDt[i],
|
||||
&mGhostLanternFlamePos, 0, &effscale);
|
||||
}
|
||||
} else {
|
||||
for (s32 i = 0; i < 2; i++) {
|
||||
stopDrawParticle(ghostLanternFlameEffect[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (mClothesChangeWaitTimer != 0) {
|
||||
mDoMtx_stack_c::copy(mpLinkModel->getBaseTRMtx());
|
||||
|
||||
@@ -19319,6 +19401,10 @@ void daAlink_c::shadowDraw() {
|
||||
dComIfGd_addRealShadow(shadowID, mpKanteraModel);
|
||||
}
|
||||
|
||||
if (mEquipItem == dItemNo_GHOST_LANTERN_e) {
|
||||
dComIfGd_addRealShadow(shadowID, mpGhostLanternModel);
|
||||
}
|
||||
|
||||
if (checkEquipHeavyBoots()) {
|
||||
for (int i = 0; i < 2; i++) {
|
||||
dComIfGd_addRealShadow(shadowID, mpLinkBootModels[i]);
|
||||
@@ -19479,6 +19565,22 @@ int daAlink_c::draw() {
|
||||
}
|
||||
}
|
||||
|
||||
if (mEquipItem == dItemNo_GHOST_LANTERN_e) {
|
||||
daE_HP_c* foundPoe = (daE_HP_c*)fopAcM_Search(srchPoe, this);
|
||||
|
||||
for (s32 i = 0; i < 2; i++) {
|
||||
JPABaseEmitter* emitter_gl = dComIfGp_particle_getEmitter(ghostLanternFlameEffect[i]);
|
||||
if (emitter_gl != NULL) {
|
||||
emitter_gl->setLocalTranslation({2.5f, -15.0f, 0.0f});
|
||||
if (checkPlayerNoDraw() || foundPoe == NULL) {
|
||||
emitter_gl->stopDrawParticle();
|
||||
} else {
|
||||
emitter_gl->playDrawParticle();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (mClothesChangeWaitTimer != 0) {
|
||||
if (mProcID == PROC_METAMORPHOSE) {
|
||||
if (mProcVar3.field_0x300e > 0) {
|
||||
@@ -19804,6 +19906,15 @@ int daAlink_c::draw() {
|
||||
basicModelDraw(mpKanteraGlowModel);
|
||||
}
|
||||
|
||||
if (mEquipItem == dItemNo_GHOST_LANTERN_e) {
|
||||
daE_HP_c* foundPoe = (daE_HP_c*)fopAcM_Search(srchPoe, this);
|
||||
modelDraw(mpGhostLanternModel, isPlayerNoDraw);
|
||||
if (foundPoe != NULL) {
|
||||
preGhostLanternDraw();
|
||||
modelDraw(mpGhostLanternGlowModel, isPlayerNoDraw);
|
||||
}
|
||||
}
|
||||
|
||||
if (checkEquipHeavyBoots()) {
|
||||
GXColorS10 color = tevStr.TevColor;
|
||||
for (int i = 0; i < 2; i++) {
|
||||
|
||||
@@ -2184,7 +2184,7 @@ void daAlink_c::setGetSubBgm(int i_itemNo) {
|
||||
/* dItemNo_NOENTRY_222_e */ SETYPE_NONE,
|
||||
/* dItemNo_NOENTRY_223_e */ SETYPE_NONE,
|
||||
/* dItemNo_POU_SPIRIT_e */ SETYPE_ITEM_GET_POU,
|
||||
/* dItemNo_NOENTRY_225_e */ SETYPE_NONE,
|
||||
/* dItemNo_GHOST_LANTERN_e */ SETYPE_ITEM_GET,
|
||||
/* dItemNo_NOENTRY_226_e */ SETYPE_NONE,
|
||||
/* dItemNo_NOENTRY_227_e */ SETYPE_NONE,
|
||||
/* dItemNo_NOENTRY_228_e */ SETYPE_NONE,
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "d/actor/d_a_tag_ss_drink.h"
|
||||
#include "m_Do/m_Do_lib.h"
|
||||
#include "SSystem/SComponent/c_math.h"
|
||||
#include "d/actor/d_a_e_hp.h"
|
||||
|
||||
static fopAc_ac_c* daAlink_searchTagKandelaar(fopAc_ac_c* i_actor, void* i_data) {
|
||||
UNUSED(i_data);
|
||||
@@ -138,6 +139,50 @@ int daAlink_c::kandelaarModelCallBack() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
int daAlink_c::ghostLanternModelCallBack() {
|
||||
cXyz sp44;
|
||||
mDoMtx_multVecZero(J3DSys::mCurrentMtx, &sp44);
|
||||
|
||||
ghost_lantern_0x3630 = ghost_lantern_0x3624;
|
||||
ghost_lantern_0x3624 = mGhostLanternFlamePos;
|
||||
|
||||
cXyz sp38 = (mGhostLanternFlamePos - sp44) + ghost_lantern_0x3618;
|
||||
sp38.y -= 3.0f;
|
||||
|
||||
cXyz sp2C;
|
||||
mDoMtx_multVec(J3DSys::mCurrentMtx, &cXyz::BaseZ, &sp2C);
|
||||
|
||||
s16 var_r29 = sp2C.atan2sX_Z();
|
||||
mDoMtx_stack_c::YrotS(-var_r29);
|
||||
mDoMtx_stack_c::multVec(&sp38, &sp38);
|
||||
|
||||
s16 var_r28 = cLib_minMaxLimit<s16>(cM_atan2s(-sp38.z, -sp38.y), -0x1800, 0x1800);
|
||||
s16 var_r27 = cLib_minMaxLimit<s16>(cM_atan2s(sp38.x, JMAFastSqrt(SQUARE(sp38.y) + SQUARE(sp38.z))), -0x1800, 0x1800);
|
||||
|
||||
mDoMtx_stack_c::transS(sp44);
|
||||
if (mProcID != PROC_OPEN_TREASURE && (mProcID != PROC_GET_ITEM || mProcVar4.field_0x3010 == 0)) {
|
||||
mDoMtx_stack_c::ZXYrotM(var_r28, var_r29, var_r27);
|
||||
}
|
||||
|
||||
static Vec const ghostLanternOffset = {0.0f, -20.0f, 0.0f};
|
||||
mDoMtx_stack_c::multVec(&ghostLanternOffset, &mGhostLanternFlamePos);
|
||||
|
||||
ghost_lantern_0x3618 = (mGhostLanternFlamePos - ghost_lantern_0x3624) * 0.9f;
|
||||
|
||||
if (!checkEndResetFlg1(ERFLG1_UNK_8) && mpGhostLanternModel != nullptr) {
|
||||
f32 scale = JMAFastSqrt(SQUARE(J3DSys::mCurrentMtx[0][0]) + SQUARE(J3DSys::mCurrentMtx[1][0]) + SQUARE(J3DSys::mCurrentMtx[2][0]));
|
||||
mDoMtx_stack_c::transS(J3DSys::mCurrentMtx[0][3], J3DSys::mCurrentMtx[1][3], J3DSys::mCurrentMtx[2][3]);
|
||||
mDoMtx_stack_c::ZXYrotM(var_r28, var_r29, var_r27);
|
||||
mDoMtx_stack_c::ZXYrotM(0, 0, -16384);
|
||||
mDoMtx_stack_c::scaleM(scale, scale, scale);
|
||||
|
||||
mpGhostLanternModel->setAnmMtx(1, mDoMtx_stack_c::get());
|
||||
cMtx_copy(mDoMtx_stack_c::get(), J3DSys::mCurrentMtx);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int daAlink_kandelaarModelCallBack(J3DJoint* i_joint, int param_1) {
|
||||
UNUSED(i_joint);
|
||||
|
||||
@@ -150,6 +195,18 @@ static int daAlink_kandelaarModelCallBack(J3DJoint* i_joint, int param_1) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int daAlink_ghostLanternModelCallBack(J3DJoint* i_joint, int param_1) {
|
||||
UNUSED(i_joint);
|
||||
|
||||
daAlink_c* player_p = (daAlink_c*)j3dSys.getModel()->getUserArea();
|
||||
|
||||
if (param_1 == 0) {
|
||||
player_p->ghostLanternModelCallBack();
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
cXyz* daAlink_c::getKandelaarFlamePos() {
|
||||
if ((!checkNoResetFlg2(daPy_FLG2(FLG2_UNK_20000 | FLG2_UNK_1)) && !checkEndResetFlg1(ERFLG1_UNK_4)) ||
|
||||
checkWolf() || !checkNoResetFlg1(FLG1_UNK_80))
|
||||
@@ -164,6 +221,60 @@ BOOL daAlink_c::checkKandelaarEquipAnime() const {
|
||||
return checkUpperAnime(dRes_ID_ALANM_BCK_WAITHK_e) || checkUpperAnime(dRes_ID_ALANM_BCK_WAITK_e);
|
||||
}
|
||||
|
||||
void* daAlink_c::srchPoe(void* i_actor, void* i_this) {
|
||||
if (i_actor != NULL && i_actor != i_this) {
|
||||
if (fopAcM_IsExecuting(fopAcM_GetID(i_actor)) && fopAcM_GetName(i_actor) == fpcNm_E_HP_e) {
|
||||
return i_actor;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void daAlink_c::preGhostLanternDraw() {
|
||||
J3DMaterial* mat_p = mpGhostLanternGlowModel->getModelData()->getMaterialNodePointer(0);
|
||||
|
||||
J3DGXColorS10 color;
|
||||
color.r = 120;
|
||||
color.g = 150;
|
||||
color.b = 150;
|
||||
color.a = 255;
|
||||
mat_p->setTevColor(1, &color);
|
||||
|
||||
color.r = 0;
|
||||
color.g = 60;
|
||||
color.b = 101;
|
||||
mat_p->setTevColor(2, &color);
|
||||
|
||||
cXyz proj;
|
||||
mDoLib_project(&mGhostLanternFlamePos, &proj);
|
||||
|
||||
camera_process_class* camera_p = dComIfGp_getCamera(0);
|
||||
f32 trimHeight;
|
||||
if (camera_p != NULL) {
|
||||
trimHeight = camera_p->mCamera.TrimHeight();
|
||||
} else {
|
||||
trimHeight = 0.0f;
|
||||
}
|
||||
|
||||
if (proj.x > 0.0f && proj.x < FB_WIDTH && proj.y > trimHeight && proj.y < FB_HEIGHT - trimHeight) {
|
||||
dComIfGd_peekZ(proj.x, proj.y, &field_0x32c8);
|
||||
} else {
|
||||
field_0x32c8 = 0;
|
||||
}
|
||||
|
||||
f32 near_ = dComIfGd_getView()->near_;
|
||||
f32 far_ = dComIfGd_getView()->far_;
|
||||
|
||||
mDoLib_pos2camera(&mGhostLanternFlamePos, &proj);
|
||||
|
||||
proj.z += 30.0f;
|
||||
if (proj.z > -0.01f) {
|
||||
proj.z = -0.01f;
|
||||
}
|
||||
|
||||
field_0x344c = ((near_ + (far_ * near_) / proj.z) / (far_ - near_) + 1.0f) * 1.6777215E7f;
|
||||
}
|
||||
|
||||
void daAlink_c::preKandelaarDraw() {
|
||||
J3DMaterial* mat_p = mpKanteraGlowModel->getModelData()->getMaterialNodePointer(0);
|
||||
|
||||
@@ -208,6 +319,16 @@ void daAlink_c::preKandelaarDraw() {
|
||||
field_0x344c = ((near_ + (far_ * near_) / proj.z) / (far_ - near_) + 1.0f) * 1.6777215E7f;
|
||||
}
|
||||
|
||||
void daAlink_c::setGhostLanternModel() {
|
||||
field_0x2f94 = 0;
|
||||
|
||||
mDoMtx_multVecZero(mpLinkModel->getAnmMtx(mLeftItemJntNo), &mGhostLanternFlamePos);
|
||||
|
||||
ghost_lantern_0x3630 = ghost_lantern_0x3624;
|
||||
ghost_lantern_0x3624 = mGhostLanternFlamePos;
|
||||
ghost_lantern_0x3618 = cXyz::Zero;
|
||||
}
|
||||
|
||||
void daAlink_c::setKandelaarModel() {
|
||||
field_0x2f94 = 0;
|
||||
|
||||
|
||||
@@ -300,6 +300,7 @@ void daAlink_c::changeWolf() {
|
||||
mAtSph.SetR(40.0f);
|
||||
|
||||
mpKanteraModel = NULL;
|
||||
mpGhostLanternModel = NULL;
|
||||
mpLinkHatModel = NULL;
|
||||
mpLinkFaceModel = NULL;
|
||||
mpLinkHandModel = NULL;
|
||||
@@ -406,12 +407,20 @@ void daAlink_c::changeLink(int param_0) {
|
||||
|
||||
modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes(mArcName, "ef_ktGlow.bmd"));
|
||||
mpKanteraGlowModel = initModel(modelData, 0x200);
|
||||
|
||||
mpKanteraGlowBtk = static_cast<J3DAnmTextureSRTKey*>(dComIfG_getObjectRes(mArcName, "ef_ktGlow.btk"));
|
||||
mpKanteraGlowBtk->setFrame(0.0f);
|
||||
mpKanteraGlowBtk->searchUpdateMaterialID(modelData);
|
||||
modelData->entryTexMtxAnimator(mpKanteraGlowBtk);
|
||||
|
||||
mpGhostLanternModel = initModelEnv(static_cast<J3DModelData*>(dComIfG_getObjectRes("E_HP", "hp_ori.bmd")), 0);
|
||||
|
||||
modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes(mArcName, "ef_ktGlow.bmd"));
|
||||
mpGhostLanternGlowModel = initModel(modelData, 0x200);
|
||||
mpGhostLanternGlowBtk = static_cast<J3DAnmTextureSRTKey*>(dComIfG_getObjectRes(mArcName, "ef_ktGlow.btk"));
|
||||
mpGhostLanternGlowBtk->setFrame(0.0f);
|
||||
mpGhostLanternGlowBtk->searchUpdateMaterialID(modelData);
|
||||
modelData->entryTexMtxAnimator(mpGhostLanternGlowBtk);
|
||||
|
||||
mWoodSwordModel = initModel(static_cast<J3DModelData*>(dComIfG_getObjectRes(mArcName, "al_SWB.bmd")), 0);
|
||||
|
||||
mDoExt_setCurrentHeap(current_heap);
|
||||
@@ -504,6 +513,10 @@ void daAlink_c::changeLink(int param_0) {
|
||||
|
||||
mpKanteraModel->setUserArea((uintptr_t)this);
|
||||
mpKanteraModel->getModelData()->getJointNodePointer(1)->setCallBack(daAlink_kandelaarModelCallBack);
|
||||
|
||||
mpGhostLanternModel->setUserArea((uintptr_t)this);
|
||||
mpGhostLanternModel->getModelData()->getJointNodePointer(1)->setCallBack(daAlink_ghostLanternModelCallBack);
|
||||
|
||||
mZ2Link.setLinkState(var_r27);
|
||||
|
||||
#if VERSION != VERSION_SHIELD_DEBUG
|
||||
|
||||
+10
-2
@@ -236,7 +236,7 @@ static void (*item_func_ptr[256])() = {
|
||||
item_func_noentry,
|
||||
item_func_noentry,
|
||||
item_func_POU_SPIRIT,
|
||||
item_func_noentry,
|
||||
item_func_GHOST_LANTERN,
|
||||
item_func_noentry,
|
||||
item_func_noentry,
|
||||
item_func_noentry,
|
||||
@@ -504,7 +504,7 @@ static int (*item_getcheck_func_ptr[256])() = {
|
||||
item_getcheck_func_noentry,
|
||||
item_getcheck_func_noentry,
|
||||
item_getcheck_func_POU_SPIRIT,
|
||||
item_getcheck_func_noentry,
|
||||
item_getcheck_func_GHOST_LANTERN,
|
||||
item_getcheck_func_noentry,
|
||||
item_getcheck_func_noentry,
|
||||
item_getcheck_func_noentry,
|
||||
@@ -791,6 +791,10 @@ void item_func_IRONBALL() {
|
||||
dComIfGs_setItem(SLOT_6, dItemNo_IRONBALL_e);
|
||||
}
|
||||
|
||||
void item_func_GHOST_LANTERN() {
|
||||
dComIfGs_setItem(SLOT_7, dItemNo_GHOST_LANTERN_e);
|
||||
}
|
||||
|
||||
void item_func_BOW() {
|
||||
dComIfGs_setItem(SLOT_4, dItemNo_BOW_e);
|
||||
dComIfGs_setArrowNum(30);
|
||||
@@ -1453,6 +1457,10 @@ int item_getcheck_func_IRONBALL() {
|
||||
return dComIfGs_getItem(SLOT_6, true) == dItemNo_IRONBALL_e ? TRUE : FALSE;
|
||||
}
|
||||
|
||||
int item_getcheck_func_GHOST_LANTERN() {
|
||||
return dComIfGs_getItem(SLOT_7, true) == dItemNo_GHOST_LANTERN_e ? TRUE : FALSE;
|
||||
}
|
||||
|
||||
int item_getcheck_func_BOW() {
|
||||
return dComIfGs_getItem(SLOT_4, false) == dItemNo_BOW_e ? TRUE : FALSE;
|
||||
}
|
||||
|
||||
@@ -1481,6 +1481,9 @@ void dScnLogo_c::dvdDataLoad() {
|
||||
OS_REPORT("\x1b[32m%d archiveHeap->getTotalFreeSize %08x\n\x1b[m", 2421, archiveHeap->getTotalFreeSize());
|
||||
archiveHeap->dump_sort();
|
||||
|
||||
rt = dComIfG_setObjectRes("E_HP", (u8)0, NULL);
|
||||
JUT_ASSERT(2425, rt == 1);
|
||||
|
||||
rt = dComIfG_setObjectRes("Alink", (u8)0, NULL);
|
||||
JUT_ASSERT(2429, rt == 1);
|
||||
|
||||
|
||||
+5
-5
@@ -432,11 +432,11 @@ u8 dSv_player_item_c::getItem(int i_slotNo, bool i_checkCombo) const {
|
||||
}
|
||||
|
||||
void dSv_player_item_c::setLineUpItem() {
|
||||
static u8 i_item_lst[23] = {
|
||||
static u8 i_item_lst[24] = {
|
||||
10, 8, 6, 2, 9, 4, 3,
|
||||
0, 1, 23, 20, 5, 15, 16,
|
||||
17, 11, 12, 13, 14, 19, 18,
|
||||
22, 21
|
||||
0, 1, 7, 23, 20, 5, 15,
|
||||
16, 17, 11, 12, 13, 14, 19,
|
||||
18, 22, 21
|
||||
};
|
||||
|
||||
int slot_idx = 0;
|
||||
@@ -445,7 +445,7 @@ void dSv_player_item_c::setLineUpItem() {
|
||||
mItemSlots[i] = dItemNo_NONE_e;
|
||||
}
|
||||
|
||||
for (int i = 0; i < 23; i++) {
|
||||
for (int i = 0; i < 24; i++) {
|
||||
u8 current = i_item_lst[i];
|
||||
if (mItems[current] != dItemNo_NONE_e) {
|
||||
mItemSlots[slot_idx] = current;
|
||||
|
||||
@@ -251,7 +251,7 @@ namespace dusk {
|
||||
{ dItemNo_NOENTRY_222_e, {"Reserved"} },
|
||||
{ dItemNo_NOENTRY_223_e, {"Reserved"} },
|
||||
{ dItemNo_POU_SPIRIT_e, {"Poe Soul"} },
|
||||
{ dItemNo_NOENTRY_225_e, {"Reserved"} },
|
||||
{ dItemNo_GHOST_LANTERN_e, {"Ghost Lantern", ITEMTYPE_EQUIP_e} },
|
||||
{ dItemNo_NOENTRY_226_e, {"Reserved"} },
|
||||
{ dItemNo_NOENTRY_227_e, {"Reserved"} },
|
||||
{ dItemNo_NOENTRY_228_e, {"Reserved"} },
|
||||
@@ -393,6 +393,7 @@ namespace dusk {
|
||||
{ SLOT_4, dItemNo_BOW_e },
|
||||
{ SLOT_5, dItemNo_HAWK_EYE_e },
|
||||
{ SLOT_6, dItemNo_IRONBALL_e },
|
||||
{ SLOT_7, dItemNo_GHOST_LANTERN_e},
|
||||
{ SLOT_8, dItemNo_COPY_ROD_e },
|
||||
{ SLOT_9, dItemNo_HOOKSHOT_e },
|
||||
{ SLOT_10, dItemNo_W_HOOKSHOT_e },
|
||||
|
||||
@@ -450,7 +450,7 @@ std::map<int, itemInfo> itemMap = {
|
||||
{dItemNo_NOENTRY_222_e, {"Reserved"}},
|
||||
{dItemNo_NOENTRY_223_e, {"Reserved"}},
|
||||
{dItemNo_POU_SPIRIT_e, {"Poe Soul"}},
|
||||
{dItemNo_NOENTRY_225_e, {"Reserved"}},
|
||||
{dItemNo_GHOST_LANTERN_e, {"Reserved"}},
|
||||
{dItemNo_NOENTRY_226_e, {"Reserved"}},
|
||||
{dItemNo_NOENTRY_227_e, {"Reserved"}},
|
||||
{dItemNo_NOENTRY_228_e, {"Reserved"}},
|
||||
|
||||
@@ -29,6 +29,8 @@
|
||||
#include "tracy/Tracy.hpp"
|
||||
#include <dusk/gamepad_color.h>
|
||||
#include <dusk/autosave.h>
|
||||
#include <d/actor/d_a_npc.h>
|
||||
#include <d/d_item.h>
|
||||
#endif
|
||||
|
||||
fapGm_HIO_c::fapGm_HIO_c() {
|
||||
@@ -741,11 +743,21 @@ static void fapGm_AfterRecord() {
|
||||
}
|
||||
|
||||
BOOL isRecording = false;
|
||||
BOOL gotGhostLantern = false;
|
||||
|
||||
static void duskExecute() {
|
||||
handleGamepadColor();
|
||||
updateAutoSave();
|
||||
|
||||
if (daNpcT_chkEvtBit(0x2B6) && !gotGhostLantern) {
|
||||
execItemGet(dItemNo_GHOST_LANTERN_e);
|
||||
gotGhostLantern = true;
|
||||
} else if (!daNpcT_chkEvtBit(0x2B6) && gotGhostLantern) {
|
||||
dComIfGs_offItemFirstBit(dItemNo_GHOST_LANTERN_e);
|
||||
dComIfGp_setItem(SLOT_7, dItemNo_NONE_e);
|
||||
gotGhostLantern = false;
|
||||
}
|
||||
|
||||
if (dusk::getSettings().game.recordingMode) {
|
||||
Z2GetSoundMgr()->getSeqMgr()->getParams()->moveVolume(0.0f, 0);
|
||||
Z2GetSoundMgr()->getStreamMgr()->getParams()->moveVolume(0.0f, 0);
|
||||
|
||||
Reference in New Issue
Block a user