92 Warning(
LOCATION,
"Debriefing text for %s rank is assigned to an invalid persona: %i (must be 0 or greater).\n", Ranks[idx].name, persona);
99 Warning(
LOCATION,
"%s rank is missing default debriefing text.\n", Ranks[idx].name);
109 for (idx = 0; idx <
NUM_RANKS - 1; idx++) {
117 mprintf((
"TABLES: Unable to parse '%s'! Error message = %s.\n",
"rank.tbl", e.what()));
260 int i, score, new_rank, old_rank;
281 if ( score >= Ranks[i].
points )
287 if ( old_rank != new_rank ) {
305 auto i = std::distance(
Ship_info.cbegin(), it);
307 total_kills += sc->
kills[
i];
313 int last_badge_kills = 0;
315 if ( total_kills >=
Medals[
i].kills_needed
316 &&
Medals[
i].kills_needed > last_badge_kills
317 &&
Medals[
i].kills_needed > 0 )
319 last_badge_kills =
Medals[
i].kills_needed;
384 for (
size_t medal = 0; medal < score->
m_badge_earned.size(); medal++) {
450 nprintf((
"Network",
"Storing stats for all players now\n"));
463 nprintf((
"General",
"Storing stats now\n"));
494 int found_slot, signature;
495 int lowest_index,
idx;
505 if(other_obj == NULL){
512 float actual_damage = 0.0f;
517 if ( other_obj->
parent != -1 ){
526 if(use_obj == ship_objp){
537 actual_damage = damage;
539 if(actual_damage < 0.0
f){
540 actual_damage = 0.0f;
592 float max_damage_pct;
593 int max_damage_index;
595 int idx,net_player_num;
600 float scoring_scale_by_damage = 1;
601 int kill_score, assist_score;
602 bool is_enemy_player =
false;
624 if(net_player_num != -1){
628 is_enemy_player =
true;
647 max_damage_index = -1;
656 max_damage_index =
idx;
661 if((max_damage_index < 0) || (max_damage_index >= MAX_DAMAGE_SLOTS)){
668 CLAMP(max_damage_pct, 0.0
f, 1.0
f);
677 scoring_scale_by_damage = max_damage_pct;
689 if(net_player_num != -1){
728 if(net_plr != NULL ) {
743 if (is_enemy_player) {
744 kill_score = (
int)(dead_ship->
score * scoring_scale_by_damage);
755 char kill_score_text[1024] =
"";
756 sprintf(kill_score_text,
"SCORING : %s killed a ship worth %d points and gets %d pts for the kill\n", plr->
callsign, dead_ship->
score, kill_score);
779 char score_text[1024] =
"";
780 sprintf(score_text,
"SCORING : All team mates get %d pts for helping kill the capship\n", assist_score);
791 char dead_text[1024] =
"";
837 if (net_player_num != -1) {
854 return max_damage_index;
859 float max_damage_pct;
860 int max_damage_index;
862 int idx,net_player_num;
866 float scoring_scale_by_damage = 1;
903 max_damage_index = -1;
912 max_damage_index =
idx;
917 if((max_damage_index < 0) || (max_damage_index >= MAX_DAMAGE_SLOTS)){
924 CLAMP(max_damage_pct, 0.0
f, 1.0
f);
933 scoring_scale_by_damage = max_damage_pct;
945 if(net_player_num != -1){
975 if(net_plr != NULL ) {
988 kill_score = (
int)(dead_wip->
score * scoring_scale_by_damage);
994 char kill_score_text[1024] =
"";
995 sprintf(kill_score_text,
"SCORING : %s killed a ship worth %i points and gets %i pts for the kill", plr->
callsign, dead_wip->
score, kill_score);
1004 if(net_plr != NULL){
1032 char dead_text[1024] =
"";
1073 #ifdef SCORING_DEBUG
1082 if (net_player_num != -1) {
1099 return max_damage_index;
1108 float scoring_scale_by_damage = 1;
1111 float scoring_scale_factor;
1129 if(net_player_num != -1){
1146 nprintf((
"Network",
"-==============GAVE PLAYER %s AN ASSIST=====================-\n",plr->
callsign));
1150 if (is_enemy_player) {
1152 scoring_scale_factor = 1.0f;
1162 assist_score = (
int)(sp->
score * scoring_scale_factor * scoring_scale_by_damage);
1171 #ifdef SCORING_DEBUG
1174 char score_text[1024] =
"";
1175 sprintf(score_text,
"SCORING : %s gets %d pts for getting an assist\n", plr->
callsign, assist_score);
1201 if(other_obj == NULL){
1217 if(other_obj->
parent < 0){
1231 bool hit_obj_is_bomb =
false;
1243 if (!hit_obj_is_bomb) {
1248 int is_bonehead = 0;
1254 }
else if (hit_obj_is_bomb) {
1273 if ( player_num != -1 ) {
1353 int found_slot, signature;
1354 int lowest_index,
idx;
1364 if(other_obj == NULL){
1371 float actual_damage = 0.0f;
1376 if ( other_obj->
parent != -1 ){
1381 use_obj = other_obj;
1385 if(use_obj == weapon_obj){
1396 actual_damage = damage;
1398 if(actual_damage < 0.0
f){
1399 actual_damage = 0.0f;
1474 nprintf((
"General",
"Could not bash player rank - invalid value!!!\n"));
1483 DCF(rank,
"changes player rank")
1489 dc_printf(
" <index> The rank index you wish to have. For retail ranks, these correspond to:\n");
1491 dc_printf(
"\t1 : Lieutenant Junior Grade\n");
1493 dc_printf(
"\t3 : Lieutenant Commander\n");
1507 dc_printf(
"Error! Current Player not active or loaded\n");
1517 dc_printf(
"Error! Current Player not active or loaded\n");
1525 for (it = Ranks[
i].promotion_text.begin(); it != Ranks[
i].
promotion_text.end(); ++it) {
#define MULTIPLAYER_CLIENT
int ship_info_lookup(const char *token)
SCP_vector< medal_stuff > Medals
weapon Weapons[MAX_WEAPONS]
void hud_gauge_popup_start(int gauge_index, int time)
Start a gauge to pop-up.
int kills[MAX_SHIP_CLASSES]
int check_for_string(const char *pstr)
void scoring_level_init(scoring_struct *scp)
weapon_info Weapon_info[MAX_WEAPON_TYPES]
void scoring_do_accept(scoring_struct *score)
char Scoring_debug_text[4096]
GLsizei const GLfloat * points
int scoring_eval_kill_on_weapon(object *weapon_obj, object *other_obj)
#define MULTI_STANDALONE(np)
void _cdecl void void _cdecl void _cdecl Warning(char *filename, int line, SCP_FORMAT_STRING const char *format,...) SCP_FORMAT_STRING_ARGS(3
unsigned int mp_shots_fired
char * drop_white_space(char *str)
unsigned int mp_bonehead_hits
int m_kills[MAX_SHIP_CLASSES]
int multi_find_player_by_signature(int signature)
void compact_multitext_string(char *str)
#define MISSION_FLAG_NO_PROMOTION
void multi_team_maybe_add_score(int points, int team)
float assist_award_percentage_scale[NUM_SKILL_LEVELS]
unsigned int ms_bonehead_hits
unsigned int s_shots_fired
int required_string_either(char *str1, char *str2)
Checks for one of two required strings.
#define AIPF_KILL_SCORING_SCALES_WITH_DAMAGE
#define PLAYER_FLAGS_PROMOTED
GLenum GLuint GLenum GLsizei const GLchar * buf
char callsign[CALLSIGN_LEN+1]
unsigned int mp_shots_hit
SCP_vector< int > m_badge_earned
void multi_df_eval_kill(net_player *killer, object *dead_obj)
#define CLAMP(x, min, max)
int damage_ship_id[MAX_WEP_DAMAGE_SLOTS]
unsigned int ms_shots_fired
typedef int(SCP_EXT_CALLCONV *SCPDLL_PFVERSION)(SCPDLL_Version *)
unsigned int missions_flown
int m_okKills[MAX_SHIP_CLASSES]
void scoring_backout_accept(scoring_struct *score)
#define NETINFO_FLAG_AM_MASTER
int scoring_eval_kill(object *ship_objp)
void scoring_level_close(int accepted)
void send_game_chat_packet(net_player *from, const char *msg, int msg_mode, net_player *to, const char *expr, int server_msg)
unsigned int p_shots_fired
ai_profile_t * ai_profile
void stuff_string(char *outstr, int type, int len, char *terminators)
sprintf(buf,"(%f,%f,%f)", v3->xyz.x, v3->xyz.y, v3->xyz.z)
float damage_ship[MAX_DAMAGE_SLOTS]
void scoring_add_damage_to_weapon(object *weapon_obj, object *other_obj, float damage)
int required_string(const char *pstr)
float scoring_get_scale_factor()
#define STATS_MISSION_KILLS
int optional_string(const char *pstr)
SCP_vector< int > medal_counts
bool dc_optional_string_either(const char *str1, const char *str2)
Searches for an optional string and it's alias.
void read_file_text(const char *filename, int mode, char *processed_text, char *raw_text)
void scoring_eval_badges(scoring_struct *sc)
int m_dogfight_kills[MAX_PLAYERS]
int iff_x_attacks_y(int team_x, int team_y)
int damage_ship_id[MAX_DAMAGE_SLOTS]
object Objects[MAX_OBJECTS]
float total_damage_received
bool end_string_at_first_hash_symbol(char *src)
void scoring_eval_rank(scoring_struct *sc)
#define WF_ALREADY_APPLIED_STATS
void reset_parse(char *text)
void scoring_add_damage(object *ship_objp, object *other_obj, float damage)
void assign(const scoring_struct &s)
void dc_stuff_int(int *i)
Stuffs an int to the given variable. Supports binary (0b), hexadecimal (0x), and octal (0o) formats...
GLuint const GLchar * name
#define AIPF_ASSIST_SCORING_SCALES_WITH_DAMAGE
float total_damage_received
#define MISSION_TYPE_TRAINING
int ship_get_by_signature(int signature)
void update_stats(scoring_struct *stats, bool training=false)
#define MULTI_CONNECTED(np)
void send_player_stats_block_packet(net_player *pl, int stats_code, net_player *target, short offset)
void scoring_eval_assists(ship *sp, int killer_sig, bool is_enemy_player)
float Scoring_scale_factors[NUM_SKILL_LEVELS]
unsigned int p_bonehead_hits
#define MULTIPLAYER_MASTER
SCP_map< int, char * > promotion_text
An overhauled/updated debug console to allow monitoring, testing, and general debugging of new featur...
SCP_vector< ship_info > Ship_info
void ignore_white_space()
#define STATS_DOGFIGHT_KILLS
rank_stuff Ranks[NUM_RANKS]
float kill_percentage_scale[NUM_SKILL_LEVELS]
void scoring_eval_hit(object *hit_obj, object *other_obj, int from_blast)
void dc_printf(const char *format,...)
Prints the given char string to the debug console.
void HUD_printf(const char *format,...)
#define MAX_FREESPACE2_RANK
int multi_find_player_by_object(object *objp)
#define MISSION_FLAG_NO_TRAITOR
float assist_percentage_scale[NUM_SKILL_LEVELS]
net_player Net_players[MAX_PLAYERS]
float damage_ship[MAX_WEP_DAMAGE_SLOTS]
unsigned int ms_shots_hit
int skip_to_string(char *pstr, char *end)
unsigned int s_bonehead_hits
DCF(rank,"changes player rank")
void scoring_bash_rank(player *pl, int rank)