Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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.
- First, we'll start off with Dive Twister.
- <?
- // DIVE TWISTER
- $ability = array(
- 'ability_name' => 'Dive Twister',
- 'ability_token' => 'dive-twister',
- 'ability_game' => 'MM04',
- //'ability_group' => 'MM04/Weapons/031',
- 'ability_group' => 'MM04/Weapons/025T2',
- '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!',
- 'ability_type' => 'missile',
- 'ability_type2' => 'water',
- 'ability_energy' => 8,
- 'ability_damage' => 24,
- 'ability_recovery2' => 20,
- 'ability_recovery2_percent' => true,
- 'ability_accuracy' => 98,
- 'ability_function' => function($objects){
- // Extract all objects into the current scope
- extract($objects);
- // Target the opposing robot
- $this_ability->target_options_update(array(
- 'frame' => 'slide',
- 'success' => array(0, 75, 0, 10, $this_robot->print_name().' uses '.$this_ability->print_name().'!')
- ));
- $this_robot->trigger_target($target_robot, $this_ability);
- // Inflict damage on the opposing robot
- $this_ability->damage_options_update(array(
- 'kind' => 'energy',
- 'kickback' => array(10, 0, 0),
- 'success' => array(1, -55, 0, 10, 'The '.$this_ability->print_name().' crashed into the target!'),
- 'failure' => array(1, -75, 0, -10, 'The '.$this_ability->print_name().' missed the target…')
- ));
- $this_ability->recovery_options_update(array(
- 'kind' => 'energy',
- 'frame' => 'taunt',
- 'kickback' => array(10, 0, 0),
- 'success' => array(1, -35, 0, 10, 'The '.$this_ability->print_name().' invigorated the target!'),
- 'failure' => array(1, -75, 0, -10, 'The '.$this_ability->print_name().' missed the target…')
- ));
- $energy_damage_amount = $this_ability->ability_damage;
- $target_robot->trigger_damage($this_robot, $this_ability, $energy_damage_amount);
- // Return true on success
- return true;
- }
- );
- ?>
- 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.
- <?
- // HOMING BLITZKRIEG
- $ability = array(
- 'ability_name' => 'Homing Blitzkrieg',
- 'ability_token' => 'homing-blitzkrieg',
- 'ability_game' => 'MM08',
- //'ability_group' => 'MM08/Weapons/031',
- 'ability_group' => 'MM08/Weapons/057T2',
- '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.',
- 'ability_type' => 'missile',
- 'ability_energy' => 8,
- 'ability_damage' => 28,
- 'ability_accuracy' => 99,
- 'ability_function' => function($objects){
- // Extract all objects into the current scope
- extract($objects);
- // Count the number of active robots on the target's side of the field
- $target_robot_ids = array();
- $target_robots_active = $target_player->values['robots_active'];
- $target_robots_active_count = $target_player->counters['robots_active'];
- $get_random_target_robot = function($robot_id = 0) use($this_battle, $target_player, &$target_robot_ids){
- $robot_info = array();
- $active_robot_keys = array_keys($target_player->values['robots_active']);
- shuffle($active_robot_keys);
- foreach ($active_robot_keys AS $key_key => $robot_key){
- $robot_info = $target_player->values['robots_active'][$robot_key];
- if (!empty($robot_id) && $robot_info['robot_id'] !== $robot_id){ continue; }
- $robot_id = $robot_info['robot_id'];
- $random_target_robot = rpg_game::get_robot($this_battle, $target_player, $robot_info);
- if (!in_array($robot_info['robot_id'], $target_robot_ids)){ $target_robot_ids[] = $robot_id; }
- return $random_target_robot;
- }
- };
- // Collect fourteen random targets, with the first always being active (repeats allowed)
- $target_robot_1 = $get_random_target_robot($target_robot->robot_id);
- $target_robot_2 = $get_random_target_robot();
- $target_robot_3 = $get_random_target_robot();
- $target_robot_4 = $get_random_target_robot();
- $target_robot_5 = $get_random_target_robot();
- $target_robot_6 = $get_random_target_robot();
- $target_robot_7 = $get_random_target_robot();
- $target_robot_8 = $get_random_target_robot();
- $target_robot_9 = $get_random_target_robot();
- $target_robot_10 = $get_random_target_robot();
- $target_robot_11 = $get_random_target_robot();
- $target_robot_12 = $get_random_target_robot();
- $target_robot_13 = $get_random_target_robot();
- $target_robot_14 = $get_random_target_robot();
- // Target the opposing robot
- $this_ability->target_options_update(array(
- 'frame' => 'defend',
- 'success' => array(0, 75, 0, 10, $this_robot->print_name().' unleashes a '.$this_ability->print_name().'!')
- ));
- $this_robot->trigger_target($target_robot, $this_ability);
- // Put the user in a shoot frame for the duration of the attack
- $this_robot->set_frame('shoot');
- // Inflict damage on the first opposing robot
- $this_ability->damage_options_update(array(
- 'kind' => 'energy',
- 'kickback' => array(10, 0, 0),
- 'success' => array(1, -55, 0, 10, 'One of the '.$this_ability->print_name().'\'s missiles collides with the target!'),
- 'failure' => array(1, -75, 0, -10, 'One of the '.$this_ability->print_name().'\'s missiles just missed the target…')
- ));
- $this_ability->recovery_options_update(array(
- 'kind' => 'energy',
- 'frame' => 'taunt',
- 'kickback' => array(10, 0, 0),
- 'success' => array(1, -35, 0, 10, 'The energy of one of the '.$this_ability->print_name().'\'s missiles absorbed by the target!'),
- 'failure' => array(1, -75, 0, -10, 'One of the '.$this_ability->print_name().'\'s missiles just missed the target…')
- ));
- $energy_damage_amount = $this_ability->ability_damage;
- $trigger_options = array('apply_modifiers' => true, 'apply_position_modifiers' => false);
- $target_robot_1->trigger_damage($this_robot, $this_ability, $energy_damage_amount, false, $trigger_options);
- // Inflict damage on the second opposing robot if they're not disabled
- if ($target_robot_2->robot_status !== 'disabled'){
- // Define the success/failure text variables
- $success_text = '';
- $failure_text = '';
- // Adjust damage/recovery text based on results
- if ($this_ability->ability_results['total_strikes'] == 1){ $success_text = 'Another missile hit!'; }
- if ($this_ability->ability_results['total_misses'] == 1){ $failure_text = 'Another missile missed!'; }
- // Attempt to trigger damage to the target robot again
- $this_ability->ability_results_reset();
- $this_ability->damage_options_update(array(
- 'kind' => 'energy',
- 'kickback' => array(10, 0, 0),
- 'success' => array(1, -55, 0, 10, $success_text),
- 'failure' => array(1, -75, 0, -10, $failure_text)
- ));
- $this_ability->recovery_options_update(array(
- 'kind' => 'energy',
- 'frame' => 'taunt',
- 'kickback' => array(-5, 0, 0),
- 'success' => array(1, -35, 0, 10, $success_text),
- 'failure' => array(1, -75, 0, -10, $failure_text)
- ));
- $target_robot_2->trigger_damage($this_robot, $this_ability, $energy_damage_amount, false, $trigger_options);
- }
- // Inflict damage on the third opposing robot if they're not disabled
- if ($target_robot_3->robot_status !== 'disabled'){
- // Define the success/failure text variables
- $success_text = '';
- $failure_text = '';
- // Adjust damage/recovery text based on results
- if ($this_ability->ability_results['total_strikes'] == 1){ $success_text = 'Another missile hit!'; }
- if ($this_ability->ability_results['total_misses'] == 1){ $failure_text = 'Another missile missed!'; }
- // Attempt to trigger damage to the target robot again
- $this_ability->ability_results_reset();
- $this_ability->damage_options_update(array(
- 'kind' => 'energy',
- 'kickback' => array(10, 0, 0),
- 'success' => array(1, -55, 0, 10, $success_text),
- 'failure' => array(1, -75, 0, -10, $failure_text)
- ));
- $this_ability->recovery_options_update(array(
- 'kind' => 'energy',
- 'frame' => 'taunt',
- 'kickback' => array(-5, 0, 0),
- 'success' => array(1, -35, 0, 10, $success_text),
- 'failure' => array(1, -75, 0, -10, $failure_text)
- ));
- $target_robot_3->trigger_damage($this_robot, $this_ability, $energy_damage_amount, false, $trigger_options);
- }
- // Inflict damage on the fourth opposing robot if they're not disabled
- if ($target_robot_4->robot_status !== 'disabled'){
- // Define the success/failure text variables
- $success_text = '';
- $failure_text = '';
- // Adjust damage/recovery text based on results
- if ($this_ability->ability_results['total_strikes'] == 1){ $success_text = 'Another missile hit!'; }
- if ($this_ability->ability_results['total_misses'] == 1){ $failure_text = 'Another missile missed!'; }
- // Attempt to trigger damage to the target robot again
- $this_ability->ability_results_reset();
- $this_ability->damage_options_update(array(
- 'kind' => 'energy',
- 'kickback' => array(10, 0, 0),
- 'success' => array(1, -55, 0, 10, $success_text),
- 'failure' => array(1, -75, 0, -10, $failure_text)
- ));
- $this_ability->recovery_options_update(array(
- 'kind' => 'energy',
- 'frame' => 'taunt',
- 'kickback' => array(-5, 0, 0),
- 'success' => array(1, -35, 0, 10, $success_text),
- 'failure' => array(1, -75, 0, -10, $failure_text)
- ));
- $target_robot_4->trigger_damage($this_robot, $this_ability, $energy_damage_amount, false, $trigger_options);
- }
- // Inflict damage on the fifth opposing robot if they're not disabled
- if ($target_robot_5->robot_status !== 'disabled'){
- // Define the success/failure text variables
- $success_text = '';
- $failure_text = '';
- // Adjust damage/recovery text based on results
- if ($this_ability->ability_results['total_strikes'] == 1){ $success_text = 'Another missile hit!'; }
- if ($this_ability->ability_results['total_misses'] == 1){ $failure_text = 'Another missile missed!'; }
- // Attempt to trigger damage to the target robot again
- $this_ability->ability_results_reset();
- $this_ability->damage_options_update(array(
- 'kind' => 'energy',
- 'kickback' => array(10, 0, 0),
- 'success' => array(1, -55, 0, 10, $success_text),
- 'failure' => array(1, -75, 0, -10, $failure_text)
- ));
- $this_ability->recovery_options_update(array(
- 'kind' => 'energy',
- 'frame' => 'taunt',
- 'kickback' => array(-5, 0, 0),
- 'success' => array(1, -35, 0, 10, $success_text),
- 'failure' => array(1, -75, 0, -10, $failure_text)
- ));
- $target_robot_5->trigger_damage($this_robot, $this_ability, $energy_damage_amount, false, $trigger_options);
- }
- // Inflict damage on the sixth opposing robot if they're not disabled
- if ($target_robot_6->robot_status !== 'disabled'){
- // Define the success/failure text variables
- $success_text = '';
- $failure_text = '';
- // Adjust damage/recovery text based on results
- if ($this_ability->ability_results['total_strikes'] == 1){ $success_text = 'Another missile hit!'; }
- if ($this_ability->ability_results['total_misses'] == 1){ $failure_text = 'Another missile missed!'; }
- // Attempt to trigger damage to the target robot again
- $this_ability->ability_results_reset();
- $this_ability->damage_options_update(array(
- 'kind' => 'energy',
- 'kickback' => array(10, 0, 0),
- 'success' => array(1, -55, 0, 10, $success_text),
- 'failure' => array(1, -75, 0, -10, $failure_text)
- ));
- $this_ability->recovery_options_update(array(
- 'kind' => 'energy',
- 'frame' => 'taunt',
- 'kickback' => array(-5, 0, 0),
- 'success' => array(1, -35, 0, 10, $success_text),
- 'failure' => array(1, -75, 0, -10, $failure_text)
- ));
- $target_robot_6->trigger_damage($this_robot, $this_ability, $energy_damage_amount, false, $trigger_options);
- }
- // Inflict damage on the seventh opposing robot if they're not disabled
- if ($target_robot_7->robot_status !== 'disabled'){
- // Define the success/failure text variables
- $success_text = '';
- $failure_text = '';
- // Adjust damage/recovery text based on results
- if ($this_ability->ability_results['total_strikes'] == 1){ $success_text = 'Another missile hit!'; }
- if ($this_ability->ability_results['total_misses'] == 1){ $failure_text = 'Another missile missed!'; }
- // Attempt to trigger damage to the target robot again
- $this_ability->ability_results_reset();
- $this_ability->damage_options_update(array(
- 'kind' => 'energy',
- 'kickback' => array(10, 0, 0),
- 'success' => array(1, -55, 0, 10, $success_text),
- 'failure' => array(1, -75, 0, -10, $failure_text)
- ));
- $this_ability->recovery_options_update(array(
- 'kind' => 'energy',
- 'frame' => 'taunt',
- 'kickback' => array(-5, 0, 0),
- 'success' => array(1, -35, 0, 10, $success_text),
- 'failure' => array(1, -75, 0, -10, $failure_text)
- ));
- $target_robot_7->trigger_damage($this_robot, $this_ability, $energy_damage_amount, false, $trigger_options);
- }
- // Inflict damage on the eighth opposing robot if they're not disabled
- if ($target_robot_8->robot_status !== 'disabled'){
- // Define the success/failure text variables
- $success_text = '';
- $failure_text = '';
- // Adjust damage/recovery text based on results
- if ($this_ability->ability_results['total_strikes'] == 1){ $success_text = 'Another missile hit!'; }
- if ($this_ability->ability_results['total_misses'] == 1){ $failure_text = 'Another missile missed!'; }
- // Attempt to trigger damage to the target robot again
- $this_ability->ability_results_reset();
- $this_ability->damage_options_update(array(
- 'kind' => 'energy',
- 'kickback' => array(10, 0, 0),
- 'success' => array(1, -55, 0, 10, $success_text),
- 'failure' => array(1, -75, 0, -10, $failure_text)
- ));
- $this_ability->recovery_options_update(array(
- 'kind' => 'energy',
- 'frame' => 'taunt',
- 'kickback' => array(-5, 0, 0),
- 'success' => array(1, -35, 0, 10, $success_text),
- 'failure' => array(1, -75, 0, -10, $failure_text)
- ));
- $target_robot_8->trigger_damage($this_robot, $this_ability, $energy_damage_amount, false, $trigger_options);
- }
- // Inflict damage on the ninth opposing robot if they're not disabled
- if ($target_robot_9->robot_status !== 'disabled'){
- // Define the success/failure text variables
- $success_text = '';
- $failure_text = '';
- // Adjust damage/recovery text based on results
- if ($this_ability->ability_results['total_strikes'] == 1){ $success_text = 'Another missile hit!'; }
- if ($this_ability->ability_results['total_misses'] == 1){ $failure_text = 'Another missile missed!'; }
- // Attempt to trigger damage to the target robot again
- $this_ability->ability_results_reset();
- $this_ability->damage_options_update(array(
- 'kind' => 'energy',
- 'kickback' => array(10, 0, 0),
- 'success' => array(1, -55, 0, 10, $success_text),
- 'failure' => array(1, -75, 0, -10, $failure_text)
- ));
- $this_ability->recovery_options_update(array(
- 'kind' => 'energy',
- 'frame' => 'taunt',
- 'kickback' => array(-5, 0, 0),
- 'success' => array(1, -35, 0, 10, $success_text),
- 'failure' => array(1, -75, 0, -10, $failure_text)
- ));
- $target_robot_9->trigger_damage($this_robot, $this_ability, $energy_damage_amount, false, $trigger_options);
- }
- // Inflict damage on the tenth opposing robot if they're not disabled
- if ($target_robot_10->robot_status !== 'disabled'){
- // Define the success/failure text variables
- $success_text = '';
- $failure_text = '';
- // Adjust damage/recovery text based on results
- if ($this_ability->ability_results['total_strikes'] == 1){ $success_text = 'Another missile hit!'; }
- if ($this_ability->ability_results['total_misses'] == 1){ $failure_text = 'Another missile missed!'; }
- // Attempt to trigger damage to the target robot again
- $this_ability->ability_results_reset();
- $this_ability->damage_options_update(array(
- 'kind' => 'energy',
- 'kickback' => array(10, 0, 0),
- 'success' => array(1, -55, 0, 10, $success_text),
- 'failure' => array(1, -75, 0, -10, $failure_text)
- ));
- $this_ability->recovery_options_update(array(
- 'kind' => 'energy',
- 'frame' => 'taunt',
- 'kickback' => array(-5, 0, 0),
- 'success' => array(1, -35, 0, 10, $success_text),
- 'failure' => array(1, -75, 0, -10, $failure_text)
- ));
- $target_robot_10->trigger_damage($this_robot, $this_ability, $energy_damage_amount, false, $trigger_options);
- }
- // Inflict damage on the eleventh opposing robot if they're not disabled
- if ($target_robot_11->robot_status !== 'disabled'){
- // Define the success/failure text variables
- $success_text = '';
- $failure_text = '';
- // Adjust damage/recovery text based on results
- if ($this_ability->ability_results['total_strikes'] == 1){ $success_text = 'Another missile hit!'; }
- if ($this_ability->ability_results['total_misses'] == 1){ $failure_text = 'Another missile missed!'; }
- // Attempt to trigger damage to the target robot again
- $this_ability->ability_results_reset();
- $this_ability->damage_options_update(array(
- 'kind' => 'energy',
- 'kickback' => array(10, 0, 0),
- 'success' => array(1, -55, 0, 10, $success_text),
- 'failure' => array(1, -75, 0, -10, $failure_text)
- ));
- $this_ability->recovery_options_update(array(
- 'kind' => 'energy',
- 'frame' => 'taunt',
- 'kickback' => array(-5, 0, 0),
- 'success' => array(1, -35, 0, 10, $success_text),
- 'failure' => array(1, -75, 0, -10, $failure_text)
- ));
- $target_robot_11->trigger_damage($this_robot, $this_ability, $energy_damage_amount, false, $trigger_options);
- }
- // Inflict damage on the twelth opposing robot if they're not disabled
- if ($target_robot_12->robot_status !== 'disabled'){
- // Define the success/failure text variables
- $success_text = '';
- $failure_text = '';
- // Adjust damage/recovery text based on results
- if ($this_ability->ability_results['total_strikes'] == 1){ $success_text = 'Another missile hit!'; }
- if ($this_ability->ability_results['total_misses'] == 1){ $failure_text = 'Another missile missed!'; }
- // Attempt to trigger damage to the target robot again
- $this_ability->ability_results_reset();
- $this_ability->damage_options_update(array(
- 'kind' => 'energy',
- 'kickback' => array(10, 0, 0),
- 'success' => array(1, -55, 0, 10, $success_text),
- 'failure' => array(1, -75, 0, -10, $failure_text)
- ));
- $this_ability->recovery_options_update(array(
- 'kind' => 'energy',
- 'frame' => 'taunt',
- 'kickback' => array(-5, 0, 0),
- 'success' => array(1, -35, 0, 10, $success_text),
- 'failure' => array(1, -75, 0, -10, $failure_text)
- ));
- $target_robot_12->trigger_damage($this_robot, $this_ability, $energy_damage_amount, false, $trigger_options);
- }
- // Inflict damage on the thirteenth opposing robot if they're not disabled
- if ($target_robot_13->robot_status !== 'disabled'){
- // Define the success/failure text variables
- $success_text = '';
- $failure_text = '';
- // Adjust damage/recovery text based on results
- if ($this_ability->ability_results['total_strikes'] == 1){ $success_text = 'Another missile hit!'; }
- if ($this_ability->ability_results['total_misses'] == 1){ $failure_text = 'Another missile missed!'; }
- // Attempt to trigger damage to the target robot again
- $this_ability->ability_results_reset();
- $this_ability->damage_options_update(array(
- 'kind' => 'energy',
- 'kickback' => array(10, 0, 0),
- 'success' => array(1, -55, 0, 10, $success_text),
- 'failure' => array(1, -75, 0, -10, $failure_text)
- ));
- $this_ability->recovery_options_update(array(
- 'kind' => 'energy',
- 'frame' => 'taunt',
- 'kickback' => array(-5, 0, 0),
- 'success' => array(1, -35, 0, 10, $success_text),
- 'failure' => array(1, -75, 0, -10, $failure_text)
- ));
- $target_robot_13->trigger_damage($this_robot, $this_ability, $energy_damage_amount, false, $trigger_options);
- }
- // Inflict damage on the fourteenth opposing robot if they're not disabled
- if ($target_robot_14->robot_status !== 'disabled'){
- // Define the success/failure text variables
- $success_text = '';
- $failure_text = '';
- // Adjust damage/recovery text based on results
- if ($this_ability->ability_results['total_strikes'] == 1){ $success_text = 'Another missile hit!'; }
- if ($this_ability->ability_results['total_misses'] == 1){ $failure_text = 'Another missile missed!'; }
- // Attempt to trigger damage to the target robot again
- $this_ability->ability_results_reset();
- $this_ability->damage_options_update(array(
- 'kind' => 'energy',
- 'kickback' => array(10, 0, 0),
- 'success' => array(1, -55, 0, 10, $success_text),
- 'failure' => array(1, -75, 0, -10, $failure_text)
- ));
- $this_ability->recovery_options_update(array(
- 'kind' => 'energy',
- 'frame' => 'taunt',
- 'kickback' => array(-5, 0, 0),
- 'success' => array(1, -35, 0, 10, $success_text),
- 'failure' => array(1, -75, 0, -10, $failure_text)
- ));
- $target_robot_14->trigger_damage($this_robot, $this_ability, $energy_damage_amount, false, $trigger_options);
- }
- // Return the user to their base frame now that we're FINALLY done
- $this_robot->set_frame('base');
- // Loop through all robots on the target side and disable any that need it
- $target_robots_active = $target_player->get_robots();
- foreach ($target_robots_active AS $key => $robot){
- if ($robot->robot_id == $target_robot->robot_id){ $temp_target_robot = $target_robot; }
- else { $temp_target_robot = $robot; }
- if (($temp_target_robot->robot_energy < 1 || $temp_target_robot->robot_status == 'disabled')
- && empty($temp_target_robot->flags['apply_disabled_state'])){
- $temp_target_robot->trigger_disabled($this_robot);
- }
- }
- // Return true on success
- return true;
- }
- );
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement