Partially fixes Ice Traps

Obtaining a freestanding Ice Trap causes link to slide forward
and receiving one from an NPC plays the sound effect and damage
animation but doesn't freeze link.
This commit is contained in:
Christopher Leggett 2022-08-07 13:17:06 -04:00
parent 9616058952
commit 0efb008213
No known key found for this signature in database
GPG Key ID: 7093AE5FF7037D79
3 changed files with 13 additions and 6 deletions

View File

@ -2329,8 +2329,8 @@ GetItemID Randomizer::GetItemFromGet(RandomizerGet randoGet, GetItemID ogItemId)
// todo figure out what GI_HEART_CONTAINER_2 is
return GI_HEART_CONTAINER;
case RG_ICE_TRAP:
return GI_ICE_TRAP;
// case RG_ICE_TRAP:
// return GI_ICE_TRAP;
case RG_MILK:
return GI_MILK; //todo logic around needing a bottle?
@ -2429,6 +2429,7 @@ bool Randomizer::IsGetItemRandoExclusive(RandomizerGet randoGet) {
case RG_BOTTLE_WITH_BUGS:
case RG_BOTTLE_WITH_POE:
case RG_BOTTLE_WITH_BIG_POE:
case RG_ICE_TRAP:
return true;
default:
return false;
@ -4807,6 +4808,7 @@ void InitRandoItemTable() {
// Starting here, these do not have ItemIDs or GetItemIDs from vanilla, so I'm using their
// RandomizerGet enum values for both.
GET_ITEM(RG_ICE_TRAP, OBJECT_INVALID, GID_RUPEE_GOLD, 0, 0, CHEST_ANIM_SHORT),
GET_ITEM(RG_MAGIC_SINGLE, OBJECT_GI_MAGICPOT, GID_MAGIC_SMALL, 0xE4, 0x80, CHEST_ANIM_LONG),
GET_ITEM(RG_MAGIC_DOUBLE, OBJECT_GI_MAGICPOT, GID_MAGIC_LARGE, 0xE8, 0x80, CHEST_ANIM_LONG),
GET_ITEM(RG_DOUBLE_DEFENSE, OBJECT_GI_HEARTS, GID_HEART_CONTAINER, 0xE9, 0x80, CHEST_ANIM_LONG),

View File

@ -1339,7 +1339,7 @@ void EnItem00_DrawCollectible(EnItem00* this, GlobalContext* globalCtx) {
GetItemEntry randoGetItemEntry =
Randomizer_GetRandomizedItem(this->getItemId, this->actor.id, this->ogParams, globalCtx->sceneNum);
EnItem00_CustomItemsParticles(&this->actor, globalCtx, randoGetItemEntry);
GetItem_Draw(globalCtx, randoGetItemEntry.gi);
GetItem_Draw(globalCtx, ABS(randoGetItemEntry.gi) - 1);
} else {
s32 texIndex = this->actor.params - 3;
@ -1399,7 +1399,7 @@ void EnItem00_DrawHeartPiece(EnItem00* this, GlobalContext* globalCtx) {
GetItemEntry randoGetItemEntry =
Randomizer_GetRandomizedItem(GI_HEART_PIECE, this->actor.id, this->ogParams, globalCtx->sceneNum);
EnItem00_CustomItemsParticles(&this->actor, globalCtx, randoGetItemEntry);
GetItem_Draw(globalCtx, ABS(randoGetItemEntry.gi - 1));
GetItem_Draw(globalCtx, ABS(randoGetItemEntry.gi) - 1);
} else {
s32 pad;

View File

@ -6281,7 +6281,12 @@ s32 func_8083E5A8(Player* this, GlobalContext* globalCtx) {
}
if (this->getItemId < GI_MAX) {
GetItemEntry giEntry = ItemTable_Retrieve(this->getItemId - 1);
GetItemEntry giEntry;
if (this->getItemEntry.objectId == OBJECT_INVALID) {
giEntry = ItemTable_Retrieve(this->getItemId - 1);
} else {
giEntry = this->getItemEntry;
}
if ((interactedActor != &this->actor) && !iREG(67)) {
interactedActor->parent = &this->actor;
@ -6289,7 +6294,7 @@ s32 func_8083E5A8(Player* this, GlobalContext* globalCtx) {
iREG(67) = false;
if (gSaveContext.n64ddFlag && this->getItemId == GI_ICE_TRAP) {
if (gSaveContext.n64ddFlag && this->getItemId == RG_ICE_TRAP) {
this->stateFlags1 &= ~(PLAYER_STATE1_10 | PLAYER_STATE1_11);
this->actor.colChkInfo.damage = 0;
func_80837C0C(globalCtx, this, 3, 0.0f, 0.0f, 0, 20);