} // -- COLLECT ENVIRONMENT VARIABLES -- // // Collect the field stars from the session variable if (!isset($_SESSION[$session_token]['values']['battle_shops'])) { $_SESSION[$session_token]['values']['battle_shops'] = array(); } $this_battle_shops = !empty($_SESSION[$session_token]['values']['battle_shops']) ? $_SESSION[$session_token]['values']['battle_shops'] : array(); $this_battle_shops_count = !empty($this_battle_shops) ? count($this_battle_shops) : 0; // 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; $global_points_counter = !empty($_SESSION[$session_token]['counters']['battle_points']) ? $_SESSION[$session_token]['counters']['battle_points'] : 0; // Define the global counters for unlocked robot cores and ability types $global_unlocked_robots = rpg_game::robot_tokens_unlocked(); $global_unlocked_abilities = rpg_game::ability_tokens_unlocked(); $global_unlocked_items = !empty($_SESSION[$session_token]['values']['battle_items']) ? $_SESSION[$session_token]['values']['battle_items'] : array(); $global_unlocked_robots_cores = array(); $global_unlocked_abilities_types = array(); $global_unlocked_items_tokens = !empty($global_unlocked_items) ? array_keys($global_unlocked_items) : 0; // Create type counters for each element if (!empty($mmrpg_database_types)) { foreach ($mmrpg_database_types as $type => $info) { $global_unlocked_robots_cores[$type] = 0; $global_unlocked_abilities_types[$type] = 0; } } // Loop through robots and count the number of cores represented if (!empty($global_unlocked_robots)) { foreach ($global_unlocked_robots as $token) { if (!isset($mmrpg_database_robots[$token])) {