./cmp_mission.lua

  1. --Global Mission Sequence Table... 
  2. Cmp_mission_seq = {} 
  3.  
  4. function cmp_mission_init() 
  5. 	Cmp_specific_doc = vint_document_find("cmp_mission") 
  6.  
  7. 	--Populate data... 
  8. 	vint_dataresponder_request("cmp_mission_success", "cmp_mission_populate", 0) 
  9. 	--Set sequence... 
  10. 	cmp_common_screen_set_data(Cmp_mission_seq) 
  11. end 
  12.  
  13. function cmp_mission_cleanup() 
  14. --	if true then 
  15. --		debug_print("vint", "cleanup cmp_mission_cleanup()\n") 
  16. --	end 
  17. end 
  18.  
  19. function cmp_mission_first_frame() 
  20. 	local h = vint_object_find("background_force_black", 0, Cmp_common_doc) 
  21. 	vint_object_destroy(h) 
  22. --	vint_set_property(h, "visible", true) 
  23.  
  24. --	local h = vint_object_find("background_base", 0, Cmp_common_doc) 
  25. --	vint_set_property(h, "background", false)	 
  26. end 
  27.  
  28. ------------------------------------------------------------- 
  29. --Populates the script from the dataresponder... 
  30. ------------------------------------------------------------- 
  31.  
  32. -- @param	mission_name						This is the mission name... "DEATH AT SMILING JACKS" 
  33. -- @param	layout								"Left" or "Right" formats 
  34. -- @param	num_unlockables_to_follow		# of unlockables in the mission flow... ? not sure if this is relevant at this stage... I have no problem doing the unlockable data_responder once and logging all the data from the game. 
  35.  
  36. -- @param	cash_reward							This is the cash reward... "4000" 
  37. -- @param	cash_multiplier					Multiplier for cash			"4.0" 
  38. -- @param	cash_reward_inc_multiplier		Cash_reward with the multiplier... "12000" (This could be calculated internally) 
  39.  
  40. -- @param	respect_points_old				Respect points before... 
  41. -- @param	respect_pct_old					Respect percentage before... 
  42. -- @param	respect_level_old					Respect level before... 
  43.  
  44. -- @param	respect_points_new				Respect points after... 
  45. -- @param	respect_pct_new					Respect percent after... 
  46. -- @param	respect_level_new					Respect level after... 
  47.  
  48. -- @param	respect_multiplier				Respect multiplier "2.0" 
  49. -- @param	respect_points_multiplier		Respect points after multiplier 
  50. -- @param	respect_pct_multiplier			Respect percent after multiplier 
  51. -- @param	respect_level_multiplier		Respect level after multiplier 
  52.  
  53. function cmp_mission_populate(unlockables_to_follow, mission_internal_name, mission_name, layout, cash_reward, cash_multiplier, cash_reward_inc_multiplier, respect_points_old, respect_pct_old, respect_level_old, respect_points_new, respect_pct_new, respect_level_new, respect_multiplier, respect_points_multiplier, respect_pct_multiplier, respect_level_multiplier) 
  54.  
  55. --[[ 
  56. 	debug_print("vint", "unlockable# = " 						.. var_to_string(unlockables_to_follow).."\n") 
  57. 	debug_print("vint", "mission number = " 					.. var_to_string(mission_number).."\n") 
  58. 	debug_print("vint", "layout number = " 					.. var_to_string(layout).."\n") 
  59. 	debug_print("vint", "cash_reward" 							.. var_to_string(cash_reward).."\n") 
  60. 	debug_print("vint", "cash_multiplier = " 					.. var_to_string(cash_multiplier).."\n") 
  61. 	debug_print("vint", "cash_reward_inc_multiplier = " 	.. var_to_string(cash_reward_inc_multiplier).."\n") 
  62. 	debug_print("vint", "respect_points_old = " 				.. var_to_string(respect_points_old).."\n") 
  63. 	debug_print("vint", "respect_pct_old = " 					.. var_to_string(respect_pct_old).."\n") 
  64. 	debug_print("vint", "respect_level_old = " 				.. var_to_string(respect_level_old).."\n") 
  65. 	debug_print("vint", "respect points_new = " 				.. var_to_string(respect_points_new).."\n") 
  66. 	debug_print("vint", "respect_pct_new = " 					.. var_to_string(respect_pct_new).."\n") 
  67. 	debug_print("vint", "respect_level_new = " 				.. var_to_string(respect_level_new).."\n") 
  68. 	debug_print("vint", "respect_multiplier = " 				.. var_to_string(respect_multiplier).."\n") 
  69. 	debug_print("vint", "respect_points_multiplier = " 	.. var_to_string(respect_points_multiplier).."\n") 
  70. 	debug_print("vint", "respect_pct_multiplier = " 		.. var_to_string(respect_pct_multiplier).."\n") 
  71. 	debug_print("vint", "respect_level_multiplier = " 		.. var_to_string(respect_level_multiplier).."\n") 
  72. 	]] 
  73.  
  74. 	Cmp_mission_seq[1].type = CMP_SCREEN_TITLE_INDEX 
  75. 	Cmp_mission_seq[1].title_string = mission_name 
  76. 	Cmp_mission_seq[1].mission_internal_name = mission_internal_name 
  77.  
  78. 	Cmp_mission_seq[2].type = CMP_SCREEN_CASH_INDEX 
  79. 	Cmp_mission_seq[2].cash_reward = cash_reward 
  80. 	Cmp_mission_seq[2].cash_multiplier = cash_multiplier 
  81. 	Cmp_mission_seq[2].cash_reward_inc_multiplier = cash_reward_inc_multiplier 
  82.  
  83. 	Cmp_mission_seq[3].respect_points_old 			= respect_points_old 			 
  84. 	Cmp_mission_seq[3].respect_pct_old				= respect_pct_old				 
  85. 	Cmp_mission_seq[3].respect_level_old			= respect_level_old			 
  86. 	Cmp_mission_seq[3].respect_points_new			= respect_points_new			 
  87. 	Cmp_mission_seq[3].respect_pct_new				= respect_pct_new				 
  88. 	Cmp_mission_seq[3].respect_level_new			= respect_level_new			 
  89. 	Cmp_mission_seq[3].respect_multiplier			= respect_multiplier			 
  90. 	Cmp_mission_seq[3].respect_points_multiplier	= respect_points_multiplier	 
  91. 	Cmp_mission_seq[3].respect_pct_multiplier		= respect_pct_multiplier		 
  92. 	Cmp_mission_seq[3].respect_level_multiplier	= respect_level_multiplier	 
  93. 	 
  94. 	if unlockables_to_follow > 0 then 
  95. 		Cmp_mission_seq[4] = {} 
  96. 		Cmp_mission_seq[4].type = CMP_SCREEN_REWARD_INDEX 
  97. 		Cmp_mission_seq[4].rewards_count = unlockables_to_follow 
  98. 	else  
  99. 		Cmp_mission_seq[4] = Cmp_mission_seq[5] 
  100. 		Cmp_mission_seq[5] = nil 
  101. 	end 
  102. end 
  103.  
  104.  
  105. Cmp_mission_seq = { 
  106. 	[1] = { 
  107. 		type 				= CMP_SCREEN_TITLE_INDEX, 
  108. 		title_string 	= "DEATH AT SMILING JACKS", 
  109. 		on_start			= cmp_mission_first_frame, 
  110. 	}, 
  111. 	[2] = { 
  112. 		type = CMP_SCREEN_CASH_INDEX, 
  113. 		cash_reward						= 20000, 
  114. 		cash_multiplier 				= 45, 
  115. 		cash_reward_inc_multiplier = 38000, 
  116. 		on_start = nil, 
  117. 	}, 
  118. 	[3] = { 
  119. 		type = CMP_SCREEN_RESPECT_INDEX, 
  120. 		on_start = nil, 
  121. 		respect_points_old			= 200, 
  122. 		respect_pct_old				= .4, 
  123. 		respect_level_old				=	2, 
  124. 		 
  125. 		respect_points_new			= 2000, 
  126. 		respect_pct_new				= .5, 
  127. 		respect_level_new				= 3, 
  128. 		respect_multiplier			= 40, 
  129. 		 
  130. 		respect_points_multiplier	= 2000,	 
  131. 		respect_pct_multiplier		= .5, 
  132. 		respect_level_multiplier	=5,	 
  133. 	}, 
  134. 	[4] = { 
  135. 		type = CMP_SCREEN_REWARD_INDEX 
  136. 	}, 
  137. 	[5] = { 
  138. 		type = CMP_SCREEN_COOP_WAIT_INDEX, 
  139. 	}, 
  140. } 
  141.