mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-11-29 04:42:18 -05:00
Tweak: Refactor 3D drops handling (#3071)
* tweak: refactor 3d drops handling * cleanup * add 2d bombchu drop support
This commit is contained in:
parent
d12592377c
commit
ff4d1b9f77
@ -2,6 +2,7 @@
|
|||||||
#include "overlays/actors/ovl_En_Elf/z_en_elf.h"
|
#include "overlays/actors/ovl_En_Elf/z_en_elf.h"
|
||||||
#include "objects/gameplay_keep/gameplay_keep.h"
|
#include "objects/gameplay_keep/gameplay_keep.h"
|
||||||
#include "overlays/effects/ovl_Effect_Ss_Dead_Sound/z_eff_ss_dead_sound.h"
|
#include "overlays/effects/ovl_Effect_Ss_Dead_Sound/z_eff_ss_dead_sound.h"
|
||||||
|
#include "textures/icon_item_static/icon_item_static.h"
|
||||||
|
|
||||||
#define FLAGS 0
|
#define FLAGS 0
|
||||||
|
|
||||||
@ -70,7 +71,6 @@ static void* sItemDropTex[] = {
|
|||||||
gDropRecoveryHeartTex, gDropBombTex, gDropArrows1Tex, gDropArrows2Tex,
|
gDropRecoveryHeartTex, gDropBombTex, gDropArrows1Tex, gDropArrows2Tex,
|
||||||
gDropArrows3Tex, gDropBombTex, gDropDekuNutTex, gDropDekuStickTex,
|
gDropArrows3Tex, gDropBombTex, gDropDekuNutTex, gDropDekuStickTex,
|
||||||
gDropMagicLargeTex, gDropMagicSmallTex, gDropDekuSeedsTex, gDropKeySmallTex,
|
gDropMagicLargeTex, gDropMagicSmallTex, gDropDekuSeedsTex, gDropKeySmallTex,
|
||||||
// OTRTODO: use 2D bombchu texture
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static u8 sItemDropIds[] = {
|
static u8 sItemDropIds[] = {
|
||||||
@ -372,14 +372,32 @@ void EnItem00_Init(Actor* thisx, PlayState* play) {
|
|||||||
case ITEM00_RUPEE_GREEN:
|
case ITEM00_RUPEE_GREEN:
|
||||||
case ITEM00_RUPEE_BLUE:
|
case ITEM00_RUPEE_BLUE:
|
||||||
case ITEM00_RUPEE_RED:
|
case ITEM00_RUPEE_RED:
|
||||||
|
Actor_SetScale(&this->actor, 0.015f);
|
||||||
|
this->scale = 0.015f;
|
||||||
|
yOffset = 750.0f;
|
||||||
break;
|
break;
|
||||||
case ITEM00_SMALL_KEY:
|
case ITEM00_SMALL_KEY:
|
||||||
this->unk_158 = 0;
|
this->unk_158 = 0;
|
||||||
|
Actor_SetScale(&this->actor, 0.03f);
|
||||||
|
this->scale = 0.03f;
|
||||||
|
// Offset keys in randomizer slightly higher for their GID replacement
|
||||||
|
if (!gSaveContext.n64ddFlag) {
|
||||||
|
yOffset = 350.0f;
|
||||||
|
} else {
|
||||||
|
yOffset = 430.0f;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case ITEM00_HEART_PIECE:
|
case ITEM00_HEART_PIECE:
|
||||||
this->unk_158 = 0;
|
this->unk_158 = 0;
|
||||||
|
yOffset = 650.0f;
|
||||||
|
Actor_SetScale(&this->actor, 0.02f);
|
||||||
|
this->scale = 0.02f;
|
||||||
break;
|
break;
|
||||||
case ITEM00_HEART:
|
case ITEM00_HEART:
|
||||||
|
this->actor.home.rot.z = Rand_CenteredFloat(65535.0f);
|
||||||
|
yOffset = 430.0f;
|
||||||
|
Actor_SetScale(&this->actor, 0.02f);
|
||||||
|
this->scale = 0.02f;
|
||||||
break;
|
break;
|
||||||
case ITEM00_HEART_CONTAINER:
|
case ITEM00_HEART_CONTAINER:
|
||||||
yOffset = 430.0f;
|
yOffset = 430.0f;
|
||||||
@ -388,9 +406,17 @@ void EnItem00_Init(Actor* thisx, PlayState* play) {
|
|||||||
this->scale = 0.02f;
|
this->scale = 0.02f;
|
||||||
break;
|
break;
|
||||||
case ITEM00_ARROWS_SINGLE:
|
case ITEM00_ARROWS_SINGLE:
|
||||||
|
yOffset = 400.0f;
|
||||||
|
Actor_SetScale(&this->actor, 0.02f);
|
||||||
|
this->scale = 0.02f;
|
||||||
|
break;
|
||||||
case ITEM00_ARROWS_SMALL:
|
case ITEM00_ARROWS_SMALL:
|
||||||
case ITEM00_ARROWS_MEDIUM:
|
case ITEM00_ARROWS_MEDIUM:
|
||||||
case ITEM00_ARROWS_LARGE:
|
case ITEM00_ARROWS_LARGE:
|
||||||
|
Actor_SetScale(&this->actor, 0.035f);
|
||||||
|
this->scale = 0.035f;
|
||||||
|
yOffset = 250.0f;
|
||||||
|
break;
|
||||||
case ITEM00_BOMBS_A:
|
case ITEM00_BOMBS_A:
|
||||||
case ITEM00_BOMBS_B:
|
case ITEM00_BOMBS_B:
|
||||||
case ITEM00_NUTS:
|
case ITEM00_NUTS:
|
||||||
@ -398,11 +424,26 @@ void EnItem00_Init(Actor* thisx, PlayState* play) {
|
|||||||
case ITEM00_MAGIC_SMALL:
|
case ITEM00_MAGIC_SMALL:
|
||||||
case ITEM00_SEEDS:
|
case ITEM00_SEEDS:
|
||||||
case ITEM00_BOMBS_SPECIAL:
|
case ITEM00_BOMBS_SPECIAL:
|
||||||
|
Actor_SetScale(&this->actor, 0.03f);
|
||||||
|
this->scale = 0.03f;
|
||||||
|
yOffset = 320.0f;
|
||||||
|
break;
|
||||||
case ITEM00_MAGIC_LARGE:
|
case ITEM00_MAGIC_LARGE:
|
||||||
|
Actor_SetScale(&this->actor, 0.045 - 1e-10);
|
||||||
|
this->scale = 0.045 - 1e-10;
|
||||||
|
yOffset = 320.0f;
|
||||||
|
break;
|
||||||
case ITEM00_RUPEE_ORANGE:
|
case ITEM00_RUPEE_ORANGE:
|
||||||
|
Actor_SetScale(&this->actor, 0.045 - 1e-10);
|
||||||
|
this->scale = 0.045 - 1e-10;
|
||||||
|
yOffset = 750.0f;
|
||||||
|
break;
|
||||||
case ITEM00_RUPEE_PURPLE:
|
case ITEM00_RUPEE_PURPLE:
|
||||||
|
Actor_SetScale(&this->actor, 0.03f);
|
||||||
|
this->scale = 0.03f;
|
||||||
|
yOffset = 750.0f;
|
||||||
|
break;
|
||||||
case ITEM00_FLEXIBLE:
|
case ITEM00_FLEXIBLE:
|
||||||
case ITEM00_BOMBCHU:
|
|
||||||
yOffset = 500.0f;
|
yOffset = 500.0f;
|
||||||
Actor_SetScale(&this->actor, 0.01f);
|
Actor_SetScale(&this->actor, 0.01f);
|
||||||
this->scale = 0.01f;
|
this->scale = 0.01f;
|
||||||
@ -432,6 +473,11 @@ void EnItem00_Init(Actor* thisx, PlayState* play) {
|
|||||||
shadowScale = 0.6f;
|
shadowScale = 0.6f;
|
||||||
this->actor.world.rot.x = 0x4000;
|
this->actor.world.rot.x = 0x4000;
|
||||||
break;
|
break;
|
||||||
|
case ITEM00_BOMBCHU:
|
||||||
|
yOffset = 320.0f;
|
||||||
|
Actor_SetScale(&this->actor, 0.03f);
|
||||||
|
this->scale = 0.03f;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
this->unk_156 = 0;
|
this->unk_156 = 0;
|
||||||
@ -551,41 +597,29 @@ void EnItem00_Destroy(Actor* thisx, PlayState* play) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void func_8001DFC8(EnItem00* this, PlayState* play) {
|
void func_8001DFC8(EnItem00* this, PlayState* play) {
|
||||||
|
if ((this->actor.params <= ITEM00_RUPEE_RED) || ((this->actor.params == ITEM00_HEART) && (this->unk_15A < 0)) ||
|
||||||
if (!CVarGetInteger("gNewDrops", 0)){
|
(this->actor.params == ITEM00_HEART_PIECE)) {
|
||||||
if ((this->actor.params <= ITEM00_RUPEE_RED) || ((this->actor.params == ITEM00_HEART) && (this->unk_15A < 0)) ||
|
this->actor.shape.rot.y += 960;
|
||||||
(this->actor.params == ITEM00_HEART_PIECE)) {
|
} else {
|
||||||
this->actor.shape.rot.y += 960;
|
if ((this->actor.params >= ITEM00_SHIELD_DEKU) && (this->actor.params != ITEM00_BOMBS_SPECIAL) &&
|
||||||
} else {
|
(this->actor.params != ITEM00_BOMBCHU)) {
|
||||||
if ((this->actor.params >= ITEM00_SHIELD_DEKU) && (this->actor.params != ITEM00_BOMBS_SPECIAL) &&
|
if (this->unk_15A == -1) {
|
||||||
(this->actor.params != ITEM00_BOMBCHU)) {
|
if (Math_SmoothStepToS(&this->actor.shape.rot.x, this->actor.world.rot.x - 0x4000, 2, 3000, 1500) ==
|
||||||
if (this->unk_15A == -1) {
|
0) {
|
||||||
if (Math_SmoothStepToS(&this->actor.shape.rot.x, this->actor.world.rot.x - 0x4000, 2, 3000, 1500) ==
|
this->unk_15A = -2;
|
||||||
0) {
|
}
|
||||||
this->unk_15A = -2;
|
} else {
|
||||||
}
|
if (Math_SmoothStepToS(&this->actor.shape.rot.x, -this->actor.world.rot.x - 0x4000, 2, 3000, 1500) ==
|
||||||
} else {
|
0) {
|
||||||
if (Math_SmoothStepToS(&this->actor.shape.rot.x, -this->actor.world.rot.x - 0x4000, 2, 3000, 1500) ==
|
this->unk_15A = -1;
|
||||||
0) {
|
|
||||||
this->unk_15A = -1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Math_SmoothStepToS(&this->actor.world.rot.x, 0, 2, 2500, 500);
|
|
||||||
}
|
}
|
||||||
|
Math_SmoothStepToS(&this->actor.world.rot.x, 0, 2, 2500, 500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->actor.params == ITEM00_HEART_PIECE) {
|
if (this->actor.params == ITEM00_HEART_PIECE) {
|
||||||
if (CVarGetInteger("gNewDrops", 0) && !gSaveContext.n64ddFlag) {
|
this->actor.shape.yOffset = Math_SinS(this->actor.shape.rot.y) * 150.0f + 850.0f;
|
||||||
this->actor.shape.yOffset = Math_SinS(this->actor.shape.rot.y) * 20.0f + 50.0f;
|
|
||||||
} else {
|
|
||||||
this->actor.shape.yOffset = Math_SinS(this->actor.shape.rot.y) * 150.0f + 850.0f;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (gSaveContext.n64ddFlag && this->actor.params == ITEM00_SMALL_KEY) {
|
|
||||||
this->actor.shape.yOffset = 600.0f;
|
|
||||||
this->actor.shape.rot.y += 960;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 0.5f, 0.0f);
|
Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 0.5f, 0.0f);
|
||||||
@ -613,7 +647,7 @@ void func_8001E1C8(EnItem00* this, PlayState* play) {
|
|||||||
f32 originalVelocity;
|
f32 originalVelocity;
|
||||||
Vec3f effectPos;
|
Vec3f effectPos;
|
||||||
|
|
||||||
if (this->actor.params <= ITEM00_RUPEE_RED && !CVarGetInteger("gNewDrops", 0)) {
|
if (this->actor.params <= ITEM00_RUPEE_RED) {
|
||||||
this->actor.shape.rot.y += 960;
|
this->actor.shape.rot.y += 960;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -715,12 +749,13 @@ void func_8001E5C8(EnItem00* this, PlayState* play) {
|
|||||||
|
|
||||||
this->actor.world.pos = player->actor.world.pos;
|
this->actor.world.pos = player->actor.world.pos;
|
||||||
|
|
||||||
if (this->actor.params <= ITEM00_RUPEE_RED && !CVarGetInteger("gNewDrops", 0)) {
|
if (this->actor.params <= ITEM00_RUPEE_RED) {
|
||||||
this->actor.shape.rot.y += 960;
|
this->actor.shape.rot.y += 960;
|
||||||
} else if (this->actor.params == ITEM00_HEART && !CVarGetInteger("gNewDrops", 0)) {
|
} else if (this->actor.params == ITEM00_HEART) {
|
||||||
this->actor.shape.rot.y = 0;
|
this->actor.shape.rot.y = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// bounces up and down above player's head
|
||||||
this->actor.world.pos.y += 40.0f + Math_SinS(this->unk_15A * 15000) * (this->unk_15A * 0.3f);
|
this->actor.world.pos.y += 40.0f + Math_SinS(this->unk_15A * 15000) * (this->unk_15A * 0.3f);
|
||||||
|
|
||||||
if (LINK_IS_ADULT) {
|
if (LINK_IS_ADULT) {
|
||||||
@ -741,21 +776,17 @@ void EnItem00_Update(Actor* thisx, PlayState* play) {
|
|||||||
EnItem00* this = (EnItem00*)thisx;
|
EnItem00* this = (EnItem00*)thisx;
|
||||||
s32 pad;
|
s32 pad;
|
||||||
|
|
||||||
// OTRTODO: remove special case for bombchu when its 2D drop is implemented
|
// Rotate some drops when 3D drops are on, otherwise reset rotation back to 0 for billboard effect
|
||||||
if (CVarGetInteger("gNewDrops", 0) || this->actor.params == ITEM00_BOMBCHU) { //set the rotation system on selected model only :)
|
if ((this->actor.params == ITEM00_HEART && this->unk_15A >= 0) ||
|
||||||
if ((this->actor.params == ITEM00_RUPEE_GREEN) || (this->actor.params == ITEM00_RUPEE_BLUE) ||
|
(this->actor.params >= ITEM00_ARROWS_SMALL && this->actor.params <= ITEM00_SMALL_KEY) ||
|
||||||
(this->actor.params == ITEM00_RUPEE_RED) || (this->actor.params == ITEM00_ARROWS_SINGLE) ||
|
this->actor.params == ITEM00_BOMBS_A || this->actor.params == ITEM00_ARROWS_SINGLE ||
|
||||||
(this->actor.params == ITEM00_ARROWS_SMALL) || (this->actor.params == ITEM00_ARROWS_MEDIUM) ||
|
this->actor.params == ITEM00_BOMBS_SPECIAL || this->actor.params == ITEM00_BOMBCHU) {
|
||||||
(this->actor.params == ITEM00_ARROWS_LARGE) || (this->actor.params == ITEM00_BOMBS_A) ||
|
if (CVarGetInteger("gNewDrops", 0) ||
|
||||||
(this->actor.params == ITEM00_BOMBS_B) || (this->actor.params == ITEM00_NUTS) ||
|
// Keys in randomizer need to always rotate for their GID replacement
|
||||||
(this->actor.params == ITEM00_MAGIC_SMALL) || (this->actor.params == ITEM00_SEEDS) ||
|
(gSaveContext.n64ddFlag && this->actor.params == ITEM00_SMALL_KEY)) {
|
||||||
(this->actor.params == ITEM00_MAGIC_LARGE) || (this->actor.params == ITEM00_HEART) ||
|
|
||||||
(this->actor.params == ITEM00_BOMBS_SPECIAL) || this->actor.params == ITEM00_HEART_PIECE ||
|
|
||||||
(this->actor.params == ITEM00_BOMBCHU)) {
|
|
||||||
this->actor.shape.rot.y += 960;
|
|
||||||
}
|
|
||||||
if (this->actor.params == ITEM00_SMALL_KEY && !gSaveContext.n64ddFlag) {
|
|
||||||
this->actor.shape.rot.y += 960;
|
this->actor.shape.rot.y += 960;
|
||||||
|
} else {
|
||||||
|
this->actor.shape.rot.y = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -978,88 +1009,48 @@ void EnItem00_Draw(Actor* thisx, PlayState* play) {
|
|||||||
switch (this->actor.params) {
|
switch (this->actor.params) {
|
||||||
case ITEM00_RUPEE_GREEN:
|
case ITEM00_RUPEE_GREEN:
|
||||||
if (CVarGetInteger("gNewDrops", 0)) {
|
if (CVarGetInteger("gNewDrops", 0)) {
|
||||||
Actor_SetScale(&this->actor, 0.3f);
|
mtxScale = 25.0f;
|
||||||
this->scale = 0.3f;
|
Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY);
|
||||||
this->actor.shape.yOffset = 50.0f;
|
|
||||||
this->actor.shape.shadowScale = 0.3f;
|
|
||||||
this->actor.world.rot.x = 0x4000;
|
|
||||||
GetItem_Draw(play, GID_RUPEE_GREEN);
|
GetItem_Draw(play, GID_RUPEE_GREEN);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ITEM00_RUPEE_BLUE:
|
case ITEM00_RUPEE_BLUE:
|
||||||
if (CVarGetInteger("gNewDrops", 0)) {
|
if (CVarGetInteger("gNewDrops", 0)) {
|
||||||
Actor_SetScale(&this->actor, 0.3f);
|
mtxScale = 25.0f;
|
||||||
this->scale = 0.3f;
|
Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY);
|
||||||
this->actor.shape.yOffset = 50.0f;
|
|
||||||
this->actor.shape.shadowScale = 0.3f;
|
|
||||||
this->actor.world.rot.x = 0x4000;
|
|
||||||
GetItem_Draw(play, GID_RUPEE_BLUE);
|
GetItem_Draw(play, GID_RUPEE_BLUE);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ITEM00_RUPEE_RED:
|
case ITEM00_RUPEE_RED:
|
||||||
if (CVarGetInteger("gNewDrops", 0)) {
|
if (CVarGetInteger("gNewDrops", 0)) {
|
||||||
Actor_SetScale(&this->actor, 0.3f);
|
mtxScale = 25.0f;
|
||||||
this->scale = 0.3f;
|
Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY);
|
||||||
this->actor.shape.yOffset = 50.0f;
|
|
||||||
this->actor.shape.shadowScale = 0.3f;
|
|
||||||
this->actor.world.rot.x = 0x4000;
|
|
||||||
GetItem_Draw(play, GID_RUPEE_RED);
|
GetItem_Draw(play, GID_RUPEE_RED);
|
||||||
break;
|
break;
|
||||||
} else {
|
|
||||||
this->actor.shape.shadowScale = 6.0f;
|
|
||||||
Actor_SetScale(&this->actor, 0.015f);
|
|
||||||
this->scale = 0.015f;
|
|
||||||
this->actor.shape.yOffset = 750.0f;
|
|
||||||
EnItem00_DrawRupee(this, play);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
case ITEM00_RUPEE_ORANGE:
|
case ITEM00_RUPEE_ORANGE:
|
||||||
if (CVarGetInteger("gNewDrops", 0)) {
|
if (CVarGetInteger("gNewDrops", 0)) {
|
||||||
Actor_SetScale(&this->actor, 0.45f);
|
mtxScale = 17.5f;
|
||||||
this->scale = 0.45f;
|
Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY);
|
||||||
this->actor.shape.yOffset = 50.0f;
|
|
||||||
this->actor.shape.shadowScale = 0.3f;
|
|
||||||
this->actor.world.rot.x = 0x4000;
|
|
||||||
GetItem_Draw(play, GID_RUPEE_GOLD);
|
GetItem_Draw(play, GID_RUPEE_GOLD);
|
||||||
break;
|
break;
|
||||||
} else {
|
|
||||||
Actor_SetScale(&this->actor, 0.045 - 1e-10);
|
|
||||||
this->actor.shape.shadowScale = 6.0f;
|
|
||||||
this->scale = 0.045 - 1e-10;
|
|
||||||
this->actor.shape.yOffset = 750.0f;
|
|
||||||
EnItem00_DrawRupee(this, play);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
case ITEM00_RUPEE_PURPLE:
|
case ITEM00_RUPEE_PURPLE:
|
||||||
if (CVarGetInteger("gNewDrops", 0)) {
|
if (CVarGetInteger("gNewDrops", 0)) {
|
||||||
Actor_SetScale(&this->actor, 0.4f);
|
mtxScale = 17.5f;
|
||||||
this->scale = 0.4f;
|
Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY);
|
||||||
this->actor.shape.yOffset = 50.0f;
|
|
||||||
this->actor.shape.shadowScale = 0.3f;
|
|
||||||
this->actor.world.rot.x = 0x4000;
|
|
||||||
GetItem_Draw(play, GID_RUPEE_PURPLE);
|
GetItem_Draw(play, GID_RUPEE_PURPLE);
|
||||||
break;
|
|
||||||
} else {
|
} else {
|
||||||
Actor_SetScale(&this->actor, 0.03f);
|
// All rupees fallthrough here when 3d drops are off
|
||||||
this->actor.shape.shadowScale = 6.0f;
|
|
||||||
this->scale = 0.03f;
|
|
||||||
this->actor.shape.yOffset = 750.0f;
|
|
||||||
EnItem00_DrawRupee(this, play);
|
EnItem00_DrawRupee(this, play);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
case ITEM00_HEART_PIECE:
|
case ITEM00_HEART_PIECE:
|
||||||
if (CVarGetInteger("gNewDrops", 0) && !gSaveContext.n64ddFlag) {
|
if (CVarGetInteger("gNewDrops", 0) && !gSaveContext.n64ddFlag) {
|
||||||
Actor_SetScale(&this->actor, 0.5f);
|
mtxScale = 21.0f;
|
||||||
this->scale = 0.5f;
|
Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY);
|
||||||
this->actor.shape.yOffset = 50.0f;
|
|
||||||
this->actor.world.rot.x = 0x4000;
|
|
||||||
this->actor.shape.shadowScale = 0.3f;
|
|
||||||
GetItem_Draw(play, GID_HEART_PIECE);
|
GetItem_Draw(play, GID_HEART_PIECE);
|
||||||
} else {
|
} else {
|
||||||
this->actor.shape.yOffset = 650.0f;
|
|
||||||
this->actor.shape.shadowScale = 0.03f;
|
|
||||||
Actor_SetScale(&this->actor, 0.02f);
|
|
||||||
this->scale = 0.02f;
|
|
||||||
EnItem00_DrawHeartPiece(this, play);
|
EnItem00_DrawHeartPiece(this, play);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -1067,17 +1058,14 @@ void EnItem00_Draw(Actor* thisx, PlayState* play) {
|
|||||||
EnItem00_DrawHeartContainer(this, play);
|
EnItem00_DrawHeartContainer(this, play);
|
||||||
break;
|
break;
|
||||||
case ITEM00_HEART:
|
case ITEM00_HEART:
|
||||||
if (CVarGetInteger("gNewDrops", 0)) {
|
// Only change despawn-able recovery hearts
|
||||||
this->actor.home.rot.z = Rand_CenteredFloat(65535.0f);
|
if (CVarGetInteger("gNewDrops", 0) && this->unk_15A >= 0) {
|
||||||
this->actor.shape.yOffset = 25.0f;
|
|
||||||
this->actor.shape.shadowScale = 0.3f;
|
|
||||||
Actor_SetScale(&this->actor, 0.3f);
|
|
||||||
this->scale = 0.3f;
|
|
||||||
GetItem_Draw(play, GID_HEART);
|
|
||||||
mtxScale = 16.0f;
|
mtxScale = 16.0f;
|
||||||
Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY);
|
Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY);
|
||||||
|
GetItem_Draw(play, GID_HEART);
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
|
// Overworld hearts that are always 3D
|
||||||
if (this->unk_15A < 0) {
|
if (this->unk_15A < 0) {
|
||||||
if (this->unk_15A == -1) {
|
if (this->unk_15A == -1) {
|
||||||
s8 bankIndex = Object_GetIndex(&play->objectCtx, OBJECT_GI_HEART);
|
s8 bankIndex = Object_GetIndex(&play->objectCtx, OBJECT_GI_HEART);
|
||||||
@ -1093,156 +1081,89 @@ void EnItem00_Draw(Actor* thisx, PlayState* play) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
//Big hearts workaround
|
|
||||||
this->actor.home.rot.z = Rand_CenteredFloat(65535.0f);
|
|
||||||
this->actor.shape.yOffset = 430.0f;
|
|
||||||
this->actor.shape.shadowScale = 6.0f;
|
|
||||||
Actor_SetScale(&this->actor, 0.02f);
|
|
||||||
this->scale = 0.02f;
|
|
||||||
EnItem00_DrawCollectible(this, play);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
case ITEM00_BOMBS_A:
|
case ITEM00_BOMBS_A:
|
||||||
if (CVarGetInteger("gNewDrops", 0)) {
|
|
||||||
Actor_SetScale(&this->actor, 0.2f);
|
|
||||||
this->scale = 0.2f;
|
|
||||||
this->actor.shape.yOffset = 50.0f;
|
|
||||||
this->actor.world.rot.x = 0x4000;
|
|
||||||
this->actor.shape.shadowScale = 0.3f;
|
|
||||||
GetItem_Draw(play, GID_BOMB);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case ITEM00_BOMBS_B:
|
case ITEM00_BOMBS_B:
|
||||||
|
case ITEM00_BOMBS_SPECIAL:
|
||||||
if (CVarGetInteger("gNewDrops", 0)) {
|
if (CVarGetInteger("gNewDrops", 0)) {
|
||||||
Actor_SetScale(&this->actor, 0.2f);
|
mtxScale = 8.0f;
|
||||||
this->scale = 0.2f;
|
Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY);
|
||||||
this->actor.shape.yOffset = 50.0f;
|
|
||||||
this->actor.world.rot.x = 0x4000;
|
|
||||||
this->actor.shape.shadowScale = 0.3f;
|
|
||||||
GetItem_Draw(play, GID_BOMB);
|
GetItem_Draw(play, GID_BOMB);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ITEM00_BOMBS_SPECIAL:
|
|
||||||
case ITEM00_ARROWS_SINGLE:
|
case ITEM00_ARROWS_SINGLE:
|
||||||
if (CVarGetInteger("gNewDrops", 0)) {
|
|
||||||
Actor_SetScale(&this->actor, 0.2f);
|
|
||||||
this->scale = 0.2f;
|
|
||||||
this->actor.shape.yOffset = 50.0f;
|
|
||||||
this->actor.world.rot.x = 0x4000;
|
|
||||||
this->actor.shape.shadowScale = 0.3f;
|
|
||||||
GetItem_Draw(play, GID_ARROWS_SMALL);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case ITEM00_ARROWS_SMALL:
|
case ITEM00_ARROWS_SMALL:
|
||||||
if (CVarGetInteger("gNewDrops", 0)) {
|
if (CVarGetInteger("gNewDrops", 0)) {
|
||||||
Actor_SetScale(&this->actor, 0.2f);
|
mtxScale = 7.0f;
|
||||||
this->scale = 0.2f;
|
Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY);
|
||||||
this->actor.shape.yOffset = 50.0f;
|
|
||||||
this->actor.world.rot.x = 0x4000;
|
|
||||||
this->actor.shape.shadowScale = 0.3f;
|
|
||||||
GetItem_Draw(play, GID_ARROWS_SMALL);
|
GetItem_Draw(play, GID_ARROWS_SMALL);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ITEM00_ARROWS_MEDIUM:
|
case ITEM00_ARROWS_MEDIUM:
|
||||||
if (CVarGetInteger("gNewDrops", 0)) {
|
if (CVarGetInteger("gNewDrops", 0)) {
|
||||||
Actor_SetScale(&this->actor, 0.2f);
|
mtxScale = 7.0f;
|
||||||
this->scale = 0.2f;
|
Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY);
|
||||||
this->actor.shape.yOffset = 50.0f;
|
|
||||||
this->actor.world.rot.x = 0x4000;
|
|
||||||
this->actor.shape.shadowScale = 0.3f;
|
|
||||||
GetItem_Draw(play, GID_ARROWS_MEDIUM);
|
GetItem_Draw(play, GID_ARROWS_MEDIUM);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ITEM00_ARROWS_LARGE:
|
case ITEM00_ARROWS_LARGE:
|
||||||
if (CVarGetInteger("gNewDrops", 0)) {
|
if (CVarGetInteger("gNewDrops", 0)) {
|
||||||
Actor_SetScale(&this->actor, 0.2f);
|
mtxScale = 7.0f;
|
||||||
this->scale = 0.2f;
|
Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY);
|
||||||
this->actor.shape.yOffset = 50.0f;
|
|
||||||
this->actor.world.rot.x = 0x4000;
|
|
||||||
this->actor.shape.shadowScale = 0.3f;
|
|
||||||
GetItem_Draw(play, GID_ARROWS_LARGE);
|
GetItem_Draw(play, GID_ARROWS_LARGE);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ITEM00_NUTS:
|
case ITEM00_NUTS:
|
||||||
if (CVarGetInteger("gNewDrops", 0)) {
|
if (CVarGetInteger("gNewDrops", 0)) {
|
||||||
Actor_SetScale(&this->actor, 0.2f);
|
mtxScale = 9.0f;
|
||||||
this->scale = 0.2f;
|
Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY);
|
||||||
this->actor.shape.yOffset = 50.0f;
|
|
||||||
this->actor.world.rot.x = 0x4000;
|
|
||||||
this->actor.shape.shadowScale = 0.3f;
|
|
||||||
GetItem_Draw(play, GID_NUTS);
|
GetItem_Draw(play, GID_NUTS);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ITEM00_STICK:
|
case ITEM00_STICK:
|
||||||
if (CVarGetInteger("gNewDrops", 0)) {
|
if (CVarGetInteger("gNewDrops", 0)) {
|
||||||
Actor_SetScale(&this->actor, 0.2f);
|
mtxScale = 7.5f;
|
||||||
this->scale = 0.2f;
|
Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY);
|
||||||
this->actor.shape.yOffset = 50.0f;
|
|
||||||
this->actor.world.rot.x = 0x4000;
|
|
||||||
this->actor.shape.shadowScale = 0.3f;
|
|
||||||
GetItem_Draw(play, GID_STICK);
|
GetItem_Draw(play, GID_STICK);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ITEM00_MAGIC_LARGE:
|
case ITEM00_MAGIC_LARGE:
|
||||||
if (CVarGetInteger("gNewDrops", 0)) {
|
if (CVarGetInteger("gNewDrops", 0)) {
|
||||||
Actor_SetScale(&this->actor, 0.2f);
|
mtxScale = 8.0f;
|
||||||
this->scale = 0.2f;
|
Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY);
|
||||||
this->actor.shape.yOffset = 50.0f;
|
|
||||||
this->actor.world.rot.x = 0x4000;
|
|
||||||
this->actor.shape.shadowScale = 0.3f;
|
|
||||||
GetItem_Draw(play, GID_MAGIC_LARGE);
|
GetItem_Draw(play, GID_MAGIC_LARGE);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ITEM00_MAGIC_SMALL:
|
case ITEM00_MAGIC_SMALL:
|
||||||
if (CVarGetInteger("gNewDrops", 0)) {
|
if (CVarGetInteger("gNewDrops", 0)) {
|
||||||
Actor_SetScale(&this->actor, 0.2f);
|
mtxScale = 8.0f;
|
||||||
this->scale = 0.2f;
|
Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY);
|
||||||
this->actor.shape.yOffset = 50.0f;
|
|
||||||
this->actor.shape.shadowScale = 0.3f;
|
|
||||||
this->actor.world.rot.x = 0x4000;
|
|
||||||
GetItem_Draw(play, GID_MAGIC_SMALL);
|
GetItem_Draw(play, GID_MAGIC_SMALL);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ITEM00_SEEDS:
|
case ITEM00_SEEDS:
|
||||||
if (CVarGetInteger("gNewDrops", 0)) {
|
if (CVarGetInteger("gNewDrops", 0)) {
|
||||||
Actor_SetScale(&this->actor, 0.2f);
|
mtxScale = 7.0f;
|
||||||
this->scale = 0.2f;
|
Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY);
|
||||||
this->actor.shape.yOffset = 50.0f;
|
|
||||||
this->actor.shape.shadowScale = 0.3f;
|
|
||||||
this->actor.world.rot.x = 0x4000;
|
|
||||||
GetItem_Draw(play, GID_SEEDS);
|
GetItem_Draw(play, GID_SEEDS);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case ITEM00_BOMBCHU:
|
||||||
|
if (CVarGetInteger("gNewDrops", 0)) {
|
||||||
|
mtxScale = 9.0f;
|
||||||
|
Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY);
|
||||||
|
GetItem_Draw(play, GID_BOMBCHU);
|
||||||
|
break;
|
||||||
|
}
|
||||||
case ITEM00_SMALL_KEY:
|
case ITEM00_SMALL_KEY:
|
||||||
if (CVarGetInteger("gNewDrops", 0) && !gSaveContext.n64ddFlag) {
|
if (CVarGetInteger("gNewDrops", 0) && !gSaveContext.n64ddFlag) {
|
||||||
Actor_SetScale(&this->actor, 0.2f);
|
mtxScale = 8.0f;
|
||||||
this->scale = 0.2f;
|
Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY);
|
||||||
this->actor.shape.yOffset = 50.0f;
|
|
||||||
this->actor.world.rot.x = 0x4000;
|
|
||||||
this->actor.shape.shadowScale = 0.5f;
|
|
||||||
GetItem_Draw(play, GID_KEY_SMALL);
|
GetItem_Draw(play, GID_KEY_SMALL);
|
||||||
break;
|
|
||||||
} else {
|
} else {
|
||||||
Actor_SetScale(&this->actor, 0.03f);
|
// All collectibles fallthrough here when 3d drops are off
|
||||||
this->scale = 0.03f;
|
|
||||||
this->actor.shape.yOffset = 320.0f;
|
|
||||||
this->actor.shape.shadowScale = 6.0f;
|
|
||||||
if (!gSaveContext.n64ddFlag) {
|
|
||||||
this->actor.world.rot.x = 0;
|
|
||||||
this->actor.shape.rot.y = 0;
|
|
||||||
}
|
|
||||||
EnItem00_DrawCollectible(this, play);
|
EnItem00_DrawCollectible(this, play);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
case ITEM00_BOMBCHU:
|
|
||||||
// OTRTODO: Stop forcing chu drops to be 3D when the texture is added
|
|
||||||
Actor_SetScale(&this->actor, 0.2f);
|
|
||||||
this->scale = 0.2f;
|
|
||||||
this->actor.shape.yOffset = 50.0f;
|
|
||||||
this->actor.world.rot.x = 0x4000;
|
|
||||||
this->actor.shape.shadowScale = 0.3f;
|
|
||||||
GetItem_Draw(play, GID_BOMBCHU);
|
|
||||||
break;
|
break;
|
||||||
case ITEM00_SHIELD_DEKU:
|
case ITEM00_SHIELD_DEKU:
|
||||||
GetItem_Draw(play, GID_SHIELD_DEKU);
|
GetItem_Draw(play, GID_SHIELD_DEKU);
|
||||||
@ -1406,11 +1327,11 @@ void EnItem00_DrawRupee(EnItem00* this, PlayState* play) {
|
|||||||
rupeeColor = CVarGetColor24("gCosmetics.Consumable_RedRupee.Value", (Color_RGB8){ 255, 255, 255 });
|
rupeeColor = CVarGetColor24("gCosmetics.Consumable_RedRupee.Value", (Color_RGB8){ 255, 255, 255 });
|
||||||
shouldColor = CVarGetInteger("gCosmetics.Consumable_RedRupee.Changed", 0);
|
shouldColor = CVarGetInteger("gCosmetics.Consumable_RedRupee.Changed", 0);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 4: // orange rupee texture corresponds to the purple rupee (authentic bug)
|
||||||
rupeeColor = CVarGetColor24("gCosmetics.Consumable_PurpleRupee.Value", (Color_RGB8){ 255, 255, 255 });
|
rupeeColor = CVarGetColor24("gCosmetics.Consumable_PurpleRupee.Value", (Color_RGB8){ 255, 255, 255 });
|
||||||
shouldColor = CVarGetInteger("gCosmetics.Consumable_PurpleRupee.Changed", 0);
|
shouldColor = CVarGetInteger("gCosmetics.Consumable_PurpleRupee.Changed", 0);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 3: // pink rupee texture corresponds to the gold rupee (authentic bug)
|
||||||
rupeeColor = CVarGetColor24("gCosmetics.Consumable_GoldRupee.Value", (Color_RGB8){ 255, 255, 255 });
|
rupeeColor = CVarGetColor24("gCosmetics.Consumable_GoldRupee.Value", (Color_RGB8){ 255, 255, 255 });
|
||||||
shouldColor = CVarGetInteger("gCosmetics.Consumable_GoldRupee.Changed", 0);
|
shouldColor = CVarGetInteger("gCosmetics.Consumable_GoldRupee.Changed", 0);
|
||||||
break;
|
break;
|
||||||
@ -1430,6 +1351,13 @@ void EnItem00_DrawRupee(EnItem00* this, PlayState* play) {
|
|||||||
CLOSE_DISPS(play->state.gfxCtx);
|
CLOSE_DISPS(play->state.gfxCtx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const Vtx customDropVtx[] = {
|
||||||
|
VTX(-250, -250, 0, 0 << 5, 0 << 5, 255, 255, 255, 255),
|
||||||
|
VTX(250, -250, 0, 32 << 5, 0 << 5, 255, 255, 255, 255),
|
||||||
|
VTX(-250, 250, 0, 0 << 5, 32 << 5, 255, 255, 255, 255),
|
||||||
|
VTX(250, 250, 0, 32 << 5, 32 << 5, 255, 255, 255, 255),
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Draw Function used for most collectible types of En_Item00 (ammo, bombs, sticks, nuts, magic...).
|
* Draw Function used for most collectible types of En_Item00 (ammo, bombs, sticks, nuts, magic...).
|
||||||
*/
|
*/
|
||||||
@ -1444,10 +1372,38 @@ void EnItem00_DrawCollectible(EnItem00* this, PlayState* play) {
|
|||||||
this->randoGiEntry.getItemFrom = ITEM_FROM_FREESTANDING;
|
this->randoGiEntry.getItemFrom = ITEM_FROM_FREESTANDING;
|
||||||
}
|
}
|
||||||
|
|
||||||
f32 mtxScale = 16.0f;
|
f32 mtxScale = 10.67f;
|
||||||
Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY);
|
Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY);
|
||||||
EnItem00_CustomItemsParticles(&this->actor, play, this->randoGiEntry);
|
EnItem00_CustomItemsParticles(&this->actor, play, this->randoGiEntry);
|
||||||
GetItemEntry_Draw(play, this->randoGiEntry);
|
GetItemEntry_Draw(play, this->randoGiEntry);
|
||||||
|
} else if (this->actor.params == ITEM00_BOMBCHU) {
|
||||||
|
OPEN_DISPS(play->state.gfxCtx);
|
||||||
|
|
||||||
|
Matrix_ReplaceRotation(&play->billboardMtxF);
|
||||||
|
// Need to flip vertically as drop icons are normally upside down, but here
|
||||||
|
// we are using the inventory/C-Button for th bombchu icon
|
||||||
|
Matrix_Scale(1.0f, -1.0f, 1.0f, MTXMODE_APPLY);
|
||||||
|
|
||||||
|
POLY_OPA_DISP = Play_SetFog(play, POLY_OPA_DISP);
|
||||||
|
|
||||||
|
POLY_OPA_DISP = Gfx_SetupDL_66(POLY_OPA_DISP);
|
||||||
|
|
||||||
|
gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(play->state.gfxCtx),
|
||||||
|
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||||
|
|
||||||
|
gDPPipeSync(POLY_OPA_DISP++);
|
||||||
|
gDPSetTexturePersp(POLY_OPA_DISP++, G_TP_PERSP);
|
||||||
|
gDPSetTextureLOD(POLY_OPA_DISP++, G_TL_TILE);
|
||||||
|
gDPSetTextureFilter(POLY_OPA_DISP++, G_TF_BILERP);
|
||||||
|
gDPSetTextureConvert(POLY_OPA_DISP++, G_TC_FILT);
|
||||||
|
gDPSetTextureLUT(POLY_OPA_DISP++, G_TT_NONE);
|
||||||
|
gDPLoadTextureBlock(POLY_OPA_DISP++, gBombchuIconTex, G_IM_FMT_RGBA, G_IM_SIZ_32b, 32, 32, 0,
|
||||||
|
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD,
|
||||||
|
G_TX_NOLOD);
|
||||||
|
gSPVertex(POLY_OPA_DISP++, customDropVtx, 4, 0);
|
||||||
|
gSP1Quadrangle(POLY_OPA_DISP++, 0, 2, 3, 1, 0);
|
||||||
|
|
||||||
|
CLOSE_DISPS(play->state.gfxCtx);
|
||||||
} else {
|
} else {
|
||||||
s32 texIndex = this->actor.params - 3;
|
s32 texIndex = this->actor.params - 3;
|
||||||
|
|
||||||
@ -1457,9 +1413,6 @@ void EnItem00_DrawCollectible(EnItem00* this, PlayState* play) {
|
|||||||
|
|
||||||
if (this->actor.params == ITEM00_BOMBS_SPECIAL) {
|
if (this->actor.params == ITEM00_BOMBS_SPECIAL) {
|
||||||
texIndex = 1;
|
texIndex = 1;
|
||||||
// OTRTODO: 2D bombchu drops
|
|
||||||
//} else if (this->actor.params == ITEM00_BOMBCHU) {
|
|
||||||
// texIndex = 12;
|
|
||||||
} else if (this->actor.params >= ITEM00_ARROWS_SMALL) {
|
} else if (this->actor.params >= ITEM00_ARROWS_SMALL) {
|
||||||
texIndex -= 3;
|
texIndex -= 3;
|
||||||
}
|
}
|
||||||
|
@ -55,12 +55,7 @@ void EnExRuppy_Init(Actor* thisx, PlayState* play) {
|
|||||||
|
|
||||||
switch (this->type) {
|
switch (this->type) {
|
||||||
case 0:
|
case 0:
|
||||||
|
this->unk_160 = 0.01f;
|
||||||
if (CVarGetInteger("gNewDrops", 0) !=0) {
|
|
||||||
this->unk_160 = 0.3f;
|
|
||||||
} else {
|
|
||||||
this->unk_160 = 0.01f;
|
|
||||||
}
|
|
||||||
Actor_SetScale(&this->actor, this->unk_160);
|
Actor_SetScale(&this->actor, this->unk_160);
|
||||||
this->actor.room = -1;
|
this->actor.room = -1;
|
||||||
this->actor.gravity = 0.0f;
|
this->actor.gravity = 0.0f;
|
||||||
@ -105,13 +100,9 @@ void EnExRuppy_Init(Actor* thisx, PlayState* play) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (CVarGetInteger("gNewDrops", 0) !=0) {
|
|
||||||
this->actor.shape.shadowScale = 0.3f;
|
this->actor.shape.shadowScale = 7.0f;
|
||||||
this->actor.shape.yOffset = 35.0f;
|
this->actor.shape.yOffset = 700.0f;
|
||||||
} else {
|
|
||||||
this->actor.shape.shadowScale = 7.0f;
|
|
||||||
this->actor.shape.yOffset = 700.0f;
|
|
||||||
}
|
|
||||||
this->unk_15A = this->actor.world.rot.z;
|
this->unk_15A = this->actor.world.rot.z;
|
||||||
this->actor.world.rot.z = 0;
|
this->actor.world.rot.z = 0;
|
||||||
this->timer = 30;
|
this->timer = 30;
|
||||||
@ -122,40 +113,23 @@ void EnExRuppy_Init(Actor* thisx, PlayState* play) {
|
|||||||
case 1:
|
case 1:
|
||||||
case 2: // Giant pink ruppe that explodes when you touch it
|
case 2: // Giant pink ruppe that explodes when you touch it
|
||||||
if (this->type == 1) {
|
if (this->type == 1) {
|
||||||
|
Actor_SetScale(&this->actor, 0.1f);
|
||||||
this->colorIdx = 4;
|
this->colorIdx = 4;
|
||||||
if (CVarGetInteger("gNewDrops", 0) !=0) {
|
|
||||||
Actor_SetScale(&this->actor, 2.0f);
|
|
||||||
} else {
|
|
||||||
Actor_SetScale(&this->actor, 0.1f);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
|
Actor_SetScale(thisx, 0.02f);
|
||||||
this->colorIdx = (s16)Rand_ZeroFloat(3.99f) + 1;
|
this->colorIdx = (s16)Rand_ZeroFloat(3.99f) + 1;
|
||||||
if (CVarGetInteger("gNewDrops", 0) !=0) {
|
|
||||||
Actor_SetScale(thisx, 0.4f);
|
|
||||||
} else {
|
|
||||||
Actor_SetScale(thisx, 0.02f);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
this->actor.gravity = -3.0f;
|
this->actor.gravity = -3.0f;
|
||||||
// "Wow Coin"
|
// "Wow Coin"
|
||||||
osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ わーなーコイン ☆☆☆☆☆ \n" VT_RST);
|
osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ わーなーコイン ☆☆☆☆☆ \n" VT_RST);
|
||||||
if (CVarGetInteger("gNewDrops", 0) !=0) {
|
this->actor.shape.shadowScale = 6.0f;
|
||||||
this->actor.shape.shadowScale = 0.3f;
|
this->actor.shape.yOffset = 700.0f;
|
||||||
this->actor.shape.yOffset = 35.0f;
|
|
||||||
} else {
|
|
||||||
this->actor.shape.shadowScale = 6.0f;
|
|
||||||
this->actor.shape.yOffset = 700.0f;
|
|
||||||
}
|
|
||||||
this->actor.flags &= ~ACTOR_FLAG_TARGETABLE;
|
this->actor.flags &= ~ACTOR_FLAG_TARGETABLE;
|
||||||
this->actionFunc = EnExRuppy_WaitToBlowUp;
|
this->actionFunc = EnExRuppy_WaitToBlowUp;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 3: // Spawned by the guard in Hyrule courtyard
|
case 3: // Spawned by the guard in Hyrule courtyard
|
||||||
if (CVarGetInteger("gNewDrops", 0) !=0) {
|
Actor_SetScale(&this->actor, 0.02f);
|
||||||
Actor_SetScale(&this->actor, 0.4f);
|
|
||||||
} else {
|
|
||||||
Actor_SetScale(&this->actor, 0.02f);
|
|
||||||
}
|
|
||||||
this->colorIdx = 0;
|
this->colorIdx = 0;
|
||||||
switch ((s16)Rand_ZeroFloat(30.99f)) {
|
switch ((s16)Rand_ZeroFloat(30.99f)) {
|
||||||
case 0:
|
case 0:
|
||||||
@ -170,13 +144,8 @@ void EnExRuppy_Init(Actor* thisx, PlayState* play) {
|
|||||||
this->actor.gravity = -3.0f;
|
this->actor.gravity = -3.0f;
|
||||||
// "Normal rupee"
|
// "Normal rupee"
|
||||||
osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ ノーマルルピー ☆☆☆☆☆ \n" VT_RST);
|
osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ ノーマルルピー ☆☆☆☆☆ \n" VT_RST);
|
||||||
if (CVarGetInteger("gNewDrops", 0) !=0) {
|
this->actor.shape.shadowScale = 6.0f;
|
||||||
this->actor.shape.shadowScale = 0.3f;
|
this->actor.shape.yOffset = 700.0f;
|
||||||
this->actor.shape.yOffset = 35.0f;
|
|
||||||
} else {
|
|
||||||
this->actor.shape.yOffset = 700.0f;
|
|
||||||
this->actor.shape.shadowScale = 6.0f;
|
|
||||||
}
|
|
||||||
this->actor.flags &= ~ACTOR_FLAG_TARGETABLE;
|
this->actor.flags &= ~ACTOR_FLAG_TARGETABLE;
|
||||||
this->actionFunc = EnExRuppy_WaitAsCollectible;
|
this->actionFunc = EnExRuppy_WaitAsCollectible;
|
||||||
break;
|
break;
|
||||||
@ -184,16 +153,9 @@ void EnExRuppy_Init(Actor* thisx, PlayState* play) {
|
|||||||
case 4: // Progress markers in the shooting gallery
|
case 4: // Progress markers in the shooting gallery
|
||||||
this->actor.gravity = -3.0f;
|
this->actor.gravity = -3.0f;
|
||||||
this->actor.flags &= ~ACTOR_FLAG_TARGETABLE;
|
this->actor.flags &= ~ACTOR_FLAG_TARGETABLE;
|
||||||
if (CVarGetInteger("gNewDrops", 0) !=0) {
|
Actor_SetScale(&this->actor, 0.01f);
|
||||||
Actor_SetScale(&this->actor, 0.3f);
|
this->actor.shape.shadowScale = 6.0f;
|
||||||
this->actor.shape.shadowScale = 0.3f;
|
this->actor.shape.yOffset = -700.0f;
|
||||||
this->actor.shape.yOffset = -1365.0f;
|
|
||||||
} else {
|
|
||||||
Actor_SetScale(&this->actor, 0.01f);
|
|
||||||
this->actor.shape.shadowScale = 6.0f;
|
|
||||||
this->actor.shape.yOffset = -700.0f;
|
|
||||||
}
|
|
||||||
|
|
||||||
this->actionFunc = EnExRuppy_GalleryTarget;
|
this->actionFunc = EnExRuppy_GalleryTarget;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -393,18 +355,10 @@ void EnExRuppy_WaitAsCollectible(EnExRuppy* this, PlayState* play) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void EnExRuppy_GalleryTarget(EnExRuppy* this, PlayState* play) {
|
void EnExRuppy_GalleryTarget(EnExRuppy* this, PlayState* play) {
|
||||||
if (CVarGetInteger("gNewDrops", 0) !=0) {
|
if (this->galleryFlag) {
|
||||||
if (this->galleryFlag) {
|
Math_ApproachF(&this->actor.shape.yOffset, 700.0f, 0.5f, 200.0f);
|
||||||
Math_ApproachF(&this->actor.shape.yOffset, 35.0f, 0.5f, 200.0f);
|
|
||||||
} else {
|
|
||||||
Math_ApproachF(&this->actor.shape.yOffset, -1365.0f, 0.5f, 200.0f);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (this->galleryFlag) {
|
Math_ApproachF(&this->actor.shape.yOffset, -700.0f, 0.5f, 200.0f);
|
||||||
Math_ApproachF(&this->actor.shape.yOffset, 700.0f, 0.5f, 200.0f);
|
|
||||||
} else {
|
|
||||||
Math_ApproachF(&this->actor.shape.yOffset, -700.0f, 0.5f, 200.0f);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -424,8 +378,9 @@ void EnExRuppy_Draw(Actor* thisx, PlayState* play) {
|
|||||||
static void* rupeeTextures[] = {
|
static void* rupeeTextures[] = {
|
||||||
gRupeeGreenTex, gRupeeBlueTex, gRupeeRedTex, gRupeePinkTex, gRupeeOrangeTex,
|
gRupeeGreenTex, gRupeeBlueTex, gRupeeRedTex, gRupeePinkTex, gRupeeOrangeTex,
|
||||||
};
|
};
|
||||||
|
// The pink/orange rupee textures are authentically reversed, so the GID models should be gold/purple respectively
|
||||||
static void* rupeeTexturesNew[] = {
|
static void* rupeeTexturesNew[] = {
|
||||||
GID_RUPEE_GREEN, GID_RUPEE_BLUE, GID_RUPEE_RED, GID_RUPEE_PURPLE, GID_RUPEE_GOLD,
|
GID_RUPEE_GREEN, GID_RUPEE_BLUE, GID_RUPEE_RED, GID_RUPEE_GOLD, GID_RUPEE_PURPLE,
|
||||||
};
|
};
|
||||||
s32 pad;
|
s32 pad;
|
||||||
EnExRuppy* this = (EnExRuppy*)thisx;
|
EnExRuppy* this = (EnExRuppy*)thisx;
|
||||||
@ -433,19 +388,51 @@ void EnExRuppy_Draw(Actor* thisx, PlayState* play) {
|
|||||||
if (!this->invisible) {
|
if (!this->invisible) {
|
||||||
OPEN_DISPS(play->state.gfxCtx);
|
OPEN_DISPS(play->state.gfxCtx);
|
||||||
|
|
||||||
Gfx_SetupDL_25Opa(play->state.gfxCtx);
|
if (CVarGetInteger("gNewDrops", 0)) {
|
||||||
func_8002EBCC(thisx, play, 0);
|
// purple/gold rupees need less scaling
|
||||||
gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
f32 mtxScale = this->colorIdx >= 3 ? 17.5f : 25.0f;
|
||||||
if (CVarGetInteger("gNewDrops", 0) !=0) {
|
Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY);
|
||||||
if (this->type == 4 && this->colorIdx >= 3) {
|
|
||||||
//For some reason the red rupee target become purple.
|
|
||||||
//when using new drops it will show as Gold and that wrong it need to be red.
|
|
||||||
this->colorIdx = 2;
|
|
||||||
}
|
|
||||||
GetItem_Draw(play, rupeeTexturesNew[this->colorIdx]);
|
GetItem_Draw(play, rupeeTexturesNew[this->colorIdx]);
|
||||||
} else {
|
} else {
|
||||||
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(rupeeTextures[this->colorIdx]));
|
Color_RGB8 rupeeColor;
|
||||||
gSPDisplayList(POLY_OPA_DISP++, gRupeeDL);
|
u8 shouldColor = 0;
|
||||||
|
switch (this->colorIdx) {
|
||||||
|
case 0:
|
||||||
|
rupeeColor = CVarGetColor24("gCosmetics.Consumable_GreenRupee.Value", (Color_RGB8){ 255, 255, 255 });
|
||||||
|
shouldColor = CVarGetInteger("gCosmetics.Consumable_GreenRupee.Changed", 0);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
rupeeColor = CVarGetColor24("gCosmetics.Consumable_BlueRupee.Value", (Color_RGB8){ 255, 255, 255 });
|
||||||
|
shouldColor = CVarGetInteger("gCosmetics.Consumable_BlueRupee.Changed", 0);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
rupeeColor = CVarGetColor24("gCosmetics.Consumable_RedRupee.Value", (Color_RGB8){ 255, 255, 255 });
|
||||||
|
shouldColor = CVarGetInteger("gCosmetics.Consumable_RedRupee.Changed", 0);
|
||||||
|
break;
|
||||||
|
case 4: // orange rupee texture corresponds to the purple rupee (authentic bug)
|
||||||
|
rupeeColor = CVarGetColor24("gCosmetics.Consumable_PurpleRupee.Value", (Color_RGB8){ 255, 255, 255 });
|
||||||
|
shouldColor = CVarGetInteger("gCosmetics.Consumable_PurpleRupee.Changed", 0);
|
||||||
|
break;
|
||||||
|
case 3: // pink rupee texture corresponds to the gold rupee (authentic bug)
|
||||||
|
rupeeColor = CVarGetColor24("gCosmetics.Consumable_GoldRupee.Value", (Color_RGB8){ 255, 255, 255 });
|
||||||
|
shouldColor = CVarGetInteger("gCosmetics.Consumable_GoldRupee.Changed", 0);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
Gfx_SetupDL_25Opa(play->state.gfxCtx);
|
||||||
|
func_8002EBCC(thisx, play, 0);
|
||||||
|
gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||||
|
|
||||||
|
if (shouldColor) {
|
||||||
|
gDPSetGrayscaleColor(POLY_OPA_DISP++, rupeeColor.r, rupeeColor.g, rupeeColor.b, 255);
|
||||||
|
gSPGrayscale(POLY_OPA_DISP++, true);
|
||||||
|
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(rupeeTextures[this->colorIdx]));
|
||||||
|
gSPDisplayList(POLY_OPA_DISP++, gRupeeDL);
|
||||||
|
gSPGrayscale(POLY_OPA_DISP++, false);
|
||||||
|
} else {
|
||||||
|
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(rupeeTextures[this->colorIdx]));
|
||||||
|
gSPDisplayList(POLY_OPA_DISP++, gRupeeDL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CLOSE_DISPS(play->state.gfxCtx);
|
CLOSE_DISPS(play->state.gfxCtx);
|
||||||
|
@ -119,22 +119,11 @@ void EnGSwitch_Init(Actor* thisx, PlayState* play) {
|
|||||||
Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit);
|
Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit);
|
||||||
this->actor.draw = EnGSwitch_DrawRupee;
|
this->actor.draw = EnGSwitch_DrawRupee;
|
||||||
this->actor.shape.yOffset = 700.0f;
|
this->actor.shape.yOffset = 700.0f;
|
||||||
|
|
||||||
if (CVarGetInteger("gNewDrops", 0) !=0) {
|
|
||||||
this->actor.shape.yOffset = 35.0f;
|
|
||||||
} else {
|
|
||||||
this->actor.shape.yOffset = 700.0f;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Flags_GetSwitch(play, this->switchFlag)) {
|
if (Flags_GetSwitch(play, this->switchFlag)) {
|
||||||
osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ You are Shock! ☆☆☆☆☆ %d\n" VT_RST, this->switchFlag);
|
osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ You are Shock! ☆☆☆☆☆ %d\n" VT_RST, this->switchFlag);
|
||||||
Actor_Kill(&this->actor);
|
Actor_Kill(&this->actor);
|
||||||
} else {
|
} else {
|
||||||
if (CVarGetInteger("gNewDrops", 0) !=0) {
|
Actor_SetScale(&this->actor, 0.03f);
|
||||||
Actor_SetScale(&this->actor, 0.6f);
|
|
||||||
} else {
|
|
||||||
Actor_SetScale(&this->actor, 0.03f);
|
|
||||||
}
|
|
||||||
this->actionFunc = EnGSwitch_SilverRupeeIdle;
|
this->actionFunc = EnGSwitch_SilverRupeeIdle;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -165,14 +154,8 @@ void EnGSwitch_Init(Actor* thisx, PlayState* play) {
|
|||||||
this->actionFunc = EnGSwitch_WaitForObject;
|
this->actionFunc = EnGSwitch_WaitForObject;
|
||||||
break;
|
break;
|
||||||
case ENGSWITCH_TARGET_RUPEE:
|
case ENGSWITCH_TARGET_RUPEE:
|
||||||
if (CVarGetInteger("gNewDrops", 0) !=0) {
|
this->actor.shape.yOffset = 700.0f;
|
||||||
this->actor.shape.yOffset = 35.0f;
|
Actor_SetScale(&this->actor, 0.05f);
|
||||||
Actor_SetScale(&this->actor, 0.9f);
|
|
||||||
} else {
|
|
||||||
this->actor.shape.yOffset = 700.0f;
|
|
||||||
Actor_SetScale(&this->actor, 0.05f);
|
|
||||||
}
|
|
||||||
|
|
||||||
Collider_InitCylinder(play, &this->collider);
|
Collider_InitCylinder(play, &this->collider);
|
||||||
Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit);
|
Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit);
|
||||||
this->actor.draw = EnGSwitch_DrawRupee;
|
this->actor.draw = EnGSwitch_DrawRupee;
|
||||||
@ -486,8 +469,9 @@ void EnGSwitch_DrawPot(Actor* thisx, PlayState* play) {
|
|||||||
static void* sRupeeTextures[] = {
|
static void* sRupeeTextures[] = {
|
||||||
gRupeeGreenTex, gRupeeBlueTex, gRupeeRedTex, gRupeePinkTex, gRupeeOrangeTex, gRupeeSilverTex,
|
gRupeeGreenTex, gRupeeBlueTex, gRupeeRedTex, gRupeePinkTex, gRupeeOrangeTex, gRupeeSilverTex,
|
||||||
};
|
};
|
||||||
|
// The pink/orange rupee textures are authentically reversed, so the GID models should be gold/purple respectively
|
||||||
static void* sRupeeTexturesNew[] = {
|
static void* sRupeeTexturesNew[] = {
|
||||||
GID_RUPEE_GREEN, GID_RUPEE_BLUE, GID_RUPEE_RED, GID_RUPEE_PURPLE, GID_RUPEE_GOLD,
|
GID_RUPEE_GREEN, GID_RUPEE_BLUE, GID_RUPEE_RED, GID_RUPEE_GOLD, GID_RUPEE_PURPLE,
|
||||||
};
|
};
|
||||||
void EnGSwitch_DrawRupee(Actor* thisx, PlayState* play) {
|
void EnGSwitch_DrawRupee(Actor* thisx, PlayState* play) {
|
||||||
s32 pad;
|
s32 pad;
|
||||||
@ -495,11 +479,12 @@ void EnGSwitch_DrawRupee(Actor* thisx, PlayState* play) {
|
|||||||
|
|
||||||
if (!this->broken) {
|
if (!this->broken) {
|
||||||
OPEN_DISPS(play->state.gfxCtx);
|
OPEN_DISPS(play->state.gfxCtx);
|
||||||
Gfx_SetupDL_25Opa(play->state.gfxCtx);
|
|
||||||
func_8002EBCC(&this->actor, play, 0);
|
if (CVarGetInteger("gNewDrops", 0)) {
|
||||||
gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
// purple/gold/silver rupees need less scaling
|
||||||
if (CVarGetInteger("gNewDrops", 0) !=0) {
|
f32 mtxScale = this->colorIdx >= 3 ? 17.5f : 25.0f;
|
||||||
gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(play->state.gfxCtx), G_MTX_MODELVIEW | G_MTX_LOAD);
|
Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY);
|
||||||
|
|
||||||
if (this->type == ENGSWITCH_TARGET_RUPEE) {
|
if (this->type == ENGSWITCH_TARGET_RUPEE) {
|
||||||
GetItem_Draw(play, sRupeeTexturesNew[this->colorIdx]);
|
GetItem_Draw(play, sRupeeTexturesNew[this->colorIdx]);
|
||||||
} else {
|
} else {
|
||||||
@ -533,11 +518,11 @@ void EnGSwitch_DrawRupee(Actor* thisx, PlayState* play) {
|
|||||||
rupeeColor = CVarGetColor24("gCosmetics.Consumable_RedRupee.Value", (Color_RGB8){ 255, 255, 255 });
|
rupeeColor = CVarGetColor24("gCosmetics.Consumable_RedRupee.Value", (Color_RGB8){ 255, 255, 255 });
|
||||||
shouldColor = CVarGetInteger("gCosmetics.Consumable_RedRupee.Changed", 0);
|
shouldColor = CVarGetInteger("gCosmetics.Consumable_RedRupee.Changed", 0);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 4: // orange rupee texture corresponds to the purple rupee (authentic bug)
|
||||||
rupeeColor = CVarGetColor24("gCosmetics.Consumable_PurpleRupee.Value", (Color_RGB8){ 255, 255, 255 });
|
rupeeColor = CVarGetColor24("gCosmetics.Consumable_PurpleRupee.Value", (Color_RGB8){ 255, 255, 255 });
|
||||||
shouldColor = CVarGetInteger("gCosmetics.Consumable_PurpleRupee.Changed", 0);
|
shouldColor = CVarGetInteger("gCosmetics.Consumable_PurpleRupee.Changed", 0);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 3: // pink rupee texture corresponds to the gold rupee (authentic bug)
|
||||||
rupeeColor = CVarGetColor24("gCosmetics.Consumable_GoldRupee.Value", (Color_RGB8){ 255, 255, 255 });
|
rupeeColor = CVarGetColor24("gCosmetics.Consumable_GoldRupee.Value", (Color_RGB8){ 255, 255, 255 });
|
||||||
shouldColor = CVarGetInteger("gCosmetics.Consumable_GoldRupee.Changed", 0);
|
shouldColor = CVarGetInteger("gCosmetics.Consumable_GoldRupee.Changed", 0);
|
||||||
break;
|
break;
|
||||||
@ -547,6 +532,10 @@ void EnGSwitch_DrawRupee(Actor* thisx, PlayState* play) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Gfx_SetupDL_25Opa(play->state.gfxCtx);
|
||||||
|
func_8002EBCC(&this->actor, play, 0);
|
||||||
|
gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||||
|
|
||||||
if (shouldColor) {
|
if (shouldColor) {
|
||||||
gDPSetGrayscaleColor(POLY_OPA_DISP++, rupeeColor.r, rupeeColor.g, rupeeColor.b, 255);
|
gDPSetGrayscaleColor(POLY_OPA_DISP++, rupeeColor.r, rupeeColor.g, rupeeColor.b, 255);
|
||||||
gSPGrayscale(POLY_OPA_DISP++, true);
|
gSPGrayscale(POLY_OPA_DISP++, true);
|
||||||
|
Loading…
Reference in New Issue
Block a user