SeveredSteel.asl 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. // autosplitter and layout by nyutie
  2. // first time doin any of this :3_:
  3. state("ThankYouVeryCool-Win64-Shipping", "oldleaderboards steam") {
  4. // float levelTimer: 0x5B0F540, 0x118, 0xB54;
  5. float fullTimer: 0x5B0F540, 0x118, 0xB58;
  6. bool isOnMainMenu: 0x59C7EE0, 0x8D0, 0x0, 0x16B0, 0xD8;
  7. }
  8. state("ThankYouVeryCool-Win64-Shipping", "oldleaderboards epic") {
  9. // float levelTimer: 0x5DC0380, 0x118, 0xB54;
  10. float fullTimer: 0x5DC0380, 0x118, 0xB58;
  11. bool isOnMainMenu: 0x5D52E90, 0x30, 0x60, 0x560, 0x320;
  12. }
  13. state("ThankYouVeryCool-Win64-Shipping", "firefight2 steam patch 1") {
  14. // float levelTimer: 0x5B19140, 0x118, 0xB64;
  15. float fullTimer: 0x5B19140, 0x118, 0xB68;
  16. bool isOnMainMenu: 0x59D1AE0, 0x2190, 0x0, 0xEA0, 0x27C;
  17. }
  18. startup
  19. {
  20. if(timer.CurrentTimingMethod == TimingMethod.RealTime) // copied this from somewhere lmao
  21. {
  22. var timingMessage = MessageBox.Show
  23. (
  24. "This game uses Game Time (time without loads) as the main timing method.\n"+
  25. "LiveSplit is currently set to show Real Time (time INCLUDING loads).\n"+
  26. "Would you like the timing method to be set to Game Time for you?",
  27. vars.aslName+" | LiveSplit",
  28. MessageBoxButtons.YesNo,
  29. MessageBoxIcon.Question
  30. );
  31. if (timingMessage == DialogResult.Yes) timer.CurrentTimingMethod = TimingMethod.GameTime;
  32. }
  33. vars.MapReferences = new List<string>()
  34. {
  35. "/Game/Campaign/Trash/CDA_Trash.CDA_Trash_C",
  36. "/Game/Campaign/TrashDiveTut/CDA_TrashDive.CDA_TrashDive_C",
  37. "/Game/Campaign/AboveTrash/CDA_AboveTrash.CDA_AboveTrash_C",
  38. "/Game/Campaign/Trash_turrets/CDA_Turrets.CDA_Turrets_C",
  39. "/Game/Campaign/trash_combat/CDA_TrashCombat.CDA_TrashCombat_C",
  40. "/Game/Campaign/TrashControlRoom/CDA_WasteManagement.CDA_WasteManagement_C",
  41. "/Game/Campaign/MeatPlant/CDA_RedHouse.CDA_RedHouse_C",
  42. "/Game/Campaign/MeatProc/CDA_RedProc.CDA_RedProc_C",
  43. "/Game/Campaign/HospitlCafe/CDA_Cafeteria.CDA_Cafeteria_C",
  44. "/Game/Campaign/Labs/CDA_Labs.CDA_Labs_C",
  45. "/Game/Campaign/LabBasement/CDA_LabBasement.CDA_LabBasement_C",
  46. "/Game/Campaign/HospitalCare/CDA_CyberHospital.CDA_CyberHospital_C",
  47. "/Game/Campaign/Corridor/CDA_Corridor.CDA_Corridor_C",
  48. "/Game/Campaign/Vents1/CDA_Vents1.CDA_Vents1_C",
  49. "/Game/Campaign/Vents_two/CDA_Vents2.CDA_Vents2_C",
  50. "/Game/Campaign/Oxygenate/CDA_Oxygenate.CDA_Oxygenate_C",
  51. "/Game/Campaign/TrainStation/CDA_SubwayStation.CDA_SubwayStation_C",
  52. "/Game/Campaign/Train0/CDA_Train0.CDA_Train0_C",
  53. "/Game/Campaign/TrainOne/CDA_TrainOne.CDA_TrainOne_C",
  54. "/Game/Campaign/Checkpoint/CDA_Checkoint.CDA_Checkoint_C",
  55. "/Game/Campaign/Intelligence/CDA_Intel.CDA_Intel_C",
  56. "/Game/Campaign/DataPrism/CDA_DataPrism.CDA_DataPrism_C",
  57. "/Game/Campaign/ServerRoom/CDA_Serveroom.CDA_Serveroom_C",
  58. "/Game/Campaign/Armory/CDA_Armory.CDA_Armory_C",
  59. "/Game/Campaign/Prison/CDA_Prison.CDA_Prison_C",
  60. "/Game/Campaign/Vents3/CDA_Vents3.CDA_Vents3_C",
  61. "/Game/Campaign/Anxiety/CDA_Anxiety.CDA_Anxiety_C",
  62. "/Game/Campaign/Reception/CDA_Reception.CDA_Reception_C",
  63. "/Game/Campaign/LowerAdmin/CDA_LowerAdmin.CDA_LowerAdmin_C",
  64. "/Game/Campaign/MiddleAdmin/CDA_MiddleAdmin2.CDA_MiddleAdmin2_C",
  65. "/Game/Campaign/UpperAdmin/CDA_UpperAdmin.CDA_UpperAdmin_C",
  66. "/Game/Campaign/TeleportingLab/CDA_Teleporter.CDA_Teleporter_C",
  67. "/Game/Campaign/Barraks/CDA_Barracks.CDA_Barracks_C",
  68. "/Game/Campaign/Apartments/CDA_Apartments.CDA_Apartments_C",
  69. "/Game/Campaign/Mall/CDA_Mall.CDA_Mall_C",
  70. "/Game/Campaign/Asention/CDA_Asention.CDA_Asention_C",
  71. "/Game/Campaign/GlassMoon/CDA_GlassMoon.CDA_GlassMoon_C",
  72. "/Game/Campaign/Nightclub/CDA_Nightclub.CDA_Nightclub_C",
  73. "/Game/Campaign/ceooffice/CDA_ceooffice.CDA_ceooffice_C",
  74. "/Game/Campaign/Penthouse/CDA_Penthouse.CDA_Penthouse_C",
  75. "/Game/Campaign/Museum1/CDA_Gallery.CDA_Gallery_C",
  76. "/Game/Campaign/Museum/CDA_Museum.CDA_Museum_C",
  77. "/Game/Campaign/Garden/CDA_Garden.CDA_Garden_C",
  78. "/Game/Campaign/Mansion/CDA_Mansion.CDA_Mansion_C",
  79. "/Game/Campaign/TheWall/CDA_TheWall.CDA_TheWall_C",
  80. "/Game/Campaign/Cage/CDA_Cage.CDA_Cage_C",
  81. "/Game/Campaign/Escapism/CDA_Escapism.CDA_Escapism_C"
  82. };
  83. }
  84. init
  85. {
  86. switch ((long)modules.First().ModuleMemorySize) {
  87. case 0x605D000:
  88. version = "oldleaderboards steam";
  89. vars.SaveOffsetPath = new DeepPointer(0x5B0B178, 0x130, 0x38, 0x70, 0x459);
  90. break;
  91. case 0x6380000:
  92. version = "oldleaderboards epic";
  93. vars.SaveOffsetPath = new DeepPointer(0x5DBBFB8, 0x130, 0x38, 0x70, 0x459);
  94. break;
  95. case 0x60B0000:
  96. version = "firefight2 steam patch 1";
  97. vars.SaveOffsetPath = new DeepPointer(0x5B14D78, 0x130, 0x38, 0x70, 0x459);
  98. break;
  99. default:
  100. MessageBox.Show
  101. (
  102. "Unsupported version of the game! If you're on GOG, sorry, I don't have it.\n" +
  103. "If you're on Steam/Epic, I'm probably already working on the update!\n\n" +
  104. "If you have any questions you can find me on the official Greylock Discord server, or the official SS/EPN speedrun Discord server.\n\n" +
  105. "modules.First().BaseAddress: 0x" + modules.First().BaseAddress.ToString("X") + "\n" +
  106. "modules.first().ModuleMemorySize: 0x" + modules.First().ModuleMemorySize.ToString("X") + "\n",
  107. "SS-autosplitter", // caption
  108. MessageBoxButtons.OK,
  109. MessageBoxIcon.Warning
  110. );
  111. return;
  112. }
  113. timer.IsGameTimePaused = false;
  114. vars.CurrentMapIndex = -2;
  115. }
  116. update
  117. {
  118. if (version == "") {
  119. return false; // stops update
  120. }
  121. IntPtr resolvedSavePath = IntPtr.Zero;
  122. vars.SaveOffsetPath.DerefOffsets(game, out resolvedSavePath);
  123. vars.SaveOffset = resolvedSavePath;
  124. IntPtr saveOffset = vars.SaveOffset;
  125. int campaignLevelReferenceStringLength = game.ReadValue<int>(saveOffset + 0x82);
  126. vars.CampaignLevelReferenceString = game.ReadString(saveOffset + 0x82 + 0x4, campaignLevelReferenceStringLength);
  127. }
  128. start
  129. {
  130. if (!current.isOnMainMenu && vars.CampaignLevelReferenceString == vars.MapReferences[0] && current.fullTimer > 0f && old.fullTimer == 0f)
  131. {
  132. vars.CurrentMapIndex = 0;
  133. return true;
  134. }
  135. }
  136. split
  137. {
  138. int nowCurrentMapIndex = vars.MapReferences.IndexOf(vars.CampaignLevelReferenceString);
  139. if (nowCurrentMapIndex == vars.CurrentMapIndex + 1)
  140. {
  141. vars.CurrentMapIndex = nowCurrentMapIndex;
  142. return true;
  143. }
  144. else if (nowCurrentMapIndex == vars.MapReferences.Count - 1 && current.fullTimer == 0f) // last map
  145. {
  146. return true;
  147. }
  148. }
  149. reset
  150. {
  151. if (current.isOnMainMenu)
  152. {
  153. return true;
  154. }
  155. }
  156. isLoading
  157. {
  158. if (!current.isOnMainMenu && current.fullTimer == old.fullTimer)
  159. {
  160. return true;
  161. }
  162. return false;
  163. }
  164. gameTime
  165. {
  166. return TimeSpan.FromSeconds(current.fullTimer != 0f ? current.fullTimer : old.fullTimer);
  167. }
  168. onReset
  169. {
  170. vars.CurrentMapIndex = -2;
  171. }
  172. exit
  173. {
  174. timer.IsGameTimePaused = true;
  175. }