Skip to content

Commit

Permalink
Merge pull request #520 from Kewlan/split-big-files-v2
Browse files Browse the repository at this point in the history
App Side: Split up location_access and hint_list for faster build times
  • Loading branch information
gymnast86 authored Jun 3, 2022
2 parents 5efce33 + 7dac31b commit 0168517
Show file tree
Hide file tree
Showing 28 changed files with 10,513 additions and 10,175 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ APP_AUTHOR := Gamestabled
APP_DESCRIPTION := A different Ocarina of Time experience
TARGET := $(notdir $(CURDIR))
BUILD := build
SOURCES := source
SOURCES := $(sort $(dir $(wildcard source/*/ source/)))
DATA := data
INCLUDES := include
INCLUDES := include $(SOURCES)
GRAPHICS := gfx
GFXBUILD := $(BUILD)
ROMFS := romfs
Expand Down
2 changes: 1 addition & 1 deletion code/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ include $(DEVKITARM)/3ds_rules
#---------------------------------------------------------------------------------
TARGET := $(notdir $(CURDIR))
BUILD := build
SOURCES := src $(sort $(dir $(wildcard src/*/)))
SOURCES := $(sort $(dir $(wildcard src/*/ src/)))
DATA := data
INCLUDES := include $(SOURCES)
INCLUDES += assets
Expand Down
5,848 changes: 337 additions & 5,511 deletions source/hint_list.cpp

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions source/hint_list.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@

#include <vector>

extern std::array<HintText, KEY_ENUM_MAX> hintTable;

void HintTable_Init();
const HintText& Hint(u32 hintKey);
std::vector<HintText> GetHintCategory(HintCategory category);

void HintTable_Init_Item();
void HintTable_Init_Exclude_Overworld();
void HintTable_Init_Exclude_Dungeon();
1,964 changes: 1,964 additions & 0 deletions source/hint_list/hint_list_exclude_dungeon.cpp

Large diffs are not rendered by default.

1,272 changes: 1,272 additions & 0 deletions source/hint_list/hint_list_exclude_overworld.cpp

Large diffs are not rendered by default.

1,952 changes: 1,952 additions & 0 deletions source/hint_list/hint_list_item.cpp

Large diffs are not rendered by default.

4,684 changes: 23 additions & 4,661 deletions source/location_access.cpp

Large diffs are not rendered by default.

35 changes: 35 additions & 0 deletions source/location_access.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,19 @@ class Area {
}
};

extern std::array<Area, KEY_ENUM_MAX> areaTable;
extern std::vector<EventAccess> grottoEvents;

bool Here(const AreaKey area, ConditionFn condition);
bool CanPlantBean(const AreaKey area);
bool BothAges(const AreaKey area);
bool ChildCanAccess(const AreaKey area);
bool AdultCanAccess(const AreaKey area);
bool HasAccessTo(const AreaKey area);

#define DAY_NIGHT_CYCLE true
#define NO_DAY_NIGHT_CYCLE false

namespace Areas {

extern void AccessReset();
Expand All @@ -229,3 +242,25 @@ namespace Areas {
void AreaTable_Init();
Area* AreaTable(const AreaKey areaKey);
std::vector<Entrance*> GetShuffleableEntrances(EntranceType type, bool onlyPrimary = true);

// Overworld
void AreaTable_Init_LostWoods();
void AreaTable_Init_HyruleField();
void AreaTable_Init_CastleTown();
void AreaTable_Init_Kakariko();
void AreaTable_Init_DeathMountain();
void AreaTable_Init_ZorasDomain();
void AreaTable_Init_GerudoValley();
// Dungeons
void AreaTable_Init_DekuTree();
void AreaTable_Init_DodongosCavern();
void AreaTable_Init_JabuJabusBelly();
void AreaTable_Init_ForestTemple();
void AreaTable_Init_FireTemple();
void AreaTable_Init_WaterTemple();
void AreaTable_Init_SpiritTemple();
void AreaTable_Init_ShadowTemple();
void AreaTable_Init_BottomOfTheWell();
void AreaTable_Init_IceCavern();
void AreaTable_Init_GerudoTrainingGrounds();
void AreaTable_Init_GanonsCastle();
88 changes: 88 additions & 0 deletions source/location_access/locacc_bottom_of_the_well.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
#include "location_access.hpp"
#include "logic.hpp"
#include "entrance.hpp"
#include "dungeon.hpp"

using namespace Logic;
using namespace Settings;

void AreaTable_Init_BottomOfTheWell() {
/*--------------------------
| VANILLA/MQ DECIDER |
---------------------------*/
areaTable[BOTTOM_OF_THE_WELL_ENTRYWAY] = Area("Bottom of the Well Entryway", "Bottom of the Well", BOTTOM_OF_THE_WELL, NO_DAY_NIGHT_CYCLE, {}, {}, {
//Exits
Entrance(BOTTOM_OF_THE_WELL_MAIN_AREA, {[]{return Dungeon::BottomOfTheWell.IsVanilla() && IsChild && (CanChildAttack || Nuts);},
/*Glitched*/[]{return Dungeon::BottomOfTheWell.IsVanilla() && IsChild && CanUse(MEGATON_HAMMER);}}),
Entrance(BOTTOM_OF_THE_WELL_MQ_PERIMETER, {[]{return Dungeon::BottomOfTheWell.IsMQ() && IsChild;},
/*Glitched*/[]{return Dungeon::BottomOfTheWell.IsMQ() && CanDoGlitch(GlitchType::HookshotClip, GlitchDifficulty::INTERMEDIATE) && Longshot;}}),
Entrance(KAKARIKO_VILLAGE, {[]{return true;}}),
});

/*--------------------------
| VANILLA DUNGEON |
---------------------------*/
if (Dungeon::BottomOfTheWell.IsVanilla()) {
areaTable[BOTTOM_OF_THE_WELL_MAIN_AREA] = Area("Bottom of the Well Main Area", "Bottom of the Well", BOTTOM_OF_THE_WELL, NO_DAY_NIGHT_CYCLE, {
//Events
EventAccess(&StickPot, {[]{return true;}}),
EventAccess(&NutPot, {[]{return true;}}),
}, {
//Locations
LocationAccess(BOTTOM_OF_THE_WELL_FRONT_LEFT_FAKE_WALL_CHEST, {[]{return LogicLensBotw || CanUse(LENS_OF_TRUTH);}}),
LocationAccess(BOTTOM_OF_THE_WELL_FRONT_CENTER_BOMBABLE_CHEST, {[]{return HasExplosives;}}),
LocationAccess(BOTTOM_OF_THE_WELL_RIGHT_BOTTOM_FAKE_WALL_CHEST, {[]{return LogicLensBotw || CanUse(LENS_OF_TRUTH);}}),
LocationAccess(BOTTOM_OF_THE_WELL_COMPASS_CHEST, {[]{return LogicLensBotw || CanUse(LENS_OF_TRUTH);}}),
LocationAccess(BOTTOM_OF_THE_WELL_CENTER_SKULLTULA_CHEST, {[]{return LogicLensBotw || CanUse(LENS_OF_TRUTH);}}),
LocationAccess(BOTTOM_OF_THE_WELL_BACK_LEFT_BOMBABLE_CHEST, {[]{return (LogicLensBotw || CanUse(LENS_OF_TRUTH)) && HasExplosives;}}),
LocationAccess(BOTTOM_OF_THE_WELL_FREESTANDING_KEY, {[]{return Sticks || CanUse(DINS_FIRE);}}),
LocationAccess(BOTTOM_OF_THE_WELL_LENS_OF_TRUTH_CHEST, {[]{return CanPlay(ZeldasLullaby) && (KokiriSword || (Sticks && LogicChildDeadhand));}}),
LocationAccess(BOTTOM_OF_THE_WELL_INVISIBLE_CHEST, {[]{return CanPlay(ZeldasLullaby) && (LogicLensBotw || CanUse(LENS_OF_TRUTH));}}),
LocationAccess(BOTTOM_OF_THE_WELL_UNDERWATER_FRONT_CHEST, {[]{return CanPlay(ZeldasLullaby);}}),
LocationAccess(BOTTOM_OF_THE_WELL_UNDERWATER_LEFT_CHEST, {[]{return CanPlay(ZeldasLullaby);}}),
LocationAccess(BOTTOM_OF_THE_WELL_MAP_CHEST, {[]{return HasExplosives || (((SmallKeys(BOTTOM_OF_THE_WELL, 3) && (LogicLensBotw || CanUse(LENS_OF_TRUTH))) || CanUse(DINS_FIRE)) && GoronBracelet);}}),
LocationAccess(BOTTOM_OF_THE_WELL_FIRE_KEESE_CHEST, {[]{return SmallKeys(BOTTOM_OF_THE_WELL, 3) && (LogicLensBotw || CanUse(LENS_OF_TRUTH));}}),
LocationAccess(BOTTOM_OF_THE_WELL_LIKE_LIKE_CHEST, {[]{return SmallKeys(BOTTOM_OF_THE_WELL, 3) && (LogicLensBotw || CanUse(LENS_OF_TRUTH));}}),
LocationAccess(BOTTOM_OF_THE_WELL_GS_WEST_INNER_ROOM, {[]{return Boomerang && (LogicLensBotw || CanUse(LENS_OF_TRUTH)) && SmallKeys(BOTTOM_OF_THE_WELL, 3);}}),
LocationAccess(BOTTOM_OF_THE_WELL_GS_EAST_INNER_ROOM, {[]{return Boomerang && (LogicLensBotw || CanUse(LENS_OF_TRUTH)) && SmallKeys(BOTTOM_OF_THE_WELL, 3);}}),
LocationAccess(BOTTOM_OF_THE_WELL_GS_LIKE_LIKE_CAGE, {[]{return SmallKeys(BOTTOM_OF_THE_WELL, 3) && (LogicLensBotw || CanUse(LENS_OF_TRUTH)) && Boomerang;}}),
}, {
//Exits
Entrance(BOTTOM_OF_THE_WELL_ENTRYWAY, {[]{return true;}}),
});
}

/*---------------------------
| MASTER QUEST DUNGEON |
---------------------------*/
if (Dungeon::BottomOfTheWell.IsMQ()) {
areaTable[BOTTOM_OF_THE_WELL_MQ_PERIMETER] = Area("Bottom of the Well MQ Perimeter", "Bottom of the Well", BOTTOM_OF_THE_WELL, NO_DAY_NIGHT_CYCLE, {
//Events
//EventAccess(&WallFairy, {[]{return WallFairy || Slingshot;}}),
}, {
//Locations
LocationAccess(BOTTOM_OF_THE_WELL_MQ_COMPASS_CHEST, {[]{return KokiriSword || (Sticks && LogicChildDeadhand);}}),
LocationAccess(BOTTOM_OF_THE_WELL_MQ_DEAD_HAND_FREESTANDING_KEY, {[]{return HasExplosives;}}),
//Trick: HasExplosives || (LogicBotWMQDeadHandKey && Boomerang)
LocationAccess(BOTTOM_OF_THE_WELL_MQ_GS_BASEMENT, {[]{return CanChildAttack;}}),
LocationAccess(BOTTOM_OF_THE_WELL_MQ_GS_COFFIN_ROOM, {[]{return CanChildAttack && SmallKeys(BOTTOM_OF_THE_WELL, 2);}}),
}, {
//Exits
Entrance(BOTTOM_OF_THE_WELL_ENTRYWAY, {[]{return true;}}),
Entrance(BOTTOM_OF_THE_WELL_MQ_MIDDLE, {[]{return CanPlay(ZeldasLullaby);}}),
//Trick: CanPlay(ZeldasLullaby) || (LogicBotWMQPits && HasExplosives)
});

areaTable[BOTTOM_OF_THE_WELL_MQ_MIDDLE] = Area("Bottom of the Well MQ Middle", "Bottom of the Well", BOTTOM_OF_THE_WELL, NO_DAY_NIGHT_CYCLE, {}, {
//Locations
LocationAccess(BOTTOM_OF_THE_WELL_MQ_MAP_CHEST, {[]{return true;}}),
LocationAccess(BOTTOM_OF_THE_WELL_MQ_LENS_OF_TRUTH_CHEST, {[]{return HasExplosives && SmallKeys(BOTTOM_OF_THE_WELL, 2);}}),
LocationAccess(BOTTOM_OF_THE_WELL_MQ_EAST_INNER_ROOM_FREESTANDING_KEY, {[]{return true;}}),
LocationAccess(BOTTOM_OF_THE_WELL_MQ_GS_WEST_INNER_ROOM, {[]{return CanChildAttack && HasExplosives;}}),
//Trick: CanChildAttack && (LogicBotWMQPits || HasExplosives)
}, {
//Exits
Entrance(BOTTOM_OF_THE_WELL_MQ_PERIMETER, {[]{return true;}}),
});
}
}
Loading

0 comments on commit 0168517

Please sign in to comment.