Metro2033Redux.asl 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. /*
  2. This is the coolest ASL I've ever made, it works for both metro 2033 and metro last light for each launcher
  3. */
  4. state("metro", "Steam")
  5. {
  6. int Loader : 0xCFAC30; // 1 loading / 0 not loading
  7. int Splitter : 0xD23810;
  8. }
  9. state("metro", "Epic")
  10. {
  11. int Loader : 0xCD6690; // 1 loading / 0 not loading
  12. int Splitter : 0xD15790;
  13. }
  14. state("metro", "GoG") // This isn't needed as I could just set the gog version to the steam one, but I'd like to keep them seperate still
  15. {
  16. int Loader : 0xCFAC30;
  17. int Splitter : 0xD23810;
  18. }
  19. init
  20. {
  21. switch (modules.First().ModuleMemorySize) { // This is to know what version you are playing on
  22. case 20750336: version = "Steam";
  23. break;
  24. case 19550208: version = "Epic";
  25. break;
  26. case 20283392: version = "GoG";
  27. break;
  28. default: version = "";
  29. break;
  30. }
  31. vars.doneMaps = new List<string>();
  32. }
  33. startup
  34. {
  35. settings.Add("2033", true, "All Chapters Metro 2033");
  36. settings.Add("Light", true, "Main Story Metro Last Light");
  37. settings.Add("LightNM", true, "New Missions Metro Last Light");
  38. var tB = (Func<string, string, string, Tuple<string, string, string>>) ((elmt1, elmt2, elmt3) => { return Tuple.Create(elmt1, elmt2, elmt3); });
  39. var sB = new List<Tuple<string, string, string>>
  40. {
  41. tB("2033","13613070", "Tower"),
  42. tB("2033","11364390", "Hunter"),
  43. tB("2033","12111516","Exhibition"),
  44. tB("2033","23459760","Chase"),
  45. tB("2033","7555304","Riga"),
  46. tB("2033","43309382","Lost Tunnel"),
  47. tB("2033","5055304","Market"),
  48. tB("2033","17551496","Dead City"),
  49. tB("2033","11632932","Dry"),
  50. tB("2033","42393914","Ghosts"),
  51. tB("2033","24570920","Cursed"),
  52. tB("2033","22705244","Armory"),
  53. tB("2033","20191422","Front Line"),
  54. tB("2033","25020278","Trolley Combat"),
  55. tB("2033","28304314","Depot"),
  56. tB("2033","46971900","Defense"),
  57. tB("2033","18233862","Outpost"),
  58. tB("2033","25194692","Black Station"),
  59. tB("2033","12945624","Polis"),
  60. tB("2033","15794468","Alley"),
  61. tB("2033","15579794","Depository"),
  62. tB("2033","8224820","Archives"),
  63. tB("2033","14964468","Church"),
  64. tB("2033","21847646","Dark Star"),
  65. tB("2033","24894220","Cave"),
  66. tB("2033","27371888","D6"),
  67. tB("2033","40533228","Tower tB(2)"),
  68. tB("Light","10156116","Sparta"),
  69. tB("Light","10825266","Ashes"),
  70. tB("Light","1070380","Pavel"),
  71. tB("Light","4115038","Reich"),
  72. tB("Light","7994250","Seperation"),
  73. tB("Light","7519198","Facility"),
  74. tB("Light","25987280","Torchlight"),
  75. tB("Light","9097920","Echoes"),
  76. tB("Light","9156618","Bolshoi"),
  77. tB("Light","2142010","Korbut"),
  78. tB("Light","13314050","Revolution"),
  79. tB("Light","8270544","Regina"),
  80. tB("Light","11343060","Bandits"),
  81. tB("Light","15610894","Dark Water"),
  82. tB("Light","4525036","Venice"),
  83. tB("Light","11142052","Sundown"),
  84. tB("Light","11910180","Nightfall"),
  85. tB("Light","17885320","Undercity"),
  86. tB("Light","15690530","Contagion"),
  87. tB("Light","8137878","Quaratine"),
  88. tB("Light","11073562","Khane"),
  89. tB("Light","12986928","The Chase"),
  90. tB("Light","11808914","The Crossing"),
  91. tB("Light","12119850","Bridge"),
  92. tB("Light","10080826","Depot"),
  93. tB("Light","13882126","The Dead City"),
  94. tB("Light","15135450","Red Square"),
  95. tB("Light","9863802","The Garden"),
  96. tB("Light","4239678","Polis"),
  97. tB("Light","4005458","D6"),
  98. tB("LightNM","1948462","Heavy Squad"),
  99. tB("LightNM","8659570","Kshatriya"),
  100. tB("LightNM","12786154","Sniper Team"),
  101. tB("LightNM","4461344","Tower Pack"),
  102. tB("LightNM","11236060","spider Lair"),
  103. tB("LightNM","11230334","Pavel"),
  104. tB("LightNM","5808252","Khan"),
  105. tB("LightNM","6718786","Anna"),
  106. };
  107. foreach (var s in sB) settings.Add(s.Item2, true, s.Item3, s.Item1);
  108. if (timer.CurrentTimingMethod == TimingMethod.RealTime) // stolen from dude simulator 3, basically asks the runner to set their livesplit to game time
  109. {
  110. var timingMessage = MessageBox.Show (
  111. "This game uses Time without Loads (Game Time) as the main timing method.\n"+
  112. "LiveSplit is currently set to show Real Time (RTA).\n"+
  113. "Would you like to set the timing method to Game Time? This will make verification easier",
  114. "LiveSplit | Metro Redux",
  115. MessageBoxButtons.YesNo,MessageBoxIcon.Question
  116. );
  117. if (timingMessage == DialogResult.Yes)
  118. {
  119. timer.CurrentTimingMethod = TimingMethod.GameTime;
  120. }
  121. }
  122. }
  123. start
  124. {
  125. return ((old.Loader == 1) && (current.Loader == 0) && (settings[current.Splitter.ToString()]));
  126. }
  127. onStart
  128. {
  129. vars.doneMaps.Clear(); // Needed because checkpoints bad in game
  130. vars.doneMaps.Add(current.Splitter.ToString()); // Adding for the starting map because it's also bad
  131. }
  132. split
  133. {
  134. if (settings[current.Splitter.ToString()] && (current.Loader != 0) && (!vars.doneMaps.Contains(current.Splitter.ToString())))
  135. {
  136. vars.doneMaps.Add(current.Splitter.ToString());
  137. return true;
  138. }
  139. }
  140. isLoading
  141. {
  142. return (current.Loader == 1);
  143. }