GhostWireTokyo.asl 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. /*state("GWT", "1.02")
  2. {
  3. // flips between 1 in game and 2 on loads
  4. int loadingNormal : 0x55211C0;
  5. // 0 in game & 112 while Fast Travelling as well as a couple specific cutscene - these cutscenes are now removed on purpose since this issue wasn't discovered for a couple months.
  6. int loadingFT : 0x57077D8;
  7. string300 CurTextString : 0x057665F8, 0xC0, 0X28, 0X0;
  8. }
  9. */
  10. state("GWT")
  11. {
  12. int loadingNormal : 0x5411388;
  13. int loadingFT : 0x570F818;
  14. string300 CurTextString : 0x0576E640, 0xC0, 0X28, 0X0;
  15. }
  16. init
  17. {
  18. vars.doneMaps = new List<string>();
  19. vars.allObjs = new List<string>();
  20. vars.DoSplit = false;
  21. // Basically finding and naming the exe we want to target as I understand it
  22. switch(modules.First().ModuleMemorySize)
  23. {
  24. case 688128 :
  25. version = "wrongEXE";
  26. break;
  27. }
  28. // Now using the exe we found earlier, we can tell livesplit to leave it alone and find the correct exe we want to read from
  29. if (version == "wrongEXE")
  30. {
  31. var allComponents = timer.Layout.Components;
  32. // Grab the autosplitter from splits
  33. if (timer.Run.AutoSplitter != null && timer.Run.AutoSplitter.Component != null)
  34. {
  35. allComponents = allComponents.Append(timer.Run.AutoSplitter.Component);
  36. }
  37. foreach (var component in allComponents)
  38. {
  39. var type = component.GetType();
  40. if (type.Name == "ASLComponent")
  41. {
  42. // Could also check script path, but renaming the script breaks that, and
  43. // running multiple autosplitters at once is already just asking for problems
  44. var script = type.GetProperty("Script").GetValue(component);
  45. script.GetType().GetField(
  46. "_game",
  47. BindingFlags.NonPublic | BindingFlags.Instance
  48. ).SetValue(script, null);
  49. }
  50. }
  51. return;
  52. }
  53. }
  54. startup
  55. {
  56. refreshRate = 30;
  57. settings.Add("GT", true, "Ghostwire: Tokyo");
  58. settings.Add("CH1", true, "Chapter 1: Beginnings", "GT");
  59. settings.Add("COS", true, "City of Shadows", "CH1");
  60. settings.Add("Chapter 2: Trouble", true, "Chapter 2: Trouble", "GT");
  61. settings.Add("K.K", true, "KK", "Chapter 2: Trouble");
  62. settings.Add("CTF", true, "Clearing the Fog", "Chapter 2: Trouble");
  63. settings.Add("AMOFD", true, "A Maze of Death", "Chapter 2: Trouble");
  64. settings.Add("TBL", true, "The Buried Life", "Chapter 2: Trouble");
  65. settings.Add("TCOS", true, "The Caves of Steel", "Chapter 2: Trouble");
  66. settings.Add("Chapter 3: Connection", true, "Chapter 3: Connection", "GT");
  67. settings.Add("POL", true, "Pillar of Light", "Chapter 3: Connection");
  68. settings.Add("B", true, "Blindness", "Chapter 3: Connection");
  69. settings.Add("AG", true, "Agony", "Chapter 3: Connection");
  70. settings.Add("Chapter 4: Contortion", true, "Chapter 4: Contortion", "GT");
  71. settings.Add("G", true, "Giants", "Chapter 4: Contortion");
  72. settings.Add("TBT", true, "The Black Tower", "Chapter 4: Contortion");
  73. settings.Add("Chapter 5: Severance", true, "Chapter 5: Severance", "GT");
  74. settings.Add("F", true, "Family", "Chapter 5: Severance");
  75. settings.Add("TT", true, "Tokyo Tower", "Chapter 5: Severance");
  76. settings.Add("Chapter 6: Binding", true, "Chapter 6: Binding", "GT");
  77. settings.Add("M", true, "Mari", "Chapter 6: Binding");
  78. settings.Add("GTTU", true, "Gate to the Underworld", "Chapter 6: Binding");
  79. settings.Add("Far", true, "Farewells", "Chapter 6: Binding");
  80. settings.Add("In memory of Robert Altman", true, "End split", "GT");
  81. var tB = (Func<string, string, string, Tuple<string, string, string>>) ((elmt1, elmt2, elmt3) => { return Tuple.Create(elmt1, elmt2, elmt3); });
  82. var sB = new List<Tuple<string, string, string>>
  83. {
  84. /* tB("TV","Defeat all enemies","Defeat all enemies & Unleash an attack"),
  85. tB("TV","Block an enemy attack","Block an enemy attack"),
  86. tB("TV","Get to the hospital","Get to the hospital"),
  87. tB("COS","Get to Mari's room","Get to Mari's room"),
  88. tB("COS","Eliminate the enemies","Eliminate the enemies"),
  89. tB("COS","Hit an enemy with a charge attack","Hit an enemy with a charge attack"), */
  90. tB("COS","Grab the enemy's core","Grab the enemy's core"),
  91. /* tB("COS","Leave the hospital","Leave the hospital"),
  92. tB("K.K","Head to Yugenzaka","Head to Yugenzaka"),
  93. tB("K.K","Examine the torii gate", "Examine the torii gate"), */
  94. tB("K.K","Search the shrine","Search the shrine"),
  95. /* tB("K.K","Save the spirits","Save the spirits"),
  96. tB("K.K","Hold a katashiro out to the spirits","old a katashiro out to the spirits"),
  97. tB("K.K","Find a phone booth","Find a phone booth"),
  98. tB("K.K","Remove the seal on the door","Remove the seal on the door"), */
  99. tB("K.K","Enter the apartment","Enter the apartment"),
  100. /* tB("CTF","Search the apartment","Search the apartment"),
  101. tB("CTF","Head outside","Head outside"),
  102. tB("CTF","Find and destroy the barrier's source","Find and destroy the barrier's source"),
  103. tB("CTF","Find the source of the barrier","Find the source of the barrier"), */
  104. tB("CTF","Use your Spectral Vision to search the area","Use your Spectral Vision to search the area"),
  105. /*tB("CTF","Follow the trail","Follow the trail"),
  106. tB("CTF","Find a way to purge the corruption","Find a way to purge the corruption"),
  107. tB("CTF","Destroy the heard of corruption","Destroy the heard of corruption"),
  108. tB("CTF","Search the area","Search the area"),
  109. tB("AMOFD","Make your way to Shiroyama Shrine","Make your way to Shiroyama Shrine"), //A Maze of Death */
  110. tB("AMOFD","Cleanse Shiroyama Shrine","Cleanse Shiroyama Shrine"),
  111. tB("AMOFD","Look for something useful at the shrine","Look for something useful at the shrine"),
  112. // tB("AMOFD","Head for the Kagerie observation deck","Head for the Kagerie observation deck"),
  113. tB("AMOFD","Use the tourist binoculars to search the area","Use the tourist binoculars to search the area"),
  114. /* tB("AMOFD","Head to the Shibuya underground","Head to the Shibuya underground"),
  115. tB("TBL","Investigate the surrounding area with Spectral Vision","Investigate the surrounding area with Spectral Vision"), // The Buried Life
  116. tB("TBL","Head deeper underground","Head deeper underground"), */
  117. tB("TBL","Defeat Yaseotoko","Defeat Yaseotoko"),
  118. tB("TBL","Get back to the surface","Get back to the surface"),
  119. tB("TCOS","Get back to KK's safehouse","Get back to KK's safehouse"), // The Caves of Steel
  120. /* tB("TCOS","Follow KK's trail","Follow KK's trail"),
  121. tB("TCOS","Make your way to the heart of Hirokawa Shrine","Make your way to the heart of Hirokawa Shrine"),
  122. tB("TCOS","Defeat the enemies","Defeat the enemies"),
  123. tB("POL","Head toward the pillar of light","Head toward the pillar of light"), //Pillar of Light */
  124. tB("POL","Head for the Sengoku Center Building","Head for the Sengoku Center Building"),
  125. /* tB("POL","Search the area for clues with Spectral Vision","Search the area for clues with Spectral Vision"),
  126. tB("POL","Follow the psychic trail","Follow the psychic trail"),
  127. tB("POL","Find another way inside","Find another way inside"),
  128. tB("POL","Search for Rinko","Search for Rinko"),
  129. tB("POL","Find a way to open the shutter","Find a way to open the shutter"),
  130. tB("POL","Find the control panel to open the shutter","Find the control panel to open the shutter"), */
  131. tB("POL","Protect Rinko","Protect Rinko"),
  132. tB("B","Find the torii gate","Find the torii gate"), //Blindness
  133. /* tB("B","Cleanse the torii gate","Cleanse the torii gate"),
  134. tB("B","Find and destroy the barrier stones","Find and destroy the barrier stones"),
  135. tB("B","Find the payphone","Find the payphone"),
  136. tB("B","Find a telephone card","Find a telephone card"),
  137. tB("B","Contact Ed","Contact Ed"),
  138. tB("B","Find the parking lot near Jizo Street","Find the parking lot near Jizo Street"), */
  139. tB("B","Head for the rental locker","Head for the rental locker"),
  140. /* tB("B","Search the locker","Search the locker"),
  141. tB("B","Head to the Kirigaoka apartment block","Head to the Kirigaoka apartment block"),*/
  142. tB("B","Go outside","Go outside"),
  143. /* tB("B","Follow Rinko","Follow Rinko"),
  144. tB("B","Check out the park","Check out the park"),
  145. tB("B","Examine the payphone","Examine the payphone"),
  146. tB("AG","Go to the pillar of light's heart","Go to the pillar of light's heart"), //AG
  147. tB("AG","Go to the wayside shrine","Go to the wayside shrine"),
  148. tB("AG","Enter the wayside shrine","Enter the wayside shrine"),
  149. tB("AG","Go deeper inside","Go deeper inside"), */
  150. tB("AG","Defeat Ko-omote","Defeat Ko-omote"),
  151. /* tB("G","Check the payphone","Check the payphone"), //Giants
  152. tB("G","Cleanse the revealed torii gates","Cleanse the revealed torii gates"), */
  153. tB("G","Follow KK's lead","Follow KK's lead"),
  154. tB("G","Head to the basement","Head to the basement"),
  155. // tB("TBT","Get to the roof of the Mitake Real Estate Building","Get to the roof of the Mitake Real Estate Building"), //The Black Tower
  156. //tB("TBT","Locate some gasoline and a turbine wheel","Locate some gasoline, a turbine wheel, and fragrant underworld oil"),
  157. tB("TBT","Find some gasoline and a turbine wheel","Find some gasoline, a turbine wheel, and a turbine wheel"),
  158. tB("TBT","Go back to the garage","Go back to the garage"),
  159. /* tB("TBT","Repair the motorcycle","Repair the motorcycle"),
  160. tB("TBT","Get on the motorcycle","Get on the motorcycle"),
  161. tB("F","Head for Tokyo Tower","Head for Tokyo Tower"), //Family */
  162. tB("F","Defeat Okina","Defeat Okina"),
  163. tB("TT","Head upward","Head upward"), // Tokyo Tower
  164. tB("TT","DY","Defeat Yaseotoko"),
  165. //tB("M","Press onward","Press onward"), //Mari
  166. tB("GTTU","Defeat the amalgamation","Defeat the amalgamation"), //Gate to the underworld
  167. tB("Far","Keep moving forward","Keep moving forward"), //Farewells
  168. };
  169. foreach (var s in sB) settings.Add(s.Item2, true, s.Item3, s.Item1);
  170. // Checks if the current comparison is set to Real Time
  171. // Asks user to change to Game Time if LiveSplit is currently set to Real Time.
  172. if (timer.CurrentTimingMethod == TimingMethod.RealTime)
  173. {
  174. var timingMessage = MessageBox.Show (
  175. "This game uses Time without Loads (Game Time) as the main timing method.\n"+
  176. "LiveSplit is currently set to show Real Time (RTA).\n"+
  177. "Would you like to set the timing method to Game Time?",
  178. "LiveSplit | Ghostwire: Tokyo",
  179. MessageBoxButtons.YesNo, MessageBoxIcon.Question
  180. );
  181. if (timingMessage == DialogResult.Yes)
  182. timer.CurrentTimingMethod = TimingMethod.GameTime;
  183. }
  184. }
  185. update
  186. {
  187. if (!vars.allObjs.Contains(current.CurTextString))
  188. {
  189. vars.allObjs.Add(current.CurTextString);
  190. }
  191. if ((vars.DoSplit == false) && (settings["DY"]) && (vars.allObjs.Contains("Head upward") && (current.CurTextString == "Head upward")))
  192. {
  193. vars.DoSplit = true;
  194. }
  195. }
  196. start
  197. {
  198. return (current.CurTextString == "Chapter 1: Beginnings");
  199. }
  200. onStart
  201. {
  202. // This is part of a "cycle fix", makes sure the timer always starts at 0.00
  203. timer.IsGameTimePaused = true;
  204. }
  205. onReset
  206. {
  207. vars.doneMaps.Clear();
  208. vars.allObjs.Clear();
  209. vars.DoSplit = false;
  210. }
  211. split
  212. {
  213. if ((settings[current.CurTextString]) && (current.CurTextString != old.CurTextString) && (!vars.doneMaps.Contains(current.CurTextString)) || ((vars.DoSplit == true) && (settings["DY"]) && (current.CurTextString == "Defeat Yaseotoko")))
  214. {
  215. vars.doneMaps.Add(current.CurTextString);
  216. vars.DoSplit = false;
  217. return true;
  218. }
  219. }
  220. isLoading
  221. {
  222. return current.loadingNormal == 2 || current.loadingFT == 112;
  223. }
  224. exit
  225. {
  226. timer.IsGameTimePaused = true;
  227. }