} // DEBUG //$this_battle->events_create(false, false, 'DEBUG_'.__LINE__.'_DATA', ' $this_battle->actions_append($target_player, $active_target_robot, $this_player, $temp_targetability_targetrobot, $target_action, $target_action_token);'); $this_battle->actions_append($target_player, $active_target_robot, $temp_targetability_targetplayer, $temp_targetability_targetrobot, $target_action, $target_action_token); // Now execute the stored actions $this_battle->actions_execute(); $this_battle->update_session(); // Collect the user ability info if set $temp_ability_id = false; $temp_ability_token = false; $temp_ability_info = array(); if ($this_action == 'ability') { list($temp_ability_id, $temp_ability_token) = explode('_', $this_action_token); $temp_ability_info = array('ability_id' => $temp_ability_id, 'ability_token' => $temp_ability_token); $temp_ability_object = new rpg_ability($this_player, $this_robot, $temp_ability_info); $temp_ability_info = $temp_ability_object->export_array(); //$temp_ability_info['ability_id'] = $temp_ability_id; if (!isset($temp_ability_info['ability_target'])) { //$temp_ability_info['ability_target'] = 'auto'; } } // Define the new target robot based on the previous target $new_target_robot = false; // If this is a special SELECT THIS target ability if ($temp_ability_info['ability_target'] == 'select_this') { // Check if this robot is targetting itself or a team mate if ($this_robot->robot_id == $backup_target_robot_id) { // Define the new target robot which is actually a team mate $new_target_robot = new rpg_robot($this_player, array('robot_id' => $this_robot->robot_id, 'robot_token' => $this_robot->robot_token)); // Queue up an this robot's action second, because its slower $this_battle->actions_append($this_player, $this_robot, $this_player, $new_target_robot, $this_action, $this_action_token);