Added in JOTWAD Death Trigger.

This commit is contained in:
Caladius 2024-03-15 12:17:53 -04:00
parent e5cdce6978
commit b433be4107
3 changed files with 15 additions and 5 deletions

View File

@ -201,6 +201,7 @@ std::vector<TimeSplitObject> splitObjects = {
{ ENTER_INSIDE_GANONS_CASTLE_COLLAPSE, "Enter Ganons Castle Collapse", "SPECIAL_SPLIT_ENTRANCE"},
{ ESCAPE_LOST_WOODS, "Lost Woods Escape", "SPECIAL_SPLIT_ENTRANCE"},
{ ESCAPE_KOKIRI_FOREST, "Forest Escape", "SPECIAL_SPLIT_ENTRANCE"},
{ WATCHTOWER_DEATH, "Watchtower Death", "SPECIAL_SPLIT_ENTRANCE"},
};
std::vector<TimeSplitObject> equipmentObjects = {
@ -304,6 +305,7 @@ std::vector<TimeSplitObject> sceneObjects = {
{ ENTER_INSIDE_GANONS_CASTLE_COLLAPSE, "Enter Ganons Castle Collapse", "SPECIAL_SPLIT_ENTRANCE"},
{ ESCAPE_LOST_WOODS, "Lost Woods Escape", "SPECIAL_SPLIT_ENTRANCE"},
{ ESCAPE_KOKIRI_FOREST, "Forest Escape", "SPECIAL_SPLIT_ENTRANCE"},
{ WATCHTOWER_DEATH, "Watchtower Death", "SPECIAL_SPLIT_ENTRANCE"},
};
std::string formatTimestampTimeSplit(uint32_t value) {
@ -365,9 +367,12 @@ void TimeSplitSceneSplitHandler(uint32_t entrance) {
if (entrance == ESCAPE_KOKIRI_FOREST && gSaveContext.cutsceneIndex != 0xfff0) {
return;
}
if (entrance != ESCAPE_LOST_WOODS && entrance != ESCAPE_KOKIRI_FOREST) {
if (entrance != ESCAPE_LOST_WOODS && entrance != ESCAPE_KOKIRI_FOREST && entrance != WATCHTOWER_DEATH) {
entrance = gPlayState->sceneNum + ENTER_DEKU_TREE;
}
if (entrance == WATCHTOWER_DEATH && gSaveContext.health != 0) {
return;
}
for (auto& str : splitItem) {
if (entrance == splitItem[loopCounter]) {
if (splitStatus[loopCounter] == 2) {
@ -1370,7 +1375,7 @@ void DrawTimeSplitListManager() {
ImGui::BeginTable("Overworld", 1);
ImGui::TableSetupColumn("Overworld1", ImGuiTableColumnFlags_WidthFixed, (220.0f * uiScale));
ImGui::TableNextColumn();
for (int i = 16; i <= 17; i++) {
for (int i = 16; i <= 18; i++) {
//itemNum = obj.itemID;
//TimeSplitColorTint();
if (ImGui::ImageButton(std::to_string(i).c_str(), LUS::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(sceneObjects[i].itemImage),

View File

@ -9,6 +9,7 @@ extern "C" {
#endif
void TimeSplitSplitsHandlerS(uint32_t itemID);
void TimeSplitSceneSplitHandler(uint32_t entrance);
#ifdef __cplusplus
}
@ -66,5 +67,6 @@ typedef enum {
ENTER_GANONS_TOWER_COLLAPSE_INTERIOR,
ENTER_INSIDE_GANONS_CASTLE_COLLAPSE,
ESCAPE_KOKIRI_FOREST = 286,
ESCAPE_LOST_WOODS = 477
ESCAPE_LOST_WOODS = 477,
WATCHTOWER_DEATH = 513
};

View File

@ -30,6 +30,7 @@
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
#include "soh/Enhancements/randomizer/randomizer_grotto.h"
#include "soh/frame_interpolation.h"
#include "soh/Enhancements/timesplits/TimeSplits.h"
#include <string.h>
#include <stdlib.h>
@ -9023,7 +9024,7 @@ s32 func_80843E64(PlayState* play, Player* this) {
Player_RequestRumble(this, impactInfo->rumbleStrength, impactInfo->rumbleDuration, impactInfo->rumbleDecreaseRate, 0);
Player_PlaySfx(this, NA_SE_PL_BODY_HIT);
func_80832698(this, impactInfo->sfxId);
return impactIndex + 1;
}
@ -11449,6 +11450,8 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) {
: (this->bodyShockTimer != 0) ? &gPlayerAnim_link_normal_electric_shock_end
: &gPlayerAnim_link_derth_rebirth);
}
TimeSplitSceneSplitHandler(gSaveContext.entranceIndex);
} else {
if ((this->actor.parent == NULL) &&
((play->transitionTrigger == TRANS_TRIGGER_START) || (this->unk_A87 != 0) || !func_808382DC(this, play))) {
@ -15978,7 +15981,7 @@ s32 Player_InflictDamageModified(PlayState* play, s32 damage, u8 modified) {
this->stateFlags2 &= ~PLAYER_STATE2_GRABBED_BY_ENEMY;
return 1;
}
return 0;
}