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

View file

@ -691,8 +691,8 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
break; break;
} }
if ((getItemId != GI_NONE) && !Actor_HasParent(&this->actor, globalCtx)) { if ((gSaveContext.n64ddFlag || getItemId != GI_NONE) && !Actor_HasParent(&this->actor, globalCtx)) {
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); 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)) || 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; this->actor.shape.rot.y += 960;
} else { } else {
if ((this->actor.params >= ITEM00_SHIELD_DEKU) && (this->actor.params != ITEM00_BOMBS_SPECIAL)) { 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; 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); Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 0.5f, 0.0f);
if (this->unk_154 == 0) { 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 ((getItemId != GI_NONE) && !Actor_HasParent(&this->actor, globalCtx)) {
if (gSaveContext.n64ddFlag) { 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); func_8002F554(&this->actor, globalCtx, getItemId);
} }
@ -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...). * Draw Function used for most collectible types of En_Item00 (ammo, bombs, sticks, nuts, magic...).
*/ */
void EnItem00_DrawCollectible(EnItem00* this, GlobalContext* globalCtx) { 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; s32 texIndex = this->actor.params - 3;
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_item00.c", 1594); OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_item00.c", 1594);
@ -1294,6 +1305,7 @@ void EnItem00_DrawCollectible(EnItem00* this, GlobalContext* globalCtx) {
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_en_item00.c", 1611); CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_en_item00.c", 1611);
} }
}
/** /**
* Draw Function used for the Heart Container type of En_Item00. * Draw Function used for the Heart Container type of En_Item00.