25 static int Ai_profiles_initted = 0;
39 profile->
flags |= flag;
41 profile->
flags &= ~flag;
75 char *saved_Mp = NULL;
100 bool no_create =
false;
109 if (!
stricmp(Ai_profiles[i].profile_name, profile_name))
111 previous_profile = &Ai_profiles[
i];
123 if (previous_profile != NULL)
124 profile = previous_profile;
129 if (previous_profile != NULL)
131 Warning(
LOCATION,
"An ai profile named '%s' already exists! The new one will not be created.\n", profile_name);
152 if (profile == &Ai_profiles[0])
346 if (fov_list[i] < 0.0
f || fov_list[i] >= 360.0
f)
348 Warning(
LOCATION,
"$Player Autoaim FOV should be >= 0 and < 360.0 (read %f). Setting to 0.", fov_list[i]);
483 mprintf((
"Warning: \"$perform less checks for death screams\" flag is deprecated in favor of \"$perform fewer checks for death screams\"\n"));
493 mprintf((
"Warning: \"$allow primary link delay\" flag is deprecated in favor of \"$allow primary link at mission start\"\n"));
504 if (saved_Mp && (saved_Mp ==
Mp))
508 strncpy(tmp,
Mp, 59);
509 mprintf((
"WARNING: Unrecognized parameter in ai_profiles: %s\n", tmp));
524 mprintf((
"TABLES: Unable to parse '%s'! Error message = %s.\n", (filename) ? filename :
"<default ai_profiles.tbl>", e.what()));
537 if (Ai_profiles_initted)
542 Default_profile_name[0] =
'\0';
559 Ai_profiles_initted = 1;
565 if (!
stricmp(name, Ai_profiles[
i].profile_name))
int chance_to_use_missiles_on_plr[NUM_SKILL_LEVELS]
#define AIPF_NAVIGATION_SUBSYS_GOVERNS_WARP
float beam_friendly_damage_cap[NUM_SKILL_LEVELS]
#define AIPF_FIX_LINKED_PRIMARY_BUG
#define AIPF2_TURRETS_IGNORE_TARGET_RADIUS
float glide_strafe_percent[NUM_SKILL_LEVELS]
int check_for_string(const char *pstr)
void fs2netd_add_table_validation(const char *tblname)
float ship_fire_delay_scale_friendly[NUM_SKILL_LEVELS]
#define AIPF2_BEAMS_DAMAGE_WEAPONS
#define AIPF_SMART_SECONDARY_WEAPON_SELECTION
float stalemate_time_thresh[NUM_SKILL_LEVELS]
#define AIPF2_ASPECT_INVULNERABILITY_FIX
float turn_time_scale[NUM_SKILL_LEVELS]
void parse_int_list(int *ilist, int size)
#define AI_PATH_MODE_NORMAL
void _cdecl void void _cdecl void _cdecl Warning(char *filename, int line, SCP_FORMAT_STRING const char *format,...) SCP_FORMAT_STRING_ARGS(3
void set_flag(ai_profile_t *profile, char *name, int flag, int type)
float player_autoaim_fov[NUM_SKILL_LEVELS]
float link_energy_levels_always[NUM_SKILL_LEVELS]
#define AIPF_SMART_SUBSYSTEM_TARGETING_FOR_TURRETS
float bay_arrive_speed_mult
#define AIPF2_STRICT_TURRET_TAGGED_ONLY_TARGETING
float bay_depart_speed_mult
float link_ammo_levels_maybe[NUM_SKILL_LEVELS]
const char * defaults_get_file(const char *filename)
float assist_award_percentage_scale[NUM_SKILL_LEVELS]
#define AIPF2_ADVANCED_TURRET_FOV_EDGE_CHECKS
#define AIPF2_PERFORM_FEWER_SCREAM_CHECKS
#define AIPF_USE_ADDITIVE_WEAPON_VELOCITY
int required_string_either(char *str1, char *str2)
Checks for one of two required strings.
#define AIPF_KILL_SCORING_SCALES_WITH_DAMAGE
GLenum GLuint GLenum GLsizei const GLchar * buf
#define AIPF2_ASPECT_LOCK_COUNTERMEASURE
float ship_fire_secondary_delay_scale_friendly[NUM_SKILL_LEVELS]
#define AIPF2_NO_WARP_CAMERA
void stuff_float(float *f)
#define AIPF_ALLOW_VERTICAL_DODGE
#define AIPF_HUGE_TURRET_WEAPONS_IGNORE_BOMBS
#define AIPF_NO_MIN_DOCK_SPEED_CAP
#define AIPF_DISABLE_WEAPON_DAMAGE_SCALING
float subsys_damage_scale[NUM_SKILL_LEVELS]
#define AIPF_FIX_AI_CLASS_BUG
int repair_penalty[NUM_SKILL_LEVELS]
#define AIPF_INCLUDE_BEAMS_IN_STAT_CALCS
#define AIPF_PREVENT_TARGETING_BOMBS_BEYOND_RANGE
void parse_ai_profiles_tbl(const char *filename)
#define AIPF2_REQUIRE_TURRET_TO_HAVE_TARGET_IN_FOV
#define AIPF2_PLAYER_WEAPON_SCALE_FIX
#define AIPF_ALLOW_RAPID_SECONDARY_DUMBFIRE
void parse_float_list(float *plist, int size)
#define AIPF_DISABLE_LINKED_FIRE_PENALTY
int cf_exists_full(const char *filename, int dir_type)
#define AIPF2_FIX_AI_PATH_ORDER_BUG
#define AIPF2_ALL_SHIPS_MANAGE_SHIELDS
#define AIPF2_NO_SPECIAL_PLAYER_AVOID
float delay_bomb_arm_timer[NUM_SKILL_LEVELS]
float primary_ammo_burst_mult[NUM_SKILL_LEVELS]
void stuff_string(char *outstr, int type, int len, char *terminators)
ai_profile_t Ai_profiles[MAX_AI_PROFILES]
#define AIPF_DONT_INSERT_RANDOM_TURRET_FIRE_DELAY
float cmeasure_life_scale[NUM_SKILL_LEVELS]
#define AIPF_MULTI_ALLOW_EMPTY_SECONDARIES
int required_string(const char *pstr)
#define AIPF2_AI_AIMS_FROM_SHIP_CENTER
int optional_string(const char *pstr)
void read_file_text(const char *filename, int mode, char *processed_text, char *raw_text)
int skip_to_start_of_string_either(char *pstr1, char *pstr2, char *end)
int max_allowed_player_homers[NUM_SKILL_LEVELS]
#define AIPF_BIG_SHIPS_CAN_ATTACK_BEAM_TURRETS_ON_UNTARGETED_SHIPS
float player_damage_scale[NUM_SKILL_LEVELS]
int max_attackers[NUM_SKILL_LEVELS]
char profile_name[NAME_LENGTH]
#define AIPF_FIX_HEAT_SEEKER_STEALTH_BUG
float weapon_energy_scale[NUM_SKILL_LEVELS]
float afterburner_recharge_scale[NUM_SKILL_LEVELS]
void read_file_text_from_array(const char *array, char *processed_text, char *raw_text)
void stuff_boolean(int *i, bool a_to_eol)
#define AIPF_SMART_AFTERBURNER_MANAGEMENT
int max_incoming_asteroids[NUM_SKILL_LEVELS]
float detail_distance_mult[MAX_DETAIL_LEVEL+1]
void reset_parse(char *text)
float max_aim_update_delay[NUM_SKILL_LEVELS]
GLuint const GLchar * name
#define AIPF_ALLOW_MULTI_EVENT_SCORING
int ai_path_type_match(char *p)
#define AIPF_ASSIST_SCORING_SCALES_WITH_DAMAGE
float turret_max_aim_update_delay[NUM_SKILL_LEVELS]
#define AIPF_ALLOW_TURRETS_TARGET_WEAPONS_FREELY
float circle_strafe_percent[NUM_SKILL_LEVELS]
#define AIPF_SMART_PRIMARY_WEAPON_SELECTION
float in_range_time[NUM_SKILL_LEVELS]
#define AIPF2_GLIDE_DECAY_REQUIRES_THRUST
#define AIPF_USE_NEWTONIAN_DAMPENING
float ship_fire_secondary_delay_scale_hostile[NUM_SKILL_LEVELS]
float link_ammo_levels_always[NUM_SKILL_LEVELS]
float glide_attack_percent[NUM_SKILL_LEVELS]
fix predict_position_delay[NUM_SKILL_LEVELS]
#define AIPF2_ALLOW_PRIMARY_LINK_AT_START
float cmeasure_fire_chance[NUM_SKILL_LEVELS]
#define AIPF_HACK_IMPROVE_NON_HOMING_SWARM_TURRET_FIRE_ACCURACY
int ai_profile_lookup(char *name)
float shield_energy_scale[NUM_SKILL_LEVELS]
float ship_fire_delay_scale_hostile[NUM_SKILL_LEVELS]
float kill_percentage_scale[NUM_SKILL_LEVELS]
int parse_modular_table(const char *name_check, void(*parse_callback)(const char *filename), int path_type, int sort_type)
float shield_manage_delay[NUM_SKILL_LEVELS]
#define AIPF_MULTI_ALLOW_EMPTY_PRIMARIES
#define AIPF_SMART_SHIELD_MANAGEMENT
float random_sidethrust_percent[NUM_SKILL_LEVELS]
#define AIPF2_AI_GUARDS_SPECIFIC_SHIP_IN_WING
int max_turret_ownage_target[NUM_SKILL_LEVELS]
int max_turret_ownage_player[NUM_SKILL_LEVELS]
float assist_percentage_scale[NUM_SKILL_LEVELS]
#define AIPF_SHOCKWAVES_DAMAGE_SMALL_SHIP_SUBSYSTEMS
float stalemate_dist_thresh[NUM_SKILL_LEVELS]
float link_energy_levels_maybe[NUM_SKILL_LEVELS]
int skip_to_string(char *pstr, char *end)
#define AIPF_FORCE_BEAM_TURRET_FOV
#define AIPF_USE_ONLY_SINGLE_FOV_FOR_TURRETS