-- Thread id used to dump pause map
local Fight_club_vs_peg_load_thread = -1
Fight_club_vs_doc_handle = -1
local Bg_tint_h = -1
local Label_julius_h = -1
local Label_jyunichii_h = -1
local Label_nyteblade_h = -1
local BOSS_JULIUS = 1
local BOSS_JYUNICHI = 2
local BOSS_NYTEBLAYDE = 3
local Boss_data = {
[BOSS_JULIUS] = {
color = {R=64/255, G=27/255, B=89/255},
image = "ui_spfc_label_julius",
img_h = "label_julius",
},
[BOSS_JYUNICHI] = {
color = {R=102/255, G=94/255, B=6/255},
image = "ui_spfc_label_jyunichi",
img_h = "label_jyunichi",
},
[BOSS_NYTEBLAYDE] = {
color = {R=180/255, G=64/255, B=33/255},
image = "ui_spfc_label_nyteblade",
img_h = "label_nyteblade",
},
}
function fight_club_vs_init()
Fight_club_vs_doc_handle = vint_object_find("fight_club_vs")
-- Hide screen grp until images have been set
local screen_grp_h = vint_object_find("screen_grp", 0, Fight_club_vs_doc_handle)
vint_set_property(screen_grp_h, "visible", false)
-- Hide all labels
for i = 1, #Boss_data do
local label_h = vint_object_find(Boss_data[i].img_h, 0, Fight_club_vs_doc_handle)
vint_set_property(label_h, "visible", false)
end
local label_boss_grp_h = vint_object_find("label_boss_grp", 0, Fight_club_vs_doc_handle)
vint_set_property(label_boss_grp_h, "visible", false)
local label_opponent_grp_h = vint_object_find("label_opponent_grp", 0, Fight_club_vs_doc_handle)
vint_set_property(label_opponent_grp_h, "visible", false)
--Default boss bg to red
local bg_tint_grp_h = vint_object_find("bg_tint_grp", 0, Fight_club_vs_doc_handle)
vint_set_property(bg_tint_grp_h, "tint", COLOR_FIGHTCLUB_BOSS_BG.R, COLOR_FIGHTCLUB_BOSS_BG.G, COLOR_FIGHTCLUB_BOSS_BG.B)
-- Create new thread to unload pause map
Fight_club_vs_peg_load_thread = thread_new("fight_club_vs_dump_pause_map")
end
function fight_club_vs_cleanup()
-- Make sure Spfc peg is unloaded
game_peg_unload("ui_bms_spfc")
game_peg_unload("ui_spfc_bg")
-- Reload pause map
pause_map_restore()
end
-------------------------------------------------------------------------------
-- Dumps pause map and loads Super Power Fight Club pegs
function fight_club_vs_dump_pause_map()
-- Dump the pause map to make room for spfc sheet
pause_map_dump(true)
-- Load the spfc pegs
fight_club_vs_load_peg()
end
-------------------------------------------------------------------------------
-- Loads Super Power Fight Club pegs
function fight_club_vs_load_peg()
-- Load Spfc sheet
game_peg_load_with_cb("fight_club_vs_peg_load_complete", 2, "ui_bms_spfc", "ui_spfc_bg")
end
-------------------------------------------------------------------------------
-- Callback for when Super Power Fight Club pegs are done loading
function fight_club_vs_peg_load_complete()
fight_club_vs_set_boss( game_fight_club_get_boss_id() )
local bg_tint_h = vint_object_find("bg_tint", 0, Fight_club_vs_doc_handle)
local bg_boss_h = vint_object_find("bg_boss", 0, Fight_club_vs_doc_handle)
vint_set_property(bg_tint_h, "image", "ui_spfc_bg")
vint_set_property(bg_boss_h, "image", "ui_spfc_bg")
-- Test
--fight_club_vs_set_boss(BOSS_NYTEBLAYDE)
local screen_grp_h = vint_object_find("screen_grp", 0, Fight_club_vs_doc_handle)
vint_set_property(screen_grp_h, "visible", true)
-- Play animations
local intro_anim_h = vint_object_find("intro_anim", 0, Fight_club_vs_doc_handle)
vint_apply_start_values(intro_anim_h)
lua_play_anim(intro_anim_h)
local idle_anim_h = vint_object_find("idle_anim", 0, Fight_club_vs_doc_handle)
vint_apply_start_values(idle_anim_h)
lua_play_anim(idle_anim_h)
end
-------------------------------------------------------------------------------
-- Set boss title image and color
function fight_club_vs_set_boss(boss_id)
local current_boss = Boss_data[boss_id]
local bg_tint_grp_h = vint_object_find("bg_tint_grp", 0, Fight_club_vs_doc_handle)
local label_h = vint_object_find(current_boss.img_h, 0, Fight_club_vs_doc_handle)
vint_set_property(label_h, "image", current_boss.image)
vint_set_property(label_h, "visible", true)
vint_set_property(bg_tint_grp_h, "tint", current_boss.color.R, current_boss.color.G, current_boss.color.B)
-- Turn boss (player) label back on
local label_boss_grp_h = vint_object_find("label_boss_grp", 0, Fight_club_vs_doc_handle)
vint_set_property(label_boss_grp_h, "visible", true)
local label_opponent_grp_h = vint_object_find("label_opponent_grp", 0, Fight_club_vs_doc_handle)
vint_set_property(label_opponent_grp_h, "visible", true)
end