./cmp_activity.lua

  1. --Global Mission Sequence Table... 
  2. Cmp_activity_seq = {} 
  3.  
  4. function cmp_activity_init() 
  5. 	Cmp_specific_doc = vint_document_find("cmp_activity") 
  6.  
  7. 	--Populate data... 
  8. 	vint_dataresponder_request("cmp_activity_success", "cmp_activity_populate", 0) 
  9. 	--Set sequence... 
  10. 	cmp_common_screen_set_data(Cmp_activity_seq) 
  11. end 
  12.  
  13. function cmp_activity_cleanup() 
  14. 	if CMP_TEST_MODE then 
  15. 		debug_print("vint", "cleanup cmp_activity_cleanup()\n") 
  16. 	end 
  17. 	 
  18. 	--game_peg_unload(Cmp_image) 
  19. end 
  20.  
  21. function cmp_activity_first_frame() 
  22. 	--Do nothing 
  23. 	local h = vint_object_find("background_force_black", 0, Cmp_common_doc) 
  24. 	vint_set_property(h, "visible", true) 
  25.  
  26. 	local h = vint_object_find("background_base", 0, Cmp_common_doc) 
  27. 	vint_set_property(h, "background", false)	 
  28. end 
  29.  
  30. ------------------------------------------------------------- 
  31. --Populates the script from the dataresponder... 
  32. ------------------------------------------------------------- 
  33.  
  34. -- @param	mission_name						This is the mission name... "DEATH AT SMILING JACKS" 
  35. -- @param	layout								"Left" or "Right" formats		(Not used by cmp_common JMH, it is sent in as a paremeter 11/3/2010) 
  36. -- @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. 
  37.  
  38. -- @param	cash_reward							This is the cash reward... "4000" 
  39. -- @param	cash_multiplier					Multiplier for cash			"4.0" 
  40. -- @param	cash_reward_inc_multiplier		Cash_reward with the multiplier... "12000" (This could be calculated internally) 
  41.  
  42. -- @param	respect_points_old				Respect points before... 
  43. -- @param	respect_pct_old					Respect percentage before... 
  44. -- @param	respect_level_old					Respect level before... 
  45.  
  46. -- @param	respect_points_new				Respect points after... 
  47. -- @param	respect_pct_new					Respect percent after... 
  48. -- @param	respect_level_new					Respect level after... 
  49.  
  50. -- @param	respect_multiplier				Respect multiplier "2.0" 
  51. -- @param	respect_points_multiplier		Respect points after multiplier 
  52. -- @param	respect_pct_multiplier			Respect percent after multiplier 
  53. -- @param	respect_level_multiplier		Respect level after multiplier 
  54.  
  55. -- @param	district_pct_old					District percent before... 
  56. -- @param	district_pct_new					District percent after... 
  57. -- @param	district_cash_per_day			Cash per day... 
  58.  
  59. function cmp_activity_populate(unlockables_to_follow, mission_number, 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, district_pct_old, district_pct_new, district_cash_per_day, district_team_name, image) 
  60. --[[ 
  61. 	debug_print("vint", "unlockable# = " 						.. var_to_string(unlockables_to_follow).."\n") 
  62. 	debug_print("vint", "mission number = " 					.. var_to_string(mission_number).."\n") 
  63. 	debug_print("vint", "mission name = " 					.. var_to_string(mission_name).."\n") 
  64. 	debug_print("vint", "layout number = " 					.. var_to_string(layout).."\n") 
  65. 	debug_print("vint", "cash_reward" 							.. var_to_string(cash_reward).."\n") 
  66. 	debug_print("vint", "cash_multiplier = " 					.. var_to_string(cash_multiplier).."\n") 
  67. 	debug_print("vint", "cash_reward_inc_multiplier = " 	.. var_to_string(cash_reward_inc_multiplier).."\n") 
  68. 	debug_print("vint", "respect_points_old = " 				.. var_to_string(respect_points_old).."\n") 
  69. 	debug_print("vint", "respect_pct_old = " 					.. var_to_string(respect_pct_old).."\n") 
  70. 	debug_print("vint", "respect_level_old = " 				.. var_to_string(respect_level_old).."\n") 
  71. 	debug_print("vint", "respect points_new = " 				.. var_to_string(respect_points_new).."\n") 
  72. 	debug_print("vint", "respect_pct_new = " 					.. var_to_string(respect_pct_new).."\n") 
  73. 	debug_print("vint", "respect_level_new = " 				.. var_to_string(respect_level_new).."\n") 
  74. 	debug_print("vint", "respect_multiplier = " 				.. var_to_string(respect_multiplier).."\n") 
  75. 	debug_print("vint", "respect_points_multiplier = " 	.. var_to_string(respect_points_multiplier).."\n") 
  76. 	debug_print("vint", "respect_pct_multiplier = " 		.. var_to_string(respect_pct_multiplier).."\n") 
  77. 	debug_print("vint", "respect_level_multiplier = " 		.. var_to_string(respect_level_multiplier).."\n") 
  78. 	debug_print("vint", "district_pct_old = " 				.. var_to_string(district_pct_new).."\n") 
  79. 	debug_print("vint", "district_pct_new = " 				.. var_to_string(district_pct_new).."\n") 
  80. 	debug_print("vint", "district_cash_per_day = " 			.. var_to_string(district_cash_per_day).."\n") 
  81. 	debug_print("vint", "district_team_name = " 				.. var_to_string(district_team_name).."\n") 
  82. ]] 
  83. 	if image == nil or image == "" then 
  84. 		image = "ui_cmp_tank_mayhem" 
  85. 	end 
  86. 	 
  87. 	-- Store our image name to global... 
  88. 	Cmp_image = image 
  89. 	 
  90. 	--Callback with image... 
  91. 	game_peg_load_with_cb("cmp_common_image_loaded", 1, image) 
  92.  
  93. 	Cmp_activity_seq[1].type = CMP_SCREEN_TITLE_INDEX 
  94. 	Cmp_activity_seq[1].title_string = mission_name 
  95. 	Cmp_activity_seq[1].image = image 
  96.  
  97. 	Cmp_activity_seq[2].type = CMP_SCREEN_CASH_INDEX 
  98. 	Cmp_activity_seq[2].cash_reward = cash_reward 
  99. 	Cmp_activity_seq[2].cash_multiplier = cash_multiplier 
  100. 	Cmp_activity_seq[2].cash_reward_inc_multiplier = cash_reward_inc_multiplier 
  101.  
  102. 	Cmp_activity_seq[3].respect_points_old 			= respect_points_old 			 
  103. 	Cmp_activity_seq[3].respect_pct_old					= respect_pct_old				 
  104. 	Cmp_activity_seq[3].respect_level_old				= respect_level_old			 
  105. 	Cmp_activity_seq[3].respect_points_new				= respect_points_new			 
  106. 	Cmp_activity_seq[3].respect_pct_new					= respect_pct_new				 
  107. 	Cmp_activity_seq[3].respect_level_new				= respect_level_new			 
  108. 	Cmp_activity_seq[3].respect_multiplier				= respect_multiplier			 
  109. 	Cmp_activity_seq[3].respect_points_multiplier	= respect_points_multiplier	 
  110. 	Cmp_activity_seq[3].respect_pct_multiplier		= respect_pct_multiplier		 
  111. 	Cmp_activity_seq[3].respect_level_multiplier		= respect_level_multiplier	 
  112. 	 
  113. 	Cmp_activity_seq[4].district_pct_old			= district_pct_old 
  114. 	Cmp_activity_seq[4].district_pct_new			= district_pct_new  
  115. 	Cmp_activity_seq[4].district_cash_per_day		= district_cash_per_day 
  116. 	Cmp_activity_seq[4].district_team_name			=  district_team_name 
  117. 	 
  118. --	Cmp_activity_seq[4].district_pct_old			= .22 --district_pct_new --.22 
  119. --	Cmp_activity_seq[4].district_pct_new			= .325 --district_pct_new --.325 
  120. --	Cmp_activity_seq[4].district_cash_per_day		= 3000 --district_cash_per_day -- 3000 
  121. --	Cmp_activity_seq[4].district_team_name			= "Luchador" --"Luchador" 
  122.  
  123. 	--Do we show rewards or not? 
  124. 	if unlockables_to_follow > 0 then 
  125. 		Cmp_activity_seq[5] = {} 
  126. 		Cmp_activity_seq[5].type = CMP_SCREEN_REWARD_INDEX 
  127. 		Cmp_activity_seq[5].rewards_count = unlockables_to_follow 
  128. 	else  
  129. 		--Swap out unlockables with Completion... 
  130. 		Cmp_activity_seq[5] = table_clone(Cmp_activity_seq[6]) 
  131. 		Cmp_activity_seq[6] = nil 
  132. 	end 
  133. end 
  134.  
  135. Cmp_activity_seq = { 
  136. 	[1] = { 
  137. 		type 				= CMP_SCREEN_TITLE_INDEX, 
  138. 		title_string 	= "DEATH AT SMILING JACKS", 
  139. 		image				= 0, 
  140. 		on_start			= cmp_activity_first_frame, 
  141. 	}, 
  142. 	[2] = { 
  143. 		type = CMP_SCREEN_CASH_INDEX, 
  144. 		cash_reward						= 20000, 
  145. 		cash_multiplier 				= 45, 
  146. 		cash_reward_inc_multiplier = 38000, 
  147. 		on_start = nil, 
  148. 	}, 
  149. 	[3] = { 
  150. 		type = CMP_SCREEN_RESPECT_INDEX, 
  151. 		on_start = nil, 
  152. 		respect_points_old			= 200, 
  153. 		respect_pct_old				= .4, 
  154. 		respect_level_old				=	2, 
  155. 		 
  156. 		respect_points_new			= 2000, 
  157. 		respect_pct_new				= .5, 
  158. 		respect_level_new				= 3, 
  159. 		respect_multiplier			= 40, 
  160. 		 
  161. 		respect_points_multiplier	=	2000,	 
  162. 		respect_pct_multiplier		= 	.5, 
  163. 		respect_level_multiplier	=	5,	 
  164. 	},	 
  165. 	[4] = { 
  166. 		type = CMP_SCREEN_CONTROL_INDEX, 
  167. 		on_start = nil, 
  168. 		district_pct_old			= .22, 
  169. 		district_pct_new			= .325, 
  170. 		district_cash_per_day	= 3000, 
  171. 		district_team_name		= "Luchador", 
  172. 	}, 
  173. 	[5] = { 
  174. 		type = CMP_SCREEN_REWARD_INDEX, 
  175. 		rewards_count = 0 
  176. 	}, 
  177. 	[6] = { 
  178. 		type = CMP_SCREEN_COOP_WAIT_INDEX, 
  179. 	}, 
  180. } 
  181.