Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Item Location Fixes #35

Merged
merged 6 commits into from
Feb 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions source/fill.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -344,9 +344,18 @@ static void FastFill(std::vector<ItemKey> items, std::vector<LocationKey> locati
//Loop until locations are empty, or also end if items are empty and the parameters specify to end then
while (!locations.empty() && (!endOnItemsEmpty || !items.empty())) {
LocationKey loc = RandomElement(locations, true);
ItemKey item = RandomElement(items, true);
/*if ( (Location(loc)->IsRepeatable() == false) && (ItemTable(item).IsReusable() == true) ){
//unsuccessfulPlacement = true;
CitraPrint("Attemting to place repeatable item in nonrepeatable spot in FastFill");
PlacementLog_Msg("\n Attempted to place " + ItemTable(item).GetName().GetEnglish() + " at " + Location(loc)->GetName());
items.push_back(item);
locations.push_back(loc);
}
else {*/
Location(loc)->SetAsHintable();
PlaceItemInLocation(loc, RandomElement(items, true));

PlaceItemInLocation(loc, item);
if (items.empty() && !endOnItemsEmpty) {
items.push_back(GetJunkItem());
}
Expand Down Expand Up @@ -477,7 +486,7 @@ static void AssumedFill(const std::vector<ItemKey>& items, const std::vector<Loc
LocationKey selectedLocation = RandomElement(accessibleLocations);
if ( !(Location(selectedLocation)->IsRepeatable()) && ItemTable(item).IsReusable() ){
//unsuccessfulPlacement = true;
CitraPrint("Attemting to place things where they shouldnt be");
CitraPrint("Attemting to place repeatable item in non repeatable spot in AssumedFill");
PlacementLog_Msg("\n Attempted to place " + ItemTable(item).GetName().GetEnglish() + " at " + Location(selectedLocation)->GetName());
itemsToPlace.push_back(item);
}
Expand Down Expand Up @@ -814,7 +823,7 @@ int Fill() {

//Place Main Inventory First
//So first get all items in the pool + DekuMask,
std::vector<ItemKey> mainadvancementItems = FilterAndEraseFromPool(ItemPool, [](const ItemKey i) {return ItemTable(i).IsAdvancement();});//&& ItemTable(i).GetItemType() == ITEMTYPE_ITEM
std::vector<ItemKey> mainadvancementItems = FilterAndEraseFromPool(ItemPool, [](const ItemKey i) {return ItemTable(i).IsAdvancement() && ItemTable(i).GetItemType() != ITEMTYPE_QUEST;});//(ItemTable(i).GetItemType() == ITEMTYPE_ITEM || ItemTable(i).GetItemType() == ITEMTYPE_MASK || ItemTable(i).GetItemType() == ITEMTYPE_TRADE || ItemTable(i).GetItemType() == ITEMTYPE_GFAIRY)
//Then Place those to expand the amount of checks available
AssumedFill(mainadvancementItems, allLocations,true);

Expand Down
4 changes: 4 additions & 0 deletions source/hint_list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ void HintTable_Init() {
//hintTable[INVERTED_SONG_OF_TIME] = HintText::Item({ Text{"slowed time", "slowed time", "slowed time"}});
hintTable[EPONAS_SONG] = HintText::Item({ Text{"a horses song", "a horses song", "a horses song"}});
hintTable[SONATA_OF_AWAKENING] = HintText::Item({ Text{"a royal song", "a royal song", "a royal song"}});
hintTable[LULLABY_INTRO] = HintText::Item({ Text{"a sleepy melody intro", "a sleepy melody intro", "a sleepy melody intro"}});
hintTable[GORONS_LULLABY] = HintText::Item({ Text{"a sleepy melody", "a sleepy melody", "a sleepy melody"}});
hintTable[NEW_WAVE_BOSSA_NOVA] = HintText::Item({ Text{"a song of newborns", "a song of newborns", "a song of newborns"}});
hintTable[ELEGY_OF_EMPTINESS] = HintText::Item({ Text{"empty shells", "empty shells", "empty shells"}});
Expand Down Expand Up @@ -331,6 +332,7 @@ void HintTable_Init() {
hintTable[MOUNTAIN_VILLAGE_SMITH_DAY_ONE] = HintText::Sometimes({Text{"a moutain smith crafts", "", ""}});
hintTable[MOUNTAIN_VILLAGE_SMITH_DAY_TWO] = HintText::Sometimes({Text{"a mountain smith crafts", "", ""}});
hintTable[MOUNTAIN_VILLAGE_FROG_CHOIR] = HintText::Sometimes({Text{"a frog choir rewards", "", ""}});
hintTable[MOUNTAIN_VILLAGE_KEATON_QUIZ] = HintText::Sometimes({Text{"a mysterious fox rewards", "", ""}});
hintTable[MOUNTAIN_VILLAGE_DARMANI] = HintText::Sometimes({Text{"a mountain spirit rewards", "", ""}});
hintTable[MOUNTAIN_VILLAGE_HUNGRY_GORON] = HintText::Sometimes({Text{"a hungry goron rewards", "", ""}});
hintTable[MOUNTAIN_WATERFALL_CHEST] = HintText::Sometimes({Text{"a springtime waterfall contains", "", ""}});
Expand Down Expand Up @@ -440,6 +442,7 @@ void HintTable_Init() {
hintTable[TWIN_ISLANDS_GORON_RACETRACK_GROTTO_CHEST] = HintText::Sometimes({Text{"a hidden cave contains", "", ""}});
hintTable[TWIN_ISLANDS_UNDERWATER_RAMP_CHEST] = HintText::Sometimes({Text{"a spring treasure contains", "", ""}});
hintTable[TWIN_ISLANDS_CAVE_CHEST] = HintText::Sometimes({Text{"a sunken springtime treasure contains", "", ""}});
hintTable[TWIN_ISLANDS_LULLABY_INTRO] = HintText::Sometimes({Text{"a goron elder teaches", "", ""}});
hintTable[TINGLE_TWIN_ISLANDS_SH] = HintText::Sometimes({Text{"a map maker sells ", "", ""}});
hintTable[TINGLE_TWIN_ISLANDS_RR] = HintText::Sometimes({Text{"a map maker sells", "", ""}});
hintTable[TINGLE_TWIN_ISLANDS_SH_SPRING] = HintText::Sometimes({Text{"a map maker sells", "", ""}});
Expand Down Expand Up @@ -795,6 +798,7 @@ void HintTable_Init() {
hintTable[IKANA_GRAVEYARD_BATS_ROOM] = HintText::Region({Text{"Ikana Graveyard", "", ""}});
hintTable[IKANA_GRAVEYARD_TABLET_ROOM] = HintText::Region({Text{"Ikana Graveyard", "", ""}});
hintTable[IKANA_GRAVEYARD_BELOW_GRAVE2] = HintText::Region({Text{"Ikana Graveyard", "", ""}});
hintTable[IKANA_GRAVEYARD_PRE_IRON_KNUCKLE_ROOM] = HintText::Region({Text{"Ikana Graveyard", "", ""}});
hintTable[IKANA_GRAVEYARD_IRON_KNUCKLE_ROOM] = HintText::Region({Text{"Ikana Graveyard", "", ""}});
hintTable[IKANA_GRAVEYARD_BELOW_GRAVE3] = HintText::Region({Text{"Ikana Graveyard", "", ""}});
hintTable[DAMPES_HUT] = HintText::Region({Text{"Ikana Graveyard", "", ""}});
Expand Down
4 changes: 4 additions & 0 deletions source/include/keys.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ typedef enum {
SONG_OF_TIME,
SONG_OF_STORMS,
SONATA_OF_AWAKENING,
LULLABY_INTRO,
GORONS_LULLABY,
NEW_WAVE_BOSSA_NOVA,
ELEGY_OF_EMPTINESS,
Expand Down Expand Up @@ -237,6 +238,7 @@ typedef enum {
SOUTHERN_SWAMP_MUSIC_STATUE,
GIANTS_OATH_TO_ORDER,
DEKU_PALACE_IMPRISONED_MONKEY,
TWIN_ISLANDS_LULLABY_INTRO,
GORON_VILLAGE_GORON_LULLABY,
GBC_BABY_ZORAS,
ROMANI_RANCH_ROMANIS_GAME,
Expand Down Expand Up @@ -338,6 +340,7 @@ typedef enum {
MOUNTAIN_VILLAGE_SMITH_DAY_ONE,
MOUNTAIN_VILLAGE_SMITH_DAY_TWO,
MOUNTAIN_VILLAGE_FROG_CHOIR,
MOUNTAIN_VILLAGE_KEATON_QUIZ,
MOUNTAIN_VILLAGE_DARMANI,
MOUNTAIN_VILLAGE_HUNGRY_GORON,
MOUNTAIN_WATERFALL_CHEST,
Expand Down Expand Up @@ -813,6 +816,7 @@ typedef enum {
IKANA_GRAVEYARD_BATS_ROOM,
IKANA_GRAVEYARD_TABLET_ROOM,
IKANA_GRAVEYARD_BELOW_GRAVE2,
IKANA_GRAVEYARD_PRE_IRON_KNUCKLE_ROOM,
IKANA_GRAVEYARD_IRON_KNUCKLE_ROOM,
IKANA_GRAVEYARD_BELOW_GRAVE3,
DAMPES_HUT,
Expand Down
1 change: 1 addition & 0 deletions source/include/logic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ namespace Logic {
extern bool SongOfStorms;
extern bool SongOfHealing;
extern bool SonataOfAwakening;
extern bool LullabyIntro;
extern bool GoronsLullaby;
extern bool NewWaveBossaNova;
extern bool ElegyOfEmptiness;
Expand Down
1 change: 1 addition & 0 deletions source/item_list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ void ItemTable_Init() { //repeatable denotes that an item in a vanilla playth
//itemTable[SONG_OF_TIME] = Item(Text{"Song of Time", "Chant du temps", "Canción del tiempo"}, ITEMTYPE_SONG, 0xC5, true, &SongOfTime, SONG_OF_TIME, false,);
itemTable[SONG_OF_STORMS] = Item(true, false, &SongOfStorms, Text{"Song of Storms", "Chant des tempêtes", "Canción de la tormenta"}, SONG_OF_STORMS, (u32)GetItemID::GI_NONE, ITEMTYPE_SONG);
itemTable[SONATA_OF_AWAKENING] = Item(true, false, &SonataOfAwakening, Text{"Sonata of Awakening", "Sonate de i'Eveil", "Sonata del Despertar"}, SONATA_OF_AWAKENING, (u32)GetItemID::GI_NONE, ITEMTYPE_SONG );
itemTable[LULLABY_INTRO] = Item(true, false, &LullabyIntro, Text{"Goron's Lullaby Intro", "Goron's Lullaby Intro", "Goron's Lullaby Intro"}, LULLABY_INTRO, (u32)GetItemID::GI_NONE, ITEMTYPE_SONG );
itemTable[GORONS_LULLABY] = Item(true, false, &GoronsLullaby, Text{"Goron's Lullaby", "Berceuse des Gorons", "Nana Goron"}, GORONS_LULLABY, (u32)GetItemID::GI_NONE, ITEMTYPE_SONG);
itemTable[NEW_WAVE_BOSSA_NOVA] = Item(true, false, &NewWaveBossaNova, Text{"New Wave Bossa Nova", "Bossa Nova des Flots", "Nueva Bossanova"}, NEW_WAVE_BOSSA_NOVA, (u32)GetItemID::GI_NONE, ITEMTYPE_SONG );
itemTable[ELEGY_OF_EMPTINESS] = Item(true, false, &ElegyOfEmptiness, Text{"Elegy of Emptiness", "Hymne du Vida", "Elegia al Vacio"}, ELEGY_OF_EMPTINESS, (u32)GetItemID::GI_NONE, ITEMTYPE_SONG );
Expand Down
Loading
Loading