<?php } ?>
        <?php if (rpg_prototype::event_complete('completed-chapter_dr-light_one')){ ?>
          <a class="link link_robots" data-step="edit_robots" data-index="<?= $temp_data_index++ ?>" data-source="frames/robots.php?action=robots" data-music="misc/robot-editor" data-tooltip="<?= $this_menu_tooltips['robots'] ?>" data-tooltip-type="field_type field_type_<?= MMRPG_SETTINGS_CURRENT_FIELDTYPE ?>"><label>robots</label></a> <span class="pipe">|</span>
        <?php } ?>
        <?if (rpg_prototype::event_complete('completed-chapter_dr-wily_one')){ ?>
          <a class="link link_players" data-step="edit_players" data-index="<?= $temp_data_index++ ?>" data-source="frames/players.php?action=players" data-music="misc/player-editor" data-tooltip="<?= $this_menu_tooltips['players'] ?>" data-tooltip-type="field_type field_type_<?= MMRPG_SETTINGS_CURRENT_FIELDTYPE ?>"><label>players</label></a> <span class="pipe">|</span>
        <?php } ?>
        <?php if (false && rpg_game::items_unlocked() >= 1){ ?>
          <a class="link link_items" data-step="items" data-index="<?= $temp_data_index++ ?>" data-source="frames/items.php" data-music="misc/item-viewer" data-tooltip="<?= $this_menu_tooltips['items'] ?>" data-tooltip-type="field_type field_type_<?= MMRPG_SETTINGS_CURRENT_FIELDTYPE ?>"><label>items</label></a> <span class="pipe">|</span>
        <?php } ?>
        <?php if (false && rpg_game::abilities_unlocked() >= 3){ ?>
          <a class="link link_abilities" data-step="abilities" data-index="<?= $temp_data_index++ ?>" data-source="frames/abilities.php" data-music="misc/ability-viewer" data-tooltip="<?= $this_menu_tooltips['abilities'] ?>" data-tooltip-type="field_type field_type_<?= MMRPG_SETTINGS_CURRENT_FIELDTYPE ?>"><label>abilities</label></a> <span class="pipe">|</span>
        <?php } ?>
        <?php if(rpg_prototype::event_complete('completed-chapter_dr-light_three')
          && rpg_prototype::event_complete('completed-chapter_dr-wily_three')
          && rpg_prototype::event_complete('completed-chapter_dr-cossack_three')){ /* rpg_game::stars_unlocked() >= 1 */ ?>
          <a class="link link_stars" data-step="starforce" data-index="<?= $temp_data_index++ ?>" data-source="frames/starforce.php" data-music="misc/star-force" data-tooltip="<?= $this_menu_tooltips['starforce'] ?>" data-tooltip-type="field_type field_type_<?= MMRPG_SETTINGS_CURRENT_FIELDTYPE ?>"><label>starforce</label></a> <span class="pipe">|</span>
        <?php } ?>
        <?php if(rpg_game::database_unlocked() >= 2){ ?>
          <a class="link link_data" data-step="database" data-index="<?= $temp_data_index++ ?>" data-source="frames/database.php" data-music="misc/data-base" data-tooltip="<?= $this_menu_tooltips['database'] ?>" data-tooltip-type="field_type field_type_<?= MMRPG_SETTINGS_CURRENT_FIELDTYPE ?>"><label>database</label></a> <span class="pipe">|</span>
        <?php } ?>
        <a class="link link_exit" data-index="<?= $temp_data_index++ ?>" data-tooltip="<?= $this_menu_tooltips['exit'] ?>"><label>exit</label></a>
        <?php
      }
      ?>
      </div>
    </div>

  </div>

  <div class="menu select_this_player" data-step="1" data-title="Player Select (<?= rpg_game::is_demo() || $unlock_count_players == 1 ? '1 Player' : $unlock_count_players.' Players' ?>)" data-select="this_player_token">
        $temp_canvas_markup .= '<div class="sprite sprite_80x80 sprite_80x80_00" style="background-image: url(images/sprites/abilities/item-star-fusion-1/sprite_right_80x80.png?' . MMRPG_CONFIG_CACHE_DATE . '); bottom: 52px; left: 248px;">Field Star</div>';
        $temp_canvas_markup .= '<div class="sprite sprite_80x80 sprite_80x80_00" style="background-image: url(images/sprites/abilities/item-star-base-1/sprite_right_80x80.png?' . MMRPG_CONFIG_CACHE_DATE . '); bottom: 52px; left: 248px;">Field Star</div>';
        $temp_canvas_markup .= '<div class="sprite sprite_80x80 sprite_80x80_01" style="background-image: url(images/sprites/robots/bass/sprite_left_80x80.png?' . MMRPG_CONFIG_CACHE_DATE . '); bottom: 40px; right: 150px;">Bass</div>';
        $temp_console_markup = '<p>As thanks for playing to the end, <strong>Dr. Wily</strong>\'s campaign has been upgraded with several new features and mechanics to keep things interesting while you replay missions.</p>';
        $temp_console_markup .= '<p>Two new bonus chapters containing special missions have been added to the main menu, and preview data for future robot masters will now appear in all fusion field missions. Try one of the <strong>Player Battles</strong> against another member\'s ghost data for a real challenge!</p>';
        $temp_console_markup .= '<p>A new <strong>Starforce</strong> mechanic has also been unlocked, allowing you to find and collect powerful <strong>Field Stars</strong> and <strong>Fusion Stars</strong> in battle that boost your robots\' elemental abilities.  Use the newly upgraded <strong>Player Editor</strong> to customize missions and share fields between players - doing so is an excellent way to hunt down extra <strong>Starforce</strong> energy.</p>';
        $temp_console_markup .= '<p>We hope you enjoyed this game prototype, and look forward to the final version some day!  Oh, and <a href="' . MMRPG_CONFIG_ROOTURL . 'contact/" target="_blank">please leave feedback</a> if you can! We love feedback! :D</p>';
        array_push($_SESSION[$session_token]['EVENTS'], array('canvas_markup' => $temp_canvas_markup, 'console_markup' => $temp_console_markup));
    }
}
/*
 * DR. COSSACK OPTIONS
 */
// UNLOCK PLAYER : DR. COSSACK
// If Dr. Wily has completed the first three chapters of his campaign, unlock Dr. Cossack
if (rpg_prototype::event_complete('completed-chapter_dr-wily_three') && !$unlock_flag_cossack) {
    // Unlock Dr. Cossack as a playable character
    rpg_game::unlock_player($mmrpg_index['players']['dr-cossack'], false, true);
    $_SESSION[$session_token]['values']['battle_rewards']['dr-cossack']['player_points'] = 0;
    // Ensure Proto Man hasn't already been unlocked by the player
    if (!rpg_game::robot_unlocked(false, 'proto-man')) {
        // Unlock Proto Man as a playable character
        $unlock_player_info = $mmrpg_index['players']['dr-cossack'];
        $unlock_robot_info = rpg_robot::get_index_info('proto-man');
        $unlock_robot_info['robot_level'] = 1;
        $unlock_robot_info['robot_experience'] = rpg_prototype::calculate_experience_required(1) - 1;
        //$unlock_robot_info['robot_experience'] = 4000;
        rpg_game::unlock_robot($unlock_player_info, $unlock_robot_info, true, false);
        //$_SESSION[$session_token]['values']['battle_rewards']['dr-cossack']['player_robots']['proto-man']['robot_experience'] = 4000;
    } elseif (rpg_game::robot_unlocked(false, 'proto-man') && !rpg_game::robot_unlocked('dr-cossack', 'proto-man')) {
        // Loop through the player rewards and collect Proto Man' info
Exemple #3
0
$global_allow_editing = true;
// -- GENERATE EDITOR MARKUP
// Require the shop index so we can use it's data
require MMRPG_CONFIG_ROOTDIR . 'includes/shop.php';
// Define which shops we're allowed to see
$allowed_edit_data = $this_shop_index;
//$prototype_player_counter = !empty($_SESSION[$session_token]['values']['battle_rewards']) ? count($_SESSION[$session_token]['values']['battle_rewards']) : 0;
//$prototype_complete_counter = rpg_prototype::campaign_complete();
//$prototype_battle_counter = rpg_prototype::battles_complete('dr-light');
if (!rpg_prototype::event_complete('completed-chapter_dr-light_one')) {
    unset($allowed_edit_data['auto']);
}
if (!rpg_prototype::event_complete('completed-chapter_dr-wily_one')) {
    unset($allowed_edit_data['reggae']);
}
if (!rpg_prototype::event_complete('completed-chapter_dr-cossack_one')) {
    unset($allowed_edit_data['kalinka']);
}
//if ($prototype_complete_counter < 3){ unset($allowed_edit_data['kalinka']); }
//if ($prototype_player_counter < 3){ unset($allowed_edit_data['reggae']); }
//if ($prototype_battle_counter < 1){ unset($allowed_edit_data['auto']); }
$allowed_edit_data_count = count($allowed_edit_data);
//die('$allowed_edit_data_count = '.$allowed_edit_data_count.'; $allowed_edit_data = <pre>'.print_r($allowed_edit_data, true).'</pre>');
// HARD-CODE ZENNY FOR TESTING
//$_SESSION[$session_token]['counters']['battle_zenny'] = 500000;
// Define the array to hold all the item quantities
$global_item_quantities = array();
$global_item_prices = array();
$global_zenny_counter = !empty($_SESSION[$session_token]['counters']['battle_zenny']) ? $_SESSION[$session_token]['counters']['battle_zenny'] : 0;
// -- PROCESS SHOP SELL ACTION -- //
// Check if an action request has been sent with an sell type
Exemple #4
0
// REGGAE'S SHOP
$this_shop_index['reggae'] = array('shop_token' => 'reggae', 'shop_name' => 'Reggae\'s Shop', 'shop_owner' => 'Reggae', 'shop_unlock' => 'Complete the first chapter as Dr. Wily.', 'shop_seeking' => 'cores', 'shop_colour' => 'explode', 'shop_field' => 'wily-castle', 'shop_player' => 'dr-wily', 'shop_number' => 'SHOP-002', 'shop_kind_selling' => array('abilities'), 'shop_kind_buying' => array('cores'), 'shop_quote_selling' => array('abilities' => 'Reggae\'s Shop this is! Squawk! New abilities you want! Squaaawk! Give me your zenny! Squaaaawk!'), 'shop_quote_buying' => array('cores' => 'Reggae wants robot cores, robot cores! Squawk! No other items will do, will do! Squaaaaawk!'), 'shop_abilities' => array('abilities_selling' => array('buster-charge' => 3000, 'buster-relay' => 3000, 'energy-boost' => 6000, 'attack-boost' => 6000, 'defense-boost' => 6000, 'speed-boost' => 6000, 'energy-break' => 9000, 'attack-break' => 9000, 'defense-break' => 9000, 'speed-break' => 9000), 'abilities_selling2' => array('buster-charge' => 3000, 'buster-relay' => 3000, 'energy-boost' => 6000, 'attack-boost' => 6000, 'defense-boost' => 6000, 'speed-boost' => 6000, 'energy-break' => 9000, 'attack-break' => 9000, 'defense-break' => 9000, 'speed-break' => 9000, 'energy-swap' => 12000, 'attack-swap' => 12000, 'defense-swap' => 12000, 'speed-swap' => 12000, 'attack-mode' => 15000, 'defense-mode' => 15000, 'speed-mode' => 15000, 'repair-mode' => 15000), 'abilities_selling3' => array('buster-charge' => 3000, 'buster-relay' => 3000, 'energy-boost' => 6000, 'attack-boost' => 6000, 'defense-boost' => 6000, 'speed-boost' => 6000, 'energy-break' => 9000, 'attack-break' => 9000, 'defense-break' => 9000, 'speed-break' => 9000, 'energy-swap' => 12000, 'attack-swap' => 12000, 'defense-swap' => 12000, 'speed-swap' => 12000, 'attack-mode' => 15000, 'defense-mode' => 15000, 'speed-mode' => 15000, 'repair-mode' => 15000, 'experience-booster' => 18000, 'experience-breaker' => 18000, 'recovery-booster' => 18000, 'recovery-breaker' => 18000, 'damage-booster' => 18000, 'damage-breaker' => 18000, 'field-support' => 16000, 'mecha-support' => 16000)), 'shop_items' => array('items_buying' => array('item-core-none' => 3000, 'item-core-cutter' => 3000, 'item-core-impact' => 3000, 'item-core-freeze' => 3000, 'item-core-explode' => 3000, 'item-core-flame' => 3000, 'item-core-electric' => 3000, 'item-core-time' => 3000, 'item-core-earth' => 3000, 'item-core-wind' => 3000, 'item-core-water' => 3000, 'item-core-swift' => 3000, 'item-core-nature' => 3000, 'item-core-missile' => 3000, 'item-core-crystal' => 3000, 'item-core-shadow' => 3000, 'item-core-space' => 3000, 'item-core-shield' => 3000, 'item-core-laser' => 3000, 'item-core-copy' => 3000)));
// KALINKA'S SHOP
$this_shop_index['kalinka'] = array('shop_token' => 'kalinka', 'shop_name' => 'Kalinka\'s Shop', 'shop_owner' => 'Kalinka', 'shop_unlock' => 'Complete the prototype as any of the three playable characters.', 'shop_seeking' => 'stars', 'shop_colour' => 'electric', 'shop_field' => 'final-destination', 'shop_player' => 'dr-cossack', 'shop_number' => 'SHOP-003', 'shop_kind_selling' => array('items'), 'shop_kind_buying' => array('stars'), 'shop_quote_selling' => array('items' => 'Greetings and welcome to Kalinka\'s Shop! I think you\'ll enjoy the new hold items I\'m developing.'), 'shop_quote_buying' => array('stars' => 'Do you have any field or fusion stars? I\'m studying the effects of starforce and need some samples.'), 'shop_items' => array('items_selling' => array('item-energy-upgrade' => 32000, 'item-weapon-upgrade' => 32000, 'item-attack-booster' => 32000, 'item-defense-booster' => 32000, 'item-target-module' => 32000, 'item-growth-module' => 32000), 'items_selling2' => array('item-energy-upgrade' => 32000, 'item-weapon-upgrade' => 32000, 'item-attack-booster' => 32000, 'item-defense-booster' => 32000, 'item-speed-booster' => 32000, 'item-field-booster' => 32000, 'item-target-module' => 32000, 'item-charge-module' => 32000, 'item-growth-module' => 32000, 'item-fortune-module' => 32000)), 'shop_stars' => array('stars_buying' => array('field' => 6000, 'fusion' => 9000)));
// -- UPDATE SHOP INVENTORY/PRICES -- //
// Loop through the shop index and prepare to create history arrays where necessary
$this_shop_index_raw = $this_shop_index;
if (!empty($this_shop_index)) {
    foreach ($this_shop_index as $shop_token => $shop_info) {
        // Default this shop's level to zero for later
        $this_shop_index[$shop_token]['shop_level'] = 0;
        // Unlock the shop if the associated doctor has completed chapter one
        $shop_player = $shop_info['shop_player'];
        $shop_selling = $shop_info['shop_kind_selling'];
        $shop_buying = $shop_info['shop_kind_buying'];
        if (rpg_prototype::event_complete('completed-chapter_' . $shop_player . '_one')) {
            // If the shop has not been created, define its defaults
            if (!isset($this_battle_shops[$shop_token])) {
                $shop_array = array();
                $shop_array['shop_level'] = 1;
                $shop_array['shop_experience'] = 0;
                $shop_array['zenny_earned'] = 0;
                $shop_array['zenny_spent'] = 0;
                if (is_array($shop_selling)) {
                    foreach ($shop_selling as $token) {
                        $shop_array[$token . '_sold'] = array();
                    }
                } else {
                    $shop_array[$shop_selling . '_sold'] = array();
                }
                if (is_array($shop_buying)) {
function refresh_editor_arrays()
{
    global $allowed_edit_players, $allowed_edit_robots, $allowed_edit_data;
    global $allowed_edit_data_count, $allowed_edit_player_count, $allowed_edit_robot_count;
    // Collect the current session token
    $session_token = rpg_game::session_token();
    // Collect the player array and merge in session details
    $temp_player_array = array();
    if (!empty($_SESSION[$session_token]['values']['battle_rewards'])) {
        $temp_player_rewards = $_SESSION[$session_token]['values']['battle_rewards'];
        $temp_player_array = array_merge($temp_player_array, $temp_player_rewards);
    }
    if (!empty($_SESSION[$session_token]['values']['battle_settings'])) {
        $temp_player_settings = $_SESSION[$session_token]['values']['battle_settings'];
        $temp_player_array = array_merge($temp_player_array, $temp_player_settings);
    }
    // Define the editor indexes and count variables
    $allowed_edit_players = array();
    $allowed_edit_robots = array();
    $allowed_edit_data = array();
    $allowed_edit_data_count = 0;
    $allowed_edit_player_count = 0;
    $allowed_edit_robot_count = 0;
    // Collect a temporary player index
    $temp_player_tokens = array_keys($temp_player_array);
    $temp_player_index = rpg_player::get_index_custom($temp_player_tokens);
    // Now to actually loop through and update the allowed players, robots, and abilities arrays
    foreach ($temp_player_array as $player_token => $player_info) {
        if (empty($player_token) || !isset($temp_player_index[$player_token])) {
            continue;
        }
        $player_index_info = $temp_player_index[$player_token];
        // If this player has not yet completed chapter one, no robot editor
        $intro_complete = rpg_prototype::event_complete('completed-chapter_' . $player_token . '_one');
        $prototype_complete = rpg_prototype::campaign_complete($player_token);
        if (!$intro_complete && !$prototype_complete) {
            continue;
        }
        // Merge the player and index info then append the token and info
        $player_info = array_merge($player_index_info, $player_info);
        $allowed_edit_players[] = $player_token;
        $allowed_edit_data[$player_token] = $player_info;
        // Collect a temporary robot index
        $temp_robot_tokens = array_keys($player_info['player_robots']);
        $temp_robot_index = rpg_robot::get_index_custom($temp_robot_tokens);
        foreach ($player_info['player_robots'] as $robot_token => $robot_info) {
            if (empty($robot_token) || !isset($temp_robot_index[$robot_token])) {
                continue;
            }
            $robot_index_info = $temp_robot_index[$robot_token];
            // Merge the robot and index info then append the token and info
            $robot_info = array_merge($robot_index_info, $robot_info);
            $allowed_edit_robots[] = $robot_token;
            $allowed_edit_data[$player_token]['player_robots'][$robot_token] = $robot_info;
            // Collect a temporary ability index
            $temp_ability_tokens = array_keys($robot_info['robot_abilities']);
            $temp_ability_index = rpg_ability::get_index_custom($temp_ability_tokens);
            foreach ($robot_info['robot_abilities'] as $ability_token => $ability_info) {
                if (empty($ability_token) || !isset($temp_ability_index[$ability_token])) {
                    continue;
                }
                $ability_index_info = $temp_ability_index[$ability_token];
                // Merge the ability and index info then append the token and info
                $ability_info = array_merge($ability_index_info, $ability_info);
                $allowed_edit_data[$player_token]['player_robots'][$robot_token]['robot_abilities'][$ability_token] = $ability_info;
            }
        }
    }
    //$allowed_edit_data = array_reverse($allowed_edit_data, true);
    $allowed_edit_player_count = !empty($allowed_edit_players) ? count($allowed_edit_players) : 0;
    $allowed_edit_robot_count = !empty($allowed_edit_robots) ? count($allowed_edit_robots) : 0;
    $allowed_edit_data_count = 0;
    foreach ($allowed_edit_data as $pinfo) {
        $pcount = !empty($pinfo['player_robots']) ? count($pinfo['player_robots']) : 0;
        $allowed_edit_data_count += $pcount;
    }
}
    public static function print_editor_markup($player_info, $robot_info)
    {
        // Define the global variables
        global $mmrpg_index, $this_current_uri, $this_current_url, $db;
        global $allowed_edit_players, $allowed_edit_robots, $allowed_edit_abilities;
        global $allowed_edit_data_count, $allowed_edit_player_count, $allowed_edit_robot_count, $first_robot_token, $global_allow_editing;
        global $key_counter, $player_rewards, $player_ability_rewards, $player_robot_favourites, $player_robot_database, $temp_robot_totals, $player_options_markup, $item_options_markup;
        global $mmrpg_database_players, $mmrpg_database_abilities, $mmrpg_database_items, $mmrpg_database_fields, $mmrpg_database_types;
        global $session_token;
        // Collect values for potentially missing global variables
        if (!isset($session_token)) {
            $session_token = rpg_game::session_token();
        }
        // If either fo empty, return error
        if (empty($player_info)) {
            return 'error:player-empty';
        }
        if (empty($robot_info)) {
            return 'error:robot-empty';
        }
        // Collect the approriate database indexes
        if (empty($mmrpg_database_players)) {
            $mmrpg_database_players = rpg_player::get_index(true);
        }
        if (empty($mmrpg_database_abilities)) {
            $mmrpg_database_abilities = rpg_ability::get_index(true);
        }
        if (empty($mmrpg_database_items)) {
            $mmrpg_database_items = rpg_item::get_index(true);
        }
        if (empty($mmrpg_database_fields)) {
            $mmrpg_database_fields = rpg_field::get_index(true);
        }
        if (empty($mmrpg_database_types)) {
            $mmrpg_database_types = rpg_type::get_index();
        }
        // Define the quick-access variables for later use
        $player_token = $player_info['player_token'];
        $robot_token = $robot_info['robot_token'];
        if (!isset($first_robot_token)) {
            $first_robot_token = $robot_token;
        }
        // Start the output buffer
        ob_start();
        // Check how many robots this player has and see if they should be able to transfer
        $counter_player_robots = !empty($player_info['player_robots']) ? count($player_info['player_robots']) : false;
        $counter_player_missions = rpg_prototype::battles_complete($player_info['player_token']);
        $allow_player_selector = $allowed_edit_player_count > 1 ? true : false;
        // Update the robot key to the current counter
        $robot_key = $key_counter;
        // Make a backup of the player selector
        $allow_player_selector_backup = $allow_player_selector;
        // Collect or define the image size
        $robot_info['robot_image_size'] = !empty($robot_info['robot_image_size']) ? $robot_info['robot_image_size'] : 40;
        $robot_image_offset = $robot_info['robot_image_size'] > 40 ? ceil(($robot_info['robot_image_size'] - 40) * 0.5) : 0;
        $robot_image_size_text = $robot_info['robot_image_size'] . 'x' . $robot_info['robot_image_size'];
        $robot_image_offset_top = -1 * $robot_image_offset;
        // Collect the robot level and experience
        $robot_info['robot_level'] = rpg_game::robot_level($player_info['player_token'], $robot_info['robot_token']);
        $robot_info['robot_experience'] = rpg_game::robot_experience($player_info['player_token'], $robot_info['robot_token']);
        // Collect the rewards for this robot
        $robot_rewards = rpg_game::robot_rewards($player_token, $robot_token);
        // Collect the settings for this robot
        $robot_settings = rpg_game::robot_settings($player_token, $robot_token);
        // Collect the database for this robot
        $robot_database = !empty($player_robot_database[$robot_token]) ? $player_robot_database[$robot_token] : array();
        //rpg_game::robot_database($robot_token);
        // Collect the robot ability core if it exists
        $robot_ability_core = !empty($robot_info['robot_core']) ? $robot_info['robot_core'] : false;
        // Check if this robot has the copy shot ability
        $robot_flag_copycore = $robot_ability_core == 'copy' ? true : false;
        // Make backups of the robot's original stats before rewards
        $robot_info['robot_energy_index'] = $robot_info['robot_energy'];
        $robot_info['robot_weapons_index'] = $robot_info['robot_weapons'];
        $robot_info['robot_attack_index'] = $robot_info['robot_attack'];
        $robot_info['robot_defense_index'] = $robot_info['robot_defense'];
        $robot_info['robot_speed_index'] = $robot_info['robot_speed'];
        // Collect this robot's ability rewards and add them to the dropdown
        $robot_ability_rewards = !empty($robot_rewards['robot_abilities']) ? $robot_rewards['robot_abilities'] : array();
        $robot_ability_settings = !empty($robot_settings['robot_abilities']) ? $robot_settings['robot_abilities'] : array();
        foreach ($robot_ability_settings as $token => $info) {
            if (empty($robot_ability_rewards[$token])) {
                $robot_ability_rewards[$token] = $info;
            }
        }
        // If the robot's level is greater than one, apply stat boosts
        if ($robot_info['robot_level'] > 1) {
            // Create the temp level by subtracting one (so we don't have level 1 boosts)
            $temp_level = $robot_info['robot_level'] - 1;
            // Update the robot energy with a small boost based on experience level
            $robot_info['robot_energy'] = $robot_info['robot_energy'] + ceil($temp_level * (0.05 * $robot_info['robot_energy']));
            // Update the robot attack with a small boost based on experience level
            $robot_info['robot_attack'] = $robot_info['robot_attack'] + ceil($temp_level * (0.05 * $robot_info['robot_attack']));
            // Update the robot defense with a small boost based on experience level
            $robot_info['robot_defense'] = $robot_info['robot_defense'] + ceil($temp_level * (0.05 * $robot_info['robot_defense']));
            // Update the robot speed with a small boost based on experience level
            $robot_info['robot_speed'] = $robot_info['robot_speed'] + ceil($temp_level * (0.05 * $robot_info['robot_speed']));
        }
        // Make backups of the robot's original stats before rewards
        $robot_info['robot_energy_base'] = $robot_info['robot_energy'];
        $robot_info['robot_attack_base'] = $robot_info['robot_attack'];
        $robot_info['robot_defense_base'] = $robot_info['robot_defense'];
        $robot_info['robot_speed_base'] = $robot_info['robot_speed'];
        // Apply any stat rewards for the robot's attack
        if (!empty($robot_rewards['robot_attack'])) {
            $robot_info['robot_attack'] += $robot_rewards['robot_attack'];
        }
        // Apply any stat rewards for the robot's defense
        if (!empty($robot_rewards['robot_defense'])) {
            $robot_info['robot_defense'] += $robot_rewards['robot_defense'];
        }
        // Apply any stat rewards for the robot's speed
        if (!empty($robot_rewards['robot_speed'])) {
            $robot_info['robot_speed'] += $robot_rewards['robot_speed'];
        }
        // Make backups of the robot's original stats before rewards
        $robot_info['robot_attack_rewards'] = $robot_info['robot_attack'] - $robot_info['robot_attack_base'];
        $robot_info['robot_defense_rewards'] = $robot_info['robot_defense'] - $robot_info['robot_defense_base'];
        $robot_info['robot_speed_rewards'] = $robot_info['robot_speed'] - $robot_info['robot_speed_base'];
        // Only apply player bonuses if the robot is with it's original player
        //if (!empty($robot_info['original_player']) && $robot_info['original_player'] == $player_info['player_token']){}
        // Apply stat bonuses to this robot based on its current player's own stats
        if (true) {
            // Apply any player special for the robot's attack
            if (!empty($player_info['player_attack'])) {
                $robot_info['robot_attack'] += ceil($robot_info['robot_attack'] * ($player_info['player_attack'] / 100));
            }
            // Apply any player special for the robot's defense
            if (!empty($player_info['player_defense'])) {
                $robot_info['robot_defense'] += ceil($robot_info['robot_defense'] * ($player_info['player_defense'] / 100));
            }
            // Apply any player special for the robot's speed
            if (!empty($player_info['player_speed'])) {
                $robot_info['robot_speed'] += ceil($robot_info['robot_speed'] * ($player_info['player_speed'] / 100));
            }
        }
        // Make backups of the robot's original stats before rewards
        $robot_info['robot_attack_player'] = $robot_info['robot_attack'] - $robot_info['robot_attack_rewards'] - $robot_info['robot_attack_base'];
        $robot_info['robot_defense_player'] = $robot_info['robot_defense'] - $robot_info['robot_defense_rewards'] - $robot_info['robot_defense_base'];
        $robot_info['robot_speed_player'] = $robot_info['robot_speed'] - $robot_info['robot_speed_rewards'] - $robot_info['robot_speed_base'];
        // Limit stat digits for display purposes
        if ($robot_info['robot_energy'] > MMRPG_SETTINGS_STATS_MAX) {
            $robot_info['robot_energy'] = MMRPG_SETTINGS_STATS_MAX;
        }
        if ($robot_info['robot_attack'] > MMRPG_SETTINGS_STATS_MAX) {
            $robot_info['robot_attack'] = MMRPG_SETTINGS_STATS_MAX;
        }
        if ($robot_info['robot_defense'] > MMRPG_SETTINGS_STATS_MAX) {
            $robot_info['robot_defense'] = MMRPG_SETTINGS_STATS_MAX;
        }
        if ($robot_info['robot_speed'] > MMRPG_SETTINGS_STATS_MAX) {
            $robot_info['robot_speed'] = MMRPG_SETTINGS_STATS_MAX;
        }
        // Collect the summon count from the session if it exists
        $robot_info['robot_summoned'] = !empty($robot_database['robot_summoned']) ? $robot_database['robot_summoned'] : 0;
        // Collect the alt images if there are any that are unlocked
        $robot_alt_count = 1 + (!empty($robot_info['robot_image_alts']) ? count($robot_info['robot_image_alts']) : 0);
        $robot_alt_options = array();
        if (!empty($robot_info['robot_image_alts'])) {
            foreach ($robot_info['robot_image_alts'] as $alt_key => $alt_info) {
                if ($robot_info['robot_summoned'] < $alt_info['summons']) {
                    continue;
                }
                $robot_alt_options[] = $alt_info['token'];
            }
        }
        // Collect the current unlock image token for this robot
        $robot_image_unlock_current = 'base';
        if (!empty($robot_settings['robot_image']) && strstr($robot_settings['robot_image'], '_')) {
            list($token, $robot_image_unlock_current) = explode('_', $robot_settings['robot_image']);
        }
        // Define the offsets for the image tokens based on count
        $token_first_offset = 2;
        $token_other_offset = 6;
        if ($robot_alt_count == 1) {
            $token_first_offset = 17;
        } elseif ($robot_alt_count == 3) {
            $token_first_offset = 10;
        }
        // Loop through and generate the robot image display token markup
        $robot_image_unlock_tokens = '';
        $temp_total_alts_count = 0;
        for ($i = 0; $i < 6; $i++) {
            $temp_enabled = true;
            $temp_active = false;
            if ($i + 1 > $robot_alt_count) {
                break;
            }
            if ($i > 0 && !isset($robot_alt_options[$i - 1])) {
                $temp_enabled = false;
            }
            if ($temp_enabled && $i == 0 && $robot_image_unlock_current == 'base') {
                $temp_active = true;
            } elseif ($temp_enabled && $i >= 1 && $robot_image_unlock_current == $robot_alt_options[$i - 1]) {
                $temp_active = true;
            }
            $robot_image_unlock_tokens .= '<span class="token token_' . ($temp_enabled ? 'enabled' : 'disabled') . ' ' . ($temp_active ? 'token_active' : '') . '" style="left: ' . ($token_first_offset + $i * $token_other_offset) . 'px;">&bull;</span>';
            $temp_total_alts_count += 1;
        }
        $temp_unlocked_alts_count = count($robot_alt_options) + 1;
        $temp_image_alt_title = '';
        if ($temp_total_alts_count > 1) {
            $temp_image_alt_title = '<strong>' . $temp_unlocked_alts_count . ' / ' . $temp_total_alts_count . ' Outfits Unlocked</strong><br />';
            //$temp_image_alt_title .= '<span style="font-size: 90%;">';
            $temp_image_alt_title .= '&#8226; <span style="font-size: 90%;">' . $robot_info['robot_name'] . '</span><br />';
            foreach ($robot_info['robot_image_alts'] as $alt_key => $alt_info) {
                if ($robot_info['robot_summoned'] >= $alt_info['summons']) {
                    $temp_image_alt_title .= '&#8226; <span style="font-size: 90%;">' . $alt_info['name'] . '</span><br />';
                } else {
                    $temp_image_alt_title .= '&#9702; <span style="font-size: 90%;">???</span><br />';
                }
            }
            //$temp_image_alt_title .= '</span>';
            $temp_image_alt_title = htmlentities($temp_image_alt_title, ENT_QUOTES, 'UTF-8', true);
        }
        // Define whether or not this robot has coreswap enabled
        $temp_allow_coreswap = $robot_info['robot_level'] >= 100 ? true : false;
        //echo $robot_info['robot_token'].' robot_image_unlock_current = '.$robot_image_unlock_current.' | robot_alt_options = '.implode(',',array_keys($robot_alt_options)).'<br />';
        ?>
            <div class="event event_double event_<?php 
        echo $robot_key == $first_robot_token ? 'visible' : 'hidden';
        ?>
 <?php 
        echo false && $robot_info['robot_level'] >= 100 && $robot_info['robot_core'] != 'copy' ? 'event_has_subcore' : '';
        ?>
" data-token="<?php 
        echo $player_info['player_token'] . '_' . $robot_info['robot_token'];
        ?>
" data-player="<?php 
        echo $player_info['player_token'];
        ?>
" data-robot="<?php 
        echo $robot_info['robot_token'];
        ?>
" data-types="<?php 
        echo !empty($robot_info['robot_core']) ? $robot_info['robot_core'] . (!empty($robot_info['robot_core2']) ? '_' . $robot_info['robot_core2'] : '') : 'none';
        ?>
">

                <div class="this_sprite sprite_left event_robot_mugshot" style="">
                    <?php 
        $temp_offset = $robot_info['robot_image_size'] == 80 ? '-20px' : '0';
        ?>
                    <div class="sprite_wrapper robot_type robot_type_<?php 
        echo !empty($robot_info['robot_core']) ? $robot_info['robot_core'] : 'none';
        ?>
" style="width: 33px;">
                        <div class="sprite_wrapper robot_type robot_type_empty" style="position: absolute; width: 27px; height: 34px; left: 2px; top: 2px;"></div>
                        <div style="left: <?php 
        echo $temp_offset;
        ?>
; bottom: <?php 
        echo $temp_offset;
        ?>
; background-image: url(i/r/<?php 
        echo !empty($robot_info['robot_image']) ? $robot_info['robot_image'] : $robot_info['robot_token'];
        ?>
/mr<?php 
        echo $robot_info['robot_image_size'];
        ?>
.png?<?php 
        echo MMRPG_CONFIG_CACHE_DATE;
        ?>
); " class="sprite sprite_robot sprite_robot_sprite sprite_<?php 
        echo $robot_info['robot_image_size'] . 'x' . $robot_info['robot_image_size'];
        ?>
 sprite_<?php 
        echo $robot_info['robot_image_size'] . 'x' . $robot_info['robot_image_size'];
        ?>
_mug robot_status_active robot_position_active"><?php 
        echo $robot_info['robot_name'];
        ?>
</div>
                    </div>
                </div>

                <?php 
        if (false && $robot_info['robot_level'] >= 100 && $robot_info['robot_core'] != 'copy') {
            ?>
                    <div class="this_sprite sprite_left event_robot_core2 ability_type ability_type_<?php 
            echo !empty($robot_info['robot_core2']) ? $robot_info['robot_core2'] : 'none';
            ?>
" style="" >
                        <div class="sprite_wrapper" style="">
                            <?php 
            if ($global_allow_editing) {
                ?>
                                <a class="robot_core2 <?php 
                echo in_array($robot_token, $player_robot_favourites) ? 'robot_core_active ' : '';
                ?>
" data-player="<?php 
                echo $player_token;
                ?>
" data-robot="<?php 
                echo $robot_token;
                ?>
" title="Equip Subcore?">
                                    <?php 
                if (!empty($robot_info['robot_core2'])) {
                    ?>
                                        <span class="sprite sprite_40x40 sprite_40x40_00" style="background-image: url(i/i/<?php 
                    echo !empty($robot_info['robot_core2']) ? $robot_info['robot_core2'] : 'none';
                    ?>
-core/il40.png);"></span>
                                    <?php 
                }
                ?>
                                </a>
                            <?php 
            } else {
                ?>
                                <span class="robot_core2 <?php 
                echo in_array($robot_token, $player_robot_favourites) ? 'robot_core_active ' : '';
                ?>
">
                                    <span class="sprite sprite_40x40 sprite_40x40_00" style="background-image: url(i/i/<?php 
                echo !empty($robot_info['robot_core2']) ? $robot_info['robot_core2'] : 'none';
                ?>
-core/il40.png);"></span>
                                </span>
                            <?php 
            }
            ?>
                        </div>
                    </div>
                <?php 
        }
        ?>

                <div class="this_sprite sprite_left event_robot_images" style="">
                    <?php 
        if ($global_allow_editing && !empty($robot_alt_options)) {
            ?>
                        <a class="robot_image_alts" data-player="<?php 
            echo $player_token;
            ?>
" data-robot="<?php 
            echo $robot_token;
            ?>
" data-alt-index="base<?php 
            echo !empty($robot_alt_options) ? ',' . implode(',', $robot_alt_options) : '';
            ?>
" data-alt-current="<?php 
            echo $robot_image_unlock_current;
            ?>
" data-tooltip="<?php 
            echo $temp_image_alt_title;
            ?>
">
                            <?php 
            $temp_offset = $robot_info['robot_image_size'] == 80 ? '-20px' : '0';
            ?>
                            <span class="sprite_wrapper" style="">
                                <?php 
            echo $robot_image_unlock_tokens;
            ?>
                                <div style="left: <?php 
            echo $temp_offset;
            ?>
; bottom: 0; background-image: url(i/r/<?php 
            echo !empty($robot_info['robot_image']) ? $robot_info['robot_image'] : $robot_info['robot_token'];
            ?>
/sr<?php 
            echo $robot_info['robot_image_size'];
            ?>
.png?<?php 
            echo MMRPG_CONFIG_CACHE_DATE;
            ?>
); " class="sprite sprite_robot sprite_robot_sprite sprite_<?php 
            echo $robot_info['robot_image_size'] . 'x' . $robot_info['robot_image_size'];
            ?>
 sprite_<?php 
            echo $robot_info['robot_image_size'] . 'x' . $robot_info['robot_image_size'];
            ?>
_base robot_status_active robot_position_active"><?php 
            echo $robot_info['robot_name'];
            ?>
</div>
                            </span>
                        </a>
                    <?php 
        } else {
            ?>
                        <span class="robot_image_alts" data-player="<?php 
            echo $player_token;
            ?>
" data-robot="<?php 
            echo $robot_token;
            ?>
" data-alt-index="base<?php 
            echo !empty($robot_alt_options) ? ',' . implode(',', $robot_alt_options) : '';
            ?>
" data-alt-current="<?php 
            echo $robot_image_unlock_current;
            ?>
" data-tooltip="<?php 
            echo $temp_image_alt_title;
            ?>
">
                            <?php 
            $temp_offset = $robot_info['robot_image_size'] == 80 ? '-20px' : '0';
            ?>
                            <span class="sprite_wrapper" style="">
                                <?php 
            echo $robot_image_unlock_tokens;
            ?>
                                <div style="left: <?php 
            echo $temp_offset;
            ?>
; bottom: 0; background-image: url(i/r/<?php 
            echo !empty($robot_info['robot_image']) ? $robot_info['robot_image'] : $robot_info['robot_token'];
            ?>
/sr<?php 
            echo $robot_info['robot_image_size'];
            ?>
.png?<?php 
            echo MMRPG_CONFIG_CACHE_DATE;
            ?>
); " class="sprite sprite_robot sprite_robot_sprite sprite_<?php 
            echo $robot_info['robot_image_size'] . 'x' . $robot_info['robot_image_size'];
            ?>
 sprite_<?php 
            echo $robot_info['robot_image_size'] . 'x' . $robot_info['robot_image_size'];
            ?>
_base robot_status_active robot_position_active"><?php 
            echo $robot_info['robot_name'];
            ?>
</div>
                            </span>
                        </span>
                    <?php 
        }
        ?>
                </div>

                <div class="this_sprite sprite_left event_robot_summons" style="">
                    <div class="robot_summons">
                        <span class="summons_count"><?php 
        echo $robot_info['robot_summoned'];
        ?>
</span>
                        <span class="summons_label"><?php 
        echo $robot_info['robot_summoned'] == 1 ? 'Summon' : 'Summons';
        ?>
</span>
                    </div>
                </div>

                <div class="this_sprite sprite_left event_robot_favourite" style="" >
                    <?php 
        if ($global_allow_editing) {
            ?>
                        <a class="robot_favourite <?php 
            echo in_array($robot_token, $player_robot_favourites) ? 'robot_favourite_active ' : '';
            ?>
" data-player="<?php 
            echo $player_token;
            ?>
" data-robot="<?php 
            echo $robot_token;
            ?>
" title="Toggle Favourite?">&hearts;</a>
                    <?php 
        } else {
            ?>
                        <span class="robot_favourite <?php 
            echo in_array($robot_token, $player_robot_favourites) ? 'robot_favourite_active ' : '';
            ?>
">&hearts;</span>
                    <?php 
        }
        ?>
                </div>

                <?php 
        // Define the placehodler cells for the empty column in case it's needed
        ob_start();
        ?>
                <td class="right">
                    <label style="display: block; float: left; color: #696969;">??? :</label>
                    <span class="robot_stat" style="color: #696969; font-weight: normal;">???</span>
                </td>
                <?php 
        $empty_column_placeholder = ob_get_clean();
        // Define an array to hold all the data in the left and right columns
        $left_column_markup = array();
        $right_column_markup = array();
        // Check to see if the player has unlocked the ability to swap players
        $temp_player_swap_unlocked = rpg_game::player_unlocked('dr-wily');
        // && rpg_prototype::event_unlocked('dr-wily', 'chapter_one_complete');
        // If this player has unlocked the ability to let robots swap players
        if ($temp_player_swap_unlocked) {
            ob_start();
            ?>
                    <td class="player_select_block right">
                        <?php 
            $player_style = '';
            $robot_info['original_player'] = !empty($robot_info['original_player']) ? $robot_info['original_player'] : $player_info['player_token'];
            if ($player_info['player_token'] != $robot_info['original_player']) {
                if ($counter_player_robots > 1) {
                    $allow_player_selector = true;
                }
            }
            ?>
                        <?php 
            if ($robot_info['original_player'] != $player_info['player_token']) {
                ?>
                            <label title="<?php 
                echo 'Transferred from Dr. ' . ucfirst(str_replace('dr-', '', $robot_info['original_player']));
                ?>
"  class="original_player original_player_<?php 
                echo $robot_info['original_player'];
                ?>
" data-tooltip-type="player_type player_type_<?php 
                echo str_replace('dr-', '', $robot_info['original_player']);
                ?>
" style="display: block; float: left; <?php 
                echo $player_style;
                ?>
"><span class="current_player current_player_<?php 
                echo $player_info['player_token'];
                ?>
">Player</span> :</label>
                        <?php 
            } else {
                ?>
                            <label class="original_player original_player_<?php 
                echo $robot_info['original_player'];
                ?>
" data-tooltip-type="player_type player_type_<?php 
                echo str_replace('dr-', '', $robot_info['original_player']);
                ?>
" style="display: block; float: left; <?php 
                echo $player_style;
                ?>
"><span class="current_player current_player_<?php 
                echo $player_info['player_token'];
                ?>
">Player</span> :</label>
                        <?php 
            }
            ?>

                        <?if($global_allow_editing && $allow_player_selector):?>
                            <a class="player_name player_type player_type_<?php 
            echo str_replace('dr-', '', $player_info['player_token']);
            ?>
"><label style="background-image: url(i/p/<?php 
            echo $player_info['player_token'];
            ?>
/ml40.png?<?php 
            echo MMRPG_CONFIG_CACHE_DATE;
            ?>
);"><?php 
            echo $player_info['player_name'];
            ?>
<span class="arrow">&#8711;</span></label></a>
                        <?elseif(!$global_allow_editing && $allow_player_selector):?>
                            <a class="player_name player_type player_type_<?php 
            echo str_replace('dr-', '', $player_info['player_token']);
            ?>
" style="cursor: default; "><label style="background-image: url(i/p/<?php 
            echo $player_info['player_token'];
            ?>
/ml40.png?<?php 
            echo MMRPG_CONFIG_CACHE_DATE;
            ?>
); cursor: default; "><?php 
            echo $player_info['player_name'];
            ?>
</label></a>
                        <?else:?>
                            <a class="player_name player_type player_type_<?php 
            echo str_replace('dr-', '', $player_info['player_token']);
            ?>
" style="opacity: 0.5; filter: alpha(opacity=50); cursor: default;"><label style="background-image: url(i/p/<?php 
            echo $player_info['player_token'];
            ?>
/ml40.png?<?php 
            echo MMRPG_CONFIG_CACHE_DATE;
            ?>
);"><?php 
            echo $player_info['player_name'];
            ?>
</label></a>
                        <?endif;?>
                    </td>
                    <?php 
            $left_column_markup[] = ob_get_clean();
        }
        // Check to see if the player has unlocked the ability to hold items
        $temp_item_hold_unlocked = rpg_prototype::event_complete('completed-chapter_dr-cossack_one');
        $current_item_token = '';
        // If this player has unlocked the ability to let robots hold items
        if ($temp_item_hold_unlocked) {
            // Collect the currently held item and token, if available
            $current_item_token = !empty($robot_info['robot_item']) ? $robot_info['robot_item'] : '';
            $current_item_info = !empty($mmrpg_database_items[$current_item_token]) ? $mmrpg_database_items[$current_item_token] : array();
            $current_item_name = !empty($current_item_info['ability_name']) ? $current_item_info['ability_name'] : 'No Item';
            $current_item_image = !empty($current_item_info['ability_image']) ? $current_item_info['ability_image'] : $current_item_token;
            $current_item_type = !empty($current_item_info['ability_type']) ? $current_item_info['ability_type'] : 'none';
            if (!empty($current_item_info['ability_type2'])) {
                $current_item_type = $current_item_type != 'none' ? $current_item_type . '_' . $current_item_info['ability_type2'] : $current_item_info['ability_type2'];
            }
            if (empty($current_item_info)) {
                $current_item_token = '';
                $current_item_image = 'ability';
            }
            ob_start();
            ?>
                    <td  class="right">
                        <label style="display: block; float: left;">Item:</label>
                        <?php 
            if ($global_allow_editing) {
                ?>
                            <a title="Change Item?" class="item_name type <?php 
                echo $current_item_type;
                ?>
"><label style="background-image: url(i/a/<?php 
                echo $current_item_image;
                ?>
/il40.png?<?php 
                echo MMRPG_CONFIG_CACHE_DATE;
                ?>
);"><?php 
                echo $current_item_name;
                ?>
<span class="arrow">&#8711;</span></label></a>
                        <?php 
            } else {
                ?>
                            <a class="item_name type <?php 
                echo $current_item_type;
                ?>
" style="opacity: 0.5; filter: alpha(opacity=50); cursor: default;"><label style="background-image: url(i/a/<?php 
                echo $current_item_image;
                ?>
/il40.png?<?php 
                echo MMRPG_CONFIG_CACHE_DATE;
                ?>
);"><?php 
                echo $current_item_name;
                ?>
</label></a>
                        <?php 
            }
            ?>
                    </td>
                    <?php 
            $left_column_markup[] = ob_get_clean();
        }
        // Define the markup for the weakness
        if (true) {
            ob_start();
            ?>
                    <td  class="right">
                        <label style="display: block; float: left;">Weaknesses :</label>
                        <?php 
            if (!empty($robot_info['robot_weaknesses'])) {
                $temp_string = array();
                foreach ($robot_info['robot_weaknesses'] as $robot_weakness) {
                    $temp_string[] = '<span class="robot_weakness robot_type robot_type_' . (!empty($robot_weakness) ? $robot_weakness : 'none') . '">' . $mmrpg_database_types[$robot_weakness]['type_name'] . '</span>';
                }
                echo implode(' ', $temp_string);
            } else {
                echo '<span class="robot_weakness">None</span>';
            }
            ?>
                    </td>
                    <?php 
            $left_column_markup[] = ob_get_clean();
        }
        // Define the markup for the resistance
        if (true) {
            ob_start();
            ?>
                    <td  class="right">
                        <label style="display: block; float: left;">Resistances :</label>
                        <?php 
            if (!empty($robot_info['robot_resistances'])) {
                $temp_string = array();
                foreach ($robot_info['robot_resistances'] as $robot_resistance) {
                    $temp_string[] = '<span class="robot_resistance robot_type robot_type_' . (!empty($robot_resistance) ? $robot_resistance : 'none') . '">' . $mmrpg_database_types[$robot_resistance]['type_name'] . '</span>';
                }
                echo implode(' ', $temp_string);
            } else {
                echo '<span class="robot_resistance">None</span>';
            }
            ?>
                    </td>
                    <?php 
            $left_column_markup[] = ob_get_clean();
        }
        // Define the markup for the affinity
        if (true) {
            ob_start();
            ?>
                    <td  class="right">
                        <label style="display: block; float: left;">Affinities :</label>
                        <?php 
            if (!empty($robot_info['robot_affinities'])) {
                $temp_string = array();
                foreach ($robot_info['robot_affinities'] as $robot_affinity) {
                    $temp_string[] = '<span class="robot_affinity robot_type robot_type_' . (!empty($robot_affinity) ? $robot_affinity : 'none') . '">' . $mmrpg_database_types[$robot_affinity]['type_name'] . '</span>';
                }
                echo implode(' ', $temp_string);
            } else {
                echo '<span class="robot_affinity">None</span>';
            }
            ?>
                    </td>
                    <?php 
            $left_column_markup[] = ob_get_clean();
        }
        // Define the markup for the immunity
        if (true) {
            ob_start();
            ?>
                    <td class="right">
                        <label style="display: block; float: left;">Immunities :</label>
                        <?php 
            if (!empty($robot_info['robot_immunities'])) {
                $temp_string = array();
                foreach ($robot_info['robot_immunities'] as $robot_immunity) {
                    $temp_string[] = '<span class="robot_immunity robot_type robot_type_' . (!empty($robot_immunity) ? $robot_immunity : 'none') . '">' . $mmrpg_database_types[$robot_immunity]['type_name'] . '</span>';
                }
                echo implode(' ', $temp_string);
            } else {
                echo '<span class="robot_immunity">None</span>';
            }
            ?>
                    </td>
                    <?php 
            $left_column_markup[] = ob_get_clean();
        }
        // Define the markup for the level
        if (true) {
            ob_start();
            ?>
                    <td  class="right">
                        <label style="display: block; float: left;">Level :</label>
                        <?php 
            if ($robot_info['robot_level'] >= 100) {
                ?>
                            <a data-tooltip-align="center" data-tooltip="<?php 
                echo htmlentities('Congratulations! ' . $robot_info['robot_name'] . ' has reached Level 100!<br /> <span style="font-size: 90%;">Stat bonuses will now be awarded immediately when this robot lands the finishing blow on a target! Try to max out each stat to its full potential!</span>', ENT_QUOTES, 'UTF-8');
                ?>
" class="robot_stat robot_type_electric"><?php 
                echo $robot_info['robot_level'];
                ?>
 <span>&#9733;</span></a>
                        <?php 
            } else {
                ?>
                            <span class="robot_stat robot_level_reset robot_type_<?php 
                echo !empty($robot_rewards['flags']['reached_max_level']) ? 'electric' : 'none';
                ?>
"><?php 
                echo !empty($robot_rewards['flags']['reached_max_level']) ? '<span>&#9733;</span>' : '';
                ?>
 <?php 
                echo $robot_info['robot_level'];
                ?>
</span>
                        <?php 
            }
            ?>
                    </td>
                    <?php 
            $right_column_markup[] = ob_get_clean();
        }
        // Define the markup for the experience
        if (true) {
            ob_start();
            ?>
                    <td  class="right">
                        <label style="display: block; float: left;">Experience :</label>
                        <?php 
            if ($robot_info['robot_level'] >= MMRPG_SETTINGS_LEVEL_MAX) {
                ?>
                            <span class="robot_stat robot_type_cutter">&#8734; / &#8734;</span>
                        <?php 
            } else {
                ?>
                            <span class="robot_stat"><?php 
                echo $robot_info['robot_experience'];
                ?>
 / <?php 
                echo rpg_prototype::calculate_experience_required($robot_info['robot_level']);
                ?>
</span>
                        <?php 
            }
            ?>
                    </td>
                    <?php 
            $right_column_markup[] = ob_get_clean();
        }
        // Define the markup for the energy
        if (true) {
            ob_start();
            ?>
                    <td class="right">
                        <label style="display: block; float: left;">Energy :</label>

                        <span class="robot_stat robot_type robot_type_energy" style="padding: 0 6px; margin-right: 3px;"><?php 
            echo MMRPG_SETTINGS_STATS_GET_ROBOTMIN($robot_info['robot_energy_index'], $robot_info['robot_level']);
            ?>
<span style="font-weight: normal; font-size: 9px; position: relative; bottom: 1px;"> LE</span></span>

                        <span class="robot_stat robot_type robot_type_weapons" style="padding: 0 6px;"><?php 
            echo $robot_info['robot_weapons_index'];
            ?>
<span style="font-weight: normal; font-size: 9px; position: relative; bottom: 1px;"> WE</span></span>

                    </td>
                    <?php 
            $right_column_markup[] = ob_get_clean();
        }
        // Define the markup for the attack
        if (true) {
            ob_start();
            ?>
                    <td class="right">
                        <?php 
            // Print out the ATTACK stat
            $temp_stat = 'attack';
            $temp_stat_max = MMRPG_SETTINGS_STATS_GET_ROBOTMAX($robot_info['robot_' . $temp_stat . '_index'], $robot_info['robot_level']);
            $temp_stat_maxed = $robot_info['robot_' . $temp_stat] >= $temp_stat_max ? true : false;
            $temp_title = $robot_info['robot_level'] >= 100 ? $robot_info['robot_' . $temp_stat] . ' / ' . $temp_stat_max . ' Max' . ($temp_stat_maxed ? ' &#9733;' : '') : '';
            $temp_data_type = $temp_stat_maxed ? 'robot_type robot_type_' . $temp_stat : '';
            ?>
                        <label class="<?php 
            echo !empty($player_info['player_' . $temp_stat]) ? 'statboost_player_' . $player_info['player_token'] : '';
            ?>
" style="display: block; float: left;"><?php 
            echo ucfirst($temp_stat);
            ?>
 :</label>
                        <span class="robot_stat <?php 
            echo $temp_stat_maxed ? 'robot_type robot_type_' . $temp_stat : '';
            ?>
"><?php 
            echo '<span style="font-weight: normal; font-size: 9px; position: relative; bottom: 1px;">';
            echo '<span title="Base ' . ucfirst($temp_stat) . '"' . (!empty($temp_data_type) ? ' data-tooltip-type="' . $temp_data_type . '"' : '') . '>' . $robot_info['robot_' . $temp_stat . '_base'] . '</span> ';
            echo !empty($robot_info['robot_' . $temp_stat . '_rewards']) ? '+ <span title="Knockout Bonuses" class="statboost_robot"' . (!empty($temp_data_type) ? ' data-tooltip-type="' . $temp_data_type . '"' : '') . '>' . $robot_info['robot_' . $temp_stat . '_rewards'] . '</span> ' : '';
            echo !empty($robot_info['robot_' . $temp_stat . '_player']) ? '+ <span title="Player Bonuses" class="statboost_player_' . $player_info['player_token'] . ($temp_stat_maxed ? '2' : '') . '"' . (!empty($temp_data_type) ? ' data-tooltip-type="' . $temp_data_type . '"' : '') . '>' . $robot_info['robot_' . $temp_stat . '_player'] . '</span> ' : '';
            echo ' = </span>';
            echo '<span' . (!empty($temp_title) ? ' title="' . $temp_title . '"' : '') . (!empty($temp_data_type) ? ' data-tooltip-type="' . $temp_data_type . '"' : '') . '>';
            echo preg_replace('/^(0+)/', '<span style="color: rgba(255, 255, 255, 0.05); text-shadow: 0 0 0 transparent; ">$1</span>', str_pad($robot_info['robot_' . $temp_stat], 4, '0', STR_PAD_LEFT));
            if ($temp_stat_maxed) {
                echo '<span>&nbsp;&#9733;</span>';
            }
            echo '</span>';
            ?>
</span>
                    </td>
                    <?php 
            $right_column_markup[] = ob_get_clean();
        }
        // Define the markup for the defense
        if (true) {
            ob_start();
            ?>
                    <td class="right">
                        <?php 
            // Print out the DEFENSE stat
            $temp_stat = 'defense';
            $temp_stat_max = MMRPG_SETTINGS_STATS_GET_ROBOTMAX($robot_info['robot_' . $temp_stat . '_index'], $robot_info['robot_level']);
            $temp_stat_maxed = $robot_info['robot_' . $temp_stat] >= $temp_stat_max ? true : false;
            $temp_title = $robot_info['robot_level'] >= 100 ? $robot_info['robot_' . $temp_stat] . ' / ' . $temp_stat_max . ' Max' . ($temp_stat_maxed ? ' &#9733;' : '') : '';
            $temp_data_type = $temp_stat_maxed ? 'robot_type robot_type_' . $temp_stat : '';
            ?>
                        <label class="<?php 
            echo !empty($player_info['player_' . $temp_stat]) ? 'statboost_player_' . $player_info['player_token'] : '';
            ?>
" style="display: block; float: left;"><?php 
            echo ucfirst($temp_stat);
            ?>
 :</label>
                        <span class="robot_stat <?php 
            echo $temp_stat_maxed ? 'robot_type robot_type_' . $temp_stat : '';
            ?>
"><?php 
            echo '<span style="font-weight: normal; font-size: 9px; position: relative; bottom: 1px;">';
            echo '<span title="Base ' . ucfirst($temp_stat) . '"' . (!empty($temp_data_type) ? ' data-tooltip-type="' . $temp_data_type . '"' : '') . '>' . $robot_info['robot_' . $temp_stat . '_base'] . '</span> ';
            echo !empty($robot_info['robot_' . $temp_stat . '_rewards']) ? '+ <span title="Knockout Bonuses" class="statboost_robot"' . (!empty($temp_data_type) ? ' data-tooltip-type="' . $temp_data_type . '"' : '') . '>' . $robot_info['robot_' . $temp_stat . '_rewards'] . '</span> ' : '';
            echo !empty($robot_info['robot_' . $temp_stat . '_player']) ? '+ <span title="Player Bonuses" class="statboost_player_' . $player_info['player_token'] . ($temp_stat_maxed ? '2' : '') . '"' . (!empty($temp_data_type) ? ' data-tooltip-type="' . $temp_data_type . '"' : '') . '>' . $robot_info['robot_' . $temp_stat . '_player'] . '</span> ' : '';
            echo ' = </span>';
            echo '<span' . (!empty($temp_title) ? ' title="' . $temp_title . '"' : '') . (!empty($temp_data_type) ? ' data-tooltip-type="' . $temp_data_type . '"' : '') . '>';
            echo preg_replace('/^(0+)/', '<span style="color: rgba(255, 255, 255, 0.05); text-shadow: 0 0 0 transparent; ">$1</span>', str_pad($robot_info['robot_' . $temp_stat], 4, '0', STR_PAD_LEFT));
            if ($temp_stat_maxed) {
                echo '<span>&nbsp;&#9733;</span>';
            }
            echo '</span>';
            ?>
</span>
                    </td>
                    <?php 
            $right_column_markup[] = ob_get_clean();
        }
        // Define the markup for the speed
        if (true) {
            ob_start();
            ?>
                    <td class="right">
                        <?php 
            // Print out the SPEED stat
            $temp_stat = 'speed';
            $temp_stat_max = MMRPG_SETTINGS_STATS_GET_ROBOTMAX($robot_info['robot_' . $temp_stat . '_index'], $robot_info['robot_level']);
            $temp_stat_maxed = $robot_info['robot_' . $temp_stat] >= $temp_stat_max ? true : false;
            $temp_title = $robot_info['robot_level'] >= 100 ? $robot_info['robot_' . $temp_stat] . ' / ' . $temp_stat_max . ' Max' . ($temp_stat_maxed ? ' &#9733;' : '') : '';
            $temp_data_type = $temp_stat_maxed ? 'robot_type robot_type_' . $temp_stat : '';
            ?>
                        <label class="<?php 
            echo !empty($player_info['player_' . $temp_stat]) ? 'statboost_player_' . $player_info['player_token'] : '';
            ?>
" style="display: block; float: left;"><?php 
            echo ucfirst($temp_stat);
            ?>
 :</label>
                        <span class="robot_stat <?php 
            echo $temp_stat_maxed ? 'robot_type robot_type_' . $temp_stat : '';
            ?>
"><?php 
            echo '<span style="font-weight: normal; font-size: 9px; position: relative; bottom: 1px;">';
            echo '<span title="Base ' . ucfirst($temp_stat) . '"' . (!empty($temp_data_type) ? ' data-tooltip-type="' . $temp_data_type . '"' : '') . '>' . $robot_info['robot_' . $temp_stat . '_base'] . '</span> ';
            echo !empty($robot_info['robot_' . $temp_stat . '_rewards']) ? '+ <span title="Knockout Bonuses" class="statboost_robot"' . (!empty($temp_data_type) ? ' data-tooltip-type="' . $temp_data_type . '"' : '') . '>' . $robot_info['robot_' . $temp_stat . '_rewards'] . '</span> ' : '';
            echo !empty($robot_info['robot_' . $temp_stat . '_player']) ? '+ <span title="Player Bonuses" class="statboost_player_' . $player_info['player_token'] . ($temp_stat_maxed ? '2' : '') . '"' . (!empty($temp_data_type) ? ' data-tooltip-type="' . $temp_data_type . '"' : '') . '>' . $robot_info['robot_' . $temp_stat . '_player'] . '</span> ' : '';
            echo ' = </span>';
            echo '<span' . (!empty($temp_title) ? ' title="' . $temp_title . '"' : '') . (!empty($temp_data_type) ? ' data-tooltip-type="' . $temp_data_type . '"' : '') . '>';
            echo preg_replace('/^(0+)/', '<span style="color: rgba(255, 255, 255, 0.05); text-shadow: 0 0 0 transparent; ">$1</span>', str_pad($robot_info['robot_' . $temp_stat], 4, '0', STR_PAD_LEFT));
            if ($temp_stat_maxed) {
                echo '<span>&nbsp;&#9733;</span>';
            }
            echo '</span>';
            ?>
</span>
                    </td>
                    <?php 
            $right_column_markup[] = ob_get_clean();
        }
        ?>

                <div class="header header_left robot_type robot_type_<?php 
        echo !empty($robot_info['robot_core']) ? $robot_info['robot_core'] : 'none';
        ?>
" style="margin-right: 0;">
                    <span class="title robot_type"><?php 
        echo $robot_info['robot_name'];
        ?>
</span>
                    <span class="core robot_type">
                        <span class="wrap"><span class="sprite sprite_40x40 sprite_40x40_00" style="background-image: url(i/i/<?php 
        echo !empty($robot_info['robot_core']) ? $robot_info['robot_core'] : 'none';
        ?>
-core/il40.png);"></span></span>
                        <span class="text"><?php 
        echo !empty($robot_info['robot_core']) ? ucfirst($robot_info['robot_core']) : 'Neutral';
        ?>
 Core</span>
                    </span>
                </div>
                <div class="body body_left" style="margin-right: 0; padding: 2px 3px; height: auto;">
                    <table class="full" style="margin-bottom: 5px;">
                        <colgroup>
                            <col width="64%" />
                            <col width="1%" />
                            <col width="35%" />
                        </colgroup>
                        <tbody>
                            <tr>
                                <?php 
        if (!empty($left_column_markup[0])) {
            echo $left_column_markup[0];
        } else {
            echo $empty_column_placeholder;
        }
        ?>
                                <td class="center">&nbsp;</td>
                                <?php 
        if (!empty($right_column_markup[0])) {
            echo $right_column_markup[0];
        } else {
            echo $empty_column_placeholder;
        }
        ?>
                            </tr>
                            <tr>
                                <?php 
        if (!empty($left_column_markup[1])) {
            echo $left_column_markup[1];
        } else {
            echo $empty_column_placeholder;
        }
        ?>
                                <td class="center">&nbsp;</td>
                                <?php 
        if (!empty($right_column_markup[1])) {
            echo $right_column_markup[1];
        } else {
            echo $empty_column_placeholder;
        }
        ?>
                            </tr>

                            <tr>
                                <?php 
        if (!empty($left_column_markup[2])) {
            echo $left_column_markup[2];
        } else {
            echo $empty_column_placeholder;
        }
        ?>
                                <td class="center">&nbsp;</td>
                                <?php 
        if (!empty($right_column_markup[2])) {
            echo $right_column_markup[2];
        } else {
            echo $empty_column_placeholder;
        }
        ?>
                            </tr>
                            <tr>
                                <?php 
        if (!empty($left_column_markup[3])) {
            echo $left_column_markup[3];
        } else {
            echo $empty_column_placeholder;
        }
        ?>
                                <td class="center">&nbsp;</td>
                                <?php 
        if (!empty($right_column_markup[3])) {
            echo $right_column_markup[3];
        } else {
            echo $empty_column_placeholder;
        }
        ?>
                            </tr>
                            <tr>
                                <?php 
        if (!empty($left_column_markup[4])) {
            echo $left_column_markup[4];
        } else {
            echo $empty_column_placeholder;
        }
        ?>
                                <td class="center">&nbsp;</td>
                                <?php 
        if (!empty($right_column_markup[4])) {
            echo $right_column_markup[4];
        } else {
            echo $empty_column_placeholder;
        }
        ?>
                            </tr>
                            <tr>
                                <?php 
        if (!empty($left_column_markup[5])) {
            echo $left_column_markup[5];
        } else {
            echo $empty_column_placeholder;
        }
        ?>
                                <td class="center">&nbsp;</td>
                                <?php 
        if (!empty($right_column_markup[5])) {
            echo $right_column_markup[5];
        } else {
            echo $empty_column_placeholder;
        }
        ?>
                            </tr>
                        </tbody>
                    </table>

                    <table class="full">
                        <colgroup>
                            <col width="100%" />
                        </colgroup>
                        <tbody>
                            <tr>
                                <td class="right" style="padding-top: 4px;">
                                    <?/*<label style="display: block; float: left; font-size: 12px;">Abilities :</label>*/?>
                                    <?php 
        // Loop through all the abilities collected by the player and collect IDs
        $allowed_ability_ids = array();
        if (!empty($player_ability_rewards)) {
            foreach ($player_ability_rewards as $ability_token => $ability_info) {
                if (empty($ability_info['ability_token'])) {
                    continue;
                } elseif ($ability_info['ability_token'] == '*') {
                    continue;
                } elseif ($ability_info['ability_token'] == 'ability') {
                    continue;
                } elseif (!isset($mmrpg_database_abilities[$ability_info['ability_token']])) {
                    continue;
                } elseif (!self::has_ability_compatibility($robot_info['robot_token'], $ability_token, $current_item_token)) {
                    continue;
                }
                $ability_info['ability_id'] = $mmrpg_database_abilities[$ability_info['ability_token']]['ability_id'];
                $allowed_ability_ids[] = $ability_info['ability_id'];
            }
        }
        ?>
                                    <div class="ability_container" data-compatible="<?php 
        echo implode(',', $allowed_ability_ids);
        ?>
">
                                        <?php 
        // Sort the player ability index based on ability number
        uasort($player_ability_rewards, array('rpg_functions', 'abilities_sort_for_editor'));
        // Sort the robot ability index based on ability number
        sort($robot_ability_rewards);
        // Collect the ability reward options to be used on all selects
        $ability_rewards_options = $global_allow_editing ? rpg_ability::print_editor_options_list_markup($player_ability_rewards, $robot_ability_rewards, $player_info, $robot_info) : '';
        // Loop through the robot's current abilities and list them one by one
        $empty_ability_counter = 0;
        if (!empty($robot_info['robot_abilities'])) {
            $temp_string = array();
            $temp_inputs = array();
            $ability_key = 0;
            // DEBUG
            //echo 'robot-ability:';
            foreach ($robot_info['robot_abilities'] as $robot_ability) {
                if (empty($robot_ability['ability_token'])) {
                    continue;
                } elseif ($robot_ability['ability_token'] == '*') {
                    continue;
                } elseif ($robot_ability['ability_token'] == 'ability') {
                    continue;
                } elseif (!isset($mmrpg_database_abilities[$robot_ability['ability_token']])) {
                    continue;
                } elseif ($ability_key > 7) {
                    continue;
                }
                $ability_token = $robot_ability['ability_token'];
                $this_ability = rpg_ability::parse_index_info($mmrpg_database_abilities[$ability_token]);
                if (empty($ability_token) || empty($this_ability)) {
                    continue;
                } elseif (!self::has_ability_compatibility($robot_info['robot_token'], $ability_token, $current_item_token)) {
                    continue;
                }
                $temp_select_markup = rpg_ability::print_editor_select_markup($ability_rewards_options, $player_info, $robot_info, $this_ability, $ability_key);
                $temp_string[] = $temp_select_markup;
                $ability_key++;
            }
            if ($ability_key <= 7) {
                for ($ability_key; $ability_key <= 7; $ability_key++) {
                    $empty_ability_counter++;
                    if ($empty_ability_counter >= 2) {
                        $empty_ability_disable = true;
                    } else {
                        $empty_ability_disable = false;
                    }
                    //$temp_select_options = str_replace('value=""', 'value="" selected="selected" disabled="disabled"', $ability_rewards_options);
                    $this_ability_title_html = '<label>-</label>';
                    //if ($global_allow_editing){ $this_ability_title_html .= '<select class="ability_name" data-key="'.$ability_key.'" data-player="'.$player_info['player_token'].'" data-robot="'.$robot_info['robot_token'].'" '.($empty_ability_disable ? 'disabled="disabled" ' : '').'>'.$temp_select_options.'</select>'; }
                    $temp_string[] = '<a class="ability_name " style="' . ($empty_ability_disable ? 'opacity:0.25; ' : '') . (!$global_allow_editing ? 'cursor: default; ' : '') . '" data-id="0" data-key="' . $ability_key . '" data-player="' . $player_info['player_token'] . '" data-robot="' . $robot_info['robot_token'] . '" data-ability="" title="" data-tooltip="">' . $this_ability_title_html . '</a>';
                }
            }
        } else {
            for ($ability_key = 0; $ability_key <= 7; $ability_key++) {
                $empty_ability_counter++;
                if ($empty_ability_counter >= 2) {
                    $empty_ability_disable = true;
                } else {
                    $empty_ability_disable = false;
                }
                //$temp_select_options = str_replace('value=""', 'value="" selected="selected"', $ability_rewards_options);
                $this_ability_title_html = '<label>-</label>';
                //if ($global_allow_editing){ $this_ability_title_html .= '<select class="ability_name" data-key="'.$ability_key.'" data-player="'.$player_info['player_token'].'" data-robot="'.$robot_info['robot_token'].'" '.($empty_ability_disable ? 'disabled="disabled" ' : '').'>'.$temp_select_options.'</select>'; }
                $temp_string[] = '<a class="ability_name " style="' . ($empty_ability_disable ? 'opacity:0.25; ' : '') . (!$global_allow_editing ? 'cursor: default; ' : '') . '" data-id="0" data-key="' . $ability_key . '" data-player="' . $player_info['player_token'] . '" data-robot="' . $robot_info['robot_token'] . '" data-ability="">' . $this_ability_title_html . '</a>';
            }
        }
        // DEBUG
        //echo 'temp-string:';
        echo !empty($temp_string) ? implode(' ', $temp_string) : '';
        // DEBUG
        //echo '<br />temp-inputs:';
        echo !empty($temp_inputs) ? implode(' ', $temp_inputs) : '';
        // DEBUG
        //echo '<br />';
        ?>
                                    </div>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
            <?php 
        $key_counter++;
        // Return the backup of the player selector
        $allow_player_selector = $allow_player_selector_backup;
        // Collect the outbut buffer contents
        $this_markup = trim(ob_get_clean());
        // Return the generated markup
        return $this_markup;
    }