Advertisement
Rotomslashblast

MMRPG Dive Twister Update

Jan 28th, 2020
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 26.78 KB | None | 0 0
  1. Okay, instead of merely suggesting ideas for MMRPG, I'm just gonna make a bunch of code to go along with said ideas this time around. I call this the "Dive Twister Update" mainly because I initially wanted to make Dive Twister a thing, but then discovered Dive Blitzkrieg was a thing, and so I decided to rework it into a T2 for Search Man. However, this would mean that I'd have to do Homing Sniper, but at the same time my idea, that it would let you select up to 4 enemy bots, but would get stronger and more accurate if you targeted less bots, was too complex for me to do, so I'm gonna let someone else take care of that.
  2.  
  3.  
  4. First, we'll start off with Dive Twister.
  5.  
  6.  
  7. <?
  8. // DIVE TWISTER
  9. $ability = array(
  10. 'ability_name' => 'Dive Twister',
  11. 'ability_token' => 'dive-twister',
  12. 'ability_game' => 'MM04',
  13. //'ability_group' => 'MM04/Weapons/031',
  14. 'ability_group' => 'MM04/Weapons/025T2',
  15. 'ability_description' => 'The user propells itself toward the target using a high speed twister to deal massive damage with a {RECOVERY2}% chance of critical hit!',
  16. 'ability_type' => 'missile',
  17. 'ability_type2' => 'water',
  18. 'ability_energy' => 8,
  19. 'ability_damage' => 24,
  20. 'ability_recovery2' => 20,
  21. 'ability_recovery2_percent' => true,
  22. 'ability_accuracy' => 98,
  23. 'ability_function' => function($objects){
  24.  
  25. // Extract all objects into the current scope
  26. extract($objects);
  27.  
  28. // Target the opposing robot
  29. $this_ability->target_options_update(array(
  30. 'frame' => 'slide',
  31. 'success' => array(0, 75, 0, 10, $this_robot->print_name().' uses '.$this_ability->print_name().'!')
  32. ));
  33. $this_robot->trigger_target($target_robot, $this_ability);
  34.  
  35. // Inflict damage on the opposing robot
  36. $this_ability->damage_options_update(array(
  37. 'kind' => 'energy',
  38. 'kickback' => array(10, 0, 0),
  39. 'success' => array(1, -55, 0, 10, 'The '.$this_ability->print_name().' crashed into the target!'),
  40. 'failure' => array(1, -75, 0, -10, 'The '.$this_ability->print_name().' missed the target&hellip;')
  41. ));
  42. $this_ability->recovery_options_update(array(
  43. 'kind' => 'energy',
  44. 'frame' => 'taunt',
  45. 'kickback' => array(10, 0, 0),
  46. 'success' => array(1, -35, 0, 10, 'The '.$this_ability->print_name().' invigorated the target!'),
  47. 'failure' => array(1, -75, 0, -10, 'The '.$this_ability->print_name().' missed the target&hellip;')
  48. ));
  49. $energy_damage_amount = $this_ability->ability_damage;
  50. $target_robot->trigger_damage($this_robot, $this_ability, $energy_damage_amount);
  51.  
  52. // Return true on success
  53. return true;
  54.  
  55. }
  56. );
  57. ?>
  58.  
  59.  
  60. Alright, now here's Homing Blitzkrieg, which was formerly an unused T3 for Dive Man called Dive Blitzkrieg. This move is supposed to hit 14 random enemies with Missile-type damage, and then lower the user's attack 2 stages. Yeah, this one would be absolute terror incarnate with a Reverse Module Search Man. Like, pre-nerf Rain Flush levels of terror.
  61.  
  62.  
  63. <?
  64. // HOMING BLITZKRIEG
  65. $ability = array(
  66. 'ability_name' => 'Homing Blitzkrieg',
  67. 'ability_token' => 'homing-blitzkrieg',
  68. 'ability_game' => 'MM08',
  69. //'ability_group' => 'MM08/Weapons/031',
  70. 'ability_group' => 'MM08/Weapons/057T2',
  71. 'ability_description' => 'The user summons a deadly storm of heat-seeking missiles upon random enemies on the opponent\'s side of the field, dealing massive damage to them! The user's attack stat severely falls after each use, however.',
  72. 'ability_type' => 'missile',
  73. 'ability_energy' => 8,
  74. 'ability_damage' => 28,
  75. 'ability_accuracy' => 99,
  76. 'ability_function' => function($objects){
  77.  
  78. // Extract all objects into the current scope
  79. extract($objects);
  80.  
  81. // Count the number of active robots on the target's side of the field
  82. $target_robot_ids = array();
  83. $target_robots_active = $target_player->values['robots_active'];
  84. $target_robots_active_count = $target_player->counters['robots_active'];
  85. $get_random_target_robot = function($robot_id = 0) use($this_battle, $target_player, &$target_robot_ids){
  86. $robot_info = array();
  87. $active_robot_keys = array_keys($target_player->values['robots_active']);
  88. shuffle($active_robot_keys);
  89. foreach ($active_robot_keys AS $key_key => $robot_key){
  90. $robot_info = $target_player->values['robots_active'][$robot_key];
  91. if (!empty($robot_id) && $robot_info['robot_id'] !== $robot_id){ continue; }
  92. $robot_id = $robot_info['robot_id'];
  93. $random_target_robot = rpg_game::get_robot($this_battle, $target_player, $robot_info);
  94. if (!in_array($robot_info['robot_id'], $target_robot_ids)){ $target_robot_ids[] = $robot_id; }
  95. return $random_target_robot;
  96. }
  97. };
  98.  
  99. // Collect fourteen random targets, with the first always being active (repeats allowed)
  100. $target_robot_1 = $get_random_target_robot($target_robot->robot_id);
  101. $target_robot_2 = $get_random_target_robot();
  102. $target_robot_3 = $get_random_target_robot();
  103. $target_robot_4 = $get_random_target_robot();
  104. $target_robot_5 = $get_random_target_robot();
  105. $target_robot_6 = $get_random_target_robot();
  106. $target_robot_7 = $get_random_target_robot();
  107. $target_robot_8 = $get_random_target_robot();
  108. $target_robot_9 = $get_random_target_robot();
  109. $target_robot_10 = $get_random_target_robot();
  110. $target_robot_11 = $get_random_target_robot();
  111. $target_robot_12 = $get_random_target_robot();
  112. $target_robot_13 = $get_random_target_robot();
  113. $target_robot_14 = $get_random_target_robot();
  114.  
  115. // Target the opposing robot
  116. $this_ability->target_options_update(array(
  117. 'frame' => 'defend',
  118. 'success' => array(0, 75, 0, 10, $this_robot->print_name().' unleashes a '.$this_ability->print_name().'!')
  119. ));
  120. $this_robot->trigger_target($target_robot, $this_ability);
  121.  
  122. // Put the user in a shoot frame for the duration of the attack
  123. $this_robot->set_frame('shoot');
  124.  
  125. // Inflict damage on the first opposing robot
  126. $this_ability->damage_options_update(array(
  127. 'kind' => 'energy',
  128. 'kickback' => array(10, 0, 0),
  129. 'success' => array(1, -55, 0, 10, 'One of the '.$this_ability->print_name().'\'s missiles collides with the target!'),
  130. 'failure' => array(1, -75, 0, -10, 'One of the '.$this_ability->print_name().'\'s missiles just missed the target&hellip;')
  131. ));
  132. $this_ability->recovery_options_update(array(
  133. 'kind' => 'energy',
  134. 'frame' => 'taunt',
  135. 'kickback' => array(10, 0, 0),
  136. 'success' => array(1, -35, 0, 10, 'The energy of one of the '.$this_ability->print_name().'\'s missiles absorbed by the target!'),
  137. 'failure' => array(1, -75, 0, -10, 'One of the '.$this_ability->print_name().'\'s missiles just missed the target&hellip;')
  138. ));
  139. $energy_damage_amount = $this_ability->ability_damage;
  140. $trigger_options = array('apply_modifiers' => true, 'apply_position_modifiers' => false);
  141. $target_robot_1->trigger_damage($this_robot, $this_ability, $energy_damage_amount, false, $trigger_options);
  142.  
  143. // Inflict damage on the second opposing robot if they're not disabled
  144. if ($target_robot_2->robot_status !== 'disabled'){
  145.  
  146. // Define the success/failure text variables
  147. $success_text = '';
  148. $failure_text = '';
  149.  
  150. // Adjust damage/recovery text based on results
  151. if ($this_ability->ability_results['total_strikes'] == 1){ $success_text = 'Another missile hit!'; }
  152. if ($this_ability->ability_results['total_misses'] == 1){ $failure_text = 'Another missile missed!'; }
  153.  
  154. // Attempt to trigger damage to the target robot again
  155. $this_ability->ability_results_reset();
  156. $this_ability->damage_options_update(array(
  157. 'kind' => 'energy',
  158. 'kickback' => array(10, 0, 0),
  159. 'success' => array(1, -55, 0, 10, $success_text),
  160. 'failure' => array(1, -75, 0, -10, $failure_text)
  161. ));
  162. $this_ability->recovery_options_update(array(
  163. 'kind' => 'energy',
  164. 'frame' => 'taunt',
  165. 'kickback' => array(-5, 0, 0),
  166. 'success' => array(1, -35, 0, 10, $success_text),
  167. 'failure' => array(1, -75, 0, -10, $failure_text)
  168. ));
  169. $target_robot_2->trigger_damage($this_robot, $this_ability, $energy_damage_amount, false, $trigger_options);
  170.  
  171. }
  172.  
  173. // Inflict damage on the third opposing robot if they're not disabled
  174. if ($target_robot_3->robot_status !== 'disabled'){
  175.  
  176. // Define the success/failure text variables
  177. $success_text = '';
  178. $failure_text = '';
  179.  
  180. // Adjust damage/recovery text based on results
  181. if ($this_ability->ability_results['total_strikes'] == 1){ $success_text = 'Another missile hit!'; }
  182. if ($this_ability->ability_results['total_misses'] == 1){ $failure_text = 'Another missile missed!'; }
  183.  
  184. // Attempt to trigger damage to the target robot again
  185. $this_ability->ability_results_reset();
  186. $this_ability->damage_options_update(array(
  187. 'kind' => 'energy',
  188. 'kickback' => array(10, 0, 0),
  189. 'success' => array(1, -55, 0, 10, $success_text),
  190. 'failure' => array(1, -75, 0, -10, $failure_text)
  191. ));
  192. $this_ability->recovery_options_update(array(
  193. 'kind' => 'energy',
  194. 'frame' => 'taunt',
  195. 'kickback' => array(-5, 0, 0),
  196. 'success' => array(1, -35, 0, 10, $success_text),
  197. 'failure' => array(1, -75, 0, -10, $failure_text)
  198. ));
  199. $target_robot_3->trigger_damage($this_robot, $this_ability, $energy_damage_amount, false, $trigger_options);
  200.  
  201. }
  202.  
  203. // Inflict damage on the fourth opposing robot if they're not disabled
  204. if ($target_robot_4->robot_status !== 'disabled'){
  205.  
  206. // Define the success/failure text variables
  207. $success_text = '';
  208. $failure_text = '';
  209.  
  210. // Adjust damage/recovery text based on results
  211. if ($this_ability->ability_results['total_strikes'] == 1){ $success_text = 'Another missile hit!'; }
  212. if ($this_ability->ability_results['total_misses'] == 1){ $failure_text = 'Another missile missed!'; }
  213.  
  214. // Attempt to trigger damage to the target robot again
  215. $this_ability->ability_results_reset();
  216. $this_ability->damage_options_update(array(
  217. 'kind' => 'energy',
  218. 'kickback' => array(10, 0, 0),
  219. 'success' => array(1, -55, 0, 10, $success_text),
  220. 'failure' => array(1, -75, 0, -10, $failure_text)
  221. ));
  222. $this_ability->recovery_options_update(array(
  223. 'kind' => 'energy',
  224. 'frame' => 'taunt',
  225. 'kickback' => array(-5, 0, 0),
  226. 'success' => array(1, -35, 0, 10, $success_text),
  227. 'failure' => array(1, -75, 0, -10, $failure_text)
  228. ));
  229. $target_robot_4->trigger_damage($this_robot, $this_ability, $energy_damage_amount, false, $trigger_options);
  230.  
  231. }
  232.  
  233. // Inflict damage on the fifth opposing robot if they're not disabled
  234. if ($target_robot_5->robot_status !== 'disabled'){
  235.  
  236. // Define the success/failure text variables
  237. $success_text = '';
  238. $failure_text = '';
  239.  
  240. // Adjust damage/recovery text based on results
  241. if ($this_ability->ability_results['total_strikes'] == 1){ $success_text = 'Another missile hit!'; }
  242. if ($this_ability->ability_results['total_misses'] == 1){ $failure_text = 'Another missile missed!'; }
  243.  
  244. // Attempt to trigger damage to the target robot again
  245. $this_ability->ability_results_reset();
  246. $this_ability->damage_options_update(array(
  247. 'kind' => 'energy',
  248. 'kickback' => array(10, 0, 0),
  249. 'success' => array(1, -55, 0, 10, $success_text),
  250. 'failure' => array(1, -75, 0, -10, $failure_text)
  251. ));
  252. $this_ability->recovery_options_update(array(
  253. 'kind' => 'energy',
  254. 'frame' => 'taunt',
  255. 'kickback' => array(-5, 0, 0),
  256. 'success' => array(1, -35, 0, 10, $success_text),
  257. 'failure' => array(1, -75, 0, -10, $failure_text)
  258. ));
  259. $target_robot_5->trigger_damage($this_robot, $this_ability, $energy_damage_amount, false, $trigger_options);
  260.  
  261. }
  262.  
  263. // Inflict damage on the sixth opposing robot if they're not disabled
  264. if ($target_robot_6->robot_status !== 'disabled'){
  265.  
  266. // Define the success/failure text variables
  267. $success_text = '';
  268. $failure_text = '';
  269.  
  270. // Adjust damage/recovery text based on results
  271. if ($this_ability->ability_results['total_strikes'] == 1){ $success_text = 'Another missile hit!'; }
  272. if ($this_ability->ability_results['total_misses'] == 1){ $failure_text = 'Another missile missed!'; }
  273.  
  274. // Attempt to trigger damage to the target robot again
  275. $this_ability->ability_results_reset();
  276. $this_ability->damage_options_update(array(
  277. 'kind' => 'energy',
  278. 'kickback' => array(10, 0, 0),
  279. 'success' => array(1, -55, 0, 10, $success_text),
  280. 'failure' => array(1, -75, 0, -10, $failure_text)
  281. ));
  282. $this_ability->recovery_options_update(array(
  283. 'kind' => 'energy',
  284. 'frame' => 'taunt',
  285. 'kickback' => array(-5, 0, 0),
  286. 'success' => array(1, -35, 0, 10, $success_text),
  287. 'failure' => array(1, -75, 0, -10, $failure_text)
  288. ));
  289. $target_robot_6->trigger_damage($this_robot, $this_ability, $energy_damage_amount, false, $trigger_options);
  290.  
  291. }
  292.  
  293. // Inflict damage on the seventh opposing robot if they're not disabled
  294. if ($target_robot_7->robot_status !== 'disabled'){
  295.  
  296. // Define the success/failure text variables
  297. $success_text = '';
  298. $failure_text = '';
  299.  
  300. // Adjust damage/recovery text based on results
  301. if ($this_ability->ability_results['total_strikes'] == 1){ $success_text = 'Another missile hit!'; }
  302. if ($this_ability->ability_results['total_misses'] == 1){ $failure_text = 'Another missile missed!'; }
  303.  
  304. // Attempt to trigger damage to the target robot again
  305. $this_ability->ability_results_reset();
  306. $this_ability->damage_options_update(array(
  307. 'kind' => 'energy',
  308. 'kickback' => array(10, 0, 0),
  309. 'success' => array(1, -55, 0, 10, $success_text),
  310. 'failure' => array(1, -75, 0, -10, $failure_text)
  311. ));
  312. $this_ability->recovery_options_update(array(
  313. 'kind' => 'energy',
  314. 'frame' => 'taunt',
  315. 'kickback' => array(-5, 0, 0),
  316. 'success' => array(1, -35, 0, 10, $success_text),
  317. 'failure' => array(1, -75, 0, -10, $failure_text)
  318. ));
  319. $target_robot_7->trigger_damage($this_robot, $this_ability, $energy_damage_amount, false, $trigger_options);
  320.  
  321. }
  322.  
  323. // Inflict damage on the eighth opposing robot if they're not disabled
  324. if ($target_robot_8->robot_status !== 'disabled'){
  325.  
  326. // Define the success/failure text variables
  327. $success_text = '';
  328. $failure_text = '';
  329.  
  330. // Adjust damage/recovery text based on results
  331. if ($this_ability->ability_results['total_strikes'] == 1){ $success_text = 'Another missile hit!'; }
  332. if ($this_ability->ability_results['total_misses'] == 1){ $failure_text = 'Another missile missed!'; }
  333.  
  334. // Attempt to trigger damage to the target robot again
  335. $this_ability->ability_results_reset();
  336. $this_ability->damage_options_update(array(
  337. 'kind' => 'energy',
  338. 'kickback' => array(10, 0, 0),
  339. 'success' => array(1, -55, 0, 10, $success_text),
  340. 'failure' => array(1, -75, 0, -10, $failure_text)
  341. ));
  342. $this_ability->recovery_options_update(array(
  343. 'kind' => 'energy',
  344. 'frame' => 'taunt',
  345. 'kickback' => array(-5, 0, 0),
  346. 'success' => array(1, -35, 0, 10, $success_text),
  347. 'failure' => array(1, -75, 0, -10, $failure_text)
  348. ));
  349. $target_robot_8->trigger_damage($this_robot, $this_ability, $energy_damage_amount, false, $trigger_options);
  350.  
  351. }
  352.  
  353. // Inflict damage on the ninth opposing robot if they're not disabled
  354. if ($target_robot_9->robot_status !== 'disabled'){
  355.  
  356. // Define the success/failure text variables
  357. $success_text = '';
  358. $failure_text = '';
  359.  
  360. // Adjust damage/recovery text based on results
  361. if ($this_ability->ability_results['total_strikes'] == 1){ $success_text = 'Another missile hit!'; }
  362. if ($this_ability->ability_results['total_misses'] == 1){ $failure_text = 'Another missile missed!'; }
  363.  
  364. // Attempt to trigger damage to the target robot again
  365. $this_ability->ability_results_reset();
  366. $this_ability->damage_options_update(array(
  367. 'kind' => 'energy',
  368. 'kickback' => array(10, 0, 0),
  369. 'success' => array(1, -55, 0, 10, $success_text),
  370. 'failure' => array(1, -75, 0, -10, $failure_text)
  371. ));
  372. $this_ability->recovery_options_update(array(
  373. 'kind' => 'energy',
  374. 'frame' => 'taunt',
  375. 'kickback' => array(-5, 0, 0),
  376. 'success' => array(1, -35, 0, 10, $success_text),
  377. 'failure' => array(1, -75, 0, -10, $failure_text)
  378. ));
  379. $target_robot_9->trigger_damage($this_robot, $this_ability, $energy_damage_amount, false, $trigger_options);
  380.  
  381. }
  382.  
  383.  
  384. // Inflict damage on the tenth opposing robot if they're not disabled
  385. if ($target_robot_10->robot_status !== 'disabled'){
  386.  
  387. // Define the success/failure text variables
  388. $success_text = '';
  389. $failure_text = '';
  390.  
  391. // Adjust damage/recovery text based on results
  392. if ($this_ability->ability_results['total_strikes'] == 1){ $success_text = 'Another missile hit!'; }
  393. if ($this_ability->ability_results['total_misses'] == 1){ $failure_text = 'Another missile missed!'; }
  394.  
  395. // Attempt to trigger damage to the target robot again
  396. $this_ability->ability_results_reset();
  397. $this_ability->damage_options_update(array(
  398. 'kind' => 'energy',
  399. 'kickback' => array(10, 0, 0),
  400. 'success' => array(1, -55, 0, 10, $success_text),
  401. 'failure' => array(1, -75, 0, -10, $failure_text)
  402. ));
  403. $this_ability->recovery_options_update(array(
  404. 'kind' => 'energy',
  405. 'frame' => 'taunt',
  406. 'kickback' => array(-5, 0, 0),
  407. 'success' => array(1, -35, 0, 10, $success_text),
  408. 'failure' => array(1, -75, 0, -10, $failure_text)
  409. ));
  410. $target_robot_10->trigger_damage($this_robot, $this_ability, $energy_damage_amount, false, $trigger_options);
  411.  
  412. }
  413.  
  414. // Inflict damage on the eleventh opposing robot if they're not disabled
  415. if ($target_robot_11->robot_status !== 'disabled'){
  416.  
  417. // Define the success/failure text variables
  418. $success_text = '';
  419. $failure_text = '';
  420.  
  421. // Adjust damage/recovery text based on results
  422. if ($this_ability->ability_results['total_strikes'] == 1){ $success_text = 'Another missile hit!'; }
  423. if ($this_ability->ability_results['total_misses'] == 1){ $failure_text = 'Another missile missed!'; }
  424.  
  425. // Attempt to trigger damage to the target robot again
  426. $this_ability->ability_results_reset();
  427. $this_ability->damage_options_update(array(
  428. 'kind' => 'energy',
  429. 'kickback' => array(10, 0, 0),
  430. 'success' => array(1, -55, 0, 10, $success_text),
  431. 'failure' => array(1, -75, 0, -10, $failure_text)
  432. ));
  433. $this_ability->recovery_options_update(array(
  434. 'kind' => 'energy',
  435. 'frame' => 'taunt',
  436. 'kickback' => array(-5, 0, 0),
  437. 'success' => array(1, -35, 0, 10, $success_text),
  438. 'failure' => array(1, -75, 0, -10, $failure_text)
  439. ));
  440. $target_robot_11->trigger_damage($this_robot, $this_ability, $energy_damage_amount, false, $trigger_options);
  441.  
  442. }
  443.  
  444. // Inflict damage on the twelth opposing robot if they're not disabled
  445. if ($target_robot_12->robot_status !== 'disabled'){
  446.  
  447. // Define the success/failure text variables
  448. $success_text = '';
  449. $failure_text = '';
  450.  
  451. // Adjust damage/recovery text based on results
  452. if ($this_ability->ability_results['total_strikes'] == 1){ $success_text = 'Another missile hit!'; }
  453. if ($this_ability->ability_results['total_misses'] == 1){ $failure_text = 'Another missile missed!'; }
  454.  
  455. // Attempt to trigger damage to the target robot again
  456. $this_ability->ability_results_reset();
  457. $this_ability->damage_options_update(array(
  458. 'kind' => 'energy',
  459. 'kickback' => array(10, 0, 0),
  460. 'success' => array(1, -55, 0, 10, $success_text),
  461. 'failure' => array(1, -75, 0, -10, $failure_text)
  462. ));
  463. $this_ability->recovery_options_update(array(
  464. 'kind' => 'energy',
  465. 'frame' => 'taunt',
  466. 'kickback' => array(-5, 0, 0),
  467. 'success' => array(1, -35, 0, 10, $success_text),
  468. 'failure' => array(1, -75, 0, -10, $failure_text)
  469. ));
  470. $target_robot_12->trigger_damage($this_robot, $this_ability, $energy_damage_amount, false, $trigger_options);
  471.  
  472. }
  473.  
  474. // Inflict damage on the thirteenth opposing robot if they're not disabled
  475. if ($target_robot_13->robot_status !== 'disabled'){
  476.  
  477. // Define the success/failure text variables
  478. $success_text = '';
  479. $failure_text = '';
  480.  
  481. // Adjust damage/recovery text based on results
  482. if ($this_ability->ability_results['total_strikes'] == 1){ $success_text = 'Another missile hit!'; }
  483. if ($this_ability->ability_results['total_misses'] == 1){ $failure_text = 'Another missile missed!'; }
  484.  
  485. // Attempt to trigger damage to the target robot again
  486. $this_ability->ability_results_reset();
  487. $this_ability->damage_options_update(array(
  488. 'kind' => 'energy',
  489. 'kickback' => array(10, 0, 0),
  490. 'success' => array(1, -55, 0, 10, $success_text),
  491. 'failure' => array(1, -75, 0, -10, $failure_text)
  492. ));
  493. $this_ability->recovery_options_update(array(
  494. 'kind' => 'energy',
  495. 'frame' => 'taunt',
  496. 'kickback' => array(-5, 0, 0),
  497. 'success' => array(1, -35, 0, 10, $success_text),
  498. 'failure' => array(1, -75, 0, -10, $failure_text)
  499. ));
  500. $target_robot_13->trigger_damage($this_robot, $this_ability, $energy_damage_amount, false, $trigger_options);
  501.  
  502. }
  503.  
  504. // Inflict damage on the fourteenth opposing robot if they're not disabled
  505. if ($target_robot_14->robot_status !== 'disabled'){
  506.  
  507. // Define the success/failure text variables
  508. $success_text = '';
  509. $failure_text = '';
  510.  
  511. // Adjust damage/recovery text based on results
  512. if ($this_ability->ability_results['total_strikes'] == 1){ $success_text = 'Another missile hit!'; }
  513. if ($this_ability->ability_results['total_misses'] == 1){ $failure_text = 'Another missile missed!'; }
  514.  
  515. // Attempt to trigger damage to the target robot again
  516. $this_ability->ability_results_reset();
  517. $this_ability->damage_options_update(array(
  518. 'kind' => 'energy',
  519. 'kickback' => array(10, 0, 0),
  520. 'success' => array(1, -55, 0, 10, $success_text),
  521. 'failure' => array(1, -75, 0, -10, $failure_text)
  522. ));
  523. $this_ability->recovery_options_update(array(
  524. 'kind' => 'energy',
  525. 'frame' => 'taunt',
  526. 'kickback' => array(-5, 0, 0),
  527. 'success' => array(1, -35, 0, 10, $success_text),
  528. 'failure' => array(1, -75, 0, -10, $failure_text)
  529. ));
  530. $target_robot_14->trigger_damage($this_robot, $this_ability, $energy_damage_amount, false, $trigger_options);
  531.  
  532. }
  533.  
  534. // Return the user to their base frame now that we're FINALLY done
  535. $this_robot->set_frame('base');
  536.  
  537. // Loop through all robots on the target side and disable any that need it
  538. $target_robots_active = $target_player->get_robots();
  539. foreach ($target_robots_active AS $key => $robot){
  540. if ($robot->robot_id == $target_robot->robot_id){ $temp_target_robot = $target_robot; }
  541. else { $temp_target_robot = $robot; }
  542. if (($temp_target_robot->robot_energy < 1 || $temp_target_robot->robot_status == 'disabled')
  543. && empty($temp_target_robot->flags['apply_disabled_state'])){
  544. $temp_target_robot->trigger_disabled($this_robot);
  545. }
  546. }
  547.  
  548. // Return true on success
  549. return true;
  550.  
  551. }
  552. );
  553. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement