md1_2.lua 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. EntityContainer = {}
  2. EntityContainer[ "Director" ] = {
  3. on_start = function( self )
  4. background2d:autoscroll_to_entity( entity_manager:get_entity( "Cloud" ) )
  5. --0358 (end 0358): [UNREVERSED] BTLMD(20, 00);
  6. --035b (end 035b): music:execute_akao( 10, pointer_to_field_AKAO_0 ); -- play field music
  7. --035d (end 035d): field:map_name(2);
  8. return 0
  9. end,
  10. }
  11. EntityContainer[ "Cloud" ] = {
  12. cloud = nil,
  13. on_start = function( self )
  14. set_entity_to_character( "Cloud", "Cloud" )
  15. self.cloud = entity_manager:get_entity( "Cloud" )
  16. self.cloud:set_solid( true )
  17. self.cloud:set_visible( true )
  18. return 0
  19. end,
  20. }
  21. EntityContainer[ "Biggs" ] = {
  22. biggs = nil,
  23. on_start = function( self )
  24. self.biggs = entity_manager:get_entity( "Biggs" )
  25. self.biggs:set_position( 26.8516, 246.281, 5.01562 )
  26. self.biggs:set_solid( false )
  27. if FFVII.Data.progress_game < 8 then
  28. self.biggs:set_visible( true )
  29. self.biggs:set_move_auto_speed( 3.75 )
  30. self.biggs:move_to_position( 28.4844, 243.898 )
  31. self.biggs:move_sync()
  32. -- this needs to be called after some sync because other entity check this in on_start too.
  33. FFVII.Data.progress_game = 8
  34. self.biggs:play_animation( "LookAround" )
  35. self.biggs:animation_sync()
  36. self.biggs:move_to_position( 33.4141, 244.211 )
  37. self.biggs:move_sync()
  38. self.biggs:move_to_position( 34.0938, 250.406 )
  39. self.biggs:move_sync()
  40. self.biggs:move_to_position( 26.4141, 252.445 )
  41. self.biggs:move_sync()
  42. self.biggs:move_to_position( 23.5156, 252.734 )
  43. self.biggs:move_sync()
  44. end
  45. self.biggs:set_visible( false )
  46. return 0
  47. end,
  48. }
  49. EntityContainer[ "Jessie" ] = {
  50. jessie = nil,
  51. on_start = function( self )
  52. self.jessie = entity_manager:get_entity( "Jessie" )
  53. self.jessie:set_default_animation( "LookAround" )
  54. self.jessie:play_animation( "LookAround" )
  55. self.jessie:set_move_auto_speed( 3.75 )
  56. self.jessie:set_rotation( 354.375 )
  57. self.jessie:set_position( 27.9219, 253.773, 4.96875 )
  58. self.jessie:set_solid( false )
  59. if FFVII.Data.progress_game < 8 then
  60. self.jessie:set_visible( true )
  61. script:wait( 8.5 )
  62. self.jessie:move_to_position( 26.4141, 252.445 )
  63. self.jessie:move_sync()
  64. self.jessie:move_to_position( 23.5156, 252.734 )
  65. self.jessie:move_sync()
  66. end
  67. self.jessie:set_visible( false )
  68. return 0
  69. end,
  70. }
  71. EntityContainer[ "Wedge" ] = {
  72. wedge = nil,
  73. on_start = function( self )
  74. self.wedge = entity_manager:get_entity( "Wedge" )
  75. self.wedge:set_default_animation( "LookAround" )
  76. self.wedge:play_animation( "LookAround" )
  77. self.wedge:set_move_auto_speed( 3.75 )
  78. self.wedge:set_rotation( 354.375 )
  79. self.wedge:set_position( 34.0312, 247.484, 5.09375 )
  80. self.wedge:set_solid( false )
  81. if FFVII.Data.progress_game < 8 then
  82. self.wedge:set_visible( true )
  83. script:wait( 4.26667 )
  84. self.wedge:move_to_position( 33.6875, 250.664 )
  85. self.wedge:move_sync()
  86. self.wedge:move_to_position( 26.4141, 252.445 )
  87. self.wedge:move_sync()
  88. self.wedge:move_to_position( 23.5156, 252.734 )
  89. self.wedge:move_sync()
  90. end
  91. self.wedge:set_visible( false )
  92. return 0
  93. end,
  94. }
  95. EntityContainer[ "BackgroundLight0" ] = {
  96. on_start = function( self )
  97. background2d:play_animation_looped( "Light0" )
  98. return 0
  99. end,
  100. }
  101. EntityContainer[ "BackgroundLight1" ] = {
  102. on_start = function( self )
  103. script:wait( 0.133333 )
  104. background2d:play_animation_looped( "Light1" )
  105. return 0
  106. end,
  107. }
  108. EntityContainer[ "BackgroundLight2" ] = {
  109. on_start = function( self )
  110. while true do
  111. local number = math.random( 1, 3 )
  112. background2d:play_animation_once( "Light2_" .. number )
  113. background2d:animation_sync( "Light2_" .. number )
  114. end
  115. return 0
  116. end,
  117. }
  118. EntityContainer[ "BackgroundWarning" ] = {
  119. on_start = function( self )
  120. local temp5_27 = 0;
  121. while true do
  122. if temp5_27 > 2 then
  123. temp5_27 = 0
  124. end
  125. local number = math.random( 0, 3 )
  126. if number == 0 then
  127. number = 1
  128. end
  129. for v = 0, number, 1 do
  130. background2d:play_animation_once( "Warning" .. temp5_27 .. "Zizizi" )
  131. background2d:animation_sync( "Warning" .. temp5_27 .. "Zizizi" )
  132. end
  133. background2d:play_animation_once( "Warning" .. temp5_27 .. "Light" )
  134. background2d:animation_sync( "Warning" .. temp5_27 .. "Light" )
  135. script:wait( 0.0333333 )
  136. background2d:play_animation_once( "Warning" .. temp5_27 .. "Light" )
  137. background2d:animation_sync( "Warning" .. temp5_27 .. "Light" )
  138. script:wait( 0.0333333 )
  139. background2d:play_animation_once( "Warning" .. temp5_27 .. "Light" )
  140. background2d:animation_sync( "Warning" .. temp5_27 .. "Light" )
  141. background2d:play_animation_once( "WarningBlank" )
  142. background2d:animation_sync( "WarningBlank" )
  143. script:wait( 0.0333333 )
  144. temp5_27 = temp5_27 + 1
  145. end
  146. return 0
  147. end,
  148. }
  149. EntityContainer[ "Gateway0" ] = {
  150. on_start = function( self )
  151. return 0
  152. end,
  153. on_enter_line = function( self, entity )
  154. return 0
  155. end,
  156. on_move_to_line = function( self, entity )
  157. return 0
  158. end,
  159. on_cross_line = function( self, entity )
  160. if entity == "Cloud" then
  161. load_field_map_request( "ffvii_md1_1", "Spawn_md1_2" )
  162. end
  163. return 0
  164. end,
  165. on_leave_line = function( self, entity )
  166. return 0
  167. end,
  168. }
  169. EntityContainer[ "Gateway1" ] = {
  170. on_start = function( self )
  171. return 0
  172. end,
  173. on_enter_line = function( self, entity )
  174. return 0
  175. end,
  176. on_move_to_line = function( self, entity )
  177. return 0
  178. end,
  179. on_cross_line = function( self, entity )
  180. if entity == "Cloud" then
  181. load_field_map_request( "ffvii_nrthmk", "Spawn_md1_2" )
  182. end
  183. return 0
  184. end,
  185. on_leave_line = function( self, entity )
  186. return 0
  187. end,
  188. }