mirror of
https://github.com/HarbourMasters/Shipwright
synced 2026-05-25 15:35:18 -04:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5f708251a6 | |||
| 62bd4b0ba7 | |||
| f5bcc6dccf | |||
| f7703e14e8 | |||
| 0c43fe7e48 | |||
| 545bc21fbe | |||
| 21a3bd9f5c | |||
| f682102c96 |
+2
-2
@@ -5,8 +5,8 @@ set(CMAKE_CXX_STANDARD 20 CACHE STRING "The C++ standard to use")
|
||||
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum OS X deployment version" FORCE)
|
||||
|
||||
project(Ship VERSION 42.0.69 LANGUAGES C CXX)
|
||||
set(PROJECT_BUILD_NAME "GREG ALFA" CACHE STRING "")
|
||||
project(Ship VERSION 6.1.2 LANGUAGES C CXX)
|
||||
set(PROJECT_BUILD_NAME "KHAN CHARLIE" CACHE STRING "")
|
||||
set(PROJECT_TEAM "github.com/harbourmasters" CACHE STRING "")
|
||||
|
||||
set_property(DIRECTORY ${CMAKE_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT soh)
|
||||
|
||||
@@ -369,7 +369,7 @@ typedef enum {
|
||||
#define EVENTCHKINF_16 0x16
|
||||
#define EVENTCHKINF_EPONA_OBTAINED 0x18
|
||||
#define EVENTCHKINF_1B 0x1B
|
||||
#define EVENTCHKINF_1C 0x1C
|
||||
#define EVENTCHKINF_SPOKE_TO_MIDO_AFTER_DEKU_TREES_DEATH 0x1C
|
||||
#define EVENTCHKINF_1D 0x1D
|
||||
#define EVENTCHKINF_1E 0x1E
|
||||
#define EVENTCHKINF_20 0x20
|
||||
|
||||
@@ -261,6 +261,10 @@ extern "C" void AudioCollection_AddToCollection(char *otrPath, uint16_t seqNum)
|
||||
AudioCollection::Instance->AddToCollection(otrPath, seqNum);
|
||||
}
|
||||
|
||||
bool AudioCollection::HasSequenceNum(uint16_t seqId) {
|
||||
return sequenceMap.contains(seqId);
|
||||
}
|
||||
|
||||
const char* AudioCollection::GetSequenceName(uint16_t seqId) {
|
||||
auto seqIt = sequenceMap.find(seqId);
|
||||
if (seqIt != sequenceMap.end()) {
|
||||
@@ -269,6 +273,18 @@ const char* AudioCollection::GetSequenceName(uint16_t seqId) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
size_t AudioCollection::SequenceMapSize() {
|
||||
return sequenceMap.size();
|
||||
}
|
||||
|
||||
extern "C" const char* AudioCollection_GetSequenceName(uint16_t seqId) {
|
||||
return AudioCollection::Instance->GetSequenceName(seqId);
|
||||
}
|
||||
|
||||
extern "C" bool AudioCollection_HasSequenceNum(uint16_t seqId) {
|
||||
return AudioCollection::Instance->HasSequenceNum(seqId);
|
||||
}
|
||||
|
||||
extern "C" size_t AudioCollection_SequenceMapSize() {
|
||||
return AudioCollection::Instance->SequenceMapSize();
|
||||
}
|
||||
@@ -58,8 +58,12 @@ class AudioCollection {
|
||||
uint16_t GetReplacementSequence(uint16_t seqId);
|
||||
void InitializeShufflePool();
|
||||
const char* GetSequenceName(uint16_t seqId);
|
||||
bool HasSequenceNum(uint16_t seqId);
|
||||
size_t SequenceMapSize();
|
||||
};
|
||||
#else
|
||||
void AudioCollection_AddToCollection(char *otrPath, uint16_t seqNum);
|
||||
const char* AudioCollection_GetSequenceName(uint16_t seqId);
|
||||
bool AudioCollection_HasSequenceNum(uint16_t seqId);
|
||||
size_t AudioCollection_SequenceMapSize();
|
||||
#endif
|
||||
@@ -11,17 +11,55 @@ extern "C" {
|
||||
extern "C" uint32_t ResourceMgr_IsSceneMasterQuest(s16 sceneNum);
|
||||
|
||||
static EnemyEntry randomizedEnemySpawnTable[RANDOMIZED_ENEMY_SPAWN_TABLE_SIZE] = {
|
||||
{ ACTOR_EN_FIREFLY, 2 }, // Regular Keese
|
||||
{ ACTOR_EN_FIREFLY, 1 }, // Fire Keese
|
||||
{ ACTOR_EN_FIREFLY, 4 }, // Ice Keese
|
||||
{ ACTOR_EN_TEST, 2 }, // Stalfos
|
||||
{ ACTOR_EN_TITE, -1 }, // Tektite (red)
|
||||
{ ACTOR_EN_TITE, -2 }, // Tektite (blue)
|
||||
{ ACTOR_EN_WALLMAS, 1 }, // Wallmaster
|
||||
{ ACTOR_EN_DODONGO, -1 }, // Dodongo
|
||||
{ ACTOR_EN_PEEHAT, -1 }, // Flying Peahat (big grounded, doesn't spawn larva)
|
||||
{ ACTOR_EN_PEEHAT, 1 }, // Flying Peahat Larva
|
||||
{ ACTOR_EN_ZF, -1 }, // Lizalfos
|
||||
{ ACTOR_EN_ZF, -2 }, // Dinolfos
|
||||
{ ACTOR_EN_GOMA, 7 }, // Gohma larva (non-gohma rooms)
|
||||
{ ACTOR_EN_BUBBLE, 0 }, // Shabom (bubble)
|
||||
{ ACTOR_EN_DODOJR, 0 }, // Baby Dodongo
|
||||
{ ACTOR_EN_TORCH2, 0 }, // Dark Link
|
||||
{ ACTOR_EN_BILI, 0 }, // Biri (jellyfish)
|
||||
{ ACTOR_EN_TP, -1 }, // Electric Tailparasan
|
||||
{ ACTOR_EN_ST, 0 }, // Skulltula (normal)
|
||||
{ ACTOR_EN_ST, 1 }, // Skulltula (big)
|
||||
{ ACTOR_EN_ST, 2 }, // Skulltula (invisible)
|
||||
{ ACTOR_EN_BW, 0 }, // Torch Slug
|
||||
{ ACTOR_EN_EIYER, 10 }, // Stinger (land) (One in formation, sink under floor and do not activate)
|
||||
{ ACTOR_EN_MB, 0 }, // Moblins (Club)
|
||||
{ ACTOR_EN_DEKUBABA, 0 }, // Deku Baba (small)
|
||||
{ ACTOR_EN_DEKUBABA, 1 }, // Deku Baba (large)
|
||||
{ ACTOR_EN_AM, -1 }, // Armos (enemy variant)
|
||||
{ ACTOR_EN_DEKUNUTS, 768 }, // Mad Scrub (triple attack) (projectiles don't work)
|
||||
{ ACTOR_EN_VALI, -1 }, // Bari (big jellyfish)
|
||||
{ ACTOR_EN_BB, -1 }, // Bubble (flying skull enemy) (blue)
|
||||
{ ACTOR_EN_YUKABYUN, 0 }, // Flying Floor Tile
|
||||
{ ACTOR_EN_VM, 1280 }, // Beamos
|
||||
{ ACTOR_EN_FLOORMAS, 0 }, // Floormaster
|
||||
{ ACTOR_EN_RD, 1 }, // Redead (standing)
|
||||
{ ACTOR_EN_RD, 32766 }, // Gibdo (standing)
|
||||
{ ACTOR_EN_SB, 0 }, // Shell Blade
|
||||
{ ACTOR_EN_KAREBABA, 0 }, // Withered Deku Baba
|
||||
{ ACTOR_EN_RR, 0 }, // Like-Like
|
||||
{ ACTOR_EN_NY, 0 }, // Spike (rolling enemy)
|
||||
{ ACTOR_EN_IK, 2 }, // Iron Knuckle (black, standing)
|
||||
{ ACTOR_EN_IK, 3 }, // Iron Knuckle (white, standing)
|
||||
{ ACTOR_EN_CLEAR_TAG, 1 } // Arwing
|
||||
{ ACTOR_EN_TUBO_TRAP, 0 }, // Flying pot
|
||||
{ ACTOR_EN_FZ, 0 }, // Freezard
|
||||
{ ACTOR_EN_CLEAR_TAG, 1 }, // Arwing
|
||||
{ ACTOR_EN_WF, 0 }, // Wolfos (normal)
|
||||
{ ACTOR_EN_WF, 1 }, // Wolfos (white)
|
||||
{ ACTOR_EN_SKB, 1 }, // Stalchild (small)
|
||||
{ ACTOR_EN_SKB, 20 }, // Stalchild (big)
|
||||
{ ACTOR_EN_CROW, 0 } // Guay
|
||||
|
||||
// Doesn't work {ACTOR_EN_POH, 0}, // Poe (Seems to rely on other objects?)
|
||||
// Doesn't work {ACTOR_EN_POH, 2}, // Poe (composer Sharp) (Seems to rely on other objects?)
|
||||
|
||||
@@ -7,7 +7,7 @@ typedef struct EnemyEntry {
|
||||
int16_t params;
|
||||
} EnemyEntry;
|
||||
|
||||
#define RANDOMIZED_ENEMY_SPAWN_TABLE_SIZE 11
|
||||
#define RANDOMIZED_ENEMY_SPAWN_TABLE_SIZE 49
|
||||
|
||||
bool IsEnemyFoundToRandomize(int16_t sceneNum, int8_t roomNum, int16_t actorId, int16_t params, float posX);
|
||||
bool IsEnemyAllowedToSpawn(int16_t sceneNum, int8_t roomNum, EnemyEntry enemy);
|
||||
|
||||
@@ -34,7 +34,6 @@ uint8_t GameInteractor_ReverseControlsActive();
|
||||
int32_t GameInteractor_DefenseModifier();
|
||||
int32_t GameInteractor_RunSpeedModifier();
|
||||
GIGravityLevel GameInteractor_GravityLevel();
|
||||
uint8_t GameInteractor_SecondCollisionUpdate();
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -67,7 +66,6 @@ public:
|
||||
static int32_t DefenseModifier;
|
||||
static int32_t RunSpeedModifier;
|
||||
static GIGravityLevel GravityLevel;
|
||||
static uint8_t SecondCollisionUpdate;
|
||||
|
||||
static void SetPacifistMode(bool active);
|
||||
};
|
||||
@@ -92,7 +90,6 @@ public:
|
||||
DEFINE_HOOK(OnReceiveItem, void(u8 item));
|
||||
DEFINE_HOOK(OnSceneInit, void(s16 sceneNum));
|
||||
DEFINE_HOOK(OnPlayerUpdate, void());
|
||||
DEFINE_HOOK(OnActorUpdate, void(void* actor));
|
||||
|
||||
DEFINE_HOOK(OnSaveFile, void(int32_t fileNum));
|
||||
DEFINE_HOOK(OnLoadFile, void(int32_t fileNum));
|
||||
@@ -119,7 +116,6 @@ public:
|
||||
static void GiveDekuShield();
|
||||
static void SpawnCuccoStorm();
|
||||
static void ForceInterfaceUpdate();
|
||||
static void UpdateActor(void* refActor);
|
||||
|
||||
static GameInteractionEffectQueryResult SpawnEnemyWithOffset(uint32_t enemyId, int32_t enemyParams);
|
||||
};
|
||||
|
||||
@@ -30,10 +30,6 @@ void GameInteractor_ExecuteOnPlayerUpdate() {
|
||||
GameInteractor::Instance->ExecuteHooks<GameInteractor::OnPlayerUpdate>();
|
||||
}
|
||||
|
||||
void GameInteractor_ExecuteOnActorUpdate(void* actor) {
|
||||
GameInteractor::Instance->ExecuteHooks<GameInteractor::OnActorUpdate>(actor);
|
||||
}
|
||||
|
||||
// MARK: - Save Files
|
||||
|
||||
void GameInteractor_ExecuteOnSaveFile(int32_t fileNum) {
|
||||
|
||||
@@ -7,7 +7,6 @@ extern "C" void GameInteractor_ExecuteOnGameFrameUpdate();
|
||||
extern "C" void GameInteractor_ExecuteOnReceiveItemHooks(u8 item);
|
||||
extern "C" void GameInteractor_ExecuteOnSceneInit(s16 sceneNum);
|
||||
extern "C" void GameInteractor_ExecuteOnPlayerUpdate();
|
||||
extern "C" void GameInteractor_ExecuteOnActorUpdate(void* actor);
|
||||
|
||||
// MARK: - Save Files
|
||||
extern "C" void GameInteractor_ExecuteOnSaveFile(int32_t fileNum);
|
||||
|
||||
@@ -142,27 +142,6 @@ void GameInteractor::RawAction::ForceInterfaceUpdate() {
|
||||
Interface_Update(gPlayState);
|
||||
}
|
||||
|
||||
void GameInteractor::RawAction::UpdateActor(void* refActor) {
|
||||
// Update actor again outside of their normal update cycle.
|
||||
|
||||
Actor* actor = static_cast<Actor*>(refActor);
|
||||
|
||||
// Sometimes the actor is destroyed in the previous Update, so check if the update function still exists.
|
||||
if (actor->update != NULL) {
|
||||
// Fix for enemies sometimes taking a "fake" hit, where their invincibility timer is
|
||||
// reset but damage isn't applied.
|
||||
if (actor->colorFilterTimer > 0) {
|
||||
actor->colorFilterTimer--;
|
||||
}
|
||||
|
||||
// This variable is used to not let the collider subscribe a second time when the actor update function
|
||||
// is ran a second time, incorrectly applying double damage in some cases.
|
||||
GameInteractor::State::SecondCollisionUpdate = 1;
|
||||
actor->update(actor, gPlayState);
|
||||
GameInteractor::State::SecondCollisionUpdate = 0;
|
||||
}
|
||||
}
|
||||
|
||||
GameInteractionEffectQueryResult GameInteractor::RawAction::SpawnEnemyWithOffset(uint32_t enemyId, int32_t enemyParams) {
|
||||
|
||||
if (!GameInteractor::CanSpawnEnemy()) {
|
||||
|
||||
@@ -12,7 +12,6 @@ bool GameInteractor::State::ReverseControlsActive = 0;
|
||||
int32_t GameInteractor::State::DefenseModifier = 0;
|
||||
int32_t GameInteractor::State::RunSpeedModifier = 0;
|
||||
GIGravityLevel GameInteractor::State::GravityLevel = GI_GRAVITY_LEVEL_NORMAL;
|
||||
uint8_t GameInteractor::State::SecondCollisionUpdate = 0;
|
||||
|
||||
void GameInteractor::State::SetPacifistMode(bool active) {
|
||||
PacifistModeActive = active;
|
||||
@@ -80,8 +79,3 @@ int32_t GameInteractor_RunSpeedModifier() {
|
||||
GIGravityLevel GameInteractor_GravityLevel() {
|
||||
return GameInteractor::State::GravityLevel;
|
||||
}
|
||||
|
||||
// MARK: - GameInteractor::State::SecondCollisionUpdate
|
||||
uint8_t GameInteractor_SecondCollisionUpdate() {
|
||||
return GameInteractor::State::SecondCollisionUpdate;
|
||||
}
|
||||
|
||||
@@ -6,9 +6,11 @@ extern "C" {
|
||||
#include <z64.h>
|
||||
#include "macros.h"
|
||||
#include "variables.h"
|
||||
#include "functions.h"
|
||||
extern SaveContext gSaveContext;
|
||||
extern PlayState* gPlayState;
|
||||
extern void Play_PerformSave(PlayState* play);
|
||||
extern s32 Health_ChangeBy(PlayState* play, s16 healthChange);
|
||||
extern void Rupees_ChangeBy(s16 rupeeChange);
|
||||
}
|
||||
|
||||
void RegisterInfiniteMoney() {
|
||||
@@ -255,46 +257,6 @@ void RegisterRupeeDash() {
|
||||
});
|
||||
}
|
||||
|
||||
void RegisterHyperBosses() {
|
||||
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnActorUpdate>([](void* refActor) {
|
||||
// Run the update function a second time to make bosses move and act twice as fast.
|
||||
|
||||
Player* player = GET_PLAYER(gPlayState);
|
||||
Actor* actor = static_cast<Actor*>(refActor);
|
||||
|
||||
uint8_t isBossActor =
|
||||
actor->id == ACTOR_BOSS_GOMA || // Gohma
|
||||
actor->id == ACTOR_BOSS_DODONGO || // King Dodongo
|
||||
actor->id == ACTOR_BOSS_VA || // Barinade
|
||||
actor->id == ACTOR_BOSS_GANONDROF || // Phantom Ganon
|
||||
(actor->id == 0 && actor->category == ACTORCAT_BOSS) || // Phantom Ganon/Ganondorf Energy Ball/Thunder
|
||||
actor->id == ACTOR_EN_FHG || // Phantom Ganon's Horse
|
||||
actor->id == ACTOR_BOSS_FD || actor->id == ACTOR_BOSS_FD2 || // Volvagia (grounded/flying)
|
||||
actor->id == ACTOR_BOSS_MO || // Morpha
|
||||
actor->id == ACTOR_BOSS_SST || // Bongo Bongo
|
||||
actor->id == ACTOR_BOSS_TW || // Twinrova
|
||||
actor->id == ACTOR_BOSS_GANON || // Ganondorf
|
||||
actor->id == ACTOR_BOSS_GANON2; // Ganon
|
||||
|
||||
// Don't apply during cutscenes because it causes weird behaviour and/or crashes on some bosses.
|
||||
if (isBossActor && !Player_InBlockingCsMode(gPlayState, player)) {
|
||||
// Barinade needs to be updated in sequence to avoid unintended behaviour.
|
||||
if (actor->id == ACTOR_BOSS_VA) {
|
||||
// params -1 is BOSSVA_BODY
|
||||
if (actor->params == -1) {
|
||||
Actor* actorList = gPlayState->actorCtx.actorLists[ACTORCAT_BOSS].head;
|
||||
while (actorList != NULL) {
|
||||
GameInteractor::RawAction::UpdateActor(actorList);
|
||||
actorList = actorList->next;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
GameInteractor::RawAction::UpdateActor(actor);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void InitMods() {
|
||||
RegisterInfiniteMoney();
|
||||
RegisterInfiniteHealth();
|
||||
@@ -308,5 +270,4 @@ void InitMods() {
|
||||
RegisterSwitchAge();
|
||||
RegisterRupeeDash();
|
||||
RegisterAutoSave();
|
||||
RegisterHyperBosses();
|
||||
}
|
||||
|
||||
@@ -4654,7 +4654,7 @@ CustomMessageEntry Randomizer::GetMerchantMessage(RandomizerInf randomizerInf, u
|
||||
} else {
|
||||
shopItemName = EnumToSpoilerfileGetName[shopItemGet];
|
||||
}
|
||||
u16 shopItemPrice = 999;
|
||||
u16 shopItemPrice = merchantPrices[rc];
|
||||
|
||||
if (textId == TEXT_SCRUB_RANDOM && shopItemPrice == 0) {
|
||||
messageEntry = CustomMessageManager::Instance->RetrieveMessage(Randomizer::merchantMessageTableID, TEXT_SCRUB_RANDOM_FREE);
|
||||
|
||||
@@ -518,7 +518,7 @@ extern "C" void VanillaItemTable_Init() {
|
||||
GET_ITEM(ITEM_POE, OBJECT_GI_GHOST, GID_POE, 0x97, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_JUNK, MOD_NONE, GI_POE),
|
||||
GET_ITEM(ITEM_BIG_POE, OBJECT_GI_GHOST, GID_BIG_POE, 0xF9, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_JUNK, MOD_NONE, GI_BIG_POE),
|
||||
GET_ITEM(ITEM_KEY_SMALL, OBJECT_GI_KEY, GID_KEY_SMALL, 0xF3, 0x80, CHEST_ANIM_SHORT, ITEM_CATEGORY_SMALL_KEY, MOD_NONE, GI_DOOR_KEY),
|
||||
GET_ITEM(ITEM_RUPEE_GREEN, OBJECT_GI_RUPY, GID_RUPEE_GREEN, 0xF4, 0x00, CHEST_ANIM_SHORT, ITEM_CATEGORY_MAJOR, MOD_NONE, GI_RUPEE_GREEN_LOSE),
|
||||
GET_ITEM(ITEM_RUPEE_GREEN, OBJECT_GI_RUPY, GID_RUPEE_GREEN, 0xF4, 0x00, CHEST_ANIM_SHORT, ITEM_CATEGORY_JUNK, MOD_NONE, GI_RUPEE_GREEN_LOSE),
|
||||
GET_ITEM(ITEM_RUPEE_BLUE, OBJECT_GI_RUPY, GID_RUPEE_BLUE, 0xF5, 0x01, CHEST_ANIM_SHORT, ITEM_CATEGORY_JUNK, MOD_NONE, GI_RUPEE_BLUE_LOSE),
|
||||
GET_ITEM(ITEM_RUPEE_RED, OBJECT_GI_RUPY, GID_RUPEE_RED, 0xF6, 0x02, CHEST_ANIM_SHORT, ITEM_CATEGORY_JUNK, MOD_NONE, GI_RUPEE_RED_LOSE),
|
||||
GET_ITEM(ITEM_RUPEE_PURPLE, OBJECT_GI_RUPY, GID_RUPEE_PURPLE, 0xF7, 0x14, CHEST_ANIM_SHORT, ITEM_CATEGORY_JUNK, MOD_NONE, GI_RUPEE_PURPLE_LOSE),
|
||||
@@ -1677,8 +1677,11 @@ extern "C" int CustomMessage_RetrieveIfExists(PlayState* play) {
|
||||
} else {
|
||||
textId = TEXT_GS_FREEZE;
|
||||
}
|
||||
// In vanilla, GS token count is incremented prior to the text box displaying
|
||||
// In rando we need to bump the token count by one to show the correct count
|
||||
s16 gsCount = gSaveContext.inventory.gsTokens + (gSaveContext.n64ddFlag ? 1 : 0);
|
||||
messageEntry = CustomMessageManager::Instance->RetrieveMessage(customMessageTableID, textId);
|
||||
CustomMessageManager::ReplaceStringInMessage(messageEntry, "{{gsCount}}", std::to_string(gSaveContext.inventory.gsTokens));
|
||||
CustomMessageManager::ReplaceStringInMessage(messageEntry, "{{gsCount}}", std::to_string(gsCount));
|
||||
}
|
||||
}
|
||||
if (textId == TEXT_HEART_CONTAINER && CVarGetInteger("gInjectItemCounts", 0)) {
|
||||
|
||||
@@ -1346,7 +1346,7 @@ void AudioLoad_Init(void* heap, size_t heapSize) {
|
||||
int customSeqListSize = 0;
|
||||
char** seqList = ResourceMgr_ListFiles("audio/sequences*", &seqListSize);
|
||||
char** customSeqList = ResourceMgr_ListFiles("custom/music/*", &customSeqListSize);
|
||||
sequenceMapSize = (size_t)(seqListSize + customSeqListSize);
|
||||
sequenceMapSize = (size_t)(AudioCollection_SequenceMapSize() + customSeqListSize);
|
||||
sequenceMap = malloc(sequenceMapSize * sizeof(char*));
|
||||
gAudioContext.seqLoadStatus = malloc(sequenceMapSize * sizeof(char*));
|
||||
|
||||
@@ -1366,16 +1366,27 @@ void AudioLoad_Init(void* heap, size_t heapSize) {
|
||||
int startingSeqNum = MAX_AUTHENTIC_SEQID; // 109 is the highest vanilla sequence
|
||||
qsort(customSeqList, customSeqListSize, sizeof(char*), strcmp_sort);
|
||||
|
||||
// Because AudioCollection's sequenceMap actually has more than sequences (including instruments from 130-135 and sfx in the 2000s, 6000s, 10000s, 14000s, 18000s, and 26000s),
|
||||
// it's better here to keep track of the next empty seqNum in AudioCollection instead of just skipping past the instruments at 130 with a higher MAX_AUTHENTIC_SEQID,
|
||||
// especially if those others could be added to in the future. However, this really needs to be streamlined with specific ranges in AudioCollection for types, or unifying
|
||||
// AudioCollection and the various maps in here
|
||||
int seqNum = startingSeqNum;
|
||||
|
||||
for (size_t i = startingSeqNum; i < startingSeqNum + customSeqListSize; i++) {
|
||||
// ensure that what would be the next sequence number is actually unassigned in AudioCollection
|
||||
while (AudioCollection_HasSequenceNum(seqNum)) {
|
||||
seqNum++;
|
||||
}
|
||||
int j = i - startingSeqNum;
|
||||
AudioCollection_AddToCollection(customSeqList[j], i);
|
||||
AudioCollection_AddToCollection(customSeqList[j], seqNum);
|
||||
SequenceData sDat = ResourceMgr_LoadSeqByName(customSeqList[j]);
|
||||
sDat.seqNumber = i;
|
||||
sDat.seqNumber = seqNum;
|
||||
|
||||
char* str = malloc(strlen(customSeqList[j]) + 1);
|
||||
strcpy(str, customSeqList[j]);
|
||||
|
||||
sequenceMap[sDat.seqNumber] = str;
|
||||
seqNum++;
|
||||
}
|
||||
|
||||
free(customSeqList);
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
#include "objects/object_bdoor/object_bdoor.h"
|
||||
#include "soh/frame_interpolation.h"
|
||||
#include "soh/Enhancements/enemyrandomizer.h"
|
||||
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
||||
|
||||
#if defined(_MSC_VER) || defined(__GNUC__)
|
||||
#include <string.h>
|
||||
@@ -2596,7 +2595,6 @@ void Actor_UpdateAll(PlayState* play, ActorContext* actorCtx) {
|
||||
actor->colorFilterTimer--;
|
||||
}
|
||||
actor->update(actor, play);
|
||||
GameInteractor_ExecuteOnActorUpdate(actor, play);
|
||||
func_8003F8EC(play, &play->colCtx.dyna, actor);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#include "global.h"
|
||||
#include "vt.h"
|
||||
#include "overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.h"
|
||||
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
||||
|
||||
typedef s32 (*ColChkResetFunc)(PlayState*, Collider*);
|
||||
typedef void (*ColChkBloodFunc)(PlayState*, Collider*, Vec3f*);
|
||||
@@ -1178,10 +1177,6 @@ static ColChkResetFunc sATResetFuncs[] = {
|
||||
s32 CollisionCheck_SetAT(PlayState* play, CollisionCheckContext* colChkCtx, Collider* collider) {
|
||||
s32 index;
|
||||
|
||||
if (GameInteractor_SecondCollisionUpdate()) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (FrameAdvance_IsEnabled(play) == true) {
|
||||
return -1;
|
||||
}
|
||||
@@ -1211,15 +1206,9 @@ s32 CollisionCheck_SetAT(PlayState* play, CollisionCheckContext* colChkCtx, Coll
|
||||
s32 CollisionCheck_SetAT_SAC(PlayState* play, CollisionCheckContext* colChkCtx, Collider* collider,
|
||||
s32 index) {
|
||||
ASSERT(collider->shape <= COLSHAPE_QUAD);
|
||||
|
||||
if (GameInteractor_SecondCollisionUpdate()) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (FrameAdvance_IsEnabled(play) == true) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
sATResetFuncs[collider->shape](play, collider);
|
||||
if (collider->actor != NULL && collider->actor->update == NULL) {
|
||||
return -1;
|
||||
@@ -1257,10 +1246,6 @@ static ColChkResetFunc sACResetFuncs[] = {
|
||||
s32 CollisionCheck_SetAC(PlayState* play, CollisionCheckContext* colChkCtx, Collider* collider) {
|
||||
s32 index;
|
||||
|
||||
if (GameInteractor_SecondCollisionUpdate()) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (FrameAdvance_IsEnabled(play) == true) {
|
||||
return -1;
|
||||
}
|
||||
@@ -1290,15 +1275,9 @@ s32 CollisionCheck_SetAC(PlayState* play, CollisionCheckContext* colChkCtx, Coll
|
||||
s32 CollisionCheck_SetAC_SAC(PlayState* play, CollisionCheckContext* colChkCtx, Collider* collider,
|
||||
s32 index) {
|
||||
ASSERT(collider->shape <= COLSHAPE_QUAD);
|
||||
|
||||
if (GameInteractor_SecondCollisionUpdate()) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (FrameAdvance_IsEnabled(play) == true) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
sACResetFuncs[collider->shape](play, collider);
|
||||
if (collider->actor != NULL && collider->actor->update == NULL) {
|
||||
return -1;
|
||||
@@ -1336,10 +1315,6 @@ static ColChkResetFunc sOCResetFuncs[] = {
|
||||
s32 CollisionCheck_SetOC(PlayState* play, CollisionCheckContext* colChkCtx, Collider* collider) {
|
||||
s32 index;
|
||||
|
||||
if (GameInteractor_SecondCollisionUpdate()) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (FrameAdvance_IsEnabled(play) == true) {
|
||||
return -1;
|
||||
}
|
||||
@@ -1370,15 +1345,9 @@ s32 CollisionCheck_SetOC(PlayState* play, CollisionCheckContext* colChkCtx, Coll
|
||||
*/
|
||||
s32 CollisionCheck_SetOC_SAC(PlayState* play, CollisionCheckContext* colChkCtx, Collider* collider,
|
||||
s32 index) {
|
||||
|
||||
if (GameInteractor_SecondCollisionUpdate()) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (FrameAdvance_IsEnabled(play) == true) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
ASSERT(collider->shape <= COLSHAPE_QUAD);
|
||||
sOCResetFuncs[collider->shape](play, collider);
|
||||
if (collider->actor != NULL && collider->actor->update == NULL) {
|
||||
@@ -1411,10 +1380,6 @@ s32 CollisionCheck_SetOC_SAC(PlayState* play, CollisionCheckContext* colChkCtx,
|
||||
s32 CollisionCheck_SetOCLine(PlayState* play, CollisionCheckContext* colChkCtx, OcLine* collider) {
|
||||
s32 index;
|
||||
|
||||
if (GameInteractor_SecondCollisionUpdate()) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (FrameAdvance_IsEnabled(play) == true) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -84,15 +84,8 @@ void ArmsHook_Destroy(Actor* thisx, PlayState* play) {
|
||||
void ArmsHook_Wait(ArmsHook* this, PlayState* play) {
|
||||
if (this->actor.parent == NULL) {
|
||||
Player* player = GET_PLAYER(play);
|
||||
s32 length;
|
||||
if (player->heldItemAction == PLAYER_IA_HOOKSHOT) {
|
||||
length = Rand_ZeroOne() * 2 * 13;
|
||||
} else {
|
||||
length = Rand_ZeroOne() * 2 * 26;
|
||||
}
|
||||
|
||||
// get correct timer length for hookshot or longshot
|
||||
//s32 length = ((player->heldItemAction == PLAYER_IA_HOOKSHOT) ? 13 : 26) * CVarGetFloat("gCheatHookshotReachMultiplier", 1.0f);
|
||||
s32 length = ((player->heldItemAction == PLAYER_IA_HOOKSHOT) ? 13 : 26) * CVarGetFloat("gCheatHookshotReachMultiplier", 1.0f);
|
||||
|
||||
ArmsHook_SetupAction(this, ArmsHook_Shoot);
|
||||
func_8002D9A4(&this->actor, 20.0f);
|
||||
|
||||
@@ -69,7 +69,7 @@ void func_8087B7E8(BgHaka* this, PlayState* play) {
|
||||
Player* player = GET_PLAYER(play);
|
||||
|
||||
if (this->dyna.unk_150 != 0.0f) {
|
||||
if (play->sceneNum == SCENE_SPOT02 && !LINK_IS_ADULT && IS_DAY && !gSaveContext.n64ddFlag && !CVarGetInteger("gDayGravePull", 0)) {
|
||||
if (play->sceneNum == SCENE_SPOT02 && !LINK_IS_ADULT && IS_DAY && !CVarGetInteger("gDayGravePull", 0)) {
|
||||
this->dyna.unk_150 = 0.0f;
|
||||
player->stateFlags2 &= ~0x10;
|
||||
if (!Play_InCsMode(play)) {
|
||||
|
||||
@@ -35,7 +35,7 @@ void BossDodongo_DrawEffects(PlayState* play);
|
||||
void BossDodongo_UpdateEffects(PlayState* play);
|
||||
|
||||
const ActorInit Boss_Dodongo_InitVars = {
|
||||
ACTOR_BOSS_DODONGO,
|
||||
ACTOR_EN_DODONGO,
|
||||
ACTORCAT_BOSS,
|
||||
FLAGS,
|
||||
OBJECT_KINGDODONGO,
|
||||
|
||||
@@ -568,6 +568,8 @@ void DoorWarp1_ChildWarpOut(DoorWarp1* this, PlayState* play) {
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
play->nextEntranceIndex = 0x0457;
|
||||
gSaveContext.nextCutsceneIndex = 0;
|
||||
// Skip Mido complaining about dead Deku tree
|
||||
Flags_SetEventChkInf(EVENTCHKINF_SPOKE_TO_MIDO_AFTER_DEKU_TREES_DEATH);
|
||||
} else {
|
||||
Item_Give(play, ITEM_KOKIRI_EMERALD);
|
||||
play->nextEntranceIndex = 0xEE;
|
||||
|
||||
@@ -624,12 +624,14 @@ void EnBox_Update(Actor* thisx, PlayState* play) {
|
||||
|
||||
void EnBox_UpdateSizeAndTexture(EnBox* this, PlayState* play) {
|
||||
EnBox_CreateExtraChestTextures();
|
||||
int cvar = CVarGetInteger("gChestSizeAndTextureMatchesContents", 0);
|
||||
int agonyCVar = CVarGetInteger("gChestSizeDependsStoneOfAgony", 0);
|
||||
int stoneCheck = CHECK_QUEST_ITEM(QUEST_STONE_OF_AGONY);
|
||||
int cstmc = CVarGetInteger("gChestSizeAndTextureMatchesContents", 0);
|
||||
int requiresStoneAgony = CVarGetInteger("gChestSizeDependsStoneOfAgony", 0);
|
||||
GetItemCategory getItemCategory;
|
||||
|
||||
if (play->sceneNum != SCENE_TAKARAYA && cvar > 0 && ((agonyCVar > 0 && stoneCheck) | agonyCVar == 0)) {
|
||||
int isVanilla = cstmc == 0 || (requiresStoneAgony && !CHECK_QUEST_ITEM(QUEST_STONE_OF_AGONY)) ||
|
||||
(play->sceneNum == SCENE_TAKARAYA && this->dyna.actor.room != 6); // Exclude treasure game chests except for the final room
|
||||
|
||||
if (!isVanilla) {
|
||||
getItemCategory = this->getItemEntry.getItemCategory;
|
||||
// If they don't have bombchu's yet consider the bombchu item major
|
||||
if (this->getItemEntry.gid == GID_BOMBCHU && INV_CONTENT(ITEM_BOMBCHU) != ITEM_BOMBCHU) {
|
||||
@@ -645,7 +647,8 @@ void EnBox_UpdateSizeAndTexture(EnBox* this, PlayState* play) {
|
||||
}
|
||||
}
|
||||
|
||||
if (play->sceneNum != SCENE_TAKARAYA && (cvar == 1 || cvar == 3) && ((agonyCVar > 0 && stoneCheck) | agonyCVar == 0)) {
|
||||
// Change size
|
||||
if (!isVanilla && (cstmc == 1 || cstmc == 3)) {
|
||||
switch (getItemCategory) {
|
||||
case ITEM_CATEGORY_JUNK:
|
||||
case ITEM_CATEGORY_SMALL_KEY:
|
||||
@@ -673,7 +676,8 @@ void EnBox_UpdateSizeAndTexture(EnBox* this, PlayState* play) {
|
||||
}
|
||||
}
|
||||
|
||||
if (play->sceneNum != SCENE_TAKARAYA && (cvar == 1 || cvar == 2) && ((agonyCVar > 0 && stoneCheck) | agonyCVar == 0)) {
|
||||
// Change texture
|
||||
if (!isVanilla && (cstmc == 1 || cstmc == 2)) {
|
||||
switch (getItemCategory) {
|
||||
case ITEM_CATEGORY_MAJOR:
|
||||
this->boxBodyDL = gGoldTreasureChestChestFrontDL;
|
||||
|
||||
@@ -136,11 +136,7 @@ void EnChanger_Init(Actor* thisx, PlayState* play2) {
|
||||
this->rightChestGetItemId = GI_DOOR_KEY;
|
||||
rightChestItem = ITEM_ETC_KEY_SMALL_CHEST_GAME;
|
||||
|
||||
uint8_t roomNum = play->roomCtx.curRoom.num;
|
||||
uint8_t leftSideKey = roomNum == 1 || roomNum == 2 || roomNum == 5;
|
||||
// Solution: LLRRL
|
||||
|
||||
if (leftSideKey) {
|
||||
if (Rand_ZeroFloat(1.99f) < 1.0f) {
|
||||
rightChestParams = (sLoserGetItemIds[play->roomCtx.curRoom.num] << 5) | 0x4000;
|
||||
this->rightChestNum = new_var;
|
||||
this->rightChestGetItemId = sLoserGetItemIds[play->roomCtx.curRoom.num];
|
||||
|
||||
@@ -136,19 +136,22 @@ void EnDntDemo_Judge(EnDntDemo* this, PlayState* play) {
|
||||
}
|
||||
} else {
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
Player* player = GET_PLAYER(play);
|
||||
switch (Player_GetMask(play)) {
|
||||
case PLAYER_MASK_SKULL:
|
||||
if (!Flags_GetTreasure(play, 0x1F)) {
|
||||
if (!Flags_GetTreasure(play, 0x1F) && !Player_InBlockingCsMode(play, player)) {
|
||||
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_DEKU_THEATER_SKULL_MASK, GI_STICK_UPGRADE_30);
|
||||
GiveItemEntryWithoutActor(play, getItemEntry);
|
||||
Flags_SetTreasure(play, 0x1F);
|
||||
player->pendingFlag.flagID = 0x1F;
|
||||
player->pendingFlag.flagType = FLAG_SCENE_TREASURE;
|
||||
}
|
||||
break;
|
||||
case PLAYER_MASK_TRUTH:
|
||||
if (!Flags_GetTreasure(play, 0x1E)) {
|
||||
if (!Flags_GetTreasure(play, 0x1E) && !Player_InBlockingCsMode(play, player)) {
|
||||
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_DEKU_THEATER_MASK_OF_TRUTH, GI_NUT_UPGRADE_40);
|
||||
GiveItemEntryWithoutActor(play, getItemEntry);
|
||||
Flags_SetTreasure(play, 0x1E);
|
||||
player->pendingFlag.flagID = 0x1E;
|
||||
player->pendingFlag.flagType = FLAG_SCENE_TREASURE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
|
||||
#include "z_en_elf.h"
|
||||
#include "objects/gameplay_keep/gameplay_keep.h"
|
||||
#include "overlays/actors/ovl_En_Niw/z_en_niw.h"
|
||||
|
||||
#define FLAGS (ACTOR_FLAG_4 | ACTOR_FLAG_5 | ACTOR_FLAG_25)
|
||||
|
||||
@@ -1432,32 +1431,6 @@ void func_80A053F0(Actor* thisx, PlayState* play) {
|
||||
} else if (!(this->fairyFlags & 0x80)) {
|
||||
gSaveContext.naviTimer = 0;
|
||||
}
|
||||
|
||||
// Unequip current shield randomly. Averages once every 1000 frames AKA 1000/20 = 50 seconds.
|
||||
if (Rand_ZeroOne() < 0.001f) {
|
||||
player->currentShield = PLAYER_SHIELD_NONE;
|
||||
}
|
||||
|
||||
// Unequip current equipped C and dpad buttons. Averages once every 10000 frames AKA 10000/20 = 500 seconds.
|
||||
if (Rand_ZeroOne() < 0.0001f) {
|
||||
gSaveContext.equips.buttonItems[1] = gSaveContext.equips.buttonItems[2] =
|
||||
gSaveContext.equips.buttonItems[3] = ITEM_NONE;
|
||||
gSaveContext.equips.buttonItems[4] = gSaveContext.equips.buttonItems[5] =
|
||||
gSaveContext.equips.buttonItems[6] = gSaveContext.equips.buttonItems[7] = ITEM_NONE;
|
||||
}
|
||||
|
||||
// Unequip ocarina when set to dpad down.
|
||||
if (gSaveContext.equips.buttonItems[5] == ITEM_OCARINA_FAIRY ||
|
||||
gSaveContext.equips.buttonItems[5] == ITEM_OCARINA_TIME) {
|
||||
gSaveContext.equips.buttonItems[5] = ITEM_NONE;
|
||||
}
|
||||
|
||||
// Randomly spawn a cucco storm. Averages once every 12500 frames AKA 12500/20 = 625 seconds.
|
||||
if (Rand_ZeroOne() < 0.00008f) {
|
||||
EnNiw* cucco = (EnNiw*)Actor_Spawn(&play->actorCtx, gPlayState, ACTOR_EN_NIW, player->actor.world.pos.x,
|
||||
player->actor.world.pos.y + 2200, player->actor.world.pos.z, 0, 0, 0, 0, 0);
|
||||
cucco->actionFunc = func_80AB70A0_nocutscene;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -301,7 +301,7 @@ s32 EnKz_FollowPath(EnKz* this, PlayState* play) {
|
||||
pathDiffZ = pointPos->z - this->actor.world.pos.z;
|
||||
Math_SmoothStepToS(&this->actor.world.rot.y, (Math_FAtan2F(pathDiffX, pathDiffZ) * (0x8000 / M_PI)), 0xA, 0x3E8, 1);
|
||||
|
||||
if ((SQ(pathDiffX) + SQ(pathDiffZ)) < 10.0f * 0.2f) {
|
||||
if ((SQ(pathDiffX) + SQ(pathDiffZ)) < 10.0f * CVarGetInteger("gMweepSpeed", 1)) {
|
||||
this->waypoint++;
|
||||
if (this->waypoint >= path->count) {
|
||||
this->waypoint = 0;
|
||||
@@ -413,7 +413,7 @@ void EnKz_SetupMweep(EnKz* this, PlayState* play) {
|
||||
initPos.z += 260.0f;
|
||||
Play_CameraSetAtEye(play, this->cutsceneCamera, &pos, &initPos);
|
||||
func_8002DF54(play, &this->actor, 8);
|
||||
this->actor.speedXZ = 0.1f * 0.2f;
|
||||
this->actor.speedXZ = 0.1f * CVarGetInteger("gMweepSpeed", 1);
|
||||
this->actionFunc = EnKz_Mweep;
|
||||
}
|
||||
|
||||
|
||||
@@ -372,8 +372,11 @@ u16 EnMd_GetTextKokiriForest(PlayState* play, EnMd* this) {
|
||||
this->unk_208 = 0;
|
||||
this->unk_209 = TEXT_STATE_NONE;
|
||||
|
||||
// In rando, skip talking about the tree being dead so we can have the prompt sword and shield instead
|
||||
if (!gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD)) {
|
||||
// In rando, skip talking about the tree being dead so we can have the prompt for sword and shield instead
|
||||
if ((!gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD)) ||
|
||||
(gSaveContext.n64ddFlag && Flags_GetEventChkInf(EVENTCHKINF_SHOWED_MIDO_SWORD_SHIELD) &&
|
||||
Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_DEKU_TREE) &&
|
||||
!Flags_GetEventChkInf(EVENTCHKINF_SPOKE_TO_MIDO_AFTER_DEKU_TREES_DEATH))) {
|
||||
return 0x1045;
|
||||
}
|
||||
|
||||
@@ -492,6 +495,7 @@ u8 EnMd_ShouldSpawn(EnMd* this, PlayState* play) {
|
||||
}
|
||||
|
||||
if (Flags_GetEventChkInf(EVENTCHKINF_SHOWED_MIDO_SWORD_SHIELD) &&
|
||||
Flags_GetEventChkInf(EVENTCHKINF_SPOKE_TO_MIDO_AFTER_DEKU_TREES_DEATH) &&
|
||||
(Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_ZELDAS_LETTER) ||
|
||||
Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_KOKIRI_EMERALD_DEKU_TREE_DEAD))) {
|
||||
return play->sceneNum == SCENE_KOKIRI_HOME4 && !LINK_IS_ADULT;
|
||||
@@ -677,7 +681,8 @@ void EnMd_Init(Actor* thisx, PlayState* play) {
|
||||
|
||||
if (((play->sceneNum == SCENE_SPOT04) && !(gSaveContext.eventChkInf[0] & 0x10)) ||
|
||||
((play->sceneNum == SCENE_SPOT04) && (gSaveContext.eventChkInf[0] & 0x10) &&
|
||||
CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD)) ||
|
||||
((!gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD)) ||
|
||||
(gSaveContext.n64ddFlag && Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_DEKU_TREE)))) ||
|
||||
((play->sceneNum == SCENE_SPOT10) && !(gSaveContext.eventChkInf[0] & 0x400))) {
|
||||
this->actor.home.pos = this->actor.world.pos;
|
||||
this->actionFunc = func_80AAB948;
|
||||
@@ -738,7 +743,9 @@ void func_80AAB948(EnMd* this, PlayState* play) {
|
||||
}
|
||||
|
||||
if (this->interactInfo.talkState == NPC_TALK_STATE_ACTION) {
|
||||
if (CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) && !(gSaveContext.eventChkInf[1] & 0x1000) &&
|
||||
if ((!gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) ||
|
||||
gSaveContext.n64ddFlag && Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_DEKU_TREE) &&
|
||||
Flags_GetEventChkInf(EVENTCHKINF_SHOWED_MIDO_SWORD_SHIELD)) && !(gSaveContext.eventChkInf[1] & 0x1000) &&
|
||||
(play->sceneNum == SCENE_SPOT04)) {
|
||||
play->msgCtx.msgMode = MSGMODE_PAUSED;
|
||||
}
|
||||
@@ -805,7 +812,9 @@ void func_80AABD0C(EnMd* this, PlayState* play) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) && !(gSaveContext.eventChkInf[1] & 0x1000) &&
|
||||
if ((!gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) ||
|
||||
gSaveContext.n64ddFlag && Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_DEKU_TREE) &&
|
||||
Flags_GetEventChkInf(EVENTCHKINF_SHOWED_MIDO_SWORD_SHIELD)) && !(gSaveContext.eventChkInf[1] & 0x1000) &&
|
||||
(play->sceneNum == SCENE_SPOT04)) {
|
||||
Message_CloseTextbox(play);
|
||||
gSaveContext.eventChkInf[1] |= 0x1000;
|
||||
|
||||
@@ -189,14 +189,12 @@ void EnPoRelay_Race(EnPoRelay* this, PlayState* play) {
|
||||
Vec3f vec;
|
||||
f32 speed;
|
||||
f32 multiplier;
|
||||
int16_t minFireTimer = 8.0f;
|
||||
f32 chanceForFire = 1.0f;
|
||||
|
||||
if (this->actionTimer != 0) {
|
||||
this->actionTimer--;
|
||||
}
|
||||
if (this->actionTimer == 0 && Rand_ZeroOne() < chanceForFire) {
|
||||
this->actionTimer = minFireTimer;
|
||||
if (this->actionTimer == 0 && Rand_ZeroOne() < 0.03f) {
|
||||
this->actionTimer = 32;
|
||||
if (this->pathIndex < 23) {
|
||||
speed = Rand_ZeroOne() * 3.0f;
|
||||
if (speed < 1.0f) {
|
||||
|
||||
@@ -103,11 +103,6 @@ void func_80AFB768(EnSi* this, PlayState* play) {
|
||||
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
Randomizer_UpdateSkullReward(this, play);
|
||||
if (getItemId != RG_ICE_TRAP) {
|
||||
Randomizer_GiveSkullReward(this, play);
|
||||
} else {
|
||||
gSaveContext.pendingIceTrapCount++;
|
||||
}
|
||||
} else {
|
||||
Item_Give(play, giveItemId);
|
||||
}
|
||||
@@ -122,8 +117,14 @@ void func_80AFB768(EnSi* this, PlayState* play) {
|
||||
|
||||
Message_StartTextbox(play, textId, NULL);
|
||||
|
||||
if (gSaveContext.n64ddFlag && getItemId != RG_ICE_TRAP) {
|
||||
Audio_PlayFanfare_Rando(getItem);
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
if (getItemId != RG_ICE_TRAP) {
|
||||
Randomizer_GiveSkullReward(this, play);
|
||||
Audio_PlayFanfare_Rando(getItem);
|
||||
} else {
|
||||
gSaveContext.pendingIceTrapCount++;
|
||||
Audio_PlayFanfare(NA_BGM_SMALL_ITEM_GET);
|
||||
}
|
||||
} else {
|
||||
Audio_PlayFanfare(NA_BGM_SMALL_ITEM_GET);
|
||||
}
|
||||
@@ -148,19 +149,20 @@ void func_80AFB89C(EnSi* this, PlayState* play) {
|
||||
if (!CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_13)) {
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
Randomizer_UpdateSkullReward(this, play);
|
||||
if (getItemId != RG_ICE_TRAP) {
|
||||
Randomizer_GiveSkullReward(this, play);
|
||||
} else {
|
||||
gSaveContext.pendingIceTrapCount++;
|
||||
}
|
||||
} else {
|
||||
Item_Give(play, giveItemId);
|
||||
}
|
||||
|
||||
Message_StartTextbox(play, textId, NULL);
|
||||
|
||||
if (gSaveContext.n64ddFlag && getItemId != RG_ICE_TRAP) {
|
||||
Audio_PlayFanfare_Rando(getItem);
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
if (getItemId != RG_ICE_TRAP) {
|
||||
Randomizer_GiveSkullReward(this, play);
|
||||
Audio_PlayFanfare_Rando(getItem);
|
||||
} else {
|
||||
gSaveContext.pendingIceTrapCount++;
|
||||
Audio_PlayFanfare(NA_BGM_SMALL_ITEM_GET);
|
||||
}
|
||||
} else {
|
||||
Audio_PlayFanfare(NA_BGM_SMALL_ITEM_GET);
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ void Fishing_UpdateFish(Actor* thisx, PlayState* play);
|
||||
void Fishing_UpdateOwner(Actor* thisx, PlayState* play);
|
||||
void Fishing_DrawFish(Actor* thisx, PlayState* play);
|
||||
void Fishing_DrawOwner(Actor* thisx, PlayState* play);
|
||||
void Fishing_Reset(void);
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 unk_00;
|
||||
@@ -132,7 +133,7 @@ const ActorInit Fishing_InitVars = {
|
||||
(ActorFunc)Fishing_Destroy,
|
||||
(ActorFunc)Fishing_UpdateFish,
|
||||
(ActorFunc)Fishing_DrawFish,
|
||||
NULL,
|
||||
(ActorResetFunc)Fishing_Reset,
|
||||
};
|
||||
|
||||
static f32 D_80B7A650 = 0.0f;
|
||||
@@ -5888,3 +5889,10 @@ void Fishing_DrawOwner(Actor* thisx, PlayState* play) {
|
||||
|
||||
CLOSE_DISPS(play->state.gfxCtx);
|
||||
}
|
||||
|
||||
void Fishing_Reset(void) {
|
||||
// Reset static variables for fishing camera and cinematic state to prevent crashing when dying
|
||||
// or re-entering the scene while the fishing rod was cast
|
||||
sCameraId = 0;
|
||||
D_80B7A6CC = 0;
|
||||
}
|
||||
|
||||
@@ -2785,7 +2785,7 @@ s32 func_808359FC(Player* this, PlayState* play) {
|
||||
this->boomerangActor = &boomerang->actor;
|
||||
if (boomerang != NULL) {
|
||||
boomerang->moveTo = this->unk_664;
|
||||
boomerang->returnTimer = 100;
|
||||
boomerang->returnTimer = 20;
|
||||
this->stateFlags1 |= PLAYER_STATE1_25;
|
||||
if (!func_8008E9C4(this)) {
|
||||
func_808355DC(this);
|
||||
@@ -7734,7 +7734,7 @@ void func_80842180(Player* this, PlayState* play) {
|
||||
}
|
||||
|
||||
if (CVarGetInteger("gMMBunnyHood", 0) && this->currentMask == PLAYER_MASK_BUNNY) {
|
||||
sp2C *= -6.0f;
|
||||
sp2C *= 1.5f;
|
||||
}
|
||||
|
||||
if (CVarGetInteger("gEnableWalkModify", 0)) {
|
||||
@@ -8654,10 +8654,8 @@ void func_80844708(Player* this, PlayState* play) {
|
||||
func_8083A060(this, play);
|
||||
}
|
||||
} else {
|
||||
f32 rand = Rand_ZeroOne();
|
||||
uint8_t randomBonk = (rand <= .05);
|
||||
if (this->linearVelocity >= 7.0f) {
|
||||
if (randomBonk || ((this->actor.bgCheckFlags & 0x200) && (D_8085360C < 0x2000)) ||
|
||||
if (((this->actor.bgCheckFlags & 0x200) && (D_8085360C < 0x2000)) ||
|
||||
((this->cylinder.base.ocFlags1 & OC1_HIT) &&
|
||||
(cylinderOc = this->cylinder.base.oc,
|
||||
((cylinderOc->id == ACTOR_EN_WOOD02) &&
|
||||
@@ -9937,7 +9935,7 @@ s32 func_80847A78(Player* this) {
|
||||
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
if (!cond) {
|
||||
this->hoverBootsTimer = 38;
|
||||
this->hoverBootsTimer = 19;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -11030,26 +11028,6 @@ void Player_Update(Actor* thisx, PlayState* play) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (this->stateFlags1 & PLAYER_STATE1_21) {
|
||||
this->actor.shape.rot.x = 31000;
|
||||
this->actor.shape.rot.z = 16000;
|
||||
} else if (this->actor.shape.rot.x == 31000 || this->actor.shape.rot.z == 16000) {
|
||||
this->actor.shape.rot.x = 0;
|
||||
this->actor.shape.rot.z = 0;
|
||||
}
|
||||
|
||||
if (this->actor.scale.x == 0.01f) {
|
||||
this->actor.scale.x = 0.009f;
|
||||
}
|
||||
|
||||
if (this->actor.scale.y == 0.01f) {
|
||||
this->actor.scale.y = 0.009f;
|
||||
}
|
||||
|
||||
if (this->actor.scale.z == 0.01f) {
|
||||
this->actor.scale.z = 0.009f;
|
||||
}
|
||||
|
||||
switch (GameInteractor_GravityLevel()) {
|
||||
case GI_GRAVITY_LEVEL_HEAVY:
|
||||
this->actor.gravity = -4.0f;
|
||||
@@ -11060,10 +11038,6 @@ void Player_Update(Actor* thisx, PlayState* play) {
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (this->currentBoots == PLAYER_BOOTS_IRON) {
|
||||
this->actor.gravity = -10.0f;
|
||||
}
|
||||
|
||||
GameInteractor_ExecuteOnPlayerUpdate();
|
||||
}
|
||||
@@ -11124,9 +11098,9 @@ void Player_DrawGameplay(PlayState* play, Player* this, s32 lod, Gfx* cullDList,
|
||||
s32 sp5C;
|
||||
s32 hoverBootsTimer = this->hoverBootsTimer;
|
||||
|
||||
if (this->hoverBootsTimer < 38) {
|
||||
if (this->hoverBootsTimer < 19) {
|
||||
if (hoverBootsTimer >= 15) {
|
||||
D_8085486C = 255.0f;
|
||||
D_8085486C = (19 - hoverBootsTimer) * 51.0f;
|
||||
} else if (hoverBootsTimer < 19) {
|
||||
sp5C = hoverBootsTimer;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user