- set g_xonoticversion 2.5svn "Xonotic version (formatted for humans)"
-
- // changes a cvar and reports it to the server (for the menu to notify the
- // server about changes)
- alias setreport "set \"$1\" \"$2\" ; sendcvar \"$1\""
-
- // detect dedicated server or client
- alias "_detect_dedicated_$qport" "$*"
- alias "_detect_dedicated_0" ""
- alias if_dedicated "_detect_dedicated_$qport ${* asis}"
- alias if_client "${* asis}"
- if_dedicated alias if_client ""
-
- seta g_configversion 0 "Configuration file version (used to upgrade settings) 0: first run, or previous start was <2.4.1 Later, it's overridden by config.cfg, version ranges are defined in config_update.cfg"
-
// Xonotic version (formatted for machines)
// used to determine if a client version is compatible
// this doesn't have to be bumped with every release
// servers either
//
// e.g. Xonotic 1.5.1 RC1 will be 15101
- gameversion 20000
- gameversion_min 20000 // 2.5.2 still used this
- gameversion_max 20699 // 2.5 version allows any 2.6 release, but no more
+ set g_xonoticversion git "Xonotic version (formatted for humans)"
+ gameversion 100 // 0.1.0
+ gameversion_min 0 // git builds see all versions
+ gameversion_max 65535 // git builds see all versions
// compatibility guideline:
// version a.b.c = a0b0c
// gameversion_min = a0(b-1)00 // show servers of the previous "line"
// gameversion_max = a0(b+1)99 // show servers of the next "line"
- // example: 2.6.3
- // gameversion 20603
- // gameversion_min 20500
- // gameversion_max 20799
- // however, in 2.5.x, we will:
- // gameversion = 20000 // let other 2.5 clients connect
- // gameversion_min = 20000 // 2.5.x still has this, we cannot block it within 2.5
- // however, in 2.6.x, we will just:
- // gameversion_min = 20000 // show 2.5 servers
+ // so, for a given gameversion, _min and _max calculate as follows:
+ // gameversion_min = (gameversion / 100) * 100 - 100
+ // gameversion_max = (gameversion / 100) * 100 + 199
+
+ // changes a cvar and reports it to the server (for the menu to notify the
+ // server about changes)
+ alias setreport "set \"$1\" \"$2\" ; sendcvar \"$1\""
+
+ // detect dedicated server or client
+ alias "_detect_dedicated_$qport" "$*"
+ alias "_detect_dedicated_0" ""
+ alias if_dedicated "_detect_dedicated_$qport ${* asis}"
+ alias if_client "${* asis}"
+ if_dedicated alias if_client ""
+
+ seta g_configversion 0 "Configuration file version (used to upgrade settings) 0: first run, or previous start was <2.4.1 Later, it's overridden by config.cfg, version ranges are defined in config_update.cfg"
// say aliases
alias asay_ctf_flagcarrier "say_team flag carrier at %y"
set sv_ready_restart_after_countdown 0 "if set to 1 the players and map items are reset after the countdown ended, otherwise they're reset already at the beginning of the countdown"
set sv_ready_restart_repeatable 0 "allows the players to restart the game as often as needed"
+ set sv_hitsound_antispam_time 0.05 "don't play the hitsound more often than this for the electro lightning gun or the laser gauntlet"
+
//nifreks lockonrestart feature, used in team-based game modes, if set to 1 and all players readied up no other player can then join the game anymore, useful to block spectators from joining
set teamplay_lockonrestart 0 "it set to 1 in a team-based game, the teams are locked once all players readied up and the game restarted (no new players can join after restart unless using the server-command unlockteams)"
set g_respawn_ghosts_maxtime 6 "maximum amount of time a respawn ghost can last, minimum time is half this value. 0 disables and ghosts fade when the body would"
// fragmessage: This allows extra information to be displayed with the frag centerprints.
- set sv_fragmessage_information_ping 0 "Enable ping display information, 0 = Never display; 1 = Always display (If the player is a bot, it will say bot instead of the ping.)"
+ set sv_fragmessage_information_ping 1 "Enable ping display information, 0 = Never display; 1 = Always display (If the player is a bot, it will say bot instead of the ping.)"
set sv_fragmessage_information_handicap 1 "Enable handicap display information, 0 = Never display; 1 = Only when the player has handicap on; 2 = Always display (Displays Off if off)"
- set sv_fragmessage_information_stats 0 "Enable statistics (health/armor) display information, 0 = Never display; 1 = Always display (Only available for the person who was killed)"
+ set sv_fragmessage_information_stats 1 "Enable statistics (health/armor) display information, 0 = Never display; 1 = Always display (Only available for the person who was killed)"
set sv_fragmessage_information_typefrag 1 "Enable typefrag display information, 0 = Never display; 1 = Always display"
// use default physics
// server game balance settings
// powerup balance settings
// weapon balance settings follow
- exec balance.cfg
+ exec balanceXonotic.cfg
set g_bloodloss 0 "amount of health below which blood loss occurs"
- set g_footsteps 0 "serverside footstep sounds"
+ set g_footsteps 1 "serverside footstep sounds"
set g_deathglow 1.25 "when enabled, players stop glowing after they die (the value specifies glow fading speed)"
// effects
r_picmipsprites 0 // Xonotic uses sprites that should never be picmipped (team mate, typing, waypoints)
+ r_picmipworld 1
+ gl_picmip_world 0
+ gl_picmip_sprites 0
+ gl_picmip_other 2 // so, picmip -2 is best possible quality
r_mipsprites 1
r_mipskins 1
r_shadow_realtime_world_lightmaps 1
seta hud_panel_notify_time 10 "time that a new entry stays until it fades out"
seta hud_panel_notify_fadetime 3 "fade out time"
+seta hud_panel_modicons_dom_layout 0 "3 possible layouts: 0) only icons; 1) icons and percentage of average pps (points per second); 2) icons and average pps"
+
seta hud_panel_timer_increment 0 "show elapsed time instead of remaining time"
seta hud_panel_radar_scale 4096 "distance you can see on the team radar"
set g_movement_highspeed 1 "movement speed modification factor (only changes movement when above maxspeed)"
set g_maxspeed 0 "player speed limit, faster players are killed (0 for unlimited speed)"
+
+ scr_conalpha 1
+ scr_conalpha2factor 0.3
+ scr_conalpha3factor 1
+ scr_conalphafactor 0.8
+ scr_conbrightness 0.35
+ scr_conforcewhiledisconnected 1
+ scr_conscroll2_x 0.11
+ scr_conscroll2_y 0.2
+ scr_conscroll3_x 0
+ scr_conscroll3_y 0
+ scr_conscroll_x -0.1
+ scr_conscroll_y -0.3
+
+ // DP cannot properly detect this, so rather turn off the detection
+ r_texture_dds_load_dxt1_noalpha 1
drawpic_aspect_skin(newPos, "ammo_current_bg", newSize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
drawfont = hud_bigfont;
- drawstring_aspect(numpos, ftos(a), eX * (2/3) * newSize_x + eY * newSize_y, color, panel_fg_alpha * alpha, DRAWFLAG_NORMAL);
+ if(a > 0)
+ drawstring_aspect(numpos, ftos(a), eX * (2/3) * newSize_x + eY * newSize_y, color, panel_fg_alpha * alpha, DRAWFLAG_NORMAL);
+ else // "ghost" ammo count
+ drawstring_aspect(numpos, ftos(a), eX * (2/3) * newSize_x + eY * newSize_y, '0 0 0', panel_fg_alpha * alpha * 0.5, DRAWFLAG_NORMAL);
drawfont = hud_font;
- drawpic_aspect_skin(picpos, GetAmmoPicture(itemcode), '1 1 0' * newSize_y, '1 1 1', panel_fg_alpha * alpha, DRAWFLAG_NORMAL);
+ if(a > 0)
+ drawpic_aspect_skin(picpos, GetAmmoPicture(itemcode), '1 1 0' * newSize_y, '1 1 1', panel_fg_alpha * alpha, DRAWFLAG_NORMAL);
+ else // "ghost" ammo icon
+ drawpic_aspect_skin(picpos, GetAmmoPicture(itemcode), '1 1 0' * newSize_y, '0 0 0', panel_fg_alpha * alpha * 0.5, DRAWFLAG_NORMAL);
}
void HUD_Ammo(void)
if(WEP_VALID(w)) {
HUD_KillNotify_Push(s1, "", 0, DEATH_GENERIC);
if (alsoprint)
- print("^1", s1, "^1 ", Weapon_SuicideMessage(type), "\n");
+ print("^1", sprintf(Weapon_SuicideMessage(type), strcat(s1, "^1")), "\n");
} else if (type == DEATH_KILL) {
HUD_KillNotify_Push(s1, "", 0, DEATH_KILL);
if (alsoprint)
} else if(msg == MSG_KILL) {
w = DEATH_WEAPONOF(type);
if(WEP_VALID(w)) {
- HUD_KillNotify_Push(s2, s1, 1, w);
+ HUD_KillNotify_Push(s1, s2, 1, type);
if (alsoprint)
- print("^1", s1, "^1 ", Weapon_KillMessage(type), "\n");
+ print("^1", sprintf(Weapon_KillMessage(type), strcat(s2, "^1"), strcat(s1, "^1")), "\n"); // default order: victim, killer
}
else if(type == KILL_TEAM_RED || type == KILL_TEAM_BLUE || type == KILL_TEAM_SPREE) {
HUD_KillNotify_Push(s1, s2, 1, type);
a = 0;
}
+ float w;
+ w = DEATH_WEAPONOF(killnotify_deathtype[j]);
+
// TODO: maybe print in team colors?
//
// Y [used by] X
{
s = "weaponelectro";
}
- else if(WEP_VALID(killnotify_deathtype[j]))
+ else if(killnotify_deathtype[j] & HITTYPE_SECONDARY && w == WEP_LASER)
+ {
+ s = "notify_melee_laser";
+ }
+ else if(killnotify_deathtype[j] & HITTYPE_SECONDARY && w == WEP_SHOTGUN)
+ {
+ s = "notify_melee_shotgun";
+ }
+ else if(WEP_VALID(w))
{
- self = get_weaponinfo(killnotify_deathtype[j]);
+ self = get_weaponinfo(w);
s = strcat("weapon", self.netname);
}
else if(killnotify_deathtype[j] == KILL_TEAM_RED)
mySize_y
);
- draw_teamradar_background(hud_panel_radar_background_alpha, hud_panel_radar_foreground_alpha);
+ draw_teamradar_background(hud_panel_radar_foreground_alpha);
for(tm = world; (tm = find(tm, classname, "radarlink")); )
draw_teamradar_link(tm.origin, tm.velocity, tm.team);
drawfont = hud_font;
}
+void DrawDomItem(vector myPos, vector mySize, float aspect_ratio, float i)
+{
+ float stat, pps_ratio;
+ string pic;
+ vector color;
+ switch(i)
+ {
+ case 0:
+ stat = getstatf(STAT_DOM_PPS_RED);
+ pic = "dom_icon_red";
+ color = '1 0 0';
+ break;
+ case 1:
+ stat = getstatf(STAT_DOM_PPS_BLUE);
+ pic = "dom_icon_blue";
+ color = '0 0 1';
+ break;
+ case 2:
+ stat = getstatf(STAT_DOM_PPS_YELLOW);
+ pic = "dom_icon_yellow";
+ color = '1 1 0';
+ break;
+ case 3:
+ stat = getstatf(STAT_DOM_PPS_PINK);
+ pic = "dom_icon_pink";
+ color = '1 0 1';
+ }
+ pps_ratio = stat / getstatf(STAT_DOM_TOTAL_PPS);
+
+ if(mySize_x/mySize_y > aspect_ratio)
+ {
+ i = aspect_ratio * mySize_y;
+ myPos_x = myPos_x + (mySize_x - i) / 2;
+ mySize_x = i;
+ }
+ else
+ {
+ i = 1/aspect_ratio * mySize_x;
+ myPos_y = myPos_y + (mySize_y - i) / 2;
+ mySize_y = i;
+ }
+
+ if (cvar("hud_panel_modicons_dom_layout")) // show text too
+ {
+ //draw the text
+ drawfont = hud_bigfont;
+ color *= 0.5 + pps_ratio * (1 - 0.5); // half saturated color at min, full saturated at max
+ if (cvar("hud_panel_modicons_dom_layout") == 2) // average pps
+ drawstring_aspect(myPos + eX * mySize_y, ftos_decimals(stat, 2), eX * (2/3) * mySize_x + eY * mySize_y, color, panel_fg_alpha, DRAWFLAG_NORMAL);
+ else // percentage of average pps
+ drawstring_aspect(myPos + eX * mySize_y, strcat( ftos(floor(pps_ratio*100 + 0.5)), "%" ), eX * (2/3) * mySize_x + eY * mySize_y, color, panel_fg_alpha, DRAWFLAG_NORMAL);
+ drawfont = hud_font;
+ }
+
+ //draw the icon
+ drawpic_aspect_skin(myPos, pic, '1 1 0' * mySize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+ if (stat > 0)
+ {
+ drawsetcliparea(myPos_x, myPos_y + mySize_y * (1 - pps_ratio), mySize_y, mySize_y * pps_ratio);
+ drawpic_aspect_skin(myPos, strcat(pic, "-highlighted"), '1 1 0' * mySize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+ drawresetcliparea();
+ }
+}
+
+void HUD_Mod_Dom(vector myPos, vector mySize)
+{
+ entity tm;
+ float teams_count;
+ for(tm = teams.sort_next; tm; tm = tm.sort_next)
+ if(tm.team != COLOR_SPECTATOR)
+ ++teams_count;
+
+ float rows, columns, aspect_ratio;
+ rows = mySize_y/mySize_x;
+ aspect_ratio = (cvar("hud_panel_modicons_dom_layout")) ? 3 : 1;
+ rows = bound(1, floor((sqrt((4 * aspect_ratio * teams_count + rows) * rows) + rows + 0.5) / 2), teams_count);
+ columns = ceil(teams_count/rows);
+
+ drawfont = hud_bigfont;
+ int i;
+ float row, column;
+ for(i=0; i<teams_count; ++i)
+ {
+ vector pos, size;
+ pos = myPos + eX * column * mySize_x*(1/columns) + eY * row * mySize_y*(1/rows);
+ size = eX * mySize_x*(1/columns) + eY * mySize_y*(1/rows);
+
+ DrawDomItem(pos, size, aspect_ratio, i);
+
+ ++row;
+ if(row >= rows)
+ {
+ row = 0;
+ ++column;
+ }
+ }
+ drawfont = hud_font;
+}
+
float mod_prev; // previous state of mod_active to check for a change
float mod_alpha;
float mod_change; // "time" when mod_active changed
if(!autocvar_hud_panel_modicons && !autocvar__hud_configure)
return;
- if (gametype != GAME_KEYHUNT && gametype != GAME_CTF && gametype != GAME_NEXBALL && gametype != GAME_CTS && gametype != GAME_RACE && !autocvar__hud_configure)
+ if (gametype != GAME_KEYHUNT && gametype != GAME_CTF && gametype != GAME_NEXBALL && gametype != GAME_CTS && gametype != GAME_RACE && gametype != GAME_DOMINATION && !autocvar__hud_configure)
return;
active_panel = HUD_PANEL_MODICONS;
HUD_Mod_NexBall(pos, mySize);
else if(gametype == GAME_CTS || gametype == GAME_RACE)
HUD_Mod_Race(pos, mySize);
+ else if(gametype == GAME_DOMINATION)
+ HUD_Mod_Dom(pos, mySize);
}
// Draw pressed keys (#11)
pos = (vid_conheight - numsize_y) * cvar("cl_showspeed_position");
drawfont = hud_bigfont;
- drawstringcenter(eX + pos * eY, speed, numsize, '1 1 1', hud_fg_alpha, DRAWFLAG_NORMAL);
+ drawstringcenter(eX + pos * eY, speed, numsize, '1 1 1', autocvar_hud_panel_fg_alpha, DRAWFLAG_NORMAL);
if (cvar("cl_showspeed_z") == 1) {
zspeed = strcat(ftos(fabs(floor( pmove_vel_z * conversion_factor + 0.5 ))), unit);
- drawstringcenter(eX + pos * eY + numsize_y * eY, zspeed, numsize * 0.5, '1 1 1', hud_fg_alpha, DRAWFLAG_NORMAL);
+ drawstringcenter(eX + pos * eY + numsize_y * eY, zspeed, numsize * 0.5, '1 1 1', autocvar_hud_panel_fg_alpha, DRAWFLAG_NORMAL);
}
drawfont = hud_font;
}
if (acceleration > 0)
- HUD_Panel_DrawProgressBar(pos, 0, acceleration * scale * '40 0 0' + sz * eY, rgb, alpha * hud_fg_alpha, DRAWFLAG_NORMAL);
+ HUD_Panel_DrawProgressBar(pos, 0, acceleration * scale * '40 0 0' + sz * eY, rgb, alpha * autocvar_hud_panel_fg_alpha, DRAWFLAG_NORMAL);
else if (acceleration < 0)
- HUD_Panel_DrawProgressBar(pos + acceleration * scale * '40 0 0', 0, -acceleration * scale * '40 0 0' + sz * eY, rgb, alpha * hud_fg_alpha, DRAWFLAG_NORMAL);
+ HUD_Panel_DrawProgressBar(pos + acceleration * scale * '40 0 0', 0, -acceleration * scale * '40 0 0' + sz * eY, rgb, alpha * autocvar_hud_panel_fg_alpha, DRAWFLAG_NORMAL);
}
void HUD_Reset (void)
menu_fade_alpha = 1;
else
menu_fade_alpha = (1 - autocvar__menu_alpha);
- hud_fg_alpha = cvar("hud_fg_alpha");
hud_border_thickness = bound(0, cvar("hud_border_thickness"), 5);
hud_accuracy_border_thickness = bound(0, cvar_or("hud_accuracy_border_thickness", 1), 5);
const float TE_CSQC_TARGET_MUSIC = 111;
const float TE_CSQC_NOTIFY = 112;
const float TE_CSQC_WEAPONCOMPLAIN = 113;
+ const float TE_CSQC_CAMPINGRIFLE_SCOPE = 115;
+ const float TE_CSQC_NEX_SCOPE = 116;
const float RACE_NET_CHECKPOINT_HIT_QUALIFYING = 0; // byte checkpoint, short time, short recordtime, string recordholder
const float RACE_NET_CHECKPOINT_CLEAR = 1;
const float ENT_CLIENT_WARPZONE = 24;
const float ENT_CLIENT_WARPZONE_CAMERA = 25;
const float ENT_CLIENT_TRIGGER_MUSIC = 26;
+ const float ENT_CLIENT_HOOK = 27;
+ const float ENT_CLIENT_LGBEAM = 28;
+ const float ENT_CLIENT_GAUNTLET = 29;
const float ENT_CLIENT_TURRET = 40;
const float STAT_LEADLIMIT = 47;
const float STAT_BULLETS_LOADED = 48;
+const float STAT_DOM_TOTAL_PPS = 70;
+const float STAT_DOM_PPS_RED = 71;
+const float STAT_DOM_PPS_BLUE = 72;
+const float STAT_DOM_PPS_PINK = 73;
+const float STAT_DOM_PPS_YELLOW = 74;
+
// see DP source, quakedef.h
const float STAT_MOVEVARS_AIRSPEEDLIMIT_NONQW = 222;
const float STAT_MOVEVARS_AIRSTRAFEACCEL_QW = 223;
{
WriteByte(MSG_ENTITY, ENT_CLIENT_INIT);
WriteByte(MSG_ENTITY, g_nexball_meter_period * 32);
- WriteCoord(MSG_ENTITY, hook_shotorigin_x);
- WriteCoord(MSG_ENTITY, hook_shotorigin_y);
- WriteCoord(MSG_ENTITY, hook_shotorigin_z);
+ WriteInt24_t(MSG_ENTITY, compressShotOrigin(hook_shotorigin[0]));
+ WriteInt24_t(MSG_ENTITY, compressShotOrigin(hook_shotorigin[1]));
+ WriteInt24_t(MSG_ENTITY, compressShotOrigin(hook_shotorigin[2]));
+ WriteInt24_t(MSG_ENTITY, compressShotOrigin(hook_shotorigin[3]));
+ WriteInt24_t(MSG_ENTITY, compressShotOrigin(electro_shotorigin[0]));
+ WriteInt24_t(MSG_ENTITY, compressShotOrigin(electro_shotorigin[1]));
+ WriteInt24_t(MSG_ENTITY, compressShotOrigin(electro_shotorigin[2]));
+ WriteInt24_t(MSG_ENTITY, compressShotOrigin(electro_shotorigin[3]));
+ WriteInt24_t(MSG_ENTITY, compressShotOrigin(gauntlet_shotorigin[0]));
+ WriteInt24_t(MSG_ENTITY, compressShotOrigin(gauntlet_shotorigin[1]));
+ WriteInt24_t(MSG_ENTITY, compressShotOrigin(gauntlet_shotorigin[2]));
+ WriteInt24_t(MSG_ENTITY, compressShotOrigin(gauntlet_shotorigin[3]));
if(sv_foginterval && world.fog != "")
WriteString(MSG_ENTITY, world.fog);
else
WriteByte(MSG_ENTITY, self.cnt * 255.0); // g_balance_weaponswitchdelay
WriteCoord(MSG_ENTITY, self.bouncefactor); // g_balance_grenadelauncher_secondary_bouncefactor
WriteCoord(MSG_ENTITY, self.bouncestop); // g_balance_grenadelauncher_secondary_bouncestop
+ WriteByte(MSG_ENTITY, cvar("g_balance_nex_secondary")); // client has to know if it should zoom or not
+ WriteByte(MSG_ENTITY, cvar("g_balance_campingrifle_secondary")); // client has to know if it should zoom or not
return TRUE;
}
.float uid_kicktime;
.string uid;
#endif
+void set_dom_state(entity e, float connecting);
void ClientConnect (void)
{
float t;
else if(cvar("sv_teamnagger") && !g_ca) // teamnagger is currently bad for ca
send_CSQC_teamnagger();
+ if (g_domination)
+ set_dom_state(self, TRUE);
+
CheatInitClient();
}
if(self.cvar_g_xonoticversion)
if(time > self.version_nagtime)
{
- if(strstr(self.cvar_g_xonoticversion, "svn", 0) < 0)
+ if(strstr(self.cvar_g_xonoticversion, "git", 0) < 0)
{
- if(strstr(cvar_string("g_xonoticversion"), "svn", 0) >= 0)
+ if(strstr(cvar_string("g_xonoticversion"), "git", 0) >= 0)
{
dprint("^1NOTE^7 to ", self.netname, "^7 - the server is running ^3Xonotic ", cvar_string("g_xonoticversion"), " (beta)^7, you have ^3Xonotic ", self.cvar_g_xonoticversion, "^1\n");
sprint(self, strcat("\{1}^1NOTE: ^7the server is running ^3Xonotic ", cvar_string("g_xonoticversion"), " (beta)^7, you have ^3Xonotic ", self.cvar_g_xonoticversion, "^1\n"));
}
if(!zoomstate_set)
- SetZoomState(self.BUTTON_ZOOM || (self.BUTTON_ATCK2 && self.weapon == WEP_NEX));
+ SetZoomState(self.BUTTON_ZOOM || (self.BUTTON_ATCK2 && self.weapon == WEP_NEX) || (self.BUTTON_ATCK2 && self.weapon == WEP_CAMPINGRIFLE && cvar("g_balance_campingrifle_secondary") == 0));
float oldspectatee_status;
oldspectatee_status = self.spectatee_status;