mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-12-23 00:28:51 -05:00
Merge pull request #413 from Baoulettes/3DProjectiles
[Mod]Enable 3D Projectiles for monsters
This commit is contained in:
commit
77fc202694
@ -966,6 +966,8 @@ namespace SohImGui {
|
|||||||
}
|
}
|
||||||
EnhancementCheckbox("N64 Mode", "gN64Mode");
|
EnhancementCheckbox("N64 Mode", "gN64Mode");
|
||||||
Tooltip("Sets aspect ratio to 4:3 and lowers resolution to 240p, the N64's native resolution");
|
Tooltip("Sets aspect ratio to 4:3 and lowers resolution to 240p, the N64's native resolution");
|
||||||
|
EnhancementCheckbox("Enable 3D Dropped items/projectiles", "gNewDrops");
|
||||||
|
Tooltip("Change most 2D items & projectiles to their a 3D version");
|
||||||
EnhancementCheckbox("Disable Black Bar Letterboxes", "gDisableBlackBars");
|
EnhancementCheckbox("Disable Black Bar Letterboxes", "gDisableBlackBars");
|
||||||
Tooltip("Disables Black Bar Letterboxes during cutscenes and Z-targeting\nNote: there may be minor visual glitches that were covered up by the black bars\nPlease disable this setting before reporting a bug");
|
Tooltip("Disables Black Bar Letterboxes during cutscenes and Z-targeting\nNote: there may be minor visual glitches that were covered up by the black bars\nPlease disable this setting before reporting a bug");
|
||||||
EnhancementCheckbox("Enable 3D Dropped items", "gNewDrops");
|
EnhancementCheckbox("Enable 3D Dropped items", "gNewDrops");
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
#include "z_en_nutsball.h"
|
#include "z_en_nutsball.h"
|
||||||
#include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h"
|
#include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h"
|
||||||
|
#include "objects/object_gi_nuts/object_gi_nuts.h"
|
||||||
#include "objects/object_dekunuts/object_dekunuts.h"
|
#include "objects/object_dekunuts/object_dekunuts.h"
|
||||||
#include "objects/object_hintnuts/object_hintnuts.h"
|
#include "objects/object_hintnuts/object_hintnuts.h"
|
||||||
#include "objects/object_shopnuts/object_shopnuts.h"
|
#include "objects/object_shopnuts/object_shopnuts.h"
|
||||||
@ -59,6 +60,10 @@ static s16 sObjectIDs[] = {
|
|||||||
OBJECT_DEKUNUTS, OBJECT_HINTNUTS, OBJECT_SHOPNUTS, OBJECT_DNS, OBJECT_DNK,
|
OBJECT_DEKUNUTS, OBJECT_HINTNUTS, OBJECT_SHOPNUTS, OBJECT_DNS, OBJECT_DNK,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static Gfx* sDListsNew[] = {
|
||||||
|
gGiNutDL, gGiNutDL, gGiNutDL, gGiNutDL, gGiNutDL,
|
||||||
|
};
|
||||||
|
|
||||||
static Gfx* sDLists[] = {
|
static Gfx* sDLists[] = {
|
||||||
gDekuNutsDekuNutDL, gHintNutsNutDL, gBusinessScrubDekuNutDL, gDntJijiNutDL, gDntStageNutDL,
|
gDekuNutsDekuNutDL, gHintNutsNutDL, gBusinessScrubDekuNutDL, gDntJijiNutDL, gDntStageNutDL,
|
||||||
};
|
};
|
||||||
@ -167,12 +172,26 @@ void EnNutsball_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
|||||||
|
|
||||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_nutsball.c", 327);
|
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_nutsball.c", 327);
|
||||||
|
|
||||||
func_80093D18(globalCtx->state.gfxCtx);
|
if (CVar_GetS32("gNewDrops", 0) != 0) {
|
||||||
Matrix_Mult(&globalCtx->billboardMtxF, MTXMODE_APPLY);
|
func_80093D18(globalCtx->state.gfxCtx);
|
||||||
Matrix_RotateZ(thisx->home.rot.z * 9.58738e-05f, MTXMODE_APPLY);
|
gSPSegment(POLY_OPA_DISP++, 0x08,
|
||||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_nutsball.c", 333),
|
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 1 * (globalCtx->state.frames * 6),
|
||||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
1 * (globalCtx->state.frames * 6), 32, 32, 1, 1 * (globalCtx->state.frames * 6),
|
||||||
gSPDisplayList(POLY_OPA_DISP++, sDLists[thisx->params]);
|
1 * (globalCtx->state.frames * 6), 32, 32));
|
||||||
|
Matrix_Scale(25.0f,25.0f,25.0f,MTXMODE_APPLY);
|
||||||
|
Matrix_RotateX(thisx->home.rot.z * 9.58738e-05f, MTXMODE_APPLY);
|
||||||
|
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_nutsball.c", 901),
|
||||||
|
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||||
|
gSPDisplayList(POLY_OPA_DISP++, sDListsNew[thisx->params]);
|
||||||
|
} else {
|
||||||
|
func_80093D18(globalCtx->state.gfxCtx);
|
||||||
|
Matrix_Mult(&globalCtx->billboardMtxF, MTXMODE_APPLY);
|
||||||
|
|
||||||
|
Matrix_RotateZ(thisx->home.rot.z * 9.58738e-05f, MTXMODE_APPLY);
|
||||||
|
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_nutsball.c", 333),
|
||||||
|
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||||
|
gSPDisplayList(POLY_OPA_DISP++, sDLists[thisx->params]);
|
||||||
|
}
|
||||||
|
|
||||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_en_nutsball.c", 337);
|
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_en_nutsball.c", 337);
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#include "z_en_okuta.h"
|
#include "z_en_okuta.h"
|
||||||
#include "objects/object_okuta/object_okuta.h"
|
#include "objects/object_okuta/object_okuta.h"
|
||||||
|
#include "objects/gameplay_field_keep/gameplay_field_keep.h"
|
||||||
|
|
||||||
#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2)
|
#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2)
|
||||||
|
|
||||||
@ -499,7 +500,50 @@ void EnOkuta_ProjectileFly(EnOkuta* this, GlobalContext* globalCtx) {
|
|||||||
pos.x = this->actor.world.pos.x;
|
pos.x = this->actor.world.pos.x;
|
||||||
pos.y = this->actor.world.pos.y + 11.0f;
|
pos.y = this->actor.world.pos.y + 11.0f;
|
||||||
pos.z = this->actor.world.pos.z;
|
pos.z = this->actor.world.pos.z;
|
||||||
EffectSsHahen_SpawnBurst(globalCtx, &pos, 6.0f, 0, 1, 2, 15, 7, 10, gOctorokProjectileDL);
|
if (CVar_GetS32("gNewDrops", 0) != 0) {
|
||||||
|
static s16 sEffectScales[] = {
|
||||||
|
145, 135, 115, 85, 75, 53, 45, 40, 35,
|
||||||
|
};
|
||||||
|
s32 pad;
|
||||||
|
Vec3f velocity;
|
||||||
|
Vec3f pos;
|
||||||
|
s16 phi_s0 = 500;
|
||||||
|
s16 gravity;
|
||||||
|
s16 phi_v0;
|
||||||
|
f32 temp_f20;
|
||||||
|
f32 temp_f22;
|
||||||
|
s32 i;
|
||||||
|
for (s16 i = 0; i < ARRAY_COUNT(sEffectScales); i++) {
|
||||||
|
phi_s0 += 10000;
|
||||||
|
|
||||||
|
temp_f20 = Rand_ZeroOne() * 5.0f;
|
||||||
|
pos.x = (Math_SinS(phi_s0) * temp_f20) + this->actor.world.pos.x;
|
||||||
|
pos.y = (Rand_ZeroOne() * 40.0f) + this->actor.world.pos.y + 5.0f;
|
||||||
|
pos.z = (Math_CosS(phi_s0) * temp_f20) + this->actor.world.pos.z;
|
||||||
|
|
||||||
|
temp_f20 = (Rand_ZeroOne() * 5.0f) + 2.0f;
|
||||||
|
velocity.x = Math_SinS(phi_s0) * temp_f20;
|
||||||
|
temp_f22 = Rand_ZeroOne();
|
||||||
|
velocity.y = (Rand_ZeroOne() * i * 2.5f) + (temp_f22 * 5.0f);
|
||||||
|
velocity.z = Math_CosS(phi_s0) * temp_f20;
|
||||||
|
|
||||||
|
if (i == 0) {
|
||||||
|
phi_v0 = 41;
|
||||||
|
gravity = -450;
|
||||||
|
} else if (i < 4) {
|
||||||
|
phi_v0 = 37;
|
||||||
|
gravity = -380;
|
||||||
|
} else {
|
||||||
|
phi_v0 = 69;
|
||||||
|
gravity = -320;
|
||||||
|
}
|
||||||
|
EffectSsKakera_Spawn(globalCtx, &pos, &velocity, &this->actor.world.pos, gravity, phi_v0, 30, 5, 0,
|
||||||
|
sEffectScales[i]/5, 3, 0, 70, 1, OBJECT_GAMEPLAY_FIELD_KEEP, gSilverRockFragmentsDL);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
EffectSsHahen_SpawnBurst(globalCtx, &pos, 6.0f, 0, 1, 2, 15, 7, 10, gOctorokProjectileDL);
|
||||||
|
}
|
||||||
|
|
||||||
SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 20, NA_SE_EN_OCTAROCK_ROCK);
|
SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 20, NA_SE_EN_OCTAROCK_ROCK);
|
||||||
Actor_Kill(&this->actor);
|
Actor_Kill(&this->actor);
|
||||||
}
|
}
|
||||||
@ -713,11 +757,24 @@ void EnOkuta_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
|||||||
} else {
|
} else {
|
||||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_okuta.c", 1653);
|
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_okuta.c", 1653);
|
||||||
|
|
||||||
Matrix_Mult(&globalCtx->billboardMtxF, MTXMODE_APPLY);
|
if (CVar_GetS32("gNewDrops", 0) != 0) {
|
||||||
Matrix_RotateZ(this->actor.home.rot.z * (M_PI / 0x8000), MTXMODE_APPLY);
|
func_80093D18(globalCtx->state.gfxCtx);
|
||||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_okuta.c", 1657),
|
gSPSegment(POLY_OPA_DISP++, 0x08,
|
||||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 1 * (globalCtx->state.frames * 6),
|
||||||
gSPDisplayList(POLY_OPA_DISP++, gOctorokProjectileDL);
|
1 * (globalCtx->state.frames * 6), 32, 32, 1, 1 * (globalCtx->state.frames * 6),
|
||||||
|
1 * (globalCtx->state.frames * 6), 32, 32));
|
||||||
|
Matrix_Scale(7.0f,7.0f,7.0f,MTXMODE_APPLY);
|
||||||
|
Matrix_RotateX(thisx->home.rot.z * (M_PI / 0x8000), MTXMODE_APPLY);
|
||||||
|
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_nutsball.c", 901),
|
||||||
|
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||||
|
gSPDisplayList(POLY_OPA_DISP++, gSilverRockDL);
|
||||||
|
} else {
|
||||||
|
Matrix_Mult(&globalCtx->billboardMtxF, MTXMODE_APPLY);
|
||||||
|
Matrix_RotateZ(this->actor.home.rot.z * (M_PI / 0x8000), MTXMODE_APPLY);
|
||||||
|
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_okuta.c", 1657),
|
||||||
|
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||||
|
gSPDisplayList(POLY_OPA_DISP++, gOctorokProjectileDL);
|
||||||
|
}
|
||||||
|
|
||||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_en_okuta.c", 1662);
|
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_en_okuta.c", 1662);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user