2022-03-21 21:51:23 -04:00
|
|
|
|
#include "global.h"
|
|
|
|
|
#include "vt.h"
|
|
|
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
|
|
#include "soh/Enhancements/gameconsole.h"
|
2022-11-14 05:22:34 -05:00
|
|
|
|
#include <ImGuiImpl.h>
|
2022-05-13 18:43:55 -04:00
|
|
|
|
#include "soh/frame_interpolation.h"
|
2022-09-27 22:41:17 -04:00
|
|
|
|
#include "soh/Enhancements/debugconsole.h"
|
2022-11-14 06:13:21 -05:00
|
|
|
|
#include "soh/Enhancements/randomizer/randomizer_entrance.h"
|
2022-09-27 22:41:17 -04:00
|
|
|
|
#include <overlays/actors/ovl_En_Niw/z_en_niw.h>
|
2022-05-13 18:43:55 -04:00
|
|
|
|
|
2022-08-02 23:48:41 -04:00
|
|
|
|
#include <time.h>
|
|
|
|
|
|
2022-03-21 21:51:23 -04:00
|
|
|
|
void* D_8012D1F0 = NULL;
|
|
|
|
|
//UNK_TYPE D_8012D1F4 = 0; // unused
|
|
|
|
|
Input* D_8012D1F8 = NULL;
|
|
|
|
|
|
|
|
|
|
TransitionUnk sTrnsnUnk;
|
|
|
|
|
s32 gTrnsnUnkState;
|
|
|
|
|
VisMono D_80161498;
|
|
|
|
|
Color_RGBA8_u32 D_801614B0;
|
|
|
|
|
FaultClient D_801614B8;
|
|
|
|
|
s16 D_801614C8;
|
|
|
|
|
#if 0
|
|
|
|
|
u64 D_801614D0[0xA00];
|
|
|
|
|
#endif
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
PlayState* gPlayState;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
void func_800BC450(PlayState* play) {
|
|
|
|
|
Camera_ChangeDataIdx(GET_ACTIVE_CAM(play), play->unk_1242B - 1);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
void func_800BC490(PlayState* play, s16 point) {
|
2022-07-05 19:29:34 -04:00
|
|
|
|
ASSERT(point == 1 || point == 2);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
play->unk_1242B = point;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
|
|
|
|
if ((YREG(15) != 0x10) && (gSaveContext.cutsceneIndex < 0xFFF0)) {
|
|
|
|
|
Audio_PlaySoundGeneral((point == 1) ? NA_SE_SY_CAMERA_ZOOM_DOWN : NA_SE_SY_CAMERA_ZOOM_UP, &D_801333D4, 4,
|
|
|
|
|
&D_801333E0, &D_801333E0, &D_801333E8);
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
func_800BC450(play);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
s32 func_800BC56C(PlayState* play, s16 arg1) {
|
|
|
|
|
return (arg1 == play->unk_1242B);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// original name: "Game_play_shop_pr_vr_switch_set"
|
2022-11-06 03:24:34 -05:00
|
|
|
|
void func_800BC590(PlayState* play) {
|
2022-03-21 21:51:23 -04:00
|
|
|
|
osSyncPrintf("Game_play_shop_pr_vr_switch_set()\n");
|
|
|
|
|
|
|
|
|
|
if (YREG(15) == 0x10) {
|
2022-11-06 03:24:34 -05:00
|
|
|
|
play->unk_1242B = 2;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
void func_800BC5E0(PlayState* play, s32 transitionType) {
|
|
|
|
|
TransitionContext* transitionCtx = &play->transitionCtx;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
|
|
|
|
memset(transitionCtx,0, sizeof(TransitionContext));
|
|
|
|
|
|
|
|
|
|
transitionCtx->transitionType = transitionType;
|
|
|
|
|
|
|
|
|
|
if ((transitionCtx->transitionType >> 5) == 1) {
|
|
|
|
|
transitionCtx->init = TransitionCircle_Init;
|
|
|
|
|
transitionCtx->destroy = TransitionCircle_Destroy;
|
|
|
|
|
transitionCtx->start = TransitionCircle_Start;
|
|
|
|
|
transitionCtx->isDone = TransitionCircle_IsDone;
|
|
|
|
|
transitionCtx->draw = TransitionCircle_Draw;
|
|
|
|
|
transitionCtx->update = TransitionCircle_Update;
|
|
|
|
|
transitionCtx->setType = TransitionCircle_SetType;
|
|
|
|
|
transitionCtx->setColor = TransitionCircle_SetColor;
|
|
|
|
|
transitionCtx->setEnvColor = TransitionCircle_SetEnvColor;
|
|
|
|
|
} else {
|
|
|
|
|
switch (transitionCtx->transitionType) {
|
|
|
|
|
case 1:
|
|
|
|
|
transitionCtx->init = TransitionTriforce_Init;
|
|
|
|
|
transitionCtx->destroy = TransitionTriforce_Destroy;
|
|
|
|
|
transitionCtx->start = TransitionTriforce_Start;
|
|
|
|
|
transitionCtx->isDone = TransitionTriforce_IsDone;
|
|
|
|
|
transitionCtx->draw = TransitionTriforce_Draw;
|
|
|
|
|
transitionCtx->update = TransitionTriforce_Update;
|
|
|
|
|
transitionCtx->setType = TransitionTriforce_SetType;
|
|
|
|
|
transitionCtx->setColor = TransitionTriforce_SetColor;
|
|
|
|
|
transitionCtx->setEnvColor = NULL;
|
|
|
|
|
break;
|
|
|
|
|
case 0:
|
|
|
|
|
case 8:
|
|
|
|
|
transitionCtx->init = TransitionWipe_Init;
|
|
|
|
|
transitionCtx->destroy = TransitionWipe_Destroy;
|
|
|
|
|
transitionCtx->start = TransitionWipe_Start;
|
|
|
|
|
transitionCtx->isDone = TransitionWipe_IsDone;
|
|
|
|
|
transitionCtx->draw = TransitionWipe_Draw;
|
|
|
|
|
transitionCtx->update = TransitionWipe_Update;
|
|
|
|
|
transitionCtx->setType = TransitionWipe_SetType;
|
|
|
|
|
transitionCtx->setColor = TransitionWipe_SetColor;
|
|
|
|
|
transitionCtx->setEnvColor = NULL;
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
case 3:
|
|
|
|
|
case 4:
|
|
|
|
|
case 5:
|
|
|
|
|
case 6:
|
|
|
|
|
case 7:
|
|
|
|
|
case 13:
|
|
|
|
|
case 17:
|
|
|
|
|
case 18:
|
|
|
|
|
case 19:
|
|
|
|
|
transitionCtx->init = TransitionFade_Init;
|
|
|
|
|
transitionCtx->destroy = TransitionFade_Destroy;
|
|
|
|
|
transitionCtx->start = TransitionFade_Start;
|
|
|
|
|
transitionCtx->isDone = TransitionFade_IsDone;
|
|
|
|
|
transitionCtx->draw = TransitionFade_Draw;
|
|
|
|
|
transitionCtx->update = TransitionFade_Update;
|
|
|
|
|
transitionCtx->setType = TransitionFade_SetType;
|
|
|
|
|
transitionCtx->setColor = TransitionFade_SetColor;
|
|
|
|
|
transitionCtx->setEnvColor = NULL;
|
|
|
|
|
break;
|
|
|
|
|
case 9:
|
|
|
|
|
case 10:
|
2022-11-06 03:24:34 -05:00
|
|
|
|
play->transitionMode = 4;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
break;
|
|
|
|
|
case 11:
|
2022-11-06 03:24:34 -05:00
|
|
|
|
play->transitionMode = 10;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
break;
|
|
|
|
|
case 12:
|
2022-11-06 03:24:34 -05:00
|
|
|
|
play->transitionMode = 7;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
break;
|
|
|
|
|
case 14:
|
2022-11-06 03:24:34 -05:00
|
|
|
|
play->transitionMode = 12;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
break;
|
|
|
|
|
case 15:
|
2022-11-06 03:24:34 -05:00
|
|
|
|
play->transitionMode = 14;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
break;
|
|
|
|
|
case 16:
|
2022-11-06 03:24:34 -05:00
|
|
|
|
play->transitionMode = 16;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
break;
|
|
|
|
|
default:
|
2022-07-05 19:29:34 -04:00
|
|
|
|
Fault_AddHungupAndCrash(__FILE__, __LINE__);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
void func_800BC88C(PlayState* play) {
|
|
|
|
|
play->transitionCtx.transitionType = -1;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
Gfx* Play_SetFog(PlayState* play, Gfx* gfx) {
|
|
|
|
|
return Gfx_SetFog2(gfx, play->lightCtx.fogColor[0], play->lightCtx.fogColor[1],
|
|
|
|
|
play->lightCtx.fogColor[2], 0, play->lightCtx.fogNear, 1000);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
void Play_Destroy(GameState* thisx) {
|
|
|
|
|
PlayState* play = (PlayState*)thisx;
|
|
|
|
|
Player* player = GET_PLAYER(play);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
2022-11-14 20:02:07 -05:00
|
|
|
|
|
|
|
|
|
// Only initialize the frame counter when exiting the title screen
|
|
|
|
|
if (gSaveContext.fileNum == 0xFF) {
|
|
|
|
|
play->gameplayFrames = 0;
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-14 06:13:21 -05:00
|
|
|
|
// In ER, remove link from epona when entering somewhere that doesn't support epona
|
|
|
|
|
if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHUFFLE_OVERWORLD_ENTRANCES)) {
|
|
|
|
|
Entrance_HandleEponaState();
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
play->state.gfxCtx->callback = NULL;
|
|
|
|
|
play->state.gfxCtx->callbackParam = 0;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
SREG(91) = 0;
|
|
|
|
|
R_PAUSE_MENU_MODE = 0;
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
PreRender_Destroy(&play->pauseBgPreRender);
|
|
|
|
|
Effect_DeleteAll(play);
|
|
|
|
|
EffectSs_ClearAll(play);
|
|
|
|
|
CollisionCheck_DestroyContext(play, &play->colChkCtx);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
|
|
|
|
if (gTrnsnUnkState == 3) {
|
|
|
|
|
TransitionUnk_Destroy(&sTrnsnUnk);
|
|
|
|
|
gTrnsnUnkState = 0;
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
if (play->transitionMode == 3) {
|
|
|
|
|
play->transitionCtx.destroy(&play->transitionCtx.data);
|
|
|
|
|
func_800BC88C(play);
|
|
|
|
|
play->transitionMode = 0;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ShrinkWindow_Destroy();
|
2022-11-06 03:24:34 -05:00
|
|
|
|
TransitionFade_Destroy(&play->transitionFade);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
VisMono_Destroy(&D_80161498);
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
if (gSaveContext.linkAge != play->linkAgeOnLoad) {
|
2022-03-21 21:51:23 -04:00
|
|
|
|
Inventory_SwapAgeEquipment();
|
2022-11-06 03:24:34 -05:00
|
|
|
|
Player_SetEquipmentData(play, player);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
func_80031C3C(&play->actorCtx, play);
|
|
|
|
|
func_80110990(play);
|
|
|
|
|
KaleidoScopeCall_Destroy(play);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
KaleidoManager_Destroy();
|
|
|
|
|
ZeldaArena_Cleanup();
|
|
|
|
|
Fault_RemoveClient(&D_801614B8);
|
2022-07-31 21:52:10 -04:00
|
|
|
|
disableBetaQuest();
|
2022-11-06 03:24:34 -05:00
|
|
|
|
gPlayState = NULL;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
void GivePlayerRandoRewardSongOfTime(PlayState* play, RandomizerCheck check) {
|
|
|
|
|
Player* player = GET_PLAYER(play);
|
testing out item replacement (#416)
* skip learning song of storms
* don't set flag when getting goron tunic as child
* Initiates prelude check when master sword unloads.
Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again.
* Stops Shadow Temple lore prompts from appearing in rando.
* Skips cutscene of royal tomb explosion in rando.
Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here.
* Improves visual of exploding gravestone.
* Adds some comments explaining the rando differences
* Skip ruto text box in jabu blue warp
For rando
* skip intro cutscene in dodongo's cavern
* load spoiler files on boot, fix spoilerfile existing check when making new saves
* name entry dropped spoiler logic
* make sure to actually init the cvar
* no chime on load
* uncomment
* Skip ganondrof cutscene
Skip to scream part of the death animation, skipping the text boxes etc. For rando
* Update z_boss_ganondrof.c
* skip owl flight cutscenes in rando
* Fixes skipped text so it only applies to shadow temple.
Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors.
* Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case.
* TEST: Text for item
* Adding ganon flavor text
* ADD: AMMO Count
* format ganon text/hint text
* Autoskip the tower cutscene if settings call for tower collapse.
* ganon hint text logic
* Improved prelude after time travel fix
* swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things.
* this is all i did
* not the cleanest code ever but it's working
* ADD: GS Count
* ADD: Wallter (crash for now)
* TWEAK: Wallet check
* FIX: Use DrawItem instread of DrawUpgrade... b-baka!
* Fixes some vanilla bugs introduced by rando code.
* Added cutscene skip for zelda escaping
Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger
* ADD: X Spacing + Placeholders for song
* ADD: default case for items
* TWEAK: Spacing
* FIX: Light Arrow
* ADD: Ammo Option
* use groups instead
* ADD: More spacing logic
* songs and names
* TWEAK: Color on wallet
* colors
* Added flags cutscene before nabooru fight
* ADD: ChromaKey text
* First attempt skip cs after nabooru defeat
* Better implementation for specific rando cutscene skips
* use pulseaudio defaults
* spaces/tabs
* move color push/pop to stop crash
* make the colors work again
* the real bottle fix
* pulseaudio values tuned for n64 audio at 44.1khz
* update tlength
* remove one hardcoded samplerate
* Cleaned up and fixed zelda escape skip
The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of.
* Revert one line to match original
nothing functional
* another hint line that breaks autonewline logic
* don't autospawn epona if we don't have the song/ocarina
* Trying to use iron knuckle death effects
not working yet
* Streamlined OoT cutscene skip for future additions
Also cleaned up if statement in general
* Made if statement more readable
Also added clarity for what cutscene was skipped
* Fixed typo in comment
* Janky nabooru defeat cs skip
* altar text formatting (gonna need help shortening some of the french ones)
* more altar text formatting
* english altar text formatting complete
* make gtg blocking guard check for card not bridge
* FIX: Typo!
* FIX: Uppercases
* FIX: Typo
* TWEAK: Alter + some names
* TWEAK: More caps!
* ADD: Missing string
TWEAK more uppercases and namefixe
s
* Hide nabooru death by covering her in flames
* bandaid fix for death crash issue
* Twinrova defeat cs skip
Skips the animation and manually calls the function to show the "beam" around the sisters
* fix crash
* fix caps to match
* fix great fairy reward mashing/shielding issue
* TWEAK : Typo clé to Clé
* TWEAK: Some Altar hints
TWEAK: Some capitals
* TWEAK: Unmatching text + some cap again
* TWEAK: More tweaks
* fix build
* remove extra json.hpp, add hint
* Update randomizer_item_tracker.cpp
* TWEAK: Double Defense with RedParticles instead of white
* make sure we don't optimize out the check to ensure a spoilerfile exists
* vanilla ganon boss key hint formatting
* TWEAK: FR- better way of the hero text
* fix
* and again
* Initializes dungeonsDone items in gSaveContext to 0.
* Replaces sizeof calculation with a NUM_DUNGEONS constant.
* Fixes Saria's Gift on the LW Bridge from getting killed when holding shield.
* More airtight fix for Saria's Gift on the Bridge.
* Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId.
* Invalidate text box icon before drawing
* Fixes the case where Saria's gift is an Ice Trap.
We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine.
* Initial commit
Might need changing when we change the settings in the future
* Fixes Door of Time opening cutscene after warping with prelude.
* Initial waterfall skip
Very rudimentary way of doing things but it seems to work so :shrug:
* inital rework
* fixed default rotation for 2D sprites
* fix tab/space issues
* 3d drops rando merge fix again
* Allows Impa to appear in the Lullaby check post drawbridge escape.
* Changes Ganon's Trials Count setting to a checkbox
The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed.
* Sets all Ganon's Trials to incomplete in new saves.
Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131
* fix castle guards when oot throw cutscene has already played in rando
* Properly removes the beams when trials are cleared.
* Removes Question Mark from Skip Ganon's Trials UI.
* Adds a todo comment about when to change back to slider.
* make deku seeds check for bullet bag
* Various tweaks
TWEAK: Altar Text
TWEAK: Hint names
TWEAK: Replace more problematic œ to oe
* upgrade ocarina on both child and adult equips
* FIX: Jabu Item
* update equipped hookshot/longshot when obtained as other age
* add hint
* don't give the bgs check without the claim check
* Skips Darunia Cutscene in Fire Temple
* Added a TODO note about not skipping the cutscene.
There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch.
* remove todo
* restore fast ocarina option in imgui that was lost in merge
* Fixes grey screen issue + tooltip for 2 handed shield
* update to use dg instead of g for textures in item tracker
* TWEAK: Default color for cosmetic RAND button was not the corect one
* fix texture crash, remove unused item tracker code
* don't open mask shop until we get zelda's letter
* Update README.md
* Prevents "correct" chime under incorrect conditions.
* Fixes typo in conditional and adds "bonk" sound effect.
"Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time.
* remove modify dpad equips toggle, replace with checks for dpad menu
* remove extra check
* add ability to hold c-up to assign to dpad when dpad menuing is enabled
* disable d-pad navigation on item menu when holding c-up to equip
* dpad+c-up stuff for equipment menu
* ADD: Checbox for songs colors
* TWEAK: RandoColors for normal songs
* kind of quick and dirty but it works
* TWEAK: Clarity of the tooltip
Co-authored-by: briaguya <briaguya@alice>
Co-authored-by: Christopher Leggett <chris@leggett.dev>
Co-authored-by: aMannus <mannusmenting@gmail.com>
Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com>
Co-authored-by: Dog <5172592+Dog@users.noreply.github.com>
Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com>
Co-authored-by: Baoulettes <perlouzerie@hotmail.fr>
Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
if (gSaveContext.entranceIndex == 0x050F && player != NULL && !Player_InBlockingCsMode(play, player) &&
|
2022-11-29 18:28:57 -05:00
|
|
|
|
!Flags_GetTreasure(play, 0x1F) && gSaveContext.nextTransitionType == 0xFF && !gSaveContext.pendingIceTrapCount) {
|
2022-08-23 20:11:38 -04:00
|
|
|
|
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(check, RG_SONG_OF_TIME);
|
2022-11-06 03:24:34 -05:00
|
|
|
|
GiveItemEntryWithoutActor(play, getItemEntry);
|
2022-08-02 18:09:53 -04:00
|
|
|
|
player->pendingFlag.flagID = 0x1F;
|
|
|
|
|
player->pendingFlag.flagType = FLAG_SCENE_TREASURE;
|
testing out item replacement (#416)
* skip learning song of storms
* don't set flag when getting goron tunic as child
* Initiates prelude check when master sword unloads.
Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again.
* Stops Shadow Temple lore prompts from appearing in rando.
* Skips cutscene of royal tomb explosion in rando.
Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here.
* Improves visual of exploding gravestone.
* Adds some comments explaining the rando differences
* Skip ruto text box in jabu blue warp
For rando
* skip intro cutscene in dodongo's cavern
* load spoiler files on boot, fix spoilerfile existing check when making new saves
* name entry dropped spoiler logic
* make sure to actually init the cvar
* no chime on load
* uncomment
* Skip ganondrof cutscene
Skip to scream part of the death animation, skipping the text boxes etc. For rando
* Update z_boss_ganondrof.c
* skip owl flight cutscenes in rando
* Fixes skipped text so it only applies to shadow temple.
Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors.
* Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case.
* TEST: Text for item
* Adding ganon flavor text
* ADD: AMMO Count
* format ganon text/hint text
* Autoskip the tower cutscene if settings call for tower collapse.
* ganon hint text logic
* Improved prelude after time travel fix
* swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things.
* this is all i did
* not the cleanest code ever but it's working
* ADD: GS Count
* ADD: Wallter (crash for now)
* TWEAK: Wallet check
* FIX: Use DrawItem instread of DrawUpgrade... b-baka!
* Fixes some vanilla bugs introduced by rando code.
* Added cutscene skip for zelda escaping
Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger
* ADD: X Spacing + Placeholders for song
* ADD: default case for items
* TWEAK: Spacing
* FIX: Light Arrow
* ADD: Ammo Option
* use groups instead
* ADD: More spacing logic
* songs and names
* TWEAK: Color on wallet
* colors
* Added flags cutscene before nabooru fight
* ADD: ChromaKey text
* First attempt skip cs after nabooru defeat
* Better implementation for specific rando cutscene skips
* use pulseaudio defaults
* spaces/tabs
* move color push/pop to stop crash
* make the colors work again
* the real bottle fix
* pulseaudio values tuned for n64 audio at 44.1khz
* update tlength
* remove one hardcoded samplerate
* Cleaned up and fixed zelda escape skip
The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of.
* Revert one line to match original
nothing functional
* another hint line that breaks autonewline logic
* don't autospawn epona if we don't have the song/ocarina
* Trying to use iron knuckle death effects
not working yet
* Streamlined OoT cutscene skip for future additions
Also cleaned up if statement in general
* Made if statement more readable
Also added clarity for what cutscene was skipped
* Fixed typo in comment
* Janky nabooru defeat cs skip
* altar text formatting (gonna need help shortening some of the french ones)
* more altar text formatting
* english altar text formatting complete
* make gtg blocking guard check for card not bridge
* FIX: Typo!
* FIX: Uppercases
* FIX: Typo
* TWEAK: Alter + some names
* TWEAK: More caps!
* ADD: Missing string
TWEAK more uppercases and namefixe
s
* Hide nabooru death by covering her in flames
* bandaid fix for death crash issue
* Twinrova defeat cs skip
Skips the animation and manually calls the function to show the "beam" around the sisters
* fix crash
* fix caps to match
* fix great fairy reward mashing/shielding issue
* TWEAK : Typo clé to Clé
* TWEAK: Some Altar hints
TWEAK: Some capitals
* TWEAK: Unmatching text + some cap again
* TWEAK: More tweaks
* fix build
* remove extra json.hpp, add hint
* Update randomizer_item_tracker.cpp
* TWEAK: Double Defense with RedParticles instead of white
* make sure we don't optimize out the check to ensure a spoilerfile exists
* vanilla ganon boss key hint formatting
* TWEAK: FR- better way of the hero text
* fix
* and again
* Initializes dungeonsDone items in gSaveContext to 0.
* Replaces sizeof calculation with a NUM_DUNGEONS constant.
* Fixes Saria's Gift on the LW Bridge from getting killed when holding shield.
* More airtight fix for Saria's Gift on the Bridge.
* Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId.
* Invalidate text box icon before drawing
* Fixes the case where Saria's gift is an Ice Trap.
We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine.
* Initial commit
Might need changing when we change the settings in the future
* Fixes Door of Time opening cutscene after warping with prelude.
* Initial waterfall skip
Very rudimentary way of doing things but it seems to work so :shrug:
* inital rework
* fixed default rotation for 2D sprites
* fix tab/space issues
* 3d drops rando merge fix again
* Allows Impa to appear in the Lullaby check post drawbridge escape.
* Changes Ganon's Trials Count setting to a checkbox
The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed.
* Sets all Ganon's Trials to incomplete in new saves.
Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131
* fix castle guards when oot throw cutscene has already played in rando
* Properly removes the beams when trials are cleared.
* Removes Question Mark from Skip Ganon's Trials UI.
* Adds a todo comment about when to change back to slider.
* make deku seeds check for bullet bag
* Various tweaks
TWEAK: Altar Text
TWEAK: Hint names
TWEAK: Replace more problematic œ to oe
* upgrade ocarina on both child and adult equips
* FIX: Jabu Item
* update equipped hookshot/longshot when obtained as other age
* add hint
* don't give the bgs check without the claim check
* Skips Darunia Cutscene in Fire Temple
* Added a TODO note about not skipping the cutscene.
There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch.
* remove todo
* restore fast ocarina option in imgui that was lost in merge
* Fixes grey screen issue + tooltip for 2 handed shield
* update to use dg instead of g for textures in item tracker
* TWEAK: Default color for cosmetic RAND button was not the corect one
* fix texture crash, remove unused item tracker code
* don't open mask shop until we get zelda's letter
* Update README.md
* Prevents "correct" chime under incorrect conditions.
* Fixes typo in conditional and adds "bonk" sound effect.
"Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time.
* remove modify dpad equips toggle, replace with checks for dpad menu
* remove extra check
* add ability to hold c-up to assign to dpad when dpad menuing is enabled
* disable d-pad navigation on item menu when holding c-up to equip
* dpad+c-up stuff for equipment menu
* ADD: Checbox for songs colors
* TWEAK: RandoColors for normal songs
* kind of quick and dirty but it works
* TWEAK: Clarity of the tooltip
Co-authored-by: briaguya <briaguya@alice>
Co-authored-by: Christopher Leggett <chris@leggett.dev>
Co-authored-by: aMannus <mannusmenting@gmail.com>
Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com>
Co-authored-by: Dog <5172592+Dog@users.noreply.github.com>
Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com>
Co-authored-by: Baoulettes <perlouzerie@hotmail.fr>
Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
void GivePlayerRandoRewardNocturne(PlayState* play, RandomizerCheck check) {
|
|
|
|
|
Player* player = GET_PLAYER(play);
|
testing out item replacement (#416)
* skip learning song of storms
* don't set flag when getting goron tunic as child
* Initiates prelude check when master sword unloads.
Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again.
* Stops Shadow Temple lore prompts from appearing in rando.
* Skips cutscene of royal tomb explosion in rando.
Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here.
* Improves visual of exploding gravestone.
* Adds some comments explaining the rando differences
* Skip ruto text box in jabu blue warp
For rando
* skip intro cutscene in dodongo's cavern
* load spoiler files on boot, fix spoilerfile existing check when making new saves
* name entry dropped spoiler logic
* make sure to actually init the cvar
* no chime on load
* uncomment
* Skip ganondrof cutscene
Skip to scream part of the death animation, skipping the text boxes etc. For rando
* Update z_boss_ganondrof.c
* skip owl flight cutscenes in rando
* Fixes skipped text so it only applies to shadow temple.
Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors.
* Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case.
* TEST: Text for item
* Adding ganon flavor text
* ADD: AMMO Count
* format ganon text/hint text
* Autoskip the tower cutscene if settings call for tower collapse.
* ganon hint text logic
* Improved prelude after time travel fix
* swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things.
* this is all i did
* not the cleanest code ever but it's working
* ADD: GS Count
* ADD: Wallter (crash for now)
* TWEAK: Wallet check
* FIX: Use DrawItem instread of DrawUpgrade... b-baka!
* Fixes some vanilla bugs introduced by rando code.
* Added cutscene skip for zelda escaping
Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger
* ADD: X Spacing + Placeholders for song
* ADD: default case for items
* TWEAK: Spacing
* FIX: Light Arrow
* ADD: Ammo Option
* use groups instead
* ADD: More spacing logic
* songs and names
* TWEAK: Color on wallet
* colors
* Added flags cutscene before nabooru fight
* ADD: ChromaKey text
* First attempt skip cs after nabooru defeat
* Better implementation for specific rando cutscene skips
* use pulseaudio defaults
* spaces/tabs
* move color push/pop to stop crash
* make the colors work again
* the real bottle fix
* pulseaudio values tuned for n64 audio at 44.1khz
* update tlength
* remove one hardcoded samplerate
* Cleaned up and fixed zelda escape skip
The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of.
* Revert one line to match original
nothing functional
* another hint line that breaks autonewline logic
* don't autospawn epona if we don't have the song/ocarina
* Trying to use iron knuckle death effects
not working yet
* Streamlined OoT cutscene skip for future additions
Also cleaned up if statement in general
* Made if statement more readable
Also added clarity for what cutscene was skipped
* Fixed typo in comment
* Janky nabooru defeat cs skip
* altar text formatting (gonna need help shortening some of the french ones)
* more altar text formatting
* english altar text formatting complete
* make gtg blocking guard check for card not bridge
* FIX: Typo!
* FIX: Uppercases
* FIX: Typo
* TWEAK: Alter + some names
* TWEAK: More caps!
* ADD: Missing string
TWEAK more uppercases and namefixe
s
* Hide nabooru death by covering her in flames
* bandaid fix for death crash issue
* Twinrova defeat cs skip
Skips the animation and manually calls the function to show the "beam" around the sisters
* fix crash
* fix caps to match
* fix great fairy reward mashing/shielding issue
* TWEAK : Typo clé to Clé
* TWEAK: Some Altar hints
TWEAK: Some capitals
* TWEAK: Unmatching text + some cap again
* TWEAK: More tweaks
* fix build
* remove extra json.hpp, add hint
* Update randomizer_item_tracker.cpp
* TWEAK: Double Defense with RedParticles instead of white
* make sure we don't optimize out the check to ensure a spoilerfile exists
* vanilla ganon boss key hint formatting
* TWEAK: FR- better way of the hero text
* fix
* and again
* Initializes dungeonsDone items in gSaveContext to 0.
* Replaces sizeof calculation with a NUM_DUNGEONS constant.
* Fixes Saria's Gift on the LW Bridge from getting killed when holding shield.
* More airtight fix for Saria's Gift on the Bridge.
* Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId.
* Invalidate text box icon before drawing
* Fixes the case where Saria's gift is an Ice Trap.
We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine.
* Initial commit
Might need changing when we change the settings in the future
* Fixes Door of Time opening cutscene after warping with prelude.
* Initial waterfall skip
Very rudimentary way of doing things but it seems to work so :shrug:
* inital rework
* fixed default rotation for 2D sprites
* fix tab/space issues
* 3d drops rando merge fix again
* Allows Impa to appear in the Lullaby check post drawbridge escape.
* Changes Ganon's Trials Count setting to a checkbox
The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed.
* Sets all Ganon's Trials to incomplete in new saves.
Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131
* fix castle guards when oot throw cutscene has already played in rando
* Properly removes the beams when trials are cleared.
* Removes Question Mark from Skip Ganon's Trials UI.
* Adds a todo comment about when to change back to slider.
* make deku seeds check for bullet bag
* Various tweaks
TWEAK: Altar Text
TWEAK: Hint names
TWEAK: Replace more problematic œ to oe
* upgrade ocarina on both child and adult equips
* FIX: Jabu Item
* update equipped hookshot/longshot when obtained as other age
* add hint
* don't give the bgs check without the claim check
* Skips Darunia Cutscene in Fire Temple
* Added a TODO note about not skipping the cutscene.
There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch.
* remove todo
* restore fast ocarina option in imgui that was lost in merge
* Fixes grey screen issue + tooltip for 2 handed shield
* update to use dg instead of g for textures in item tracker
* TWEAK: Default color for cosmetic RAND button was not the corect one
* fix texture crash, remove unused item tracker code
* don't open mask shop until we get zelda's letter
* Update README.md
* Prevents "correct" chime under incorrect conditions.
* Fixes typo in conditional and adds "bonk" sound effect.
"Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time.
* remove modify dpad equips toggle, replace with checks for dpad menu
* remove extra check
* add ability to hold c-up to assign to dpad when dpad menuing is enabled
* disable d-pad navigation on item menu when holding c-up to equip
* dpad+c-up stuff for equipment menu
* ADD: Checbox for songs colors
* TWEAK: RandoColors for normal songs
* kind of quick and dirty but it works
* TWEAK: Clarity of the tooltip
Co-authored-by: briaguya <briaguya@alice>
Co-authored-by: Christopher Leggett <chris@leggett.dev>
Co-authored-by: aMannus <mannusmenting@gmail.com>
Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com>
Co-authored-by: Dog <5172592+Dog@users.noreply.github.com>
Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com>
Co-authored-by: Baoulettes <perlouzerie@hotmail.fr>
Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
|
|
|
|
|
|
|
|
|
if ((gSaveContext.entranceIndex == 0x00DB ||
|
|
|
|
|
gSaveContext.entranceIndex == 0x0191 ||
|
|
|
|
|
gSaveContext.entranceIndex == 0x0195) && LINK_IS_ADULT && CHECK_QUEST_ITEM(QUEST_MEDALLION_FOREST) &&
|
|
|
|
|
CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE) && CHECK_QUEST_ITEM(QUEST_MEDALLION_WATER) && player != NULL &&
|
2022-11-06 03:24:34 -05:00
|
|
|
|
!Player_InBlockingCsMode(play, player) && !Flags_GetEventChkInf(0xAA)) {
|
2022-08-23 20:11:38 -04:00
|
|
|
|
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(check, RG_NOCTURNE_OF_SHADOW);
|
2022-11-06 03:24:34 -05:00
|
|
|
|
GiveItemEntryWithoutActor(play, getItemEntry);
|
2022-09-06 05:27:26 -04:00
|
|
|
|
player->pendingFlag.flagID = 0xAA;
|
|
|
|
|
player->pendingFlag.flagType = FLAG_EVENT_CHECK_INF;
|
testing out item replacement (#416)
* skip learning song of storms
* don't set flag when getting goron tunic as child
* Initiates prelude check when master sword unloads.
Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again.
* Stops Shadow Temple lore prompts from appearing in rando.
* Skips cutscene of royal tomb explosion in rando.
Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here.
* Improves visual of exploding gravestone.
* Adds some comments explaining the rando differences
* Skip ruto text box in jabu blue warp
For rando
* skip intro cutscene in dodongo's cavern
* load spoiler files on boot, fix spoilerfile existing check when making new saves
* name entry dropped spoiler logic
* make sure to actually init the cvar
* no chime on load
* uncomment
* Skip ganondrof cutscene
Skip to scream part of the death animation, skipping the text boxes etc. For rando
* Update z_boss_ganondrof.c
* skip owl flight cutscenes in rando
* Fixes skipped text so it only applies to shadow temple.
Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors.
* Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case.
* TEST: Text for item
* Adding ganon flavor text
* ADD: AMMO Count
* format ganon text/hint text
* Autoskip the tower cutscene if settings call for tower collapse.
* ganon hint text logic
* Improved prelude after time travel fix
* swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things.
* this is all i did
* not the cleanest code ever but it's working
* ADD: GS Count
* ADD: Wallter (crash for now)
* TWEAK: Wallet check
* FIX: Use DrawItem instread of DrawUpgrade... b-baka!
* Fixes some vanilla bugs introduced by rando code.
* Added cutscene skip for zelda escaping
Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger
* ADD: X Spacing + Placeholders for song
* ADD: default case for items
* TWEAK: Spacing
* FIX: Light Arrow
* ADD: Ammo Option
* use groups instead
* ADD: More spacing logic
* songs and names
* TWEAK: Color on wallet
* colors
* Added flags cutscene before nabooru fight
* ADD: ChromaKey text
* First attempt skip cs after nabooru defeat
* Better implementation for specific rando cutscene skips
* use pulseaudio defaults
* spaces/tabs
* move color push/pop to stop crash
* make the colors work again
* the real bottle fix
* pulseaudio values tuned for n64 audio at 44.1khz
* update tlength
* remove one hardcoded samplerate
* Cleaned up and fixed zelda escape skip
The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of.
* Revert one line to match original
nothing functional
* another hint line that breaks autonewline logic
* don't autospawn epona if we don't have the song/ocarina
* Trying to use iron knuckle death effects
not working yet
* Streamlined OoT cutscene skip for future additions
Also cleaned up if statement in general
* Made if statement more readable
Also added clarity for what cutscene was skipped
* Fixed typo in comment
* Janky nabooru defeat cs skip
* altar text formatting (gonna need help shortening some of the french ones)
* more altar text formatting
* english altar text formatting complete
* make gtg blocking guard check for card not bridge
* FIX: Typo!
* FIX: Uppercases
* FIX: Typo
* TWEAK: Alter + some names
* TWEAK: More caps!
* ADD: Missing string
TWEAK more uppercases and namefixe
s
* Hide nabooru death by covering her in flames
* bandaid fix for death crash issue
* Twinrova defeat cs skip
Skips the animation and manually calls the function to show the "beam" around the sisters
* fix crash
* fix caps to match
* fix great fairy reward mashing/shielding issue
* TWEAK : Typo clé to Clé
* TWEAK: Some Altar hints
TWEAK: Some capitals
* TWEAK: Unmatching text + some cap again
* TWEAK: More tweaks
* fix build
* remove extra json.hpp, add hint
* Update randomizer_item_tracker.cpp
* TWEAK: Double Defense with RedParticles instead of white
* make sure we don't optimize out the check to ensure a spoilerfile exists
* vanilla ganon boss key hint formatting
* TWEAK: FR- better way of the hero text
* fix
* and again
* Initializes dungeonsDone items in gSaveContext to 0.
* Replaces sizeof calculation with a NUM_DUNGEONS constant.
* Fixes Saria's Gift on the LW Bridge from getting killed when holding shield.
* More airtight fix for Saria's Gift on the Bridge.
* Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId.
* Invalidate text box icon before drawing
* Fixes the case where Saria's gift is an Ice Trap.
We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine.
* Initial commit
Might need changing when we change the settings in the future
* Fixes Door of Time opening cutscene after warping with prelude.
* Initial waterfall skip
Very rudimentary way of doing things but it seems to work so :shrug:
* inital rework
* fixed default rotation for 2D sprites
* fix tab/space issues
* 3d drops rando merge fix again
* Allows Impa to appear in the Lullaby check post drawbridge escape.
* Changes Ganon's Trials Count setting to a checkbox
The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed.
* Sets all Ganon's Trials to incomplete in new saves.
Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131
* fix castle guards when oot throw cutscene has already played in rando
* Properly removes the beams when trials are cleared.
* Removes Question Mark from Skip Ganon's Trials UI.
* Adds a todo comment about when to change back to slider.
* make deku seeds check for bullet bag
* Various tweaks
TWEAK: Altar Text
TWEAK: Hint names
TWEAK: Replace more problematic œ to oe
* upgrade ocarina on both child and adult equips
* FIX: Jabu Item
* update equipped hookshot/longshot when obtained as other age
* add hint
* don't give the bgs check without the claim check
* Skips Darunia Cutscene in Fire Temple
* Added a TODO note about not skipping the cutscene.
There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch.
* remove todo
* restore fast ocarina option in imgui that was lost in merge
* Fixes grey screen issue + tooltip for 2 handed shield
* update to use dg instead of g for textures in item tracker
* TWEAK: Default color for cosmetic RAND button was not the corect one
* fix texture crash, remove unused item tracker code
* don't open mask shop until we get zelda's letter
* Update README.md
* Prevents "correct" chime under incorrect conditions.
* Fixes typo in conditional and adds "bonk" sound effect.
"Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time.
* remove modify dpad equips toggle, replace with checks for dpad menu
* remove extra check
* add ability to hold c-up to assign to dpad when dpad menuing is enabled
* disable d-pad navigation on item menu when holding c-up to equip
* dpad+c-up stuff for equipment menu
* ADD: Checbox for songs colors
* TWEAK: RandoColors for normal songs
* kind of quick and dirty but it works
* TWEAK: Clarity of the tooltip
Co-authored-by: briaguya <briaguya@alice>
Co-authored-by: Christopher Leggett <chris@leggett.dev>
Co-authored-by: aMannus <mannusmenting@gmail.com>
Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com>
Co-authored-by: Dog <5172592+Dog@users.noreply.github.com>
Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com>
Co-authored-by: Baoulettes <perlouzerie@hotmail.fr>
Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
void GivePlayerRandoRewardRequiem(PlayState* play, RandomizerCheck check) {
|
|
|
|
|
Player* player = GET_PLAYER(play);
|
testing out item replacement (#416)
* skip learning song of storms
* don't set flag when getting goron tunic as child
* Initiates prelude check when master sword unloads.
Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again.
* Stops Shadow Temple lore prompts from appearing in rando.
* Skips cutscene of royal tomb explosion in rando.
Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here.
* Improves visual of exploding gravestone.
* Adds some comments explaining the rando differences
* Skip ruto text box in jabu blue warp
For rando
* skip intro cutscene in dodongo's cavern
* load spoiler files on boot, fix spoilerfile existing check when making new saves
* name entry dropped spoiler logic
* make sure to actually init the cvar
* no chime on load
* uncomment
* Skip ganondrof cutscene
Skip to scream part of the death animation, skipping the text boxes etc. For rando
* Update z_boss_ganondrof.c
* skip owl flight cutscenes in rando
* Fixes skipped text so it only applies to shadow temple.
Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors.
* Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case.
* TEST: Text for item
* Adding ganon flavor text
* ADD: AMMO Count
* format ganon text/hint text
* Autoskip the tower cutscene if settings call for tower collapse.
* ganon hint text logic
* Improved prelude after time travel fix
* swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things.
* this is all i did
* not the cleanest code ever but it's working
* ADD: GS Count
* ADD: Wallter (crash for now)
* TWEAK: Wallet check
* FIX: Use DrawItem instread of DrawUpgrade... b-baka!
* Fixes some vanilla bugs introduced by rando code.
* Added cutscene skip for zelda escaping
Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger
* ADD: X Spacing + Placeholders for song
* ADD: default case for items
* TWEAK: Spacing
* FIX: Light Arrow
* ADD: Ammo Option
* use groups instead
* ADD: More spacing logic
* songs and names
* TWEAK: Color on wallet
* colors
* Added flags cutscene before nabooru fight
* ADD: ChromaKey text
* First attempt skip cs after nabooru defeat
* Better implementation for specific rando cutscene skips
* use pulseaudio defaults
* spaces/tabs
* move color push/pop to stop crash
* make the colors work again
* the real bottle fix
* pulseaudio values tuned for n64 audio at 44.1khz
* update tlength
* remove one hardcoded samplerate
* Cleaned up and fixed zelda escape skip
The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of.
* Revert one line to match original
nothing functional
* another hint line that breaks autonewline logic
* don't autospawn epona if we don't have the song/ocarina
* Trying to use iron knuckle death effects
not working yet
* Streamlined OoT cutscene skip for future additions
Also cleaned up if statement in general
* Made if statement more readable
Also added clarity for what cutscene was skipped
* Fixed typo in comment
* Janky nabooru defeat cs skip
* altar text formatting (gonna need help shortening some of the french ones)
* more altar text formatting
* english altar text formatting complete
* make gtg blocking guard check for card not bridge
* FIX: Typo!
* FIX: Uppercases
* FIX: Typo
* TWEAK: Alter + some names
* TWEAK: More caps!
* ADD: Missing string
TWEAK more uppercases and namefixe
s
* Hide nabooru death by covering her in flames
* bandaid fix for death crash issue
* Twinrova defeat cs skip
Skips the animation and manually calls the function to show the "beam" around the sisters
* fix crash
* fix caps to match
* fix great fairy reward mashing/shielding issue
* TWEAK : Typo clé to Clé
* TWEAK: Some Altar hints
TWEAK: Some capitals
* TWEAK: Unmatching text + some cap again
* TWEAK: More tweaks
* fix build
* remove extra json.hpp, add hint
* Update randomizer_item_tracker.cpp
* TWEAK: Double Defense with RedParticles instead of white
* make sure we don't optimize out the check to ensure a spoilerfile exists
* vanilla ganon boss key hint formatting
* TWEAK: FR- better way of the hero text
* fix
* and again
* Initializes dungeonsDone items in gSaveContext to 0.
* Replaces sizeof calculation with a NUM_DUNGEONS constant.
* Fixes Saria's Gift on the LW Bridge from getting killed when holding shield.
* More airtight fix for Saria's Gift on the Bridge.
* Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId.
* Invalidate text box icon before drawing
* Fixes the case where Saria's gift is an Ice Trap.
We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine.
* Initial commit
Might need changing when we change the settings in the future
* Fixes Door of Time opening cutscene after warping with prelude.
* Initial waterfall skip
Very rudimentary way of doing things but it seems to work so :shrug:
* inital rework
* fixed default rotation for 2D sprites
* fix tab/space issues
* 3d drops rando merge fix again
* Allows Impa to appear in the Lullaby check post drawbridge escape.
* Changes Ganon's Trials Count setting to a checkbox
The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed.
* Sets all Ganon's Trials to incomplete in new saves.
Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131
* fix castle guards when oot throw cutscene has already played in rando
* Properly removes the beams when trials are cleared.
* Removes Question Mark from Skip Ganon's Trials UI.
* Adds a todo comment about when to change back to slider.
* make deku seeds check for bullet bag
* Various tweaks
TWEAK: Altar Text
TWEAK: Hint names
TWEAK: Replace more problematic œ to oe
* upgrade ocarina on both child and adult equips
* FIX: Jabu Item
* update equipped hookshot/longshot when obtained as other age
* add hint
* don't give the bgs check without the claim check
* Skips Darunia Cutscene in Fire Temple
* Added a TODO note about not skipping the cutscene.
There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch.
* remove todo
* restore fast ocarina option in imgui that was lost in merge
* Fixes grey screen issue + tooltip for 2 handed shield
* update to use dg instead of g for textures in item tracker
* TWEAK: Default color for cosmetic RAND button was not the corect one
* fix texture crash, remove unused item tracker code
* don't open mask shop until we get zelda's letter
* Update README.md
* Prevents "correct" chime under incorrect conditions.
* Fixes typo in conditional and adds "bonk" sound effect.
"Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time.
* remove modify dpad equips toggle, replace with checks for dpad menu
* remove extra check
* add ability to hold c-up to assign to dpad when dpad menuing is enabled
* disable d-pad navigation on item menu when holding c-up to equip
* dpad+c-up stuff for equipment menu
* ADD: Checbox for songs colors
* TWEAK: RandoColors for normal songs
* kind of quick and dirty but it works
* TWEAK: Clarity of the tooltip
Co-authored-by: briaguya <briaguya@alice>
Co-authored-by: Christopher Leggett <chris@leggett.dev>
Co-authored-by: aMannus <mannusmenting@gmail.com>
Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com>
Co-authored-by: Dog <5172592+Dog@users.noreply.github.com>
Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com>
Co-authored-by: Baoulettes <perlouzerie@hotmail.fr>
Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
|
|
|
|
|
|
|
|
|
if ((gSaveContext.gameMode == 0) && (gSaveContext.respawnFlag <= 0) && (gSaveContext.cutsceneIndex < 0xFFF0)) {
|
|
|
|
|
if ((gSaveContext.entranceIndex == 0x01E1) && !Flags_GetEventChkInf(0xAC) && player != NULL &&
|
2022-11-06 03:24:34 -05:00
|
|
|
|
!Player_InBlockingCsMode(play, player)) {
|
2022-08-23 20:11:38 -04:00
|
|
|
|
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(check, RG_SONG_OF_TIME);
|
2022-11-06 03:24:34 -05:00
|
|
|
|
GiveItemEntryWithoutActor(play, getItemEntry);
|
2022-09-06 05:27:26 -04:00
|
|
|
|
player->pendingFlag.flagID = 0xAC;
|
|
|
|
|
player->pendingFlag.flagType = FLAG_EVENT_CHECK_INF;
|
testing out item replacement (#416)
* skip learning song of storms
* don't set flag when getting goron tunic as child
* Initiates prelude check when master sword unloads.
Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again.
* Stops Shadow Temple lore prompts from appearing in rando.
* Skips cutscene of royal tomb explosion in rando.
Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here.
* Improves visual of exploding gravestone.
* Adds some comments explaining the rando differences
* Skip ruto text box in jabu blue warp
For rando
* skip intro cutscene in dodongo's cavern
* load spoiler files on boot, fix spoilerfile existing check when making new saves
* name entry dropped spoiler logic
* make sure to actually init the cvar
* no chime on load
* uncomment
* Skip ganondrof cutscene
Skip to scream part of the death animation, skipping the text boxes etc. For rando
* Update z_boss_ganondrof.c
* skip owl flight cutscenes in rando
* Fixes skipped text so it only applies to shadow temple.
Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors.
* Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case.
* TEST: Text for item
* Adding ganon flavor text
* ADD: AMMO Count
* format ganon text/hint text
* Autoskip the tower cutscene if settings call for tower collapse.
* ganon hint text logic
* Improved prelude after time travel fix
* swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things.
* this is all i did
* not the cleanest code ever but it's working
* ADD: GS Count
* ADD: Wallter (crash for now)
* TWEAK: Wallet check
* FIX: Use DrawItem instread of DrawUpgrade... b-baka!
* Fixes some vanilla bugs introduced by rando code.
* Added cutscene skip for zelda escaping
Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger
* ADD: X Spacing + Placeholders for song
* ADD: default case for items
* TWEAK: Spacing
* FIX: Light Arrow
* ADD: Ammo Option
* use groups instead
* ADD: More spacing logic
* songs and names
* TWEAK: Color on wallet
* colors
* Added flags cutscene before nabooru fight
* ADD: ChromaKey text
* First attempt skip cs after nabooru defeat
* Better implementation for specific rando cutscene skips
* use pulseaudio defaults
* spaces/tabs
* move color push/pop to stop crash
* make the colors work again
* the real bottle fix
* pulseaudio values tuned for n64 audio at 44.1khz
* update tlength
* remove one hardcoded samplerate
* Cleaned up and fixed zelda escape skip
The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of.
* Revert one line to match original
nothing functional
* another hint line that breaks autonewline logic
* don't autospawn epona if we don't have the song/ocarina
* Trying to use iron knuckle death effects
not working yet
* Streamlined OoT cutscene skip for future additions
Also cleaned up if statement in general
* Made if statement more readable
Also added clarity for what cutscene was skipped
* Fixed typo in comment
* Janky nabooru defeat cs skip
* altar text formatting (gonna need help shortening some of the french ones)
* more altar text formatting
* english altar text formatting complete
* make gtg blocking guard check for card not bridge
* FIX: Typo!
* FIX: Uppercases
* FIX: Typo
* TWEAK: Alter + some names
* TWEAK: More caps!
* ADD: Missing string
TWEAK more uppercases and namefixe
s
* Hide nabooru death by covering her in flames
* bandaid fix for death crash issue
* Twinrova defeat cs skip
Skips the animation and manually calls the function to show the "beam" around the sisters
* fix crash
* fix caps to match
* fix great fairy reward mashing/shielding issue
* TWEAK : Typo clé to Clé
* TWEAK: Some Altar hints
TWEAK: Some capitals
* TWEAK: Unmatching text + some cap again
* TWEAK: More tweaks
* fix build
* remove extra json.hpp, add hint
* Update randomizer_item_tracker.cpp
* TWEAK: Double Defense with RedParticles instead of white
* make sure we don't optimize out the check to ensure a spoilerfile exists
* vanilla ganon boss key hint formatting
* TWEAK: FR- better way of the hero text
* fix
* and again
* Initializes dungeonsDone items in gSaveContext to 0.
* Replaces sizeof calculation with a NUM_DUNGEONS constant.
* Fixes Saria's Gift on the LW Bridge from getting killed when holding shield.
* More airtight fix for Saria's Gift on the Bridge.
* Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId.
* Invalidate text box icon before drawing
* Fixes the case where Saria's gift is an Ice Trap.
We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine.
* Initial commit
Might need changing when we change the settings in the future
* Fixes Door of Time opening cutscene after warping with prelude.
* Initial waterfall skip
Very rudimentary way of doing things but it seems to work so :shrug:
* inital rework
* fixed default rotation for 2D sprites
* fix tab/space issues
* 3d drops rando merge fix again
* Allows Impa to appear in the Lullaby check post drawbridge escape.
* Changes Ganon's Trials Count setting to a checkbox
The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed.
* Sets all Ganon's Trials to incomplete in new saves.
Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131
* fix castle guards when oot throw cutscene has already played in rando
* Properly removes the beams when trials are cleared.
* Removes Question Mark from Skip Ganon's Trials UI.
* Adds a todo comment about when to change back to slider.
* make deku seeds check for bullet bag
* Various tweaks
TWEAK: Altar Text
TWEAK: Hint names
TWEAK: Replace more problematic œ to oe
* upgrade ocarina on both child and adult equips
* FIX: Jabu Item
* update equipped hookshot/longshot when obtained as other age
* add hint
* don't give the bgs check without the claim check
* Skips Darunia Cutscene in Fire Temple
* Added a TODO note about not skipping the cutscene.
There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch.
* remove todo
* restore fast ocarina option in imgui that was lost in merge
* Fixes grey screen issue + tooltip for 2 handed shield
* update to use dg instead of g for textures in item tracker
* TWEAK: Default color for cosmetic RAND button was not the corect one
* fix texture crash, remove unused item tracker code
* don't open mask shop until we get zelda's letter
* Update README.md
* Prevents "correct" chime under incorrect conditions.
* Fixes typo in conditional and adds "bonk" sound effect.
"Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time.
* remove modify dpad equips toggle, replace with checks for dpad menu
* remove extra check
* add ability to hold c-up to assign to dpad when dpad menuing is enabled
* disable d-pad navigation on item menu when holding c-up to equip
* dpad+c-up stuff for equipment menu
* ADD: Checbox for songs colors
* TWEAK: RandoColors for normal songs
* kind of quick and dirty but it works
* TWEAK: Clarity of the tooltip
Co-authored-by: briaguya <briaguya@alice>
Co-authored-by: Christopher Leggett <chris@leggett.dev>
Co-authored-by: aMannus <mannusmenting@gmail.com>
Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com>
Co-authored-by: Dog <5172592+Dog@users.noreply.github.com>
Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com>
Co-authored-by: Baoulettes <perlouzerie@hotmail.fr>
Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-20 23:10:29 -04:00
|
|
|
|
u8 CheckStoneCount() {
|
|
|
|
|
u8 stoneCount = 0;
|
|
|
|
|
|
|
|
|
|
if (CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD)) {
|
|
|
|
|
stoneCount++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (CHECK_QUEST_ITEM(QUEST_GORON_RUBY)) {
|
|
|
|
|
stoneCount++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (CHECK_QUEST_ITEM(QUEST_ZORA_SAPPHIRE)) {
|
|
|
|
|
stoneCount++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return stoneCount;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
u8 CheckMedallionCount() {
|
|
|
|
|
u8 medallionCount = 0;
|
|
|
|
|
|
|
|
|
|
if (CHECK_QUEST_ITEM(QUEST_MEDALLION_FOREST)) {
|
|
|
|
|
medallionCount++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE)) {
|
|
|
|
|
medallionCount++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (CHECK_QUEST_ITEM(QUEST_MEDALLION_WATER)) {
|
|
|
|
|
medallionCount++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (CHECK_QUEST_ITEM(QUEST_MEDALLION_SHADOW)) {
|
|
|
|
|
medallionCount++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (CHECK_QUEST_ITEM(QUEST_MEDALLION_SPIRIT)) {
|
|
|
|
|
medallionCount++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (CHECK_QUEST_ITEM(QUEST_MEDALLION_LIGHT)) {
|
|
|
|
|
medallionCount++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return medallionCount;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
u8 CheckDungeonCount() {
|
|
|
|
|
u8 dungeonCount = 0;
|
|
|
|
|
|
|
|
|
|
if (Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_DEKU_TREE)) {
|
|
|
|
|
dungeonCount++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_DODONGOS_CAVERN)) {
|
|
|
|
|
dungeonCount++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_JABU_JABUS_BELLY)) {
|
|
|
|
|
dungeonCount++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_FOREST_TEMPLE)) {
|
|
|
|
|
dungeonCount++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_FIRE_TEMPLE)) {
|
|
|
|
|
dungeonCount++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_WATER_TEMPLE)) {
|
|
|
|
|
dungeonCount++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_SPIRIT_TEMPLE)) {
|
|
|
|
|
dungeonCount++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_SHADOW_TEMPLE)) {
|
|
|
|
|
dungeonCount++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return dungeonCount;
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
void GivePlayerRandoRewardZeldaLightArrowsGift(PlayState* play, RandomizerCheck check) {
|
|
|
|
|
Player* player = GET_PLAYER(play);
|
testing out item replacement (#416)
* skip learning song of storms
* don't set flag when getting goron tunic as child
* Initiates prelude check when master sword unloads.
Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again.
* Stops Shadow Temple lore prompts from appearing in rando.
* Skips cutscene of royal tomb explosion in rando.
Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here.
* Improves visual of exploding gravestone.
* Adds some comments explaining the rando differences
* Skip ruto text box in jabu blue warp
For rando
* skip intro cutscene in dodongo's cavern
* load spoiler files on boot, fix spoilerfile existing check when making new saves
* name entry dropped spoiler logic
* make sure to actually init the cvar
* no chime on load
* uncomment
* Skip ganondrof cutscene
Skip to scream part of the death animation, skipping the text boxes etc. For rando
* Update z_boss_ganondrof.c
* skip owl flight cutscenes in rando
* Fixes skipped text so it only applies to shadow temple.
Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors.
* Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case.
* TEST: Text for item
* Adding ganon flavor text
* ADD: AMMO Count
* format ganon text/hint text
* Autoskip the tower cutscene if settings call for tower collapse.
* ganon hint text logic
* Improved prelude after time travel fix
* swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things.
* this is all i did
* not the cleanest code ever but it's working
* ADD: GS Count
* ADD: Wallter (crash for now)
* TWEAK: Wallet check
* FIX: Use DrawItem instread of DrawUpgrade... b-baka!
* Fixes some vanilla bugs introduced by rando code.
* Added cutscene skip for zelda escaping
Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger
* ADD: X Spacing + Placeholders for song
* ADD: default case for items
* TWEAK: Spacing
* FIX: Light Arrow
* ADD: Ammo Option
* use groups instead
* ADD: More spacing logic
* songs and names
* TWEAK: Color on wallet
* colors
* Added flags cutscene before nabooru fight
* ADD: ChromaKey text
* First attempt skip cs after nabooru defeat
* Better implementation for specific rando cutscene skips
* use pulseaudio defaults
* spaces/tabs
* move color push/pop to stop crash
* make the colors work again
* the real bottle fix
* pulseaudio values tuned for n64 audio at 44.1khz
* update tlength
* remove one hardcoded samplerate
* Cleaned up and fixed zelda escape skip
The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of.
* Revert one line to match original
nothing functional
* another hint line that breaks autonewline logic
* don't autospawn epona if we don't have the song/ocarina
* Trying to use iron knuckle death effects
not working yet
* Streamlined OoT cutscene skip for future additions
Also cleaned up if statement in general
* Made if statement more readable
Also added clarity for what cutscene was skipped
* Fixed typo in comment
* Janky nabooru defeat cs skip
* altar text formatting (gonna need help shortening some of the french ones)
* more altar text formatting
* english altar text formatting complete
* make gtg blocking guard check for card not bridge
* FIX: Typo!
* FIX: Uppercases
* FIX: Typo
* TWEAK: Alter + some names
* TWEAK: More caps!
* ADD: Missing string
TWEAK more uppercases and namefixe
s
* Hide nabooru death by covering her in flames
* bandaid fix for death crash issue
* Twinrova defeat cs skip
Skips the animation and manually calls the function to show the "beam" around the sisters
* fix crash
* fix caps to match
* fix great fairy reward mashing/shielding issue
* TWEAK : Typo clé to Clé
* TWEAK: Some Altar hints
TWEAK: Some capitals
* TWEAK: Unmatching text + some cap again
* TWEAK: More tweaks
* fix build
* remove extra json.hpp, add hint
* Update randomizer_item_tracker.cpp
* TWEAK: Double Defense with RedParticles instead of white
* make sure we don't optimize out the check to ensure a spoilerfile exists
* vanilla ganon boss key hint formatting
* TWEAK: FR- better way of the hero text
* fix
* and again
* Initializes dungeonsDone items in gSaveContext to 0.
* Replaces sizeof calculation with a NUM_DUNGEONS constant.
* Fixes Saria's Gift on the LW Bridge from getting killed when holding shield.
* More airtight fix for Saria's Gift on the Bridge.
* Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId.
* Invalidate text box icon before drawing
* Fixes the case where Saria's gift is an Ice Trap.
We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine.
* Initial commit
Might need changing when we change the settings in the future
* Fixes Door of Time opening cutscene after warping with prelude.
* Initial waterfall skip
Very rudimentary way of doing things but it seems to work so :shrug:
* inital rework
* fixed default rotation for 2D sprites
* fix tab/space issues
* 3d drops rando merge fix again
* Allows Impa to appear in the Lullaby check post drawbridge escape.
* Changes Ganon's Trials Count setting to a checkbox
The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed.
* Sets all Ganon's Trials to incomplete in new saves.
Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131
* fix castle guards when oot throw cutscene has already played in rando
* Properly removes the beams when trials are cleared.
* Removes Question Mark from Skip Ganon's Trials UI.
* Adds a todo comment about when to change back to slider.
* make deku seeds check for bullet bag
* Various tweaks
TWEAK: Altar Text
TWEAK: Hint names
TWEAK: Replace more problematic œ to oe
* upgrade ocarina on both child and adult equips
* FIX: Jabu Item
* update equipped hookshot/longshot when obtained as other age
* add hint
* don't give the bgs check without the claim check
* Skips Darunia Cutscene in Fire Temple
* Added a TODO note about not skipping the cutscene.
There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch.
* remove todo
* restore fast ocarina option in imgui that was lost in merge
* Fixes grey screen issue + tooltip for 2 handed shield
* update to use dg instead of g for textures in item tracker
* TWEAK: Default color for cosmetic RAND button was not the corect one
* fix texture crash, remove unused item tracker code
* don't open mask shop until we get zelda's letter
* Update README.md
* Prevents "correct" chime under incorrect conditions.
* Fixes typo in conditional and adds "bonk" sound effect.
"Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time.
* remove modify dpad equips toggle, replace with checks for dpad menu
* remove extra check
* add ability to hold c-up to assign to dpad when dpad menuing is enabled
* disable d-pad navigation on item menu when holding c-up to equip
* dpad+c-up stuff for equipment menu
* ADD: Checbox for songs colors
* TWEAK: RandoColors for normal songs
* kind of quick and dirty but it works
* TWEAK: Clarity of the tooltip
Co-authored-by: briaguya <briaguya@alice>
Co-authored-by: Christopher Leggett <chris@leggett.dev>
Co-authored-by: aMannus <mannusmenting@gmail.com>
Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com>
Co-authored-by: Dog <5172592+Dog@users.noreply.github.com>
Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com>
Co-authored-by: Baoulettes <perlouzerie@hotmail.fr>
Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
|
|
|
|
|
2022-10-20 23:10:29 -04:00
|
|
|
|
u8 meetsRequirements = 0;
|
|
|
|
|
|
|
|
|
|
switch (Randomizer_GetSettingValue(RSK_GANONS_BOSS_KEY)) {
|
2022-11-29 20:01:41 -05:00
|
|
|
|
case RO_GANON_BOSS_KEY_LACS_MEDALLIONS:
|
2022-10-20 23:10:29 -04:00
|
|
|
|
if (CheckMedallionCount() >= Randomizer_GetSettingValue(RSK_LACS_MEDALLION_COUNT)) {
|
|
|
|
|
meetsRequirements = true;
|
|
|
|
|
}
|
|
|
|
|
break;
|
2022-11-29 20:01:41 -05:00
|
|
|
|
case RO_GANON_BOSS_KEY_LACS_STONES:
|
2022-10-20 23:10:29 -04:00
|
|
|
|
if (CheckStoneCount() >= Randomizer_GetSettingValue(RSK_LACS_STONE_COUNT)) {
|
|
|
|
|
meetsRequirements = true;
|
|
|
|
|
}
|
|
|
|
|
break;
|
2022-11-29 20:01:41 -05:00
|
|
|
|
case RO_GANON_BOSS_KEY_LACS_REWARDS:
|
2022-10-20 23:10:29 -04:00
|
|
|
|
if ((CheckMedallionCount() + CheckStoneCount()) >= Randomizer_GetSettingValue(RSK_LACS_REWARD_COUNT)) {
|
|
|
|
|
meetsRequirements = true;
|
|
|
|
|
}
|
|
|
|
|
break;
|
2022-11-29 20:01:41 -05:00
|
|
|
|
case RO_GANON_BOSS_KEY_LACS_DUNGEONS:
|
2022-10-20 23:10:29 -04:00
|
|
|
|
if (CheckDungeonCount() >= Randomizer_GetSettingValue(RSK_LACS_DUNGEON_COUNT)) {
|
|
|
|
|
meetsRequirements = true;
|
|
|
|
|
}
|
|
|
|
|
break;
|
2022-11-29 20:01:41 -05:00
|
|
|
|
case RO_GANON_BOSS_KEY_LACS_TOKENS:
|
2022-10-20 23:10:29 -04:00
|
|
|
|
if (gSaveContext.inventory.gsTokens >= Randomizer_GetSettingValue(RSK_LACS_TOKEN_COUNT)) {
|
|
|
|
|
meetsRequirements = true;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
if (CHECK_QUEST_ITEM(QUEST_MEDALLION_SPIRIT) && CHECK_QUEST_ITEM(QUEST_MEDALLION_SHADOW)) {
|
|
|
|
|
meetsRequirements = true;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (meetsRequirements && LINK_IS_ADULT &&
|
testing out item replacement (#416)
* skip learning song of storms
* don't set flag when getting goron tunic as child
* Initiates prelude check when master sword unloads.
Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again.
* Stops Shadow Temple lore prompts from appearing in rando.
* Skips cutscene of royal tomb explosion in rando.
Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here.
* Improves visual of exploding gravestone.
* Adds some comments explaining the rando differences
* Skip ruto text box in jabu blue warp
For rando
* skip intro cutscene in dodongo's cavern
* load spoiler files on boot, fix spoilerfile existing check when making new saves
* name entry dropped spoiler logic
* make sure to actually init the cvar
* no chime on load
* uncomment
* Skip ganondrof cutscene
Skip to scream part of the death animation, skipping the text boxes etc. For rando
* Update z_boss_ganondrof.c
* skip owl flight cutscenes in rando
* Fixes skipped text so it only applies to shadow temple.
Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors.
* Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case.
* TEST: Text for item
* Adding ganon flavor text
* ADD: AMMO Count
* format ganon text/hint text
* Autoskip the tower cutscene if settings call for tower collapse.
* ganon hint text logic
* Improved prelude after time travel fix
* swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things.
* this is all i did
* not the cleanest code ever but it's working
* ADD: GS Count
* ADD: Wallter (crash for now)
* TWEAK: Wallet check
* FIX: Use DrawItem instread of DrawUpgrade... b-baka!
* Fixes some vanilla bugs introduced by rando code.
* Added cutscene skip for zelda escaping
Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger
* ADD: X Spacing + Placeholders for song
* ADD: default case for items
* TWEAK: Spacing
* FIX: Light Arrow
* ADD: Ammo Option
* use groups instead
* ADD: More spacing logic
* songs and names
* TWEAK: Color on wallet
* colors
* Added flags cutscene before nabooru fight
* ADD: ChromaKey text
* First attempt skip cs after nabooru defeat
* Better implementation for specific rando cutscene skips
* use pulseaudio defaults
* spaces/tabs
* move color push/pop to stop crash
* make the colors work again
* the real bottle fix
* pulseaudio values tuned for n64 audio at 44.1khz
* update tlength
* remove one hardcoded samplerate
* Cleaned up and fixed zelda escape skip
The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of.
* Revert one line to match original
nothing functional
* another hint line that breaks autonewline logic
* don't autospawn epona if we don't have the song/ocarina
* Trying to use iron knuckle death effects
not working yet
* Streamlined OoT cutscene skip for future additions
Also cleaned up if statement in general
* Made if statement more readable
Also added clarity for what cutscene was skipped
* Fixed typo in comment
* Janky nabooru defeat cs skip
* altar text formatting (gonna need help shortening some of the french ones)
* more altar text formatting
* english altar text formatting complete
* make gtg blocking guard check for card not bridge
* FIX: Typo!
* FIX: Uppercases
* FIX: Typo
* TWEAK: Alter + some names
* TWEAK: More caps!
* ADD: Missing string
TWEAK more uppercases and namefixe
s
* Hide nabooru death by covering her in flames
* bandaid fix for death crash issue
* Twinrova defeat cs skip
Skips the animation and manually calls the function to show the "beam" around the sisters
* fix crash
* fix caps to match
* fix great fairy reward mashing/shielding issue
* TWEAK : Typo clé to Clé
* TWEAK: Some Altar hints
TWEAK: Some capitals
* TWEAK: Unmatching text + some cap again
* TWEAK: More tweaks
* fix build
* remove extra json.hpp, add hint
* Update randomizer_item_tracker.cpp
* TWEAK: Double Defense with RedParticles instead of white
* make sure we don't optimize out the check to ensure a spoilerfile exists
* vanilla ganon boss key hint formatting
* TWEAK: FR- better way of the hero text
* fix
* and again
* Initializes dungeonsDone items in gSaveContext to 0.
* Replaces sizeof calculation with a NUM_DUNGEONS constant.
* Fixes Saria's Gift on the LW Bridge from getting killed when holding shield.
* More airtight fix for Saria's Gift on the Bridge.
* Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId.
* Invalidate text box icon before drawing
* Fixes the case where Saria's gift is an Ice Trap.
We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine.
* Initial commit
Might need changing when we change the settings in the future
* Fixes Door of Time opening cutscene after warping with prelude.
* Initial waterfall skip
Very rudimentary way of doing things but it seems to work so :shrug:
* inital rework
* fixed default rotation for 2D sprites
* fix tab/space issues
* 3d drops rando merge fix again
* Allows Impa to appear in the Lullaby check post drawbridge escape.
* Changes Ganon's Trials Count setting to a checkbox
The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed.
* Sets all Ganon's Trials to incomplete in new saves.
Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131
* fix castle guards when oot throw cutscene has already played in rando
* Properly removes the beams when trials are cleared.
* Removes Question Mark from Skip Ganon's Trials UI.
* Adds a todo comment about when to change back to slider.
* make deku seeds check for bullet bag
* Various tweaks
TWEAK: Altar Text
TWEAK: Hint names
TWEAK: Replace more problematic œ to oe
* upgrade ocarina on both child and adult equips
* FIX: Jabu Item
* update equipped hookshot/longshot when obtained as other age
* add hint
* don't give the bgs check without the claim check
* Skips Darunia Cutscene in Fire Temple
* Added a TODO note about not skipping the cutscene.
There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch.
* remove todo
* restore fast ocarina option in imgui that was lost in merge
* Fixes grey screen issue + tooltip for 2 handed shield
* update to use dg instead of g for textures in item tracker
* TWEAK: Default color for cosmetic RAND button was not the corect one
* fix texture crash, remove unused item tracker code
* don't open mask shop until we get zelda's letter
* Update README.md
* Prevents "correct" chime under incorrect conditions.
* Fixes typo in conditional and adds "bonk" sound effect.
"Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time.
* remove modify dpad equips toggle, replace with checks for dpad menu
* remove extra check
* add ability to hold c-up to assign to dpad when dpad menuing is enabled
* disable d-pad navigation on item menu when holding c-up to equip
* dpad+c-up stuff for equipment menu
* ADD: Checbox for songs colors
* TWEAK: RandoColors for normal songs
* kind of quick and dirty but it works
* TWEAK: Clarity of the tooltip
Co-authored-by: briaguya <briaguya@alice>
Co-authored-by: Christopher Leggett <chris@leggett.dev>
Co-authored-by: aMannus <mannusmenting@gmail.com>
Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com>
Co-authored-by: Dog <5172592+Dog@users.noreply.github.com>
Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com>
Co-authored-by: Baoulettes <perlouzerie@hotmail.fr>
Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
|
|
|
|
(gEntranceTable[((void)0, gSaveContext.entranceIndex)].scene == SCENE_TOKINOMA) &&
|
2022-11-06 03:24:34 -05:00
|
|
|
|
!Flags_GetTreasure(play, 0x1E) && player != NULL && !Player_InBlockingCsMode(play, player) &&
|
|
|
|
|
play->sceneLoadFlag == 0) {
|
2022-08-23 20:11:38 -04:00
|
|
|
|
GetItemEntry getItem = Randomizer_GetItemFromKnownCheck(check, GI_ARROW_LIGHT);
|
2022-11-06 03:24:34 -05:00
|
|
|
|
if (GiveItemEntryWithoutActor(play, getItem)) {
|
2022-08-23 20:11:38 -04:00
|
|
|
|
player->pendingFlag.flagID = 0x1E;
|
|
|
|
|
player->pendingFlag.flagType = FLAG_SCENE_TREASURE;
|
|
|
|
|
}
|
testing out item replacement (#416)
* skip learning song of storms
* don't set flag when getting goron tunic as child
* Initiates prelude check when master sword unloads.
Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again.
* Stops Shadow Temple lore prompts from appearing in rando.
* Skips cutscene of royal tomb explosion in rando.
Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here.
* Improves visual of exploding gravestone.
* Adds some comments explaining the rando differences
* Skip ruto text box in jabu blue warp
For rando
* skip intro cutscene in dodongo's cavern
* load spoiler files on boot, fix spoilerfile existing check when making new saves
* name entry dropped spoiler logic
* make sure to actually init the cvar
* no chime on load
* uncomment
* Skip ganondrof cutscene
Skip to scream part of the death animation, skipping the text boxes etc. For rando
* Update z_boss_ganondrof.c
* skip owl flight cutscenes in rando
* Fixes skipped text so it only applies to shadow temple.
Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors.
* Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case.
* TEST: Text for item
* Adding ganon flavor text
* ADD: AMMO Count
* format ganon text/hint text
* Autoskip the tower cutscene if settings call for tower collapse.
* ganon hint text logic
* Improved prelude after time travel fix
* swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things.
* this is all i did
* not the cleanest code ever but it's working
* ADD: GS Count
* ADD: Wallter (crash for now)
* TWEAK: Wallet check
* FIX: Use DrawItem instread of DrawUpgrade... b-baka!
* Fixes some vanilla bugs introduced by rando code.
* Added cutscene skip for zelda escaping
Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger
* ADD: X Spacing + Placeholders for song
* ADD: default case for items
* TWEAK: Spacing
* FIX: Light Arrow
* ADD: Ammo Option
* use groups instead
* ADD: More spacing logic
* songs and names
* TWEAK: Color on wallet
* colors
* Added flags cutscene before nabooru fight
* ADD: ChromaKey text
* First attempt skip cs after nabooru defeat
* Better implementation for specific rando cutscene skips
* use pulseaudio defaults
* spaces/tabs
* move color push/pop to stop crash
* make the colors work again
* the real bottle fix
* pulseaudio values tuned for n64 audio at 44.1khz
* update tlength
* remove one hardcoded samplerate
* Cleaned up and fixed zelda escape skip
The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of.
* Revert one line to match original
nothing functional
* another hint line that breaks autonewline logic
* don't autospawn epona if we don't have the song/ocarina
* Trying to use iron knuckle death effects
not working yet
* Streamlined OoT cutscene skip for future additions
Also cleaned up if statement in general
* Made if statement more readable
Also added clarity for what cutscene was skipped
* Fixed typo in comment
* Janky nabooru defeat cs skip
* altar text formatting (gonna need help shortening some of the french ones)
* more altar text formatting
* english altar text formatting complete
* make gtg blocking guard check for card not bridge
* FIX: Typo!
* FIX: Uppercases
* FIX: Typo
* TWEAK: Alter + some names
* TWEAK: More caps!
* ADD: Missing string
TWEAK more uppercases and namefixe
s
* Hide nabooru death by covering her in flames
* bandaid fix for death crash issue
* Twinrova defeat cs skip
Skips the animation and manually calls the function to show the "beam" around the sisters
* fix crash
* fix caps to match
* fix great fairy reward mashing/shielding issue
* TWEAK : Typo clé to Clé
* TWEAK: Some Altar hints
TWEAK: Some capitals
* TWEAK: Unmatching text + some cap again
* TWEAK: More tweaks
* fix build
* remove extra json.hpp, add hint
* Update randomizer_item_tracker.cpp
* TWEAK: Double Defense with RedParticles instead of white
* make sure we don't optimize out the check to ensure a spoilerfile exists
* vanilla ganon boss key hint formatting
* TWEAK: FR- better way of the hero text
* fix
* and again
* Initializes dungeonsDone items in gSaveContext to 0.
* Replaces sizeof calculation with a NUM_DUNGEONS constant.
* Fixes Saria's Gift on the LW Bridge from getting killed when holding shield.
* More airtight fix for Saria's Gift on the Bridge.
* Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId.
* Invalidate text box icon before drawing
* Fixes the case where Saria's gift is an Ice Trap.
We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine.
* Initial commit
Might need changing when we change the settings in the future
* Fixes Door of Time opening cutscene after warping with prelude.
* Initial waterfall skip
Very rudimentary way of doing things but it seems to work so :shrug:
* inital rework
* fixed default rotation for 2D sprites
* fix tab/space issues
* 3d drops rando merge fix again
* Allows Impa to appear in the Lullaby check post drawbridge escape.
* Changes Ganon's Trials Count setting to a checkbox
The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed.
* Sets all Ganon's Trials to incomplete in new saves.
Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131
* fix castle guards when oot throw cutscene has already played in rando
* Properly removes the beams when trials are cleared.
* Removes Question Mark from Skip Ganon's Trials UI.
* Adds a todo comment about when to change back to slider.
* make deku seeds check for bullet bag
* Various tweaks
TWEAK: Altar Text
TWEAK: Hint names
TWEAK: Replace more problematic œ to oe
* upgrade ocarina on both child and adult equips
* FIX: Jabu Item
* update equipped hookshot/longshot when obtained as other age
* add hint
* don't give the bgs check without the claim check
* Skips Darunia Cutscene in Fire Temple
* Added a TODO note about not skipping the cutscene.
There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch.
* remove todo
* restore fast ocarina option in imgui that was lost in merge
* Fixes grey screen issue + tooltip for 2 handed shield
* update to use dg instead of g for textures in item tracker
* TWEAK: Default color for cosmetic RAND button was not the corect one
* fix texture crash, remove unused item tracker code
* don't open mask shop until we get zelda's letter
* Update README.md
* Prevents "correct" chime under incorrect conditions.
* Fixes typo in conditional and adds "bonk" sound effect.
"Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time.
* remove modify dpad equips toggle, replace with checks for dpad menu
* remove extra check
* add ability to hold c-up to assign to dpad when dpad menuing is enabled
* disable d-pad navigation on item menu when holding c-up to equip
* dpad+c-up stuff for equipment menu
* ADD: Checbox for songs colors
* TWEAK: RandoColors for normal songs
* kind of quick and dirty but it works
* TWEAK: Clarity of the tooltip
Co-authored-by: briaguya <briaguya@alice>
Co-authored-by: Christopher Leggett <chris@leggett.dev>
Co-authored-by: aMannus <mannusmenting@gmail.com>
Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com>
Co-authored-by: Dog <5172592+Dog@users.noreply.github.com>
Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com>
Co-authored-by: Baoulettes <perlouzerie@hotmail.fr>
Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
void GivePlayerRandoRewardSariaGift(PlayState* play, RandomizerCheck check) {
|
|
|
|
|
Player* player = GET_PLAYER(play);
|
testing out item replacement (#416)
* skip learning song of storms
* don't set flag when getting goron tunic as child
* Initiates prelude check when master sword unloads.
Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again.
* Stops Shadow Temple lore prompts from appearing in rando.
* Skips cutscene of royal tomb explosion in rando.
Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here.
* Improves visual of exploding gravestone.
* Adds some comments explaining the rando differences
* Skip ruto text box in jabu blue warp
For rando
* skip intro cutscene in dodongo's cavern
* load spoiler files on boot, fix spoilerfile existing check when making new saves
* name entry dropped spoiler logic
* make sure to actually init the cvar
* no chime on load
* uncomment
* Skip ganondrof cutscene
Skip to scream part of the death animation, skipping the text boxes etc. For rando
* Update z_boss_ganondrof.c
* skip owl flight cutscenes in rando
* Fixes skipped text so it only applies to shadow temple.
Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors.
* Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case.
* TEST: Text for item
* Adding ganon flavor text
* ADD: AMMO Count
* format ganon text/hint text
* Autoskip the tower cutscene if settings call for tower collapse.
* ganon hint text logic
* Improved prelude after time travel fix
* swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things.
* this is all i did
* not the cleanest code ever but it's working
* ADD: GS Count
* ADD: Wallter (crash for now)
* TWEAK: Wallet check
* FIX: Use DrawItem instread of DrawUpgrade... b-baka!
* Fixes some vanilla bugs introduced by rando code.
* Added cutscene skip for zelda escaping
Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger
* ADD: X Spacing + Placeholders for song
* ADD: default case for items
* TWEAK: Spacing
* FIX: Light Arrow
* ADD: Ammo Option
* use groups instead
* ADD: More spacing logic
* songs and names
* TWEAK: Color on wallet
* colors
* Added flags cutscene before nabooru fight
* ADD: ChromaKey text
* First attempt skip cs after nabooru defeat
* Better implementation for specific rando cutscene skips
* use pulseaudio defaults
* spaces/tabs
* move color push/pop to stop crash
* make the colors work again
* the real bottle fix
* pulseaudio values tuned for n64 audio at 44.1khz
* update tlength
* remove one hardcoded samplerate
* Cleaned up and fixed zelda escape skip
The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of.
* Revert one line to match original
nothing functional
* another hint line that breaks autonewline logic
* don't autospawn epona if we don't have the song/ocarina
* Trying to use iron knuckle death effects
not working yet
* Streamlined OoT cutscene skip for future additions
Also cleaned up if statement in general
* Made if statement more readable
Also added clarity for what cutscene was skipped
* Fixed typo in comment
* Janky nabooru defeat cs skip
* altar text formatting (gonna need help shortening some of the french ones)
* more altar text formatting
* english altar text formatting complete
* make gtg blocking guard check for card not bridge
* FIX: Typo!
* FIX: Uppercases
* FIX: Typo
* TWEAK: Alter + some names
* TWEAK: More caps!
* ADD: Missing string
TWEAK more uppercases and namefixe
s
* Hide nabooru death by covering her in flames
* bandaid fix for death crash issue
* Twinrova defeat cs skip
Skips the animation and manually calls the function to show the "beam" around the sisters
* fix crash
* fix caps to match
* fix great fairy reward mashing/shielding issue
* TWEAK : Typo clé to Clé
* TWEAK: Some Altar hints
TWEAK: Some capitals
* TWEAK: Unmatching text + some cap again
* TWEAK: More tweaks
* fix build
* remove extra json.hpp, add hint
* Update randomizer_item_tracker.cpp
* TWEAK: Double Defense with RedParticles instead of white
* make sure we don't optimize out the check to ensure a spoilerfile exists
* vanilla ganon boss key hint formatting
* TWEAK: FR- better way of the hero text
* fix
* and again
* Initializes dungeonsDone items in gSaveContext to 0.
* Replaces sizeof calculation with a NUM_DUNGEONS constant.
* Fixes Saria's Gift on the LW Bridge from getting killed when holding shield.
* More airtight fix for Saria's Gift on the Bridge.
* Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId.
* Invalidate text box icon before drawing
* Fixes the case where Saria's gift is an Ice Trap.
We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine.
* Initial commit
Might need changing when we change the settings in the future
* Fixes Door of Time opening cutscene after warping with prelude.
* Initial waterfall skip
Very rudimentary way of doing things but it seems to work so :shrug:
* inital rework
* fixed default rotation for 2D sprites
* fix tab/space issues
* 3d drops rando merge fix again
* Allows Impa to appear in the Lullaby check post drawbridge escape.
* Changes Ganon's Trials Count setting to a checkbox
The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed.
* Sets all Ganon's Trials to incomplete in new saves.
Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131
* fix castle guards when oot throw cutscene has already played in rando
* Properly removes the beams when trials are cleared.
* Removes Question Mark from Skip Ganon's Trials UI.
* Adds a todo comment about when to change back to slider.
* make deku seeds check for bullet bag
* Various tweaks
TWEAK: Altar Text
TWEAK: Hint names
TWEAK: Replace more problematic œ to oe
* upgrade ocarina on both child and adult equips
* FIX: Jabu Item
* update equipped hookshot/longshot when obtained as other age
* add hint
* don't give the bgs check without the claim check
* Skips Darunia Cutscene in Fire Temple
* Added a TODO note about not skipping the cutscene.
There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch.
* remove todo
* restore fast ocarina option in imgui that was lost in merge
* Fixes grey screen issue + tooltip for 2 handed shield
* update to use dg instead of g for textures in item tracker
* TWEAK: Default color for cosmetic RAND button was not the corect one
* fix texture crash, remove unused item tracker code
* don't open mask shop until we get zelda's letter
* Update README.md
* Prevents "correct" chime under incorrect conditions.
* Fixes typo in conditional and adds "bonk" sound effect.
"Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time.
* remove modify dpad equips toggle, replace with checks for dpad menu
* remove extra check
* add ability to hold c-up to assign to dpad when dpad menuing is enabled
* disable d-pad navigation on item menu when holding c-up to equip
* dpad+c-up stuff for equipment menu
* ADD: Checbox for songs colors
* TWEAK: RandoColors for normal songs
* kind of quick and dirty but it works
* TWEAK: Clarity of the tooltip
Co-authored-by: briaguya <briaguya@alice>
Co-authored-by: Christopher Leggett <chris@leggett.dev>
Co-authored-by: aMannus <mannusmenting@gmail.com>
Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com>
Co-authored-by: Dog <5172592+Dog@users.noreply.github.com>
Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com>
Co-authored-by: Baoulettes <perlouzerie@hotmail.fr>
Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
|
|
|
|
if (gSaveContext.entranceIndex == 0x05E0) {
|
2022-08-23 20:11:38 -04:00
|
|
|
|
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(check, RG_ZELDAS_LULLABY);
|
testing out item replacement (#416)
* skip learning song of storms
* don't set flag when getting goron tunic as child
* Initiates prelude check when master sword unloads.
Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again.
* Stops Shadow Temple lore prompts from appearing in rando.
* Skips cutscene of royal tomb explosion in rando.
Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here.
* Improves visual of exploding gravestone.
* Adds some comments explaining the rando differences
* Skip ruto text box in jabu blue warp
For rando
* skip intro cutscene in dodongo's cavern
* load spoiler files on boot, fix spoilerfile existing check when making new saves
* name entry dropped spoiler logic
* make sure to actually init the cvar
* no chime on load
* uncomment
* Skip ganondrof cutscene
Skip to scream part of the death animation, skipping the text boxes etc. For rando
* Update z_boss_ganondrof.c
* skip owl flight cutscenes in rando
* Fixes skipped text so it only applies to shadow temple.
Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors.
* Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case.
* TEST: Text for item
* Adding ganon flavor text
* ADD: AMMO Count
* format ganon text/hint text
* Autoskip the tower cutscene if settings call for tower collapse.
* ganon hint text logic
* Improved prelude after time travel fix
* swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things.
* this is all i did
* not the cleanest code ever but it's working
* ADD: GS Count
* ADD: Wallter (crash for now)
* TWEAK: Wallet check
* FIX: Use DrawItem instread of DrawUpgrade... b-baka!
* Fixes some vanilla bugs introduced by rando code.
* Added cutscene skip for zelda escaping
Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger
* ADD: X Spacing + Placeholders for song
* ADD: default case for items
* TWEAK: Spacing
* FIX: Light Arrow
* ADD: Ammo Option
* use groups instead
* ADD: More spacing logic
* songs and names
* TWEAK: Color on wallet
* colors
* Added flags cutscene before nabooru fight
* ADD: ChromaKey text
* First attempt skip cs after nabooru defeat
* Better implementation for specific rando cutscene skips
* use pulseaudio defaults
* spaces/tabs
* move color push/pop to stop crash
* make the colors work again
* the real bottle fix
* pulseaudio values tuned for n64 audio at 44.1khz
* update tlength
* remove one hardcoded samplerate
* Cleaned up and fixed zelda escape skip
The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of.
* Revert one line to match original
nothing functional
* another hint line that breaks autonewline logic
* don't autospawn epona if we don't have the song/ocarina
* Trying to use iron knuckle death effects
not working yet
* Streamlined OoT cutscene skip for future additions
Also cleaned up if statement in general
* Made if statement more readable
Also added clarity for what cutscene was skipped
* Fixed typo in comment
* Janky nabooru defeat cs skip
* altar text formatting (gonna need help shortening some of the french ones)
* more altar text formatting
* english altar text formatting complete
* make gtg blocking guard check for card not bridge
* FIX: Typo!
* FIX: Uppercases
* FIX: Typo
* TWEAK: Alter + some names
* TWEAK: More caps!
* ADD: Missing string
TWEAK more uppercases and namefixe
s
* Hide nabooru death by covering her in flames
* bandaid fix for death crash issue
* Twinrova defeat cs skip
Skips the animation and manually calls the function to show the "beam" around the sisters
* fix crash
* fix caps to match
* fix great fairy reward mashing/shielding issue
* TWEAK : Typo clé to Clé
* TWEAK: Some Altar hints
TWEAK: Some capitals
* TWEAK: Unmatching text + some cap again
* TWEAK: More tweaks
* fix build
* remove extra json.hpp, add hint
* Update randomizer_item_tracker.cpp
* TWEAK: Double Defense with RedParticles instead of white
* make sure we don't optimize out the check to ensure a spoilerfile exists
* vanilla ganon boss key hint formatting
* TWEAK: FR- better way of the hero text
* fix
* and again
* Initializes dungeonsDone items in gSaveContext to 0.
* Replaces sizeof calculation with a NUM_DUNGEONS constant.
* Fixes Saria's Gift on the LW Bridge from getting killed when holding shield.
* More airtight fix for Saria's Gift on the Bridge.
* Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId.
* Invalidate text box icon before drawing
* Fixes the case where Saria's gift is an Ice Trap.
We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine.
* Initial commit
Might need changing when we change the settings in the future
* Fixes Door of Time opening cutscene after warping with prelude.
* Initial waterfall skip
Very rudimentary way of doing things but it seems to work so :shrug:
* inital rework
* fixed default rotation for 2D sprites
* fix tab/space issues
* 3d drops rando merge fix again
* Allows Impa to appear in the Lullaby check post drawbridge escape.
* Changes Ganon's Trials Count setting to a checkbox
The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed.
* Sets all Ganon's Trials to incomplete in new saves.
Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131
* fix castle guards when oot throw cutscene has already played in rando
* Properly removes the beams when trials are cleared.
* Removes Question Mark from Skip Ganon's Trials UI.
* Adds a todo comment about when to change back to slider.
* make deku seeds check for bullet bag
* Various tweaks
TWEAK: Altar Text
TWEAK: Hint names
TWEAK: Replace more problematic œ to oe
* upgrade ocarina on both child and adult equips
* FIX: Jabu Item
* update equipped hookshot/longshot when obtained as other age
* add hint
* don't give the bgs check without the claim check
* Skips Darunia Cutscene in Fire Temple
* Added a TODO note about not skipping the cutscene.
There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch.
* remove todo
* restore fast ocarina option in imgui that was lost in merge
* Fixes grey screen issue + tooltip for 2 handed shield
* update to use dg instead of g for textures in item tracker
* TWEAK: Default color for cosmetic RAND button was not the corect one
* fix texture crash, remove unused item tracker code
* don't open mask shop until we get zelda's letter
* Update README.md
* Prevents "correct" chime under incorrect conditions.
* Fixes typo in conditional and adds "bonk" sound effect.
"Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time.
* remove modify dpad equips toggle, replace with checks for dpad menu
* remove extra check
* add ability to hold c-up to assign to dpad when dpad menuing is enabled
* disable d-pad navigation on item menu when holding c-up to equip
* dpad+c-up stuff for equipment menu
* ADD: Checbox for songs colors
* TWEAK: RandoColors for normal songs
* kind of quick and dirty but it works
* TWEAK: Clarity of the tooltip
Co-authored-by: briaguya <briaguya@alice>
Co-authored-by: Christopher Leggett <chris@leggett.dev>
Co-authored-by: aMannus <mannusmenting@gmail.com>
Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com>
Co-authored-by: Dog <5172592+Dog@users.noreply.github.com>
Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com>
Co-authored-by: Baoulettes <perlouzerie@hotmail.fr>
Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
if (!Flags_GetEventChkInf(0xC1) && player != NULL && !Player_InBlockingCsMode(play, player)) {
|
|
|
|
|
GiveItemEntryWithoutActor(play, getItemEntry);
|
2022-08-25 14:16:43 -04:00
|
|
|
|
player->pendingFlag.flagType = FLAG_EVENT_CHECK_INF;
|
|
|
|
|
player->pendingFlag.flagID = 0xC1;
|
testing out item replacement (#416)
* skip learning song of storms
* don't set flag when getting goron tunic as child
* Initiates prelude check when master sword unloads.
Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again.
* Stops Shadow Temple lore prompts from appearing in rando.
* Skips cutscene of royal tomb explosion in rando.
Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here.
* Improves visual of exploding gravestone.
* Adds some comments explaining the rando differences
* Skip ruto text box in jabu blue warp
For rando
* skip intro cutscene in dodongo's cavern
* load spoiler files on boot, fix spoilerfile existing check when making new saves
* name entry dropped spoiler logic
* make sure to actually init the cvar
* no chime on load
* uncomment
* Skip ganondrof cutscene
Skip to scream part of the death animation, skipping the text boxes etc. For rando
* Update z_boss_ganondrof.c
* skip owl flight cutscenes in rando
* Fixes skipped text so it only applies to shadow temple.
Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors.
* Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case.
* TEST: Text for item
* Adding ganon flavor text
* ADD: AMMO Count
* format ganon text/hint text
* Autoskip the tower cutscene if settings call for tower collapse.
* ganon hint text logic
* Improved prelude after time travel fix
* swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things.
* this is all i did
* not the cleanest code ever but it's working
* ADD: GS Count
* ADD: Wallter (crash for now)
* TWEAK: Wallet check
* FIX: Use DrawItem instread of DrawUpgrade... b-baka!
* Fixes some vanilla bugs introduced by rando code.
* Added cutscene skip for zelda escaping
Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger
* ADD: X Spacing + Placeholders for song
* ADD: default case for items
* TWEAK: Spacing
* FIX: Light Arrow
* ADD: Ammo Option
* use groups instead
* ADD: More spacing logic
* songs and names
* TWEAK: Color on wallet
* colors
* Added flags cutscene before nabooru fight
* ADD: ChromaKey text
* First attempt skip cs after nabooru defeat
* Better implementation for specific rando cutscene skips
* use pulseaudio defaults
* spaces/tabs
* move color push/pop to stop crash
* make the colors work again
* the real bottle fix
* pulseaudio values tuned for n64 audio at 44.1khz
* update tlength
* remove one hardcoded samplerate
* Cleaned up and fixed zelda escape skip
The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of.
* Revert one line to match original
nothing functional
* another hint line that breaks autonewline logic
* don't autospawn epona if we don't have the song/ocarina
* Trying to use iron knuckle death effects
not working yet
* Streamlined OoT cutscene skip for future additions
Also cleaned up if statement in general
* Made if statement more readable
Also added clarity for what cutscene was skipped
* Fixed typo in comment
* Janky nabooru defeat cs skip
* altar text formatting (gonna need help shortening some of the french ones)
* more altar text formatting
* english altar text formatting complete
* make gtg blocking guard check for card not bridge
* FIX: Typo!
* FIX: Uppercases
* FIX: Typo
* TWEAK: Alter + some names
* TWEAK: More caps!
* ADD: Missing string
TWEAK more uppercases and namefixe
s
* Hide nabooru death by covering her in flames
* bandaid fix for death crash issue
* Twinrova defeat cs skip
Skips the animation and manually calls the function to show the "beam" around the sisters
* fix crash
* fix caps to match
* fix great fairy reward mashing/shielding issue
* TWEAK : Typo clé to Clé
* TWEAK: Some Altar hints
TWEAK: Some capitals
* TWEAK: Unmatching text + some cap again
* TWEAK: More tweaks
* fix build
* remove extra json.hpp, add hint
* Update randomizer_item_tracker.cpp
* TWEAK: Double Defense with RedParticles instead of white
* make sure we don't optimize out the check to ensure a spoilerfile exists
* vanilla ganon boss key hint formatting
* TWEAK: FR- better way of the hero text
* fix
* and again
* Initializes dungeonsDone items in gSaveContext to 0.
* Replaces sizeof calculation with a NUM_DUNGEONS constant.
* Fixes Saria's Gift on the LW Bridge from getting killed when holding shield.
* More airtight fix for Saria's Gift on the Bridge.
* Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId.
* Invalidate text box icon before drawing
* Fixes the case where Saria's gift is an Ice Trap.
We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine.
* Initial commit
Might need changing when we change the settings in the future
* Fixes Door of Time opening cutscene after warping with prelude.
* Initial waterfall skip
Very rudimentary way of doing things but it seems to work so :shrug:
* inital rework
* fixed default rotation for 2D sprites
* fix tab/space issues
* 3d drops rando merge fix again
* Allows Impa to appear in the Lullaby check post drawbridge escape.
* Changes Ganon's Trials Count setting to a checkbox
The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed.
* Sets all Ganon's Trials to incomplete in new saves.
Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131
* fix castle guards when oot throw cutscene has already played in rando
* Properly removes the beams when trials are cleared.
* Removes Question Mark from Skip Ganon's Trials UI.
* Adds a todo comment about when to change back to slider.
* make deku seeds check for bullet bag
* Various tweaks
TWEAK: Altar Text
TWEAK: Hint names
TWEAK: Replace more problematic œ to oe
* upgrade ocarina on both child and adult equips
* FIX: Jabu Item
* update equipped hookshot/longshot when obtained as other age
* add hint
* don't give the bgs check without the claim check
* Skips Darunia Cutscene in Fire Temple
* Added a TODO note about not skipping the cutscene.
There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch.
* remove todo
* restore fast ocarina option in imgui that was lost in merge
* Fixes grey screen issue + tooltip for 2 handed shield
* update to use dg instead of g for textures in item tracker
* TWEAK: Default color for cosmetic RAND button was not the corect one
* fix texture crash, remove unused item tracker code
* don't open mask shop until we get zelda's letter
* Update README.md
* Prevents "correct" chime under incorrect conditions.
* Fixes typo in conditional and adds "bonk" sound effect.
"Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time.
* remove modify dpad equips toggle, replace with checks for dpad menu
* remove extra check
* add ability to hold c-up to assign to dpad when dpad menuing is enabled
* disable d-pad navigation on item menu when holding c-up to equip
* dpad+c-up stuff for equipment menu
* ADD: Checbox for songs colors
* TWEAK: RandoColors for normal songs
* kind of quick and dirty but it works
* TWEAK: Clarity of the tooltip
Co-authored-by: briaguya <briaguya@alice>
Co-authored-by: Christopher Leggett <chris@leggett.dev>
Co-authored-by: aMannus <mannusmenting@gmail.com>
Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com>
Co-authored-by: Dog <5172592+Dog@users.noreply.github.com>
Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com>
Co-authored-by: Baoulettes <perlouzerie@hotmail.fr>
Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
void Play_Init(GameState* thisx) {
|
|
|
|
|
PlayState* play = (PlayState*)thisx;
|
|
|
|
|
GraphicsContext* gfxCtx = play->state.gfxCtx;
|
2022-07-31 21:52:10 -04:00
|
|
|
|
enableBetaQuest();
|
2022-11-06 03:24:34 -05:00
|
|
|
|
gPlayState = play;
|
|
|
|
|
//play->state.gfxCtx = NULL;
|
2022-05-14 19:19:02 -04:00
|
|
|
|
uintptr_t zAlloc;
|
|
|
|
|
uintptr_t zAllocAligned;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
size_t zAllocSize;
|
|
|
|
|
Player* player;
|
|
|
|
|
s32 playerStartCamId;
|
|
|
|
|
s32 i;
|
|
|
|
|
u8 tempSetupIndex;
|
|
|
|
|
s32 pad[2];
|
|
|
|
|
|
2022-08-08 19:59:06 -04:00
|
|
|
|
// Skip Child Stealth when option is enabled, Zelda's Letter isn't obtained and Impa's reward hasn't been received
|
|
|
|
|
// eventChkInf[4] & 1 = Got Zelda's Letter
|
|
|
|
|
// eventChkInf[5] & 0x200 = Got Impa's reward
|
|
|
|
|
// entranceIndex 0x7A, Castle Courtyard - Day from crawlspace
|
|
|
|
|
// entranceIndex 0x400, Zelda's Courtyard
|
|
|
|
|
if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SKIP_CHILD_STEALTH) &&
|
|
|
|
|
!(gSaveContext.eventChkInf[4] & 1) && !(gSaveContext.eventChkInf[5] & 0x200)) {
|
testing out item replacement (#416)
* skip learning song of storms
* don't set flag when getting goron tunic as child
* Initiates prelude check when master sword unloads.
Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again.
* Stops Shadow Temple lore prompts from appearing in rando.
* Skips cutscene of royal tomb explosion in rando.
Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here.
* Improves visual of exploding gravestone.
* Adds some comments explaining the rando differences
* Skip ruto text box in jabu blue warp
For rando
* skip intro cutscene in dodongo's cavern
* load spoiler files on boot, fix spoilerfile existing check when making new saves
* name entry dropped spoiler logic
* make sure to actually init the cvar
* no chime on load
* uncomment
* Skip ganondrof cutscene
Skip to scream part of the death animation, skipping the text boxes etc. For rando
* Update z_boss_ganondrof.c
* skip owl flight cutscenes in rando
* Fixes skipped text so it only applies to shadow temple.
Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors.
* Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case.
* TEST: Text for item
* Adding ganon flavor text
* ADD: AMMO Count
* format ganon text/hint text
* Autoskip the tower cutscene if settings call for tower collapse.
* ganon hint text logic
* Improved prelude after time travel fix
* swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things.
* this is all i did
* not the cleanest code ever but it's working
* ADD: GS Count
* ADD: Wallter (crash for now)
* TWEAK: Wallet check
* FIX: Use DrawItem instread of DrawUpgrade... b-baka!
* Fixes some vanilla bugs introduced by rando code.
* Added cutscene skip for zelda escaping
Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger
* ADD: X Spacing + Placeholders for song
* ADD: default case for items
* TWEAK: Spacing
* FIX: Light Arrow
* ADD: Ammo Option
* use groups instead
* ADD: More spacing logic
* songs and names
* TWEAK: Color on wallet
* colors
* Added flags cutscene before nabooru fight
* ADD: ChromaKey text
* First attempt skip cs after nabooru defeat
* Better implementation for specific rando cutscene skips
* use pulseaudio defaults
* spaces/tabs
* move color push/pop to stop crash
* make the colors work again
* the real bottle fix
* pulseaudio values tuned for n64 audio at 44.1khz
* update tlength
* remove one hardcoded samplerate
* Cleaned up and fixed zelda escape skip
The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of.
* Revert one line to match original
nothing functional
* another hint line that breaks autonewline logic
* don't autospawn epona if we don't have the song/ocarina
* Trying to use iron knuckle death effects
not working yet
* Streamlined OoT cutscene skip for future additions
Also cleaned up if statement in general
* Made if statement more readable
Also added clarity for what cutscene was skipped
* Fixed typo in comment
* Janky nabooru defeat cs skip
* altar text formatting (gonna need help shortening some of the french ones)
* more altar text formatting
* english altar text formatting complete
* make gtg blocking guard check for card not bridge
* FIX: Typo!
* FIX: Uppercases
* FIX: Typo
* TWEAK: Alter + some names
* TWEAK: More caps!
* ADD: Missing string
TWEAK more uppercases and namefixe
s
* Hide nabooru death by covering her in flames
* bandaid fix for death crash issue
* Twinrova defeat cs skip
Skips the animation and manually calls the function to show the "beam" around the sisters
* fix crash
* fix caps to match
* fix great fairy reward mashing/shielding issue
* TWEAK : Typo clé to Clé
* TWEAK: Some Altar hints
TWEAK: Some capitals
* TWEAK: Unmatching text + some cap again
* TWEAK: More tweaks
* fix build
* remove extra json.hpp, add hint
* Update randomizer_item_tracker.cpp
* TWEAK: Double Defense with RedParticles instead of white
* make sure we don't optimize out the check to ensure a spoilerfile exists
* vanilla ganon boss key hint formatting
* TWEAK: FR- better way of the hero text
* fix
* and again
* Initializes dungeonsDone items in gSaveContext to 0.
* Replaces sizeof calculation with a NUM_DUNGEONS constant.
* Fixes Saria's Gift on the LW Bridge from getting killed when holding shield.
* More airtight fix for Saria's Gift on the Bridge.
* Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId.
* Invalidate text box icon before drawing
* Fixes the case where Saria's gift is an Ice Trap.
We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine.
* Initial commit
Might need changing when we change the settings in the future
* Fixes Door of Time opening cutscene after warping with prelude.
* Initial waterfall skip
Very rudimentary way of doing things but it seems to work so :shrug:
* inital rework
* fixed default rotation for 2D sprites
* fix tab/space issues
* 3d drops rando merge fix again
* Allows Impa to appear in the Lullaby check post drawbridge escape.
* Changes Ganon's Trials Count setting to a checkbox
The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed.
* Sets all Ganon's Trials to incomplete in new saves.
Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131
* fix castle guards when oot throw cutscene has already played in rando
* Properly removes the beams when trials are cleared.
* Removes Question Mark from Skip Ganon's Trials UI.
* Adds a todo comment about when to change back to slider.
* make deku seeds check for bullet bag
* Various tweaks
TWEAK: Altar Text
TWEAK: Hint names
TWEAK: Replace more problematic œ to oe
* upgrade ocarina on both child and adult equips
* FIX: Jabu Item
* update equipped hookshot/longshot when obtained as other age
* add hint
* don't give the bgs check without the claim check
* Skips Darunia Cutscene in Fire Temple
* Added a TODO note about not skipping the cutscene.
There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch.
* remove todo
* restore fast ocarina option in imgui that was lost in merge
* Fixes grey screen issue + tooltip for 2 handed shield
* update to use dg instead of g for textures in item tracker
* TWEAK: Default color for cosmetic RAND button was not the corect one
* fix texture crash, remove unused item tracker code
* don't open mask shop until we get zelda's letter
* Update README.md
* Prevents "correct" chime under incorrect conditions.
* Fixes typo in conditional and adds "bonk" sound effect.
"Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time.
* remove modify dpad equips toggle, replace with checks for dpad menu
* remove extra check
* add ability to hold c-up to assign to dpad when dpad menuing is enabled
* disable d-pad navigation on item menu when holding c-up to equip
* dpad+c-up stuff for equipment menu
* ADD: Checbox for songs colors
* TWEAK: RandoColors for normal songs
* kind of quick and dirty but it works
* TWEAK: Clarity of the tooltip
Co-authored-by: briaguya <briaguya@alice>
Co-authored-by: Christopher Leggett <chris@leggett.dev>
Co-authored-by: aMannus <mannusmenting@gmail.com>
Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com>
Co-authored-by: Dog <5172592+Dog@users.noreply.github.com>
Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com>
Co-authored-by: Baoulettes <perlouzerie@hotmail.fr>
Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
|
|
|
|
if (gSaveContext.entranceIndex == 0x7A) {
|
|
|
|
|
gSaveContext.entranceIndex = 0x400;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-03-21 21:51:23 -04:00
|
|
|
|
if (gSaveContext.entranceIndex == -1) {
|
|
|
|
|
gSaveContext.entranceIndex = 0;
|
2022-11-06 03:24:34 -05:00
|
|
|
|
play->state.running = false;
|
|
|
|
|
SET_NEXT_GAMESTATE(&play->state, Opening_Init, OpeningContext);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SystemArena_Display();
|
|
|
|
|
// OTRTODO allocate double the normal amount of memory
|
|
|
|
|
// This is to avoid some parts of the game, like loading actors, causing OoM
|
|
|
|
|
// This is potionally unavoidable due to struct size differences, but is x2 the right amount?
|
2022-11-06 03:24:34 -05:00
|
|
|
|
GameState_Realloc(&play->state, 0x1D4790 * 2);
|
|
|
|
|
KaleidoManager_Init(play);
|
|
|
|
|
View_Init(&play->view, gfxCtx);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
Audio_SetExtraFilter(0);
|
|
|
|
|
Quake_Init();
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
for (i = 0; i < ARRAY_COUNT(play->cameraPtrs); i++) {
|
|
|
|
|
play->cameraPtrs[i] = NULL;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
Camera_Init(&play->mainCamera, &play->view, &play->colCtx, play);
|
|
|
|
|
Camera_ChangeStatus(&play->mainCamera, CAM_STAT_ACTIVE);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
|
|
|
|
for (i = 0; i < 3; i++) {
|
2022-11-06 03:24:34 -05:00
|
|
|
|
Camera_Init(&play->subCameras[i], &play->view, &play->colCtx, play);
|
|
|
|
|
Camera_ChangeStatus(&play->subCameras[i], CAM_STAT_UNK100);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
play->cameraPtrs[MAIN_CAM] = &play->mainCamera;
|
|
|
|
|
play->cameraPtrs[MAIN_CAM]->uid = 0;
|
|
|
|
|
play->activeCamera = MAIN_CAM;
|
|
|
|
|
func_8005AC48(&play->mainCamera, 0xFF);
|
|
|
|
|
func_80112098(play);
|
|
|
|
|
Message_Init(play);
|
|
|
|
|
GameOver_Init(play);
|
|
|
|
|
SoundSource_InitAll(play);
|
|
|
|
|
Effect_InitContext(play);
|
|
|
|
|
EffectSs_InitInfo(play, 0x55);
|
|
|
|
|
CollisionCheck_InitContext(play, &play->colChkCtx);
|
|
|
|
|
AnimationContext_Reset(&play->animationCtx);
|
|
|
|
|
func_8006450C(play, &play->csCtx);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
|
|
|
|
if (gSaveContext.nextCutsceneIndex != 0xFFEF) {
|
|
|
|
|
gSaveContext.cutsceneIndex = gSaveContext.nextCutsceneIndex;
|
|
|
|
|
gSaveContext.nextCutsceneIndex = 0xFFEF;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (gSaveContext.cutsceneIndex == 0xFFFD) {
|
|
|
|
|
gSaveContext.cutsceneIndex = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (gSaveContext.nextDayTime != 0xFFFF) {
|
|
|
|
|
gSaveContext.dayTime = gSaveContext.nextDayTime;
|
|
|
|
|
gSaveContext.skyboxTime = gSaveContext.nextDayTime;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (gSaveContext.dayTime > 0xC000 || gSaveContext.dayTime < 0x4555) {
|
|
|
|
|
gSaveContext.nightFlag = 1;
|
|
|
|
|
} else {
|
|
|
|
|
gSaveContext.nightFlag = 0;
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
Cutscene_HandleConditionalTriggers(play);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
|
|
|
|
if (gSaveContext.gameMode != 0 || gSaveContext.cutsceneIndex >= 0xFFF0) {
|
|
|
|
|
gSaveContext.nayrusLoveTimer = 0;
|
2022-11-06 03:24:34 -05:00
|
|
|
|
func_800876C8(play);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
gSaveContext.sceneSetupIndex = (gSaveContext.cutsceneIndex & 0xF) + 4;
|
|
|
|
|
} else if (!LINK_IS_ADULT && IS_DAY) {
|
|
|
|
|
gSaveContext.sceneSetupIndex = 0;
|
|
|
|
|
} else if (!LINK_IS_ADULT && !IS_DAY) {
|
|
|
|
|
gSaveContext.sceneSetupIndex = 1;
|
|
|
|
|
} else if (LINK_IS_ADULT && IS_DAY) {
|
|
|
|
|
gSaveContext.sceneSetupIndex = 2;
|
|
|
|
|
} else {
|
|
|
|
|
gSaveContext.sceneSetupIndex = 3;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
tempSetupIndex = gSaveContext.sceneSetupIndex;
|
|
|
|
|
if ((gEntranceTable[((void)0, gSaveContext.entranceIndex)].scene == SCENE_SPOT00) && !LINK_IS_ADULT &&
|
|
|
|
|
gSaveContext.sceneSetupIndex < 4) {
|
|
|
|
|
if (CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) && CHECK_QUEST_ITEM(QUEST_GORON_RUBY) &&
|
|
|
|
|
CHECK_QUEST_ITEM(QUEST_ZORA_SAPPHIRE)) {
|
|
|
|
|
gSaveContext.sceneSetupIndex = 1;
|
|
|
|
|
} else {
|
|
|
|
|
gSaveContext.sceneSetupIndex = 0;
|
|
|
|
|
}
|
|
|
|
|
} else if ((gEntranceTable[((void)0, gSaveContext.entranceIndex)].scene == SCENE_SPOT04) && LINK_IS_ADULT &&
|
|
|
|
|
gSaveContext.sceneSetupIndex < 4) {
|
|
|
|
|
gSaveContext.sceneSetupIndex = (gSaveContext.eventChkInf[4] & 0x100) ? 3 : 2;
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
Play_SpawnScene(
|
|
|
|
|
play,
|
2022-03-21 21:51:23 -04:00
|
|
|
|
gEntranceTable[((void)0, gSaveContext.entranceIndex) + ((void)0, gSaveContext.sceneSetupIndex)].scene,
|
|
|
|
|
gEntranceTable[((void)0, gSaveContext.sceneSetupIndex) + ((void)0, gSaveContext.entranceIndex)].spawn);
|
2022-11-14 06:13:21 -05:00
|
|
|
|
|
2022-03-21 21:51:23 -04:00
|
|
|
|
osSyncPrintf("\nSCENE_NO=%d COUNTER=%d\n", ((void)0, gSaveContext.entranceIndex), gSaveContext.sceneSetupIndex);
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
Cutscene_HandleEntranceTriggers(play);
|
|
|
|
|
KaleidoScopeCall_Init(play);
|
|
|
|
|
func_801109B0(play);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
|
|
|
|
if (gSaveContext.nextDayTime != 0xFFFF) {
|
|
|
|
|
if (gSaveContext.nextDayTime == 0x8001) {
|
|
|
|
|
gSaveContext.totalDays++;
|
|
|
|
|
gSaveContext.bgsDayCount++;
|
|
|
|
|
gSaveContext.dogIsLost = true;
|
2022-11-06 03:24:34 -05:00
|
|
|
|
if (Inventory_ReplaceItem(play, ITEM_WEIRD_EGG, ITEM_CHICKEN) ||
|
|
|
|
|
Inventory_HatchPocketCucco(play)) {
|
|
|
|
|
Message_StartTextbox(play, 0x3066, NULL);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
gSaveContext.nextDayTime = 0xFFFE;
|
|
|
|
|
} else {
|
|
|
|
|
gSaveContext.nextDayTime = 0xFFFD;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SREG(91) = -1;
|
|
|
|
|
R_PAUSE_MENU_MODE = 0;
|
2022-11-06 03:24:34 -05:00
|
|
|
|
PreRender_Init(&play->pauseBgPreRender);
|
|
|
|
|
PreRender_SetValuesSave(&play->pauseBgPreRender, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0, 0);
|
|
|
|
|
PreRender_SetValues(&play->pauseBgPreRender, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
gTrnsnUnkState = 0;
|
2022-11-06 03:24:34 -05:00
|
|
|
|
play->transitionMode = 0;
|
2022-08-23 20:20:56 -04:00
|
|
|
|
|
|
|
|
|
if (CVar_GetS32("gSceneTransitions", 255)!= 255){
|
2022-11-06 03:24:34 -05:00
|
|
|
|
play->transitionMode = CVar_GetS32("gSceneTransitions", 0);
|
2022-11-29 18:28:57 -05:00
|
|
|
|
gSaveContext.nextTransitionType = CVar_GetS32("gSceneTransitions", 0);
|
2022-11-06 03:24:34 -05:00
|
|
|
|
play->fadeTransition = CVar_GetS32("gSceneTransitions", 0);
|
2022-08-23 20:20:56 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
FrameAdvance_Init(&play->frameAdvCtx);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
Rand_Seed((u32)osGetTime());
|
2022-11-06 03:24:34 -05:00
|
|
|
|
Matrix_Init(&play->state);
|
|
|
|
|
play->state.main = Play_Main;
|
|
|
|
|
play->state.destroy = Play_Destroy;
|
|
|
|
|
play->sceneLoadFlag = -0x14;
|
|
|
|
|
play->unk_11E16 = 0xFF;
|
|
|
|
|
play->unk_11E18 = 0;
|
|
|
|
|
play->unk_11DE9 = 0;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
|
|
|
|
if (gSaveContext.gameMode != 1) {
|
2022-11-29 18:28:57 -05:00
|
|
|
|
if (gSaveContext.nextTransitionType == 0xFF) {
|
2022-11-06 03:24:34 -05:00
|
|
|
|
play->fadeTransition =
|
2022-03-21 21:51:23 -04:00
|
|
|
|
(gEntranceTable[((void)0, gSaveContext.entranceIndex) + tempSetupIndex].field >> 7) & 0x7F; // Fade In
|
|
|
|
|
} else {
|
2022-11-29 18:28:57 -05:00
|
|
|
|
play->fadeTransition = gSaveContext.nextTransitionType;
|
|
|
|
|
gSaveContext.nextTransitionType = 0xFF;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
} else {
|
2022-11-06 03:24:34 -05:00
|
|
|
|
play->fadeTransition = 6;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ShrinkWindow_Init();
|
2022-11-06 03:24:34 -05:00
|
|
|
|
TransitionFade_Init(&play->transitionFade);
|
|
|
|
|
TransitionFade_SetType(&play->transitionFade, 3);
|
|
|
|
|
TransitionFade_SetColor(&play->transitionFade, RGBA8(160, 160, 160, 255));
|
|
|
|
|
TransitionFade_Start(&play->transitionFade);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
VisMono_Init(&D_80161498);
|
|
|
|
|
D_801614B0.a = 0;
|
2022-11-06 03:24:34 -05:00
|
|
|
|
Flags_UnsetAllEnv(play);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
osSyncPrintf("ZELDA ALLOC SIZE=%x\n", THA_GetSize(&play->state.tha));
|
|
|
|
|
zAllocSize = THA_GetSize(&play->state.tha);
|
|
|
|
|
zAlloc = GAMESTATE_ALLOC_MC(&play->state, zAllocSize);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
zAllocAligned = (zAlloc + 8) & ~0xF;
|
|
|
|
|
ZeldaArena_Init(zAllocAligned, zAllocSize - zAllocAligned + zAlloc);
|
|
|
|
|
// "Zelda Heap"
|
|
|
|
|
osSyncPrintf("ゼルダヒープ %08x-%08x\n", zAllocAligned,
|
|
|
|
|
(s32)(zAllocAligned + zAllocSize) - (s32)(zAllocAligned - zAlloc));
|
|
|
|
|
|
|
|
|
|
Fault_AddClient(&D_801614B8, ZeldaArena_Display, NULL, NULL);
|
2022-11-06 03:24:34 -05:00
|
|
|
|
func_800304DC(play, &play->actorCtx, play->linkActorEntry);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
while (!func_800973FC(play, &play->roomCtx)) {
|
2022-03-21 21:51:23 -04:00
|
|
|
|
; // Empty Loop
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
player = GET_PLAYER(play);
|
|
|
|
|
Camera_InitPlayerSettings(&play->mainCamera, player);
|
|
|
|
|
Camera_ChangeMode(&play->mainCamera, CAM_MODE_NORMAL);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
2022-07-10 09:30:19 -04:00
|
|
|
|
// OTRTODO: Bounds check cameraDataList to guard against scenes spawning the player with
|
|
|
|
|
// an out of bounds background camera index. This requires adding an extra field to the
|
|
|
|
|
// CollisionHeader struct to save the length of cameraDataList.
|
|
|
|
|
// Fixes Dodongo's Cavern blue warp crash.
|
|
|
|
|
{
|
2022-11-06 03:24:34 -05:00
|
|
|
|
CollisionHeader* colHeader = BgCheck_GetCollisionHeader(&play->colCtx, BGCHECK_SCENE);
|
2022-07-10 09:30:19 -04:00
|
|
|
|
|
|
|
|
|
// If the player's start cam is out of bounds, set it to 0xFF so it isn't used.
|
|
|
|
|
if (colHeader != NULL && ((player->actor.params & 0xFF) >= colHeader->cameraDataListLen)) {
|
|
|
|
|
player->actor.params |= 0xFF;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-03-21 21:51:23 -04:00
|
|
|
|
playerStartCamId = player->actor.params & 0xFF;
|
|
|
|
|
if (playerStartCamId != 0xFF) {
|
|
|
|
|
osSyncPrintf("player has start camera ID (" VT_FGCOL(BLUE) "%d" VT_RST ")\n", playerStartCamId);
|
2022-11-06 03:24:34 -05:00
|
|
|
|
Camera_ChangeDataIdx(&play->mainCamera, playerStartCamId);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (YREG(15) == 32) {
|
2022-11-06 03:24:34 -05:00
|
|
|
|
play->unk_1242B = 2;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
} else if (YREG(15) == 16) {
|
2022-11-06 03:24:34 -05:00
|
|
|
|
play->unk_1242B = 1;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
} else {
|
2022-11-06 03:24:34 -05:00
|
|
|
|
play->unk_1242B = 0;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
Interface_SetSceneRestrictions(play);
|
|
|
|
|
Environment_PlaySceneSequence(play);
|
|
|
|
|
gSaveContext.seqId = play->sequenceCtx.seqId;
|
|
|
|
|
gSaveContext.natureAmbienceId = play->sequenceCtx.natureAmbienceId;
|
|
|
|
|
func_8002DF18(play, GET_PLAYER(play));
|
|
|
|
|
AnimationContext_Update(play, &play->animationCtx);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
gSaveContext.respawnFlag = 0;
|
|
|
|
|
#if 0
|
|
|
|
|
if (dREG(95) != 0) {
|
|
|
|
|
D_8012D1F0 = D_801614D0;
|
|
|
|
|
osSyncPrintf("\nkawauso_data=[%x]", D_8012D1F0);
|
|
|
|
|
DmaMgr_DmaRomToRam(0x03FEB000, D_8012D1F0, sizeof(D_801614D0));
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
void Play_Update(PlayState* play) {
|
2022-03-21 21:51:23 -04:00
|
|
|
|
s32 pad1;
|
|
|
|
|
s32 sp80;
|
|
|
|
|
Input* input;
|
|
|
|
|
u32 i;
|
|
|
|
|
s32 pad2;
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
input = play->state.input;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
testing out item replacement (#416)
* skip learning song of storms
* don't set flag when getting goron tunic as child
* Initiates prelude check when master sword unloads.
Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again.
* Stops Shadow Temple lore prompts from appearing in rando.
* Skips cutscene of royal tomb explosion in rando.
Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here.
* Improves visual of exploding gravestone.
* Adds some comments explaining the rando differences
* Skip ruto text box in jabu blue warp
For rando
* skip intro cutscene in dodongo's cavern
* load spoiler files on boot, fix spoilerfile existing check when making new saves
* name entry dropped spoiler logic
* make sure to actually init the cvar
* no chime on load
* uncomment
* Skip ganondrof cutscene
Skip to scream part of the death animation, skipping the text boxes etc. For rando
* Update z_boss_ganondrof.c
* skip owl flight cutscenes in rando
* Fixes skipped text so it only applies to shadow temple.
Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors.
* Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case.
* TEST: Text for item
* Adding ganon flavor text
* ADD: AMMO Count
* format ganon text/hint text
* Autoskip the tower cutscene if settings call for tower collapse.
* ganon hint text logic
* Improved prelude after time travel fix
* swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things.
* this is all i did
* not the cleanest code ever but it's working
* ADD: GS Count
* ADD: Wallter (crash for now)
* TWEAK: Wallet check
* FIX: Use DrawItem instread of DrawUpgrade... b-baka!
* Fixes some vanilla bugs introduced by rando code.
* Added cutscene skip for zelda escaping
Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger
* ADD: X Spacing + Placeholders for song
* ADD: default case for items
* TWEAK: Spacing
* FIX: Light Arrow
* ADD: Ammo Option
* use groups instead
* ADD: More spacing logic
* songs and names
* TWEAK: Color on wallet
* colors
* Added flags cutscene before nabooru fight
* ADD: ChromaKey text
* First attempt skip cs after nabooru defeat
* Better implementation for specific rando cutscene skips
* use pulseaudio defaults
* spaces/tabs
* move color push/pop to stop crash
* make the colors work again
* the real bottle fix
* pulseaudio values tuned for n64 audio at 44.1khz
* update tlength
* remove one hardcoded samplerate
* Cleaned up and fixed zelda escape skip
The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of.
* Revert one line to match original
nothing functional
* another hint line that breaks autonewline logic
* don't autospawn epona if we don't have the song/ocarina
* Trying to use iron knuckle death effects
not working yet
* Streamlined OoT cutscene skip for future additions
Also cleaned up if statement in general
* Made if statement more readable
Also added clarity for what cutscene was skipped
* Fixed typo in comment
* Janky nabooru defeat cs skip
* altar text formatting (gonna need help shortening some of the french ones)
* more altar text formatting
* english altar text formatting complete
* make gtg blocking guard check for card not bridge
* FIX: Typo!
* FIX: Uppercases
* FIX: Typo
* TWEAK: Alter + some names
* TWEAK: More caps!
* ADD: Missing string
TWEAK more uppercases and namefixe
s
* Hide nabooru death by covering her in flames
* bandaid fix for death crash issue
* Twinrova defeat cs skip
Skips the animation and manually calls the function to show the "beam" around the sisters
* fix crash
* fix caps to match
* fix great fairy reward mashing/shielding issue
* TWEAK : Typo clé to Clé
* TWEAK: Some Altar hints
TWEAK: Some capitals
* TWEAK: Unmatching text + some cap again
* TWEAK: More tweaks
* fix build
* remove extra json.hpp, add hint
* Update randomizer_item_tracker.cpp
* TWEAK: Double Defense with RedParticles instead of white
* make sure we don't optimize out the check to ensure a spoilerfile exists
* vanilla ganon boss key hint formatting
* TWEAK: FR- better way of the hero text
* fix
* and again
* Initializes dungeonsDone items in gSaveContext to 0.
* Replaces sizeof calculation with a NUM_DUNGEONS constant.
* Fixes Saria's Gift on the LW Bridge from getting killed when holding shield.
* More airtight fix for Saria's Gift on the Bridge.
* Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId.
* Invalidate text box icon before drawing
* Fixes the case where Saria's gift is an Ice Trap.
We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine.
* Initial commit
Might need changing when we change the settings in the future
* Fixes Door of Time opening cutscene after warping with prelude.
* Initial waterfall skip
Very rudimentary way of doing things but it seems to work so :shrug:
* inital rework
* fixed default rotation for 2D sprites
* fix tab/space issues
* 3d drops rando merge fix again
* Allows Impa to appear in the Lullaby check post drawbridge escape.
* Changes Ganon's Trials Count setting to a checkbox
The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed.
* Sets all Ganon's Trials to incomplete in new saves.
Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131
* fix castle guards when oot throw cutscene has already played in rando
* Properly removes the beams when trials are cleared.
* Removes Question Mark from Skip Ganon's Trials UI.
* Adds a todo comment about when to change back to slider.
* make deku seeds check for bullet bag
* Various tweaks
TWEAK: Altar Text
TWEAK: Hint names
TWEAK: Replace more problematic œ to oe
* upgrade ocarina on both child and adult equips
* FIX: Jabu Item
* update equipped hookshot/longshot when obtained as other age
* add hint
* don't give the bgs check without the claim check
* Skips Darunia Cutscene in Fire Temple
* Added a TODO note about not skipping the cutscene.
There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch.
* remove todo
* restore fast ocarina option in imgui that was lost in merge
* Fixes grey screen issue + tooltip for 2 handed shield
* update to use dg instead of g for textures in item tracker
* TWEAK: Default color for cosmetic RAND button was not the corect one
* fix texture crash, remove unused item tracker code
* don't open mask shop until we get zelda's letter
* Update README.md
* Prevents "correct" chime under incorrect conditions.
* Fixes typo in conditional and adds "bonk" sound effect.
"Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time.
* remove modify dpad equips toggle, replace with checks for dpad menu
* remove extra check
* add ability to hold c-up to assign to dpad when dpad menuing is enabled
* disable d-pad navigation on item menu when holding c-up to equip
* dpad+c-up stuff for equipment menu
* ADD: Checbox for songs colors
* TWEAK: RandoColors for normal songs
* kind of quick and dirty but it works
* TWEAK: Clarity of the tooltip
Co-authored-by: briaguya <briaguya@alice>
Co-authored-by: Christopher Leggett <chris@leggett.dev>
Co-authored-by: aMannus <mannusmenting@gmail.com>
Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com>
Co-authored-by: Dog <5172592+Dog@users.noreply.github.com>
Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com>
Co-authored-by: Baoulettes <perlouzerie@hotmail.fr>
Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
|
|
|
|
if ((SREG(1) < 0) || (DREG(0) != 0)) {
|
2022-03-21 21:51:23 -04:00
|
|
|
|
SREG(1) = 0;
|
|
|
|
|
ZeldaArena_Display();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ((HREG(80) == 18) && (HREG(81) < 0)) {
|
|
|
|
|
HREG(81) = 0;
|
|
|
|
|
osSyncPrintf("object_exchange_rom_address %u\n", gObjectTableSize);
|
|
|
|
|
osSyncPrintf("RomStart RomEnd Size\n");
|
|
|
|
|
for (i = 0; i < gObjectTableSize; i++) {
|
|
|
|
|
ptrdiff_t size = gObjectTable[i].vromEnd - gObjectTable[i].vromStart;
|
|
|
|
|
|
|
|
|
|
osSyncPrintf("%08x-%08x %08x(%8.3fKB)\n", gObjectTable[i].vromStart, gObjectTable[i].vromEnd, size,
|
|
|
|
|
size / 1024.0f);
|
|
|
|
|
}
|
|
|
|
|
osSyncPrintf("\n");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ((HREG(81) == 18) && (HREG(82) < 0)) {
|
|
|
|
|
HREG(82) = 0;
|
|
|
|
|
ActorOverlayTable_LogPrint();
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
if (CVar_GetS32("gFreeCamera", 0) && Player_InCsMode(play)) {
|
|
|
|
|
play->manualCamera = false;
|
2022-07-12 18:40:18 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
gSegments[4] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[play->objectCtx.mainKeepIndex].segment);
|
|
|
|
|
gSegments[5] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[play->objectCtx.subKeepIndex].segment);
|
|
|
|
|
gSegments[2] = VIRTUAL_TO_PHYSICAL(play->sceneSegment);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
if (FrameAdvance_Update(&play->frameAdvCtx, &input[1])) {
|
|
|
|
|
if ((play->transitionMode == 0) && (play->sceneLoadFlag != 0)) {
|
|
|
|
|
play->transitionMode = 1;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-22 20:04:40 -05:00
|
|
|
|
// Gameplay stats: Count button presses
|
|
|
|
|
if (!gSaveContext.sohStats.gameComplete) {
|
|
|
|
|
if (CHECK_BTN_ALL(input[0].press.button, BTN_A)) {gSaveContext.sohStats.count[COUNT_BUTTON_PRESSES_A]++;}
|
|
|
|
|
if (CHECK_BTN_ALL(input[0].press.button, BTN_B)) {gSaveContext.sohStats.count[COUNT_BUTTON_PRESSES_B]++;}
|
|
|
|
|
if (CHECK_BTN_ALL(input[0].press.button, BTN_CUP)) {gSaveContext.sohStats.count[COUNT_BUTTON_PRESSES_CUP]++;}
|
2022-11-23 20:53:10 -05:00
|
|
|
|
if (CHECK_BTN_ALL(input[0].press.button, BTN_CRIGHT)) {gSaveContext.sohStats.count[COUNT_BUTTON_PRESSES_CRIGHT]++;}
|
|
|
|
|
if (CHECK_BTN_ALL(input[0].press.button, BTN_CLEFT)) {gSaveContext.sohStats.count[COUNT_BUTTON_PRESSES_CLEFT]++;}
|
|
|
|
|
if (CHECK_BTN_ALL(input[0].press.button, BTN_CDOWN)) {gSaveContext.sohStats.count[COUNT_BUTTON_PRESSES_CDOWN]++;}
|
2022-11-22 20:04:40 -05:00
|
|
|
|
if (CHECK_BTN_ALL(input[0].press.button, BTN_DUP)) {gSaveContext.sohStats.count[COUNT_BUTTON_PRESSES_DUP]++;}
|
|
|
|
|
if (CHECK_BTN_ALL(input[0].press.button, BTN_DRIGHT)) {gSaveContext.sohStats.count[COUNT_BUTTON_PRESSES_DRIGHT]++;}
|
|
|
|
|
if (CHECK_BTN_ALL(input[0].press.button, BTN_DDOWN)) {gSaveContext.sohStats.count[COUNT_BUTTON_PRESSES_DDOWN]++;}
|
|
|
|
|
if (CHECK_BTN_ALL(input[0].press.button, BTN_DLEFT)) {gSaveContext.sohStats.count[COUNT_BUTTON_PRESSES_DLEFT]++;}
|
|
|
|
|
if (CHECK_BTN_ALL(input[0].press.button, BTN_L)) {gSaveContext.sohStats.count[COUNT_BUTTON_PRESSES_L]++;}
|
|
|
|
|
if (CHECK_BTN_ALL(input[0].press.button, BTN_R)) {gSaveContext.sohStats.count[COUNT_BUTTON_PRESSES_R]++;}
|
|
|
|
|
if (CHECK_BTN_ALL(input[0].press.button, BTN_Z)) {gSaveContext.sohStats.count[COUNT_BUTTON_PRESSES_Z]++;}
|
|
|
|
|
if (CHECK_BTN_ALL(input[0].press.button, BTN_START)) {gSaveContext.sohStats.count[COUNT_BUTTON_PRESSES_START]++;}
|
|
|
|
|
}
|
|
|
|
|
|
2022-03-21 21:51:23 -04:00
|
|
|
|
if (gTrnsnUnkState != 0) {
|
|
|
|
|
switch (gTrnsnUnkState) {
|
|
|
|
|
case 2:
|
|
|
|
|
if (TransitionUnk_Init(&sTrnsnUnk, 10, 7) == NULL) {
|
|
|
|
|
osSyncPrintf("fbdemo_init呼出し失敗!\n"); // "fbdemo_init call failed!"
|
|
|
|
|
gTrnsnUnkState = 0;
|
|
|
|
|
} else {
|
|
|
|
|
sTrnsnUnk.zBuffer = (u16*)gZBuffer;
|
|
|
|
|
gTrnsnUnkState = 3;
|
|
|
|
|
R_UPDATE_RATE = 1;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 3:
|
|
|
|
|
func_800B23E8(&sTrnsnUnk);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
if (play->transitionMode) {
|
|
|
|
|
switch (play->transitionMode) {
|
2022-03-21 21:51:23 -04:00
|
|
|
|
case 1:
|
2022-11-06 03:24:34 -05:00
|
|
|
|
if (play->sceneLoadFlag != -0x14) {
|
2022-03-21 21:51:23 -04:00
|
|
|
|
s16 sp6E = 0;
|
|
|
|
|
Interface_ChangeAlpha(1);
|
|
|
|
|
|
|
|
|
|
if (gSaveContext.cutsceneIndex >= 0xFFF0) {
|
|
|
|
|
sp6E = (gSaveContext.cutsceneIndex & 0xF) + 4;
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
if (!(gEntranceTable[play->nextEntranceIndex + sp6E].field & 0x8000)) { // Continue BGM Off
|
2022-03-21 21:51:23 -04:00
|
|
|
|
// "Sound initalized. 111"
|
|
|
|
|
osSyncPrintf("\n\n\nサウンドイニシャル来ました。111");
|
2022-11-06 03:24:34 -05:00
|
|
|
|
if ((play->fadeTransition < 56) && !Environment_IsForcedSequenceDisabled()) {
|
2022-03-21 21:51:23 -04:00
|
|
|
|
// "Sound initalized. 222"
|
|
|
|
|
osSyncPrintf("\n\n\nサウンドイニシャル来ました。222");
|
|
|
|
|
func_800F6964(0x14);
|
|
|
|
|
gSaveContext.seqId = (u8)NA_BGM_DISABLED;
|
|
|
|
|
gSaveContext.natureAmbienceId = NATURE_ID_DISABLED;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (CREG(11) == 0) {
|
2022-11-06 03:24:34 -05:00
|
|
|
|
func_800BC5E0(play, play->fadeTransition);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
} else {
|
2022-11-06 03:24:34 -05:00
|
|
|
|
func_800BC5E0(play, CREG(12));
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
if (play->transitionMode >= 4) {
|
2022-03-21 21:51:23 -04:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case 2:
|
2022-11-06 03:24:34 -05:00
|
|
|
|
play->transitionCtx.init(&play->transitionCtx.data);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
if ((play->transitionCtx.transitionType >> 5) == 1) {
|
|
|
|
|
play->transitionCtx.setType(&play->transitionCtx.data,
|
|
|
|
|
play->transitionCtx.transitionType | 0x80);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-29 18:28:57 -05:00
|
|
|
|
gSaveContext.transWipeSpeed = 14;
|
2022-11-06 03:24:34 -05:00
|
|
|
|
if ((play->transitionCtx.transitionType == 8) ||
|
|
|
|
|
(play->transitionCtx.transitionType == 9)) {
|
2022-11-29 18:28:57 -05:00
|
|
|
|
gSaveContext.transWipeSpeed = 28;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-29 18:28:57 -05:00
|
|
|
|
gSaveContext.transFadeDuration = 60;
|
2022-11-06 03:24:34 -05:00
|
|
|
|
if ((play->transitionCtx.transitionType == 4) ||
|
|
|
|
|
(play->transitionCtx.transitionType == 5)) {
|
2022-11-29 18:28:57 -05:00
|
|
|
|
gSaveContext.transFadeDuration = 20;
|
2022-11-06 03:24:34 -05:00
|
|
|
|
} else if ((play->transitionCtx.transitionType == 6) ||
|
|
|
|
|
(play->transitionCtx.transitionType == 7)) {
|
2022-11-29 18:28:57 -05:00
|
|
|
|
gSaveContext.transFadeDuration = 150;
|
2022-11-06 03:24:34 -05:00
|
|
|
|
} else if (play->transitionCtx.transitionType == 17) {
|
2022-11-29 18:28:57 -05:00
|
|
|
|
gSaveContext.transFadeDuration = 2;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
if ((play->transitionCtx.transitionType == 3) ||
|
|
|
|
|
(play->transitionCtx.transitionType == 5) ||
|
|
|
|
|
(play->transitionCtx.transitionType == 7) ||
|
|
|
|
|
(play->transitionCtx.transitionType == 13) ||
|
|
|
|
|
(play->transitionCtx.transitionType == 17)) {
|
|
|
|
|
play->transitionCtx.setColor(&play->transitionCtx.data, RGBA8(160, 160, 160, 255));
|
|
|
|
|
if (play->transitionCtx.setEnvColor != NULL) {
|
|
|
|
|
play->transitionCtx.setEnvColor(&play->transitionCtx.data,
|
2022-03-21 21:51:23 -04:00
|
|
|
|
RGBA8(160, 160, 160, 255));
|
|
|
|
|
}
|
2022-11-06 03:24:34 -05:00
|
|
|
|
} else if (play->transitionCtx.transitionType == 18) {
|
|
|
|
|
play->transitionCtx.setColor(&play->transitionCtx.data, RGBA8(140, 140, 100, 255));
|
|
|
|
|
if (play->transitionCtx.setEnvColor != NULL) {
|
|
|
|
|
play->transitionCtx.setEnvColor(&play->transitionCtx.data,
|
2022-03-21 21:51:23 -04:00
|
|
|
|
RGBA8(140, 140, 100, 255));
|
|
|
|
|
}
|
2022-11-06 03:24:34 -05:00
|
|
|
|
} else if (play->transitionCtx.transitionType == 19) {
|
|
|
|
|
play->transitionCtx.setColor(&play->transitionCtx.data, RGBA8(70, 100, 110, 255));
|
|
|
|
|
if (play->transitionCtx.setEnvColor != NULL) {
|
|
|
|
|
play->transitionCtx.setEnvColor(&play->transitionCtx.data,
|
2022-03-21 21:51:23 -04:00
|
|
|
|
RGBA8(70, 100, 110, 255));
|
|
|
|
|
}
|
|
|
|
|
} else {
|
2022-11-06 03:24:34 -05:00
|
|
|
|
play->transitionCtx.setColor(&play->transitionCtx.data, RGBA8(0, 0, 0, 0));
|
|
|
|
|
if (play->transitionCtx.setEnvColor != NULL) {
|
|
|
|
|
play->transitionCtx.setEnvColor(&play->transitionCtx.data, RGBA8(0, 0, 0, 0));
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
if (play->sceneLoadFlag == -0x14) {
|
|
|
|
|
play->transitionCtx.setType(&play->transitionCtx.data, 1);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
} else {
|
2022-11-06 03:24:34 -05:00
|
|
|
|
play->transitionCtx.setType(&play->transitionCtx.data, 2);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
play->transitionCtx.start(&play->transitionCtx);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
if (play->transitionCtx.transitionType == 13) {
|
|
|
|
|
play->transitionMode = 11;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
} else {
|
2022-11-06 03:24:34 -05:00
|
|
|
|
play->transitionMode = 3;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 3:
|
2022-11-06 03:24:34 -05:00
|
|
|
|
if (play->transitionCtx.isDone(&play->transitionCtx) != 0) {
|
|
|
|
|
if (play->transitionCtx.transitionType >= 56) {
|
|
|
|
|
if (play->sceneLoadFlag == -0x14) {
|
|
|
|
|
play->transitionCtx.destroy(&play->transitionCtx);
|
|
|
|
|
func_800BC88C(play);
|
|
|
|
|
play->transitionMode = 0;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
2022-11-06 03:24:34 -05:00
|
|
|
|
} else if (play->sceneLoadFlag != -0x14) {
|
|
|
|
|
play->state.running = 0;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
if (gSaveContext.gameMode != 2) {
|
2022-11-06 03:24:34 -05:00
|
|
|
|
SET_NEXT_GAMESTATE(&play->state, Play_Init, PlayState);
|
|
|
|
|
gSaveContext.entranceIndex = play->nextEntranceIndex;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
if (gSaveContext.minigameState == 1) {
|
|
|
|
|
gSaveContext.minigameState = 3;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
2022-11-06 03:24:34 -05:00
|
|
|
|
SET_NEXT_GAMESTATE(&play->state, FileChoose_Init, FileChooseContext);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
} else {
|
2022-11-06 03:24:34 -05:00
|
|
|
|
play->transitionCtx.destroy(&play->transitionCtx);
|
|
|
|
|
func_800BC88C(play);
|
|
|
|
|
play->transitionMode = 0;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
if (gTrnsnUnkState == 3) {
|
|
|
|
|
TransitionUnk_Destroy(&sTrnsnUnk);
|
|
|
|
|
gTrnsnUnkState = 0;
|
|
|
|
|
R_UPDATE_RATE = 3;
|
|
|
|
|
}
|
2022-08-05 00:15:49 -04:00
|
|
|
|
|
|
|
|
|
// Don't autosave in grottos or cutscenes
|
2022-11-14 20:02:07 -05:00
|
|
|
|
// Also don't save when you first load a file
|
|
|
|
|
if (CVar_GetS32("gAutosave", 0) && (gSaveContext.cutsceneIndex == 0) && (play->gameplayFrames > 60) &&
|
2022-12-04 20:13:29 -05:00
|
|
|
|
(play->sceneNum != SCENE_YOUSEI_IZUMI_TATE) && (play->sceneNum != SCENE_KAKUSIANA) && (play->sceneNum != SCENE_KENJYANOMA)) {
|
2022-11-06 03:24:34 -05:00
|
|
|
|
Play_PerformSave(play);
|
2022-08-05 00:15:49 -04:00
|
|
|
|
}
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
2022-11-06 03:24:34 -05:00
|
|
|
|
play->sceneLoadFlag = 0;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
} else {
|
2022-11-06 03:24:34 -05:00
|
|
|
|
play->transitionCtx.update(&play->transitionCtx.data, R_UPDATE_RATE);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
switch (play->transitionMode) {
|
2022-03-21 21:51:23 -04:00
|
|
|
|
case 4:
|
|
|
|
|
D_801614C8 = 0;
|
2022-11-06 03:24:34 -05:00
|
|
|
|
play->envCtx.fillScreen = true;
|
|
|
|
|
play->envCtx.screenFillColor[0] = 160;
|
|
|
|
|
play->envCtx.screenFillColor[1] = 160;
|
|
|
|
|
play->envCtx.screenFillColor[2] = 160;
|
|
|
|
|
if (play->sceneLoadFlag != -0x14) {
|
|
|
|
|
play->envCtx.screenFillColor[3] = 0;
|
|
|
|
|
play->transitionMode = 5;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
} else {
|
2022-11-06 03:24:34 -05:00
|
|
|
|
play->envCtx.screenFillColor[3] = 255;
|
|
|
|
|
play->transitionMode = 6;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 5:
|
2022-11-06 03:24:34 -05:00
|
|
|
|
play->envCtx.screenFillColor[3] = (D_801614C8 / 20.0f) * 255.0f;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
if (D_801614C8 >= 20 && 1) {
|
2022-11-06 03:24:34 -05:00
|
|
|
|
play->state.running = 0;
|
|
|
|
|
SET_NEXT_GAMESTATE(&play->state, Play_Init, PlayState);
|
|
|
|
|
gSaveContext.entranceIndex = play->nextEntranceIndex;
|
|
|
|
|
play->sceneLoadFlag = 0;
|
|
|
|
|
play->transitionMode = 0;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
} else {
|
|
|
|
|
D_801614C8++;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 6:
|
2022-11-06 03:24:34 -05:00
|
|
|
|
play->envCtx.screenFillColor[3] = (1 - D_801614C8 / 20.0f) * 255.0f;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
if (D_801614C8 >= 20 && 1) {
|
|
|
|
|
gTrnsnUnkState = 0;
|
|
|
|
|
R_UPDATE_RATE = 3;
|
2022-11-06 03:24:34 -05:00
|
|
|
|
play->sceneLoadFlag = 0;
|
|
|
|
|
play->transitionMode = 0;
|
|
|
|
|
play->envCtx.fillScreen = false;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
} else {
|
|
|
|
|
D_801614C8++;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 7:
|
|
|
|
|
D_801614C8 = 0;
|
2022-11-06 03:24:34 -05:00
|
|
|
|
play->envCtx.fillScreen = true;
|
|
|
|
|
play->envCtx.screenFillColor[0] = 170;
|
|
|
|
|
play->envCtx.screenFillColor[1] = 160;
|
|
|
|
|
play->envCtx.screenFillColor[2] = 150;
|
|
|
|
|
if (play->sceneLoadFlag != -0x14) {
|
|
|
|
|
play->envCtx.screenFillColor[3] = 0;
|
|
|
|
|
play->transitionMode = 5;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
} else {
|
2022-11-06 03:24:34 -05:00
|
|
|
|
play->envCtx.screenFillColor[3] = 255;
|
|
|
|
|
play->transitionMode = 6;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 10:
|
2022-11-06 03:24:34 -05:00
|
|
|
|
if (play->sceneLoadFlag != -0x14) {
|
|
|
|
|
play->state.running = 0;
|
|
|
|
|
SET_NEXT_GAMESTATE(&play->state, Play_Init, PlayState);
|
|
|
|
|
gSaveContext.entranceIndex = play->nextEntranceIndex;
|
|
|
|
|
play->sceneLoadFlag = 0;
|
|
|
|
|
play->transitionMode = 0;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
} else {
|
|
|
|
|
gTrnsnUnkState = 0;
|
|
|
|
|
R_UPDATE_RATE = 3;
|
2022-11-06 03:24:34 -05:00
|
|
|
|
play->sceneLoadFlag = 0;
|
|
|
|
|
play->transitionMode = 0;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 11:
|
2022-11-29 18:28:57 -05:00
|
|
|
|
if (gSaveContext.cutsceneTransitionControl != 0) {
|
2022-11-06 03:24:34 -05:00
|
|
|
|
play->transitionMode = 3;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 12:
|
2022-11-06 03:24:34 -05:00
|
|
|
|
if (play->sceneLoadFlag != -0x14) {
|
|
|
|
|
play->envCtx.sandstormState = 1;
|
|
|
|
|
play->transitionMode = 13;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
} else {
|
2022-11-06 03:24:34 -05:00
|
|
|
|
play->envCtx.sandstormState = 2;
|
|
|
|
|
play->envCtx.sandstormPrimA = 255;
|
|
|
|
|
play->envCtx.sandstormEnvA = 255;
|
|
|
|
|
play->transitionMode = 13;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 13:
|
|
|
|
|
Audio_PlaySoundGeneral(NA_SE_EV_SAND_STORM - SFX_FLAG, &D_801333D4, 4, &D_801333E0, &D_801333E0,
|
|
|
|
|
&D_801333E8);
|
2022-11-06 03:24:34 -05:00
|
|
|
|
if (play->sceneLoadFlag == -0x14) {
|
|
|
|
|
if (play->envCtx.sandstormPrimA < 110) {
|
2022-03-21 21:51:23 -04:00
|
|
|
|
gTrnsnUnkState = 0;
|
|
|
|
|
R_UPDATE_RATE = 3;
|
2022-11-06 03:24:34 -05:00
|
|
|
|
play->sceneLoadFlag = 0;
|
|
|
|
|
play->transitionMode = 0;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
} else {
|
2022-11-06 03:24:34 -05:00
|
|
|
|
if (play->envCtx.sandstormEnvA == 255) {
|
|
|
|
|
play->state.running = 0;
|
|
|
|
|
SET_NEXT_GAMESTATE(&play->state, Play_Init, PlayState);
|
|
|
|
|
gSaveContext.entranceIndex = play->nextEntranceIndex;
|
|
|
|
|
play->sceneLoadFlag = 0;
|
|
|
|
|
play->transitionMode = 0;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 14:
|
2022-11-06 03:24:34 -05:00
|
|
|
|
if (play->sceneLoadFlag == -0x14) {
|
|
|
|
|
play->envCtx.sandstormState = 4;
|
|
|
|
|
play->envCtx.sandstormPrimA = 255;
|
|
|
|
|
play->envCtx.sandstormEnvA = 255;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
// "It's here!!!!!!!!!"
|
2022-07-05 19:29:34 -04:00
|
|
|
|
LOG_STRING("来た!!!!!!!!!!!!!!!!!!!!!");
|
2022-11-06 03:24:34 -05:00
|
|
|
|
play->transitionMode = 15;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
} else {
|
2022-11-06 03:24:34 -05:00
|
|
|
|
play->transitionMode = 12;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 15:
|
|
|
|
|
Audio_PlaySoundGeneral(NA_SE_EV_SAND_STORM - SFX_FLAG, &D_801333D4, 4, &D_801333E0, &D_801333E0,
|
|
|
|
|
&D_801333E8);
|
2022-11-06 03:24:34 -05:00
|
|
|
|
if (play->sceneLoadFlag == -0x14) {
|
|
|
|
|
if (play->envCtx.sandstormPrimA <= 0) {
|
2022-03-21 21:51:23 -04:00
|
|
|
|
gTrnsnUnkState = 0;
|
|
|
|
|
R_UPDATE_RATE = 3;
|
2022-11-06 03:24:34 -05:00
|
|
|
|
play->sceneLoadFlag = 0;
|
|
|
|
|
play->transitionMode = 0;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 16:
|
|
|
|
|
D_801614C8 = 0;
|
2022-11-06 03:24:34 -05:00
|
|
|
|
play->envCtx.fillScreen = true;
|
|
|
|
|
play->envCtx.screenFillColor[0] = 0;
|
|
|
|
|
play->envCtx.screenFillColor[1] = 0;
|
|
|
|
|
play->envCtx.screenFillColor[2] = 0;
|
|
|
|
|
play->envCtx.screenFillColor[3] = 255;
|
|
|
|
|
play->transitionMode = 17;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 17:
|
2022-11-29 18:28:57 -05:00
|
|
|
|
if (gSaveContext.cutsceneTransitionControl != 0) {
|
|
|
|
|
play->envCtx.screenFillColor[3] = gSaveContext.cutsceneTransitionControl;
|
|
|
|
|
if (gSaveContext.cutsceneTransitionControl < 0x65) {
|
2022-03-21 21:51:23 -04:00
|
|
|
|
gTrnsnUnkState = 0;
|
|
|
|
|
R_UPDATE_RATE = 3;
|
2022-11-06 03:24:34 -05:00
|
|
|
|
play->sceneLoadFlag = 0;
|
|
|
|
|
play->transitionMode = 0;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (1 && HREG(63)) {
|
2022-07-05 19:29:34 -04:00
|
|
|
|
LOG_NUM("1", 1);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (1 && (gTrnsnUnkState != 3)) {
|
|
|
|
|
if (1 && HREG(63)) {
|
2022-07-05 19:29:34 -04:00
|
|
|
|
LOG_NUM("1", 1);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
if ((gSaveContext.gameMode == 0) && (play->msgCtx.msgMode == MSGMODE_NONE) &&
|
|
|
|
|
(play->gameOverCtx.state == GAMEOVER_INACTIVE)) {
|
|
|
|
|
KaleidoSetup_Update(play);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (1 && HREG(63)) {
|
2022-07-05 19:29:34 -04:00
|
|
|
|
LOG_NUM("1", 1);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
sp80 = (play->pauseCtx.state != 0) || (play->pauseCtx.debugState != 0);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
|
|
|
|
if (1 && HREG(63)) {
|
2022-07-05 19:29:34 -04:00
|
|
|
|
LOG_NUM("1", 1);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
AnimationContext_Reset(&play->animationCtx);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
|
|
|
|
if (1 && HREG(63)) {
|
2022-07-05 19:29:34 -04:00
|
|
|
|
LOG_NUM("1", 1);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
Object_UpdateBank(&play->objectCtx);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
|
|
|
|
if (1 && HREG(63)) {
|
2022-07-05 19:29:34 -04:00
|
|
|
|
LOG_NUM("1", 1);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ((sp80 == 0) && (IREG(72) == 0)) {
|
|
|
|
|
if (1 && HREG(63)) {
|
2022-07-05 19:29:34 -04:00
|
|
|
|
LOG_NUM("1", 1);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
play->gameplayFrames++;
|
2022-11-22 20:04:40 -05:00
|
|
|
|
// Gameplay stat tracking
|
|
|
|
|
if (!gSaveContext.sohStats.gameComplete) {
|
|
|
|
|
gSaveContext.sohStats.playTimer++;
|
2022-12-10 15:37:33 -05:00
|
|
|
|
|
|
|
|
|
if (CVar_GetS32("gMMBunnyHood", 0) && Player_GetMask(play) == PLAYER_MASK_BUNNY) {
|
|
|
|
|
gSaveContext.sohStats.count[COUNT_TIME_BUNNY_HOOD]++;
|
|
|
|
|
}
|
2022-11-22 20:04:40 -05:00
|
|
|
|
}
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
|
|
|
|
func_800AA178(1);
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
if (play->actorCtx.freezeFlashTimer && (play->actorCtx.freezeFlashTimer-- < 5)) {
|
|
|
|
|
osSyncPrintf("FINISH=%d\n", play->actorCtx.freezeFlashTimer);
|
|
|
|
|
if ((play->actorCtx.freezeFlashTimer > 0) &&
|
|
|
|
|
((play->actorCtx.freezeFlashTimer % 2) != 0)) {
|
|
|
|
|
play->envCtx.fillScreen = true;
|
|
|
|
|
play->envCtx.screenFillColor[0] = play->envCtx.screenFillColor[1] =
|
|
|
|
|
play->envCtx.screenFillColor[2] = 150;
|
|
|
|
|
play->envCtx.screenFillColor[3] = 80;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
} else {
|
2022-11-06 03:24:34 -05:00
|
|
|
|
play->envCtx.fillScreen = false;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (1 && HREG(63)) {
|
2022-07-05 19:29:34 -04:00
|
|
|
|
LOG_NUM("1", 1);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
func_800973FC(play, &play->roomCtx);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
|
|
|
|
if (1 && HREG(63)) {
|
2022-07-05 19:29:34 -04:00
|
|
|
|
LOG_NUM("1", 1);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
CollisionCheck_AT(play, &play->colChkCtx);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
|
|
|
|
if (1 && HREG(63)) {
|
2022-07-05 19:29:34 -04:00
|
|
|
|
LOG_NUM("1", 1);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
CollisionCheck_OC(play, &play->colChkCtx);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
|
|
|
|
if (1 && HREG(63)) {
|
2022-07-05 19:29:34 -04:00
|
|
|
|
LOG_NUM("1", 1);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
CollisionCheck_Damage(play, &play->colChkCtx);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
|
|
|
|
if (1 && HREG(63)) {
|
2022-07-05 19:29:34 -04:00
|
|
|
|
LOG_NUM("1", 1);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
CollisionCheck_ClearContext(play, &play->colChkCtx);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
|
|
|
|
if (1 && HREG(63)) {
|
2022-07-05 19:29:34 -04:00
|
|
|
|
LOG_NUM("1", 1);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
if (play->unk_11DE9 == 0) {
|
|
|
|
|
Actor_UpdateAll(play, &play->actorCtx);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (1 && HREG(63)) {
|
2022-07-05 19:29:34 -04:00
|
|
|
|
LOG_NUM("1", 1);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
func_80064558(play, &play->csCtx);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
|
|
|
|
if (1 && HREG(63)) {
|
2022-07-05 19:29:34 -04:00
|
|
|
|
LOG_NUM("1", 1);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
func_800645A0(play, &play->csCtx);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
|
|
|
|
if (1 && HREG(63)) {
|
2022-07-05 19:29:34 -04:00
|
|
|
|
LOG_NUM("1", 1);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
Effect_UpdateAll(play);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
|
|
|
|
if (1 && HREG(63)) {
|
2022-07-05 19:29:34 -04:00
|
|
|
|
LOG_NUM("1", 1);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
EffectSs_UpdateAll(play);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
|
|
|
|
if (1 && HREG(63)) {
|
2022-07-05 19:29:34 -04:00
|
|
|
|
LOG_NUM("1", 1);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
func_800AA178(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (1 && HREG(63)) {
|
2022-07-05 19:29:34 -04:00
|
|
|
|
LOG_NUM("1", 1);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
func_80095AA0(play, &play->roomCtx.curRoom, &input[1], 0);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
|
|
|
|
if (1 && HREG(63)) {
|
2022-07-05 19:29:34 -04:00
|
|
|
|
LOG_NUM("1", 1);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
func_80095AA0(play, &play->roomCtx.prevRoom, &input[1], 1);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
|
|
|
|
if (1 && HREG(63)) {
|
2022-07-05 19:29:34 -04:00
|
|
|
|
LOG_NUM("1", 1);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
if (play->unk_1242B != 0) {
|
2022-03-21 21:51:23 -04:00
|
|
|
|
if (CHECK_BTN_ALL(input[0].press.button, BTN_CUP)) {
|
2022-11-06 03:24:34 -05:00
|
|
|
|
if ((play->pauseCtx.state != 0) || (play->pauseCtx.debugState != 0)) {
|
2022-03-21 21:51:23 -04:00
|
|
|
|
// "Changing viewpoint is prohibited due to the kaleidoscope"
|
|
|
|
|
osSyncPrintf(VT_FGCOL(CYAN) "カレイドスコープ中につき視点変更を禁止しております\n" VT_RST);
|
2022-11-06 03:24:34 -05:00
|
|
|
|
} else if (Player_InCsMode(play)) {
|
2022-03-21 21:51:23 -04:00
|
|
|
|
// "Changing viewpoint is prohibited during the cutscene"
|
|
|
|
|
osSyncPrintf(VT_FGCOL(CYAN) "デモ中につき視点変更を禁止しております\n" VT_RST);
|
|
|
|
|
} else if (YREG(15) == 0x10) {
|
|
|
|
|
Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
|
|
|
|
|
} else {
|
2022-11-06 03:24:34 -05:00
|
|
|
|
func_800BC490(play, play->unk_1242B ^ 3);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
}
|
2022-11-06 03:24:34 -05:00
|
|
|
|
func_800BC450(play);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (1 && HREG(63)) {
|
2022-07-05 19:29:34 -04:00
|
|
|
|
LOG_NUM("1", 1);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
SkyboxDraw_Update(&play->skyboxCtx);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
|
|
|
|
if (1 && HREG(63)) {
|
2022-07-05 19:29:34 -04:00
|
|
|
|
LOG_NUM("1", 1);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
if ((play->pauseCtx.state != 0) || (play->pauseCtx.debugState != 0)) {
|
2022-03-21 21:51:23 -04:00
|
|
|
|
if (1 && HREG(63)) {
|
2022-07-05 19:29:34 -04:00
|
|
|
|
LOG_NUM("1", 1);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
KaleidoScopeCall_Update(play);
|
|
|
|
|
} else if (play->gameOverCtx.state != GAMEOVER_INACTIVE) {
|
2022-03-21 21:51:23 -04:00
|
|
|
|
if (1 && HREG(63)) {
|
2022-07-05 19:29:34 -04:00
|
|
|
|
LOG_NUM("1", 1);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
GameOver_Update(play);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
} else {
|
|
|
|
|
if (1 && HREG(63)) {
|
2022-07-05 19:29:34 -04:00
|
|
|
|
LOG_NUM("1", 1);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
Message_Update(play);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (1 && HREG(63)) {
|
2022-07-05 19:29:34 -04:00
|
|
|
|
LOG_NUM("1", 1);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (1 && HREG(63)) {
|
2022-07-05 19:29:34 -04:00
|
|
|
|
LOG_NUM("1", 1);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
Interface_Update(play);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
|
|
|
|
if (1 && HREG(63)) {
|
2022-07-05 19:29:34 -04:00
|
|
|
|
LOG_NUM("1", 1);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
AnimationContext_Update(play, &play->animationCtx);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
|
|
|
|
if (1 && HREG(63)) {
|
2022-07-05 19:29:34 -04:00
|
|
|
|
LOG_NUM("1", 1);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
SoundSource_UpdateAll(play);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
|
|
|
|
if (1 && HREG(63)) {
|
2022-07-05 19:29:34 -04:00
|
|
|
|
LOG_NUM("1", 1);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ShrinkWindow_Update(R_UPDATE_RATE);
|
|
|
|
|
|
|
|
|
|
if (1 && HREG(63)) {
|
2022-07-05 19:29:34 -04:00
|
|
|
|
LOG_NUM("1", 1);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
TransitionFade_Update(&play->transitionFade, R_UPDATE_RATE);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
} else {
|
|
|
|
|
goto skip;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (1 && HREG(63)) {
|
2022-07-05 19:29:34 -04:00
|
|
|
|
LOG_NUM("1", 1);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
skip:
|
|
|
|
|
if (1 && HREG(63)) {
|
2022-07-05 19:29:34 -04:00
|
|
|
|
LOG_NUM("1", 1);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ((sp80 == 0) || (gDbgCamEnabled)) {
|
|
|
|
|
s32 pad3[5];
|
|
|
|
|
s32 i;
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
play->nextCamera = play->activeCamera;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
|
|
|
|
if (1 && HREG(63)) {
|
2022-07-05 19:29:34 -04:00
|
|
|
|
LOG_NUM("1", 1);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < NUM_CAMS; i++) {
|
2022-11-06 03:24:34 -05:00
|
|
|
|
if ((i != play->nextCamera) && (play->cameraPtrs[i] != NULL)) {
|
2022-03-21 21:51:23 -04:00
|
|
|
|
if (1 && HREG(63)) {
|
2022-07-05 19:29:34 -04:00
|
|
|
|
LOG_NUM("1", 1);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
Camera_Update(play->cameraPtrs[i]);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
Camera_Update(play->cameraPtrs[play->nextCamera]);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
|
|
|
|
if (1 && HREG(63)) {
|
2022-07-05 19:29:34 -04:00
|
|
|
|
LOG_NUM("1", 1);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (1 && HREG(63)) {
|
2022-07-05 19:29:34 -04:00
|
|
|
|
LOG_NUM("1", 1);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
Environment_Update(play, &play->envCtx, &play->lightCtx, &play->pauseCtx, &play->msgCtx,
|
|
|
|
|
&play->gameOverCtx, play->state.gfxCtx);
|
testing out item replacement (#416)
* skip learning song of storms
* don't set flag when getting goron tunic as child
* Initiates prelude check when master sword unloads.
Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again.
* Stops Shadow Temple lore prompts from appearing in rando.
* Skips cutscene of royal tomb explosion in rando.
Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here.
* Improves visual of exploding gravestone.
* Adds some comments explaining the rando differences
* Skip ruto text box in jabu blue warp
For rando
* skip intro cutscene in dodongo's cavern
* load spoiler files on boot, fix spoilerfile existing check when making new saves
* name entry dropped spoiler logic
* make sure to actually init the cvar
* no chime on load
* uncomment
* Skip ganondrof cutscene
Skip to scream part of the death animation, skipping the text boxes etc. For rando
* Update z_boss_ganondrof.c
* skip owl flight cutscenes in rando
* Fixes skipped text so it only applies to shadow temple.
Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors.
* Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case.
* TEST: Text for item
* Adding ganon flavor text
* ADD: AMMO Count
* format ganon text/hint text
* Autoskip the tower cutscene if settings call for tower collapse.
* ganon hint text logic
* Improved prelude after time travel fix
* swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things.
* this is all i did
* not the cleanest code ever but it's working
* ADD: GS Count
* ADD: Wallter (crash for now)
* TWEAK: Wallet check
* FIX: Use DrawItem instread of DrawUpgrade... b-baka!
* Fixes some vanilla bugs introduced by rando code.
* Added cutscene skip for zelda escaping
Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger
* ADD: X Spacing + Placeholders for song
* ADD: default case for items
* TWEAK: Spacing
* FIX: Light Arrow
* ADD: Ammo Option
* use groups instead
* ADD: More spacing logic
* songs and names
* TWEAK: Color on wallet
* colors
* Added flags cutscene before nabooru fight
* ADD: ChromaKey text
* First attempt skip cs after nabooru defeat
* Better implementation for specific rando cutscene skips
* use pulseaudio defaults
* spaces/tabs
* move color push/pop to stop crash
* make the colors work again
* the real bottle fix
* pulseaudio values tuned for n64 audio at 44.1khz
* update tlength
* remove one hardcoded samplerate
* Cleaned up and fixed zelda escape skip
The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of.
* Revert one line to match original
nothing functional
* another hint line that breaks autonewline logic
* don't autospawn epona if we don't have the song/ocarina
* Trying to use iron knuckle death effects
not working yet
* Streamlined OoT cutscene skip for future additions
Also cleaned up if statement in general
* Made if statement more readable
Also added clarity for what cutscene was skipped
* Fixed typo in comment
* Janky nabooru defeat cs skip
* altar text formatting (gonna need help shortening some of the french ones)
* more altar text formatting
* english altar text formatting complete
* make gtg blocking guard check for card not bridge
* FIX: Typo!
* FIX: Uppercases
* FIX: Typo
* TWEAK: Alter + some names
* TWEAK: More caps!
* ADD: Missing string
TWEAK more uppercases and namefixe
s
* Hide nabooru death by covering her in flames
* bandaid fix for death crash issue
* Twinrova defeat cs skip
Skips the animation and manually calls the function to show the "beam" around the sisters
* fix crash
* fix caps to match
* fix great fairy reward mashing/shielding issue
* TWEAK : Typo clé to Clé
* TWEAK: Some Altar hints
TWEAK: Some capitals
* TWEAK: Unmatching text + some cap again
* TWEAK: More tweaks
* fix build
* remove extra json.hpp, add hint
* Update randomizer_item_tracker.cpp
* TWEAK: Double Defense with RedParticles instead of white
* make sure we don't optimize out the check to ensure a spoilerfile exists
* vanilla ganon boss key hint formatting
* TWEAK: FR- better way of the hero text
* fix
* and again
* Initializes dungeonsDone items in gSaveContext to 0.
* Replaces sizeof calculation with a NUM_DUNGEONS constant.
* Fixes Saria's Gift on the LW Bridge from getting killed when holding shield.
* More airtight fix for Saria's Gift on the Bridge.
* Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId.
* Invalidate text box icon before drawing
* Fixes the case where Saria's gift is an Ice Trap.
We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine.
* Initial commit
Might need changing when we change the settings in the future
* Fixes Door of Time opening cutscene after warping with prelude.
* Initial waterfall skip
Very rudimentary way of doing things but it seems to work so :shrug:
* inital rework
* fixed default rotation for 2D sprites
* fix tab/space issues
* 3d drops rando merge fix again
* Allows Impa to appear in the Lullaby check post drawbridge escape.
* Changes Ganon's Trials Count setting to a checkbox
The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed.
* Sets all Ganon's Trials to incomplete in new saves.
Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131
* fix castle guards when oot throw cutscene has already played in rando
* Properly removes the beams when trials are cleared.
* Removes Question Mark from Skip Ganon's Trials UI.
* Adds a todo comment about when to change back to slider.
* make deku seeds check for bullet bag
* Various tweaks
TWEAK: Altar Text
TWEAK: Hint names
TWEAK: Replace more problematic œ to oe
* upgrade ocarina on both child and adult equips
* FIX: Jabu Item
* update equipped hookshot/longshot when obtained as other age
* add hint
* don't give the bgs check without the claim check
* Skips Darunia Cutscene in Fire Temple
* Added a TODO note about not skipping the cutscene.
There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch.
* remove todo
* restore fast ocarina option in imgui that was lost in merge
* Fixes grey screen issue + tooltip for 2 handed shield
* update to use dg instead of g for textures in item tracker
* TWEAK: Default color for cosmetic RAND button was not the corect one
* fix texture crash, remove unused item tracker code
* don't open mask shop until we get zelda's letter
* Update README.md
* Prevents "correct" chime under incorrect conditions.
* Fixes typo in conditional and adds "bonk" sound effect.
"Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time.
* remove modify dpad equips toggle, replace with checks for dpad menu
* remove extra check
* add ability to hold c-up to assign to dpad when dpad menuing is enabled
* disable d-pad navigation on item menu when holding c-up to equip
* dpad+c-up stuff for equipment menu
* ADD: Checbox for songs colors
* TWEAK: RandoColors for normal songs
* kind of quick and dirty but it works
* TWEAK: Clarity of the tooltip
Co-authored-by: briaguya <briaguya@alice>
Co-authored-by: Christopher Leggett <chris@leggett.dev>
Co-authored-by: aMannus <mannusmenting@gmail.com>
Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com>
Co-authored-by: Dog <5172592+Dog@users.noreply.github.com>
Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com>
Co-authored-by: Baoulettes <perlouzerie@hotmail.fr>
Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
|
|
|
|
|
|
|
|
|
if (gSaveContext.n64ddFlag) {
|
2022-11-06 03:24:34 -05:00
|
|
|
|
GivePlayerRandoRewardSariaGift(play, RC_LW_GIFT_FROM_SARIA);
|
|
|
|
|
GivePlayerRandoRewardSongOfTime(play, RC_SONG_FROM_OCARINA_OF_TIME);
|
|
|
|
|
GivePlayerRandoRewardZeldaLightArrowsGift(play, RC_TOT_LIGHT_ARROWS_CUTSCENE);
|
|
|
|
|
GivePlayerRandoRewardNocturne(play, RC_SHEIK_IN_KAKARIKO);
|
|
|
|
|
GivePlayerRandoRewardRequiem(play, RC_SHEIK_AT_COLOSSUS);
|
testing out item replacement (#416)
* skip learning song of storms
* don't set flag when getting goron tunic as child
* Initiates prelude check when master sword unloads.
Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again.
* Stops Shadow Temple lore prompts from appearing in rando.
* Skips cutscene of royal tomb explosion in rando.
Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here.
* Improves visual of exploding gravestone.
* Adds some comments explaining the rando differences
* Skip ruto text box in jabu blue warp
For rando
* skip intro cutscene in dodongo's cavern
* load spoiler files on boot, fix spoilerfile existing check when making new saves
* name entry dropped spoiler logic
* make sure to actually init the cvar
* no chime on load
* uncomment
* Skip ganondrof cutscene
Skip to scream part of the death animation, skipping the text boxes etc. For rando
* Update z_boss_ganondrof.c
* skip owl flight cutscenes in rando
* Fixes skipped text so it only applies to shadow temple.
Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors.
* Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case.
* TEST: Text for item
* Adding ganon flavor text
* ADD: AMMO Count
* format ganon text/hint text
* Autoskip the tower cutscene if settings call for tower collapse.
* ganon hint text logic
* Improved prelude after time travel fix
* swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things.
* this is all i did
* not the cleanest code ever but it's working
* ADD: GS Count
* ADD: Wallter (crash for now)
* TWEAK: Wallet check
* FIX: Use DrawItem instread of DrawUpgrade... b-baka!
* Fixes some vanilla bugs introduced by rando code.
* Added cutscene skip for zelda escaping
Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger
* ADD: X Spacing + Placeholders for song
* ADD: default case for items
* TWEAK: Spacing
* FIX: Light Arrow
* ADD: Ammo Option
* use groups instead
* ADD: More spacing logic
* songs and names
* TWEAK: Color on wallet
* colors
* Added flags cutscene before nabooru fight
* ADD: ChromaKey text
* First attempt skip cs after nabooru defeat
* Better implementation for specific rando cutscene skips
* use pulseaudio defaults
* spaces/tabs
* move color push/pop to stop crash
* make the colors work again
* the real bottle fix
* pulseaudio values tuned for n64 audio at 44.1khz
* update tlength
* remove one hardcoded samplerate
* Cleaned up and fixed zelda escape skip
The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of.
* Revert one line to match original
nothing functional
* another hint line that breaks autonewline logic
* don't autospawn epona if we don't have the song/ocarina
* Trying to use iron knuckle death effects
not working yet
* Streamlined OoT cutscene skip for future additions
Also cleaned up if statement in general
* Made if statement more readable
Also added clarity for what cutscene was skipped
* Fixed typo in comment
* Janky nabooru defeat cs skip
* altar text formatting (gonna need help shortening some of the french ones)
* more altar text formatting
* english altar text formatting complete
* make gtg blocking guard check for card not bridge
* FIX: Typo!
* FIX: Uppercases
* FIX: Typo
* TWEAK: Alter + some names
* TWEAK: More caps!
* ADD: Missing string
TWEAK more uppercases and namefixe
s
* Hide nabooru death by covering her in flames
* bandaid fix for death crash issue
* Twinrova defeat cs skip
Skips the animation and manually calls the function to show the "beam" around the sisters
* fix crash
* fix caps to match
* fix great fairy reward mashing/shielding issue
* TWEAK : Typo clé to Clé
* TWEAK: Some Altar hints
TWEAK: Some capitals
* TWEAK: Unmatching text + some cap again
* TWEAK: More tweaks
* fix build
* remove extra json.hpp, add hint
* Update randomizer_item_tracker.cpp
* TWEAK: Double Defense with RedParticles instead of white
* make sure we don't optimize out the check to ensure a spoilerfile exists
* vanilla ganon boss key hint formatting
* TWEAK: FR- better way of the hero text
* fix
* and again
* Initializes dungeonsDone items in gSaveContext to 0.
* Replaces sizeof calculation with a NUM_DUNGEONS constant.
* Fixes Saria's Gift on the LW Bridge from getting killed when holding shield.
* More airtight fix for Saria's Gift on the Bridge.
* Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId.
* Invalidate text box icon before drawing
* Fixes the case where Saria's gift is an Ice Trap.
We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine.
* Initial commit
Might need changing when we change the settings in the future
* Fixes Door of Time opening cutscene after warping with prelude.
* Initial waterfall skip
Very rudimentary way of doing things but it seems to work so :shrug:
* inital rework
* fixed default rotation for 2D sprites
* fix tab/space issues
* 3d drops rando merge fix again
* Allows Impa to appear in the Lullaby check post drawbridge escape.
* Changes Ganon's Trials Count setting to a checkbox
The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed.
* Sets all Ganon's Trials to incomplete in new saves.
Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131
* fix castle guards when oot throw cutscene has already played in rando
* Properly removes the beams when trials are cleared.
* Removes Question Mark from Skip Ganon's Trials UI.
* Adds a todo comment about when to change back to slider.
* make deku seeds check for bullet bag
* Various tweaks
TWEAK: Altar Text
TWEAK: Hint names
TWEAK: Replace more problematic œ to oe
* upgrade ocarina on both child and adult equips
* FIX: Jabu Item
* update equipped hookshot/longshot when obtained as other age
* add hint
* don't give the bgs check without the claim check
* Skips Darunia Cutscene in Fire Temple
* Added a TODO note about not skipping the cutscene.
There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch.
* remove todo
* restore fast ocarina option in imgui that was lost in merge
* Fixes grey screen issue + tooltip for 2 handed shield
* update to use dg instead of g for textures in item tracker
* TWEAK: Default color for cosmetic RAND button was not the corect one
* fix texture crash, remove unused item tracker code
* don't open mask shop until we get zelda's letter
* Update README.md
* Prevents "correct" chime under incorrect conditions.
* Fixes typo in conditional and adds "bonk" sound effect.
"Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time.
* remove modify dpad equips toggle, replace with checks for dpad menu
* remove extra check
* add ability to hold c-up to assign to dpad when dpad menuing is enabled
* disable d-pad navigation on item menu when holding c-up to equip
* dpad+c-up stuff for equipment menu
* ADD: Checbox for songs colors
* TWEAK: RandoColors for normal songs
* kind of quick and dirty but it works
* TWEAK: Clarity of the tooltip
Co-authored-by: briaguya <briaguya@alice>
Co-authored-by: Christopher Leggett <chris@leggett.dev>
Co-authored-by: aMannus <mannusmenting@gmail.com>
Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com>
Co-authored-by: Dog <5172592+Dog@users.noreply.github.com>
Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com>
Co-authored-by: Baoulettes <perlouzerie@hotmail.fr>
Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
|
|
|
|
}
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
void Play_DrawOverlayElements(PlayState* play) {
|
|
|
|
|
if ((play->pauseCtx.state != 0) || (play->pauseCtx.debugState != 0)) {
|
|
|
|
|
KaleidoScopeCall_Draw(play);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (gSaveContext.gameMode == 0) {
|
2022-11-06 03:24:34 -05:00
|
|
|
|
Interface_Draw(play);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
Message_Draw(play);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
if (play->gameOverCtx.state != GAMEOVER_INACTIVE) {
|
|
|
|
|
GameOver_FadeInLights(play);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
void Play_Draw(PlayState* play) {
|
|
|
|
|
GraphicsContext* gfxCtx = play->state.gfxCtx;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
Lights* sp228;
|
|
|
|
|
Vec3f sp21C;
|
|
|
|
|
|
2022-07-05 19:29:34 -04:00
|
|
|
|
OPEN_DISPS(gfxCtx);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
gSegments[4] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[play->objectCtx.mainKeepIndex].segment);
|
|
|
|
|
gSegments[5] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[play->objectCtx.subKeepIndex].segment);
|
|
|
|
|
gSegments[2] = VIRTUAL_TO_PHYSICAL(play->sceneSegment);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
|
|
|
|
gSPSegment(POLY_OPA_DISP++, 0x00, NULL);
|
|
|
|
|
gSPSegment(POLY_XLU_DISP++, 0x00, NULL);
|
|
|
|
|
gSPSegment(OVERLAY_DISP++, 0x00, NULL);
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
gSPSegment(POLY_OPA_DISP++, 0x04, play->objectCtx.status[play->objectCtx.mainKeepIndex].segment);
|
|
|
|
|
gSPSegment(POLY_XLU_DISP++, 0x04, play->objectCtx.status[play->objectCtx.mainKeepIndex].segment);
|
|
|
|
|
gSPSegment(OVERLAY_DISP++, 0x04, play->objectCtx.status[play->objectCtx.mainKeepIndex].segment);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
gSPSegment(POLY_OPA_DISP++, 0x05, play->objectCtx.status[play->objectCtx.subKeepIndex].segment);
|
|
|
|
|
gSPSegment(POLY_XLU_DISP++, 0x05, play->objectCtx.status[play->objectCtx.subKeepIndex].segment);
|
|
|
|
|
gSPSegment(OVERLAY_DISP++, 0x05, play->objectCtx.status[play->objectCtx.subKeepIndex].segment);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
gSPSegment(POLY_OPA_DISP++, 0x02, play->sceneSegment);
|
|
|
|
|
gSPSegment(POLY_XLU_DISP++, 0x02, play->sceneSegment);
|
|
|
|
|
gSPSegment(OVERLAY_DISP++, 0x02, play->sceneSegment);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
2022-11-29 18:29:36 -05:00
|
|
|
|
Gfx_SetupFrame(gfxCtx, 0, 0, 0);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
|
|
|
|
if ((HREG(80) != 10) || (HREG(82) != 0)) {
|
2022-11-06 03:24:34 -05:00
|
|
|
|
POLY_OPA_DISP = Play_SetFog(play, POLY_OPA_DISP);
|
|
|
|
|
POLY_XLU_DISP = Play_SetFog(play, POLY_XLU_DISP);
|
|
|
|
|
POLY_KAL_DISP = Play_SetFog(play, POLY_KAL_DISP);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
func_800AA460(&play->view, play->view.fovy, play->view.zNear, play->lightCtx.fogFar);
|
|
|
|
|
func_800AAA50(&play->view, 15);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
|
|
|
|
// The billboard matrix temporarily stores the viewing matrix
|
2022-11-06 03:24:34 -05:00
|
|
|
|
Matrix_MtxToMtxF(&play->view.viewing, &play->billboardMtxF);
|
|
|
|
|
Matrix_MtxToMtxF(&play->view.projection, &play->viewProjectionMtxF);
|
|
|
|
|
Matrix_Mult(&play->viewProjectionMtxF, MTXMODE_NEW);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
// The billboard is still a viewing matrix at this stage
|
2022-11-06 03:24:34 -05:00
|
|
|
|
Matrix_Mult(&play->billboardMtxF, MTXMODE_APPLY);
|
|
|
|
|
Matrix_Get(&play->viewProjectionMtxF);
|
|
|
|
|
play->billboardMtxF.mf[0][3] = play->billboardMtxF.mf[1][3] = play->billboardMtxF.mf[2][3] =
|
|
|
|
|
play->billboardMtxF.mf[3][0] = play->billboardMtxF.mf[3][1] = play->billboardMtxF.mf[3][2] =
|
2022-03-21 21:51:23 -04:00
|
|
|
|
0.0f;
|
|
|
|
|
// This transpose is where the viewing matrix is properly converted into a billboard matrix
|
2022-11-06 03:24:34 -05:00
|
|
|
|
Matrix_Transpose(&play->billboardMtxF);
|
|
|
|
|
play->billboardMtx = Matrix_MtxFToMtx(MATRIX_CHECKFLOATS(&play->billboardMtxF),
|
2022-03-21 21:51:23 -04:00
|
|
|
|
Graph_Alloc(gfxCtx, sizeof(Mtx)));
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
gSPSegment(POLY_OPA_DISP++, 0x01, play->billboardMtx);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
|
|
|
|
if ((HREG(80) != 10) || (HREG(92) != 0)) {
|
|
|
|
|
Gfx* gfxP;
|
|
|
|
|
Gfx* sp1CC = POLY_OPA_DISP;
|
|
|
|
|
|
|
|
|
|
gfxP = Graph_GfxPlusOne(sp1CC);
|
|
|
|
|
gSPDisplayList(OVERLAY_DISP++, gfxP);
|
2022-11-14 23:01:06 -05:00
|
|
|
|
gSPGrayscale(gfxP++, false);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
if ((play->transitionMode == 3) || (play->transitionMode == 11) ||
|
|
|
|
|
(play->transitionCtx.transitionType >= 56)) {
|
2022-03-21 21:51:23 -04:00
|
|
|
|
View view;
|
|
|
|
|
|
|
|
|
|
View_Init(&view, gfxCtx);
|
|
|
|
|
view.flags = 2 | 8;
|
|
|
|
|
|
|
|
|
|
SET_FULLSCREEN_VIEWPORT(&view);
|
|
|
|
|
|
|
|
|
|
func_800AB9EC(&view, 15, &gfxP);
|
2022-11-06 03:24:34 -05:00
|
|
|
|
play->transitionCtx.draw(&play->transitionCtx.data, &gfxP);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
TransitionFade_Draw(&play->transitionFade, &gfxP);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
|
|
|
|
if (D_801614B0.a > 0) {
|
2022-11-14 23:01:06 -05:00
|
|
|
|
gDPSetGrayscaleColor(gfxP++, D_801614B0.r, D_801614B0.g, D_801614B0.b, D_801614B0.a);
|
|
|
|
|
gSPGrayscale(gfxP++, true);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gSPEndDisplayList(gfxP++);
|
|
|
|
|
Graph_BranchDlist(sp1CC, gfxP);
|
|
|
|
|
POLY_OPA_DISP = gfxP;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (gTrnsnUnkState == 3) {
|
|
|
|
|
Gfx* sp88 = POLY_OPA_DISP;
|
|
|
|
|
|
|
|
|
|
TransitionUnk_Draw(&sTrnsnUnk, &sp88);
|
|
|
|
|
POLY_OPA_DISP = sp88;
|
2022-11-06 03:24:34 -05:00
|
|
|
|
goto Play_Draw_DrawOverlayElements;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
} else {
|
2022-11-06 03:24:34 -05:00
|
|
|
|
PreRender_SetValues(&play->pauseBgPreRender, SCREEN_WIDTH, SCREEN_HEIGHT, gfxCtx->curFrameBuffer,
|
2022-03-21 21:51:23 -04:00
|
|
|
|
gZBuffer);
|
|
|
|
|
|
|
|
|
|
if (R_PAUSE_MENU_MODE == 2) {
|
|
|
|
|
MsgEvent_SendNullTask();
|
2022-11-06 03:24:34 -05:00
|
|
|
|
PreRender_Calc(&play->pauseBgPreRender);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
R_PAUSE_MENU_MODE = 3;
|
|
|
|
|
} else if (R_PAUSE_MENU_MODE >= 4) {
|
|
|
|
|
R_PAUSE_MENU_MODE = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (R_PAUSE_MENU_MODE == 3) {
|
|
|
|
|
Gfx* sp84 = POLY_OPA_DISP;
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
//func_800C24BC(&play->pauseBgPreRender, &sp84);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
POLY_OPA_DISP = sp84;
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
//goto Play_Draw_DrawOverlayElements;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
2022-04-25 18:04:15 -04:00
|
|
|
|
//else
|
2022-03-21 21:51:23 -04:00
|
|
|
|
{
|
|
|
|
|
s32 sp80;
|
|
|
|
|
|
|
|
|
|
if ((HREG(80) != 10) || (HREG(83) != 0)) {
|
2022-11-06 03:24:34 -05:00
|
|
|
|
if (play->skyboxId && (play->skyboxId != SKYBOX_UNSET_1D) &&
|
|
|
|
|
!play->envCtx.skyboxDisabled) {
|
|
|
|
|
if ((play->skyboxId == SKYBOX_NORMAL_SKY) ||
|
|
|
|
|
(play->skyboxId == SKYBOX_CUTSCENE_MAP)) {
|
|
|
|
|
Environment_UpdateSkybox(play, play->skyboxId, &play->envCtx, &play->skyboxCtx);
|
|
|
|
|
|
|
|
|
|
SkyboxDraw_Draw(&play->skyboxCtx, gfxCtx, play->skyboxId,
|
|
|
|
|
play->envCtx.skyboxBlend, play->view.eye.x, play->view.eye.y,
|
|
|
|
|
play->view.eye.z);
|
|
|
|
|
} else if (play->skyboxCtx.unk_140 == 0) {
|
|
|
|
|
SkyboxDraw_Draw(&play->skyboxCtx, gfxCtx, play->skyboxId, 0,
|
|
|
|
|
play->view.eye.x, play->view.eye.y, play->view.eye.z);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ((HREG(80) != 10) || (HREG(90) & 2)) {
|
2022-11-06 03:24:34 -05:00
|
|
|
|
if (!play->envCtx.sunMoonDisabled) {
|
|
|
|
|
Environment_DrawSunAndMoon(play);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ((HREG(80) != 10) || (HREG(90) & 1)) {
|
2022-11-06 03:24:34 -05:00
|
|
|
|
Environment_DrawSkyboxFilters(play);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ((HREG(80) != 10) || (HREG(90) & 4)) {
|
2022-11-06 03:24:34 -05:00
|
|
|
|
Environment_UpdateLightningStrike(play);
|
|
|
|
|
Environment_DrawLightning(play, 0);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ((HREG(80) != 10) || (HREG(90) & 8)) {
|
2022-11-06 03:24:34 -05:00
|
|
|
|
sp228 = LightContext_NewLights(&play->lightCtx, gfxCtx);
|
|
|
|
|
Lights_BindAll(sp228, play->lightCtx.listHead, NULL);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
Lights_Draw(sp228, gfxCtx);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ((HREG(80) != 10) || (HREG(84) != 0)) {
|
|
|
|
|
if (VREG(94) == 0) {
|
|
|
|
|
if (HREG(80) != 10) {
|
|
|
|
|
sp80 = 3;
|
|
|
|
|
} else {
|
|
|
|
|
sp80 = HREG(84);
|
|
|
|
|
}
|
2022-11-06 03:24:34 -05:00
|
|
|
|
Scene_Draw(play);
|
|
|
|
|
Room_Draw(play, &play->roomCtx.curRoom, sp80 & 3);
|
|
|
|
|
Room_Draw(play, &play->roomCtx.prevRoom, sp80 & 3);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ((HREG(80) != 10) || (HREG(83) != 0)) {
|
2022-11-06 03:24:34 -05:00
|
|
|
|
if ((play->skyboxCtx.unk_140 != 0) &&
|
|
|
|
|
(GET_ACTIVE_CAM(play)->setting != CAM_SET_PREREND_FIXED)) {
|
2022-03-21 21:51:23 -04:00
|
|
|
|
Vec3f sp74;
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
Camera_GetSkyboxOffset(&sp74, GET_ACTIVE_CAM(play));
|
|
|
|
|
SkyboxDraw_Draw(&play->skyboxCtx, gfxCtx, play->skyboxId, 0,
|
|
|
|
|
play->view.eye.x + sp74.x, play->view.eye.y + sp74.y,
|
|
|
|
|
play->view.eye.z + sp74.z);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
if (play->envCtx.unk_EE[1] != 0) {
|
|
|
|
|
Environment_DrawRain(play, &play->view, gfxCtx);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ((HREG(80) != 10) || (HREG(84) != 0)) {
|
2022-11-06 03:24:34 -05:00
|
|
|
|
Environment_FillScreen(gfxCtx, 0, 0, 0, play->unk_11E18, FILL_SCREEN_OPA);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
if ((play->pauseCtx.state != 0) && (HREG(80) != 10) || (HREG(89) != 0)) {
|
|
|
|
|
Play_DrawOverlayElements(play);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ((HREG(80) != 10) || (HREG(85) != 0)) {
|
2022-11-06 03:24:34 -05:00
|
|
|
|
func_800315AC(play, &play->actorCtx);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ((HREG(80) != 10) || (HREG(86) != 0)) {
|
2022-11-06 03:24:34 -05:00
|
|
|
|
if (!play->envCtx.sunMoonDisabled) {
|
|
|
|
|
sp21C.x = play->view.eye.x + play->envCtx.sunPos.x;
|
|
|
|
|
sp21C.y = play->view.eye.y + play->envCtx.sunPos.y;
|
|
|
|
|
sp21C.z = play->view.eye.z + play->envCtx.sunPos.z;
|
|
|
|
|
Environment_DrawSunLensFlare(play, &play->envCtx, &play->view, gfxCtx, sp21C, 0);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
2022-11-06 03:24:34 -05:00
|
|
|
|
Environment_DrawCustomLensFlare(play);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ((HREG(80) != 10) || (HREG(87) != 0)) {
|
|
|
|
|
if (MREG(64) != 0) {
|
|
|
|
|
Environment_FillScreen(gfxCtx, MREG(65), MREG(66), MREG(67), MREG(68),
|
|
|
|
|
FILL_SCREEN_OPA | FILL_SCREEN_XLU);
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
switch (play->envCtx.fillScreen) {
|
2022-03-21 21:51:23 -04:00
|
|
|
|
case 1:
|
|
|
|
|
Environment_FillScreen(
|
2022-11-06 03:24:34 -05:00
|
|
|
|
gfxCtx, play->envCtx.screenFillColor[0], play->envCtx.screenFillColor[1],
|
|
|
|
|
play->envCtx.screenFillColor[2], play->envCtx.screenFillColor[3],
|
2022-03-21 21:51:23 -04:00
|
|
|
|
FILL_SCREEN_OPA | FILL_SCREEN_XLU);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ((HREG(80) != 10) || (HREG(88) != 0)) {
|
2022-11-06 03:24:34 -05:00
|
|
|
|
if (play->envCtx.sandstormState != 0) {
|
|
|
|
|
Environment_DrawSandstorm(play, play->envCtx.sandstormState);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ((HREG(80) != 10) || (HREG(93) != 0)) {
|
2022-11-06 03:24:34 -05:00
|
|
|
|
DebugDisplay_DrawObjects(play);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ((R_PAUSE_MENU_MODE == 1) || (gTrnsnUnkState == 1)) {
|
|
|
|
|
Gfx* sp70 = OVERLAY_DISP;
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
play->pauseBgPreRender.fbuf = gfxCtx->curFrameBuffer;
|
|
|
|
|
play->pauseBgPreRender.fbufSave = (u16*)gZBuffer;
|
|
|
|
|
func_800C1F20(&play->pauseBgPreRender, &sp70);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
if (R_PAUSE_MENU_MODE == 1) {
|
2022-11-06 03:24:34 -05:00
|
|
|
|
play->pauseBgPreRender.cvgSave = (u8*)gfxCtx->curFrameBuffer;
|
|
|
|
|
func_800C20B4(&play->pauseBgPreRender, &sp70);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
R_PAUSE_MENU_MODE = 2;
|
|
|
|
|
} else {
|
|
|
|
|
gTrnsnUnkState = 2;
|
|
|
|
|
}
|
|
|
|
|
OVERLAY_DISP = sp70;
|
2022-11-06 03:24:34 -05:00
|
|
|
|
play->unk_121C7 = 2;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
SREG(33) |= 1;
|
2022-08-01 23:46:50 -04:00
|
|
|
|
} else if (R_PAUSE_MENU_MODE != 3) {
|
2022-11-06 03:24:34 -05:00
|
|
|
|
Play_Draw_DrawOverlayElements:
|
2022-03-21 21:51:23 -04:00
|
|
|
|
if ((HREG(80) != 10) || (HREG(89) != 0)) {
|
2022-11-06 03:24:34 -05:00
|
|
|
|
Play_DrawOverlayElements(play);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
if (play->view.unk_124 != 0) {
|
|
|
|
|
Camera_Update(GET_ACTIVE_CAM(play));
|
|
|
|
|
func_800AB944(&play->view);
|
|
|
|
|
play->view.unk_124 = 0;
|
|
|
|
|
if (play->skyboxId && (play->skyboxId != SKYBOX_UNSET_1D) && !play->envCtx.skyboxDisabled) {
|
|
|
|
|
SkyboxDraw_UpdateMatrix(&play->skyboxCtx, play->view.eye.x, play->view.eye.y,
|
|
|
|
|
play->view.eye.z);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
Camera_Finish(GET_ACTIVE_CAM(play));
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
Gfx* prevDisplayList = POLY_OPA_DISP;
|
|
|
|
|
Gfx* gfxP = Graph_GfxPlusOne(POLY_OPA_DISP);
|
|
|
|
|
gSPDisplayList(OVERLAY_DISP++, gfxP);
|
|
|
|
|
gSPEndDisplayList(gfxP++);
|
|
|
|
|
Graph_BranchDlist(prevDisplayList, gfxP);
|
|
|
|
|
POLY_OPA_DISP = gfxP;
|
|
|
|
|
}
|
|
|
|
|
|
2022-07-05 19:29:34 -04:00
|
|
|
|
CLOSE_DISPS(gfxCtx);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
time_t Play_GetRealTime() {
|
2022-08-02 23:48:41 -04:00
|
|
|
|
time_t t1, t2;
|
|
|
|
|
struct tm* tms;
|
|
|
|
|
time(&t1);
|
|
|
|
|
tms = localtime(&t1);
|
|
|
|
|
tms->tm_hour = 0;
|
|
|
|
|
tms->tm_min = 0;
|
|
|
|
|
tms->tm_sec = 0;
|
|
|
|
|
t2 = mktime(tms);
|
|
|
|
|
return t1 - t2;
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
void Play_Main(GameState* thisx) {
|
|
|
|
|
PlayState* play = (PlayState*)thisx;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
2022-09-20 23:24:06 -04:00
|
|
|
|
if (CVar_GetS32("gCheatEasyPauseBufferFrameAdvance", 0)) {
|
|
|
|
|
CVar_SetS32("gCheatEasyPauseBufferFrameAdvance", CVar_GetS32("gCheatEasyPauseBufferFrameAdvance", 0) - 1);
|
|
|
|
|
}
|
|
|
|
|
if (CVar_GetS32("gPauseBufferBlockInputFrame", 0)) {
|
|
|
|
|
CVar_SetS32("gPauseBufferBlockInputFrame", CVar_GetS32("gPauseBufferBlockInputFrame", 0) - 1);
|
|
|
|
|
}
|
2022-12-08 23:24:39 -05:00
|
|
|
|
if (play->envCtx.unk_EE[2] == 0 && CVar_GetS32("gLetItSnow", 0)) {
|
|
|
|
|
play->envCtx.unk_EE[3] = 64;
|
|
|
|
|
Actor_Spawn(&gPlayState->actorCtx, gPlayState, ACTOR_OBJECT_KANKYO, 0, 0, 0, 0, 0, 0, 3, 0);
|
|
|
|
|
}
|
2022-09-20 23:24:06 -04:00
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
D_8012D1F8 = &play->state.input[0];
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
|
|
|
|
DebugDisplay_Init();
|
|
|
|
|
|
|
|
|
|
if (1 && HREG(63)) {
|
2022-07-05 19:29:34 -04:00
|
|
|
|
LOG_NUM("1", 1);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ((HREG(80) == 10) && (HREG(94) != 10)) {
|
|
|
|
|
HREG(81) = 1;
|
|
|
|
|
HREG(82) = 1;
|
|
|
|
|
HREG(83) = 1;
|
|
|
|
|
HREG(84) = 3;
|
|
|
|
|
HREG(85) = 1;
|
|
|
|
|
HREG(86) = 1;
|
|
|
|
|
HREG(87) = 1;
|
|
|
|
|
HREG(88) = 1;
|
|
|
|
|
HREG(89) = 1;
|
|
|
|
|
HREG(90) = 15;
|
|
|
|
|
HREG(91) = 1;
|
|
|
|
|
HREG(92) = 1;
|
|
|
|
|
HREG(93) = 1;
|
|
|
|
|
HREG(94) = 10;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ((HREG(80) != 10) || (HREG(81) != 0)) {
|
2022-11-06 03:24:34 -05:00
|
|
|
|
Play_Update(play);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (1 && HREG(63)) {
|
2022-07-05 19:29:34 -04:00
|
|
|
|
LOG_NUM("1", 1);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-05-13 18:43:55 -04:00
|
|
|
|
FrameInterpolation_StartRecord();
|
2022-11-06 03:24:34 -05:00
|
|
|
|
Play_Draw(play);
|
2022-05-13 18:43:55 -04:00
|
|
|
|
FrameInterpolation_StopRecord();
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
|
|
|
|
if (1 && HREG(63)) {
|
2022-07-05 19:29:34 -04:00
|
|
|
|
LOG_NUM("1", 1);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
2022-08-02 23:48:41 -04:00
|
|
|
|
|
|
|
|
|
if (CVar_GetS32("gTimeSync", 0)) {
|
|
|
|
|
const int maxRealDaySeconds = 86400;
|
|
|
|
|
const int maxInGameDayTicks = 65536;
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
int secs = (int)Play_GetRealTime();
|
2022-08-02 23:48:41 -04:00
|
|
|
|
float percent = (float)secs / (float)maxRealDaySeconds;
|
|
|
|
|
|
|
|
|
|
int newIngameTime = maxInGameDayTicks * percent;
|
|
|
|
|
|
|
|
|
|
gSaveContext.dayTime = newIngameTime;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-09-27 22:41:17 -04:00
|
|
|
|
u8 PlayerGrounded(Player* player) {
|
|
|
|
|
return player->actor.bgCheckFlags & 1;
|
|
|
|
|
}
|
|
|
|
|
|
2022-03-21 21:51:23 -04:00
|
|
|
|
// original name: "Game_play_demo_mode_check"
|
2022-11-06 03:24:34 -05:00
|
|
|
|
s32 Play_InCsMode(PlayState* play) {
|
|
|
|
|
return (play->csCtx.state != CS_STATE_IDLE) || Player_InCsMode(play);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
f32 func_800BFCB8(PlayState* play, MtxF* mf, Vec3f* vec) {
|
2022-03-21 21:51:23 -04:00
|
|
|
|
CollisionPoly poly;
|
|
|
|
|
f32 temp1;
|
|
|
|
|
f32 temp2;
|
|
|
|
|
f32 temp3;
|
|
|
|
|
f32 floorY;
|
|
|
|
|
f32 nx;
|
|
|
|
|
f32 ny;
|
|
|
|
|
f32 nz;
|
|
|
|
|
s32 pad[5];
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
floorY = BgCheck_AnyRaycastFloor1(&play->colCtx, &poly, vec);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
|
|
|
|
if (floorY > BGCHECK_Y_MIN) {
|
|
|
|
|
nx = COLPOLY_GET_NORMAL(poly.normal.x);
|
|
|
|
|
ny = COLPOLY_GET_NORMAL(poly.normal.y);
|
|
|
|
|
nz = COLPOLY_GET_NORMAL(poly.normal.z);
|
|
|
|
|
|
|
|
|
|
temp1 = sqrtf(1.0f - SQ(nx));
|
|
|
|
|
|
|
|
|
|
if (temp1 != 0.0f) {
|
|
|
|
|
temp2 = ny * temp1;
|
|
|
|
|
temp3 = -nz * temp1;
|
|
|
|
|
} else {
|
|
|
|
|
temp3 = 0.0f;
|
|
|
|
|
temp2 = 0.0f;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
mf->xx = temp1;
|
|
|
|
|
mf->yx = -nx * temp2;
|
|
|
|
|
mf->zx = nx * temp3;
|
|
|
|
|
mf->xy = nx;
|
|
|
|
|
mf->yy = ny;
|
|
|
|
|
mf->zy = nz;
|
|
|
|
|
mf->yz = temp3;
|
|
|
|
|
mf->zz = temp2;
|
|
|
|
|
mf->wx = 0.0f;
|
|
|
|
|
mf->wy = 0.0f;
|
|
|
|
|
mf->xz = 0.0f;
|
|
|
|
|
mf->wz = 0.0f;
|
|
|
|
|
mf->xw = vec->x;
|
|
|
|
|
mf->yw = floorY;
|
|
|
|
|
mf->zw = vec->z;
|
|
|
|
|
mf->ww = 1.0f;
|
|
|
|
|
} else {
|
|
|
|
|
mf->xy = 0.0f;
|
|
|
|
|
mf->zx = 0.0f;
|
|
|
|
|
mf->yx = 0.0f;
|
|
|
|
|
mf->xx = 0.0f;
|
|
|
|
|
mf->wz = 0.0f;
|
|
|
|
|
mf->xz = 0.0f;
|
|
|
|
|
mf->wy = 0.0f;
|
|
|
|
|
mf->wx = 0.0f;
|
|
|
|
|
mf->zz = 0.0f;
|
|
|
|
|
mf->yz = 0.0f;
|
|
|
|
|
mf->zy = 0.0f;
|
|
|
|
|
mf->yy = 1.0f;
|
|
|
|
|
mf->xw = vec->x;
|
|
|
|
|
mf->yw = vec->y;
|
|
|
|
|
mf->zw = vec->z;
|
|
|
|
|
mf->ww = 1.0f;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return floorY;
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
void* Play_LoadFile(PlayState* play, RomFile* file) {
|
2022-03-21 21:51:23 -04:00
|
|
|
|
size_t size;
|
|
|
|
|
void* allocp;
|
|
|
|
|
|
|
|
|
|
size = file->vromEnd - file->vromStart;
|
2022-11-06 03:24:34 -05:00
|
|
|
|
allocp = GAMESTATE_ALLOC_MC(&play->state, size);
|
2022-07-05 19:29:34 -04:00
|
|
|
|
DmaMgr_SendRequest1(allocp, file->vromStart, size, __FILE__, __LINE__);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
|
|
|
|
return allocp;
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
void Play_InitEnvironment(PlayState* play, s16 skyboxId) {
|
2022-11-14 06:13:21 -05:00
|
|
|
|
// For entrance rando, ensure the correct weather state and sky mode is applied
|
|
|
|
|
if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHUFFLE_ENTRANCES)) {
|
|
|
|
|
Entrance_OverrideWeatherState();
|
|
|
|
|
}
|
2022-11-06 03:24:34 -05:00
|
|
|
|
Skybox_Init(&play->state, &play->skyboxCtx, skyboxId);
|
|
|
|
|
Environment_Init(play, &play->envCtx, 0);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
void Play_InitScene(PlayState* play, s32 spawn)
|
2022-03-21 21:51:23 -04:00
|
|
|
|
{
|
2022-11-06 03:24:34 -05:00
|
|
|
|
play->curSpawn = spawn;
|
|
|
|
|
play->linkActorEntry = NULL;
|
|
|
|
|
play->unk_11DFC = NULL;
|
|
|
|
|
play->setupEntranceList = NULL;
|
|
|
|
|
play->setupExitList = NULL;
|
|
|
|
|
play->cUpElfMsgs = NULL;
|
|
|
|
|
play->setupPathList = NULL;
|
|
|
|
|
play->numSetupActors = 0;
|
|
|
|
|
Object_InitBank(play, &play->objectCtx);
|
|
|
|
|
LightContext_Init(play, &play->lightCtx);
|
|
|
|
|
TransitionActor_InitContext(&play->state, &play->transiActorCtx);
|
|
|
|
|
func_80096FD4(play, &play->roomCtx.curRoom);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
YREG(15) = 0;
|
|
|
|
|
gSaveContext.worldMapArea = 0;
|
2022-11-06 03:24:34 -05:00
|
|
|
|
Scene_ExecuteCommands(play, play->sceneSegment);
|
|
|
|
|
Play_InitEnvironment(play, play->skyboxId);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
void Play_SpawnScene(PlayState* play, s32 sceneNum, s32 spawn) {
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
OTRPlay_SpawnScene(play, sceneNum, spawn);
|
2022-11-14 06:13:21 -05:00
|
|
|
|
|
|
|
|
|
if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHUFFLE_ENTRANCES)) {
|
|
|
|
|
Entrance_OverrideSpawnScene(sceneNum, spawn);
|
|
|
|
|
}
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
void func_800C016C(PlayState* play, Vec3f* src, Vec3f* dest) {
|
2022-03-21 21:51:23 -04:00
|
|
|
|
f32 temp;
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
Matrix_Mult(&play->viewProjectionMtxF, MTXMODE_NEW);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
Matrix_MultVec3f(src, dest);
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
temp = play->viewProjectionMtxF.ww +
|
|
|
|
|
(play->viewProjectionMtxF.wx * src->x + play->viewProjectionMtxF.wy * src->y +
|
|
|
|
|
play->viewProjectionMtxF.wz * src->z);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
|
|
|
|
dest->x = 160.0f + ((dest->x / temp) * 160.0f);
|
|
|
|
|
dest->y = 120.0f + ((dest->y / temp) * 120.0f);
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
s16 Play_CreateSubCamera(PlayState* play) {
|
2022-03-21 21:51:23 -04:00
|
|
|
|
s16 i;
|
|
|
|
|
|
|
|
|
|
for (i = SUBCAM_FIRST; i < NUM_CAMS; i++) {
|
2022-11-06 03:24:34 -05:00
|
|
|
|
if (play->cameraPtrs[i] == NULL) {
|
2022-03-21 21:51:23 -04:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (i == NUM_CAMS) {
|
|
|
|
|
osSyncPrintf(VT_COL(RED, WHITE) "camera control: error: fulled sub camera system area\n" VT_RST);
|
|
|
|
|
return SUBCAM_NONE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
osSyncPrintf("camera control: " VT_BGCOL(CYAN) " " VT_COL(WHITE, BLUE) " create new sub camera [%d] " VT_BGCOL(
|
|
|
|
|
CYAN) " " VT_RST "\n",
|
|
|
|
|
i);
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
play->cameraPtrs[i] = &play->subCameras[i - SUBCAM_FIRST];
|
|
|
|
|
Camera_Init(play->cameraPtrs[i], &play->view, &play->colCtx, play);
|
|
|
|
|
play->cameraPtrs[i]->thisIdx = i;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
|
|
|
|
return i;
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
s16 Play_GetActiveCamId(PlayState* play) {
|
|
|
|
|
return play->activeCamera;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
s16 Play_ChangeCameraStatus(PlayState* play, s16 camId, s16 status) {
|
|
|
|
|
s16 camIdx = (camId == SUBCAM_ACTIVE) ? play->activeCamera : camId;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
|
|
|
|
if (status == CAM_STAT_ACTIVE) {
|
2022-11-06 03:24:34 -05:00
|
|
|
|
play->activeCamera = camIdx;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
return Camera_ChangeStatus(play->cameraPtrs[camIdx], status);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
void Play_ClearCamera(PlayState* play, s16 camId) {
|
|
|
|
|
s16 camIdx = (camId == SUBCAM_ACTIVE) ? play->activeCamera : camId;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
|
|
|
|
if (camIdx == MAIN_CAM) {
|
|
|
|
|
osSyncPrintf(VT_COL(RED, WHITE) "camera control: error: never clear camera !!\n" VT_RST);
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
if (play->cameraPtrs[camIdx] != NULL) {
|
|
|
|
|
Camera_ChangeStatus(play->cameraPtrs[camIdx], CAM_STAT_UNK100);
|
|
|
|
|
play->cameraPtrs[camIdx] = NULL;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
osSyncPrintf("camera control: " VT_BGCOL(CYAN) " " VT_COL(WHITE, BLUE) " clear sub camera [%d] " VT_BGCOL(
|
|
|
|
|
CYAN) " " VT_RST "\n",
|
|
|
|
|
camIdx);
|
|
|
|
|
} else {
|
|
|
|
|
osSyncPrintf(VT_COL(RED, WHITE) "camera control: error: camera No.%d already cleared\n" VT_RST, camIdx);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
void Play_ClearAllSubCameras(PlayState* play) {
|
2022-03-21 21:51:23 -04:00
|
|
|
|
s16 i;
|
|
|
|
|
|
|
|
|
|
for (i = SUBCAM_FIRST; i < NUM_CAMS; i++) {
|
2022-11-06 03:24:34 -05:00
|
|
|
|
if (play->cameraPtrs[i] != NULL) {
|
|
|
|
|
Play_ClearCamera(play, i);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
play->activeCamera = MAIN_CAM;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
Camera* Play_GetCamera(PlayState* play, s16 camId) {
|
|
|
|
|
s16 camIdx = (camId == SUBCAM_ACTIVE) ? play->activeCamera : camId;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
return play->cameraPtrs[camIdx];
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
s32 Play_CameraSetAtEye(PlayState* play, s16 camId, Vec3f* at, Vec3f* eye) {
|
2022-03-21 21:51:23 -04:00
|
|
|
|
s32 ret = 0;
|
2022-11-06 03:24:34 -05:00
|
|
|
|
s16 camIdx = (camId == SUBCAM_ACTIVE) ? play->activeCamera : camId;
|
|
|
|
|
Camera* camera = play->cameraPtrs[camIdx];
|
2022-03-21 21:51:23 -04:00
|
|
|
|
Player* player;
|
|
|
|
|
|
|
|
|
|
ret |= Camera_SetParam(camera, 1, at);
|
|
|
|
|
ret <<= 1;
|
|
|
|
|
ret |= Camera_SetParam(camera, 2, eye);
|
|
|
|
|
|
|
|
|
|
camera->dist = Math3D_Vec3f_DistXYZ(at, eye);
|
|
|
|
|
|
|
|
|
|
player = camera->player;
|
|
|
|
|
if (player != NULL) {
|
|
|
|
|
camera->posOffset.x = at->x - player->actor.world.pos.x;
|
|
|
|
|
camera->posOffset.y = at->y - player->actor.world.pos.y;
|
|
|
|
|
camera->posOffset.z = at->z - player->actor.world.pos.z;
|
|
|
|
|
} else {
|
|
|
|
|
camera->posOffset.x = camera->posOffset.y = camera->posOffset.z = 0.0f;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
camera->atLERPStepScale = 0.01f;
|
|
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
s32 Play_CameraSetAtEyeUp(PlayState* play, s16 camId, Vec3f* at, Vec3f* eye, Vec3f* up) {
|
2022-03-21 21:51:23 -04:00
|
|
|
|
s32 ret = 0;
|
2022-11-06 03:24:34 -05:00
|
|
|
|
s16 camIdx = (camId == SUBCAM_ACTIVE) ? play->activeCamera : camId;
|
|
|
|
|
Camera* camera = play->cameraPtrs[camIdx];
|
2022-03-21 21:51:23 -04:00
|
|
|
|
Player* player;
|
|
|
|
|
|
|
|
|
|
ret |= Camera_SetParam(camera, 1, at);
|
|
|
|
|
ret <<= 1;
|
|
|
|
|
ret |= Camera_SetParam(camera, 2, eye);
|
|
|
|
|
ret <<= 1;
|
|
|
|
|
ret |= Camera_SetParam(camera, 4, up);
|
|
|
|
|
|
|
|
|
|
camera->dist = Math3D_Vec3f_DistXYZ(at, eye);
|
|
|
|
|
|
|
|
|
|
player = camera->player;
|
|
|
|
|
if (player != NULL) {
|
|
|
|
|
camera->posOffset.x = at->x - player->actor.world.pos.x;
|
|
|
|
|
camera->posOffset.y = at->y - player->actor.world.pos.y;
|
|
|
|
|
camera->posOffset.z = at->z - player->actor.world.pos.z;
|
|
|
|
|
} else {
|
|
|
|
|
camera->posOffset.x = camera->posOffset.y = camera->posOffset.z = 0.0f;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
camera->atLERPStepScale = 0.01f;
|
|
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
s32 Play_CameraSetFov(PlayState* play, s16 camId, f32 fov) {
|
|
|
|
|
s32 ret = Camera_SetParam(play->cameraPtrs[camId], 0x20, &fov) & 1;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
s32 Play_SetCameraRoll(PlayState* play, s16 camId, s16 roll) {
|
|
|
|
|
s16 camIdx = (camId == SUBCAM_ACTIVE) ? play->activeCamera : camId;
|
|
|
|
|
Camera* camera = play->cameraPtrs[camIdx];
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
|
|
|
|
camera->roll = roll;
|
|
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
void Play_CopyCamera(PlayState* play, s16 camId1, s16 camId2) {
|
|
|
|
|
s16 camIdx2 = (camId2 == SUBCAM_ACTIVE) ? play->activeCamera : camId2;
|
|
|
|
|
s16 camIdx1 = (camId1 == SUBCAM_ACTIVE) ? play->activeCamera : camId1;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
Camera_Copy(play->cameraPtrs[camIdx1], play->cameraPtrs[camIdx2]);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
s32 func_800C0808(PlayState* play, s16 camId, Player* player, s16 setting) {
|
2022-03-21 21:51:23 -04:00
|
|
|
|
Camera* camera;
|
2022-11-06 03:24:34 -05:00
|
|
|
|
s16 camIdx = (camId == SUBCAM_ACTIVE) ? play->activeCamera : camId;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
camera = play->cameraPtrs[camIdx];
|
2022-03-21 21:51:23 -04:00
|
|
|
|
Camera_InitPlayerSettings(camera, player);
|
|
|
|
|
return Camera_ChangeSetting(camera, setting);
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
s32 Play_CameraChangeSetting(PlayState* play, s16 camId, s16 setting) {
|
|
|
|
|
return Camera_ChangeSetting(Play_GetCamera(play, camId), setting);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
void func_800C08AC(PlayState* play, s16 camId, s16 arg2) {
|
|
|
|
|
s16 camIdx = (camId == SUBCAM_ACTIVE) ? play->activeCamera : camId;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
s16 i;
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
Play_ClearCamera(play, camIdx);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
|
|
|
|
for (i = SUBCAM_FIRST; i < NUM_CAMS; i++) {
|
2022-11-06 03:24:34 -05:00
|
|
|
|
if (play->cameraPtrs[i] != NULL) {
|
2022-03-21 21:51:23 -04:00
|
|
|
|
osSyncPrintf(
|
|
|
|
|
VT_COL(RED, WHITE) "camera control: error: return to main, other camera left. %d cleared!!\n" VT_RST,
|
|
|
|
|
i);
|
2022-11-06 03:24:34 -05:00
|
|
|
|
Play_ClearCamera(play, i);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (arg2 <= 0) {
|
2022-11-06 03:24:34 -05:00
|
|
|
|
Play_ChangeCameraStatus(play, MAIN_CAM, CAM_STAT_ACTIVE);
|
|
|
|
|
play->cameraPtrs[MAIN_CAM]->childCamIdx = play->cameraPtrs[MAIN_CAM]->parentCamIdx = SUBCAM_FREE;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
} else {
|
2022-11-06 03:24:34 -05:00
|
|
|
|
OnePointCutscene_Init(play, 1020, arg2, NULL, MAIN_CAM);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
s16 Play_CameraGetUID(PlayState* play, s16 camId) {
|
|
|
|
|
Camera* camera = play->cameraPtrs[camId];
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
|
|
|
|
if (camera != NULL) {
|
|
|
|
|
return camera->uid;
|
|
|
|
|
} else {
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
s16 func_800C09D8(PlayState* play, s16 camId, s16 arg2) {
|
|
|
|
|
Camera* camera = play->cameraPtrs[camId];
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
|
|
|
|
if (camera != NULL) {
|
|
|
|
|
return 0;
|
|
|
|
|
} else if (camera->uid != arg2) {
|
|
|
|
|
return 0;
|
|
|
|
|
} else if (camera->status != CAM_STAT_ACTIVE) {
|
|
|
|
|
return 2;
|
|
|
|
|
} else {
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
void Play_SaveSceneFlags(PlayState* play) {
|
|
|
|
|
SavedSceneFlags* savedSceneFlags = &gSaveContext.sceneFlags[play->sceneNum];
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
savedSceneFlags->chest = play->actorCtx.flags.chest;
|
|
|
|
|
savedSceneFlags->swch = play->actorCtx.flags.swch;
|
|
|
|
|
savedSceneFlags->clear = play->actorCtx.flags.clear;
|
|
|
|
|
savedSceneFlags->collect = play->actorCtx.flags.collect;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
void Play_SetRespawnData(PlayState* play, s32 respawnMode, s16 entranceIndex, s32 roomIndex,
|
2022-03-21 21:51:23 -04:00
|
|
|
|
s32 playerParams, Vec3f* pos, s16 yaw) {
|
|
|
|
|
RespawnData* respawnData = &gSaveContext.respawn[respawnMode];
|
|
|
|
|
|
|
|
|
|
respawnData->entranceIndex = entranceIndex;
|
|
|
|
|
respawnData->roomIndex = roomIndex;
|
|
|
|
|
respawnData->pos = *pos;
|
|
|
|
|
respawnData->yaw = yaw;
|
|
|
|
|
respawnData->playerParams = playerParams;
|
2022-11-06 03:24:34 -05:00
|
|
|
|
respawnData->tempSwchFlags = play->actorCtx.flags.tempSwch;
|
|
|
|
|
respawnData->tempCollectFlags = play->actorCtx.flags.tempCollect;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
void Play_SetupRespawnPoint(PlayState* play, s32 respawnMode, s32 playerParams) {
|
|
|
|
|
Player* player = GET_PLAYER(play);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
s32 entranceIndex;
|
|
|
|
|
s8 roomIndex;
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
if ((play->sceneNum != SCENE_YOUSEI_IZUMI_TATE) && (play->sceneNum != SCENE_KAKUSIANA)) {
|
|
|
|
|
roomIndex = play->roomCtx.curRoom.num;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
entranceIndex = gSaveContext.entranceIndex;
|
2022-11-06 03:24:34 -05:00
|
|
|
|
Play_SetRespawnData(play, respawnMode, entranceIndex, roomIndex, playerParams,
|
2022-03-21 21:51:23 -04:00
|
|
|
|
&player->actor.world.pos, player->actor.shape.rot.y);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
void Play_TriggerVoidOut(PlayState* play) {
|
|
|
|
|
gSaveContext.respawn[RESPAWN_MODE_DOWN].tempSwchFlags = play->actorCtx.flags.tempSwch;
|
|
|
|
|
gSaveContext.respawn[RESPAWN_MODE_DOWN].tempCollectFlags = play->actorCtx.flags.tempCollect;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
gSaveContext.respawnFlag = 1;
|
2022-11-06 03:24:34 -05:00
|
|
|
|
play->sceneLoadFlag = 0x14;
|
|
|
|
|
play->nextEntranceIndex = gSaveContext.respawn[RESPAWN_MODE_DOWN].entranceIndex;
|
|
|
|
|
play->fadeTransition = 2;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
void Play_LoadToLastEntrance(PlayState* play) {
|
2022-03-21 21:51:23 -04:00
|
|
|
|
gSaveContext.respawnFlag = -1;
|
2022-11-06 03:24:34 -05:00
|
|
|
|
play->sceneLoadFlag = 0x14;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
if ((play->sceneNum == SCENE_GANON_SONOGO) || (play->sceneNum == SCENE_GANON_FINAL) ||
|
|
|
|
|
(play->sceneNum == SCENE_GANONTIKA_SONOGO) || (play->sceneNum == SCENE_GANON_DEMO)) {
|
|
|
|
|
play->nextEntranceIndex = 0x043F;
|
|
|
|
|
Item_Give(play, ITEM_SWORD_MASTER);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
} else if ((gSaveContext.entranceIndex == 0x028A) || (gSaveContext.entranceIndex == 0x028E) ||
|
|
|
|
|
(gSaveContext.entranceIndex == 0x0292) || (gSaveContext.entranceIndex == 0x0476)) {
|
2022-11-06 03:24:34 -05:00
|
|
|
|
play->nextEntranceIndex = 0x01F9;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
} else {
|
2022-11-06 03:24:34 -05:00
|
|
|
|
play->nextEntranceIndex = gSaveContext.entranceIndex;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
play->fadeTransition = 2;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
void Play_TriggerRespawn(PlayState* play) {
|
|
|
|
|
Play_SetupRespawnPoint(play, RESPAWN_MODE_DOWN, 0xDFF);
|
|
|
|
|
Play_LoadToLastEntrance(play);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
s32 func_800C0CB8(PlayState* play) {
|
|
|
|
|
return (play->roomCtx.curRoom.meshHeader->base.type != 1) && (YREG(15) != 0x20) && (YREG(15) != 0x30) &&
|
|
|
|
|
(YREG(15) != 0x40) && (play->sceneNum != SCENE_HAIRAL_NIWA);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
s32 FrameAdvance_IsEnabled(PlayState* play) {
|
|
|
|
|
return !!play->frameAdvCtx.enabled;
|
2022-03-21 21:51:23 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
s32 func_800C0D34(PlayState* play, Actor* actor, s16* yaw) {
|
2022-03-21 21:51:23 -04:00
|
|
|
|
TransitionActorEntry* transitionActor;
|
|
|
|
|
s32 frontRoom;
|
|
|
|
|
|
|
|
|
|
if (actor->category != ACTORCAT_DOOR) {
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
transitionActor = &play->transiActorCtx.list[(u16)actor->params >> 10];
|
2022-03-21 21:51:23 -04:00
|
|
|
|
frontRoom = transitionActor->sides[0].room;
|
|
|
|
|
|
|
|
|
|
if (frontRoom == transitionActor->sides[1].room) {
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (frontRoom == actor->room) {
|
|
|
|
|
*yaw = actor->shape.rot.y;
|
|
|
|
|
} else {
|
|
|
|
|
*yaw = actor->shape.rot.y + 0x8000;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
s32 func_800C0DB4(PlayState* play, Vec3f* pos) {
|
2022-03-21 21:51:23 -04:00
|
|
|
|
WaterBox* waterBox;
|
|
|
|
|
CollisionPoly* poly;
|
|
|
|
|
Vec3f waterSurfacePos;
|
|
|
|
|
s32 bgId;
|
|
|
|
|
|
|
|
|
|
waterSurfacePos = *pos;
|
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
if (WaterBox_GetSurface1(play, &play->colCtx, waterSurfacePos.x, waterSurfacePos.z, &waterSurfacePos.y,
|
2022-03-21 21:51:23 -04:00
|
|
|
|
&waterBox) == true &&
|
|
|
|
|
pos->y < waterSurfacePos.y &&
|
2022-11-06 03:24:34 -05:00
|
|
|
|
BgCheck_EntityRaycastFloor3(&play->colCtx, &poly, &bgId, &waterSurfacePos) != BGCHECK_Y_MIN) {
|
2022-03-21 21:51:23 -04:00
|
|
|
|
return true;
|
|
|
|
|
} else {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-08-05 00:15:49 -04:00
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
|
void Play_PerformSave(PlayState* play) {
|
|
|
|
|
if (play != NULL && gSaveContext.fileNum != 0xFF) {
|
|
|
|
|
Play_SaveSceneFlags(play);
|
|
|
|
|
gSaveContext.savedSceneNum = play->sceneNum;
|
2022-09-21 18:28:07 -04:00
|
|
|
|
if (gSaveContext.temporaryWeapon) {
|
|
|
|
|
gSaveContext.equips.buttonItems[0] = ITEM_NONE;
|
2022-11-29 18:28:57 -05:00
|
|
|
|
GET_PLAYER(play)->currentSwordItemId = ITEM_NONE;
|
2022-09-21 18:28:07 -04:00
|
|
|
|
Inventory_ChangeEquipment(EQUIP_SWORD, PLAYER_SWORD_NONE);
|
|
|
|
|
Save_SaveFile();
|
|
|
|
|
gSaveContext.equips.buttonItems[0] = ITEM_SWORD_KOKIRI;
|
2022-11-29 18:28:57 -05:00
|
|
|
|
GET_PLAYER(play)->currentSwordItemId = ITEM_SWORD_KOKIRI;
|
2022-09-21 18:28:07 -04:00
|
|
|
|
Inventory_ChangeEquipment(EQUIP_SWORD, PLAYER_SWORD_KOKIRI);
|
|
|
|
|
} else {
|
|
|
|
|
Save_SaveFile();
|
|
|
|
|
}
|
|
|
|
|
if (CVar_GetS32("gAutosave", 0)) {
|
|
|
|
|
Overlay_DisplayText(3.0f, "Game Saved");
|
|
|
|
|
}
|
2022-09-20 20:08:43 -04:00
|
|
|
|
}
|
2022-08-05 00:15:49 -04:00
|
|
|
|
}
|