mirror of
https://github.com/HarbourMasters/Shipwright
synced 2026-09-08 12:15:55 -04:00
V1 - Chestapalooza (#2922)
* V1- Adds additional trap variants to Chests * Create and use OnTrapProcessed hook * Update naming for Traps, extends to NPC and Token Rewards. New Hook for Rando traps. Restore Vanilla code for ice traps. * Update soh/src/overlays/actors/ovl_player_actor/z_player.c Co-authored-by: Garrett Cox <garrettjcox@gmail.com> * More tweaks, remove processed trap hook --------- Co-authored-by: Garrett Cox <garrettjcox@gmail.com>
This commit is contained in:
@@ -627,9 +627,12 @@ void EnBox_Update(Actor* thisx, PlayState* play) {
|
||||
}
|
||||
|
||||
if (((!gSaveContext.n64ddFlag && ((this->dyna.actor.params >> 5 & 0x7F) == 0x7C)) ||
|
||||
(gSaveContext.n64ddFlag && ABS(sItem.getItemId) == RG_ICE_TRAP)) &&
|
||||
this->actionFunc == EnBox_Open && this->skelanime.curFrame > 45 &&
|
||||
this->iceSmokeTimer < 100) EnBox_SpawnIceSmoke(this, play);
|
||||
(gSaveContext.n64ddFlag && ABS(sItem.getItemId) == RG_ICE_TRAP)) &&
|
||||
this->actionFunc == EnBox_Open && this->skelanime.curFrame > 45 && this->iceSmokeTimer < 100) {
|
||||
if (!CVarGetInteger("gAddTraps.enabled", 0)) {
|
||||
EnBox_SpawnIceSmoke(this, play);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EnBox_UpdateSizeAndTexture(EnBox* this, PlayState* play) {
|
||||
|
||||
@@ -988,10 +988,6 @@ void EnGirlA_ItemGive_Randomizer(PlayState* play, EnGirlA* this) {
|
||||
Randomizer_Item_Give(play, getItemEntry);
|
||||
}
|
||||
|
||||
if (getItemEntry.itemId == GI_ICE_TRAP || getItemEntry.itemId == RG_ICE_TRAP) {
|
||||
GameInteractor_ExecuteOnItemReceiveHooks(getItemEntry);
|
||||
}
|
||||
|
||||
Flags_SetRandomizerInf(shopItemIdentity.randomizerInf);
|
||||
Rupees_ChangeBy(-this->basePrice);
|
||||
}
|
||||
|
||||
@@ -6326,6 +6326,8 @@ s32 func_8083E5A8(Player* this, PlayState* play) {
|
||||
|
||||
if(gSaveContext.pendingIceTrapCount) {
|
||||
gSaveContext.pendingIceTrapCount--;
|
||||
GameInteractor_ExecuteOnItemReceiveHooks(ItemTable_RetrieveEntry(MOD_RANDOMIZER, RG_ICE_TRAP));
|
||||
if (CVarGetInteger("gAddTraps.enabled", 0)) return;
|
||||
this->stateFlags1 &= ~(PLAYER_STATE1_GETTING_ITEM | PLAYER_STATE1_ITEM_OVER_HEAD);
|
||||
this->actor.colChkInfo.damage = 0;
|
||||
func_80837C0C(play, this, 3, 0.0f, 0.0f, 0, 20);
|
||||
@@ -6361,7 +6363,6 @@ s32 func_8083E5A8(Player* this, PlayState* play) {
|
||||
Player_SetPendingFlag(this, play);
|
||||
Message_StartTextbox(play, 0xF8, NULL);
|
||||
Audio_PlayFanfare(NA_BGM_SMALL_ITEM_GET);
|
||||
GameInteractor_ExecuteOnItemReceiveHooks(this->getItemEntry);
|
||||
gSaveContext.pendingIceTrapCount++;
|
||||
return 1;
|
||||
}
|
||||
@@ -12790,7 +12791,6 @@ s32 func_8084DFF4(PlayState* play, Player* this) {
|
||||
this->unk_862 = 0;
|
||||
gSaveContext.pendingIceTrapCount++;
|
||||
Player_SetPendingFlag(this, play);
|
||||
GameInteractor_ExecuteOnItemReceiveHooks(giEntry);
|
||||
}
|
||||
|
||||
this->getItemId = GI_NONE;
|
||||
@@ -12949,7 +12949,6 @@ void func_8084E6D4(Player* this, PlayState* play) {
|
||||
}
|
||||
} else {
|
||||
func_80832DBC(this);
|
||||
|
||||
if ((this->getItemId == GI_ICE_TRAP && !gSaveContext.n64ddFlag) ||
|
||||
(gSaveContext.n64ddFlag && (this->getItemId == RG_ICE_TRAP || this->getItemEntry.getItemId == RG_ICE_TRAP))) {
|
||||
this->stateFlags1 &= ~(PLAYER_STATE1_GETTING_ITEM | PLAYER_STATE1_ITEM_OVER_HEAD);
|
||||
@@ -12959,15 +12958,13 @@ void func_8084E6D4(Player* this, PlayState* play) {
|
||||
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_CLEAR_TAG, this->actor.world.pos.x,
|
||||
this->actor.world.pos.y + 100.0f, this->actor.world.pos.z, 0, 0, 0, 0, true);
|
||||
func_8083C0E8(this, play);
|
||||
GameInteractor_ExecuteOnItemReceiveHooks(this->getItemEntry);
|
||||
} else if (gSaveContext.n64ddFlag) {
|
||||
gSaveContext.pendingIceTrapCount++;
|
||||
Player_SetPendingFlag(this, play);
|
||||
func_8083C0E8(this, play);
|
||||
} else {
|
||||
this->actor.colChkInfo.damage = 0;
|
||||
func_80837C0C(play, this, 3, 0.0f, 0.0f, 0, 20);
|
||||
GameInteractor_ExecuteOnItemReceiveHooks(this->getItemEntry);
|
||||
this->getItemId = GI_NONE;
|
||||
this->getItemEntry = (GetItemEntry)GET_ITEM_NONE;
|
||||
// Gameplay stats: Increment Ice Trap count
|
||||
gSaveContext.sohStats.count[COUNT_ICE_TRAPS]++;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user