<commit_before><?
// RHYTHM SATELLITE
$ability = array(
    'ability_name' => 'Rhythm Satellite',
    'ability_token' => '<PASSWORD>',
    'ability_game' => 'MMRPG',
    'ability_group' => 'MM00/Weapons/Rhythm',
    'ability_description' => 'The user creates a pair of orbiting satellites that hover behind a target and enhance its attacks. This causes the target to deal double damage from attacks for the next six turns.',
    'ability_type' => 'space',
    'ability_energy' => 4,
    'ability_accuracy' => 100,
    'ability_target' => 'select_this',
    'ability_function' => function($objects){

        // Extract all objects into the current scope
        extract($objects);

        // Define the base attachment duration
        $base_attachment_duration = 6;
        $base_attachment_multiplier = 2.0;

        // Update the ability image if the user is in their alt image
        $alt_image_triggers = array('rhythm_alt', 'rhythm_alt3', 'rhythm_alt5');
        if (in_array($this_robot->robot_image, $alt_image_triggers)){
            $this_ability->set_image($this_ability->ability_token.'-b');
        }

        // Define this ability's attachment token
        $this_attachment_token = 'ability_'.$this_ability->ability_token.'_'.$target_robot->robot_id;
        $this_attachment_info = array(
            'class' => 'ability',
            'ability_token' => $this_ability->ability_token,
            'ability_image' => $this_ability->ability_image,
            'ability_frame' => 2,
            'ability_frame_animate' => array(3, 4, 2),
            'ability_frame_offset' => array('x' => -24, 'y' => 10, 'z' => -18),
            'attachment_token' => $this_attachment_token,
            'attachment_duration' => $base_attachment_duration,
            'attachment_damage_output_booster' => $base_attachment_multiplier,
            'attachment_create' => array(
                'trigger' => 'special',
                'kind' => '',
                'percent' => true,
                'frame' => 'taunt',
                'rates' => array(100, 0, 0),
                'success' => array(2, -24, 10, -18, 'The '.$this_ability->print_name(true).' hover behind '.$target_robot->print_name().'!<br /> '.$target_robot->print_name().'&#39;s weapons were bolstered!'),
                'failure' => array(2, -24, 10, -18, 'The '.$this_ability->print_name(true).' hover behind '.$target_robot->print_name().'!<br /> '.$target_robot->print_name().'&#39;s weapons were bolstered!')
                ),
            'attachment_destroy' => array(
                'trigger' => 'special',
                'kind' => '',
                'type' => '',
                'percent' => true,
                'modifiers' => false,
                'frame' => 'defend',
                'rates' => array(100, 0, 0),
                'success' => array(2, -24, 10, -18,  'The '.$this_ability->print_name(true).' faded away!<br /> '.$target_robot->print_name().'&#39;s weapons returned to normal!'),
                'failure' => array(2, -24, 10, -18, 'The '.$this_ability->print_name(true).' faded away!<br /> '.$target_robot->print_name().'&#39;s weapons returned to normal!')
                )
            );

        // Create the attachment object for this ability
        $this_attachment = rpg_game::get_ability($this_battle, $this_player, $target_robot, $this_attachment_info);

        // If the ability flag was not set, attach the ability to the target
        if (!isset($target_robot->robot_attachments[$this_attachment_token])){

            // Target this robot's self
            $this_ability->target_options_update(array(
                'frame' => 'summon',
                'success' => array(1, 24, 30, 18, $this_robot->print_name().' summons the '.$this_ability->print_name(true).'!')
                ));
            $this_robot->trigger_target($this_robot, $this_ability);

            // If this robot is targetting itself
            if ($this_robot->robot_id == $target_robot->robot_id){

                // Target this robot's self
                $this_attachment->target_options_update($this_attachment_info['attachment_create']);
                $this_robot->trigger_target($this_robot, $this_attachment);

                // Attach this ability attachment to the robot using it
                //$this_attachment_info['ability_frame_animate'] = array(2, 1, 0, 1);
                $this_robot->robot_attachments[$this_attachment_token] = $this_attachment_info;
                $this_robot->update_session();

            }
            // Otherwise if targetting a team mate
            else {

                // Target this robot's self
                $this_robot->robot_frame = 'base';
                $this_robot->update_session();
                $this_attachment->target_options_update($this_attachment_info['attachment_create']);
                $target_robot->trigger_target($target_robot, $this_attachment);

                // Attach this ability attachment to the robot using it
                //$this_attachment_info['ability_frame_animate'] = array(0, 1, 2, 1);
                $target_robot->robot_attachments[$this_attachment_token] = $this_attachment_info;
                $target_robot->update_session();

            }

        }
        // Else if the ability flag was set, reinforce the shield by one more duration point
        else {

            // If this robot is targetting itself
            if ($this_robot->robot_id == $target_robot->robot_id){

                // Collect the attachment from the robot to back up its info
                $this_attachment_info = $this_robot->robot_attachments[$this_attachment_token];
                $this_attachment_info['attachment_duration'] = $base_attachment_duration;
                $this_attachment_info['attachment_damage_output_booster'] = $this_attachment_info['attachment_damage_output_booster'] * $base_attachment_multiplier;
                $this_robot->robot_attachments[$this_attachment_token] = $this_attachment_info;
                $this_robot->update_session();

                // Target the opposing robot
                $this_ability->target_options_update(array(
                    'frame' => 'summon',
                    'success' => array(9, 24, 30, 18, $this_robot->print_name().' amplified the effects of the '.$this_ability->print_name(true).'!<br /> The duration of '.$this_robot->print_name().'&#39;s reinforcement was extended!')
                    ));
                $this_robot->trigger_target($this_robot, $this_ability);

            }
            // Otherwise if targetting a team mate
            else {

                // Collect the attachment from the robot to back up its info
                $this_attachment_info = $target_robot->robot_attachments[$this_attachment_token];
                $this_attachment_info['attachment_duration'] = $base_attachment_duration;
                $this_attachment_info['attachment_damage_output_booster'] = $this_attachment_info['attachment_damage_output_booster'] * $base_attachment_multiplier;
                $target_robot->robot_attachments[$this_attachment_token] = $this_attachment_info;
                $target_robot->update_session();

                // Target the opposing robot
                $this_ability->target_options_update(array(
                    'frame' => 'summon',
                    'success' => array(9, 24, 30, 18, $this_robot->print_name().' amplified the effects of the '.$this_ability->print_name(true).'!<br /> The duration of '.$target_robot->print_name().'&#39;s reinforcement was extended!')
                    ));
                $this_robot->trigger_target($this_robot, $this_ability);

            }

        }

        // Either way, update this attachment's settings to prevent recovery
        $this_attachment->damage_options_update($this_attachment_info['attachment_destroy'], true);
        $this_attachment->recovery_options_update($this_attachment_info['attachment_destroy'], true);
        $this_attachment->update_session();

        // DEBUG
        //$this_battle->events_create(false, false, 'DEBUG', '<pre>Reached the end... '.preg_replace('#\s+#', ' ', print_r(array('ability_id' => $this_ability->ability_id, 'ability_token' => $this_ability->ability_token), true)).'</pre>');


        // Return true on success
        return true;

    },
    'ability_function_onload' => function($objects){

        // Extract all objects into the current scope
        extract($objects);

        // Update the ability image if the user is in their alt image
        $alt_image_triggers = array('rhythm_alt', 'rhythm_alt3', 'rhythm_alt5');
        if (in_array($this_robot->robot_image, $alt_image_triggers)){
            $this_ability->set_image($this_ability->ability_token.'-b');
        }

        // Return true on success
        return true;

        }
    );
?><commit_msg>Tweaked Rhythm Satellite text, fixed target bug<commit_after><?
// RHYTHM SATELLITE
$ability = array(
    'ability_name' => 'Rhythm Satellite',
    'ability_token' => '<PASSWORD>',
    'ability_game' => 'MMRPG',
    'ability_group' => 'MM00/Weapons/Rhythm',
    'ability_description' => 'The user creates a pair of orbiting satellites that hover behind a target and enhance its attacks. This causes the target to deal double damage from attacks for the next six turns.',
    'ability_type' => 'space',
    'ability_energy' => 4,
    'ability_accuracy' => 100,
    'ability_target' => 'select_this',
    'ability_function' => function($objects){

        // Extract all objects into the current scope
        extract($objects);

        // Collect the target robot and correct for bugs
        if ($target_robot->player->player_id == $this_robot->player->player_id){ $temp_ally_robot = $target_robot; }
        else { $temp_ally_robot = $this_robot; }

        // Define the base attachment duration
        $base_attachment_duration = 6;
        $base_attachment_multiplier = 2.0;

        // Update the ability image if the user is in their alt image
        $alt_image_triggers = array('rhythm_alt', 'rhythm_alt3', 'rhythm_alt5');
        if (in_array($this_robot->robot_image, $alt_image_triggers)){
            $this_ability->set_image($this_ability->ability_token.'-b');
        }

        // Define this ability's attachment token
        $this_attachment_token = 'ability_'.$this_ability->ability_token.'_'.$temp_ally_robot->robot_id;
        $this_attachment_info = array(
            'class' => 'ability',
            'ability_token' => $this_ability->ability_token,
            'ability_image' => $this_ability->ability_image,
            'ability_frame' => 2,
            'ability_frame_animate' => array(3, 4, 2),
            'ability_frame_offset' => array('x' => -24, 'y' => 10, 'z' => -18),
            'attachment_token' => $this_attachment_token,
            'attachment_duration' => $base_attachment_duration,
            'attachment_damage_output_booster' => $base_attachment_multiplier,
            'attachment_create' => array(
                'trigger' => 'special',
                'kind' => '',
                'percent' => true,
                'frame' => 'taunt',
                'rates' => array(100, 0, 0),
                'success' => array(2, -24, 10, -18, 'The '.$this_ability->print_name(true).' hover behind '.$temp_ally_robot->print_name().'!<br /> '.$temp_ally_robot->print_name().'&#39;s weapons were reinforced!'),
                'failure' => array(2, -24, 10, -18, 'The '.$this_ability->print_name(true).' hover behind '.$temp_ally_robot->print_name().'!<br /> '.$temp_ally_robot->print_name().'&#39;s weapons were reinforced!')
                ),
            'attachment_destroy' => array(
                'trigger' => 'special',
                'kind' => '',
                'type' => '',
                'percent' => true,
                'modifiers' => false,
                'frame' => 'defend',
                'rates' => array(100, 0, 0),
                'success' => array(2, -24, 10, -18,  'The '.$this_ability->print_name(true).' faded away!<br /> '.$temp_ally_robot->print_name().'&#39;s weapons returned to normal!'),
                'failure' => array(2, -24, 10, -18, 'The '.$this_ability->print_name(true).' faded away!<br /> '.$temp_ally_robot->print_name().'&#39;s weapons returned to normal!')
                )
            );

        // Create the attachment object for this ability
        $this_attachment = rpg_game::get_ability($this_battle, $this_player, $temp_ally_robot, $this_attachment_info);

        // Target this robot's self
        $already_has_satellite = isset($temp_ally_robot->robot_attachments[$this_attachment_token]) ? true : false;
        $this_ability->target_options_update(array(
            'frame' => 'summon',
            'success' => array((!$already_has_satellite ? 1 : 9), 0, 40, 18,
                $this_robot->print_name().' '.(
                    $temp_ally_robot->robot_id == $this_robot->robot_id
                    ? 'targets '.$temp_ally_robot->get_pronoun('reflexive').'...'
                    : 'targets the benched '.$temp_ally_robot->print_name().'!'
                    ).' <br /> '.
                $this_robot->print_name().' '.(!$already_has_satellite ? 'summons the' : 'refreshed '.$temp_ally_robot->get_pronoun('possessive2')).' '.$this_ability->print_name(true).'!'
                )
            ));
        $this_robot->trigger_target($this_robot, $this_ability, array('prevent_default_text' => true));

        // If the ability flag was not set, attach the ability to the target
        if (!$already_has_satellite){

            // If this robot is targetting itself
            if ($this_robot->robot_id == $temp_ally_robot->robot_id){

                // Target this robot's self
                $this_attachment->target_options_update($this_attachment_info['attachment_create']);
                $this_robot->trigger_target($this_robot, $this_attachment);

                // Attach this ability attachment to the robot using it
                //$this_attachment_info['ability_frame_animate'] = array(2, 1, 0, 1);
                $this_robot->robot_attachments[$this_attachment_token] = $this_attachment_info;
                $this_robot->update_session();

            }
            // Otherwise if targetting a team mate
            else {

                // Target this robot's self
                $this_robot->robot_frame = 'base';
                $this_robot->update_session();
                $this_attachment->target_options_update($this_attachment_info['attachment_create']);
                $temp_ally_robot->trigger_target($temp_ally_robot, $this_attachment);

                // Attach this ability attachment to the robot using it
                //$this_attachment_info['ability_frame_animate'] = array(0, 1, 2, 1);
                $temp_ally_robot->robot_attachments[$this_attachment_token] = $this_attachment_info;
                $temp_ally_robot->update_session();

            }

        }
        // Else if the ability flag was set, reinforce the shield by one more duration point
        else {

            // If this robot is targetting itself
            if ($this_robot->robot_id == $temp_ally_robot->robot_id){

                // Collect the attachment from the robot to back up its info
                $this_attachment_info = $this_robot->robot_attachments[$this_attachment_token];
                $this_attachment_info['attachment_duration'] = $base_attachment_duration;
                $this_robot->robot_attachments[$this_attachment_token] = $this_attachment_info;
                $this_robot->update_session();

                // Target the opposing robot
                $this_ability->target_options_update(array(
                    'frame' => 'taunt',
                    'success' => array(9, 24, 30, 18,
                    ' The '.$this_ability->print_name(true).' are as good as new! '.
                    ' <br /> The duration of their reinforcement has been extended! '
                    )
                    ));
                $temp_ally_robot->trigger_target($temp_ally_robot, $this_ability, array('prevent_default_text' => true));

            }
            // Otherwise if targetting a team mate
            else {

                // Collect the attachment from the robot to back up its info
                $this_attachment_info = $temp_ally_robot->robot_attachments[$this_attachment_token];
                $this_attachment_info['attachment_duration'] = $base_attachment_duration;
                $temp_ally_robot->robot_attachments[$this_attachment_token] = $this_attachment_info;
                $temp_ally_robot->update_session();

                // Target the opposing robot
                $this_ability->target_options_update(array(
                    'frame' => 'taunt',
                    'success' => array(9, 24, 30, 18,
                    ' The '.$this_ability->print_name(true).' are as good as new! '.
                    ' <br /> The duration of their reinforcement has been extended! '
                    )
                    ));
                $temp_ally_robot->trigger_target($temp_ally_robot, $this_ability, array('prevent_default_text' => true));

            }

        }

        // Either way, update this attachment's settings to prevent recovery
        $this_attachment->damage_options_update($this_attachment_info['attachment_destroy'], true);
        $this_attachment->recovery_options_update($this_attachment_info['attachment_destroy'], true);
        $this_attachment->update_session();

        // DEBUG
        //$this_battle->events_create(false, false, 'DEBUG', '<pre>Reached the end... '.preg_replace('#\s+#', ' ', print_r(array('ability_id' => $this_ability->ability_id, 'ability_token' => $this_ability->ability_token), true)).'</pre>');


        // Return true on success
        return true;

    },
    'ability_function_onload' => function($objects){

        // Extract all objects into the current scope
        extract($objects);

        // Update the ability image if the user is in their alt image
        $alt_image_triggers = array('rhythm_alt', 'rhythm_alt3', 'rhythm_alt5');
        if (in_array($this_robot->robot_image, $alt_image_triggers)){
            $this_ability->set_image($this_ability->ability_token.'-b');
        }

        // Return true on success
        return true;

        }
    );
?>
{'fraction_non_alphanumeric': 0.13038050263257883, 'fraction_numerical': 0.010910275199478913, 'mean_word_length': 2.368805997440117, 'pattern_counts': {'":': 0, '<': 24, '<?xml version=': 0, '>': 253, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3385338', 'n_tokens_mistral': 5504, 'n_tokens_neox': 5146, 'n_words': 1093}