Skip to content

Commit

Permalink
2.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Trexounay committed Jan 24, 2023
1 parent 5fce550 commit 23150d4
Show file tree
Hide file tree
Showing 12 changed files with 3,616 additions and 2,576 deletions.
4 changes: 2 additions & 2 deletions EnderLilies.Game/EnderLilies.Game.rc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ END

VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,1
PRODUCTVERSION 2,2,1,0
PRODUCTVERSION 2,3,2,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -74,7 +74,7 @@ BEGIN
VALUE "LegalCopyright", "Copyright (C) 2021"
VALUE "OriginalFilename", "EnderLilies.Game"
VALUE "ProductName", "EnderLilies.Randomizer.Game"
VALUE "ProductVersion", "2.2.1.0"
VALUE "ProductVersion", "2.3.2.0"
END
END
BLOCK "VarFileInfo"
Expand Down
1 change: 1 addition & 0 deletions EnderLilies.Game/Randomizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -893,6 +893,7 @@ void Randomizer::RefreshAptitudes()
for (int i = 0; i < gm->TutorialTable->Data.Num(); ++i)
pc->MarkTutorialAsSeen(gm->TutorialTable->Data[i].Name);

return;
#ifdef _DEBUG

pc->UnlockAllAptitudes();
Expand Down
18 changes: 0 additions & 18 deletions EnderLilies.Game/xinput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,3 @@ namespace
{
HMODULE xinput;
}


/*
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
write();
if(fdwReason == DLL_PROCESS_ATTACH) {
xinput = LoadLibrary(L"C:\\Windows\\System32\\xinput1_3-orig.dll");
if(xinput == 0)
xinput = LoadLibrary(L"C:\\Windows\\System32\\xinput1_3.dll");
}
return TRUE;
}*/
7 changes: 5 additions & 2 deletions EnderLilies.Randomizer/ComponentSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,7 @@ public ComponentSettings()
public event PropertyChangedEventHandler PropertyChanged = delegate { };
public event PropertyChangedEventHandler PropertyChangedEnded = delegate { };

public bool Init = false;
public void SetSettings(XmlNode node)
{
var element = (XmlElement)node;
Expand Down Expand Up @@ -788,8 +789,8 @@ public void SetSettings(XmlNode node)
DashProgressive = SettingsHelper.ParseBool(element["DashProgressive"], true);
StartWeaponUsesAncientSouls = SettingsHelper.ParseBool(element["StartWeaponUsesAncientSouls"], true);
ShuffleWeaponUpgrades = SettingsHelper.ParseBool(element["ShuffleWeaponUpgrades"], false);


Init = true;
NotifyPropertyChanged();
}

public XmlNode GetSettings(XmlDocument document)
Expand Down Expand Up @@ -1032,7 +1033,9 @@ private void NotifyPropertyChanged([CallerMemberName] String propertyName = "")
if (!_internalInteraction)
{
if (propertyName != "SeedText")
{
NotifyPropertyChanged("SeedText");
}
else
PropertyChangedEnded(this, new PropertyChangedEventArgs(propertyName));
}
Expand Down
18 changes: 9 additions & 9 deletions EnderLilies.Randomizer/EnderLilies.Randomizer.json
Original file line number Diff line number Diff line change
Expand Up @@ -1015,7 +1015,7 @@
},
"Castle_15_GAMEPLAY.BP_WorldTravelVolume_2": {
"content": "Map.map_castle_16.15",
"rules": "Castle15Left | TowerAlcove + claw + (hook | FULLSILVA + sinner | 3LEDGE)"
"rules": "TowerAlcove + claw + (hook | FULLSILVA + sinner | 3LEDGE)"
},
"Castle_15_GAMEPLAY.BP_WorldTravelVolume2": {
"content": "Map.map_castle_14.15",
Expand Down Expand Up @@ -2550,19 +2550,19 @@
},
"Oubliette_04_GAMEPLAY.BP_SCR_LV1S_2020_2": {
"content": "Generic.i_SpiritCurrencyLv1_M",
"rules": "Oubliette04Left + (FULLSILVA | hook)"
"rules": "Oubliette04Left + (FULLSILVA | hook | 3LEDGE | sinner + silva + djump | silva + champion + dodge | 2HORIZONTAL + dash + LEDGE | djump + champion + HORIZONTAL)"
},
"Oubliette_04_GAMEPLAY.BP_SCR_LV2S_2010_3": {
"content": "Generic.i_SpiritCurrencyLv2_S",
"rules": "Oubliette04Right"
"rules": "Oubliette04Right | Oubliette04Left"
},
"Oubliette_04_GAMEPLAY.BP_WorldTravelVolume14": {
"content": "Map.map_oubliette_03.4",
"rules": "Oubliette04Right | Oubliette04Left"
},
"Oubliette_04_GAMEPLAY.BP_WorldTravelVolume16": {
"content": "Map.map_oubliette_02.4",
"rules": "Oubliette04Left | Oubliette04Right"
"rules": "Oubliette04Right | Oubliette04Left"
},
"Oubliette_05_1_GAMEPLAY.BP_Interactable_WorldTravel13": {
"content": "Map.map_oubliette_05.5_1",
Expand Down Expand Up @@ -2922,7 +2922,7 @@
},
"Oubliette_16_GAMEPLAY.BP_WorldTravelVolume18": {
"content": "Map.map_outside_01.O16",
"rules": "Oubliette16Right | Oubliette16Left + (hook + ((sinner + LEDGE) | 2HORIZONTAL | silva + (djump | dodge) | djump + (dodge | champion)) | silva + djump + (claw | champion | dodge))"
"rules": "Oubliette16Right | Oubliette16Left + (hook + (sinner + (LEDGE | dash | dodge) | silva + (djump | dodge | champion + dash) | djump + (dodge | champion)) | silva + djump + (claw | champion | dodge))"
},
"Oubliette_17_GAMEPLAY.BP_WorldTravelVolume19": {
"content": "Map.map_oubliette_10.17",
Expand Down Expand Up @@ -3130,7 +3130,7 @@
},
"Swamp_11_GAMEPLAY.BP_Interactable_Item_MaxHPUp_01_2": {
"content": "Parameter.i_maxHPUp_01",
"rules": "Swamp11Left + (LEDGE + HORIZONTAL)"
"rules": "Swamp11Left + (LEDGE + HORIZONTAL | 2HORIZONTAL | silva + djump)"
},
"Swamp_11_GAMEPLAY.BP_Interactable_Passives_Treasure_2": {
"content": "Passive.i_passive_dmgup",
Expand Down Expand Up @@ -3350,7 +3350,7 @@
},
"Village_03_GAMEPLAY.BP_Interactable_Passives_Treasure_2": {
"content": "Passive.i_passive_dmgcut_LV1",
"rules": "Village03Right + (claw | hook | LEDGE | HORIZONTAL)"
"rules": "Village03Right + (claw | hook | LEDGE | HORIZONTAL | dash)"
},
"Village_03_GAMEPLAY.BP_SCR_LV1S_2021_2": {
"content": "Generic.i_SpiritCurrencyLv1_S",
Expand Down Expand Up @@ -3530,11 +3530,11 @@
},
"Village_10_GAMEPLAY.BP_WorldTravelVolume_2": {
"content": "Map.map_village_09.1",
"rules": "Village10Left | Gerrod"
"rules": "Gerrod"
},
"Village_10_GAMEPLAY.BP_WorldTravelVolume2": {
"content": "Map.map_village_11.0",
"rules": "Village10Right | Gerrod"
"rules": "Gerrod"
},
"Village_11_1_GAMEPLAY.BP_Interactable_Item_HealPower_Up_5": {
"content": "Generic.i_HealPower_Up",
Expand Down
113 changes: 35 additions & 78 deletions EnderLilies.Randomizer/Logic/GameGraph.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,92 +141,46 @@ public bool AddProgressItem(int key, bool metaprogression, ref BitArray reachabl
return true;
}

int max_item_count = 0;

public Dictionary<string, string> Solve(string start, string weapon = "umbral", bool metaprogression = false, bool roomrandom = false)
{
if (aliases.ContainsKey(start))
start = aliases[start];

Dictionary<string, string> data = new Dictionary<string, string>();
if (roomrandom)
{
/*
var trans = new List<string>(transitions.Values);
trans.Shuffle();
List<string> first_pass = tags.Where(k => transitions.ContainsKey(k.Value)).
Select<KeyValuePair<string, int>, string>(k => k.Key).ToList();
List<string> tagsnames = new List<string>(transitions.Values);
List<int> volumes = new List<int>(transitions.Keys);
var query = tags.Values.GroupBy(x => x)
.Where(g => g.Count() > 1)
.Select(y => y.Key)
.ToList();
first_pass.Shuffle();
HashSet<string> done = new HashSet<string>();
while (first_pass.Count > 0)
{
string source_map = first_pass[0].Substring(4, first_pass[0].LastIndexOf('.') - 4);
//first_pass[0].Split('.')[1].Substring(4);
int i = 1;
for (; i < first_pass.Count; ++i)
{
string dest_map = first_pass[i].Substring(4, first_pass[i].LastIndexOf('.') - 4);
if (source_map != dest_map)
break;
}
if (i >= first_pass.Count)
break;
string tag1 = first_pass[0];
string tag2 = first_pass[i];
data[Node(tags[tag1])] = tag2;
data[Node(tags[tag2])] = tag1;
AddRule(Node(tags[tag1]), Node(tags[tag2]));
AddRule(Node(tags[tag2]), Node(tags[tag1]));
first_pass.RemoveAt(i);
first_pass.RemoveAt(0);
int i1 = tagsnames.IndexOf(tag1);
tagsnames.RemoveAt(i1);
int i2 = tagsnames.IndexOf(tag2);
tagsnames.RemoveAt(i2);
int v1 = volumes.IndexOf(tags[tag1]);
volumes.RemoveAt(v1);
int v2 = volumes.IndexOf(tags[tag2]);
volumes.RemoveAt(v2);
}
while (volumes.Count > 0)
{
string node = Node(volumes[0]);
node = node.Substring(0, node.IndexOf('.'));
string source_map = node.Substring(0, node.LastIndexOf('_')).ToLower();
int i = 0;
for (; i < tagsnames.Count; ++i)
var trans = new List<string>(transitions.Values);
trans.Shuffle();
foreach (var id in transitions)
{
string dest_map = tagsnames[i].Substring(4, tagsnames[i].LastIndexOf('.') - 4);
if (source_map != dest_map)
break;
var i = trans.Count - 1;
var tag = trans[i];
data[Node(id.Key)] = trans[i];
AddRule(tag, Node(id.Key));
trans.RemoveAt(i);
}
if (i >= tagsnames.Count)
break;
data[Node(volumes[0])] = tagsnames[i];
AddRule(Node(tags[tagsnames[i]]), Node(volumes[0]));
volumes.RemoveAt(0);
tagsnames.RemoveAt(i);
}*/

var trans = new List<string>(transitions.Values);
trans.Shuffle();
foreach (var id in transitions)
{
data[Node(id.Key)] = trans[trans.Count - 1];
AddRule(Node(tags[trans[trans.Count - 1]]), Node(id.Key));
trans.RemoveAt(trans.Count - 1);
}
}
/*
var area = new Dictionary<string, string>()
{
{ "Map.map_church_08.1", "Map.map_village_01.0" },
{ "Map.map_church_08.2", "Map.map_forest_01.C8" },
{ "Map.map_village_11.1", "Map.map_castle_01.0" },
{ "Map.map_village_12.C1", "Map.map_cave_01.V12" },
{ "Map.map_village_15.F1", "Map.map_fort_01.V15" },
{ "Map.map_castle_07.F1", "Map.map_fort_01.C7" },
{ "Map.map_cave_22.F2", "Map.map_fort_02.C22" },
{ "Map.map_forest_07.O1", "Map.map_oubliette_01.F7" },
{ "Map.map_forest_09.S2","Map.map_swamp_02.F9" },
{ "Map.map_oubliette_17.S6", "Map.map_swamp_06.O17" },
};
*/
else
foreach (var trans in transitions)
AddRule(trans.Value, Node(trans.Key));
foreach (var t in transitions)
AddRule(t.Value, Node(t.Key));

if (aliases.ContainsKey(start))
start = aliases[start];
if (aliases.ContainsKey(weapon))
weapon = aliases[weapon];

Expand Down Expand Up @@ -261,7 +215,7 @@ public Dictionary<string, string> Solve(string start, string weapon = "umbral",
do
{
progress = false;
for (int nb_items = 1; !progress && nb_items <= missing_keys.Count; nb_items++)
for (int nb_items = 1; !progress && nb_items <= missing_keys.Count && nb_items < max_item_count; nb_items++)
{
// check 1 by 1 item that would grant progress
foreach (IEnumerable<int> subitems in Numerics.Combinations(missing_keys, nb_items))
Expand Down Expand Up @@ -293,7 +247,7 @@ public Dictionary<string, string> Solve(string start, string weapon = "umbral",
empty_locations.AddRange(meta_locations);
//for (int i = 0; i < meta_locations.Count; i++)
//{
//Console.WriteLine(i.ToString() + " " + Node(meta_locations[i]));
//Console.WriteLine(i.ToString() + " " + Node(meta_locations[i]));
//}

foreach (int key in subitems)
Expand Down Expand Up @@ -369,6 +323,8 @@ public int AddNode(string node, string check = null)
int id = nodes.IndexOf(node);
if (check != null)
{
if (aliases.ContainsKey(check))
check = aliases[check];
if (check.StartsWith("Map."))
transitions[id] = check;
else
Expand Down Expand Up @@ -402,6 +358,7 @@ public void AddRule(string location, params string[] tokens)
else
keys_condition.Add(AddKey(condition));
}
max_item_count = Math.Max(max_item_count, keys_condition.Count);
if (nodes_condition.Count == 0)
throw new Exception("unlinked node");
if (!conditions.ContainsKey(node))
Expand Down
4 changes: 4 additions & 0 deletions EnderLilies.Randomizer/Logic/RandomSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,12 @@ public RandomSession(ComponentSettings settings)
_settings.PropertyChangedEnded += _settings_PropertyChanged;
}

string _seed_text = "";
private void _settings_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
{
if (!_settings.Init || _settings.SeedText == _seed_text)
return;
_seed_text = _settings.SeedText;
Generate(_settings.Seed);
_settings.GeneratePreview(this);
}
Expand Down
2 changes: 1 addition & 1 deletion EnderLilies.Randomizer/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.2.1.0")]
[assembly: AssemblyVersion("2.3.2.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Binary file modified Update/Components/EnderLilies.Game.dll
Binary file not shown.
Binary file modified Update/Components/EnderLilies.Randomizer.dll
Binary file not shown.
Loading

0 comments on commit 23150d4

Please sign in to comment.