$temp_player_switch_actions = array(); $objects['temp_player_switch_actions'] =& $temp_player_switch_actions; $actions_markup['switch'] = rpg_battle::get_menu_markup($objects, 'switch'); // Collect the battle target menus markup $actions_markup['target_target'] = rpg_battle::get_menu_markup($objects, 'target_target'); $actions_markup['target_this'] = rpg_battle::get_menu_markup($objects, 'target_this'); $actions_markup['target_this_disabled'] = rpg_battle::get_menu_markup($objects, 'target_this_disabled'); // Collect the battle scan menu markup $actions_markup['scan'] = rpg_battle::get_menu_markup($objects, 'scan'); // Collect the battle menu markup $actions_markup['battle'] = rpg_battle::get_menu_markup($objects, 'battle'); } elseif (empty($this_redirect) && $this_battle_status == 'complete') { // Collect the battle options menu markup $actions_markup['option'] = rpg_battle::get_menu_markup($objects, 'option'); // Collect the battle complete menu markup $actions_markup['complete'] = rpg_battle::get_menu_markup($objects, 'complete'); } // If possible, attempt to save the game to the session with recent changes if (rpg_user::is_member() && $this_battle_status == 'complete') { // Save the game session rpg_game::save_session(); } // Determine the next action based on everything that's happened if (empty($this_redirect)) { $this_next_action = 'battle'; $this_robot_status = $this_robot->get_status(); $this_robot_position = $this_robot->get_position(); if (($this_robot_status == 'disabled' || $this_robot_position != 'active') && $this_battle_status != 'complete') { $this_next_action = 'switch'; } }