./cutscene_effects.lua

  1. ------------------------------------------------------------------------------ 
  2. -- Screen to handle cutscene effects 
  3. ------------------------------------------------------------------------------ 
  4.  
  5. local Cutscene_peg_loaded 				= false 
  6. local Starburst_grp 						= -1 
  7. local Starburst_anim 					= -1 
  8. local Fan_grp								= -1 
  9. local Bg_saints_grp						= -1 
  10. local Bg_saints_anim						= -1 
  11. local Kanji_grp							= -1 
  12. local Kanji_anim							= -1 
  13. local Purple_glow_grp					= -1 
  14. local Purple_glow_anim					= -1 
  15. local White_fade_grp						= -1 
  16. local White_fade_in_anim				= -1 
  17.  
  18. local Cutscene_effects_doc_handle 	= -1 
  19.  
  20. local FAN_X = 640 
  21. local FAN_Y = 360 
  22.  
  23. function cutscene_effects_init() 
  24. 	Cutscene_effects_doc_handle = vint_document_find("cutscene_effects") 
  25. 	 
  26. 	pause_map_dump()	 
  27. 	 
  28. 	-- Delay loading new peg until pause map is fully dumped. 
  29. 	thread_new("cutscene_effects_peg_delay_load") 
  30.  
  31. 	Starburst_grp = Vdo_base_object:new("starburst_grp", 0 , Cutscene_effects_doc_handle) 
  32. 	Bg_saints_grp = Vdo_base_object:new("crib_bg_grp", 0 , Cutscene_effects_doc_handle) 
  33. 	Fan_grp = Vdo_base_object:new("fan_grp", 0 , Cutscene_effects_doc_handle) 
  34. 	Kanji_grp = Vdo_base_object:new("kanji_grp", 0 , Cutscene_effects_doc_handle) 
  35. 	Purple_glow_grp = Vdo_base_object:new("purple_glow_grp", 0 , Cutscene_effects_doc_handle) 
  36. 	White_fade_grp = Vdo_base_object:new("white_fade_grp", 0 , Cutscene_effects_doc_handle) 
  37. 	 
  38. 	Starburst_anim = Vdo_anim_object:new("starburst_anim", 0, Cutscene_effects_doc_handle) 
  39. 	Bg_saints_anim = Vdo_anim_object:new("crib_bg_loop_anim", 0, Cutscene_effects_doc_handle) 
  40. 	Kanji_anim = Vdo_anim_object:new("kanji_anim", 0, Cutscene_effects_doc_handle) 
  41. 	Purple_glow_anim = Vdo_anim_object:new("purple_glow_anim", 0, Cutscene_effects_doc_handle) 
  42. 	White_fade_in_anim = Vdo_anim_object:new("white_fade_in_anim", 0, Cutscene_effects_doc_handle) 
  43. 	 
  44. 	Starburst_grp:set_visible(false) 
  45. 	Bg_saints_grp:set_visible(false)	 
  46. 	Kanji_grp:set_visible(false)	 
  47. 	Purple_glow_grp:set_visible(false)	 
  48. 	White_fade_grp:set_visible(false) 
  49. 	 
  50. 	local disclaimer_txt = Vdo_base_object:new("disclaimer_txt", 0, Cutscene_effects_doc_handle) 
  51. 	disclaimer_txt:set_text("CUTSCENE01_PROHIBITED") 
  52. 	 
  53. end 
  54.  
  55. ------------------------------------------------------------------------------ 
  56. -- Peg load functions 
  57. ------------------------------------------------------------------------------ 
  58.  
  59. function cutscene_effects_peg_delay_load() 
  60. 	delay(2) 
  61. 	cutscene_effects_peg_load() 
  62. end 
  63.  
  64. function cutscene_effects_peg_load() 
  65. 	game_peg_load_with_cb("cutscene_effects_peg_load_complete", 1, "ui_bms_cutscene_01") 
  66. end 
  67.  
  68. function cutscene_effects_peg_load_complete() 
  69. 	--JM: This might not be necessary because we know we don't have to show images for the first ~2 frames 
  70. 	Cutscene_peg_loaded = true 
  71. end 
  72.  
  73. function cutscene_effects_cleanup() 
  74. 	game_peg_unload("ui_bms_cutscene_01") 
  75. end 
  76.  
  77. ------------------------------------------------------------------------------ 
  78. -- Shot specific functions 
  79. ------------------------------------------------------------------------------ 
  80. function cutscene_effects_shot_1()	 
  81. 	White_fade_grp:set_visible(false) 
  82. 	if Hud_msg_doc ~= nil or Hud_msg_doc ~= 0 then 
  83. 		hud_msg_subtitle_top() 
  84. 	end 
  85. end 
  86.  
  87. function cutscene_effects_shot_2()	 
  88. 	White_fade_grp:set_visible(true) 
  89. 	White_fade_in_anim:play(0) 
  90. 	if Hud_msg_doc ~= nil or Hud_msg_doc ~= 0 then 
  91. 		hud_msg_subtitle_bottom() 
  92. 	end 
  93. end 
  94.  
  95. function cutscene_effects_shot_3()	 
  96. 	White_fade_grp:set_visible(false) 
  97. end 
  98.  
  99. function cutscene_effects_shot_6()	 
  100. 	Starburst_grp:set_visible(false) 
  101. 	Bg_saints_grp:set_visible(false) 
  102. end 
  103.  
  104. function cutscene_effects_shot_7() 
  105. 	Fan_grp:set_anchor(FAN_X, FAN_Y) 
  106. 	Starburst_grp:set_visible(true) 
  107. 	Bg_saints_grp:set_visible(true) 
  108. 	Starburst_anim:play(0)	 
  109. 	Bg_saints_anim:play(0) 
  110. 	 
  111. 	Purple_glow_grp:set_visible(false) 
  112. end 
  113.  
  114. function cutscene_effects_shot_8() 
  115. 	-- Clone fleur outline animation and object. Then Retarget and store handles for later... 
  116. 	local fleur_outline = Vdo_anim_object:new("fleur_outline", 0 , Cutscene_effects_doc_handle) 
  117. 	local fleur_outline_anim = Vdo_anim_object:new("fleur_outline_zoom_anim", 0 , Cutscene_effects_doc_handle) 
  118. 	local fluer_outline_anims = {} 
  119. 	 
  120. 	for index = 1, 5 do 
  121. 		local fleur_outline_clone = Vdo_base_object:clone(fleur_outline.handle) 
  122. 		local anim = Vdo_anim_object:clone(fleur_outline_anim.handle) 
  123. 		anim:set_target_handle(fleur_outline_clone.handle) 
  124. 		anim:stop() 
  125. 		fluer_outline_anims[index] = anim  
  126. 	end 
  127. 		 
  128. 	fleur_outline_anim:play() 
  129. 	 
  130. 	--Play Fleur outline animation... 
  131. 	for index = 1, 5 do 
  132. 		fluer_outline_anims[index]:play(index * .125) 
  133. 	end	 
  134. 	 
  135. 	Purple_glow_anim:play(0) 
  136. 	 
  137. 	Purple_glow_grp:set_visible(true) 
  138. end 
  139.  
  140. function cutscene_effects_shot_9() 
  141. 	Purple_glow_grp:set_visible(false) 
  142. 	Starburst_grp:set_visible(false) 
  143. 	Bg_saints_grp:set_visible(false) 
  144. 	Starburst_anim:set_property("is_paused", true)	 
  145. 	Bg_saints_anim:set_property("is_paused", true)	 
  146. end 
  147.  
  148. function cutscene_effects_shot_10() 
  149. end 
  150.  
  151. function cutscene_effects_shot_11() 
  152.  
  153. end 
  154.  
  155. function cutscene_effects_shot_20() 
  156.  
  157. end 
  158.  
  159. function cutscene_effects_shot_21() 
  160.  
  161. end 
  162.  
  163. function cutscene_effects_shot_23() 
  164.  
  165. end 
  166.  
  167. function cutscene_effects_shot_24() 
  168. 	Kanji_grp:set_visible(false)	 
  169. end 
  170.  
  171. function cutscene_effects_shot_25() 
  172. 	Kanji_grp:set_visible(true)	 
  173. 	Kanji_anim:play(0) 
  174. end 
  175.  
  176. function cutscene_effects_shot_26() 
  177. 	Kanji_grp:set_visible(false)	 
  178. 	Kanji_anim:set_property("is_paused", true)	 
  179. end