} elseif (empty($target_robot)) { die('<pre>$target_robot is empty on line ' . __LINE__ . '! :' . print_r($target_robot, true) . '</pre>'); } // If the target's was a switch action, also queue up an ability if ($target_action == 'switch') { // Now execute the stored actions $this_battle->actions_execute(); // Update the active robot reference just in case it has changed foreach ($target_player->player_robots as $temp_robotinfo) { if ($temp_robotinfo['robot_position'] == 'active') { $active_target_robot->robot_load($temp_robotinfo); $active_target_robot->robot_position = 'active'; $active_target_robot->update_session(); } else { $temp_robot = new rpg_robot($target_player, $temp_robotinfo); $temp_robot->robot_load($temp_robotinfo); $temp_robot->robot_position = 'bench'; $temp_robot->update_session(); } } if (empty($active_target_robot)) { $active_target_robot->robot_load($target_player->player_robots[0]); $active_target_robot->robot_position = 'active'; $active_target_robot->update_session(); } // Decide which ability this robot will use $target_action_token = ''; // Check if this robot has choice data defined if (true) { // Collect the ability choice from the robot $temp_token = $active_target_robot->robot_choices_abilities($this_player, $this_robot);