Move trap handler to its own file and make the additional trap types seeded (#4942)

This commit is contained in:
Garrett Cox
2025-01-25 10:50:36 -06:00
committed by GitHub
parent 388eb487e3
commit 8ac8dc3fd0
4 changed files with 206 additions and 169 deletions

View File

@@ -7254,19 +7254,9 @@ void func_8083E4C4(PlayState* play, Player* this, GetItemEntry* giEntry) {
s32 Player_ActionHandler_2(Player* this, PlayState* play) {
Actor* interactedActor;
if(gSaveContext.ship.pendingIceTrapCount) {
gSaveContext.ship.pendingIceTrapCount--;
GameInteractor_ExecuteOnItemReceiveHooks(ItemTable_RetrieveEntry(MOD_RANDOMIZER, RG_ICE_TRAP));
if (CVarGetInteger(CVAR_ENHANCEMENT("ExtraTraps.Enabled"), 0)) {
return 1;
}
this->stateFlags1 &= ~(PLAYER_STATE1_GETTING_ITEM | PLAYER_STATE1_CARRYING_ACTOR);
this->actor.colChkInfo.damage = 0;
func_80837C0C(play, this, 3, 0.0f, 0.0f, 0, 20);
if (GameInteractor_Should(VB_SHORT_CIRCUIT_GIVE_ITEM_PROCESS, false)) {
this->getItemId = GI_NONE;
this->getItemEntry = (GetItemEntry) GET_ITEM_NONE;
// Gameplay stats: Increment Ice Trap count
gSaveContext.ship.stats.count[COUNT_ICE_TRAPS]++;
this->getItemEntry = (GetItemEntry)GET_ITEM_NONE;
return 1;
}