./fight_club_vs.lua

  1.  
  2. -- Thread id used to dump pause map 
  3. local Fight_club_vs_peg_load_thread = -1 
  4.  
  5. Fight_club_vs_doc_handle = -1 
  6.  
  7. local Bg_tint_h = -1 
  8. local Label_julius_h = -1 
  9. local Label_jyunichii_h = -1 
  10. local Label_nyteblade_h = -1 
  11.  
  12. local BOSS_JULIUS 			= 1 
  13. local BOSS_JYUNICHI 			= 2 
  14. local BOSS_NYTEBLAYDE 		= 3 
  15.  
  16. local Boss_data = { 
  17. 	[BOSS_JULIUS] = { 
  18. 		color = {R=64/255, G=27/255, B=89/255}, 
  19. 		image = "ui_spfc_label_julius", 
  20. 		img_h = "label_julius", 
  21. 	}, 
  22. 	[BOSS_JYUNICHI] = { 
  23. 		color = {R=102/255, G=94/255, B=6/255}, 
  24. 		image = "ui_spfc_label_jyunichi", 
  25. 		img_h = "label_jyunichi", 
  26. 	}, 
  27. 	[BOSS_NYTEBLAYDE] = { 
  28. 		color = {R=180/255, G=64/255, B=33/255}, 
  29. 		image = "ui_spfc_label_nyteblade", 
  30. 		img_h = "label_nyteblade", 
  31. 	},	 
  32. } 
  33.  
  34.  
  35. function fight_club_vs_init() 
  36. 	Fight_club_vs_doc_handle = vint_object_find("fight_club_vs") 
  37. 	 
  38. 	-- Hide screen grp until images have been set 
  39. 	local screen_grp_h = vint_object_find("screen_grp", 0, Fight_club_vs_doc_handle) 
  40. 	vint_set_property(screen_grp_h, "visible", false) 
  41. 	 
  42. 	-- Hide all labels 
  43. 	for i = 1, #Boss_data do 
  44. 		local label_h = vint_object_find(Boss_data[i].img_h, 0, Fight_club_vs_doc_handle) 
  45. 		vint_set_property(label_h, "visible", false) 
  46. 	end 
  47. 	 
  48. 	local label_boss_grp_h = vint_object_find("label_boss_grp", 0, Fight_club_vs_doc_handle) 
  49. 	vint_set_property(label_boss_grp_h, "visible", false) 
  50. 	 
  51. 	local label_opponent_grp_h = vint_object_find("label_opponent_grp", 0, Fight_club_vs_doc_handle) 
  52. 	vint_set_property(label_opponent_grp_h, "visible", false)	 
  53. 	 
  54. 	--Default boss bg to red 
  55. 	local bg_tint_grp_h = vint_object_find("bg_tint_grp", 0, Fight_club_vs_doc_handle) 
  56. 	vint_set_property(bg_tint_grp_h, "tint", COLOR_FIGHTCLUB_BOSS_BG.R, COLOR_FIGHTCLUB_BOSS_BG.G, COLOR_FIGHTCLUB_BOSS_BG.B) 
  57.  
  58. 	-- Create new thread to unload pause map 
  59. 	Fight_club_vs_peg_load_thread = thread_new("fight_club_vs_dump_pause_map")       
  60. end 
  61.  
  62.  
  63. function fight_club_vs_cleanup()	  
  64.  
  65. 	-- Make sure Spfc peg is unloaded 
  66. 	game_peg_unload("ui_bms_spfc") 
  67. 	game_peg_unload("ui_spfc_bg") 
  68.  
  69. 	-- Reload pause map 
  70. 	pause_map_restore() 
  71. end 
  72.  
  73.  
  74. ------------------------------------------------------------------------------- 
  75. -- Dumps pause map and loads Super Power Fight Club pegs 
  76.  
  77. function fight_club_vs_dump_pause_map()   
  78.                
  79. 	-- Dump the pause map to make room for spfc sheet 
  80. 	pause_map_dump(true) 
  81. 	 
  82. 	-- Load the spfc pegs 
  83. 	fight_club_vs_load_peg() 
  84. end 
  85.  
  86.  
  87. ------------------------------------------------------------------------------- 
  88. -- Loads Super Power Fight Club pegs 
  89.  
  90. function fight_club_vs_load_peg() 
  91.  
  92. 	-- Load Spfc sheet 
  93. 	game_peg_load_with_cb("fight_club_vs_peg_load_complete", 2, "ui_bms_spfc", "ui_spfc_bg") 
  94. end 
  95.  
  96.  
  97. ------------------------------------------------------------------------------- 
  98. -- Callback for when Super Power Fight Club pegs are done loading 
  99.  
  100. function fight_club_vs_peg_load_complete()	 
  101. 	fight_club_vs_set_boss( game_fight_club_get_boss_id() ) 
  102.  
  103. 	local bg_tint_h = vint_object_find("bg_tint", 0, Fight_club_vs_doc_handle) 
  104. 	local bg_boss_h = vint_object_find("bg_boss", 0, Fight_club_vs_doc_handle) 
  105. 	 
  106. 	vint_set_property(bg_tint_h, "image", "ui_spfc_bg") 
  107. 	vint_set_property(bg_boss_h, "image", "ui_spfc_bg") 
  108. 	 
  109. 	-- Test 
  110. 	--fight_club_vs_set_boss(BOSS_NYTEBLAYDE) 
  111. 	 
  112. 	local screen_grp_h = vint_object_find("screen_grp", 0, Fight_club_vs_doc_handle) 
  113. 	vint_set_property(screen_grp_h, "visible", true) 
  114. 	 
  115. 	-- Play animations 
  116. 	local intro_anim_h = vint_object_find("intro_anim", 0, Fight_club_vs_doc_handle) 
  117. 	vint_apply_start_values(intro_anim_h) 
  118. 	lua_play_anim(intro_anim_h) 
  119.  
  120. 	local idle_anim_h = vint_object_find("idle_anim", 0, Fight_club_vs_doc_handle) 
  121. 	vint_apply_start_values(idle_anim_h) 
  122. 	lua_play_anim(idle_anim_h)	 
  123. end 
  124.  
  125.  
  126. ------------------------------------------------------------------------------- 
  127. -- Set boss title image and color 
  128.  
  129. function fight_club_vs_set_boss(boss_id) 
  130.  
  131. 	local current_boss = Boss_data[boss_id] 
  132.    local bg_tint_grp_h = vint_object_find("bg_tint_grp", 0, Fight_club_vs_doc_handle)	 
  133. 	local label_h = vint_object_find(current_boss.img_h, 0, Fight_club_vs_doc_handle) 
  134. 	 
  135. 	vint_set_property(label_h, "image", current_boss.image) 
  136. 	vint_set_property(label_h, "visible", true)		 
  137. 	vint_set_property(bg_tint_grp_h, "tint", current_boss.color.R, current_boss.color.G, current_boss.color.B) 
  138. 	 
  139. 	-- Turn boss (player) label back on 
  140. 	local label_boss_grp_h = vint_object_find("label_boss_grp", 0, Fight_club_vs_doc_handle) 
  141. 	vint_set_property(label_boss_grp_h, "visible", true) 
  142. 	 
  143. 	local label_opponent_grp_h = vint_object_find("label_opponent_grp", 0, Fight_club_vs_doc_handle) 
  144. 	vint_set_property(label_opponent_grp_h, "visible", true)		 
  145. end 
  146.