Skip to content

Commit

Permalink
Merge pull request #108 from Razzmatazzz/improve-locations
Browse files Browse the repository at this point in the history
improve location names, fix discarding some events
  • Loading branch information
Razzmatazzz authored Aug 17, 2023
2 parents df7e74b + 2ee088e commit 41f6d0f
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 4,556 deletions.
1 change: 1 addition & 0 deletions RemnantSaveGuardian/LocalizationProvider.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Reflection;
using System.Text.RegularExpressions;
using WPFLocalizeExtension.Extensions;
Expand Down
27 changes: 19 additions & 8 deletions RemnantSaveGuardian/RemnantWorldEvent.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text.RegularExpressions;

Expand Down Expand Up @@ -969,6 +970,9 @@ static public void ProcessEvents(RemnantCharacter character, MatchCollection are
if (GameInfo.SubLocations.ContainsKey(eventMatch.Groups["eventName"].Value))
{
currentSublocation = GameInfo.SubLocations[eventMatch.Groups["eventName"].Value];
} else if (currentMainLocation == null)
{
currentSublocation = area.Groups["locationName"].Value;
}
if (currentSublocation == null && eventMatch.Groups["eventType"].Value != "OverworldPOI")
{
Expand Down Expand Up @@ -1105,20 +1109,27 @@ static public void ProcessEvents(RemnantCharacter character, MatchCollection are
"Boss",
"SideD",
"Miniboss",
"Point of Interest"
"Point of Interest",
"OverworldPOI"
};
var exclusiveEvent = areaEvents.Find(e => exclusiveTypes.Contains(e.RawType));
if (exclusiveEvent != null)
var exclusiveEvents = areaEvents.FindAll(e => exclusiveTypes.Contains(e.RawType));
if (exclusiveEvents.Count > 0)
{
if (zoneEvents[currentWorld].FindIndex(e => e._name == exclusiveEvent._name) != -1)
var previousIndex = zoneEvents[currentWorld].FindIndex(e => e._name == exclusiveEvents[0]._name);
if (previousIndex != -1)
{
areaEvents = areaEvents.FindAll(e => !exclusiveEvents.Contains(e) || !zoneEvents[currentWorld].Any(prev => prev._name == e._name));
if (areaEvents.Count > 0)
{
zoneEvents[currentWorld].InsertRange(previousIndex + 1, areaEvents);
}
continue;
}
}
if (areaEvents.Any(e => e._name == "EmpressStory"))
{
var lastRedThrone = areaEvents.FindLastIndex(e => e.Locations.Contains("TheRedThrone"));
RemnantWorldEvent widowsCourt = new RemnantWorldEvent("RedDoeStatue", new List<string>() { currentWorld, "WidowsCourt" }, "OverworldPOI");
var lastRedThrone = areaEvents.FindLastIndex(e => e.Locations.Contains("The Red Throne"));
RemnantWorldEvent widowsCourt = new RemnantWorldEvent("RedDoeStatue", new List<string>() { currentWorld, "Widow's Court" }, "OverworldPOI");
widowsCourt.setMissingItems(character);
areaEvents.Insert(lastRedThrone+1, widowsCourt);
}
Expand Down Expand Up @@ -1576,8 +1587,8 @@ static public void ProcessEvents(RemnantCharacter character, string saveText)
for (var i = 0; i < eventStarts.Count; i++)
{
var eventText = saveText[eventStarts[i].Index..eventEnds[i].Index];
//var matches = Regex.Matches(eventText, @"/Game/(?<world>[\w/]+)/SpawnTables/(?<spawnTable>[\w/]+)\.\w+(?<events>.+)MapGen[\w\W]+?/Script/Remnant\.ZoneActor.{10}(?<tileSets>(?:.\u0001....(?:/.+?))+).{9}ID");
var matches = Regex.Matches(eventText, @"/Game/(?<world>[\w/]+)/SpawnTables/(?<spawnTable>[\w/]+)\.\w+(?<events>.+)MapGen[\w\W]+?/Script/Remnant\.ZoneActor.{10}(?:.\u0001....(?<tileSet>/.+?))+.{9}ID");
//var matches = Regex.Matches(eventText, @"/Game/(?<world>[\w/]+)/SpawnTables/(?<spawnTable>[\w/]+)\.\w+(?<events>.+)MapGen[\w\W]+?/Script/Remnant\.ZoneActor.{10}(?:.\u0001....(?<tileSet>/.+?))+.{9}ID");
var matches = Regex.Matches(eventText, @"[A-Z0-9]{32}.{5}(?<locationName>[a-zA-Z0-9 ']+)\x00.+?(?:\n.+?)?/Game/(?<world>[\w/]+)/SpawnTables/(?<spawnTable>[\w/]+)\.\w+.{5}(?<events>/.+).{20}MapGen[\w\W]+?/Script/Remnant\.ZoneActor.{10}(?:.\u0001....(?<tileSet>/.+?))+.{9}ID");
if (matches.Count > 7)
{
eventGroupMatches.Add(matches);
Expand Down
1 change: 1 addition & 0 deletions RemnantSaveGuardian/Views/Pages/SettingsPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public SettingsPage(ViewModels.SettingsViewModel viewModel)
} catch (Exception ex) {
Logger.Error($"Error initializing settings page: {ex}");
}
Logger.Log(string.Join(", ", Loc.AvailableLocalizations()));
}

private void BtnCheckUpdate_Click(object sender, RoutedEventArgs e)
Expand Down
99 changes: 49 additions & 50 deletions RemnantSaveGuardian/game.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,59 +11,58 @@
],
"subLocations": {
"Jungle": {
"Shrewd": "TheExpandingGlade",
"RavagerStory": "RavagersLair",
"RootHorror": "KaeulasRest",
"RootCultist": "TheTwistedChantry",
"MotherMind": "TheNamelessNest",
"Meidra": "TheDappledGlade",
"Ruins": "AbandonedRuins",
"KoaraKuri": "KoaraKuriNest",
"HiddenMaze": "EndairasEnd",
"TheTangle": "ImperialGardens",
"TheLament": "TheLament",
"Sarcophagus": "TheLament",
"TheChimney": "LaemirsLyceum",
"WailingField": "ForgottenField",
"CathedralOfSeasons": "CathedralOfSeasons",
"Empress": "TheRedThrone",
"ManyFaces": "TheGreatBole"
"Shrewd": "The Expanding Glade",
"RavagerStory": "Ravager's Lair",
"RootHorror": "Kaeula's Rest",
"RootCultist": "The Twisted Chantry",
"MotherMind": "The Nameless Nest",
"Meidra": "The Dappled Glade",
"Ruins": "Abandoned Ruins",
"KoaraKuri": "Koara Kuri Nest",
"HiddenMaze": "Endaira's End",
"TheTangle": "Imperial Gardens",
"TheLament": "The Lament",
"Sarcophagus": "The Lament",
"TheChimney": "Laemir's Lyceum",
"WailingField": "Forgotten Field",
"CathedralOfSeasons": "Cathedral Of Seasons",
"Empress": "The Red Throne",
"ManyFaces": "The Great Bole"
},
"Fae": {
"AllFather": "BeatificPalace",
"DranGrenadier": "CottonsKiln",
"Ravenous": "TheGreatHall",
"CharnelHouse": "HarvestersReach",
"TheHunter": "BriellasGarden",
"ClockTower": "LemarkDistrict",
"BloatKing": "TheGreatSewers",
"CrimsonHarvest": "ButchersQuarter",
"FaeArchon": "ShatteredGallery",
"FaeCouncil": "CouncilChamber",
"RedPrince": "GildedChambers",
"DranOracle": "OraclesRefuge",
"Settlement": "BairnsCrossing",
"Nimue": "NimuesRetreat",
"FaelinFaerlin": "BeatificPalace",
"Faerin": "MaleficGallery",
"TheNest": "Sewers",
"TownTurnedToDust": "TillersRest",
"ThreeMenMorris": "PostulantsParlor"
"AllFather": "Beatific Palace",
"DranGrenadier": "Cotton's Kiln",
"Ravenous": "The Great Hall",
"CharnelHouse": "Harvester's Reach",
"TheHunter": "Briella's Garden",
"BloatKing": "The Great Sewers",
"CrimsonHarvest": "Butcher's Quarter",
"FaeArchon": "Shattered Gallery",
"FaeCouncil": "Council Chamber",
"RedPrince": "Gilded Chambers",
"DranOracle": "Oracle'' sRefuge",
"Settlement": "Bairn's Crossing",
"Nimue": "Nimue's Retreat",
"FaelinFaerlin": "Beatific Palace",
"Faerin": "Malefic Gallery",
"__TheNest": "Sewers",
"TownTurnedToDust": "Tiller's Rest",
"ThreeMenMorris": "Postulant's Parlor"
},
"Nerud": {
"Abomination": "ThePutridDomain",
"Hatchery": "TheHatchery",
"Extraction": "DarkConduit",
"Extermination": "DormantNErudianFacility",
"Train": "TerminusStation",
"CustodianEye": "SpectrumNexus",
"TowerHeist": "TowerOfTheUnseen",
"TheDreamlessSleep": "VoidVesselFacility",
"NerudGuardian": "ThresholdOfTheUnknown",
"TheCustodian": "ThePhantomWasteland",
"TalRatha": "ForgottenPrison",
"Phantom": "TheAstroPathsRespite",
"StasisSiege": "VaultOfTheFormless"
"Abomination": "The Putrid Domain",
"Hatchery": "The Hatchery",
"Extraction": "Dark Conduit",
"Extermination": "Dormant N'Erudian Facility",
"Train": "Terminus Station",
"CustodianEye": "Spectrum Nexus",
"TowerHeist": "Tower Of The Unseen",
"TheDreamlessSleep": "Void Vessel Facility",
"NerudGuardian": "Threshold Of The Unknown",
"TheCustodian": "The Phantom Wasteland",
"TalRatha": "Forgotten Prison",
"Phantom": "Astropath's Respite",
"StasisSiege": "Vault Of The Formless"
}
},
"injectableParents": {
Expand Down Expand Up @@ -1072,7 +1071,7 @@
"name": "/Items/Trinkets/Rings/VacuumSeal/Ring_VacuumSeal"
}
],
"Towers_ElevatorShaft": [
"ElevatorShaft": [
{
"name": "/Items/Trinkets/Rings/PropulsionLoop/Ring_PropulsionLoop"
},
Expand Down
Loading

0 comments on commit 41f6d0f

Please sign in to comment.