freestanding keys done + bombchu 5 fix

This commit is contained in:
MelonSpeedruns 2022-05-31 20:27:02 -04:00
commit b4dc22dd07
2 changed files with 300 additions and 280 deletions

View file

@ -1238,6 +1238,8 @@ GetItemID Randomizer::GetItemFromGet(RandomizerGet randoGet, GetItemID ogItemId)
return GI_SWORD_KOKIRI;
case DEKU_SHIELD:
return GI_SHIELD_DEKU;
case BOMBCHUS_5:
return GI_BOMBCHUS_5;
case BOMBCHUS_20:
return GI_BOMBCHUS_20;
case ICE_TRAP:
@ -1752,6 +1754,8 @@ RandomizerCheck Randomizer::GetCheckFromActor(s16 sceneNum, s16 actorId, s16 act
}
case 8:
switch(actorParams) {
case 273:
return BOTTOM_OF_THE_WELL_FREESTANDING_KEY;
case 22600:
return BOTTOM_OF_THE_WELL_FRONT_LEFT_FAKE_WALL_CHEST;
case 20578:
@ -1864,6 +1868,8 @@ RandomizerCheck Randomizer::GetCheckFromActor(s16 sceneNum, s16 actorId, s16 act
}
case 7:
switch(actorParams) {
case 273:
return SHADOW_TEMPLE_FREESTANDING_KEY;
case 6177:
return SHADOW_TEMPLE_MAP_CHEST;
case 5607:
@ -1956,6 +1962,8 @@ RandomizerCheck Randomizer::GetCheckFromActor(s16 sceneNum, s16 actorId, s16 act
}
case 11:
switch(actorParams) {
case 273:
return GERUDO_TRAINING_GROUND_FREESTANDING_KEY;
case -30573:
return GERUDO_TRAINING_GROUND_LOBBY_LEFT_CHEST;
case -30393:

View file

@ -360,7 +360,7 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
switch (this->actor.params) {
case ITEM00_RUPEE_GREEN:
if (CVar_GetS32("gNewDrops", 0) !=0) {
if (CVar_GetS32("gNewDrops", 0) != 0) {
Actor_SetScale(&this->actor, 0.3f);
this->scale = 0.3f;
yOffset = 50.0f;
@ -369,7 +369,7 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
break;
}
case ITEM00_RUPEE_BLUE:
if (CVar_GetS32("gNewDrops", 0) !=0) {
if (CVar_GetS32("gNewDrops", 0) != 0) {
Actor_SetScale(&this->actor, 0.3f);
this->scale = 0.3f;
yOffset = 50.0f;
@ -377,7 +377,7 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actor.world.rot.x = 0x4000;
}
case ITEM00_RUPEE_RED:
if (CVar_GetS32("gNewDrops", 0) !=0) {
if (CVar_GetS32("gNewDrops", 0) != 0) {
Actor_SetScale(&this->actor, 0.3f);
this->scale = 0.3f;
yOffset = 50.0f;
@ -402,7 +402,7 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
this->scale = 0.02f;
break;
case ITEM00_HEART:
if (CVar_GetS32("gNewDrops", 0) !=0) {
if (CVar_GetS32("gNewDrops", 0) != 0) {
this->actor.home.rot.z = Rand_CenteredFloat(65535.0f);
yOffset = 25.0f;
Actor_SetScale(&this->actor, 0.3f);
@ -422,7 +422,7 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
this->scale = 0.02f;
break;
case ITEM00_ARROWS_SINGLE:
if (CVar_GetS32("gNewDrops", 0) !=0) {
if (CVar_GetS32("gNewDrops", 0) != 0) {
Actor_SetScale(&this->actor, 0.2f);
this->scale = 0.2f;
yOffset = 50.0f;
@ -435,7 +435,7 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
}
break;
case ITEM00_ARROWS_SMALL:
if (CVar_GetS32("gNewDrops", 0) !=0) {
if (CVar_GetS32("gNewDrops", 0) != 0) {
Actor_SetScale(&this->actor, 0.2f);
this->scale = 0.2f;
yOffset = 50.0f;
@ -444,7 +444,7 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
break;
}
case ITEM00_ARROWS_MEDIUM:
if (CVar_GetS32("gNewDrops", 0) !=0) {
if (CVar_GetS32("gNewDrops", 0) != 0) {
Actor_SetScale(&this->actor, 0.2f);
this->scale = 0.2f;
yOffset = 50.0f;
@ -453,7 +453,7 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
break;
}
case ITEM00_ARROWS_LARGE:
if (CVar_GetS32("gNewDrops", 0) !=0) {
if (CVar_GetS32("gNewDrops", 0) != 0) {
Actor_SetScale(&this->actor, 0.2f);
this->scale = 0.2f;
yOffset = 50.0f;
@ -466,7 +466,7 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
}
break;
case ITEM00_BOMBS_A:
if (CVar_GetS32("gNewDrops", 0) !=0) {
if (CVar_GetS32("gNewDrops", 0) != 0) {
Actor_SetScale(&this->actor, 0.2f);
this->scale = 0.2f;
yOffset = 50.0f;
@ -475,7 +475,7 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
break;
}
case ITEM00_BOMBS_B:
if (CVar_GetS32("gNewDrops", 0) !=0) {
if (CVar_GetS32("gNewDrops", 0) != 0) {
Actor_SetScale(&this->actor, 0.2f);
this->scale = 0.2f;
yOffset = 50.0f;
@ -484,7 +484,7 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
break;
}
case ITEM00_NUTS:
if (CVar_GetS32("gNewDrops", 0) !=0) {
if (CVar_GetS32("gNewDrops", 0) != 0) {
Actor_SetScale(&this->actor, 0.2f);
this->scale = 0.2f;
yOffset = 50.0f;
@ -493,7 +493,7 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
break;
}
case ITEM00_STICK:
if (CVar_GetS32("gNewDrops", 0) !=0) {
if (CVar_GetS32("gNewDrops", 0) != 0) {
Actor_SetScale(&this->actor, 0.2f);
this->scale = 0.2f;
yOffset = 50.0f;
@ -502,7 +502,7 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
break;
}
case ITEM00_MAGIC_SMALL:
if (CVar_GetS32("gNewDrops", 0) !=0) {
if (CVar_GetS32("gNewDrops", 0) != 0) {
Actor_SetScale(&this->actor, 0.2f);
this->scale = 0.2f;
yOffset = 50.0f;
@ -511,7 +511,7 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
break;
}
case ITEM00_SEEDS:
if (CVar_GetS32("gNewDrops", 0) !=0) {
if (CVar_GetS32("gNewDrops", 0) != 0) {
Actor_SetScale(&this->actor, 0.2f);
this->scale = 0.2f;
yOffset = 50.0f;
@ -520,7 +520,7 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
break;
}
case ITEM00_BOMBS_SPECIAL:
if (CVar_GetS32("gNewDrops", 0) !=0) {
if (CVar_GetS32("gNewDrops", 0) != 0) {
Actor_SetScale(&this->actor, 0.2f);
this->scale = 0.2f;
yOffset = 50.0f;
@ -533,7 +533,7 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
}
break;
case ITEM00_MAGIC_LARGE:
if (CVar_GetS32("gNewDrops", 0) !=0) {
if (CVar_GetS32("gNewDrops", 0) != 0) {
Actor_SetScale(&this->actor, 0.2f);
this->scale = 0.2f;
yOffset = 50.0f;
@ -546,7 +546,7 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
}
break;
case ITEM00_RUPEE_ORANGE:
if (CVar_GetS32("gNewDrops", 0) !=0) {
if (CVar_GetS32("gNewDrops", 0) != 0) {
Actor_SetScale(&this->actor, 0.45f);
this->scale = 0.45f;
yOffset = 50.0f;
@ -559,7 +559,7 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
}
break;
case ITEM00_RUPEE_PURPLE:
if (CVar_GetS32("gNewDrops", 0) !=0) {
if (CVar_GetS32("gNewDrops", 0) != 0) {
Actor_SetScale(&this->actor, 0.4f);
this->scale = 0.4f;
yOffset = 50.0f;
@ -691,8 +691,8 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
break;
}
if ((getItemId != GI_NONE) && !Actor_HasParent(&this->actor, globalCtx)) {
getItemId = GetRandomizedItemId(this->getItemId, this->actor.id, this->ogParams, globalCtx->sceneNum);
if ((gSaveContext.n64ddFlag || getItemId != GI_NONE) && !Actor_HasParent(&this->actor, globalCtx)) {
getItemId = GetRandomizedItemId(getItemId, this->actor.id, this->ogParams, globalCtx->sceneNum);
func_8002F554(&this->actor, globalCtx, getItemId);
}
@ -721,7 +721,8 @@ void func_8001DFC8(EnItem00* this, GlobalContext* globalCtx) {
}
if ((this->actor.params <= ITEM00_RUPEE_RED) || ((this->actor.params == ITEM00_HEART) && (this->unk_15A < 0)) ||
(this->actor.params == ITEM00_HEART_PIECE)) {
(this->actor.params == ITEM00_HEART_PIECE) ||
(gSaveContext.n64ddFlag && this->actor.params == ITEM00_SMALL_KEY)) {
this->actor.shape.rot.y += 960;
} else {
if ((this->actor.params >= ITEM00_SHIELD_DEKU) && (this->actor.params != ITEM00_BOMBS_SPECIAL)) {
@ -744,6 +745,10 @@ void func_8001DFC8(EnItem00* this, GlobalContext* globalCtx) {
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;
}
Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 0.5f, 0.0f);
if (this->unk_154 == 0) {
@ -1053,7 +1058,7 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) {
if ((getItemId != GI_NONE) && !Actor_HasParent(&this->actor, globalCtx)) {
if (gSaveContext.n64ddFlag) {
getItemId = GetRandomizedItemId(this->getItemId, this->actor.id, this->ogParams, globalCtx->sceneNum);
getItemId = GetRandomizedItemId(getItemId, this->actor.id, this->ogParams, globalCtx->sceneNum);
}
func_8002F554(&this->actor, globalCtx, getItemId);
}
@ -1107,27 +1112,27 @@ void EnItem00_Draw(Actor* thisx, GlobalContext* globalCtx) {
if (!(this->unk_156 & this->unk_158)) {
switch (this->actor.params) {
case ITEM00_RUPEE_GREEN:
if (CVar_GetS32("gNewDrops", 0) !=0) {
if (CVar_GetS32("gNewDrops", 0) != 0) {
GetItem_Draw(globalCtx, GID_RUPEE_GREEN);
break;
}
case ITEM00_RUPEE_BLUE:
if (CVar_GetS32("gNewDrops", 0) !=0) {
if (CVar_GetS32("gNewDrops", 0) != 0) {
GetItem_Draw(globalCtx, GID_RUPEE_BLUE);
break;
}
case ITEM00_RUPEE_RED:
if (CVar_GetS32("gNewDrops", 0) !=0) {
if (CVar_GetS32("gNewDrops", 0) != 0) {
GetItem_Draw(globalCtx, GID_RUPEE_RED);
break;
}
case ITEM00_RUPEE_ORANGE:
if (CVar_GetS32("gNewDrops", 0) !=0) {
if (CVar_GetS32("gNewDrops", 0) != 0) {
GetItem_Draw(globalCtx, GID_RUPEE_GOLD);
break;
}
case ITEM00_RUPEE_PURPLE:
if (CVar_GetS32("gNewDrops", 0) !=0) {
if (CVar_GetS32("gNewDrops", 0) != 0) {
GetItem_Draw(globalCtx, GID_RUPEE_PURPLE);
} else {
EnItem00_DrawRupee(this, globalCtx);
@ -1140,7 +1145,7 @@ void EnItem00_Draw(Actor* thisx, GlobalContext* globalCtx) {
EnItem00_DrawHeartContainer(this, globalCtx);
break;
case ITEM00_HEART:
if (CVar_GetS32("gNewDrops", 0) !=0) {
if (CVar_GetS32("gNewDrops", 0) != 0) {
GetItem_Draw(globalCtx, GID_HEART);
mtxScale = 16.0f;
Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY);
@ -1164,58 +1169,58 @@ void EnItem00_Draw(Actor* thisx, GlobalContext* globalCtx) {
}
}
case ITEM00_BOMBS_A:
if (CVar_GetS32("gNewDrops", 0) !=0) {
if (CVar_GetS32("gNewDrops", 0) != 0) {
GetItem_Draw(globalCtx, GID_BOMB);
break;
}
case ITEM00_BOMBS_B:
if (CVar_GetS32("gNewDrops", 0) !=0) {
if (CVar_GetS32("gNewDrops", 0) != 0) {
GetItem_Draw(globalCtx, GID_BOMB);
break;
}
case ITEM00_BOMBS_SPECIAL:
case ITEM00_ARROWS_SINGLE:
if (CVar_GetS32("gNewDrops", 0) !=0) {
if (CVar_GetS32("gNewDrops", 0) != 0) {
GetItem_Draw(globalCtx, GID_ARROWS_SMALL);
break;
}
case ITEM00_ARROWS_SMALL:
if (CVar_GetS32("gNewDrops", 0) !=0) {
if (CVar_GetS32("gNewDrops", 0) != 0) {
GetItem_Draw(globalCtx, GID_ARROWS_SMALL);
break;
}
case ITEM00_ARROWS_MEDIUM:
if (CVar_GetS32("gNewDrops", 0) !=0) {
if (CVar_GetS32("gNewDrops", 0) != 0) {
GetItem_Draw(globalCtx, GID_ARROWS_MEDIUM);
break;
}
case ITEM00_ARROWS_LARGE:
if (CVar_GetS32("gNewDrops", 0) !=0) {
if (CVar_GetS32("gNewDrops", 0) != 0) {
GetItem_Draw(globalCtx, GID_ARROWS_LARGE);
break;
}
case ITEM00_NUTS:
if (CVar_GetS32("gNewDrops", 0) !=0) {
if (CVar_GetS32("gNewDrops", 0) != 0) {
GetItem_Draw(globalCtx, GID_NUTS);
break;
}
case ITEM00_STICK:
if (CVar_GetS32("gNewDrops", 0) !=0) {
if (CVar_GetS32("gNewDrops", 0) != 0) {
GetItem_Draw(globalCtx, GID_STICK);
break;
}
case ITEM00_MAGIC_LARGE:
if (CVar_GetS32("gNewDrops", 0) !=0) {
if (CVar_GetS32("gNewDrops", 0) != 0) {
GetItem_Draw(globalCtx, GID_MAGIC_LARGE);
break;
}
case ITEM00_MAGIC_SMALL:
if (CVar_GetS32("gNewDrops", 0) !=0) {
if (CVar_GetS32("gNewDrops", 0) != 0) {
GetItem_Draw(globalCtx, GID_MAGIC_SMALL);
break;
}
case ITEM00_SEEDS:
if (CVar_GetS32("gNewDrops", 0) !=0) {
if (CVar_GetS32("gNewDrops", 0) != 0) {
GetItem_Draw(globalCtx, GID_SEEDS);
break;
}
@ -1272,6 +1277,12 @@ void EnItem00_DrawRupee(EnItem00* this, GlobalContext* globalCtx) {
* Draw Function used for most collectible types of En_Item00 (ammo, bombs, sticks, nuts, magic...).
*/
void EnItem00_DrawCollectible(EnItem00* this, GlobalContext* globalCtx) {
if ((gSaveContext.n64ddFlag && this->getItemId != GI_NONE) || this->actor.params == ITEM00_SMALL_KEY) {
f32 mtxScale = 16.0f;
Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY);
GetItem_Draw(globalCtx, GetItemModelFromId(GetRandomizedItemId(this->getItemId, this->actor.id, this->ogParams,
globalCtx->sceneNum)));
} else {
s32 texIndex = this->actor.params - 3;
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_item00.c", 1594);
@ -1293,6 +1304,7 @@ void EnItem00_DrawCollectible(EnItem00* this, GlobalContext* globalCtx) {
gSPDisplayList(POLY_OPA_DISP++, gItemDropDL);
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_en_item00.c", 1611);
}
}
/**