3D Drops & Projectiles update (#548)

* Fix remaining rupee and keys

* fix tabs -> spaces

* more fix about tabs -> spaces

* Better up <-> down mouvement for hearts

* remove useless comment
This commit is contained in:
Baoulettes 2022-07-06 02:46:21 +02:00 committed by GitHub
parent 1ad2931f80
commit 2fbdd056ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 161 additions and 40 deletions

View File

@ -389,15 +389,31 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
break;
case ITEM00_SMALL_KEY:
this->unk_158 = 0;
Actor_SetScale(&this->actor, 0.03f);
this->scale = 0.03f;
yOffset = 350.0f;
if (CVar_GetS32("gNewDrops", 0) !=0) {
Actor_SetScale(&this->actor, 0.3f);
this->scale = 0.3f;
yOffset = 50.0f;
shadowScale = 0.5f;
this->actor.world.rot.x = 0x4000;
} else {
Actor_SetScale(&this->actor, 0.03f);
this->scale = 0.03f;
yOffset = 350.0f;
}
break;
case ITEM00_HEART_PIECE:
this->unk_158 = 0;
yOffset = 650.0f;
Actor_SetScale(&this->actor, 0.02f);
this->scale = 0.02f;
if (CVar_GetS32("gNewDrops", 0) !=0) {
Actor_SetScale(&this->actor, 0.5f);
this->scale = 0.5f;
yOffset = 50.0f;
shadowScale = 0.5f;
this->actor.world.rot.x = 0x4000;
} else {
yOffset = 650.0f;
Actor_SetScale(&this->actor, 0.02f);
this->scale = 0.02f;
}
break;
case ITEM00_HEART:
if (CVar_GetS32("gNewDrops", 0) !=0) {
@ -711,7 +727,7 @@ void func_8001DFC8(EnItem00* this, GlobalContext* globalCtx) {
(this->actor.params == ITEM00_ARROWS_MEDIUM) || (this->actor.params == ITEM00_ARROWS_LARGE) ||
(this->actor.params == ITEM00_BOMBS_A) || (this->actor.params == ITEM00_BOMBS_B) ||
(this->actor.params == ITEM00_NUTS) || (this->actor.params == ITEM00_STICK) ||
(this->actor.params == ITEM00_MAGIC_SMALL) || (this->actor.params == ITEM00_SEEDS) ||
(this->actor.params == ITEM00_MAGIC_SMALL) || (this->actor.params == ITEM00_SEEDS) || (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.shape.rot.y = DroppedItemRot;
}
@ -738,7 +754,11 @@ void func_8001DFC8(EnItem00* this, GlobalContext* globalCtx) {
}
if (this->actor.params == ITEM00_HEART_PIECE) {
this->actor.shape.yOffset = Math_SinS(this->actor.shape.rot.y) * 150.0f + 850.0f;
if (CVar_GetS32("gNewDrops", 0) !=0) {
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;
}
}
Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 0.5f, 0.0f);
@ -891,7 +911,7 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) {
s32 pad;
if (CVar_GetS32("gNewDrops", 0) !=0) { //Update 3D Model rotation on frame update :)
DroppedItemRot += 100;
DroppedItemRot += 250;
}
if (this->unk_15A > 0) {
@ -1131,7 +1151,11 @@ void EnItem00_Draw(Actor* thisx, GlobalContext* globalCtx) {
}
break;
case ITEM00_HEART_PIECE:
EnItem00_DrawHeartPiece(this, globalCtx);
if (CVar_GetS32("gNewDrops", 0) !=0) {
GetItem_Draw(globalCtx, GID_HEART_PIECE);
} else {
EnItem00_DrawHeartPiece(this, globalCtx);
}
break;
case ITEM00_HEART_CONTAINER:
EnItem00_DrawHeartContainer(this, globalCtx);
@ -1217,7 +1241,11 @@ void EnItem00_Draw(Actor* thisx, GlobalContext* globalCtx) {
break;
}
case ITEM00_SMALL_KEY:
EnItem00_DrawCollectible(this, globalCtx);
if (CVar_GetS32("gNewDrops", 0) !=0) {
GetItem_Draw(globalCtx, GID_KEY_SMALL);
} else {
EnItem00_DrawCollectible(this, globalCtx);
}
break;
case ITEM00_SHIELD_DEKU:
GetItem_Draw(globalCtx, GID_SHIELD_DEKU);

View File

@ -55,7 +55,12 @@ void EnExRuppy_Init(Actor* thisx, GlobalContext* globalCtx) {
switch (this->type) {
case 0:
this->unk_160 = 0.01f;
if (CVar_GetS32("gNewDrops", 0) !=0) {
this->unk_160 = 0.3f;
} else {
this->unk_160 = 0.01f;
}
Actor_SetScale(&this->actor, this->unk_160);
this->actor.room = -1;
this->actor.gravity = 0.0f;
@ -100,9 +105,13 @@ void EnExRuppy_Init(Actor* thisx, GlobalContext* globalCtx) {
}
}
}
this->actor.shape.shadowScale = 7.0f;
this->actor.shape.yOffset = 700.0f;
if (CVar_GetS32("gNewDrops", 0) !=0) {
this->actor.shape.shadowScale = 0.3f;
this->actor.shape.yOffset = 35.0f;
} else {
this->actor.shape.shadowScale = 7.0f;
this->actor.shape.yOffset = 700.0f;
}
this->unk_15A = this->actor.world.rot.z;
this->actor.world.rot.z = 0;
this->timer = 30;
@ -113,23 +122,40 @@ void EnExRuppy_Init(Actor* thisx, GlobalContext* globalCtx) {
case 1:
case 2: // Giant pink ruppe that explodes when you touch it
if (this->type == 1) {
Actor_SetScale(&this->actor, 0.1f);
this->colorIdx = 4;
if (CVar_GetS32("gNewDrops", 0) !=0) {
Actor_SetScale(&this->actor, 2.0f);
} else {
Actor_SetScale(&this->actor, 0.1f);
}
} else {
Actor_SetScale(thisx, 0.02f);
this->colorIdx = (s16)Rand_ZeroFloat(3.99f) + 1;
if (CVar_GetS32("gNewDrops", 0) !=0) {
Actor_SetScale(thisx, 0.4f);
} else {
Actor_SetScale(thisx, 0.02f);
}
}
this->actor.gravity = -3.0f;
// "Wow Coin"
osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ わーなーコイン ☆☆☆☆☆ \n" VT_RST);
this->actor.shape.shadowScale = 6.0f;
this->actor.shape.yOffset = 700.0f;
if (CVar_GetS32("gNewDrops", 0) !=0) {
this->actor.shape.shadowScale = 0.3f;
this->actor.shape.yOffset = 35.0f;
} else {
this->actor.shape.shadowScale = 6.0f;
this->actor.shape.yOffset = 700.0f;
}
this->actor.flags &= ~ACTOR_FLAG_0;
this->actionFunc = EnExRuppy_WaitToBlowUp;
break;
case 3: // Spawned by the guard in Hyrule courtyard
Actor_SetScale(&this->actor, 0.02f);
if (CVar_GetS32("gNewDrops", 0) !=0) {
Actor_SetScale(&this->actor, 0.4f);
} else {
Actor_SetScale(&this->actor, 0.02f);
}
this->colorIdx = 0;
switch ((s16)Rand_ZeroFloat(30.99f)) {
case 0:
@ -144,8 +170,13 @@ void EnExRuppy_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actor.gravity = -3.0f;
// "Normal rupee"
osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ ノーマルルピー ☆☆☆☆☆ \n" VT_RST);
this->actor.shape.shadowScale = 6.0f;
this->actor.shape.yOffset = 700.0f;
if (CVar_GetS32("gNewDrops", 0) !=0) {
this->actor.shape.shadowScale = 0.3f;
this->actor.shape.yOffset = 35.0f;
} else {
this->actor.shape.yOffset = 700.0f;
this->actor.shape.shadowScale = 6.0f;
}
this->actor.flags &= ~ACTOR_FLAG_0;
this->actionFunc = EnExRuppy_WaitAsCollectible;
break;
@ -153,9 +184,16 @@ void EnExRuppy_Init(Actor* thisx, GlobalContext* globalCtx) {
case 4: // Progress markers in the shooting gallery
this->actor.gravity = -3.0f;
this->actor.flags &= ~ACTOR_FLAG_0;
Actor_SetScale(&this->actor, 0.01f);
this->actor.shape.shadowScale = 6.0f;
this->actor.shape.yOffset = -700.0f;
if (CVar_GetS32("gNewDrops", 0) !=0) {
Actor_SetScale(&this->actor, 0.3f);
this->actor.shape.shadowScale = 0.3f;
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;
break;
}
@ -355,10 +393,18 @@ void EnExRuppy_WaitAsCollectible(EnExRuppy* this, GlobalContext* globalCtx) {
}
void EnExRuppy_GalleryTarget(EnExRuppy* this, GlobalContext* globalCtx) {
if (this->galleryFlag) {
Math_ApproachF(&this->actor.shape.yOffset, 700.0f, 0.5f, 200.0f);
if (CVar_GetS32("gNewDrops", 0) !=0) {
if (this->galleryFlag) {
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 {
Math_ApproachF(&this->actor.shape.yOffset, -700.0f, 0.5f, 200.0f);
if (this->galleryFlag) {
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);
}
}
}
@ -378,6 +424,9 @@ void EnExRuppy_Draw(Actor* thisx, GlobalContext* globalCtx) {
static void* rupeeTextures[] = {
gRupeeGreenTex, gRupeeBlueTex, gRupeeRedTex, gRupeePinkTex, gRupeeOrangeTex,
};
static void* rupeeTexturesNew[] = {
GID_RUPEE_GREEN, GID_RUPEE_BLUE, GID_RUPEE_RED, GID_RUPEE_PURPLE, GID_RUPEE_GOLD,
};
s32 pad;
EnExRuppy* this = (EnExRuppy*)thisx;
@ -386,10 +435,18 @@ void EnExRuppy_Draw(Actor* thisx, GlobalContext* globalCtx) {
func_80093D18(globalCtx->state.gfxCtx);
func_8002EBCC(thisx, globalCtx, 0);
gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(globalCtx->state.gfxCtx),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(rupeeTextures[this->colorIdx]));
gSPDisplayList(POLY_OPA_DISP++, gRupeeDL);
gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
if (CVar_GetS32("gNewDrops", 0) !=0) {
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(globalCtx, rupeeTexturesNew[this->colorIdx]);
} else {
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(rupeeTextures[this->colorIdx]));
gSPDisplayList(POLY_OPA_DISP++, gRupeeDL);
}
CLOSE_DISPS(globalCtx->state.gfxCtx);
}

View File

@ -11,6 +11,7 @@
#include "overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.h"
#include "objects/gameplay_keep/gameplay_keep.h"
#include "objects/object_tsubo/object_tsubo.h"
#include "objects/object_gi_rupy/object_gi_rupy.h"
#define FLAGS (ACTOR_FLAG_4 | ACTOR_FLAG_5)
@ -117,11 +118,22 @@ void EnGSwitch_Init(Actor* thisx, GlobalContext* globalCtx) {
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
this->actor.draw = EnGSwitch_DrawRupee;
this->actor.shape.yOffset = 700.0f;
if (CVar_GetS32("gNewDrops", 0) !=0) {
this->actor.shape.yOffset = 35.0f;
} else {
this->actor.shape.yOffset = 700.0f;
}
if (Flags_GetSwitch(globalCtx, this->switchFlag)) {
osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ ☆☆☆☆☆ %d\n" VT_RST, this->switchFlag);
Actor_Kill(&this->actor);
} else {
Actor_SetScale(&this->actor, 0.03f);
if (CVar_GetS32("gNewDrops", 0) !=0) {
Actor_SetScale(&this->actor, 0.6f);
} else {
Actor_SetScale(&this->actor, 0.03f);
}
this->actionFunc = EnGSwitch_SilverRupeeIdle;
}
break;
@ -152,8 +164,14 @@ void EnGSwitch_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actionFunc = EnGSwitch_WaitForObject;
break;
case ENGSWITCH_TARGET_RUPEE:
this->actor.shape.yOffset = 700.0f;
Actor_SetScale(&this->actor, 0.05f);
if (CVar_GetS32("gNewDrops", 0) !=0) {
this->actor.shape.yOffset = 35.0f;
Actor_SetScale(&this->actor, 0.9f);
} else {
this->actor.shape.yOffset = 700.0f;
Actor_SetScale(&this->actor, 0.05f);
}
Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
this->actor.draw = EnGSwitch_DrawRupee;
@ -467,7 +485,9 @@ void EnGSwitch_DrawPot(Actor* thisx, GlobalContext* globalCtx) {
static void* sRupeeTextures[] = {
gRupeeGreenTex, gRupeeBlueTex, gRupeeRedTex, gRupeePinkTex, gRupeeOrangeTex, gRupeeSilverTex,
};
static void* sRupeeTexturesNew[] = {
GID_RUPEE_GREEN, GID_RUPEE_BLUE, GID_RUPEE_RED, GID_RUPEE_PURPLE, GID_RUPEE_GOLD,
};
void EnGSwitch_DrawRupee(Actor* thisx, GlobalContext* globalCtx) {
s32 pad;
EnGSwitch* this = (EnGSwitch*)thisx;
@ -476,10 +496,26 @@ void EnGSwitch_DrawRupee(Actor* thisx, GlobalContext* globalCtx) {
OPEN_DISPS(globalCtx->state.gfxCtx);
func_80093D18(globalCtx->state.gfxCtx);
func_8002EBCC(&this->actor, globalCtx, 0);
gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(globalCtx->state.gfxCtx),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sRupeeTextures[this->colorIdx]));
gSPDisplayList(POLY_OPA_DISP++, gRupeeDL);
gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
if (CVar_GetS32("gNewDrops", 0) !=0) {
gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(globalCtx->state.gfxCtx), G_MTX_MODELVIEW | G_MTX_LOAD);
if (this->type == ENGSWITCH_TARGET_RUPEE) {
GetItem_Draw(globalCtx, sRupeeTexturesNew[this->colorIdx]);
} else {
gsDPSetGrayscaleColor(POLY_OPA_DISP++, 255, 255, 255, 255);
gsSPGrayscale(POLY_OPA_DISP++, true);
func_80093D18(globalCtx->state.gfxCtx);
gSPDisplayList(POLY_OPA_DISP++, gGiRupeeInnerDL);
gSPDisplayList(POLY_OPA_DISP++, gGiGoldRupeeInnerColorDL);
func_80093D84(globalCtx->state.gfxCtx);
gSPDisplayList(POLY_OPA_DISP++, gGiRupeeOuterDL);
gSPDisplayList(POLY_OPA_DISP++, gGiGoldRupeeOuterColorDL);
gsSPGrayscale(POLY_OPA_DISP++, false);
}
} else {
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sRupeeTextures[this->colorIdx]));
gSPDisplayList(POLY_OPA_DISP++, gRupeeDL);
}
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
if (this->type == ENGSWITCH_TARGET_RUPEE) {