./msatan.lua

  1.  
  2. --[[ USING THE MISSION START TEMPLATE  
  3. 		1.	Read "SR3 Mission Scripting Standards" if you haven't already. 
  4. 		2.	Save this file as "mSatan.lua" in the missions directory. 
  5. 		3.	Replace "mSatan" with the name of your mission (must use the same name as your mission start node). 
  6. 		3a.	Replace "mSatan" with the capitalized name of your mission 
  7. 		4.	Replace "20130821" with today's date. 
  8. 		5.	Replace "hvs" with your name. 
  9. 		6.	Replace "first_checkpoint_nav" with the name of the first location to go to 
  10. 		7.	Replace "fcp with a 3-4 letter abbreviation for the first checkpoint. 
  11. 		8.	Replace "next_checkpoint_nav" with the second checkpoint name (first is named start) 
  12. 		9.	Replace "ncp" with a 3-4 letter abbreviation for the next checkpoint. 
  13. 		10.	If you find an error with this template, fix it and check it in!!!! 
  14. 		11.	Remove these instructions.  You're on your own now! 
  15. ]]-- 
  16.  
  17. --[[ 
  18. 	mSatan.lua 
  19. 	SR3 Mission Script 
  20. 	DATE: 2013-09-23 
  21. 	AUTHOR:	Arturo Mata 
  22. ]]-- 
  23.  
  24.  
  25. -- Debug flags -- 
  26.  
  27. -- Tweakable Parameters -- 
  28.  
  29. -------------------------------------------------------------------------------------------------- 
  30. 																				--[[ GROUPS ]]-- 
  31. -------------------------------------------------------------------------------------------------- 
  32. 	mSatan_group = { 
  33. 									--[[ FLIGHT TEST GROUP ]]--	 
  34. 		satan = { 
  35. 			name = "Satan_group", 
  36. 			members = { "satan<001>" }, 
  37. 		}, 
  38. 		 
  39. 		kinzie = { 
  40. 			name = "Kinzie_group", 
  41. 			members = { "kinzie<001>" }, 
  42. 		}, 
  43. 		 
  44. 		johnny = { 
  45. 			name = "Johnny_group", 
  46. 			members = { "johnny<001>" }, 
  47. 		}, 
  48. 	} 
  49.  
  50. -------------------------------------------------------------------------------------------------- 
  51. 																				--[[ THREADS ]]-- 
  52. -------------------------------------------------------------------------------------------------- 
  53. 	mSatan_thread = { 
  54. 		mSatan_set_velocity = INVALID_THREAD_HANDLE, 
  55. 	} 
  56.  
  57. -------------------------------------------------------------------------------------------------- 
  58. 																			--[[ CHECKPOINTS ]]-- 
  59. -------------------------------------------------------------------------------------------------- 
  60. 	mSatan_checkpoint = { 
  61. 		{ 
  62. 			name = MISSION_START_CHECKPOINT,					-- Throne Room Checkpoint (thr) 
  63. 			init = "mSatan_thr_init", 
  64. 			run = "mSatan_thr_run", 
  65. 			cleanup = "mSatan_thr_cleanup", 
  66. 			next_checkpoint = "", 
  67. 			host_start = "Throne_Nav_Host", 
  68. 			client_start = "Throne_Nav_Client", 
  69. 			p1_car_nav = "", 
  70. 			p2_car_nav = "", 
  71. 			start_groups = { }, 
  72. 			cp_only_groups = { }, 
  73. 		}, 
  74. 	} 
  75. 	 
  76. -------------------------------------------------------------------------------------------------- 
  77. 																			--[[ CUTSCENES ]]-- 
  78. -------------------------------------------------------------------------------------------------- 
  79. 	mSatan_scene = { 
  80. 		intro = "Bink_Wedding_Party", 
  81. 		face_punch = "Satan_Punch_out", 
  82. 		outro = "outro" 
  83. 	} 
  84.  
  85. -------------------------------------------------------------------------------------------------- 
  86. 																			--[[ CONVERSATIONS ]]-- 
  87. -------------------------------------------------------------------------------------------------- 
  88.  
  89. 	mSatan_convo = { 
  90. 		--[[ = { 
  91. 			name = "file_name without voice (_bm, _wm, _bf...", 
  92. 			player_talks = true or false, 
  93. 			handle = INVALID_CONVERSATION_HANDLE, 
  94. 			convo_thread = INVALID_THREAD_HANDLE, 
  95. 			max_wait_seconds = 60,	-- if the conversation doesn't complete before this time, kill it 
  96. 			timer_thread = INVALID_THREAD_HANDLE, 
  97. 			priority = CONVO_PRIORITY_HIGH or CONVO_PRIORITY_NORMAL or CONVO_PRIORITY_OPTIONAL 
  98. 			(optional) persona_line = true,	-- this is a single line 
  99. 			(required if persona_line) speaker_name = "name of speaker",	-- single line speaker (might be set before call to play is made?) 
  100. 			(optional)phone_call = true,  -- this is a phone conversation (phone persona must be preloaded) 
  101. 			(required if phone_call) receiving_call = true or false  -- auto-answer is always true in missions (until proven otherwise) 
  102. 			 
  103. 		},]] 
  104. 		 
  105. 		--[[ 
  106. 		face_punch = { 
  107. 			name = "mdrained_elevator",  
  108. 			player_talks = false, 
  109. 			handle = INVALID_CONVERSATION_HANDLE, 
  110. 			convo_thread = INVALID_THREAD_HANDLE, 
  111. 			max_wait_seconds = 60, 
  112. 			timer_thread = INVALID_THREAD_HANDLE, 
  113. 			priority = CONVO_PRIORITY_NORMAL, 
  114. 		}, 
  115. 		]]-- 
  116. 	} 
  117. 	 
  118. 	mSatan_convo_queue = { 
  119. 		--[[start_drive_queue = {  
  120. 			{ delay = 2.0, convo = mSatan_convo.goto_first_checkpoint_nav }, 
  121. 			{ delay = 4.0, convo = mSatan_convo.goto_first_checkpoint_nav2 }, 
  122. 			{ delay = 3.0, convo = mSatan_convo.goto_first_checkpoint_nav3 }, 
  123. 			{ delay = 5.0, convo = mSatan_convo.goto_first_checkpoint_nav4 } 
  124. 		}, 
  125. 		]]-- 
  126. 	} 
  127. 	 
  128. -------------------------------------------------------------------------------------------------- 
  129. 																			--[[ TRIGGERS ]]-- 
  130. -------------------------------------------------------------------------------------------------- 
  131. 	mSatan_trigger = { 
  132. 		-- = { 
  133. 		--	name = "_trigger", 
  134. 		--	hit = false, 
  135. 		-- 	last_hit_by = nil, -- 	last_hit_human = nil (set to the last human to enter the trigger in the default trigger callback) 
  136. 		--  (optional)callback = "mSatan_function_name_cb" 
  137. 		--	(optional)marker = TRIGGER_LOCATION or TRIGGER_USE or custom or don't include for no marker 
  138. 		--  (optional)waypoint = true, 
  139. 		--  (optional)teleport_to = { 
  140. 		--						host = "host_nav", 
  141. 		--						client = "client_nav"  
  142. 		--					},		 
  143. 		--	(optional)conversation = mSatan_convo.convo_name  -- play a conversation 
  144. 		--	(optional)next_trigger = "next_trigger_name" sets up next trigger when triggered (breadcrumbs) 
  145. 		--}, 
  146. 		 
  147. 									--[[ first_checkpoint_nav TRIGGERS ]]-- 
  148.  
  149. 		--end_trigger = { 
  150. 		--	name = "end_mission_trigger", 
  151. 		--	hit = false, 
  152. 		--	marker = TRIGGER_LOCATION, 
  153. 		--	waypoint = false, 
  154. 		--}, 
  155. 		 
  156. 									--[[ next_checkpoint_nav TRIGGERS ]]--	 
  157.  
  158.  
  159. 		--trigger_01 = { 
  160. 		--	name = "trigger<001>", 
  161. 		--	hit = false, 
  162. 		--	marker = TRIGGER_LOCATION, 
  163. 		--	waypoint = true, 
  164. 		--}, 
  165.  
  166.  
  167. 	} 
  168. 	 
  169. -------------------------------------------------------------------------------------------------- 
  170. 																	  --[[ INTERROGATION DATA ]]-- 
  171. -------------------------------------------------------------------------------------------------- 
  172. 	--mSatan_interrogate = { 
  173. 	--	leader = { 
  174. 	--		target = mSatan_group.friendly_fire.owner, 
  175. 	--		persona = "Interrogation", 
  176. 	--		objective = "mSatan_INTERROGATE_OWNER", 
  177. 	--	--	(optional)conversation = mSatan_convo.convo_name  -- play a conversation while interrogating 
  178. 	--	}, 
  179. 	--} 
  180. 		 
  181. -------------------------------------------------------------------------------------------------- 
  182. 																				   --[[ OTHER ]]-- 
  183. -------------------------------------------------------------------------------------------------- 
  184. --HVS_JBG : The FIRST navpoint in this list should be directly in front of the throne! 
  185. 	mSatan_navpoints = { 
  186. 		teleport_nav = { "satan_tele_nav<001>","satan_tele_nav<002>","satan_tele_nav<003>","satan_tele_nav<004>", 
  187. 						 "satan_tele_nav<005>","satan_tele_nav<006>","satan_tele_nav<007>","satan_tele_nav<008>", 
  188. 						 "satan_tele_nav<009>","satan_tele_nav<010>","satan_tele_nav<011>","satan_tele_nav<012>", 
  189. 						 "satan_tele_nav<013>"}, 
  190.  
  191. 	} 
  192. 	 
  193. 	mSatan_runtime = { 
  194. 		satan_downed = false, 
  195. 		face_punch_complete = false, 
  196. 		mission_end_complete = false,  
  197. 		kinzie_swap_complete = false,  
  198. 		satan_wings_ready = false, 
  199. 	} 
  200. 	 
  201. 	mSatan_homie = { 
  202. 	kinzie = "", 
  203. 	johnny = "", 
  204. 	} 
  205.  
  206. -------------------------------------------------------------------------------------------------- 
  207. 								--[[**********************]]-- 
  208. 								--[[                      ]]-- 
  209. 								--[[  Standard functions  ]]-- 
  210. 								--[[                      ]]-- 
  211. 								--[[**********************]]-- 
  212.  
  213. -- This is the primary entry point for the mission, and is responsible for starting up the mission 
  214. -- at the specified checkpoint. 
  215. -- CALLED FROM CODE 
  216. -- 
  217. -- start_checkpoint_name:	(string) The checkpoint the mission should begin at 
  218. -- is_restart:					(bool) TRUE if the mission is restarting, FALSE otherwise 
  219. -- 
  220. function mSatan_start(start_checkpoint_name, is_restart) 
  221. 	mission_start_fade_out(0.0) 
  222. 	set_ped_override_density(.1) 
  223. 	set_traffic_density(.1) 
  224. 	parking_spot_disable_all(true) 
  225. 	-- initialize systems 
  226. 	mission_startup(mSatan_trigger, mSatan_convo) -- mSatan_checkpoint 
  227. 	 
  228. 	local start_cp = get_table_by_name(mSatan_checkpoint, MISSION_START_CHECKPOINT) 
  229.  
  230. 	--hvUnlockLoadout("mSatan") 
  231.  
  232. 	-- Check if this mission starting from the beginning 
  233. 	if (start_checkpoint_name == start_cp.name) then 
  234. 		if (is_restart == false and mSatan_scene.intro ~= "") then 
  235. 			-- First time playing mission 
  236. 			local fade_in_after = false 
  237. 			cutscene_play(mSatan_scene.intro, nil, {start_cp.host_start, start_cp.client_start}, fade_in_after) 
  238. 		else 
  239. 			teleport_coop(start_cp.host_start, start_cp.client_start, true) 
  240. 		end 
  241. 		fade_out(0) 
  242. 	end 
  243.  
  244. 	-- Handle mission initialization for the current checkpoint 
  245. 	mSatan_initialize(start_checkpoint_name) 
  246.  
  247. 	-- Run the mission from the current checkpoint 
  248. 	checkpoint_run_mission(mSatan_checkpoint, start_checkpoint_name) 
  249.  
  250. 	if(mSatan_runtime.mission_end_complete == false) then 
  251. 		mission_end_success("mSatan", mSatan_scene.outro, {"cancel_end_host", "cancel_end_client"}) 
  252. 	end		 
  253. 	--mission_end_success("mSatan", mSatan_scene.outro)--, {, }) 
  254. end 
  255.  
  256. -- This is the primary function responsible for cleaning up the entire mission 
  257. -- CALLED FROM CODE (+++MUST RETURN IMMEDIATELY+++) 
  258. -- 
  259. function mSatan_cleanup() 
  260. 	camera_revert_target() -- HVS_RCK - Just in case you quit while the camera was on Satan 
  261. 	satan_maybe_restore_control() --HVS_RCK - same just in case as above: Restore player control 
  262. 	--[[ INSERT ANY MISSION SPECIFIC CLEAN-UP ]]-- 
  263. 	satan_clear_resources() 
  264. 	on_seamless_animated_moment_end("") 
  265. 	--make sure zone is off 
  266. 	city_zone_swap("m_Sthrone", false) 
  267. 	 
  268. 	-- cleanup all threads 
  269. 	cleanup_threads(mSatan_thread) 
  270. 	 
  271. 	-- run checkpoint cleanups (move into mission_shutdown?) 
  272. 	checkpoint_cleanup_mission(mSatan_checkpoint) 
  273. 	 
  274. 	-- cleanup triggers, convos, kill_list and interrogations 
  275. 	mission_shutdown() 
  276. 	 
  277. 	-- cleanup all groups 
  278. 	cleanup_groups(mSatan_group) 
  279. 	 
  280. 	--return normal player jump/sprint values 
  281. 	tweak_table_restore_value ("Jump_super_max_height_scripted") 
  282. 	tweak_table_restore_value ("Sprint_super_max_speed_scripted") 
  283. 	set_ped_override_density(-1) 
  284. 	set_traffic_density(1) 
  285. 	parking_spot_disable_all(false) 
  286.  
  287. end 
  288.  
  289. -- Called when the mission has ended with success 
  290. -- CALLED FROM CODE (+++MUST RETURN IMMEDIATELY+++) 
  291. -- 
  292. function mSatan_success() 
  293. 	--[[ INSERT ANY MISSION SPECIFIC SUCCESS STUFF ]]-- 
  294. 	 
  295. end 
  296.  
  297. -------------------------------------------------------------------------------------------------- 
  298. 								--[[**********************]]-- 
  299. 								--[[                      ]]-- 
  300. 								--[[ Initialize functions ]]-- 
  301. 								--[[                      ]]-- 
  302. 								--[[**********************]]-- 
  303.  
  304. -- Initialize the mission for the specified checkpoint 
  305. -- 
  306. -- checkpoint_name:		(string) Checkpoint to initialize the mission to 
  307. -- 
  308. function mSatan_initialize(checkpoint_name) 
  309. 	-- Common initialization 
  310. 	mSatan_initialize_common() 
  311. 	 
  312. 	-- Checkpoint specific initialization 
  313. 	checkpoint_init(mSatan_checkpoint, checkpoint_name) 
  314.  
  315. 	-- Remove any present subtitles 
  316. 	message_remove_all() 
  317.  
  318. 	-- Start fading in  
  319. 	mission_start_fade_in() 
  320.  
  321. 	audio_object_post_event("Play_AMB_INT_Throne_Room_1") 
  322. end 
  323.  
  324. -- Handle any common initialization 
  325. -- 
  326. function mSatan_initialize_common() 
  327. 	--[[ INSERT ANY COMMON INITIALIZATION CODE HERE ]]-- 
  328. 	 
  329. 	mission_set_cancel_warp_location("cancel_end_host", "cancel_end_client") 
  330. 		audio_object_post_event("Play_SatanMusic") 
  331. 		audio_object_post_event("Play_AMB_INT_Throne_Room_1") 
  332. end 
  333.  
  334. -------------------------------------------------------------------------------------------------- 
  335. 								--[[**********************]]-- 
  336. 								--[[                      ]]-- 
  337. 								--[[ Checkpoint functions ]]-- 
  338. 								--[[                      ]]-- 
  339. 								--[[**********************]]-- 
  340.  
  341. ------------------------------------ 
  342. -- 
  343. -- Checkpoint helper functions 
  344. -- 
  345. ------------------------------------ 
  346.  
  347.  
  348. ------------------------------------ 
  349. -- 
  350. -- Checkpoint callback functions 
  351. -- 
  352. ------------------------------------ 
  353.  
  354.  
  355. ------------------------------------ 
  356. -- 
  357. -- Checkpoint thread functions 
  358. -- 
  359. ------------------------------------ 
  360.  
  361. -------------------------------------------------------------------------------------------------- 
  362. 																	--[[ Throne Room Checkpoint ]]-- 
  363. -------------------------------------------------------------------------------------------------- 
  364.  
  365. -- Initialize this checkpoint. 
  366. -- 
  367. -- mission_start: (bool) Whether we're initializing from a mission (re)start or from 
  368. --					a natural play-through. 
  369. -- 
  370. function mSatan_thr_init(mission_start) 
  371.  
  372. 	--set up single player only homie Kinzie 
  373. 	 if (coop_is_active() == false) then 
  374. 		local block = true 
  375. 		 
  376. 		-- if player is johnny, spawn kinzie as a homie, else spawn johnny as the homie 
  377. 		if character_get_anim_set(LOCAL_PLAYER) == "PLYM" then 
  378. 			group_create( mSatan_group.kinzie.name, block ) 
  379. 			mSatan_homie.kinzie = mSatan_group.kinzie.members[1] 
  380. 			party_add(mSatan_homie.kinzie, LOCAL_PLAYER) 
  381. 			follower_set_can_abandon( mSatan_homie.kinzie, false ) 
  382. 			on_death ( "mSatan_failure_kinzie_died_cb", mSatan_homie.kinzie ) 
  383. 			on_dismiss ( "mSatan_failure_kinzie_dismissed_cb", mSatan_homie.kinzie ) 
  384. 			turn_invulnerable( mSatan_group.kinzie.members[1] ) 
  385. 			character_set_never_catch_fire(mSatan_group.kinzie.members[1]) 
  386. 		else 
  387. 			group_create( mSatan_group.johnny.name, block ) 
  388. 			mSatan_homie.johnny = mSatan_group.johnny.members[1] 
  389. 			party_add(mSatan_homie.johnny, LOCAL_PLAYER) 
  390. 			follower_set_can_abandon( mSatan_homie.johnny, false ) 
  391. 			on_death ( "mSatan_failure_johnny_died_cb", mSatan_homie.johnny ) 
  392. 			on_dismiss ( "mSatan_failure_johnny_dismissed_cb", mSatan_homie.johnny ) 
  393. 			turn_invulnerable( mSatan_group.johnny.members[1] ) 
  394. 			character_set_never_catch_fire(mSatan_group.johnny.members[1]) 
  395. 		end 
  396. 		 
  397. 		party_set_dismissable(false) 
  398. 	 end 
  399. 	  
  400. 	mission_start_fade_out() 
  401. 	city_zone_swap("m_Sthrone", true) 
  402. 	 
  403. 	-- HVS_JBG - moved this before the fade so we don't see satan pop in.  
  404. 	-- it should also give his wings a chance to open and get into the anim network in time for the player swap SAM. 
  405. 	local block = true 
  406. 	group_create( mSatan_group.satan.name, block ) 
  407.  
  408. 	satan_disable_combat(true) 
  409. 	satan_set_flight_mode(mSatan_group.satan.members[1], false) 
  410. 	 
  411. 	local cp = get_table_by_name(mSatan_checkpoint, MISSION_START_CHECKPOINT) 
  412. 	teleport_coop(cp.host_start, cp.client_start, true) 
  413. 	 
  414. 	teleport( mSatan_group.satan.members[1], mSatan_navpoints.teleport_nav[1] ) 
  415. 	human_clear_teleport_navpoints(mSatan_group.satan.members[1]) 
  416. 	 
  417. 	for i, nav in ipairs(mSatan_navpoints.teleport_nav) do 
  418. 		human_add_teleport_navpoint(mSatan_group.satan.members[1], nav) 
  419. 	end 
  420. 	 
  421. 	satan_set_proxy_push_navpoint("satan_proxy_push_nav") 
  422. 	 
  423. 	mission_start_fade_in()	 
  424. 	 
  425. 	--reduce player jump/sprint values 
  426. 	tweak_table_override_value("Jump_super_max_height_scripted",26) 
  427. 	tweak_table_override_value("Sprint_super_max_speed_scripted",28) 
  428. 	 
  429. 	notoriety_force_no_spawn(true) 
  430. 	 
  431. 	--while (mSatan_runtime.satan_wings_ready == false) do 
  432. 	--	thread_yield();	 
  433. 	--end 
  434.  
  435. 	if (coop_is_active() == false) then 
  436.  
  437. 		-- if the player character isn't johnny, play the kinzie swap SAM. 
  438. 		if character_get_anim_set(LOCAL_PLAYER) ~= "PLYM" then 
  439.  
  440. 			on_seamless_animated_moment_end("mSatan_Kinzie_swap_Complete") 
  441.  
  442. 			satan_wing_pcswap_sam(mSatan_group.satan.members[1], true) 
  443. 			 
  444. 			local actor_list2 = { mSatan_homie.johnny, LOCAL_PLAYER, mSatan_group.satan.members[1] } 
  445. 			seamless_animated_moment_prep("sam_kinzie_switch", actor_list2) 
  446. 			seamless_animated_moment_start("sam_kinzie_switch", actor_list2) 
  447. 			audio_object_post_event("Play_MSatan_Player_Swap") 
  448.  
  449. 			delay(13.2) 
  450. 			player_swap_character() 
  451.  
  452. 			party_dismiss_all() 
  453. 			group_destroy(mSatan_group.johnny) 
  454.  
  455. 			--set up kinzie as a homie. 
  456. 			group_create( mSatan_group.kinzie.name, true ) 
  457. 			mSatan_homie.kinzie = mSatan_group.kinzie.members[1] 
  458. 			party_add(mSatan_homie.kinzie, LOCAL_PLAYER) 
  459. 			follower_set_can_abandon( mSatan_homie.kinzie, false ) 
  460. 			on_death ( "mSatan_failure_kinzie_died_cb", mSatan_homie.kinzie ) 
  461. 			on_dismiss ( "mSatan_failure_kinzie_dismissed_cb", mSatan_homie.kinzie ) 
  462. 			turn_invulnerable( mSatan_group.kinzie.members[1] ) 
  463. 			character_set_never_catch_fire(mSatan_group.kinzie.members[1]) 
  464. 			 
  465. 			while(mSatan_runtime.kinzie_swap_complete == false) do 
  466. 				thread_yield() 
  467. 			end	 
  468.  
  469. 			on_seamless_animated_moment_end("") 
  470. 		else  
  471. 			satan_disable_combat(false) 
  472. 		end 
  473. 	else 
  474. 		satan_disable_combat(false) 
  475. 	end 
  476. end 
  477.  
  478. -- The first objective 
  479. -- 
  480. function mSatan_thr_run() 
  481.  
  482. 	--objective_text(0,"","","",SYNC_ALL,OI_ASSET_LOCATION) 
  483. 	 
  484. 	while not mSatan_runtime.satan_downed do 
  485. 		thread_yield() 
  486. 	end 
  487.  
  488. 	objective_text_clear(0)	 
  489. 	convo_end_all() 
  490. 	--convo_start(mSatan_convo.face_punch) 
  491. 	 
  492. 	on_seamless_animated_moment_end("mSatan_Face_Punch_Complete") 
  493.  
  494. 	-- since we swap out kinzie for johnny now, the homie actor will always be kinzie 
  495. 	local player_char = LOCAL_PLAYER 
  496. 	local homie = mSatan_homie.kinzie 
  497.  
  498. 	-- HVS_BDF: gotta account for co-op 
  499. 	if coop_is_active() then 
  500. 		-- If the local player isn't Johnny, then they must be Kinzie. 
  501. 		if character_get_anim_set(LOCAL_PLAYER) ~= "PLYM" then 
  502. 			player_char = REMOTE_PLAYER 
  503. 			homie = LOCAL_PLAYER 
  504. 		else 
  505. 			homie = REMOTE_PLAYER 
  506. 		end 
  507. 	end  
  508. 	 
  509.  
  510. 	local actor_list1 = {  mSatan_group.satan.members[1], player_char, homie } 
  511. 	seamless_animated_moment_prep("sam_satan_punch", actor_list1) 
  512. 	seamless_animated_moment_start("sam_satan_punch", actor_list1) 
  513. 	audio_object_post_event("Play_MSatan_Punch") 
  514.  
  515. 	-- register a callback function to be called at the end 
  516. 	on_anim_trigger( "mSatan_SAM_fade_out", mSatan_group.satan.members[1] ) 
  517.  
  518. 	while(mSatan_runtime.face_punch_complete == false) do 
  519. 		thread_yield() 
  520. 	end	 
  521. 	 
  522. 	on_seamless_animated_moment_end("") 
  523. end 
  524.  
  525. -- Callback handler for the Shadow Demon's SAM animation trigger 
  526. function mSatan_SAM_fade_out() 
  527.  
  528. 	--seamless_animated_moment_cleanup()	-- HVS_BDF: we don't want this here because it causes the camera to pan back during the fade-out 
  529. 	fade_out(0) 
  530. end 
  531.  
  532. -- Do any cleanup for this checkpoint. 
  533. -- 
  534. -- (+++THIS IS CALLED FROM MISSION CLEANUP, MUST RETURN IMMEDIATELY+++) 
  535. -- 
  536. -- mission_exit: (bool) Whether we're exiting the mission entirely, or just 
  537. --					moving on to the next checkpoint. 
  538. -- 
  539. function mSatan_thr_cleanup(mission_exit) 
  540. 	if mission_exit then	 
  541. 		mSatan_cleanup_homies() 
  542. 	end 
  543.  
  544. 	on_anim_trigger( "", mSatan_group.satan.members[1] ) 
  545. end 
  546.  
  547. function mSatan_Face_Punch_Complete() 
  548. 	mSatan_runtime.mission_end_complete = true; 
  549. 	mSatan_runtime.face_punch_complete = true; 
  550. 	seamless_animated_moment_cleanup()  
  551. 	mission_end_success("mSatan", mSatan_scene.outro, {"cancel_end_host", "cancel_end_client"}) 
  552. end 
  553.  
  554. function mSatan_Kinzie_swap_Complete() 
  555. 	mSatan_runtime.kinzie_swap_complete = true; 
  556. 	satan_wing_pcswap_sam(mSatan_group.satan.members[1], false) 
  557. 	satan_disable_combat(false) 
  558. 	seamless_animated_moment_cleanup()  
  559.  
  560. end 
  561.  
  562. function mSatan_cleanup_homies() 
  563. 	if mSatan_homie.kinzie ~= nil and mSatan_homie.kinzie ~= "" then 
  564. 		on_death("", mSatan_homie.kinzie) 
  565. 		on_dismiss("", mSatan_homie.kinzie) 
  566. 	end 
  567. end 
  568.  
  569. function mSatan_failure_kinzie_died_cb() 
  570. 	mission_end_failure("mSatan", "GM_SATAN_FAIL_KINZIE_DIED") 
  571. end 
  572.  
  573. function mSatan_failure_johnny_died_cb() 
  574. 	mission_end_failure("mSatan", "GM_SATAN_FAIL_JOHNNY_DIED") 
  575. end 
  576.  
  577. function mSatan_failure_kinzie_dismissed_cb() 
  578. 	mission_end_failure("mSatan", "GM_SATAN_FAIL_KINZIE_DIS") 
  579. end 
  580.  
  581. function mSatan_failure_johnny_dismissed_cb() 
  582. 	mission_end_failure("mSatan", "GM_SATAN_FAIL_JOHNNY_DIS") 
  583. end 
  584.  
  585. ------------------------------------ 
  586. -- 
  587. -- Checkpoint helper functions 
  588. -- 
  589. ------------------------------------ 
  590.  
  591. ------------------------------------ 
  592. -- 
  593. -- Checkpoint callback functions 
  594. -- 
  595. ------------------------------------ 
  596.  
  597. ------------------------------------ 
  598. -- 
  599. -- Checkpoint thread functions 
  600. -- 
  601. ------------------------------------ 
  602.  
  603. -------------------------------------------------------------------------------------------------- 
  604. 																	--[[ next_checkpoint_nav ]]-- 
  605. -------------------------------------------------------------------------------------------------- 
  606.  
  607. ------------------------------------ 
  608. -- 
  609. -- Checkpoint helper functions 
  610. -- 
  611. ------------------------------------ 
  612.  
  613. ------------------------------------ 
  614. -- 
  615. -- Checkpoint callback functions 
  616. -- 
  617. ------------------------------------ 
  618.  
  619. ------------------------------------ 
  620. -- 
  621. -- Checkpoint thread functions 
  622. -- 
  623. ------------------------------------ 
  624.  
  625. -------------------------------------------------------------------------------------------------- 
  626. 								--[[**********************]]-- 
  627. 								--[[                      ]]-- 
  628. 								--[[   Common functions   ]]-- 
  629. 								--[[                      ]]-- 
  630. 								--[[**********************]]-- 
  631. -------------------------------------------------------------------------------------------------- 
  632. 								--[[**********************]]-- 
  633. 								--[[                      ]]-- 
  634. 								--[[  Callback functions  ]]-- 
  635. 								--[[                      ]]-- 
  636. 								--[[**********************]]-- 
  637. -------------------------------------------------------------------------------------------------- 
  638.  
  639. function mSatan_face_punch( npc ) 
  640. 	mSatan_runtime.satan_downed = true; 
  641. end 
  642.  
  643. function mSatan_wings_ready( npc ) 
  644. 	mSatan_runtime.satan_wings_ready = true; 
  645. end 
  646.  
  647.  
  648. 								--[[**********************]]-- 
  649. 								--[[                      ]]-- 
  650. 								--[[   Thread functions   ]]-- 
  651. 								--[[                      ]]-- 
  652. 								--[[**********************]]--