Skip to content

Commit

Permalink
Added options to randomizer & chests scanned by default & random para…
Browse files Browse the repository at this point in the history
…glider
  • Loading branch information
MelonSpeedruns committed Apr 8, 2024
1 parent 21018e4 commit 608b240
Show file tree
Hide file tree
Showing 5 changed files with 2,034 additions and 10 deletions.
100 changes: 97 additions & 3 deletions Form1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 40 additions & 6 deletions Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -405,15 +405,15 @@ private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
string finalEventFlowPath = Path.Combine(eventFlowFolder, Path.GetFileName(eventFile));

bool editedEvent = false;
byte[] modifiedData = new byte[0];
byte[] modifiedData = Array.Empty<byte>();

if (eventName == "OpeningEvent")
{
File.Copy(eventFile, finalEventFlowPath, true);
modifiedData = TotkRandomizer.Events.EditOpeningEvent(finalEventFlowPath);
editedEvent = true;
}
else if (eventName == "DmF_SY_SmallDungeonGoal")
else if (eventName == "DmF_SY_SmallDungeonGoal" && randomizeChests.Checked)
{
File.Copy(eventFile, finalEventFlowPath, true);
modifiedData = TotkRandomizer.Events.EditDungeonGoalEvent(finalEventFlowPath);
Expand Down Expand Up @@ -503,6 +503,26 @@ private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
{
enumList[i].GetMap()["DefaultValue"] = 0x311bb18f;
}
else if (saveHash == 0x92d92e37 && randomizeChests.Checked)
{
enumList[i].GetMap()["DefaultValue"] = 0x9610d708;
}
else if (saveHash == 0x01d063db && randomizeParagliderFabric.Checked)
{
string randomParasailValue = enumList[i].GetMap()["RawValues"].GetArray()[RNG.Next(25)].GetString();
enumList[i].GetMap()["DefaultValue"] = MurMurHash3.Hash(randomParasailValue);
}
}

BymlArray string64List = saveByaml.GetMap()["Data"].GetMap()["String64"].GetArray();
for (int i = 0; i < string64List.Count; i++)
{
uint saveHash = string64List[i].GetMap()["Hash"].GetUInt32();

if (saveHash == 0x1b39e32f && randomizeChests.Checked)
{
string64List[i].GetMap()["DefaultValue"] = "TBox_Field_Iron";
}
}

BymlArray intArrayList = saveByaml.GetMap()["Data"].GetMap()["IntArray"].GetArray();
Expand Down Expand Up @@ -602,11 +622,25 @@ private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)

for (int i = 0; i < actorList.Count; i++)
{
actorList[i] = ReplaceFloorWeapon(actorList[i]);
actorList[i] = ReplaceEnemy(actorList[i]);
actorList[i] = ReplaceChest(actorList[i], mapFile);
if (randomizeWeapons.Checked)
{
actorList[i] = ReplaceFloorWeapon(actorList[i]);
}

if (randomizeEnemies.Checked)
{
actorList[i] = ReplaceEnemy(actorList[i]);
}

actorList[i] = ReplaceBasics(actorList[i]);
if (randomizeChests.Checked)
{
actorList[i] = ReplaceChest(actorList[i], mapFile);
}

if (randomizeNature.Checked)
{
actorList[i] = ReplaceBasics(actorList[i]);
}
}
}

Expand Down
Loading

0 comments on commit 608b240

Please sign in to comment.