Skip to content

Commit 608b240

Browse files
Added options to randomizer & chests scanned by default & random paraglider
1 parent 21018e4 commit 608b240

5 files changed

Lines changed: 2034 additions & 10 deletions

File tree

Form1.Designer.cs

Lines changed: 97 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Form1.cs

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -405,15 +405,15 @@ private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
405405
string finalEventFlowPath = Path.Combine(eventFlowFolder, Path.GetFileName(eventFile));
406406

407407
bool editedEvent = false;
408-
byte[] modifiedData = new byte[0];
408+
byte[] modifiedData = Array.Empty<byte>();
409409

410410
if (eventName == "OpeningEvent")
411411
{
412412
File.Copy(eventFile, finalEventFlowPath, true);
413413
modifiedData = TotkRandomizer.Events.EditOpeningEvent(finalEventFlowPath);
414414
editedEvent = true;
415415
}
416-
else if (eventName == "DmF_SY_SmallDungeonGoal")
416+
else if (eventName == "DmF_SY_SmallDungeonGoal" && randomizeChests.Checked)
417417
{
418418
File.Copy(eventFile, finalEventFlowPath, true);
419419
modifiedData = TotkRandomizer.Events.EditDungeonGoalEvent(finalEventFlowPath);
@@ -503,6 +503,26 @@ private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
503503
{
504504
enumList[i].GetMap()["DefaultValue"] = 0x311bb18f;
505505
}
506+
else if (saveHash == 0x92d92e37 && randomizeChests.Checked)
507+
{
508+
enumList[i].GetMap()["DefaultValue"] = 0x9610d708;
509+
}
510+
else if (saveHash == 0x01d063db && randomizeParagliderFabric.Checked)
511+
{
512+
string randomParasailValue = enumList[i].GetMap()["RawValues"].GetArray()[RNG.Next(25)].GetString();
513+
enumList[i].GetMap()["DefaultValue"] = MurMurHash3.Hash(randomParasailValue);
514+
}
515+
}
516+
517+
BymlArray string64List = saveByaml.GetMap()["Data"].GetMap()["String64"].GetArray();
518+
for (int i = 0; i < string64List.Count; i++)
519+
{
520+
uint saveHash = string64List[i].GetMap()["Hash"].GetUInt32();
521+
522+
if (saveHash == 0x1b39e32f && randomizeChests.Checked)
523+
{
524+
string64List[i].GetMap()["DefaultValue"] = "TBox_Field_Iron";
525+
}
506526
}
507527

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

603623
for (int i = 0; i < actorList.Count; i++)
604624
{
605-
actorList[i] = ReplaceFloorWeapon(actorList[i]);
606-
actorList[i] = ReplaceEnemy(actorList[i]);
607-
actorList[i] = ReplaceChest(actorList[i], mapFile);
625+
if (randomizeWeapons.Checked)
626+
{
627+
actorList[i] = ReplaceFloorWeapon(actorList[i]);
628+
}
629+
630+
if (randomizeEnemies.Checked)
631+
{
632+
actorList[i] = ReplaceEnemy(actorList[i]);
633+
}
608634

609-
actorList[i] = ReplaceBasics(actorList[i]);
635+
if (randomizeChests.Checked)
636+
{
637+
actorList[i] = ReplaceChest(actorList[i], mapFile);
638+
}
639+
640+
if (randomizeNature.Checked)
641+
{
642+
actorList[i] = ReplaceBasics(actorList[i]);
643+
}
610644
}
611645
}
612646

0 commit comments

Comments
 (0)