├── LaMulana2Randomizer ├── Seed │ └── spoilers.json ├── LaMulana2.ico ├── Monomod │ ├── MonoMod.exe │ ├── Mono.Cecil.dll │ ├── Mono.Cecil.Mdb.dll │ ├── Mono.Cecil.Pdb.dll │ ├── MonoMod.Utils.dll │ └── Mono.Cecil.Rocks.dll ├── packages.config ├── App.xaml.cs ├── UI │ ├── MainWindow.xaml.cs │ ├── EnumBooleanConverter.cs │ ├── ProgressDialog.xaml.cs │ ├── IntRangRules.cs │ └── ProgressDialog.xaml ├── App.xaml ├── Utils │ ├── Shuffle.cs │ ├── Logger.cs │ └── FileUtils.cs ├── Extensions │ └── StringExtensions.cs ├── RandomiserException.cs ├── BindableBase.cs ├── Item.cs ├── RelayCommand.cs ├── SpoilerLog.cs ├── LogicParsing │ ├── Logic.cs │ ├── ShuntingYard.cs │ ├── LogicTree.cs │ └── Tokeniser.cs ├── Area.cs ├── App.config ├── ViewModels │ ├── ProgressDialogViewModel.cs │ └── MainViewModel.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── Location.cs ├── Exit.cs ├── ItemPool.cs └── LaMulana2Randomizer.csproj ├── LM2RandomiserShared ├── Version.cs ├── Properties │ └── AssemblyInfo.cs ├── ExitID.cs ├── AreaID.cs ├── LaMulana2RandomizerShared.csproj ├── ItemID.cs └── LocationID.cs ├── Assembly-CSharp ├── Patches │ ├── TrapFloor.cs │ ├── MenuSystem.cs │ ├── L2SystemCore.cs │ ├── HolyTabretScript.cs │ ├── TreasureBoxScript.cs │ ├── EventItemScript.cs │ ├── CostumeScript.cs │ ├── ItemPotScript.cs │ ├── Status.cs │ ├── SeihaiMenu.cs │ ├── L2FlagSystem.cs │ ├── ItemDialog.cs │ └── ShopScript.cs ├── Properties │ └── AssemblyInfo.cs ├── FakeItem.cs ├── HotSpring.cs ├── StartDB.cs ├── ItemTracker.cs ├── DevUI.cs ├── Assembly-CSharp.csproj └── ExitDB.cs ├── README.md ├── LaMulana2Randomizer.sln └── .gitignore /LaMulana2Randomizer/Seed/spoilers.json: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /LaMulana2Randomizer/LaMulana2.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Coookie93/LaMulana2Randomizer/HEAD/LaMulana2Randomizer/LaMulana2.ico -------------------------------------------------------------------------------- /LaMulana2Randomizer/Monomod/MonoMod.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Coookie93/LaMulana2Randomizer/HEAD/LaMulana2Randomizer/Monomod/MonoMod.exe -------------------------------------------------------------------------------- /LaMulana2Randomizer/Monomod/Mono.Cecil.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Coookie93/LaMulana2Randomizer/HEAD/LaMulana2Randomizer/Monomod/Mono.Cecil.dll -------------------------------------------------------------------------------- /LaMulana2Randomizer/Monomod/Mono.Cecil.Mdb.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Coookie93/LaMulana2Randomizer/HEAD/LaMulana2Randomizer/Monomod/Mono.Cecil.Mdb.dll -------------------------------------------------------------------------------- /LaMulana2Randomizer/Monomod/Mono.Cecil.Pdb.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Coookie93/LaMulana2Randomizer/HEAD/LaMulana2Randomizer/Monomod/Mono.Cecil.Pdb.dll -------------------------------------------------------------------------------- /LaMulana2Randomizer/Monomod/MonoMod.Utils.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Coookie93/LaMulana2Randomizer/HEAD/LaMulana2Randomizer/Monomod/MonoMod.Utils.dll -------------------------------------------------------------------------------- /LaMulana2Randomizer/Monomod/Mono.Cecil.Rocks.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Coookie93/LaMulana2Randomizer/HEAD/LaMulana2Randomizer/Monomod/Mono.Cecil.Rocks.dll -------------------------------------------------------------------------------- /LaMulana2Randomizer/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /LM2RandomiserShared/Version.cs: -------------------------------------------------------------------------------- 1 | namespace LaMulana2RandomizerShared 2 | { 3 | public static class Version 4 | { 5 | public static string version = "2.2.4"; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /LaMulana2Randomizer/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | 3 | namespace LaMulana2Randomizer 4 | { 5 | /// 6 | /// Interaction logic for App.xaml 7 | /// 8 | public partial class App : Application 9 | { 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /LaMulana2Randomizer/UI/MainWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | 3 | namespace LaMulana2Randomizer.UI 4 | { 5 | public partial class MainWindow : Window 6 | { 7 | public MainWindow() 8 | { 9 | InitializeComponent(); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Assembly-CSharp/Patches/TrapFloor.cs: -------------------------------------------------------------------------------- 1 | using MonoMod; 2 | 3 | namespace LM2RandomiserMod.Patches 4 | { 5 | [MonoModPatch("global::TrapFloor")] 6 | public class patched_TrapFloor : global::TrapFloor 7 | { 8 | public float whalf; 9 | public float width; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /LaMulana2Randomizer/App.xaml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /LaMulana2Randomizer/Utils/Shuffle.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace LaMulana2Randomizer.Utils 5 | { 6 | public abstract class Shuffle 7 | { 8 | public static List FisherYates(List list, Random random) 9 | { 10 | int max = list.Count; 11 | for (int i = 0; i < max; i++) 12 | { 13 | int r = i + random.Next(max - i); 14 | T temp = list[r]; 15 | list[r] = list[i]; 16 | list[i] = temp; 17 | } 18 | return list; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /LaMulana2Randomizer/Extensions/StringExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace LaMulana2Randomizer.ExtensionMethods 5 | { 6 | public static class StringExtensions 7 | { 8 | public static string RemoveWhitespace(this string str) 9 | { 10 | return string.Join("", str.Split(default(string[]), StringSplitOptions.RemoveEmptyEntries)); 11 | } 12 | 13 | public static IEnumerable Chunk(this string str, int chunkSize) 14 | { 15 | for (int i = 0; i < str.Length; i += chunkSize) 16 | yield return str.Substring(i, Math.Min(chunkSize, str.Length - i)); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /LaMulana2Randomizer/RandomiserException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace LaMulana2Randomizer 4 | { 5 | public class RandomiserException : Exception 6 | { 7 | public RandomiserException(string message) : base(message) { } 8 | } 9 | 10 | public class LogicParsingExcpetion : RandomiserException 11 | { 12 | public LogicParsingExcpetion(string message) : base(message) { } 13 | } 14 | 15 | public class InvalidLocationException : RandomiserException 16 | { 17 | public InvalidLocationException(string message) : base(message) { } 18 | } 19 | 20 | public class InvalidAreaException : RandomiserException 21 | { 22 | public InvalidAreaException(string message) : base(message) { } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /LaMulana2Randomizer/BindableBase.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | using System.Runtime.CompilerServices; 3 | 4 | namespace LaMulana2Randomizer 5 | { 6 | public abstract class BindableBase : INotifyPropertyChanged 7 | { 8 | public event PropertyChangedEventHandler PropertyChanged; 9 | 10 | protected virtual void RaisePropertyChanged([CallerMemberName] string propertyName = null) 11 | { 12 | PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); 13 | } 14 | 15 | protected virtual void Set(ref T field, T value, [CallerMemberName] string propertyName = null) 16 | { 17 | if (Equals(field, value)) return; 18 | 19 | field = value; 20 | RaisePropertyChanged(propertyName); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /LaMulana2Randomizer/UI/EnumBooleanConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Data; 3 | 4 | namespace LaMulana2Randomizer.UI 5 | { 6 | [ValueConversion(typeof(Enum), typeof(bool))] 7 | public class EnumBooleanConverter : IValueConverter 8 | { 9 | public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) 10 | { 11 | if (value == null) 12 | { 13 | return false; 14 | } 15 | return value.Equals(parameter); 16 | } 17 | 18 | public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) 19 | { 20 | return value.Equals(true) ? parameter : Binding.DoNothing; 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /LaMulana2Randomizer/Item.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using LaMulana2RandomizerShared; 3 | 4 | namespace LaMulana2Randomizer 5 | { 6 | public class Item 7 | { 8 | public string Name { get; private set; } 9 | public bool IsRequired { get; private set; } 10 | 11 | [JsonIgnore] 12 | public ItemID ID { get; private set; } 13 | 14 | public int PriceMultiplier; 15 | 16 | [JsonConstructor] 17 | public Item(string name, ItemID id, bool isRequired = false) 18 | { 19 | Name = name; 20 | ID = id; 21 | IsRequired = isRequired; 22 | PriceMultiplier = 10; 23 | } 24 | 25 | public Item DeepCopy() 26 | { 27 | Item result = (Item)MemberwiseClone(); 28 | result.Name = string.Copy(Name); 29 | return result; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /LaMulana2Randomizer/RelayCommand.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Input; 3 | 4 | namespace LaMulana2Randomizer 5 | { 6 | public class RelayCommand : ICommand 7 | { 8 | private readonly Predicate _canExecute; 9 | private readonly Action _execute; 10 | 11 | public RelayCommand(Predicate canExecute, Action execute) 12 | { 13 | _canExecute = canExecute; 14 | _execute = execute; 15 | } 16 | 17 | public event EventHandler CanExecuteChanged { 18 | add { CommandManager.RequerySuggested += value; } 19 | remove { CommandManager.RequerySuggested -= value; } 20 | } 21 | 22 | public bool CanExecute(object parameter) 23 | { 24 | return _canExecute(parameter); 25 | } 26 | 27 | public void Execute(object parameter) 28 | { 29 | _execute(parameter); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /LaMulana2Randomizer/Utils/Logger.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Windows; 4 | 5 | namespace LaMulana2Randomizer.Utils 6 | { 7 | public static class Logger 8 | { 9 | private static StreamWriter sw; 10 | 11 | public static void Log(string message) 12 | { 13 | try 14 | { 15 | if(sw == null) 16 | sw = new StreamWriter("log.txt", true); 17 | 18 | sw.WriteLine(message); 19 | } 20 | catch(Exception ex) 21 | { 22 | MessageBox.Show($"Error with logging, {ex.Message}"); 23 | } 24 | } 25 | 26 | public static void Flush() 27 | { 28 | if (sw != null) 29 | sw.Flush(); 30 | } 31 | 32 | public static void LogAndFlush(string message) 33 | { 34 | Log(message); 35 | Flush(); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /LaMulana2Randomizer/SpoilerLog.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Newtonsoft.Json; 3 | 4 | namespace LaMulana2Randomizer 5 | { 6 | public class SpoilerLog 7 | { 8 | public int Seed; 9 | 10 | [JsonProperty("Settings String")] 11 | public string SettingsString; 12 | 13 | public Settings Settings; 14 | 15 | [JsonProperty("Starting Area")] 16 | public string StartingArea; 17 | 18 | [JsonProperty("Starting Weapon")] 19 | public string StartingWeapon; 20 | 21 | [JsonProperty("Starting Items")] 22 | public List StartingItems; 23 | 24 | [JsonProperty("Cursed Locations")] 25 | public List CursedLocations; 26 | 27 | public SortedList Entrances; 28 | 29 | [JsonProperty("Soul Gates")] 30 | public SortedList> SoulGates; 31 | 32 | public Dictionary Locations; 33 | public Dictionary> Playthrough; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /LaMulana2Randomizer/UI/ProgressDialog.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | using System.Windows; 4 | using System.Windows.Interop; 5 | 6 | namespace LaMulana2Randomizer.UI 7 | { 8 | public partial class ProgressDialog : Window 9 | { 10 | public ProgressDialog() 11 | { 12 | InitializeComponent(); 13 | } 14 | 15 | #region Why can't this just be done in the xaml 16 | private const int GWL_STYLE = -16; 17 | private const int WS_SYSMENU = 0x80000; 18 | 19 | [DllImport("user32.dll", SetLastError = true)] 20 | private static extern int GetWindowLong(IntPtr hWnd, int nIndex); 21 | 22 | [DllImport("user32.dll")] 23 | private static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong); 24 | 25 | private void Window_Loaded(object sender, RoutedEventArgs e) 26 | { 27 | var hwnd = new WindowInteropHelper(this).Handle; 28 | SetWindowLong(hwnd, GWL_STYLE, GetWindowLong(hwnd, GWL_STYLE) & ~WS_SYSMENU); 29 | } 30 | #endregion 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /LaMulana2Randomizer/UI/IntRangRules.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | using System.Windows.Controls; 4 | 5 | namespace LaMulana2Randomizer.UI 6 | { 7 | public class IntRangeRule : ValidationRule 8 | { 9 | public int Min { get; set; } 10 | 11 | public int Max { get; set; } 12 | 13 | public override ValidationResult Validate(object value, CultureInfo cultureInfo) 14 | { 15 | int parameter = 0; 16 | try 17 | { 18 | if (((string)value).Length > 0) 19 | { 20 | parameter = int.Parse((string)value); 21 | } 22 | } 23 | catch (Exception e) 24 | { 25 | return new ValidationResult(false, "Illegal characters or " + e.Message); 26 | } 27 | 28 | if ((parameter < Min) || (parameter > Max)) 29 | { 30 | return new ValidationResult(false, "Please enter value in the range: " + Min + " - " + Max + "."); 31 | } 32 | return new ValidationResult(true, null); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /LaMulana2Randomizer/LogicParsing/Logic.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace LaMulana2Randomizer.LogicParsing 4 | { 5 | public class Logic 6 | { 7 | public LogicType logicType; 8 | public string value; 9 | 10 | public Logic(string logic, string value = null) 11 | { 12 | if(!Enum.TryParse(logic, out logicType)) 13 | throw new InvalidLogicTypeException($"Failed to parse logic type, type of logic \"{logic}\" does not exist."); 14 | 15 | this.value = value; 16 | } 17 | } 18 | 19 | public enum LogicType 20 | { 21 | CanReach, 22 | CanChant, 23 | CanWarp, 24 | CanSpinCorridor, 25 | CanStopTime, 26 | CanSealCorridor, 27 | Has, 28 | CanUse, 29 | MeleeAttack, 30 | HorizontalAttack, 31 | IsDead, 32 | CanKill, 33 | OrbCount, 34 | GuardianKills, 35 | PuzzleFinished, 36 | AnkhCount, 37 | Dissonance, 38 | SkullCount, 39 | Setting, 40 | Glitch, 41 | Start, 42 | True, 43 | False 44 | } 45 | 46 | public class InvalidLogicTypeException : Exception 47 | { 48 | public InvalidLogicTypeException(string message) : base(message) { } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /LaMulana2Randomizer/UI/ProgressDialog.xaml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |