alias localprint "qc_cmd_cl localprint ${* ?}" // Create your own centerprint sent to yourself
//alias mv_download "qc_cmd_cl mv_download ${* ?}" // Retrieve mapshot picture from the server
alias sendcvar "qc_cmd_cl sendcvar ${* ?}" // Send a cvar to the server (like weaponpriority)
+alias exit "quit"
// other aliases for local commands
alias hud_configure "qc_cmd_cl hud configure"
alias vdokick "vdo kick ${* ?}"
alias vdokickban "vdo kickban ${* ?}"
alias vdoend "vdo endmatch"
+alias vext "vcall extendmatchtime"
// ======================
// rcon server commands
set g_warmup 0 "split the game into a warmup- and match-stage when set to 1"
set g_warmup_limit 0 "if set to -1 the warmup-stage is not affected by any timelimit, if set to 0 the usual timelimit also affects warmup-stage, otherwise warmup will be limited to this time in SECONDS (useful for public matches)"
set g_warmup_allow_timeout 0 "if set to 1 timeouts can also be called in the warmup-stage, when sv_timeout is set to 1"
-set g_warmup_allguns 1 "if set players start with all guns in warmup mode"
+set g_warmup_allguns 1 "provide more weapons on start while in warmup: 0 = normal start weapons, 1 = all guns available on the map, 2 = all normal weapons"
set g_warmup_majority_factor 0.8 "minimum percentage of players ready needed for warmup to end"
set g_chat_nospectators 0 "if 0 spec/observer chat is always visible to the player, if 1 it is never visible to players, if 2 it is only visible to players during warmup stage"
set g_spawnshieldtime 1 "number of seconds you are invincible after you spawned, this shield is lost after you fire"
set g_antilag 2 "AntiLag (0 = no AntiLag, 1 = verified client side hit scan, 2 = server side hit scan in the past, 3 = unverified client side hit scan)"
set g_antilag_nudge 0 "don't touch"
-set g_antilag_bullets 1 "Bullets AntiLag (0 = no AntiLag, 1 = server side hit scan in the past) - DO NOT TOUCH (severely changes weapon balance)"
set g_shootfromclient 2 "let client decide if it has the gun left or right; if set to 2, center handedness is allowed; see also cl_gunalign"
set g_shootfromeye 0 "shots are fired from your eye/crosshair; visual gun position can still be influenced by cl_gunalign 1 and 2"
set g_shootfromcenter 0 "weapon gets moved to the center, shots still come from the barrel of your weapon; visual gun position can still be influenced by cl_gunalign 1 and 2"
r_cullentities_trace 0
// less "lagging" of other players, but also less PL tolerant... let's try this
-sv_clmovement_inputtimeout 0.07 // more than 2, less than 3 server frames
+sv_clmovement_inputtimeout 0.066 // slightly less than 2 frames, so only one frame can be compensated
// exact gloss looks better, e.g. on g-23
r_shadow_glossexact 1
// item: server list
ALPHA_SERVERLIST_FULL 0.4
-ALPHA_SERVERLIST_EMPTY 0.7
+ALPHA_SERVERLIST_EMPTY 0.6
COLOR_SERVERLIST_LOWPING '0 1 0'
COLOR_SERVERLIST_MEDPING '1 0.75 0'
COLOR_SERVERLIST_HIGHPING '1 0 0'
entity clearentity_ent;
void clearentity(entity e)
{
- if not(clearentity_ent)
+ if (!clearentity_ent)
{
clearentity_ent = spawn();
clearentity_ent.classname = "clearentity";
//registercommand("hud_configure");
//registercommand("hud_save");
//registercommand("menu_action");
-
+
ConsoleCommand_macro_init();
registercvar("hud_usecsqc", "1");
turrets_precache();
Tuba_Precache();
CSQCPlayer_Precache();
-
+
if(autocvar_cl_reticle)
{
if(autocvar_cl_reticle_item_normal) { precache_pic("gfx/reticle_normal"); }
if(autocvar_cl_reticle_item_nex) { precache_pic("gfx/reticle_nex"); }
}
-
+
get_mi_min_max_texcoords(1); // try the CLEVER way first
minimapname = strcat("gfx/", mi_shortname, "_radar.tga");
shortmapname = mi_shortname;
if(autocvar_chase_active < 0)
cvar_set("chase_active", "0");
- if not(isdemo())
+ if (!isdemo())
{
- if not(calledhooks & HOOK_START)
+ if (!(calledhooks & HOOK_START))
localcmd("\n_cl_hook_gamestart nop\n");
- if not(calledhooks & HOOK_END)
+ if (!(calledhooks & HOOK_END))
localcmd("\ncl_hook_gameend\n");
}
}
}
else
{
- if not(o.has_team)
+ if (!o.has_team)
{
o.team = Team;
tm = GetTeam(Team, true);
}
else
{
- if not(e.sort_prev)
+ if (!e.sort_prev)
{
// player connected
- if not(e)
+ if (!e)
playerslots[i] = e = spawn();
e.sv_entnum = i;
e.ping = 0;
self.sv_entnum = n;
- if not(playerslots[self.sv_entnum])
+ if (!(playerslots[self.sv_entnum]))
playerslots[self.sv_entnum] = spawn();
o = self.owner = playerslots[self.sv_entnum];
o.sv_entnum = self.sv_entnum;
o.gotscores = 1;
- //if not(o.sort_prev)
+ //if (!o.sort_prev)
// RegisterPlayer(o);
//playerchecker will do this for us later, if it has not already done so
{
f = ReadByte();
for(j = i-1, b = 1; b < 256; b *= 2, ++j)
- if not(f & b)
+ if (!(f & b))
if(playerslots[j])
playerslots[j].ready = 0;
}
spn_origin_x = ReadShort();
spn_origin_y = ReadShort();
spn_origin_z = ReadShort();
-
+
if(is_new)
{
self.origin = spn_origin;
}
}
else { self.cnt = particleeffectnum("spawn_point_neutral"); }
-
+
self.draw = Spawn_Draw;
}
}
// this way the server can disable the sending of
// spawn origin or such to clients if wanted.
float entnum = ReadByte();
-
+
if(entnum)
{
self.origin_x = ReadShort();
}
}
}
-
+
// local spawn actions
if(is_new && (!entnum || (entnum == player_localentnum)))
{
button_zoom = FALSE;
}
}
-
+
//print(sprintf("Ent_ReadSpawnEvent(is_new = %d); origin = %s, entnum = %d, localentnum = %d\n", is_new, vtos(self.origin), entnum, player_localentnum));
}
case ENT_CLIENT_GAUNTLET: Ent_ReadHook(bIsNewEntity, ENT_CLIENT_GAUNTLET); break;
case ENT_CLIENT_ACCURACY: Ent_ReadAccuracy(); break;
case ENT_CLIENT_AUXILIARYXHAIR: Net_AuXair2(bIsNewEntity); break;
- case ENT_CLIENT_TURRET: ent_turret(); break;
+ case ENT_CLIENT_TURRET: ent_turret(); break;
case ENT_CLIENT_MODEL: CSQCModel_Read(bIsNewEntity); break;
- case ENT_CLIENT_ITEM: ItemRead(bIsNewEntity); break;
+ case ENT_CLIENT_ITEM: ItemRead(bIsNewEntity); break;
case ENT_CLIENT_BUMBLE_RAYGUN: bumble_raygun_read(bIsNewEntity); break;
case ENT_CLIENT_SPAWNPOINT: Ent_ReadSpawnPoint(bIsNewEntity); break;
case ENT_CLIENT_SPAWNEVENT: Ent_ReadSpawnEvent(bIsNewEntity); break;
void Gamemode_Init()
{
- if not(isdemo())
+ if (!isdemo())
{
if(!(calledhooks & HOOK_START))
localcmd("\n_cl_hook_gamestart ", MapInfo_Type_ToString(gametype), "\n");
pi = ReadShort();
pl = ReadByte();
ml = ReadByte();
- if not(playerslots[e])
+ if (!(playerslots[e]))
return;
playerslots[e].ping = pi;
playerslots[e].ping_packetloss = pl / 255.0;
else if(autocvar_cl_spawnzoom && zoomin_effect)
{
float spawnzoomfactor = bound(1, autocvar_cl_spawnzoom_factor, 16);
-
- current_viewzoom += (autocvar_cl_spawnzoom_speed * (spawnzoomfactor - current_viewzoom) * drawframetime);
+
+ current_viewzoom += (autocvar_cl_spawnzoom_speed * (spawnzoomfactor - current_viewzoom) * drawframetime);
current_viewzoom = bound(1 / spawnzoomfactor, current_viewzoom, 1);
if(current_viewzoom == 1) { zoomin_effect = 0; }
}
setsensitivityscale(pow(current_viewzoom, 1 - zoomsensitivity));
else
setsensitivityscale(1);
-
+
makevectors(view_angles);
if(autocvar_cl_velocityzoom && autocvar_cl_velocityzoom_type) // _type = 0 disables velocity zoom too
case 1: default: curspeed = vlen(v); break;
}
}
-
+
velocityzoom = bound(0, drawframetime / max(0.000000001, autocvar_cl_velocityzoom_time), 1); // speed at which the zoom adapts to player velocity
avgspeed = avgspeed * (1 - velocityzoom) + (curspeed / autocvar_cl_velocityzoom_speed) * velocityzoom;
velocityzoom = exp(float2range11(avgspeed * -autocvar_cl_velocityzoom / 1) * 1);
-
+
//print(ftos(avgspeed), " avgspeed, ", ftos(curspeed), " curspeed, ", ftos(velocityzoom), " return\n"); // for debugging
}
else
drawstring('0 0 0', "", '1 1 0', '1 1 1', 0, 0);
if(autocvar_r_fakelight >= 2 || autocvar_r_fullbright)
- if not(serverflags & SERVERFLAG_ALLOW_FULLBRIGHT)
+ if (!(serverflags & SERVERFLAG_ALLOW_FULLBRIGHT))
{
// apply night vision effect
vector tc_00, tc_01, tc_10, tc_11;
R_PolygonVertex(autocvar_vid_conheight * '0 1 0', tc_01, rgb, a);
R_EndPolygon();
}
-
+
// Draw the aiming reticle for weapons that use it
// reticle_type is changed to the item we are zooming / aiming with, to decide which reticle to use
// It must be a persisted float for fading out to work properly (you let go of the zoom button for
reticle_type = 1; // normal zoom
else if((activeweapon == WEP_NEX) && button_attack2)
reticle_type = 2; // nex zoom
-
+
if(reticle_type && autocvar_cl_reticle)
{
if(autocvar_cl_reticle_stretch)
old_bluralpha = 0;
}
- // edge detection postprocess handling done second (used by hud_powerup)
+ // edge detection postprocess handling done second (used by hud_powerup)
float sharpen_intensity = 0, strength_finished = getstatf(STAT_STRENGTH_FINISHED), invincible_finished = getstatf(STAT_INVINCIBLE_FINISHED);
if (strength_finished - time > 0) { sharpen_intensity += (strength_finished - time); }
if (invincible_finished - time > 0) { sharpen_intensity += (invincible_finished - time); }
-
+
sharpen_intensity = bound(0, ((getstati(STAT_HEALTH) > 0) ? sharpen_intensity : 0), 5); // Check to see if player is alive (if not, set 0) - also bound to fade out starting at 5 seconds.
-
+
if(autocvar_hud_powerup && sharpen_intensity > 0)
{
if(sharpen_intensity != old_sharpen_intensity) // reduce cvar_set spam as much as possible
{
if(time - hit_time < MAX_TIME_DIFF) // don't play the sound if it's too old.
sound(world, CH_INFO, "misc/hit.wav", VOL_BASE, ATTEN_NONE);
-
+
nextsound_hit_time = time + autocvar_cl_hitsound_antispam_time;
}
typehit_time = getstatf(STAT_TYPEHIT_TIME);
- if(typehit_time > nextsound_typehit_time)
+ if(typehit_time > nextsound_typehit_time)
{
if(time - typehit_time < MAX_TIME_DIFF) // don't play the sound if it's too old.
sound(world, CH_INFO, "misc/typehit.wav", VOL_BASE, ATTEN_NONE);
-
+
nextsound_typehit_time = time + autocvar_cl_hitsound_antispam_time;
}
CSQC_common_hud();
// crosshair goes VERY LAST
- if(!scoreboard_active && !camera_active && intermission != 2 && spectatee_status != -1 && hud == HUD_NORMAL)
+ if(!scoreboard_active && !camera_active && intermission != 2 && spectatee_status != -1 && hud == HUD_NORMAL)
{
- if not(autocvar_crosshair_enabled) // main toggle for crosshair rendering
+ if (!autocvar_crosshair_enabled) // main toggle for crosshair rendering
return;
-
+
string wcross_style;
float wcross_alpha, wcross_resolution;
wcross_style = autocvar_crosshair;
if(autocvar_crosshair_pickup)
{
float stat_pickup_time = getstatf(STAT_LAST_PICKUP);
-
+
if(pickup_crosshair_time < stat_pickup_time)
{
if(time - stat_pickup_time < MAX_TIME_DIFF) // don't trigger the animation if it's too old
pickup_crosshair_size = 1;
-
+
pickup_crosshair_time = stat_pickup_time;
}
if(autocvar_crosshair_hitindication)
{
vector hitindication_color = ((autocvar_crosshair_color_special == 1) ? stov(autocvar_crosshair_hitindication_per_weapon_color) : stov(autocvar_crosshair_hitindication_color));
-
+
if(hitindication_crosshair_time < hit_time)
{
if(time - hit_time < MAX_TIME_DIFF) // don't trigger the animation if it's too old
hitindication_crosshair_size = 1;
-
+
hitindication_crosshair_time = hit_time;
}
// handle the values
if (autocvar_crosshair_ring && activeweapon == WEP_NEX && nex_charge && autocvar_crosshair_ring_nex) // ring around crosshair representing velocity-dependent damage for the nex
{
- if (nex_chargepool || use_nex_chargepool) {
- use_nex_chargepool = 1;
+ if (nex_chargepool || use_nex_chargepool) {
+ use_nex_chargepool = 1;
ring_inner_value = nex_chargepool;
- } else {
+ } else {
nex_charge_movingavg = (1 - autocvar_crosshair_ring_nex_currentcharge_movingavg_rate) * nex_charge_movingavg + autocvar_crosshair_ring_nex_currentcharge_movingavg_rate * nex_charge;
- ring_inner_value = bound(0, autocvar_crosshair_ring_nex_currentcharge_scale * (nex_charge - nex_charge_movingavg), 1);
+ ring_inner_value = bound(0, autocvar_crosshair_ring_nex_currentcharge_scale * (nex_charge - nex_charge_movingavg), 1);
}
ring_inner_alpha = autocvar_crosshair_ring_nex_inner_alpha;
ring_rgb = wcross_color;
ring_image = "gfx/crosshair_ring_nexgun.tga";
}
- else if (autocvar_crosshair_ring && activeweapon == WEP_MINE_LAYER && minelayer_maxmines && autocvar_crosshair_ring_minelayer)
+ else if (autocvar_crosshair_ring && activeweapon == WEP_MINE_LAYER && minelayer_maxmines && autocvar_crosshair_ring_minelayer)
{
ring_value = bound(0, getstati(STAT_LAYED_MINES) / minelayer_maxmines, 1); // if you later need to use the count of bullets in another place, then add a float for it. For now, no need to.
ring_alpha = autocvar_crosshair_ring_minelayer_alpha;
ring_image = "gfx/crosshair_ring.tga";
}
- if(autocvar_crosshair_ring_reload && weapon_clipsize) // forces there to be only an ammo ring
+ if(autocvar_crosshair_ring_reload && weapon_clipsize) // forces there to be only an ammo ring
{
ring_value = bound(0, weapon_clipload / weapon_clipsize, 1);
ring_scale = autocvar_crosshair_ring_reload_size;
if(autocvar_crosshair_effect_time > 0)
{
f = (time - wcross_name_changestarttime) / autocvar_crosshair_effect_time;
- if not(f < 1)
+ if (!(f < 1))
{
wcross_ring_prev = ((ring_image) ? TRUE : FALSE);
}
-
+
if(wcross_ring_prev)
{
if(f < 1)
{
vector wcross_color_old;
wcross_color_old = wcross_color;
-
+
if((autocvar_crosshair_dot_color_custom) && (autocvar_crosshair_dot_color != "0"))
wcross_color = stov(autocvar_crosshair_dot_color);
-
+
CROSSHAIR_DRAW(wcross_resolution * autocvar_crosshair_dot_size, "gfx/crosshairdot.tga", f * autocvar_crosshair_dot_alpha);
// FIXME why don't we use wcross_alpha here?cl_notice_run();
wcross_color = wcross_color_old;
if(autocvar__hud_configure)
HUD_Panel_Mouse();
-
+
if(hud && !intermission)
- {
+ {
if(hud == HUD_SPIDERBOT)
CSQC_SPIDER_HUD();
else if(hud == HUD_WAKIZASHI)
else if(hud == HUD_BUMBLEBEE_GUN)
CSQC_BUMBLE_GUN_HUD();
}
-
+
cl_notice_run();
-
+
// let's reset the view back to normal for the end
setproperty(VF_MIN, '0 0 0');
setproperty(VF_SIZE, '1 0 0' * w + '0 1 0' * h);
float announcer_1min;
float announcer_5min;
-void Announcer_Countdown()
+void Announcer_Countdown()
{
float starttime = getstatf(STAT_GAMESTARTTIME);
float roundstarttime = getstatf(STAT_ROUNDSTARTTIME);
if(countdown <= 0) // countdown has finished, starttime is now
{
- Local_Notification(MSG_CENTER, CENTER_COUNTDOWN_BEGIN);
- Local_Notification(MSG_MULTI, MULTI_COUNTDOWN_BEGIN);
+ Local_Notification(MSG_CENTER, CENTER_COUNTDOWN_BEGIN);
+ Local_Notification(MSG_MULTI, MULTI_COUNTDOWN_BEGIN);
remove(self);
return;
}
* and STAT_FRAGLIMIT to be auto-sent)
*/
float previous_game_starttime;
-void Announcer_Gamestart()
+void Announcer_Gamestart()
{
float startTime = getstatf(STAT_GAMESTARTTIME);
float roundstarttime = getstatf(STAT_ROUNDSTARTTIME);
if(roundstarttime > startTime)
startTime = roundstarttime;
- if(previous_game_starttime != startTime)
+ if(previous_game_starttime != startTime)
{
if((time + 5.0) < startTime) // if connecting to server while restart was active don't always play prepareforbattle
Local_Notification(MSG_ANNCE, ANNCE_PREPARE);
- if(time < startTime)
+ if(time < startTime)
{
entity e = find(world, classname, "announcer_countdown");
- if not(e)
+ if (!e)
{
e = spawn();
e.classname = "announcer_countdown";
e.nextthink = startTime - floor(startTime - time); //synchronize nextthink to startTime
}
}
-
+
previous_game_starttime = startTime;
}
// Plays the 1 minute or 5 minutes (of maptime) remaining sound, if client wants it
-void Announcer_Time()
+void Announcer_Time()
{
float timelimit = getstatf(STAT_TIMELIMIT);
float timeleft = max(0, timelimit * 60 + getstatf(STAT_GAMESTARTTIME) - time);
float warmup_timeleft = 0;
-
- if(warmup_stage)
+
+ if(warmup_stage)
if(autocvar_g_warmup_limit > 0)
- warmup_timeleft = max(0, autocvar_g_warmup_limit + getstatf(STAT_GAMESTARTTIME) - time);
+ warmup_timeleft = max(0, autocvar_g_warmup_limit + getstatf(STAT_GAMESTARTTIME) - time);
// 5 minute check
- if(autocvar_cl_announcer_maptime >= 2)
+ if(autocvar_cl_announcer_maptime >= 2)
{
// make sure that after connect (and e.g. 4 minutes left) we will not get a wrong sound
if(announcer_5min)
{
- if(((!warmup_stage || autocvar_g_warmup_limit == 0) && timeleft > 300)
+ if(((!warmup_stage || autocvar_g_warmup_limit == 0) && timeleft > 300)
|| (warmup_stage && autocvar_g_warmup_limit > 0 && warmup_timeleft > 300))
announcer_5min = FALSE;
}
- else
+ else
{
- if(((!warmup_stage || autocvar_g_warmup_limit == 0) && timelimit > 0 && timeleft < 300 && timeleft > 299)
+ if(((!warmup_stage || autocvar_g_warmup_limit == 0) && timelimit > 0 && timeleft < 300 && timeleft > 299)
|| (warmup_stage && autocvar_g_warmup_limit > 0 && warmup_timeleft < 300 && warmup_timeleft > 299))
{
//if we're in warmup mode, check whether there's a warmup timelimit
- if not(autocvar_g_warmup_limit == -1 && warmup_stage)
+ if(!(autocvar_g_warmup_limit == -1 && warmup_stage))
{
announcer_5min = TRUE;
Local_Notification(MSG_ANNCE, ANNCE_REMAINING_MIN_5);
{
if (announcer_1min)
{
- if(((!warmup_stage || autocvar_g_warmup_limit == 0) && timeleft > 60)
+ if(((!warmup_stage || autocvar_g_warmup_limit == 0) && timeleft > 60)
|| (warmup_stage && autocvar_g_warmup_limit > 0 && warmup_timeleft > 60))
announcer_1min = FALSE;
}
- else if(((!warmup_stage || autocvar_g_warmup_limit == 0) && timelimit > 0 && timeleft < 60)
+ else if(((!warmup_stage || autocvar_g_warmup_limit == 0) && timelimit > 0 && timeleft < 60)
|| (warmup_stage && autocvar_g_warmup_limit > 0 && warmup_timeleft < 60))
{
// if we're in warmup mode, check whether there's a warmup timelimit
- if not(autocvar_g_warmup_limit == -1 && warmup_stage)
+ if(!(autocvar_g_warmup_limit == -1 && warmup_stage))
{
announcer_1min = TRUE;
Local_Notification(MSG_ANNCE, ANNCE_REMAINING_MIN_1);
float autocvar_hud_panel_weapons_timeout_effect;
float autocvar_hud_panel_weapons_timeout_fadebgmin;
float autocvar_hud_panel_weapons_timeout_fadefgmin;
-var float autocvar_hud_panel_weapons_timeout_speed_in = 0.25;
+var float autocvar_hud_panel_weapons_timeout_speed_in = 0.25;
var float autocvar_hud_panel_weapons_timeout_speed_out = 0.75;
float autocvar_hud_progressbar_alpha;
float autocvar_hud_showbinds;
// attack: from 0 to 1, in time a for a full length
// decay: from 1 to s, in time d
// sustain: s
-
+
if(t < 0)
return 0;
-
+
if(a)
if(t <= a)
return t / a;
if(!r)
return 0;
-
+
if(t > r)
return 0;
-
+
releaseval = s * (1 - t / r);
if(t < -d)
if(!s)
return 0;
-
+
// if amp > s, we may be in the attack or in the prolonged decay curve
releasetime = (1 - amp / s) * r;
if(e.bgmscript == "")
return 1;
-
+
if(autocvar_bgmvolume <= 0)
return -1;
blurtest_radius = stof(argv(2));
blurtest_power = stof(argv(3));
print("Enabled blurtest\n");
- return;
+ return;
}
-
+
default:
case CMD_REQUEST_USAGE:
{
float fh;
string filename = strcat(MapInfo_Map_bspname, "_scrshot_ent.txt");
fh = fopen(filename, FILE_WRITE);
-
+
if(fh >= 0)
{
fputs(fh, "{\n");
fputs(fh, strcat("\"origin\" \"", strcat(ftos(view_origin_x), " ", ftos(view_origin_y), " ", ftos(view_origin_z)), "\"\n"));
fputs(fh, strcat("\"angles\" \"", strcat(ftos(view_angles_x), " ", ftos(view_angles_y), " ", ftos(view_angles_z)), "\"\n"));
fputs(fh, "}\n");
-
+
print("Completed screenshot entity dump in ^2data/data/", MapInfo_Map_bspname, "_scrshot_ent.txt^7.\n");
-
+
fclose(fh);
}
else
}
return;
}
-
+
default:
case CMD_REQUEST_USAGE:
{
{
string modelname = argv(1);
entity debugmodel_entity;
-
+
debugmodel_entity = spawn();
precache_model(modelname);
setmodel(debugmodel_entity, modelname);
debugmodel_entity.angles = view_angles;
debugmodel_entity.draw = DrawDebugModel;
debugmodel_entity.classname = "debugmodel";
-
- return;
+
+ return;
}
-
+
default:
case CMD_REQUEST_USAGE:
{
{
float vote_selection;
string vote_string;
-
+
if(InterpretBoolean(argv(1)))
{
- vote_selection = 2;
+ vote_selection = 2;
vote_string = "yes";
}
else
{
- vote_selection = 1;
- vote_string = "no";
+ vote_selection = 1;
+ vote_string = "no";
}
-
+
if(vote_selection)
{
if(uid2name_dialog) // handled by "uid2name" option
uid2name_dialog = 0;
}
else { localcmd(strcat("cmd vote ", vote_string, "\n")); }
-
+
return;
}
}
-
+
default:
print("Incorrect parameters for ^2handlevote^7\n");
case CMD_REQUEST_USAGE:
cvar_set("_hud_configure", ftos(!autocvar__hud_configure));
return;
}
-
+
case "save":
{
if(argv(2))
break; // go to usage, we're missing the paramater needed here.
}
}
-
+
case "scoreboard_columns_set":
{
- Cmd_HUD_SetFields(argc);
+ Cmd_HUD_SetFields(argc);
return;
}
Cmd_HUD_Help();
return;
}
-
+
case "radar":
{
if(argv(2))
}
}
}
-
+
default:
print("Incorrect parameters for ^2hud^7\n");
case CMD_REQUEST_USAGE:
if(argv(1))
{
centerprint_hud(argv(1));
- return;
+ return;
}
}
-
+
default:
print("Incorrect parameters for ^2localprint^7\n");
case CMD_REQUEST_USAGE:
if(argv(1))
{
Cmd_MapVote_MapDownload(argc);
- return;
+ return;
}
}
-
+
default:
print("Incorrect parameters for ^2mv_download^7\n");
case CMD_REQUEST_USAGE:
// W_FixWeaponOrder will trash argv, so save what we need.
string thiscvar = strzone(argv(1));
string s = cvar_string(thiscvar);
-
+
if(thiscvar == "cl_weaponpriority")
s = W_FixWeaponOrder(W_NumberWeaponOrder(s), 1);
else if(substring(thiscvar, 0, 17) == "cl_weaponpriority" && strlen(thiscvar) == 18)
s = W_FixWeaponOrder(W_NumberWeaponOrder(s), 0);
-
+
localcmd("cmd sentcvar ", thiscvar, " \"", s, "\"\n");
strunzone(thiscvar);
- return;
+ return;
}
}
-
+
default:
print("Incorrect parameters for ^2sendcvar^7\n");
case CMD_REQUEST_USAGE:
{
case CMD_REQUEST_COMMAND:
{
-
- return;
+
+ return;
}
-
+
default:
case CMD_REQUEST_USAGE:
{
CLIENT_COMMAND("mv_download", LocalCommand_mv_download(request, arguments), "Retrieve mapshot picture from the server") \
CLIENT_COMMAND("sendcvar", LocalCommand_sendcvar(request, arguments), "Send a cvar to the server (like weaponpriority)") \
/* nothing */
-
+
void LocalCommand_macro_help()
{
#define CLIENT_COMMAND(name,function,description) \
{ if(strtolower(description) != "") { print(" ^2", name, "^7: ", description, "\n"); } }
-
+
CLIENT_COMMANDS(0, 0)
#undef CLIENT_COMMAND
-
+
return;
}
{
#define CLIENT_COMMAND(name,function,description) \
{ if(name == strtolower(argv(0))) { function; return TRUE; } }
-
+
CLIENT_COMMANDS(CMD_REQUEST_COMMAND, argc)
#undef CLIENT_COMMAND
-
+
return FALSE;
}
{
#define CLIENT_COMMAND(name,function,description) \
{ if(name == strtolower(argv(1))) { function; return TRUE; } }
-
+
CLIENT_COMMANDS(CMD_REQUEST_USAGE, argc)
#undef CLIENT_COMMAND
-
+
return FALSE;
}
{
#define CLIENT_COMMAND(name,function,description) \
{ if(strtolower(description) != "") { CMD_Write_Alias("qc_cmd_cl", name, description); } }
-
+
CLIENT_COMMANDS(0, 0)
#undef CLIENT_COMMAND
-
+
return;
}
// Guide for working with argc arguments by example:
// argc: 1 - 2 - 3 - 4
- // argv: 0 - 1 - 2 - 3
+ // argv: 0 - 1 - 2 - 3
// cmd vote - master - login - password
- if(strtolower(argv(0)) == "help")
+ if(strtolower(argv(0)) == "help")
{
- if(argc == 1)
+ if(argc == 1)
{
print("\nClient console commands:\n");
LocalCommand_macro_help();
print("\nGeneric commands shared by all programs:\n");
GenericCommand_macro_help();
-
+
print("\nUsage:^3 cl_cmd COMMAND...^7, where possible commands are listed above.\n");
print("For help about a specific command, type cl_cmd help COMMAND\n");
-
+
return;
- }
+ }
else if(GenericCommand_macro_usage(argc)) // Instead of trying to call a command, we're going to see detailed information about it
{
return;
{
return;
}
- }
- else if(GenericCommand(command))
+ }
+ else if(GenericCommand(command))
{
return; // handled by common/command/generic.qc
}
{
return; // handled by one of the above LocalCommand_* functions
}
-
+
// nothing above caught the command, must be invalid
print(((command != "") ? strcat("Unknown client command \"", command, "\"") : "No command provided"), ". For a list of supported commands, try cl_cmd help.\n");
-
+
return;
}
CONSOLE_COMMAND("+showaccuracy", { scoreboard_showaccuracy = TRUE; }) \
CONSOLE_COMMAND("-showaccuracy", { scoreboard_showaccuracy = FALSE; }) \
/* nothing */
-
+
#define CONSOLE_COMMANDS_MOVEMENT \
CONSOLE_COMMAND("+forward", { ++camera_direction_x; }) \
CONSOLE_COMMAND("-forward", { --camera_direction_x; }) \
CONSOLE_COMMANDS_NORMAL
#undef CONSOLE_COMMAND
-
+
// then init movement commands
#ifndef CAMERATEST
if(isdemo())
#ifndef CAMERATEST
}
#endif
-
+
return;
}
{
#define CONSOLE_COMMAND(name,execution) \
{ if(name == strtolower(argv(0))) { { execution } return TRUE; } }
-
+
CONSOLE_COMMANDS_NORMAL
#undef CONSOLE_COMMAND
-
+
return FALSE;
}
CONSOLE_COMMANDS_MOVEMENT
#undef CONSOLE_COMMAND
}
-
+
return FALSE;
}
{
return TRUE;
}
-
+
// Return value should be 1 if CSQC handled the command, otherwise return 0 to have the engine handle it.
return FALSE;
const float VF_CL_VIEWANGLES = 33; //(vector)
const float VF_CL_VIEWANGLES_X = 34; //(float)
const float VF_CL_VIEWANGLES_Y = 35; //(float)
-const float VF_CL_VIEWANGLES_Z = 36; //(float)
+const float VF_CL_VIEWANGLES_Z = 36; //(float)
// Server Autosent Stat Constants
const float STAT_HEALTH = 0;
float forceplayermodels_goodmodelindex;
.vector glowmod;
-.vector old_glowmod;
+.vector old_glowmod;
void CSQCPlayer_ModelAppearance_PreUpdate(void)
{
{
// FORCEMODEL
// which one is ALWAYS good?
- if not(forceplayermodels_goodmodel)
+ if (!forceplayermodels_goodmodel)
{
entity e;
e = spawn();
float isfriend;
float cm;
cm = self.forceplayermodels_savecolormap;
- cm = (cm >= 1024) ? cm : (stof(getplayerkeyvalue(self.colormap - 1, "colors")) + 1024);
+ cm = (cm >= 1024) ? cm : (stof(getplayerkeyvalue(cm - 1, "colors")) + 1024);
if(teamplay)
isfriend = (cm == 1024 + 17 * myteam);
// Fade out to black now...
if(self.old_glowmod == '0 0 0') { self.old_glowmod = self.glowmod; }
self.colormap = 0;
-
+
self.glowmod = self.old_glowmod * bound(0, 1 - (time - self.death_time) / autocvar_cl_deathglow, 1);
self.glowmod_x = max(self.glowmod_x, 0.0001);
self.glowmod_y = max(self.glowmod_y, 0.0001);
self.renderflags &= ~(RF_DEPTHHACK | RF_ADDITIVE | RF_FULLBRIGHT | EF_NOSHADOW | RF_USEAXIS);
self.effects = 0;
self.traileffect = 0;
-
+
if(eff & EF_BRIGHTFIELD)
self.traileffect = particleeffectnum("TR_NEXUIZPLASMA");
// ignoring EF_MUZZLEFLASH
e = get_weaponinfo(type);
effectname = strcat("damage_", e.netname);
-
+
// if damage was dealt with a bullet weapon, our effect is blood
// since blood is species dependent, include the species tag
if(type == WEP_SHOTGUN || type == WEP_UZI || type == WEP_RIFLE)
force = decompressShortVector(ReadShort());
species = ReadByte();
- if not(isNew)
+ if (!isNew)
return;
if(rad < 0)
}
else
forcemul = 1;
-
+
for(self = findradius(w_org, rad + MAX_DAMAGEEXTRARADIUS); self; self = self.chain)
{
// attached ents suck
}
self = oldself;
-
+
if(DEATH_ISVEHICLE(w_deathtype))
{
traceline(w_org - normalize(force) * 16, w_org + normalize(force) * 16, MOVE_NOMONSTERS, world);
w_backoff = trace_plane_normal;
else
w_backoff = -1 * normalize(w_org - (w_org + normalize(force) * 16));
-
+
setorigin(self, w_org + w_backoff * 2); // for sound() calls
-
+
switch(w_deathtype)
{
case DEATH_VH_CRUSH:
break;
-
+
// spiderbot
case DEATH_VH_SPID_MINIGUN:
string _snd;
sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_MIN);
pointparticles(particleeffectnum("explosion_big"), self.origin, w_backoff * 1000, 1);
break;
-
+
case DEATH_VH_WAKI_GUN:
sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTEN_NORM);
pointparticles(particleeffectnum("wakizashi_gun_impact"), self.origin, w_backoff * 1000, 1);
sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_MIN);
pointparticles(particleeffectnum("explosion_big"), self.origin, w_backoff * 1000, 1);
break;
-
+
case DEATH_VH_RAPT_CANNON:
sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTEN_NORM);
pointparticles(particleeffectnum("raptor_cannon_impact"), self.origin, w_backoff * 1000, 1);
break;
}
}
-
-
+
+
if(DEATH_ISTURRET(w_deathtype))
{
string _snd;
w_backoff = trace_plane_normal;
else
w_backoff = -1 * normalize(w_org - (w_org + normalize(force) * 16));
-
+
setorigin(self, w_org + w_backoff * 2); // for sound() calls
-
+
switch(w_deathtype)
- {
+ {
case DEATH_TURRET_EWHEEL:
sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTEN_MIN);
pointparticles(particleeffectnum("laser_impact"), self.origin, w_backoff * 1000, 1);
break;
-
+
case DEATH_TURRET_FLAC:
pointparticles(particleeffectnum("hagar_explode"), w_org, '0 0 0', 1);
_snd = strcat("weapons/hagexp", ftos(1 + rint(random() * 2)), ".waw");
sound(self, CH_SHOTS, _snd, VOL_BASE, ATTEN_NORM);
break;
-
+
case DEATH_TURRET_MLRS:
case DEATH_TURRET_HK:
case DEATH_TURRET_WALK_ROCKET:
sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_MIN);
pointparticles(particleeffectnum("rocket_explode"), self.origin, w_backoff * 1000, 1);
break;
-
+
case DEATH_TURRET_MACHINEGUN:
case DEATH_TURRET_WALK_GUN:
_snd = strcat("weapons/ric", ftos(1 + rint(random() * 2)), ".waw");
sound(self, CH_SHOTS, _snd, VOL_BASE, ATTEN_NORM);
pointparticles(particleeffectnum("machinegun_impact"), self.origin, w_backoff * 1000, 1);
break;
-
+
case DEATH_TURRET_PLASMA:
sound(self, CH_SHOTS, "weapons/electro_impact.wav", VOL_BASE, ATTEN_MIN);
pointparticles(particleeffectnum("electro_impact"), self.origin, w_backoff * 1000, 1);
break;
-
+
case DEATH_TURRET_WALK_MEELE:
sound(self, CH_SHOTS, "weapons/ric1.wav", VOL_BASE, ATTEN_MIN);
pointparticles(particleeffectnum("TE_SPARK"), self.origin, w_backoff * 1000, 1);
case DEATH_TURRET_PHASER:
break;
-
+
case DEATH_TURRET_TESLA:
te_smallflash(self.origin);
break;
}
}
-
+
// TODO spawn particle effects and sounds based on w_deathtype
if(!DEATH_ISSPECIAL(w_deathtype))
- if not(hitplayer && !rad) // don't show ground impacts for hitscan weapons if a player was hit
+ if(!hitplayer || rad) // don't show ground impacts for hitscan weapons if a player was hit
{
float hitwep;
{
if(cl_gentle_gibs == 2)
gentle_prefix = "";
- else if(cl_gentle_gibs == 3)
+ else if(cl_gentle_gibs == 3)
gentle_prefix = "happy_";
}
else if(autocvar_cl_particlegibs)
gentle_prefix = "particlegibs_";
}
- if not(cl_gentle_gibs || autocvar_cl_gentle)
+ if (!(cl_gentle_gibs || autocvar_cl_gentle))
amount *= 1 - autocvar_cl_nogibs;
if(autocvar_ekg)
{
// I want to draw a quad...
// from and to are MIDPOINTS.
-
+
vector axis, thickdir, A, B, C, D;
float length_tex;
float GetPlayerColor(float i)
{
- if not(playerslots[i].gotscores) // unconnected
+ if(!playerslots[i].gotscores) // unconnected
return NUM_SPECTATOR;
else if(stof(getplayerkeyvalue(i, "frags")) == FRAGS_SPECTATOR)
return NUM_SPECTATOR;
// skip this weapon if we don't own it (and onlyowned is enabled)-- or if weapons_complainbubble is showing for this weapon
if(autocvar_hud_panel_weapons_onlyowned)
- if not((weapons_stat & WepSet_FromWeapon(self.weapon)) || (self.weapon == complain_weapon))
+ if (!((weapons_stat & WepSet_FromWeapon(self.weapon)) || (self.weapon == complain_weapon)))
continue;
// figure out the drawing position of weapon
- weapon_pos = (panel_pos
- + eX * column * weapon_size_x
+ weapon_pos = (panel_pos
+ + eX * column * weapon_size_x
+ eY * row * weapon_size_y);
// draw background behind currently selected weapon
{
if(!autocvar_hud_panel_powerups) return;
if(spectatee_status == -1) return;
- if not(getstati(STAT_ITEMS, 0, 24) & (IT_STRENGTH | IT_INVINCIBLE | IT_SUPERWEAPON)) return;
+ if(!(getstati(STAT_ITEMS, 0, 24) & (IT_STRENGTH | IT_INVINCIBLE | IT_SUPERWEAPON))) return;
if (getstati(STAT_HEALTH) <= 0) return;
strength_time = bound(0, getstatf(STAT_STRENGTH_FINISHED) - time, 99);
{
float BLINK_FACTOR = 0.15;
float BLINK_BASE = 0.85;
- float BLINK_FREQ = 9;
+ float BLINK_FREQ = 9;
pain_health_alpha = BLINK_BASE + BLINK_FACTOR * cos(time * BLINK_FREQ);
}
}
float entries, height;
entries = bound(1, floor(KN_MAX_ENTRIES * mySize_y/mySize_x), KN_MAX_ENTRIES);
height = mySize_y/entries;
-
+
vector fontsize;
float fontheight = height * autocvar_hud_panel_notify_fontsize;
fontsize = '0.5 0.5 0' * fontheight;
{
break;
}
-
+
attacker = notify_attackers[j];
victim = notify_victims[j];
icon = notify_icon[j];
panel_size_y = bound(0.2, panel_size_y, 1) * vid_conheight;
panel_pos_x = (vid_conwidth - panel_size_x) / 2;
panel_pos_y = (vid_conheight - panel_size_y) / 2;
-
+
panel_bg = strcat(hud_skin_path, "/border_default"); // always use the default border when maximized
if(precache_pic(panel_bg) == "") { panel_bg = "gfx/hud/default/border_default"; } // fallback
-
+
switch(hud_panel_radar_maximized_zoommode)
{
default:
f = 1;
break;
}
-
+
switch(hud_panel_radar_maximized_rotation)
{
case 0:
f = 1;
break;
}
-
+
switch(hud_panel_radar_rotation)
{
case 0:
score = tm.(teamscores[ts_primary]);
if(autocvar__hud_configure)
score = 123;
-
+
if (score > max_fragcount)
max_fragcount = score;
stat_items = getstati(STAT_ITEMS, 0, 24);
redflag = (stat_items/IT_RED_FLAG_TAKEN) & 3;
blueflag = (stat_items/IT_BLUE_FLAG_TAKEN) & 3;
-
+
if(redflag || blueflag)
mod_active = 1;
else
float kaball_prevstatus; // last remembered status
float kaball_statuschange_time; // time when the status changed
-// we don't need to reset for keepaway since it immediately
+// we don't need to reset for keepaway since it immediately
// autocorrects prevstatus as to if the player has the ball or not
void HUD_Mod_Keepaway(vector pos, vector mySize)
{
mod_active = 1; // keepaway should always show the mod HUD
-
+
float BLINK_FACTOR = 0.15;
float BLINK_BASE = 0.85;
- float BLINK_FREQ = 5;
+ float BLINK_FREQ = 5;
float kaball_alpha = BLINK_BASE + BLINK_FACTOR * cos(time * BLINK_FREQ);
-
+
float stat_items = getstati(STAT_ITEMS, 0, 24);
float kaball = (stat_items/IT_KEY1) & 1;
-
+
if(kaball != kaball_prevstatus)
{
kaball_statuschange_time = time;
kaball_prevstatus = kaball;
}
-
+
vector kaball_pos, kaball_size;
-
+
if(mySize_x > mySize_y) {
kaball_pos = pos + eX * 0.25 * mySize_x;
kaball_size = eX * 0.5 * mySize_x + eY * mySize_y;
kaball_pos = pos + eY * 0.25 * mySize_y;
kaball_size = eY * 0.5 * mySize_y + eX * mySize_x;
}
-
+
float kaball_statuschange_elapsedtime = time - kaball_statuschange_time;
float f = bound(0, kaball_statuschange_elapsedtime*2, 1);
-
+
if(kaball_prevstatus && f < 1)
drawpic_aspect_skin_expanding(kaball_pos, "keepawayball_carrying", kaball_size, '1 1 1', panel_fg_alpha * kaball_alpha, DRAWFLAG_NORMAL, f);
-
+
if(kaball)
drawpic_aspect_skin(pos, "keepawayball_carrying", eX * mySize_x + eY * mySize_y, '1 1 1', panel_fg_alpha * kaball_alpha * f, DRAWFLAG_NORMAL);
}
float f; // yet another function has this
score = me.(scores[ps_primary]);
- if not((scores_flags[ps_primary] & SFL_TIME) && !teamplay) // race/cts record display on HUD
+ if(!(scores_flags[ps_primary] & SFL_TIME) || teamplay) // race/cts record display on HUD
return; // no records in the actual race
// clientside personal record
frametimeavg = (frametimeavg + frametimeavg1 + frametimeavg2 + currentframetime)/4; // average three frametimes into framecounter for slightly more stable fps readings :P
frametimeavg2 = frametimeavg1;
frametimeavg1 = frametimeavg;
-
+
float weight;
weight = cvar("hud_panel_engineinfo_framecounter_exponentialmovingaverage_new_weight");
if(currentframetime > 0.0001) // filter out insane values which sometimes seem to occur and throw off the average? If you are getting 10,000 fps or more, then you don't need a framerate counter.
vector fontsize;
fontsize = '0.20 0.20 0' * mySize_y;
-
+
float a;
a = panel_fg_alpha;
}
}
}
- else
+ else
{
s = _("^7Press ^3ESC ^7to show HUD options.");
drawInfoMessage(s)
conversion_factor = 0.0254 * 1.943844492; // 1 m/s = 1.943844492 knots, because 1 knot = 1.852 km/h
break;
}
-
+
vector vel = (csqcplayer ? csqcplayer.velocity : pmove_vel);
float max_speed = floor( autocvar_hud_panel_physics_speed_max * conversion_factor + 0.5 );
acceleration = (vlen(vel) - vlen(acc_prevspeed));
else
acceleration = (vlen(vel - '0 0 1' * vel_z) - vlen(acc_prevspeed - '0 0 1' * acc_prevspeed_z));
-
+
acceleration = acceleration * (1 / max(0.0001, f)) * (0.0254 / 9.80665);
-
+
acc_prevspeed = vel;
acc_prevtime = time;
if (scoreboard_bottom >= 0.96 * vid_conheight)
return;
vector target_pos;
-
+
target_pos = eY * scoreboard_bottom + eX * 0.5 * (vid_conwidth - panel_size_x);
-
+
if(target_pos_y > panel_pos_y)
{
panel_pos = panel_pos + (target_pos - panel_pos) * sqrt(scoreboard_fade_alpha);
}
- // fade the centerprint_hud in/out
+ // fade the centerprint_hud in/out
if(centerprint_time[j] < 0)
a = bound(0, (time - centerprint_expire_time[j]) / max(0.0001, autocvar_hud_panel_centerprint_fade_in), 1);
else if(centerprint_expire_time[j] - autocvar_hud_panel_centerprint_fade_out > time)
a = (centerprint_expire_time[j] - time) / max(0.0001, autocvar_hud_panel_centerprint_fade_out);
else
a = 0;
-
+
// set the size from fading in/out before subsequent fading
- sz = autocvar_hud_panel_centerprint_fade_minfontsize + a * (1 - autocvar_hud_panel_centerprint_fade_minfontsize);
-
+ sz = autocvar_hud_panel_centerprint_fade_minfontsize + a * (1 - autocvar_hud_panel_centerprint_fade_minfontsize);
+
// also fade it based on positioning
if(autocvar_hud_panel_centerprint_fade_subsequent)
{
a = a * bound(autocvar_hud_panel_centerprint_fade_subsequent_passone_minalpha, (1 - (g / max(1, autocvar_hud_panel_centerprint_fade_subsequent_passone))), 1); // pass one: all messages after the first have half theAlpha
a = a * bound(autocvar_hud_panel_centerprint_fade_subsequent_passtwo_minalpha, (1 - (g / max(1, autocvar_hud_panel_centerprint_fade_subsequent_passtwo))), 1); // pass two: after that, gradually lower theAlpha even more for each message
}
-
+
// finally set the size based on the new theAlpha from subsequent fading
- sz = sz * (autocvar_hud_panel_centerprint_fade_subsequent_minfontsize + a * (1 - autocvar_hud_panel_centerprint_fade_subsequent_minfontsize));
+ sz = sz * (autocvar_hud_panel_centerprint_fade_subsequent_minfontsize + a * (1 - autocvar_hud_panel_centerprint_fade_subsequent_minfontsize));
drawfontscale = sz * '1 1 0';
-
+
if (centerprint_countdown_num[j])
n = tokenizebyseparator(strreplace("^COUNT", count_seconds(centerprint_countdown_num[j]), centerprint_messages[j]), "\n");
else
}
}
- ++g; // move next position number up
-
+ ++g; // move next position number up
+
msg_size = pos_y - msg_size;
if (autocvar_hud_panel_centerprint_flip)
{
pos_y = current_msg_pos_y - CENTERPRINT_SPACING * fontsize_y;
if (a < 1 && centerprint_msgID[j] == 0) // messages with id can be replaced just after they are faded out, so never move over them the next messages
pos_y += (msg_size + CENTERPRINT_SPACING * fontsize_y) * (1 - sqrt(sz));
-
+
if (pos_y < panel_pos_y) // check if the next message can be shown
{
drawfontscale = '1 1 0';
pos_y += CENTERPRINT_SPACING * fontsize_y;
if (a < 1 && centerprint_msgID[j] == 0) // messages with id can be replaced just after they are faded out, so never move over them the next messages
pos_y -= (msg_size + CENTERPRINT_SPACING * fontsize_y) * (1 - sqrt(sz));
-
+
if(pos_y > panel_pos_y + panel_size_y - fontsize_y) // check if the next message can be shown
{
drawfontscale = '1 1 0';
HUD_Write_PanelCvar_q("_maximized_scale");
HUD_Write_PanelCvar_q("_maximized_size");
HUD_Write_PanelCvar_q("_maximized_rotation");
- HUD_Write_PanelCvar_q("_maximized_zoommode");
+ HUD_Write_PanelCvar_q("_maximized_zoommode");
break;
case HUD_PANEL_SCORE:
HUD_Write_PanelCvar_q("_rankings");
}
// now save the new top id
panel_order[0] = id;
-
+
// let's save them into the cvar by some strcat trickery
string s = "";
for(i = 0; i < HUD_PANEL_NUM; ++i)
if(autocvar__menu_alpha == 1)
return;
- if not(autocvar_hud_cursormode)
+ if (!autocvar_hud_cursormode)
{
mousepos = mousepos + getmousepos() * autocvar_menu_mouse_speed;
-
+
mousepos_x = bound(0, mousepos_x, vid_conwidth);
mousepos_y = bound(0, mousepos_y, vid_conheight);
}
Draw_CylindricLine(self.origin, trace_endpos, self.scale, "particles/laserbeam", 0, time * 3, self.colormod, 0.5, DRAWFLAG_ADDITIVE, view_origin);
}
}
- if not(trace_dphitq3surfaceflags & (Q3SURFACEFLAG_SKY | Q3SURFACEFLAG_NOIMPACT))
+ if (!(trace_dphitq3surfaceflags & (Q3SURFACEFLAG_SKY | Q3SURFACEFLAG_NOIMPACT)))
{
if(self.cnt >= 0)
pointparticles(self.cnt, trace_endpos, trace_plane_normal, drawframetime * 1000);
vector rgb;
string label;
float text_size;
-
+
isize -= hud_fontsize_y; // respect the text when calculating the image size
rgb = MapVote_RGB(id, count);
-
+
img_size_y = isize;
img_size_x = isize / 0.75; // 4:3 x can be stretched easily, height is defined in isize
pos_y = pos_y + img_size_y;
-
+
label = MapVote_FormatMapItem(id, map, count, tsize, hud_fontsize);
text_size = stringwidth(label, false, hud_fontsize);
pos_x -= text_size*0.5;
drawstring(pos, label, hud_fontsize, rgb, theAlpha, DRAWFLAG_NORMAL);
-
+
pos_x = pos_x + text_size*0.5 - img_size_x*0.5;
pos_y = pos_y - img_size_y;
vector rgb;
float text_size;
string label;
-
+
rgb = MapVote_RGB(id, count);
pos_y = pos_y + hud_fontsize_y;
-
+
label = MapVote_FormatMapItem(id, _("Don't care"), count, tsize, hud_fontsize);
text_size = stringwidth(label, false, hud_fontsize);
-
+
pos_x -= text_size*0.5;
drawstring(pos, label, hud_fontsize, rgb, 1, DRAWFLAG_NORMAL);
}
if(!mv_active)
return;
- if not(autocvar_hud_cursormode)
+ if (!autocvar_hud_cursormode)
{
mv_mousepos = mv_mousepos + getmousepos();
-
+
mv_mousepos_x = bound(0, mv_mousepos_x, vid_conwidth);
mv_mousepos_y = bound(0, mv_mousepos_y, vid_conheight);
}
print(_("mv_mapdownload: ^3You're not supposed to use this command on your own!\n"));
return;
}
-
+
id = stof(argv(1));
for(pak = mv_pk3list; pak; pak = pak.chain)
if(pak.sv_entnum == id)
break;
-
+
if(!pak || pak.sv_entnum != id) {
print(_("^1Error:^7 Couldn't find pak index.\n"));
return;
pak.netname = pk3;
pak.message = pic;
pak.sv_entnum = id;
-
+
pak.chain = mv_pk3list;
mv_pk3list = pak;
-
+
if(pk3 != "")
{
localcmd(strcat("\ncurl --pak ", pk3, "; wait; cl_cmd mv_download ", ftos(id), "\n"));
mv_maps_mask = ReadByte();
else
mv_maps_mask = ReadShort();
-
+
// Assume mv_pk3list is world, there should only be 1 mapvote per round
mv_pk3list = world; // I'm still paranoid!
-
+
for(i = 0, power = 1; i < mv_num_maps; ++i, power *= 2)
{
mv_votes[i] = 0;
map = strzone(ReadString());
pk3 = strzone(ReadString());
j = bound(0, ReadByte(), n_ssdirs - 1);
-
+
mv_maps[i] = map;
mv_pk3[i] = pk3;
map = strzone(strcat(ssdirs[j], "/", map));
// remove votes that no longer apply
for(i = 0, power = 1; i < mv_num_maps; ++i, power *= 2)
- if not(mv_maps_mask & power)
+ if (!(mv_maps_mask & power))
mv_votes[i] = -1;
mv_top2_time = time;
num = (Team == NUM_SPECTATOR) ? 16 : Team;
if(teamslots[num])
return teamslots[num];
- if not(add)
+ if (!add)
return world;
tm = spawn();
tm.team = Team;
vector tri;
string tex;
tex = getsurfacetexture(e, i_s);
- if not(tex)
+ if (!tex)
return 0; // this is beyond the last one
n_t = getsurfacenumtriangles(e, i_s);
for(i_t = 0; i_t < n_t; ++i_t)
float getplayerisdead(float pl)
{
entity e;
-
+
e = CSQCModel_server2csqc(pl + 1);
if(e)
return e.csqcmodel_isdead;
-
+
return FALSE;
}
vector org;
float cont;
org = self.move_origin + ofs;
-
+
cont = self.dphitcontentsmask;
self.dphitcontentsmask = DPCONTENTS_SOLID;
tracebox(self.move_origin, self.mins, self.maxs, self.move_origin, MOVE_NOMONSTERS, self);
_Movetype_PushEntity(move, TRUE);
if(wasfreed(self))
return;
-
+
if(trace_startsolid)
{
_Movetype_UnstickEntity();
shotorg_x = ReadCoord(); shotorg_y = ReadCoord(); shotorg_z = ReadCoord();
endpos_x = ReadCoord(); endpos_y = ReadCoord(); endpos_z = ReadCoord();
charge = ReadByte() / 255.0;
-
+
pointparticles(particleeffectnum("nex_muzzleflash"), shotorg, normalize(endpos - shotorg) * 1000, 1);
-
+
//draw either the old v2.3 beam or the new beam
charge = sqrt(charge); // divide evenly among trail spacing and alpha
particles_alphamin = particles_alphamax = particles_fade = charge;
player_skeleton.qc
../common/animdecide.qc
-
-../common/if-this-file-errors-scroll-up-and-fix-the-warnings.fteqccfail
case PROJECTILE_NADE_PINK:
case PROJECTILE_NADE_BURN:
case PROJECTILE_NADE:
- rot = self.avelocity;
+ rot = self.avelocity;
break;
case PROJECTILE_HOOKBOMB:
rot = '1000 0 0'; // forward
switch(self.cnt)
{
- case PROJECTILE_BULLET_GLOWING:
- case PROJECTILE_BULLET_GLOWING_TRACER:
- adddynamiclight(self.origin, 50 * a, '1 1 0');
- break;
+ // Possibly add dlights here.
default:
break;
}
{
case PROJECTILE_ELECTRO: setmodel(self, "models/ebomb.mdl");self.traileffect = particleeffectnum("TR_NEXUIZPLASMA"); break;
case PROJECTILE_ROCKET: setmodel(self, "models/rocket.md3");self.traileffect = particleeffectnum("TR_ROCKET"); self.scale = 2; break;
- case PROJECTILE_BULLET: setmodel(self, "models/tracer.mdl");self.traileffect = particleeffectnum("tr_bullet"); break;
- case PROJECTILE_BULLET_GLOWING: setmodel(self, "models/tracer.mdl");self.traileffect = particleeffectnum("tr_rifle_weak"); break;
- case PROJECTILE_BULLET_GLOWING_TRACER: setmodel(self, "models/tracer.mdl");self.traileffect = particleeffectnum("tr_rifle"); break;
case PROJECTILE_CRYLINK: setmodel(self, "models/plasmatrail.mdl");self.traileffect = particleeffectnum("TR_CRYLINKPLASMA"); break;
case PROJECTILE_CRYLINK_BOUNCING: setmodel(self, "models/plasmatrail.mdl");self.traileffect = particleeffectnum("TR_CRYLINKPLASMA"); break;
case PROJECTILE_ELECTRO_BEAM: setmodel(self, "models/elaser.mdl");self.traileffect = particleeffectnum("TR_NEXUIZPLASMA"); break;
case PROJECTILE_BUMBLE_GUN: setmodel(self, "models/elaser.mdl");self.traileffect = particleeffectnum("TR_NEXUIZPLASMA"); break;
case PROJECTILE_BUMBLE_BEAM: setmodel(self, "models/elaser.mdl");self.traileffect = particleeffectnum("TR_NEXUIZPLASMA"); break;
-
+
case PROJECTILE_NADE_RED: setmodel(self, "models/weapons/v_ok_grenade.md3");self.traileffect = particleeffectnum("nade_red"); break;
case PROJECTILE_NADE_RED_BURN: setmodel(self, "models/weapons/v_ok_grenade.md3");self.traileffect = particleeffectnum("nade_red_burn"); break;
case PROJECTILE_NADE_BLUE: setmodel(self, "models/weapons/v_ok_grenade.md3");self.traileffect = particleeffectnum("nade_blue"); break;
break;
case PROJECTILE_WAKIROCKET:
loopsound(self, CH_SHOTS_SINGLE, "weapons/tag_rocket_fly.wav", VOL_BASE, ATTEN_NORM);
- break;
+ break;
/*
case PROJECTILE_WAKICANNON:
break;
precache_model("models/rocket.md3");
precache_model("models/tagrocket.md3");
precache_model("models/tracer.mdl");
-
+
precache_model("models/weapons/v_ok_grenade.md3");
precache_sound("weapons/electro_fly.wav");
pattern = substring(str, 0, slash);
str = substring(str, slash + 1, strlen(str) - (slash + 1));
- if not(isGametypeInFilter(gametype, teamplay, FALSE, pattern))
+ if (!isGametypeInFilter(gametype, teamplay, FALSE, pattern))
continue;
}
}
else
{
- if not(nocomplain)
+ if (!nocomplain)
print(sprintf("^1Error:^7 Unknown score field: '%s'\n", str));
continue;
}
switch(field)
{
case SP_PING:
- if not(pl.gotscores)
+ if (!pl.gotscores)
return "\xEE\x82\x8D\xEE\x82\x8D\xEE\x82\x8D"; // >>> sign
//str = getplayerkeyvalue(pl.sv_entnum, "ping");
f = pl.ping;
return ftos(f);
case SP_PL:
- if not(pl.gotscores)
+ if (!pl.gotscores)
return _("N/A");
f = pl.ping_packetloss;
tmp = pl.ping_movementloss;
} else
str = sprintf("%.1f", num/denom);
return str;
-
+
case SP_SUM:
f = pl.(scores[SP_KILLS]);
f -= pl.(scores[SP_DEATHS]);
for(i = WEP_FIRST; i <= WEP_LAST; ++i)
{
self = get_weaponinfo(i);
- if not(self.weapon)
+ if (!self.weapon)
continue;
if ((i == WEP_NEX && g_minstagib) || i == WEP_PORTO || (i == WEP_MINSTANEX && !g_minstagib) || i == WEP_TUBA) // skip port-o-launch, nex || minstanex and tuba
continue;
drawstring(pos, value, hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
pos_x = px;
pos_y+= hud_fontsize_y;
-
+
return pos;
}
rows = (stat_secrets_total ? 1 : 0);
// if no rows, return
- if not(rows)
+ if (!rows)
return pos;
// draw table header
drawstring(pos, _("Map stats:"), hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
pos_y += 1.25 * hud_fontsize_y + autocvar_scoreboard_border_thickness;
-
- // draw table
+
+ // draw table
vector tmp = '0 0 0';
tmp_x = sbwidth;
tmp_y = hud_fontsize_y * rows;
// draw secrets
val = sprintf("%d/%d", stat_secrets_found, stat_secrets_total);
pos = HUD_DrawKeyValue(pos, _("Secrets found:"), val);
-
+
// update position
pos_y += 1.25 * hud_fontsize_y;
return pos;
scoreboard_fade_alpha = 0;
}
- if not(scoreboard_fade_alpha)
+ if (!scoreboard_fade_alpha)
return;
HUD_UpdatePlayerTeams();
pos = HUD_DrawScoreboardAccuracyStats(pos, rgb, bg_size);
}
-
+
if(teamplay)
pos = HUD_DrawMapStats(pos, Team_ColorRGB(myteam), bg_size);
else
str = strcat(str, _(" or"));
if(teamplay)
{
- str = strcat(str, sprintf(_(" until ^3%s %s^7"), ScoreString(teamscores_flags[ts_primary], fl),
+ str = strcat(str, sprintf(_(" until ^3%s %s^7"), ScoreString(teamscores_flags[ts_primary], fl),
(teamscores_label[ts_primary] == "score") ? CTX(_("SCO^points")) :
(teamscores_label[ts_primary] == "fastest") ? CTX(_("SCO^is beaten")) :
TranslateScoresLabel(teamscores_label[ts_primary])));
}
else
{
- str = strcat(str, sprintf(_(" until ^3%s %s^7"), ScoreString(scores_flags[ps_primary], fl),
+ str = strcat(str, sprintf(_(" until ^3%s %s^7"), ScoreString(scores_flags[ps_primary], fl),
(scores_label[ps_primary] == "score") ? CTX(_("SCO^points")) :
(scores_label[ps_primary] == "fastest") ? CTX(_("SCO^is beaten")) :
TranslateScoresLabel(scores_label[ps_primary])));
str = strcat(str, _(" or"));
if(teamplay)
{
- str = strcat(str, sprintf(_(" until a lead of ^3%s %s^7"), ScoreString(teamscores_flags[ts_primary], ll),
+ str = strcat(str, sprintf(_(" until a lead of ^3%s %s^7"), ScoreString(teamscores_flags[ts_primary], ll),
(teamscores_label[ts_primary] == "score") ? CTX(_("SCO^points")) :
(teamscores_label[ts_primary] == "fastest") ? CTX(_("SCO^is beaten")) :
TranslateScoresLabel(teamscores_label[ts_primary])));
}
else
{
- str = strcat(str, sprintf(_(" until a lead of ^3%s %s^7"), ScoreString(scores_flags[ps_primary], ll),
+ str = strcat(str, sprintf(_(" until a lead of ^3%s %s^7"), ScoreString(scores_flags[ps_primary], ll),
(scores_label[ps_primary] == "score") ? CTX(_("SCO^points")) :
(scores_label[ps_primary] == "fastest") ? CTX(_("SCO^is beaten")) :
TranslateScoresLabel(scores_label[ps_primary])));
// a negative number means we are awaiting respawn, time value is still the same
respawn_time *= -1; // remove mark now that we checked it
respawn_time = max(time, respawn_time); // don't show a negative value while the server is respawning the player (lag)
-
+
str = sprintf(_("^1Respawning in ^3%s^1..."),
(autocvar_scoreboard_respawntime_decimals ?
count_seconds_decs(respawn_time - time, autocvar_scoreboard_respawntime_decimals)
{
if(!autocvar_hud_shownames)
return;
-
+
#ifdef COMPAT_XON050_ENGINE
if((ent.sv_entnum == player_localentnum) || (ent.sv_entnum == spectatee_status)) // ent is me or person i'm spectating
#else
if(ent.sv_entnum == player_localentnum) // ent is me or person i'm spectating
#endif
- if not (autocvar_hud_shownames_self && autocvar_chase_active)
+ if(!(autocvar_hud_shownames_self && autocvar_chase_active))
return;
makevectors(view_angles);
if(ent.sameteam || (!ent.sameteam && autocvar_hud_shownames_enemies))
{
ent.origin_z += autocvar_hud_shownames_offset;
-
+
float hit;
if(ent.sameteam && !autocvar_hud_shownames_crosshairdistance)
{
// handle tag fading
float overlap = FALSE, onscreen, crosshairdistance;
vector o, eo;
-
+
o = project_3d_to_2d(ent.origin);
-
+
if(autocvar_hud_shownames_antioverlap)
{
// fade tag out if another tag that is closer to you overlaps
if(e == ent)
continue;
eo = project_3d_to_2d(e.origin);
- if not(eo_z < 0 || eo_x < 0 || eo_y < 0 || eo_x > vid_conwidth || eo_y > vid_conheight)
+ if (!(eo_z < 0 || eo_x < 0 || eo_y < 0 || eo_x > vid_conwidth || eo_y > vid_conheight))
{
eo_z = 0;
if(vlen((eX * o_x + eY * o_y) - eo) < autocvar_hud_shownames_antioverlap_distance && vlen(ent.origin - view_origin) > vlen(e.origin - view_origin))
onscreen = (o_z >= 0 && o_x >= 0 && o_y >= 0 && o_x <= vid_conwidth && o_y <= vid_conheight);
crosshairdistance = sqrt( pow(o_x - vid_conwidth/2, 2) + pow(o_y - vid_conheight/2, 2) );
-
+
if(autocvar_hud_shownames_crosshairdistance)
{
if(autocvar_hud_shownames_crosshairdistance > crosshairdistance)
ent.pointtime = time;
-
- if not(ent.pointtime + autocvar_hud_shownames_crosshairdistance_time > time)
+
+ if (!(ent.pointtime + autocvar_hud_shownames_crosshairdistance_time > time))
overlap = TRUE;
else
overlap = (autocvar_hud_shownames_crosshairdistance_antioverlap ? overlap : FALSE); // override what antioverlap says unless allowed by cvar.
}
-
+
if(!ent.fadedelay)
ent.fadedelay = time + SHOWNAMES_FADEDELAY;
if(!ent.sameteam && (!onscreen || !hit)) // out of view, fade out
- {
- ent.alpha = max(0, ent.alpha - SHOWNAMES_FADESPEED * frametime);
+ {
+ ent.alpha = max(0, ent.alpha - SHOWNAMES_FADESPEED * frametime);
ent.fadedelay = 0; // reset fade in delay, enemy has left the view
}
else if(ent.csqcmodel_isdead) // dead player, fade out slowly
- ent.alpha = max(0, ent.alpha - SHOWNAMES_FADESPEED * 0.25 * frametime);
+ ent.alpha = max(0, ent.alpha - SHOWNAMES_FADESPEED * 0.25 * frametime);
else if(overlap) // tag overlap detected, fade out
- ent.alpha = max(0, ent.alpha - SHOWNAMES_FADESPEED * frametime);
+ ent.alpha = max(0, ent.alpha - SHOWNAMES_FADESPEED * frametime);
else if(ent.sameteam) // fade in for team mates
ent.alpha = min(1, ent.alpha + SHOWNAMES_FADESPEED * frametime);
else if(time > ent.fadedelay) // fade in for enemies
if(!ent.alpha)
return;
-
+
float dist;
dist = vlen(ent.origin - view_origin);
setorigin(e, getplayerorigin(i));
if(e.origin == GETPLAYERORIGIN_ERROR)
continue;
-
+
e.csqcmodel_isdead = getplayerisdead(i);
Draw_ShowNames(e);
}
void turret_precache(float _tid)
-{
+{
if (!turret_is_precache[TID_COMMON])
{
precache_sound ("weapons/rocket_impact.wav");
{
case TID_EWHEEL:
precache_model ("models/turrets/ewheel-base2.md3");
- precache_model ("models/turrets/ewheel-gun1.md3");
+ precache_model ("models/turrets/ewheel-gun1.md3");
break;
case TID_FLAC:
precache_model ("models/turrets/flac.md3");
break;
case TID_FUSION:
- precache_model ("models/turrets/reactor.md3");
+ precache_model ("models/turrets/reactor.md3");
break;
case TID_HELLION:
precache_model ("models/turrets/hellion.md3");
precache_model ("models/turrets/walker_body.md3");
precache_sound ("weapons/uzi_fire.wav");
break;
- }
+ }
turret_is_precache[_tid] = TRUE;
}
tid2info_min = '-70 -70 0';
tid2info_max = '70 70 95';
break;
- }
+ }
}
void turret_remove()
-{
+{
remove(self.tur_head);
//remove(self.enemy);
- self.tur_head = world;
+ self.tur_head = world;
}
.vector glowmod;
void turret_changeteam()
-{
+{
switch(self.team - 1)
{
case NUM_TEAM_1: // Red
self.teamradar_color = '1 0 1';
break;
}
-
+
if(self.team)
self.colormap = 1024 + (self.team - 1) * 17;
-
+
self.tur_head.colormap = self.colormap;
self.tur_head.glowmod = self.glowmod;
-
+
}
void turret_head_draw()
-{
+{
self.drawmask = MASK_NORMAL;
}
void turret_draw()
-{
+{
float dt;
dt = time - self.move_time;
self.move_time = time;
if(dt <= 0)
return;
-
+
self.tur_head.angles += dt * self.tur_head.move_avelocity;
if (self.health < 127)
{
dt = random();
-
+
if(dt < 0.03)
- te_spark(self.origin + '0 0 40', randomvec() * 256 + '0 0 256', 16);
+ te_spark(self.origin + '0 0 40', randomvec() * 256 + '0 0 256', 16);
}
-
+
if(self.health < 85)
if(dt < 0.01)
pointparticles(particleeffectnum("smoke_large"), (self.origin + (randomvec() * 80)), '0 0 0', 1);
-
+
if(self.health < 32)
if(dt < 0.015)
- pointparticles(particleeffectnum("smoke_small"), (self.origin + (randomvec() * 80)), '0 0 0', 1);
+ pointparticles(particleeffectnum("smoke_small"), (self.origin + (randomvec() * 80)), '0 0 0', 1);
}
{
if(self.netname == "")
return;
-
+
if(!autocvar_g_waypointsprite_turrets)
return;
-
+
if(autocvar_cl_hidewaypoints)
- return;
+ return;
float dist = vlen(self.origin - view_origin);
- float t = (GetPlayerColor(player_localnum) + 1);
+ float t = (GetPlayerColor(player_localnum) + 1);
vector o;
string txt;
-
+
if(autocvar_cl_vehicles_hud_tactical)
if(dist < 10240 && t != self.team)
{
// TODO: Vehicle tactical hud
o = project_3d_to_2d(self.origin + '0 0 32');
- if(o_z < 0
- || o_x < (vid_conwidth * waypointsprite_edgeoffset_left)
- || o_y < (vid_conheight * waypointsprite_edgeoffset_top)
- || o_x > (vid_conwidth - (vid_conwidth * waypointsprite_edgeoffset_right))
+ if(o_z < 0
+ || o_x < (vid_conwidth * waypointsprite_edgeoffset_left)
+ || o_y < (vid_conheight * waypointsprite_edgeoffset_top)
+ || o_x > (vid_conwidth - (vid_conwidth * waypointsprite_edgeoffset_right))
|| o_y > (vid_conheight - (vid_conheight * waypointsprite_edgeoffset_bottom)))
return; // Dont draw wp's for turrets out of view
o_z = 0;
if(hud != HUD_NORMAL)
- {
+ {
switch(hud)
{
case HUD_SPIDERBOT:
txt = "gfx/vehicles/vth-mover.tga";
else
txt = "gfx/vehicles/vth-stationary.tga";
-
+
vector pz = drawgetimagesize(txt) * 0.25;
drawpic(o - pz * 0.5, txt, pz , '1 1 1', 0.75, DRAWFLAG_NORMAL);
break;
}
}
}
-
+
if(dist > self.maxdistance)
return;
float a = self.alpha * autocvar_hud_panel_fg_alpha;
vector rgb = spritelookupcolor(spriteimage, self.teamradar_color);
-
+
if(self.maxdistance > waypointsprite_normdistance)
a *= pow(bound(0, (self.maxdistance - dist) / (self.maxdistance - waypointsprite_normdistance), 1), waypointsprite_distancealphaexponent);
else if(self.maxdistance > 0)
if(rgb == '0 0 0')
{
self.teamradar_color = '1 0 1';
- print(sprintf("WARNING: sprite of name %s has no color, using pink so you notice it\n", spriteimage));
+ print(sprintf("WARNING: sprite of name %s has no color, using pink so you notice it\n", spriteimage));
}
txt = self.netname;
txt = _("Spam");
else
txt = spritelookuptext(spriteimage);
-
+
if(time - floor(time) > 0.5 && t == self.team)
{
if(self.helpme && time < self.helpme)
{
a *= SPRITE_HELPME_BLINK;
txt = sprintf(_("%s under attack!"), txt);
- }
+ }
else
a *= spritelookupblinkvalue(spriteimage);
}
-
+
if(autocvar_g_waypointsprite_uppercase)
txt = strtoupper(txt);
if(a <= 0)
return;
-
+
rgb = fixrgbexcess(rgb);
o = project_3d_to_2d(self.origin + '0 0 64');
- if(o_z < 0
- || o_x < (vid_conwidth * waypointsprite_edgeoffset_left)
- || o_y < (vid_conheight * waypointsprite_edgeoffset_top)
- || o_x > (vid_conwidth - (vid_conwidth * waypointsprite_edgeoffset_right))
+ if(o_z < 0
+ || o_x < (vid_conwidth * waypointsprite_edgeoffset_left)
+ || o_y < (vid_conheight * waypointsprite_edgeoffset_top)
+ || o_x > (vid_conwidth - (vid_conwidth * waypointsprite_edgeoffset_right))
|| o_y > (vid_conheight - (vid_conheight * waypointsprite_edgeoffset_bottom)))
return; // Dont draw wp's for turrets out of view
o_z = 0;
float edgedistance_min, crosshairdistance;
- edgedistance_min = min((o_y - (vid_conheight * waypointsprite_edgeoffset_top)),
+ edgedistance_min = min((o_y - (vid_conheight * waypointsprite_edgeoffset_top)),
(o_x - (vid_conwidth * waypointsprite_edgeoffset_left)),
- (vid_conwidth - (vid_conwidth * waypointsprite_edgeoffset_right)) - o_x,
+ (vid_conwidth - (vid_conwidth * waypointsprite_edgeoffset_right)) - o_x,
(vid_conheight - (vid_conheight * waypointsprite_edgeoffset_bottom)) - o_y);
float vidscale = max(vid_conwidth / vid_width, vid_conheight / vid_height);
t = t * (1 - (1 - waypointsprite_crosshairfadescale) * (1 - bound(0, crosshairdistance/waypointsprite_crosshairfadedistance, 1)));
}
- o = drawspritearrow(o, M_PI, rgb, a, SPRITE_ARROW_SCALE * t);
+ o = drawspritearrow(o, M_PI, rgb, a, SPRITE_ARROW_SCALE * t);
o = drawspritetext(o, M_PI, (SPRITE_HEALTHBAR_WIDTH + 2 * SPRITE_HEALTHBAR_BORDER) * t, rgb, a, waypointsprite_fontsize * '1 1 0', txt);
drawhealthbar(
o,
}
void turret_walker_draw()
-{
+{
float dt;
-
+
dt = time - self.move_time;
self.move_time = time;
if(dt <= 0)
return;
-
+
fixedmakevectors(self.angles);
movelib_groundalign4point(300, 100, 0.25, 45);
setorigin(self, self.origin + self.velocity * dt);
self.tur_head.angles += dt * self.tur_head.move_avelocity;
self.angles_y = self.move_angles_y;
-
+
if (self.health < 127)
if(random() < 0.15)
- te_spark(self.origin + '0 0 40', randomvec() * 256 + '0 0 256', 16);
+ te_spark(self.origin + '0 0 40', randomvec() * 256 + '0 0 256', 16);
}
void turret_ewheel_draw()
-{
+{
float dt;
-
+
dt = time - self.move_time;
self.move_time = time;
if(dt <= 0)
return;
-
- fixedmakevectors(self.angles);
+
+ fixedmakevectors(self.angles);
setorigin(self, self.origin + self.velocity * dt);
self.tur_head.angles += dt * self.tur_head.move_avelocity;
self.angles_y = self.move_angles_y;
-
+
if (self.health < 127)
if(random() < 0.05)
- te_spark(self.origin + '0 0 40', randomvec() * 256 + '0 0 256', 16);
+ te_spark(self.origin + '0 0 40', randomvec() * 256 + '0 0 256', 16);
}
void(entity e, entity tagentity, string tagname) setattachment = #443;
void turret_construct()
-{
+{
if(self.tur_head == world)
self.tur_head = spawn();
-
+
turret_tid2info(self.turret_type);
self.netname = tid2info_name;
setmodel(self.tur_head, tid2info_head);
setsize(self, tid2info_min, tid2info_max);
setsize(self.tur_head, '0 0 0', '0 0 0');
-
+
if(self.turret_type == TID_EWHEEL)
setattachment(self.tur_head, self, "");
else
setattachment(self.tur_head, self, "tag_head");
-
+
self.tur_head.classname = "turret_head";
self.tur_head.owner = self;
self.tur_head.move_movetype = MOVETYPE_NOCLIP;
self.solid = SOLID_BBOX;
self.tur_head.solid = SOLID_NOT;
self.movetype = MOVETYPE_NOCLIP;
- self.tur_head.movetype = MOVETYPE_NOCLIP;
+ self.tur_head.movetype = MOVETYPE_NOCLIP;
self.draw = turret_draw;
self.entremove = turret_remove;
self.drawmask = MASK_NORMAL;
self.tur_head.drawmask = MASK_NORMAL;
- self.anim_start_time = 0;
+ self.anim_start_time = 0;
self.draw2d = turret_draw2d;
self.maxdistance = autocvar_g_waypointsprite_turrets_maxdist;
self.teamradar_color = '1 0 0';
self.alpha = 1;
-
+
if(self.turret_type == TID_EWHEEL || self.turret_type == TID_WALKER)
{
self.gravity = 1;
self.movetype = MOVETYPE_BOUNCE;
self.move_movetype = MOVETYPE_BOUNCE;
- self.move_origin = self.origin;
- self.move_time = time;
+ self.move_origin = self.origin;
+ self.move_time = time;
switch(self.turret_type)
{
case TID_EWHEEL:
case TID_WALKER:
self.draw = turret_walker_draw;
break;
-
- }
+
+ }
}
}
void turret_gib_draw()
{
Movetype_Physics_MatchTicrate(autocvar_cl_gibs_ticrate, autocvar_cl_gibs_sloppy);
-
+
self.drawmask = MASK_NORMAL;
-
+
if(self.cnt)
{
if(time >= self.nextthink)
{
self.alpha = bound(0, self.nextthink - time, 1);
if(self.alpha < ALPHA_MIN_VISIBLE)
- remove(self);
+ remove(self);
}
}
void turret_gibboom()
{
float i;
-
+
sound (self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
pointparticles(particleeffectnum("rocket_explode"), self.origin, '0 0 0', 1);
entity turret_gibtoss(string _model, vector _from, vector _to, vector _cmod, float _explode)
{
entity gib;
-
+
traceline(_from, _to, MOVE_NOMONSTERS, world);
if(trace_startsolid)
return world;
-
+
gib = spawn();
setorigin(gib, _from);
setmodel(gib, _model);
gib.colormod = _cmod;
gib.solid = SOLID_CORPSE;
- gib.draw = turret_gib_draw;
+ gib.draw = turret_gib_draw;
gib.cnt = _explode;
setsize(gib, '-1 -1 -1', '1 1 1');
if(_explode)
{
gib.nextthink = time + 0.2 * (autocvar_cl_gibs_lifetime * (1 + prandom() * 0.15));
gib.effects = EF_FLAME;
- }
+ }
else
gib.nextthink = time + autocvar_cl_gibs_lifetime * (1 + prandom() * 0.15);
-
+
gib.gravity = 1;
gib.move_movetype = MOVETYPE_BOUNCE;
gib.move_origin = _from;
setorigin(gib, _from);
- gib.move_velocity = _to;
+ gib.move_velocity = _to;
gib.move_avelocity = prandomvec() * 32;
gib.move_time = time;
gib.damageforcescale = 1;
gib.classname = "turret_gib";
-
+
return gib;
}
void turret_die()
-{
-
+{
+
sound (self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
pointparticles(particleeffectnum("rocket_explode"), self.origin, '0 0 0', 1);
turret_tid2info(self.turret_type);
else if (self.turret_type == TID_TESLA)
turret_gibtoss(tid2info_base, self.origin + '0 0 18', '0 0 200', '-1 -1 -1', FALSE);
else
- {
+ {
if (random() > 0.5)
- {
+ {
turret_gibtoss("models/turrets/base-gib2.md3", self.origin + '0 0 8', '0 0 50' + randomvec() * 150, '0 0 0', FALSE);
turret_gibtoss("models/turrets/base-gib3.md3", self.origin + '0 0 8', '0 0 50' + randomvec() * 150, '0 0 0', FALSE);
turret_gibtoss("models/turrets/base-gib4.md3", self.origin + '0 0 8', '0 0 50' + randomvec() * 150, '0 0 0', FALSE);
headgib.angles = headgib.move_angles = self.tur_head.angles;
headgib.avelocity = headgib.move_avelocity = self.tur_head.move_avelocity + randomvec() * 45;
headgib.avelocity_y = headgib.move_avelocity_y = headgib.move_avelocity_y * 5;
- headgib.gravity = 0.5;
+ headgib.gravity = 0.5;
}
}
}
-
+
setmodel(self, "null");
setmodel(self.tur_head, "null");
}
sf = ReadByte();
if(sf & TNSF_SETUP)
- {
+ {
self.turret_type = ReadByte();
-
+
self.origin_x = ReadCoord();
self.origin_y = ReadCoord();
self.origin_z = ReadCoord();
setorigin(self, self.origin);
-
+
self.angles_x = ReadAngle();
self.angles_y = ReadAngle();
-
+
turret_precache(self.turret_type);
turret_construct();
self.colormap = 1024;
- self.glowmod = '0 1 1';
+ self.glowmod = '0 1 1';
self.tur_head.colormap = self.colormap;
self.tur_head.glowmod = self.glowmod;
}
-
+
if(sf & TNSF_ANG)
{
if(self.tur_head == world) // aparenly this can happpen before TNSF_SETUP. great.
self.tur_head = spawn();
-
+
self.tur_head.move_angles_x = ReadShort();
self.tur_head.move_angles_y = ReadShort();
//self.tur_head.angles = self.angles + self.tur_head.move_angles;
self.tur_head.angles = self.tur_head.move_angles;
}
-
+
if(sf & TNSF_AVEL)
{
if(self.tur_head == world) // aparenly this can happpen before TNSF_SETUP. great.
self.tur_head = spawn();
-
+
self.tur_head.move_avelocity_x = ReadShort();
- self.tur_head.move_avelocity_y = ReadShort();
+ self.tur_head.move_avelocity_y = ReadShort();
}
-
+
if(sf & TNSF_MOVE)
{
self.origin_x = ReadShort();
self.origin_y = ReadShort();
self.origin_z = ReadShort();
setorigin(self, self.origin);
-
+
self.velocity_x = ReadShort();
self.velocity_y = ReadShort();
self.velocity_z = ReadShort();
-
+
self.move_angles_y = ReadShort();
-
+
self.move_time = time;
self.move_velocity = self.velocity;
self.move_origin = self.origin;
}
-
+
if(sf & TNSF_ANIM)
{
self.frame1time = ReadCoord();
float _tmp;
_tmp = ReadByte();
if(_tmp != self.team)
- {
- self.team = _tmp;
+ {
+ self.team = _tmp;
turret_changeteam();
}
-
- _tmp = ReadByte();
+
+ _tmp = ReadByte();
if(_tmp == 0 && self.health != 0)
turret_die();
else if(self.health && self.health != _tmp)
self.helpme = servertime + 10;
self.health = _tmp;
- }
+ }
//self.enemy.health = self.health / 255;
}
psize = self.axh_scale * draw_getimagesize(self.axh_image);
loc = project_3d_to_2d(self.move_origin) - 0.5 * psize;
- if not (loc_z < 0 || loc_x < 0 || loc_y < 0 || loc_x > vid_conwidth || loc_y > vid_conheight)
+ if (!(loc_z < 0 || loc_x < 0 || loc_y < 0 || loc_x > vid_conwidth || loc_y > vid_conheight))
{
loc_z = 0;
psize_z = 0;
axh.alpha = 1;
AuxiliaryXhair[axh_id] = axh;
}
-
+
axh.move_origin_x = ReadCoord();
axh.move_origin_y = ReadCoord();
axh.move_origin_z = ReadCoord();
axh.colormod_y = ReadByte() / 255;
axh.colormod_z = ReadByte() / 255;
axh.cnt = time;
- axh.draw2d = AuxiliaryXhair_Draw2D;
+ axh.draw2d = AuxiliaryXhair_Draw2D;
}
void Net_VehicleSetup()
{
float i;
-
+
float hud_id = ReadByte();
-
+
// Weapon update?
if(hud_id > HUD_VEHICLE_LAST)
{
weapon2mode = hud_id - HUD_VEHICLE_LAST;
return;
}
-
+
// hud_id == 0 means we exited a vehicle, so stop alarm sound/s
if(hud_id == 0)
{
sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
- sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
+ sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
return;
}
-
+
hud_id = bound(HUD_VEHICLE_FIRST, hud_id, HUD_VEHICLE_LAST);
// Init auxiliary crosshairs
// Raygun-locked
AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-bracket.tga";
AuxiliaryXhair[0].axh_scale = 0.5;
-
+
// Gunner1
AuxiliaryXhair[1].axh_image = "gfx/vehicles/axh-target.tga";
AuxiliaryXhair[1].axh_scale = 0.75;
-
+
// Gunner2
AuxiliaryXhair[2].axh_image = "gfx/vehicles/axh-target.tga";
AuxiliaryXhair[2].axh_scale = 0.75;
- break;
+ break;
case HUD_BUMBLEBEE_GUN:
// Plasma cannons
AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-bracket.tga";
pic2size = draw_getimagesize(bumb_ico) * (autocvar_cl_vehicles_hudscale * 0.8);
picloc = picsize * 0.5 - pic2size * 0.5;
-
+
if(vh_health < 0.25)
drawpic(hudloc + picloc, bumb_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
else
drawpic(hudloc + picloc, bumb_ico, pic2size, '1 1 1' * vh_health + '1 0 0' * (1 - vh_health), 1, DRAWFLAG_NORMAL);
-
+
drawpic(hudloc + picloc, bumb_lgun, pic2size, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
drawpic(hudloc + picloc, bumb_lgun, pic2size, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
drawpic(hudloc + picloc, hud_sh, pic2size, '1 1 1', shield, DRAWFLAG_NORMAL);
alarm1time = time + 2;
sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTEN_NONE);
}
-
+
drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
- }
+ }
else
{
drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
{
sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
alarm1time = 0;
- }
+ }
}
// Shield bar
{
drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
if(alarm2time)
- {
+ {
sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
alarm2time = 0;
}
}
-
+
ammo1 *= 0.01;
ammo2 *= 0.01;
-
+
// Gunner1 bar
picsize = draw_getimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale;
picloc = '450 69 0' * autocvar_cl_vehicles_hudscale;
// Right gunner slot occupied?
if(!AuxiliaryXhair[1].draw2d)
{
- shield = (picsize_x * 0.5) - (0.5 * stringwidth(_("No right gunner!"), FALSE, '1 0 0' * picsize_y + '0 1 0' * picsize_y));
+ shield = (picsize_x * 0.5) - (0.5 * stringwidth(_("No right gunner!"), FALSE, '1 0 0' * picsize_y + '0 1 0' * picsize_y));
drawfill(hudloc + picloc - '0.2 0.2 0', picsize + '0.4 0.4 0', '0.25 0.25 0.25', 0.75, DRAWFLAG_NORMAL);
drawstring(hudloc + picloc + '1 0 0' * shield, _("No right gunner!"), '1 0 0' * picsize_y + '0 1 0' * picsize_y, '1 0 0' + '0 1 1' * sin(time * 10), 1, DRAWFLAG_NORMAL);
}
-
+
// .. and icon
picsize = 1.5 * draw_getimagesize(hud_energy) * autocvar_cl_vehicles_hudscale;
picloc = '664 60 0' * autocvar_cl_vehicles_hudscale;
drawpic(hudloc + picloc, hud_energy, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
else
drawpic(hudloc + picloc, hud_energy, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
-
+
// Gunner2 bar
picsize = draw_getimagesize(hud_ammo2_bar) * autocvar_cl_vehicles_hudscale;
picloc = '450 140 0' * autocvar_cl_vehicles_hudscale;
// Left gunner slot occupied?
if(!AuxiliaryXhair[2].draw2d)
{
- shield = (picsize_x * 0.5) - (0.5 * stringwidth(_("No left gunner!"), FALSE, '1 0 0' * picsize_y + '0 1 0' * picsize_y));
+ shield = (picsize_x * 0.5) - (0.5 * stringwidth(_("No left gunner!"), FALSE, '1 0 0' * picsize_y + '0 1 0' * picsize_y));
drawfill(hudloc + picloc - '0.2 0.2 0', picsize + '0.4 0.4 0', '0.25 0.25 0.25', 0.75, DRAWFLAG_NORMAL);
drawstring(hudloc + picloc + '1 0 0' * shield, _("No left gunner!"), '1 0 0' * picsize_y + '0 1 0' * picsize_y, '1 0 0' + '0 1 1' * sin(time * 10), 1, DRAWFLAG_NORMAL);
}
picsize_y *= 0.5;
drawpic('0.5 0 0' * (vid_conwidth - picsize_x) + '0 0.5 0' * (vid_conheight - picsize_y), waki_xhair, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
}
-
+
}
void CSQC_BUMBLE_GUN_HUD()
pic2size = draw_getimagesize(bumb_gun_ico) * (autocvar_cl_vehicles_hudscale * 0.8);
picloc = picsize * 0.5 - pic2size * 0.5;
-
+
if(vh_health < 0.25)
drawpic(hudloc + picloc, bumb_gun_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
else
drawpic(hudloc + picloc, bumb_gun_ico, pic2size, '1 1 1' * vh_health + '1 0 0' * (1 - vh_health), 1, DRAWFLAG_NORMAL);
-
+
drawpic(hudloc + picloc, bumb_gun_gun, pic2size, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
drawpic(hudloc + picloc, hud_sh, pic2size, '1 1 1', shield, DRAWFLAG_NORMAL);
alarm1time = time + 2;
sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTEN_NONE);
}
-
+
drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
- }
+ }
else
{
drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
{
sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
alarm1time = 0;
- }
+ }
}
// Shield bar
{
drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
if(alarm2time)
- {
+ {
sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
alarm2time = 0;
}
}
-
+
// Gun bar
picsize = draw_getimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale;
picloc = '450 69 0' * autocvar_cl_vehicles_hudscale;
drawsetcliparea(hudloc_x + picloc_x, picloc_y, picsize_x * energy, vid_conheight);
drawpic(hudloc + picloc, hud_ammo1_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
drawresetcliparea();
-
+
// .. and icon
picsize = 1.5 * draw_getimagesize(hud_energy) * autocvar_cl_vehicles_hudscale;
picloc = '664 60 0' * autocvar_cl_vehicles_hudscale;
if(vh_health < 0.25)
drawpic(hudloc + picloc, spider_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
else
- drawpic(hudloc + picloc, spider_ico, pic2size, '1 1 1' * vh_health + '1 0 0' * (1 - vh_health), 1, DRAWFLAG_NORMAL);
+ drawpic(hudloc + picloc, spider_ico, pic2size, '1 1 1' * vh_health + '1 0 0' * (1 - vh_health), 1, DRAWFLAG_NORMAL);
drawpic(hudloc + picloc, spider_rkt, pic2size, '1 1 1' * reload2 + '1 0 0' * (1 - reload2), 1, DRAWFLAG_NORMAL);
drawpic(hudloc + picloc, spider_mgun, pic2size, '1 1 1' * ammo1 + '1 0 0' * (1 - ammo1), 1, DRAWFLAG_NORMAL);
drawpic(hudloc + picloc, hud_sh, pic2size, '1 1 1', shield, DRAWFLAG_NORMAL);
{
alarm1time = time + 2;
sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTEN_NONE);
- }
+ }
drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
- }
+ }
else
{
drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
{
sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
alarm1time = 0;
- }
+ }
}
// Shield bar
picsize = draw_getimagesize(hud_sh_bar) * autocvar_cl_vehicles_hudscale;
{
drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
if(alarm2time)
- {
+ {
sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
alarm2time = 0;
}
alarm1time = time + 2;
sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTEN_NONE);
}
-
+
drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
- }
+ }
else
{
drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
{
drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
if(alarm2time)
- {
+ {
sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
alarm2time = 0;
}
}
-
+
// Gun bar
picsize = draw_getimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale;
picloc = '450 69 0' * autocvar_cl_vehicles_hudscale;
drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
else
drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 1 1', 1, DRAWFLAG_NORMAL);
-
+
if(weapon2mode == RSM_FLARE)
{
raptor_xhair = "gfx/vehicles/axh-bracket.tga";
else
{
raptor_xhair = "gfx/vehicles/axh-ring.tga";
-
+
// Bombing crosshair
if(!dropmark)
{
setorigin(dropmark, trace_endpos);
picsize = draw_getimagesize(raptor_drop) * 0.2;
- if not (where_z < 0 || where_x < 0 || where_y < 0 || where_x > vid_conwidth || where_y > vid_conheight)
+ if (!(where_z < 0 || where_x < 0 || where_y < 0 || where_x > vid_conwidth || where_y > vid_conheight))
{
where_x -= picsize_x * 0.5;
where_y -= picsize_y * 0.5;
where = project_3d_to_2d(dropmark.origin);
picsize = draw_getimagesize(raptor_drop) * 0.25;
- if not (where_z < 0 || where_x < 0 || where_y < 0 || where_x > vid_conwidth || where_y > vid_conheight)
+ if (!(where_z < 0 || where_x < 0 || where_y < 0 || where_x > vid_conwidth || where_y > vid_conheight))
{
where_x -= picsize_x * 0.5;
where_y -= picsize_y * 0.5;
}
}
}
-
+
if (scoreboard_showscores)
HUD_DrawScoreboard();
else
alarm1time = time + 2;
sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTEN_NONE);
}
-
+
drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
- }
+ }
else
{
drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
{
sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
alarm1time = 0;
- }
+ }
}
-
+
// Shield bar
picsize = draw_getimagesize(hud_sh_bar) * autocvar_cl_vehicles_hudscale;
{
drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
if(alarm2time)
- {
+ {
sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
alarm2time = 0;
}
}
-
+
// Gun bar
picsize = draw_getimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale;
picloc = '450 69 0' * autocvar_cl_vehicles_hudscale;
precache_model("models/vehicles/clusterbomb_fragment.md3");
precache_model("models/vehicles/rocket01.md3");
precache_model("models/vehicles/rocket02.md3");
-
+
precache_sound ("vehicles/alarm.wav");
precache_sound ("vehicles/alarm_shield.wav");
}
void RaptorCBShellfragDraw()
{
if(wasfreed(self))
- return;
-
+ return;
+
Movetype_Physics_MatchTicrate(autocvar_cl_gibs_ticrate, autocvar_cl_gibs_sloppy);
self.move_avelocity += randomvec() * 15;
self.renderflags = 0;
-
+
if(self.cnt < time)
self.alpha = bound(0, self.nextthink - time, 1);
void RaptorCBShellfragToss(vector _org, vector _vel, vector _ang)
{
entity sfrag;
-
+
sfrag = spawn();
setmodel(sfrag, "models/vehicles/clusterbomb_fragment.md3");
setorigin(sfrag, _org);
o = hotspot;
ri = '1 0 0';
up = '0 1 0';
-
+
rot = -rot; // rotate by the opposite angle, as our coordinate system is reversed
o = rotate(o, rot) + org;
ri = rotate(ri, rot);
return;
++waypointsprite_newcount;
-
+
float dist;
dist = vlen(self.origin - view_origin);
-
+
float a;
a = self.alpha * autocvar_hud_panel_fg_alpha;
if(rgb == '0 0 0')
{
self.teamradar_color = '1 0 1';
- print(sprintf("WARNING: sprite of name %s has no color, using pink so you notice it\n", spriteimage));
+ print(sprintf("WARNING: sprite of name %s has no color, using pink so you notice it\n", spriteimage));
}
if(time - floor(time) > 0.5)
float ang;
o = project_3d_to_2d(self.origin);
- if(o_z < 0
- || o_x < (vid_conwidth * waypointsprite_edgeoffset_left)
- || o_y < (vid_conheight * waypointsprite_edgeoffset_top)
- || o_x > (vid_conwidth - (vid_conwidth * waypointsprite_edgeoffset_right))
+ if(o_z < 0
+ || o_x < (vid_conwidth * waypointsprite_edgeoffset_left)
+ || o_y < (vid_conheight * waypointsprite_edgeoffset_top)
+ || o_x > (vid_conwidth - (vid_conwidth * waypointsprite_edgeoffset_right))
|| o_y > (vid_conheight - (vid_conheight * waypointsprite_edgeoffset_bottom)))
{
// scale it to be just in view
o_z = 0;
float edgedistance_min, crosshairdistance;
- edgedistance_min = min((o_y - (vid_conheight * waypointsprite_edgeoffset_top)),
+ edgedistance_min = min((o_y - (vid_conheight * waypointsprite_edgeoffset_top)),
(o_x - (vid_conwidth * waypointsprite_edgeoffset_left)),
- (vid_conwidth - (vid_conwidth * waypointsprite_edgeoffset_right)) - o_x,
+ (vid_conwidth - (vid_conwidth * waypointsprite_edgeoffset_right)) - o_x,
(vid_conheight - (vid_conheight * waypointsprite_edgeoffset_bottom)) - o_y);
float vidscale;
}
o = drawspritearrow(o, ang, rgb, a, SPRITE_ARROW_SCALE * t);
-
+
string txt;
if(autocvar_g_waypointsprite_spam && waypointsprite_count >= autocvar_g_waypointsprite_spam)
txt = _("Spam");
campaign_entries = campaign_entries + 1;
- if(campaign_entries >= n)
+ if(campaign_entries >= n)
break;
}
lineno = lineno + 1;
strunzone(do_cvar);
}
if(!do_exec)
- if not(do_cvar)
+ if (!do_cvar)
print(data);
}
case CMD_REQUEST_COMMAND:
{
float i;
-
+
if(argc >= 2)
{
string original_cvar = argv(1);
string tmp_string = argv(2);
-
+
if(cvar_string(original_cvar) == "") // cvar was empty
{
cvar_set(original_cvar, tmp_string);
else // add it to the end of the list if the list doesn't already have it
{
argc = tokenizebyseparator(cvar_string(original_cvar), " ");
-
+
for(i = 0; i < argc; ++i)
if(argv(i) == tmp_string)
return; // already in list
-
+
cvar_set(original_cvar, strcat(tmp_string, " ", cvar_string(original_cvar)));
}
return;
}
}
-
+
default:
print("Incorrect parameters for ^2addtolist^7\n");
case CMD_REQUEST_USAGE:
return;
}
-
+
default:
case CMD_REQUEST_USAGE:
{
float fh;
string filename = strcat(GetProgramCommandPrefix(), "_dump.txt");
fh = fopen(filename, FILE_WRITE);
-
+
if(fh >= 0)
{
#ifdef SVQC
CMD_Write("dump of server console commands:\n");
GameCommand_macro_write_aliases(fh);
-
+
CMD_Write("\ndump of networked client only commands:\n");
ClientCommand_macro_write_aliases(fh);
-
+
CMD_Write("\ndump of common commands:\n");
CommonCommand_macro_write_aliases(fh);
CMD_Write("\ndump of ban commands:\n");
BanCommand_macro_write_aliases(fh);
#endif
-
+
#ifdef CSQC
CMD_Write("dump of client commands:\n");
LocalCommand_macro_write_aliases(fh);
#endif
-
+
CMD_Write("\ndump of generic commands:\n");
GenericCommand_macro_write_aliases(fh);
-
+
print("Completed dump of aliases in ^2data/data/", GetProgramCommandPrefix(), "_dump.txt^7.\n");
-
+
fclose(fh);
}
else
}
return;
}
-
+
default:
case CMD_REQUEST_USAGE:
{
#ifndef MENUQC
float fh, alsoprint = FALSE;
string filename = argv(1);
-
+
if(filename == "")
{
filename = "notifications.cfg";
alsoprint = TRUE;
}
fh = fopen(filename, FILE_WRITE);
-
+
if(fh >= 0)
{
Dump_Notifications(fh, alsoprint);
#endif
return;
}
-
+
default:
case CMD_REQUEST_USAGE:
{
{
string tmp_string;
float i;
-
+
switch(argv(1))
{
case "add": // appends new maps to the maplist
print("maplist: ERROR: ", argv(2), " does not exist!\n");
break;
}
-
+
if(cvar_string("g_maplist") == "")
cvar_set("g_maplist", argv(2));
else
cvar_set("g_maplist", strcat(argv(2), " ", cvar_string("g_maplist")));
-
+
return;
}
break; // go to usage
}
-
+
case "cleanup": // scans maplist and only adds back the ones which are really usable
{
MapInfo_Enumerate();
MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags(), 0);
argc = tokenizebyseparator(cvar_string("g_maplist"), " ");
-
+
tmp_string = "";
for(i = 0; i < argc; ++i)
if(MapInfo_CheckMap(argv(i)))
tmp_string = strcat(tmp_string, " ", argv(i));
-
+
tmp_string = substring(tmp_string, 1, strlen(tmp_string) - 1);
cvar_set("g_maplist", tmp_string);
-
+
return;
}
-
+
case "remove": // scans maplist and only adds back whatever maps were not provided in argv(2)
{
if(argc == 3)
{
argc = tokenizebyseparator(cvar_string("g_maplist"), " ");
-
+
tmp_string = "";
for(i = 0; i < argc; ++i)
if(argv(i) != argv(2))
tmp_string = strcat(tmp_string, " ", argv(i));
-
+
tmp_string = substring(tmp_string, 1, strlen(tmp_string) - 1);
cvar_set("g_maplist", tmp_string);
-
+
return;
}
break; // go to usage
}
-
+
case "shuffle": // randomly shuffle the maplist
{
cvar_set("g_maplist", shufflewords(cvar_string("g_maplist")));
return;
}
-
+
default: break;
}
}
-
+
default:
print("Incorrect parameters for ^2maplist^7\n");
case CMD_REQUEST_USAGE:
queue_to_execute_next_frame(substring(command, argv_start_index(1), argv_end_index(-1) - argv_start_index(1)));
return;
}
-
+
default:
case CMD_REQUEST_USAGE:
{
string original_cvar = argv(1);
string removal = argv(2);
string tmp_string;
-
+
argc = tokenizebyseparator(cvar_string(original_cvar), " ");
-
+
tmp_string = "";
for(i = 0; i < argc; ++i)
if(argv(i) != removal)
tmp_string = strcat(tmp_string, " ", argv(i));
-
+
tmp_string = substring(tmp_string, 1, strlen(tmp_string) - 1);
cvar_set(original_cvar, tmp_string);
-
+
return;
}
}
-
+
default:
print("Incorrect parameters for ^2removefromlist^7\n");
case CMD_REQUEST_USAGE:
NOTIF_CENTER_COUNT,
NOTIF_MULTI_COUNT,
NOTIF_CHOICE_COUNT
- ));
+ ));
Destroy_All_Notifications();
CALL_ACCUMULATED_FUNCTION(RegisterNotifications);
#else
#endif
return;
}
-
+
default:
case CMD_REQUEST_USAGE:
{
{
float f = cvar_settemp(argv(1), argv(2));
if(f == 1)
- dprint("Creating new settemp tracker for ", argv(1), " and setting it to \"", argv(2), "\" temporarily.\n");
+ dprint("Creating new settemp tracker for ", argv(1), " and setting it to \"", argv(2), "\" temporarily.\n");
else if(f == -1)
dprint("Already had a tracker for ", argv(1), ", updating it to \"", argv(2), "\".\n");
// else cvar_settemp itself errors out
case CMD_REQUEST_COMMAND:
{
float i = cvar_settemp_restore();
-
+
if(i)
dprint("Restored ", ftos(i), " temporary cvar settings to their original values.\n");
else
dprint("Nothing to restore.\n");
-
+
return;
}
-
+
default:
case CMD_REQUEST_USAGE:
{
TEST_RunAll();
return;
}
-
+
default:
case CMD_REQUEST_USAGE:
{
{
case CMD_REQUEST_COMMAND:
{
-
+
return;
}
-
+
default:
case CMD_REQUEST_USAGE:
{
{
#define GENERIC_COMMAND(name,function,description) \
{ print(" ^2", name, "^7: ", description, "\n"); }
-
+
GENERIC_COMMANDS(0, 0, "")
#undef GENERIC_COMMAND
-
+
return;
}
{
#define GENERIC_COMMAND(name,function,description) \
{ if(name == strtolower(argv(0))) { function; return TRUE; } }
-
+
GENERIC_COMMANDS(CMD_REQUEST_COMMAND, argc, command)
#undef GENERIC_COMMAND
-
+
return FALSE;
}
{
#define GENERIC_COMMAND(name,function,description) \
{ if(name == strtolower(argv(1))) { function; return TRUE; } }
-
+
GENERIC_COMMANDS(CMD_REQUEST_USAGE, argc, "")
#undef GENERIC_COMMAND
-
+
return FALSE;
}
{
#define GENERIC_COMMAND(name,function,description) \
{ CMD_Write_Alias("qc_cmd_svmenu", name, description); }
-
+
GENERIC_COMMANDS(0, 0, "")
#undef GENERIC_COMMAND
-
+
return;
}
-
+
// ===========================================
// Main Common Function For Generic Commands
// ===========================================
-// Commands spread out among all programs (menu, client, and server)
+// Commands spread out among all programs (menu, client, and server)
float GenericCommand(string command)
{
// Guide for working with argc arguments by example:
// argc: 1 - 2 - 3 - 4
- // argv: 0 - 1 - 2 - 3
+ // argv: 0 - 1 - 2 - 3
// cmd vote - master - login - password
-
+
if(GenericCommand_macro_command(argc, command)) // continue as usual and scan for normal commands
{
return TRUE; // handled by one of the above GenericCommand_* functions
// test case for terencehill's color codes
s = strdecolorize(substring(command, argv_start_index(2), argv_end_index(-1) - argv_start_index(2)));
s2 = "";
-
+
n = strlen(s);
j = ((6 * max(1, floor(strlen(s)/32 + random() * 2 - 1))) / n) * (1 - 2 * (random() > 0.5));
f = random() * 6;
// =========================================================
// Used by other game command systems for common commands,
-// and it returns true if handled, false if not.
+// and it returns true if handled, false if not.
// Note: It tokenizes its input, so be careful!
float GenericCommand(string command);
// Returns command prefix specific for whatever program it is compiled in
-string GetProgramCommandPrefix(void);
+string GetProgramCommandPrefix(void);
// used by common/command/generic.qc:GenericCommand_dumpcommands to list all commands into a .txt file
#define CMD_Write(s) fputs(fh, s)
// Last updated: December 28th, 2011
// ========================================
-string rpn_pop()
+string rpn_pop()
{
if(rpn_sp > 0) {
--rpn_sp;
return "";
}
}
-void rpn_push(string s)
+void rpn_push(string s)
{
if(rpn_sp < MAX_RPN_STACK) {
rpn_stack[rpn_sp] = s;
rpn_error = TRUE;
}
}
-string rpn_get()
+string rpn_get()
{
if(rpn_sp > 0) {
return rpn_stack[rpn_sp - 1];
return "";
}
}
-void rpn_set(string s)
+void rpn_set(string s)
{
if(rpn_sp > 0) {
rpn_stack[rpn_sp - 1] = s;
float i, j, f, f2, f3, rpnpos;
//vector rgb;
string s, s2, rpncmd;
-
+
if(!rpn_db)
{
rpn_db = db_create();
db_put(rpn_db, "stack.pointer", "0");
db_put(rpn_db, "stack.pos", "-1");
}
-
+
if(argc >= 2)
{
rpn_sp = 0;
print("rpn: database underflow\n");
}
} else if(rpncmd == "dbget") {
-
+
i = stof(db_get(rpn_db, "stack.pointer"));
if(i)
{
{
j = stof(db_get(rpn_db, "stack.pointer"));
i = stof(db_get(rpn_db, "stack.pos"));
-
+
if(i < 0)
{
i = 0;
db_put(rpn_db, "stack.pos", "0");
}
-
+
db_put(rpn_db, "stack.pointer", ftos(j+1));
for(--j; j >= i; --j)
{
i = 0;
else
i = stof(s);
-
+
j = stof(db_get(rpn_db, "stack.pointer"));
if(i < 0 || i >= j)
{
// tokens f..f2 represent s2
// UNION: add all tokens to s that are in s2 but not in s
s = "";
- for(i = 0; i < f; ++i)
+ for(i = 0; i < f; ++i)
s = strcat(s, " ", argv(i));
for(i = f; i < f2; ++i) {
for(j = 0; j < f; ++j)
return;
}
-
+
default:
case CMD_REQUEST_USAGE:
{
const float PROJECTILE_ELECTRO = 1;
const float PROJECTILE_ROCKET = 2;
const float PROJECTILE_TAG = 3;
-const float PROJECTILE_BULLET = 4;
const float PROJECTILE_CRYLINK = 5;
const float PROJECTILE_ELECTRO_BEAM = 6;
const float PROJECTILE_GRENADE = 7;
const float PROJECTILE_HOOKBOMB = 16;
const float PROJECTILE_HAGAR = 17;
const float PROJECTILE_HAGAR_BOUNCING = 18;
-const float PROJECTILE_BULLET_GLOWING = 19;
const float PROJECTILE_CRYLINK_BOUNCING = 20;
const float PROJECTILE_FIREBALL = 21;
const float PROJECTILE_FIREMINE = 22;
-const float PROJECTILE_BULLET_GLOWING_TRACER = 23;
const float PROJECTILE_RAPTORCANNON = 24;
const float PROJECTILE_RAPTORBOMB = 25;
ZCTX(_("CI_SEC^%d seconds")), /* second */ \
ZCTX(_("CI_THI^%d seconds")), /* third */ \
ZCTX(_("CI_MUL^%d seconds"))) /* multi */
-
+
string count_ordinal(float interval)
{
// This function is designed primarily for the English language, it's impossible
}
}
else { return sprintf(_("%dth"), interval); }
-
+
return "";
}
// 1 second
// 2 seconds
// 3 seconds
- // etc... minutes, hours, days, etc.
+ // etc... minutes, hours, days, etc.
switch(floor(interval))
{
{
float tmp_hours = 0, tmp_minutes = 0, tmp_seconds = 0;
float tmp_years = 0, tmp_weeks = 0, tmp_days = 0;
-
+
tmp_seconds = floor(seconds);
if(tmp_seconds)
{
tmp_minutes = floor(tmp_seconds / 60);
-
+
if(tmp_minutes)
{
tmp_seconds -= (tmp_minutes * 60);
tmp_hours = floor(tmp_minutes / 60);
-
+
if(tmp_hours)
{
tmp_minutes -= (tmp_hours * 60);
tmp_days = floor(tmp_hours / 24);
-
+
if(tmp_days)
{
tmp_hours -= (tmp_days * 24);
tmp_weeks = floor(tmp_days / 7);
-
+
if(tmp_weeks)
{
tmp_days -= (tmp_weeks * 7);
if(DEATH_ISSPECIAL(deathtype))
{
entity deathent = deathtypes[(deathtype - DT_FIRST)];
- if not(deathent) { backtrace("Deathtype_Name: Could not find deathtype entity!\n"); return ""; }
+ if (!deathent) { backtrace("Deathtype_Name: Could not find deathtype entity!\n"); return ""; }
return deathent.nent_name;
}
else { return ftos(deathtype); }
// GLOB HANDLING (for all BSP files)
float _MapInfo_globopen;
-float _MapInfo_globcount;
+float _MapInfo_globcount;
float _MapInfo_globhandle;
string _MapInfo_GlobItem(float i)
{
float MapInfo_FilterGametype(float pGametype, float pFeatures, float pFlagsRequired, float pFlagsForbidden, float pAbortOnGenerate)
{
float i, j;
- if not(_MapInfo_filtered_allocated)
+ if (!_MapInfo_filtered_allocated)
{
_MapInfo_filtered_allocated = 1;
_MapInfo_filtered = buf_create();
}
MapInfo_count = j + 1;
MapInfo_ClearTemps();
-
+
// sometimes the glob isn't sorted nicely, so fix it here...
heapsort(MapInfo_count, _MapInfo_FilterList_swap, _MapInfo_FilterList_cmp, world);
for(;;)
{
- if not((s = fgets(fh)))
+ if (!((s = fgets(fh))))
break;
if(inWorldspawn == 1)
if(startsWith(s, "}"))
if(load_default)
_MapInfo_Map_ApplyGametype(_MapInfo_GetDefault(pThisType), pWantedType, pThisType, FALSE);
-
+
if(pWantedType == MAPINFO_TYPE_ASSAULT || pWantedType == MAPINFO_TYPE_ONSLAUGHT || pWantedType == MAPINFO_TYPE_RACE || pWantedType == MAPINFO_TYPE_CTS) // these modes don't use fraglimit
{
cvar_set("fraglimit", "0");
s = cdr(s);
}
*/
-
+
// rc = timelimit timelimit_qualification laps laps_teamplay
if(pWantedType == MAPINFO_TYPE_RACE)
{
string MapInfo_Type_ToString(float t)
{
entity e;
- if(t == MAPINFO_TYPE_ALL)
+ if(t == MAPINFO_TYPE_ALL)
return "all";
for(e = MapInfo_Type_first; e; e = e.enemy)
if(t == e.items)
o = strstrofs(s, "\"", 0);
if(o >= 0)
s = substring(s, 0, o);
-
+
// remove // comments
o = strstrofs(s, "//", 0);
if(o >= 0)
s = substring(s, 0, o);
-
+
// remove trailing spaces
while(substring(s, -1, 1) == " ")
s = substring(s, 0, -2);
{
for(;;)
{
- if not((s = fgets(fh)))
+ if (!((s = fgets(fh))))
break;
// catch different sorts of comments
}
else if(t == "")
print("Map ", pFilename, " contains a potentially harmful setting, ignored\n");
- else if not(cvar_value_issafe(t))
+ else if (!cvar_value_issafe(t))
print("Map ", pFilename, " contains a potentially harmful setting, ignored\n");
- else if not (cvar_value_issafe(s))
+ else if (!cvar_value_issafe(s))
print("Map ", pFilename, " contains a potentially harmful setting, ignored\n");
else if(matchacl(MAPINFO_SETTEMP_ACL_SYSTEM, t) <= 0)
print("Map ", pFilename, " contains a potentially harmful setting, ignored\n");
else
fputs(fh, "// uncomment this if you added turrets: has turrets\n");
if(MapInfo_Map_supportedFeatures & MAPINFO_FEATURE_VEHICLES)
- fputs(fh, "has weapons\n");
+ fputs(fh, "has vehicles\n");
else
fputs(fh, "// uncomment this if you added vehicles: has vehicles\n");
if(MapInfo_Map_flags & MAPINFO_FLAG_FRUSTRATING)
_MapInfo_Map_Reset();
for(;;)
{
- if not((s = fgets(fh)))
+ if (!((s = fgets(fh))))
break;
// catch different sorts of comments
}
else if(t == "fog")
{
- if not(cvar_value_issafe(s))
+ if (!cvar_value_issafe(s))
print("Map ", pFilename, " contains a potentially harmful fog setting, ignored\n");
else
MapInfo_Map_fog = s;
t = car(s); s = cdr(s);
if(pGametypeToSet) // FIXME is this check right here?
{
- if not(cvar_value_issafe(t))
+ if (!cvar_value_issafe(t))
print("Map ", pFilename, " contains a potentially harmful cdtrack, ignored\n");
else
MapInfo_Map_clientstuff = strcat(
if(cvar("g_tdm_on_dm_maps"))
{
// if this is set, all DM maps support TDM too
- if not(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_TEAM_DEATHMATCH)
+ if (!(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_TEAM_DEATHMATCH))
if(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_DEATHMATCH)
_MapInfo_Map_ApplyGametypeEx ("", pGametypeToSet, MAPINFO_TYPE_TEAM_DEATHMATCH);
}
// print("EMERGENCY: can't play the selected map in the given game mode. Falling back to DM.\n");
// MapInfo_SwitchGameType(MAPINFO_TYPE_DEATHMATCH);
//}
-
+
cvar_settemp_restore();
if(reinit)
localcmd(strcat("\nmap ", s, "\n"));
f = MAPINFO_FLAG_FORBIDDEN;
#ifndef MENUQC
- if not(cvar("g_maplist_allow_hidden"))
+ if (!cvar("g_maplist_allow_hidden"))
#endif
f |= MAPINFO_FLAG_HIDDEN;
- if not(cvar("g_maplist_allow_frustrating"))
+ if (!cvar("g_maplist_allow_frustrating"))
f |= MAPINFO_FLAG_FRUSTRATING;
return f;
float argc = tokenizebyseparator(autocvar_sv_join_notices, "|");
if(argc > 0)
{
- float i;
- for(i = argc - 1; i >= 0; --i)
+ float i;
+ for(i = argc - 1; i >= 0; --i)
sv_notice_to(self.owner, argv(i), autocvar_sv_join_notices_time, FALSE);
- }
+ }
remove(self);
}
entity n = spawn();
n.owner = self;
n.think = sv_notice_join_think;
- n.nextthink = time + 1;
+ n.nextthink = time + 1;
}
void sv_notice_to(entity _to, string _notice, float _howlong, float _modal)
entity _head;
FOR_EACH_REALCLIENT(_head)
sv_notice_to(_head, _notice, _howlong, _modal);
-
+
}
#endif // SVQC
entity _notes;
string _notice;
float m = FALSE;
-
+
_notes = findchain(classname, "sv_notice");
if(!_notes)
return FALSE;
#define M1 30
#define M2 10
-
+
vector v1, v2 = '0 0 0', v3;
v1 = '1 1 0' * M1;
v2_x = vid_conwidth - (2 * M1);
v2_y = vid_conheight - (2 * M1);
-
+
drawfill(v1, v2, '0 0 0', 0.5, DRAWFLAG_NORMAL);
v1 = '1 1 0' * (M1 + M2);
v2_x = vid_conwidth - (2 * (M1 + M2));
v2_y = vid_conheight - (2 * (M1 + M2));
drawfill(v1, v2, '0.5 0.5 0.5', 0.5, DRAWFLAG_NORMAL);
v3 = v1 + '10 10 0';
-
+
#define OUT(s,z) drawcolorcodedstring(v3, s, '1 1 0' * z, 1, DRAWFLAG_NORMAL); v3_y += z + 4
-
+
OUT(_("^1Server notices:"), 32);
-
+
//drawcolorcodedstring(v1 + '5 5 0', "^1Server notices:", '32 32 0', 1, DRAWFLAG_NORMAL);
while(_notes)
{
-
+
_notice = sprintf(_("^7%s (^3%d sec left)"), _notes.netname , rint(_notes.alpha - time));
OUT(_notice, 16);
- if(_notes.skin)
+ if(_notes.skin)
m = TRUE;
-
+
if(_notes.alpha <= time)
{
_notes.think = SUB_Remove;
_notes.nextthink = time;
}
-
- _notes = _notes.chain;
+
+ _notes = _notes.chain;
}
-
+
#undef OUT
#undef M1
#undef M2
-
+
return m;
}
{ checkargs = sprintf("%sNo client provided!", checkargs); }
break;
}
-
+
case NOTIF_ALL_EXCEPT:
{
if(IS_NOT_A_CLIENT(client))
{ checkargs = sprintf("%sException can't be a non-client!", checkargs); }
break;
}
-
+
case NOTIF_ALL:
{
if(client)
{ checkargs = sprintf("%sEntity provided when world was required!", checkargs); }
break;
}
-
+
case NOTIF_TEAM:
{
- if not(teamplay)
+ if (!teamplay)
{ checkargs = sprintf("%sTeamplay not active!", checkargs); }
- //else if not(client.team) { checkargs = sprintf("%sNo team provided!", checkargs); }
+ //else if (!client.team) { checkargs = sprintf("%sNo team provided!", checkargs); }
break;
}
-
+
case NOTIF_TEAM_EXCEPT:
{
- if not(teamplay)
+ if (!teamplay)
{ checkargs = sprintf("%sTeamplay not active!", checkargs); }
else if(IS_NOT_A_CLIENT(client))
{ checkargs = sprintf("%sException can't be a non-client!", checkargs); }
break;
}
-
+
default: { checkargs = sprintf("%sImproper broadcast: %d!", checkargs, broadcast); break; }
}
return checkargs;
{
entity notif;
float i;
-
+
#define DESTROY_LOOP(type,count) \
for(i = 1; i <= count; ++i) \
{ \
notif = Get_Notif_Ent(type, i); \
- if not(notif) { backtrace("Destroy_All_Notifications(): Missing notification entity!\n"); return; } \
+ if (!notif) { backtrace("Destroy_All_Notifications(): Missing notification entity!\n"); return; } \
Destroy_Notification_Entity(notif); \
}
}
break;
}
- case 3: // durcnt
+ case 3: // durcnt
{
if(sel_num == NOTIF_MAX_DURCNT)
{
float strnum,
float flnum,
/* MSG_ANNCE */
- float channel,
+ float channel,
string snd,
float vol,
float position,
notif.nent_type = typeid;
notif.nent_id = nameid;
notif.nent_name = strzone(namestring);
-
+
string typestring = Get_Notif_TypeName(typeid);
// Other pre-notif-setup requisites
{
// Set MSG_ANNCE information and handle precaching
#ifdef CSQC
- if not(GENTLE && (var_cvar == 1))
+ if (!(GENTLE && (var_cvar == 1)))
{
if(snd != "")
{
break;
}
-
+
case MSG_INFO:
case MSG_CENTER:
{
{
notif.nent_hudargs = strzone(
Process_Notif_Args(2, hudargs, typestring, namestring));
-
+
if(icon != "") { notif.nent_icon = strzone(icon); }
else
{
{
notif.nent_durcnt = strzone(
Process_Notif_Args(3, durcnt, typestring, namestring));
-
+
if(cpid != NO_MSG) { notif.nent_cpid = cpid; }
else
{
));
notif_error = TRUE;
}
- }
+ }
else if(cpid != NO_MSG) { notif.nent_cpid = cpid; }
#endif
else if(normal != "") { SET_NOTIF_STRING(normal, "NORMAL") }
}
else if(normal != "") { SET_NOTIF_STRING(normal, "NORMAL") }
-
+
#undef SET_NOTIF_STRING
// Check to make sure a string was chosen
{
// announcements don't actually need any arguments, so lets not even count them.
if(anncename != NO_MSG) { notif.nent_msgannce = msg_annce_notifs[anncename - 1]; }
-
+
float infoname_stringcount = 0, infoname_floatcount = 0;
float centername_stringcount = 0, centername_floatcount = 0;
-
+
if(infoname != NO_MSG)
{
notif.nent_msginfo = msg_info_notifs[infoname - 1];
infoname_stringcount = notif.nent_msginfo.nent_stringcount;
infoname_floatcount = notif.nent_msginfo.nent_floatcount;
}
-
+
if(centername != NO_MSG)
{
notif.nent_msgcenter = msg_center_notifs[centername - 1];
centername_stringcount = notif.nent_msgcenter.nent_stringcount;
centername_floatcount = notif.nent_msgcenter.nent_floatcount;
}
-
+
// set the requirements of THIS notification to the totals of its subcalls
notif.nent_stringcount = max(infoname_stringcount, centername_stringcount);
notif.nent_floatcount = max(infoname_floatcount, centername_floatcount);
}
-
+
break;
}
notif.nent_optionb = msg_multi_notifs[optionb - 1];
break;
}
- case MSG_CHOICE: // should we REALLY allow nested options?...
+ case MSG_CHOICE: // should we REALLY allow nested options?...
{
notif.nent_optiona = msg_choice_notifs[optiona - 1];
notif.nent_optionb = msg_choice_notifs[optionb - 1];
notif.nent_challow_var = challow_var; // 0: never allowed, 1: allowed in warmup, 2: always allowed
notif.nent_stringcount = max(notif.nent_optiona.nent_stringcount, notif.nent_optionb.nent_stringcount);
notif.nent_floatcount = max(notif.nent_optiona.nent_floatcount, notif.nent_optionb.nent_floatcount);
-
+
/*#ifdef NOTIFICATIONS_DEBUG
Debug_Notification(sprintf(
"Create_Notification_Entity(...): MSG_CHOICE: %s\n%s\n%s\n",
}
break;
}
-
+
default:
{
print(sprintf(
}
}
- // now check to see if any errors happened
+ // now check to see if any errors happened
if(notif_error)
{
notif.nent_enabled = FALSE; // disable the notification so it can't cause trouble
for(i = 1; i <= NOTIF_ANNCE_COUNT; ++i)
{
e = Get_Notif_Ent(MSG_ANNCE, i);
- if not(e) { backtrace("Dump_Notifications(): Missing notification entity!\n"); return; }
-
+ if (!e) { backtrace("Dump_Notifications(): Missing notification entity!\n"); return; }
+
NOTIF_WRITE_ENTITY(
"Notification control cvar: 0 = disabled, 1 = enabled if gentle mode is off, 2 = always enabled)"
);
for(i = 1; i <= NOTIF_INFO_COUNT; ++i)
{
e = Get_Notif_Ent(MSG_INFO, i);
- if not(e) { backtrace("Dump_Notifications(): Missing notification entity!\n"); return; }
-
+ if (!e) { backtrace("Dump_Notifications(): Missing notification entity!\n"); return; }
+
NOTIF_WRITE_ENTITY(
"Notification control cvar: 0 = off, 1 = print to console, "
"2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
for(i = 1; i <= NOTIF_CENTER_COUNT; ++i)
{
e = Get_Notif_Ent(MSG_CENTER, i);
- if not(e) { backtrace("Dump_Notifications(): Missing notification entity!\n"); return; }
-
+ if (!e) { backtrace("Dump_Notifications(): Missing notification entity!\n"); return; }
+
NOTIF_WRITE_ENTITY(
"Notification control cvar: 0 = off, 1 = centerprint"
);
for(i = 1; i <= NOTIF_MULTI_COUNT; ++i)
{
e = Get_Notif_Ent(MSG_MULTI, i);
- if not(e) { backtrace("Dump_Notifications(): Missing notification entity!\n"); return; }
-
+ if (!e) { backtrace("Dump_Notifications(): Missing notification entity!\n"); return; }
+
NOTIF_WRITE_ENTITY(
"Notification control cvar: 0 = off, 1 = trigger subcalls"
);
for(i = 1; i <= NOTIF_CHOICE_COUNT; ++i)
{
e = Get_Notif_Ent(MSG_CHOICE, i);
- if not(e) { backtrace("Dump_Notifications(): Missing notification entity!\n"); return; }
-
+ if (!e) { backtrace("Dump_Notifications(): Missing notification entity!\n"); return; }
+
NOTIF_WRITE_ENTITY_CHOICE(
"Notification control cvar: 0 = off, 1 = trigger option A subcall, 2 = trigger option B subcall",
"Notification control cvar: 0 = off, 1 = allowed in warmup mode, 2 = always allowed"
// edit these to match whichever cvars are used for specific notification options
NOTIF_WRITE("\n// HARD CODED notification variables:\n");
-
+
NOTIF_WRITE_HARDCODED(
"allow_chatboxprint", "1",
"Allow notifications to be printed to chat box by setting notification cvar to 2 "
"(You can also set this cvar to 2 to force ALL notifications to be printed to the chatbox)"
);
-
+
NOTIF_WRITE_HARDCODED(
"debug", "0",
"Print extra debug information on all notification function calls "
"(Requires -DNOTIFICATIONS_DEBUG flag to be enabled on QCSRC compilation)... "
"0 = disabled, 1 = dprint, 2 = print"
);
-
+
NOTIF_WRITE_HARDCODED(
"errors_are_fatal", "1",
"If a notification fails upon initialization, cause a Host_Error to stop the program"
);
-
+
NOTIF_WRITE_HARDCODED(
"item_centerprinttime", "1.5",
"How long to show item information centerprint messages (like 'You got the Electro' or such)"
);
-
+
NOTIF_WRITE_HARDCODED(
"lifetime_mapload", "10",
"Amount of time that notification entities last immediately at mapload (in seconds) "
"to help prevent notifications from being lost on early init (like gamestart countdown)"
);
-
+
NOTIF_WRITE_HARDCODED(
"lifetime_runtime", "0.5",
"Amount of time that notification entities last on the server during runtime (In seconds)"
);
-
+
NOTIF_WRITE_HARDCODED(
"server_allows_location", "1",
"Server side cvar for allowing death messages to show location information too"
);
-
+
NOTIF_WRITE_HARDCODED(
"show_location", "0",
"Append location information to MSG_INFO death/kill messages"
);
-
+
NOTIF_WRITE_HARDCODED(
"show_location_string", "",
"Replacement string piped into sprintf, "
"so you can do different messages like this: ' at the %s' or ' (near %s)'"
);
-
+
NOTIF_WRITE_HARDCODED(
"show_sprees", "1",
"Print information about sprees in death/kill messages"
);
-
+
NOTIF_WRITE_HARDCODED(
"show_sprees_center", "1",
"Show spree information in MSG_CENTER messages... "
"0 = off, 1 = target (but only for first victim) and attacker"
);
-
+
NOTIF_WRITE_HARDCODED(
"show_sprees_center_specialonly", "1",
"Don't show spree information in MSG_CENTER messages if it isn't an achievement"
);
-
+
NOTIF_WRITE_HARDCODED(
"show_sprees_info", "3",
"Show spree information in MSG_INFO messages... "
"0 = off, 1 = target only, 2 = attacker only, 3 = target and attacker"
);
-
+
NOTIF_WRITE_HARDCODED(
"show_sprees_info_newline", "1",
"Show attacker spree information for MSG_INFO messages on a separate line than the death notification itself"
);
-
+
NOTIF_WRITE_HARDCODED(
"show_sprees_info_specialonly", "1",
"Don't show attacker spree information in MSG_INFO messages if it isn't an achievement"
NOTIF_MULTI_COUNT,
NOTIF_CHOICE_COUNT
));
-
+
return;
#undef NOTIF_WRITE_HARDCODED
#undef NOTIF_WRITE_ENTITY
#endif
string Local_Notification_sprintf(
- string input, string args,
+ string input, string args,
string s1, string s2, string s3, string s4,
float f1, float f2, float f3, float f4)
{
sprintf("%d, %d, %d, %d", f1, f2, f3, f4)
));
#endif
-
+
string selected;
float sel_num;
for(sel_num = 0; sel_num < NOTIF_MAX_ARGS; ++sel_num) { arg_slot[sel_num] = ""; }
soundposition
));
#endif
-
+
sound(
world,
soundchannel,
soundvolume,
soundposition
);
-
+
if(prev_soundfile) { strunzone(prev_soundfile); }
prev_soundfile = strzone(soundfile);
prev_soundtime = time;
#endif
return;
}
-
+
// check supplied type and name for errors
string checkargs = Notification_CheckArgs_TypeName(net_type, net_name);
if(checkargs != "")
// retreive entity of this notification
entity notif = Get_Notif_Ent(net_type, net_name);
- if not(notif)
+ if (!notif)
{
#ifdef NOTIFICATIONS_DEBUG
Debug_Notification(sprintf(
}
// check if the notification is enabled
- if not(notif.nent_enabled)
+ if (!notif.nent_enabled)
{
#ifdef NOTIFICATIONS_DEBUG
Debug_Notification(sprintf(
sprintf("%d, %d, %d, %d", f1, f2, f3, f4)
));
#endif
-
+
if((notif.nent_stringcount + notif.nent_floatcount) > count)
{
backtrace(sprintf(
strcat(
"Not enough arguments for Local_Notification(%s, %s, ...)! ",
- "stringcount(%d) + floatcount(%d) > count(%d)\n",
+ "stringcount(%d) + floatcount(%d) > count(%d)\n",
"Check the definition and function call for accuracy...?\n"
),
Get_Notif_TypeName(net_type),
));
return;
}
-
+
switch(net_type)
{
case MSG_ANNCE:
#endif
break;
}
-
+
case MSG_INFO:
{
print(
Local_Notification_sprintf(
notif.nent_string,
- notif.nent_args,
+ notif.nent_args,
s1, s2, s3, s4,
f1, f2, f3, f4)
);
- #ifdef CSQC
+ #ifdef CSQC
if(notif.nent_icon != "")
{
Local_Notification_HUD_Notify_Push(
notif.nent_icon,
notif.nent_hudargs,
s1, s2, s3, s4);
- }
- #endif
+ }
+ #endif
break;
}
-
+
#ifdef CSQC
case MSG_CENTER:
{
Local_Notification_centerprint_generic(
Local_Notification_sprintf(
notif.nent_string,
- notif.nent_args,
+ notif.nent_args,
s1, s2, s3, s4,
f1, f2, f3, f4),
notif.nent_durcnt,
break;
}
#endif
-
+
case MSG_MULTI:
{
if(notif.nent_msginfo)
{
Local_Notification_WOVA(
MSG_INFO,
- notif.nent_msginfo.nent_id,
- notif.nent_msginfo.nent_stringcount,
- notif.nent_msginfo.nent_floatcount,
+ notif.nent_msginfo.nent_id,
+ notif.nent_msginfo.nent_stringcount,
+ notif.nent_msginfo.nent_floatcount,
s1, s2, s3, s4,
f1, f2, f3, f4);
}
{
Local_Notification_WOVA(
MSG_ANNCE,
- notif.nent_msgannce.nent_id,
- 0, 0,
+ notif.nent_msgannce.nent_id,
+ 0, 0,
"", "", "", "",
0, 0, 0, 0);
}
{
Local_Notification_WOVA(
MSG_CENTER,
- notif.nent_msgcenter.nent_id,
- notif.nent_msgcenter.nent_stringcount,
- notif.nent_msgcenter.nent_floatcount,
+ notif.nent_msgcenter.nent_id,
+ notif.nent_msgcenter.nent_stringcount,
+ notif.nent_msgcenter.nent_floatcount,
s1, s2, s3, s4,
- f1, f2, f3, f4);
+ f1, f2, f3, f4);
}
#endif
break;
case MSG_CHOICE:
{
entity found_choice;
-
+
if(notif.nent_challow_var && (warmup_stage || (notif.nent_challow_var == 2)))
{
switch(cvar_string(sprintf("notification_%s", notif.nent_name)))
}
}
else { found_choice = notif.nent_optiona; }
-
+
Local_Notification_WOVA(
found_choice.nent_type,
- found_choice.nent_id,
- found_choice.nent_stringcount,
- found_choice.nent_floatcount,
+ found_choice.nent_id,
+ found_choice.nent_stringcount,
+ found_choice.nent_floatcount,
s1, s2, s3, s4,
- f1, f2, f3, f4);
+ f1, f2, f3, f4);
}
}
}
-// WOVA = Without Variable Arguments
+// WOVA = Without Variable Arguments
void Local_Notification_WOVA(
float net_type, float net_name,
float stringcount, float floatcount,
net_name
));
#endif
-
+
if(is_new)
{
if(net_name == 0) { reset_centerprint_messages(); }
is_new,
time
));
- }
+ }
}
}
else
{
notif = Get_Notif_Ent(net_type, net_name);
- if not(notif) { backtrace("Read_Notification: Could not find notification entity!\n"); return; }
+ if (!notif) { backtrace("Read_Notification: Could not find notification entity!\n"); return; }
#ifdef NOTIFICATIONS_DEBUG
Debug_Notification(sprintf(
float f2 = ((1 < notif.nent_floatcount) ? ReadLong() : 0);
float f3 = ((2 < notif.nent_floatcount) ? ReadLong() : 0);
float f4 = ((3 < notif.nent_floatcount) ? ReadLong() : 0);
-
+
if(is_new)
{
Local_Notification_WOVA(
#ifdef SVQC
void Net_Notification_Remove()
{
- if not(self) { backtrace(sprintf("Net_Notification_Remove() at %f: Missing self!?\n", time)); return; }
-
+ if (!self) { backtrace(sprintf("Net_Notification_Remove() at %f: Missing self!?\n", time)); return; }
+
#ifdef NOTIFICATIONS_DEBUG
Debug_Notification(sprintf(
"Net_Notification_Remove() at %f: %s '%s - %s' notification\n",
self.owner.nent_name
));
#endif
-
+
float i;
for(i = 0; i < 4; ++i) { if(self.nent_strings[i]) { strunzone(self.nent_strings[i]); } }
remove(self);
WriteByte(MSG_ENTITY, ENT_CLIENT_NOTIFICATION);
WriteByte(MSG_ENTITY, self.nent_net_type);
WriteShort(MSG_ENTITY, self.nent_net_name);
- for(i = 0; i < self.nent_stringcount; ++i) { WriteString(MSG_ENTITY, self.nent_strings[i]); }
+ for(i = 0; i < self.nent_stringcount; ++i) { WriteString(MSG_ENTITY, self.nent_strings[i]); }
for(i = 0; i < self.nent_floatcount; ++i) { WriteLong(MSG_ENTITY, self.nent_floats[i]); }
return TRUE;
}
net_name
));
#endif
-
+
string checkargs = Notification_CheckArgs(broadcast, client, 1, 1);
if(checkargs != "") { backtrace(sprintf("Incorrect usage of Kill_Notification: %s\n", checkargs)); return; }
entity notif, net_notif;
float killed_cpid = NO_CPID;
-
+
switch(net_type)
{
case 0:
killed_cpid = 0; // kill ALL centerprints
break;
}
-
+
case MSG_CENTER:
{
if(net_name)
{
entity notif = Get_Notif_Ent(net_type, net_name);
- if not(notif) { backtrace("Kill_Notification: Could not find notification entity!\n"); return; }
-
+ if (!notif) { backtrace("Kill_Notification: Could not find notification entity!\n"); return; }
+
if(notif.nent_cpid)
killed_cpid = notif.nent_cpid;
else
#endif
return;
}
-
+
// check supplied broadcast, target, type, and name for errors
string checkargs = Notification_CheckArgs(broadcast, client, net_type, net_name);
if(checkargs != "")
// retreive entity of this notification
entity notif = Get_Notif_Ent(net_type, net_name);
- if not(notif)
+ if (!notif)
{
#ifdef NOTIFICATIONS_DEBUG
Debug_Notification(sprintf(
backtrace(sprintf(
strcat(
"Not enough arguments for Send_Notification(%s, ...)! ",
- "stringcount(%d) + floatcount(%d) > count(%d)\n",
+ "stringcount(%d) + floatcount(%d) > count(%d)\n",
"Check the definition and function call for accuracy...?\n"
),
sprintf(
// It's slow, but it's better than the alternatives:
// 1. Constantly networking all info and letting client decide
// 2. Manually handling each separate call on per-usage basis (See old CTF usage of verbose)
- entity found_choice;
+ entity found_choice;
#define RECURSE_FROM_CHOICE(ent,action) \
if(notif.nent_challow_var && (warmup_stage || (notif.nent_challow_var == 2))) \
net_notif.nent_net_name = net_name;
net_notif.nent_stringcount = notif.nent_stringcount;
net_notif.nent_floatcount = notif.nent_floatcount;
-
+
float i;
for(i = 0; i < net_notif.nent_stringcount; ++i)
{ net_notif.nent_strings[i] = strzone(...(i, string)); }
(time + autocvar_notification_lifetime_runtime)
:
autocvar_notification_lifetime_mapload
- );
+ );
Net_LinkEntity(net_notif, FALSE, 0, Net_Write_Notification);
}
}
-// WOVA = Without Variable Arguments
+// WOVA = Without Variable Arguments
void Send_Notification_WOVA(
float broadcast, entity client,
float net_type, float net_name,
sprintf("%d, %d, %d, %d", f1, f2, f3, f4)
));
#endif
-
+
#define VARITEM(stringc,floatc,args) \
if((stringcount == stringc) && (floatcount == floatc)) \
{ Send_Notification(broadcast, client, net_type, net_name, args); return; }
Send_Notification(broadcast, client, net_type, net_name); // some notifications don't have any arguments at all
}
-// WOCOVA = Without Counts Or Variable Arguments
+// WOCOVA = Without Counts Or Variable Arguments
void Send_Notification_WOCOVA(
float broadcast, entity client,
float net_type, float net_name,
float f1, float f2, float f3, float f4)
{
entity notif = Get_Notif_Ent(net_type, net_name);
-
+
#ifdef NOTIFICATIONS_DEBUG
Debug_Notification(sprintf(
"Send_Notification_WOCOVA(%s, %s, %s);\n",
sprintf("%d, %d, %d, %d", f1, f2, f3, f4)
));
#endif
-
+
#define VARITEM(stringc,floatc,args) \
if((notif.nent_stringcount == stringc) && (notif.nent_floatcount == floatc)) \
{ Send_Notification(broadcast, client, net_type, net_name, args); return; }
// main types/groups of notifications
#define MSG_ANNCE 1 // "Global" AND "personal" announcer messages
-#define MSG_INFO 2 // "Global" information messages
+#define MSG_INFO 2 // "Global" information messages
#define MSG_CENTER 3 // "Personal" centerprint messages
#define MSG_CENTER_CPID 4 // Kill centerprint message
#define MSG_MULTI 5 // Subcall MSG_INFO and/or MSG_CENTER notifications
float strnum,
float flnum,
/* MSG_ANNCE */
- float channel,
+ float channel,
string snd,
float vol,
float position,
Check out the definitions in util.qc/util.qh/teams.qh for string CCR(...) and
string TCR(...) to better understand how these code replacements work.
-
+
Additionally, you can find all the definitions and explanations for
the argument values and what they return down below in this file.
MSG_ANNCE_NOTIF(default, prefix##YELLOW, channel, sprintf(sound, strtolower(STATIC_NAME_TEAM_3)), volume, position) \
MSG_ANNCE_NOTIF(default, prefix##PINK, channel, sprintf(sound, strtolower(STATIC_NAME_TEAM_4)), volume, position)
#define MULTITEAM_ANNCE(default,prefix,teams,channel,sound,volume,position) \
- MSG_ANNCE_NOTIF_##teams(default,prefix,channel,sound,volume,position) \
+ MULTITEAM_ANNCE##teams(default,prefix,channel,sound,volume,position)
#define MSG_ANNCE_NOTIFICATIONS \
MSG_ANNCE_NOTIF(1, ANNCE_ACHIEVEMENT_AIRSHOT, CH_INFO, "airshot", VOL_BASEVOICE, ATTEN_NONE) \
MSG_INFO_NOTIF(1, INFO_WEAPON_TUBA_MURDER, 3, 2, "spree_inf s1 s2 s3loc spree_end", "s2 s1", "weapontuba", _("^BG%s%s^K1 died of ^BG%s^K1's great playing on the @!#%%'n Tuba%s%s"), "") \
MSG_INFO_NOTIF(1, INFO_WEAPON_TUBA_SUICIDE, 2, 1, "s1 s2loc spree_lost", "s1", "weapontuba", _("^BG%s^K1 hurt their own ears with the @!#%%'n Tuba%s%s"), "") \
MSG_INFO_NOTIF(1, INFO_WEAPON_UZI_MURDER_SNIPE, 3, 2, "spree_inf s1 s2 s3loc spree_end", "s2 s1", "weaponuzi", _("^BG%s%s^K1 was sniped by ^BG%s^K1's Machine Gun%s%s"), "") \
- MSG_INFO_NOTIF(1, INFO_WEAPON_UZI_MURDER_SPRAY, 3, 2, "spree_inf s1 s2 s3loc spree_end", "s2 s1", "weaponuzi", _("^BG%s%s^K1 was riddled full of holes by ^BG%s^K1's Machine Gun%s%s"), "")
+ MSG_INFO_NOTIF(1, INFO_WEAPON_UZI_MURDER_SPRAY, 3, 2, "spree_inf s1 s2 s3loc spree_end", "s2 s1", "weaponuzi", _("^BG%s%s^K1 was riddled full of holes by ^BG%s^K1's Machine Gun%s%s"), "")
#define MULTITEAM_CENTER2(default,prefix,strnum,flnum,args,cpid,durcnt,normal,gentle) \
MSG_CENTER_NOTIF(default, prefix##RED, strnum, flnum, args, cpid, durcnt, TCR(normal, COL_TEAM_1, strtoupper(NAME_TEAM_1)), TCR(gentle, COL_TEAM_1, strtoupper(NAME_TEAM_1))) \
// 0 = no, 1 = yes, 2 = forced on for all MSG_INFO notifs
// DISABLED IN CODE, BUT ENABLED IN CONFIG FOR COMPATIBILITY WITH OLD CLIENTS
-var float autocvar_notification_allow_chatboxprint = 0;
+var float autocvar_notification_allow_chatboxprint = 0;
var float autocvar_notification_show_sprees_center = TRUE;
var float autocvar_notification_show_sprees_center_specialonly = TRUE;
allows for more dynamic data to be inferred by the local
notification parser, so that the server does not have to network
anything too crazy on a per-client/per-situation basis.
-
+
Pay attention to the CSQC/SVQC relations, some of these are redefined
in slightly different ways for different programs, this is because the
server does a more conservative approach to the notifs than the client.
-
+
All arguments are swapped into strings, so be sure that your
sprintf usage matches with proper %s placement.
-
+
Argument descriptions:
s1-s4: string arguments to be literally swapped into sprintf
s2loc: s2 string of locations of deaths or other events
string notif_arg_frag_stats(float fhealth, float farmor, float fping)
{
- if not(fhealth < 1)
+ if (!(fhealth < 1))
return sprintf(CCR(_("\n(Health ^1%d^BG / Armor ^2%d^BG)%s")), fhealth, farmor, notif_arg_frag_ping(FALSE, fping));
else
return sprintf(CCR(_("\n(^F4Dead^BG)%s")), notif_arg_frag_ping(FALSE, fping));
string notif_arg_spree_cen(float spree)
{
// 0 = off, 1 = target (but only for first victim) and attacker
- if(autocvar_notification_show_sprees_center)
+ if(autocvar_notification_show_sprees_center)
{
if(spree > 1)
{
#define SPREE_ITEM(counta,countb,center,normal,gentle) \
case counta: { return normal_or_gentle(center, sprintf(_("%d score spree! "), spree)); }
-
+
switch(spree)
{
KILL_SPREE_LIST
default:
{
- if not(autocvar_notification_show_sprees_center_specialonly)
+ if (!autocvar_notification_show_sprees_center_specialonly)
{
return
sprintf(
),
spree);
}
- else { return ""; } // don't show spree information if it isn't an achievement
+ else { return ""; } // don't show spree information if it isn't an achievement
}
}
{
// 0 = off, 1 = target only, 2 = attacker only, 3 = target and attacker
// this conditional (& 2) is true for 2 and 3
- if(autocvar_notification_show_sprees_info & 2)
+ if(autocvar_notification_show_sprees_info & 2)
{
#ifdef CSQC
string spree_newline =
string spree_newline =
(autocvar_notification_show_sprees_info_newline ? "\n" : "");
#endif
-
+
if(spree > 1)
{
#define SPREE_ITEM(counta,countb,center,normal,gentle) \
case counta: { return sprintf(CCR(normal_or_gentle(normal, gentle)), player, spree_newline); }
-
+
switch(spree)
{
KILL_SPREE_LIST
default:
{
- if not(autocvar_notification_show_sprees_info_specialonly)
+ if (!autocvar_notification_show_sprees_info_specialonly)
{
return
sprintf(
spree_newline
);
}
- else { return ""; } // don't show spree information if it isn't an achievement
+ else { return ""; } // don't show spree information if it isn't an achievement
}
}
#else
#define dedi ""
#endif
-
+
print(sprintf("Beginning notification initialization on %s%s program...\n", dedi, PROGNAME));
-
+
// maybe do another implementation of this with checksums? for now, we don't need versioning
/*if(autocvar_notification_version != NOTIF_VERSION)
{
case NUM_TEAM_3: return COL_TEAM_3;
case NUM_TEAM_4: return COL_TEAM_4;
}
-
+
return "^7";
}
case NUM_TEAM_3: return NAME_TEAM_3;
case NUM_TEAM_4: return NAME_TEAM_4;
}
-
+
return NAME_NEUTRAL;
}
case NUM_TEAM_3: return STATIC_NAME_TEAM_3;
case NUM_TEAM_4: return STATIC_NAME_TEAM_4;
}
-
+
return NAME_NEUTRAL;
}
case "pink": return NUM_TEAM_4;
case "auto": return 0;
}
-
+
return -1;
}
case 3: return NUM_TEAM_3;
case 4: return NUM_TEAM_4;
}
-
+
return -1;
}
case NUM_TEAM_3: return 3;
case NUM_TEAM_4: return 4;
}
-
+
return -1;
}
float dist_point_line(vector p, vector l0, vector ldir)
{
ldir = normalize(ldir);
-
+
// remove the component in line direction
p = p - (p * ldir) * ldir;
string fstrunzone(string s)
{
string sc;
- if not(s)
+ if (!s)
return s;
sc = strcat(s, "");
strunzone(s);
{
float fh, i, n;
fh = fopen(pFilename, FILE_WRITE);
- if(fh < 0)
+ if(fh < 0)
{
print(strcat("^1Can't write DB to ", pFilename));
return;
valstr = TIME_ENCODED_TOSTRING(pValue);
else
valstr = ftos(pValue);
-
+
return valstr;
}
neworder = strcat(neworder, ftos(w), " ");
}
}
-
+
return substring(neworder, 0, strlen(neworder) - 1);
}
neworder = "";
for(i = 0; i < n; ++i)
neworder = strcat(neworder, mapfunc(argv(i)), " ");
-
+
return substring(neworder, 0, strlen(neworder) - 1);
}
}
return substring(s, 0, strlen(s) - 1);
}
-
+
return order;
}
created_saved_value = 0;
- if not(tmp_cvar || tmp_value)
+ if (!(tmp_cvar || tmp_value))
{
dprint("Error: Invalid usage of cvar_settemp(string, string); !\n");
return 0;
hsv_y = 0;
else
hsv_y = 1 - mi/ma;
-
+
return hsv;
}
ma = max(rgb_x, rgb_y, rgb_z);
hsl_x = rgb_mi_ma_to_hue(rgb, mi, ma);
-
+
hsl_z = 0.5 * (mi + ma);
if(mi == ma)
hsl_y = 0;
hsl_y = (ma - mi) / (2*hsl_z);
else // if(hsl_z > 0.5)
hsl_y = (ma - mi) / (2 - 2*hsl_z);
-
+
return hsl;
}
maminusmi = hsl_y * 2 * hsl_z;
else
maminusmi = hsl_y * (2 - 2 * hsl_z);
-
+
// hsl_z = 0.5 * mi + 0.5 * ma
// maminusmi = - mi + ma
mi = hsl_z - 0.5 * maminusmi;
// terminate, as the range still halves each time - but nevertheless, it is
// guaranteed that it finds ONE valid cutoff place (where "left" is in
// range, and "right" is outside).
-
+
// terencehill: the following code detects truncated ^xrgb tags (e.g. ^x or ^x4)
// and decrease left on the basis of the chars detected of the truncated tag
// Even if the ^xrgb tag is not complete/correct, left is decreased
}
}
}
-
+
return left;
}
// terminate, as the range still halves each time - but nevertheless, it is
// guaranteed that it finds ONE valid cutoff place (where "left" is in
// range, and "right" is outside).
-
+
// terencehill: the following code detects truncated ^xrgb tags (e.g. ^x or ^x4)
// and decrease left on the basis of the chars detected of the truncated tag
// Even if the ^xrgb tag is not complete/correct, left is decreased
}
}
}
-
+
return left;
}
string s;
s = getWrappedLine_remaining;
-
+
if(w <= 0)
{
getWrappedLine_remaining = string_null;
string s;
s = getWrappedLine_remaining;
-
+
if(w <= 0)
{
getWrappedLine_remaining = string_null;
if(strstrofs(strcat(",", pattern, ","), subpattern2, 0) < 0)
if(strstrofs(strcat(",", pattern, ","), subpattern3, 0) < 0)
{
- if not(subpattern4)
+ if (!subpattern4)
return 0;
if(strstrofs(strcat(",", pattern, ","), subpattern4, 0) < 0)
return 0;
error("fteqcc bug introduced with revision 3178 detected. Please upgrade fteqcc to a later revision, downgrade fteqcc to revision 3177, or pester Spike until he fixes it. You can set _allow_unacceptable_compiler_bugs 1 to skip this check, but expect stuff to be horribly broken then.");
string s = "";
- if not(s)
+ if (!s)
error("The empty string counts as false. We do not want that!");
}
}
get_model_parameters_fixbone = 0;
- if not(m)
+ if (!m)
return 1;
if(substring(m, -9, 5) == "_lod1" || substring(m, -9, 5) == "_lod2")
case "true":
case "on":
return TRUE;
-
+
case "no":
case "false":
case "off":
return FALSE;
-
+
default: return stof(input);
}
}
/*
// if this is the case, the possible zeros of the first derivative are outside
// 0..1
- We can calculate this condition as condition
+ We can calculate this condition as condition
if(se <= 3)
return TRUE;
*/
// (3, [0..3])
// (3.5, [0.2..2.3])
// (4, 1)
+
+ /*
+ On another note:
+ inflection point is always at (2s + e - 3) / (3s + 3e - 6).
+
+ s + e - 2 == 0: no inflection
+
+ s + e > 2:
+ 0 < inflection < 1 if:
+ 0 < 2s + e - 3 < 3s + 3e - 6
+ 2s + e > 3 and 2e + s > 3
+
+ s + e < 2:
+ 0 < inflection < 1 if:
+ 0 > 2s + e - 3 > 3s + 3e - 6
+ 2s + e < 3 and 2e + s < 3
+
+ Therefore: there is an inflection point iff:
+ e outside (3 - s)/2 .. 3 - s*2
+
+ in other words, if (s,e) in triangle (1,1)(0,3)(0,1.5) or in triangle (1,1)(3,0)(1.5,0)
+ */
}
.float FindConnectedComponent_processing;
string CCR(string input)
{
// See the autocvar declarations in util.qh for default values
-
+
// foreground/normal colors
- input = strreplace("^F1", strcat("^", autocvar_hud_colorset_foreground_1), input);
- input = strreplace("^F2", strcat("^", autocvar_hud_colorset_foreground_2), input);
- input = strreplace("^F3", strcat("^", autocvar_hud_colorset_foreground_3), input);
- input = strreplace("^F4", strcat("^", autocvar_hud_colorset_foreground_4), input);
+ input = strreplace("^F1", strcat("^", autocvar_hud_colorset_foreground_1), input);
+ input = strreplace("^F2", strcat("^", autocvar_hud_colorset_foreground_2), input);
+ input = strreplace("^F3", strcat("^", autocvar_hud_colorset_foreground_3), input);
+ input = strreplace("^F4", strcat("^", autocvar_hud_colorset_foreground_4), input);
// "kill" colors
input = strreplace("^K1", strcat("^", autocvar_hud_colorset_kill_1), input);
switch(num)
{
case 10: return ANNCE_NUM_GAMESTART_10;
- case 9: return ANNCE_NUM_GAMESTART_9;
- case 8: return ANNCE_NUM_GAMESTART_8;
- case 7: return ANNCE_NUM_GAMESTART_7;
- case 6: return ANNCE_NUM_GAMESTART_6;
- case 5: return ANNCE_NUM_GAMESTART_5;
- case 4: return ANNCE_NUM_GAMESTART_4;
- case 3: return ANNCE_NUM_GAMESTART_3;
- case 2: return ANNCE_NUM_GAMESTART_2;
- case 1: return ANNCE_NUM_GAMESTART_1;
+ case 9: return ANNCE_NUM_GAMESTART_9;
+ case 8: return ANNCE_NUM_GAMESTART_8;
+ case 7: return ANNCE_NUM_GAMESTART_7;
+ case 6: return ANNCE_NUM_GAMESTART_6;
+ case 5: return ANNCE_NUM_GAMESTART_5;
+ case 4: return ANNCE_NUM_GAMESTART_4;
+ case 3: return ANNCE_NUM_GAMESTART_3;
+ case 2: return ANNCE_NUM_GAMESTART_2;
+ case 1: return ANNCE_NUM_GAMESTART_1;
}
break;
}
switch(num)
{
case 10: return ANNCE_NUM_IDLE_10;
- case 9: return ANNCE_NUM_IDLE_9;
- case 8: return ANNCE_NUM_IDLE_8;
- case 7: return ANNCE_NUM_IDLE_7;
- case 6: return ANNCE_NUM_IDLE_6;
- case 5: return ANNCE_NUM_IDLE_5;
- case 4: return ANNCE_NUM_IDLE_4;
- case 3: return ANNCE_NUM_IDLE_3;
- case 2: return ANNCE_NUM_IDLE_2;
- case 1: return ANNCE_NUM_IDLE_1;
+ case 9: return ANNCE_NUM_IDLE_9;
+ case 8: return ANNCE_NUM_IDLE_8;
+ case 7: return ANNCE_NUM_IDLE_7;
+ case 6: return ANNCE_NUM_IDLE_6;
+ case 5: return ANNCE_NUM_IDLE_5;
+ case 4: return ANNCE_NUM_IDLE_4;
+ case 3: return ANNCE_NUM_IDLE_3;
+ case 2: return ANNCE_NUM_IDLE_2;
+ case 1: return ANNCE_NUM_IDLE_1;
}
break;
}
switch(num)
{
case 10: return ANNCE_NUM_KILL_10;
- case 9: return ANNCE_NUM_KILL_9;
- case 8: return ANNCE_NUM_KILL_8;
- case 7: return ANNCE_NUM_KILL_7;
- case 6: return ANNCE_NUM_KILL_6;
- case 5: return ANNCE_NUM_KILL_5;
- case 4: return ANNCE_NUM_KILL_4;
- case 3: return ANNCE_NUM_KILL_3;
- case 2: return ANNCE_NUM_KILL_2;
- case 1: return ANNCE_NUM_KILL_1;
+ case 9: return ANNCE_NUM_KILL_9;
+ case 8: return ANNCE_NUM_KILL_8;
+ case 7: return ANNCE_NUM_KILL_7;
+ case 6: return ANNCE_NUM_KILL_6;
+ case 5: return ANNCE_NUM_KILL_5;
+ case 4: return ANNCE_NUM_KILL_4;
+ case 3: return ANNCE_NUM_KILL_3;
+ case 2: return ANNCE_NUM_KILL_2;
+ case 1: return ANNCE_NUM_KILL_1;
}
break;
}
switch(num)
{
case 10: return ANNCE_NUM_RESPAWN_10;
- case 9: return ANNCE_NUM_RESPAWN_9;
- case 8: return ANNCE_NUM_RESPAWN_8;
- case 7: return ANNCE_NUM_RESPAWN_7;
- case 6: return ANNCE_NUM_RESPAWN_6;
- case 5: return ANNCE_NUM_RESPAWN_5;
- case 4: return ANNCE_NUM_RESPAWN_4;
- case 3: return ANNCE_NUM_RESPAWN_3;
- case 2: return ANNCE_NUM_RESPAWN_2;
- case 1: return ANNCE_NUM_RESPAWN_1;
+ case 9: return ANNCE_NUM_RESPAWN_9;
+ case 8: return ANNCE_NUM_RESPAWN_8;
+ case 7: return ANNCE_NUM_RESPAWN_7;
+ case 6: return ANNCE_NUM_RESPAWN_6;
+ case 5: return ANNCE_NUM_RESPAWN_5;
+ case 4: return ANNCE_NUM_RESPAWN_4;
+ case 3: return ANNCE_NUM_RESPAWN_3;
+ case 2: return ANNCE_NUM_RESPAWN_2;
+ case 1: return ANNCE_NUM_RESPAWN_1;
}
break;
}
switch(num)
{
case 10: return ANNCE_NUM_ROUNDSTART_10;
- case 9: return ANNCE_NUM_ROUNDSTART_9;
- case 8: return ANNCE_NUM_ROUNDSTART_8;
- case 7: return ANNCE_NUM_ROUNDSTART_7;
- case 6: return ANNCE_NUM_ROUNDSTART_6;
- case 5: return ANNCE_NUM_ROUNDSTART_5;
- case 4: return ANNCE_NUM_ROUNDSTART_4;
- case 3: return ANNCE_NUM_ROUNDSTART_3;
- case 2: return ANNCE_NUM_ROUNDSTART_2;
- case 1: return ANNCE_NUM_ROUNDSTART_1;
+ case 9: return ANNCE_NUM_ROUNDSTART_9;
+ case 8: return ANNCE_NUM_ROUNDSTART_8;
+ case 7: return ANNCE_NUM_ROUNDSTART_7;
+ case 6: return ANNCE_NUM_ROUNDSTART_6;
+ case 5: return ANNCE_NUM_ROUNDSTART_5;
+ case 4: return ANNCE_NUM_ROUNDSTART_4;
+ case 3: return ANNCE_NUM_ROUNDSTART_3;
+ case 2: return ANNCE_NUM_ROUNDSTART_2;
+ case 1: return ANNCE_NUM_ROUNDSTART_1;
}
break;
}
switch(num)
{
case 10: return ANNCE_NUM_10;
- case 9: return ANNCE_NUM_9;
- case 8: return ANNCE_NUM_8;
- case 7: return ANNCE_NUM_7;
- case 6: return ANNCE_NUM_6;
- case 5: return ANNCE_NUM_5;
- case 4: return ANNCE_NUM_4;
- case 3: return ANNCE_NUM_3;
- case 2: return ANNCE_NUM_2;
- case 1: return ANNCE_NUM_1;
+ case 9: return ANNCE_NUM_9;
+ case 8: return ANNCE_NUM_8;
+ case 7: return ANNCE_NUM_7;
+ case 6: return ANNCE_NUM_6;
+ case 5: return ANNCE_NUM_5;
+ case 4: return ANNCE_NUM_4;
+ case 3: return ANNCE_NUM_3;
+ case 2: return ANNCE_NUM_2;
+ case 1: return ANNCE_NUM_1;
}
break;
}
// a dummy macro that prevents the "hanging ;" warning
#define ENDS_WITH_CURLY_BRACE
+#ifdef GMQCC
+# define ACCUMULATE_FUNCTION(func,otherfunc) \
+ [[accumulate]] void func() { otherfunc(); }
+# define CALL_ACCUMULATED_FUNCTION(func) \
+ func()
+#else
#ifdef HAVE_YO_DAWG_CPP
// TODO make ascii art pic of xzibit
// YO DAWG!
# define CALL_ACCUMULATED_FUNCTION(func) \
ACCUMULATE_call(#func)
#endif
+#endif
// used for simplifying ACCUMULATE_FUNCTIONs
#define SET_FIRST_OR_LAST(input,first,count) if(!input) { input = (first + count); }
// modulo function
#ifndef MENUQC
-float mod(float a, float b) { return a - (floor(a / b) * b); }
+float mod(float a, float b) { return a - (floor(a / b) * b); }
#endif
#define TIME_TO_NTHS(t,n) floor((t) * (n) + 0.4)
self.iflags |= IFLAG_TELEPORTED;
self.csqcmodel_teleported = 1;
}
-
+
CSQCModel_InterpolateAnimation_Note(sf);
InterpolateOrigin_Note();
CSQCPlayer_PostUpdate();
const float VF_CL_VIEWANGLES = 33; //(vector)
const float VF_CL_VIEWANGLES_X = 34; //(float)
const float VF_CL_VIEWANGLES_Y = 35; //(float)
-const float VF_CL_VIEWANGLES_Z = 36; //(float)
+const float VF_CL_VIEWANGLES_Z = 36; //(float)
const float VF_PERSPECTIVE = 200;
const float TE_EXPLOSIONQUAD = 70;
const float TE_SPIKEQUAD = 58;
const float TE_SUPERSPIKEQUAD = 59;
-
+
// PFlags for Dynamic Lights
const float PFLAGS_NOSHADOW = 1;
const float PFLAGS_CORONA = 2;
string(float chars, string s, ...) strpad = #225;
string(string info, string key, string value, ...) infoadd = #226;
string(string info, string key) infoget = #227;
+float(string s1, string s2) strcmp = #228;
float(string s1, string s2, float len) strncmp = #228;
float(string s1, string s2) strcasecmp = #229;
float(string s1, string s2, float len) strncasecmp = #230;
float particle_type; // one of PT_
float particle_blendmode; // one of PBLEND_ values
float particle_orientation; // one of PARTICLE_ values
-vector particle_color1;
+vector particle_color1;
vector particle_color2;
float particle_tex; // number of chunk in particlefont
float particle_size;
-float particle_sizeincrease;
+float particle_sizeincrease;
float particle_alpha;
float particle_alphafade;
float particle_time;
float(vector org, vector vel, float theme) quickparticle = #527; // not reading globals, just theme, returns 0 when failed, 1 when spawned
float(vector org, vector vel, float delay, float collisiondelay) delayedparticle = #528;
float(vector org, vector vel, float delay, float collisiondelay, float theme) quickdelayedparticle = #528;
-// description: this builtin provides an easy and flexible way to spawn particles,
-// it is not created as replace for DP_SV_POINTPARTICLES but as an addition to it.
+// description: this builtin provides an easy and flexible way to spawn particles,
+// it is not created as replace for DP_SV_POINTPARTICLES but as an addition to it.
// With this extension you can create a specific particles like rain particles, or entity particles
-// notes:
+// notes:
// 1) 0 is default particle template, it could be changed
// 2) color vectors could have value 0-255 of each component
// restrictions: max themes could be between 4 and 2048
//darkplaces implementation: Blub\0
//console commands:
// loadfont fontname fontmaps size1 size2 ...
-// A font can simply be gfx/tgafile (freetype fonts doent need extension),
+// A font can simply be gfx/tgafile (freetype fonts doent need extension),
// or alternatively you can specify multiple fonts and faces
// Like this: gfx/vera-sans:2,gfx/fallback:1
// to load face 2 of the font gfx/vera-sans and use face 1
float FONT_USER7 = 15; // 'user7' slot, userdefined fonts
//builtin definitions:
float findfont(string s) = #356; // find font by fontname and return it's index
-float loadfont(string fontname, string fontmaps, string sizes, float slot, float fix_scale, float fix_voffset) = #357;
+float loadfont(string fontname, string fontmaps, string sizes, float slot, float fix_scale, float fix_voffset) = #357;
// loads font immediately so stringwidth() function can be used just after builtin call
// returns a font slotnum (which is used to set drawfont to)
// first 3 parms are identical to "loadfont" console command ones
// r_font_postprocess_shadow_y X : font outline shadow y shift amount, applied during outlining
// r_font_postprocess_shadow_z X : font outline shadow z shift amount, applied during blurring
//description: engine support for truetype/freetype fonts
-//so .AFM+.PFB/.OTF/.TTF files could be stuffed as fontmaps in loadfont()
+//so .AFM+.PFB/.OTF/.TTF files could be stuffed as fontmaps in loadfont()
//(console command version will support them as well)
//DP_CSQC_BINDMAPS
//constant definitions:
const float VF_MAINVIEW = 400;
//use setproperty(VF_MAINVIEW, 1); before calling R_RenderView for the render
-//that shall become the "main" view, which is e.g. used by PRYDON_CLIENTCURSOR
+//that shall become the "main" view, which is e.g. used by PRYDON_CLIENTCURSOR
//this flag is set for the first scene, and not cleared by R_ClearScene
//this flag is automatically cleared by R_RenderView
//so when not using this extension, the first view rendered is the main view
//darkplaces implementation: Blub\0
//cvar definitions:
// utf8_enable: enable utf8 encoding
-//description: utf8 characters are allowed inside cvars, protocol strings, files, progs strings, etc.,
+//description: utf8 characters are allowed inside cvars, protocol strings, files, progs strings, etc.,
//and count as 1 char for string functions like strlen, substring, etc.
// note: utf8_enable is run-time cvar, could be changed during execution
// note: beware that str2chr() could return value bigger than 255 once utf8 is enabled
// description: allows alternative 'static' lightstyle syntax : "=value"
// examples: "=0.5", "=2.0", "=2.75"
// could be used to control switchable lights or making styled lights with brightness > 2
-// Warning: this extension is experimental. It safely works in CSQC, but SVQC use is limited by the fact
+// Warning: this extension is experimental. It safely works in CSQC, but SVQC use is limited by the fact
// that other engines (which do not support this extension) could connect to a game and misunderstand this kind of lightstyle syntax
//DP_LITSPRITES
//syntax of .dpsubs files: each line in .dpsubs file defines 1 subtitle, there are three tokens:
// <start> <end> "string"
// start: subtitle start time in seconds
-// end: subtitle time-to-show in seconds, if 0 - subtitle will be showed until next subtitle is started,
+// end: subtitle time-to-show in seconds, if 0 - subtitle will be showed until next subtitle is started,
// if below 0 - show until next subtitles minus this number of seconds
// text: subtitle text, color codes (Q3-style and ^xRGB) are allowed
//example of subtitle file:
// 3 0 "Vengeance! Vengeance for my eternity of suffering!"
// 9 0 "Whelp! As if you knew what eternity was!"
// 13 0 "Grovel before your true master."
-// 17 0 "Never!"
+// 17 0 "Never!"
// 18 7 "I'll hack you from crotch to gizzard and feed what's left of you to your brides..."
//DP_SOLIDCORPSE
.vector massofs; // offsets a mass center out of object center, if not set a center of model bounds is used
.float friction; // a friction of object, get multiplied by second objects's friction on contact
.float bouncefactor;
-.float bouncestop;
+.float bouncestop;
.float jointtype; // type of joint
.float forcetype; // type of force
-.float erp; // error restitution parameter, makes ODE solver attempt to fix errors in contacts,
- // bringing together 2 joints or fixing object being stuch in other object,
+.float erp; // error restitution parameter, makes ODE solver attempt to fix errors in contacts,
+ // bringing together 2 joints or fixing object being stuch in other object,
// a value of 0.1 will fix slightly, a value of 1.0 attempts to fix whole error in one frame
// use with care as high values makes system unstable and likely to explode
//builtin definitions:
string(float chars, string s, ...) strpad = #225; // pad string with spaces to a specified length, < 0 = left padding, > 0 = right padding
string(string info, string key, string value, ...) infoadd = #226; // sets or adds a key/value pair to an infostring - note: forbidden characters are \ and "
string(string info, string key) infoget = #227; // gets a key/value pair in an infostring, returns value or null if not found
+float(string s1, string s2) strcmp = #228; // compare two strings
float(string s1, string s2, float len) strncmp = #228; // compare two strings up to the specified number of characters, if their length differs and is within the specified limit the result will be negative, otherwise it is the difference in value of their first non-matching character.
float(string s1, string s2) strcasecmp = #229; // compare two strings with case-insensitive matching, characters a-z are considered equivalent to the matching A-Z character, no other differences, and this does not consider special characters equal even if they look similar
float(string s1, string s2, float len) strncasecmp = #230; // same as strcasecmp but with a length limit, see strncmp
float drawcolorcodedstring(vector position, string text, vector scale, float alpha, float flag) = #467;
vector drawcolorcodedstring2(vector position, string text, vector scale, vector rgb, float alpha, float flag) = #467;
-
+
float drawpic(vector position, string pic, vector size, vector rgb, float alpha, float flag) = #456;
float drawfill(vector position, vector size, vector rgb, float alpha, float flag) = #457;
string(float chars, string s, ...) strpad = #225;
string(string info, string key, string value, ...) infoadd = #226;
string(string info, string key) infoget = #227;
+float(string s1, string s2) strcmp = #228;
float(string s1, string s2, float len) strncmp = #228;
float(string s1, string s2) strcasecmp = #229;
float(string s1, string s2, float len) strncasecmp = #230;
return;
}
+ if(argv(0) == "update_conwidths_before_vid_restart")
+ {
+ updateConwidths(cvar("vid_width"), cvar("vid_height"), cvar("vid_pixelheight"));
+ return;
+ }
+
if(argv(0) == "directmenu" || argv(0) == "directpanelhudmenu")
{
string filter = string_null;
}
void draw_Text(vector theOrigin, string theText, vector theSize, vector theColor, float theAlpha, float ICanHasKallerz)
{
- if(theSize_x <= 0 || theSize_y <= 0)
- error("Drawing zero size text?\n");
+ if(theSize_x <= 0 || theSize_y <= 0) {
+ dprint("Drawing zero size text?\n");
+ return;
+ }
//float wi;
//wi = draw_TextWidth(theText, ICanHasKallerz, theSize);
me.mouseDrag(me, pos); // verify coordinates
if(me.pressed)
{
- if not(me.disabled)
+ if (!me.disabled)
{
if(cvar("menu_sounds"))
localsound("sound/misc/menu2.wav");
if(me.clickTime > 0 && me.clickTime <= frametime)
{
// keyboard click timer expired? Fire the event then.
- if not(me.disabled)
+ if (!me.disabled)
if(me.onClick)
me.onClick(me, me.onClickEntity);
}
void Container_hideNotify(entity me)
{
entity e;
- if not(me.shown)
+ if (!me.shown)
return;
me.shown = 0;
for(e = me.firstChild; e; e = e.nextSibling)
void Container_setFocus(entity me, entity other)
{
if(other)
- if not(me.focused)
+ if (!me.focused)
error("Trying to set focus in a non-focused control!");
if(me.focusedChild == other)
return;
n.prevSibling = p;
else
me.lastChild = p;
-
+
// now other got removed. Insert it behind dest now.
other.prevSibling = dest;
if(dest)
// - closable is 0
// - rootDialog is 0
// - title is ""
-// - marginTop is
+// - marginTop is
// - intendedHeight ends up to be the tab's actual height, or at least close
// - titleFontSize is 0
// - marginTop cancels out as much of titleHeight as needed (that is, it should be actualMarginTop - titleHeight)
me.frame.alpha = me.alpha;
me.addItem(me, me.frame, '0 0 0', '1 1 0', 1);
- if not(me.titleFontSize)
+ if (!me.titleFontSize)
me.titleHeight = 0; // no title bar
absWidth = me.intendedWidth * conwidth;
vector p;
vector theTempColor;
float component;
-
+
p = me.realOrigin - eX * me.scrollPos;
theColor = '1 1 1';
theAlpha = 1; //theVariableAlpha = 1; // changes when ^ax found
-
+
n = strlen(me.text);
for(i = 0; i < n; ++i)
{
else if(ch2 == "x") // ^x found
{
theColor = '1 1 1';
-
+
component = HEXDIGIT_TO_DEC(substring(me.text, i+2, 1));
if (component >= 0) // ^xr found
{
theTempColor_x = component/15;
-
+
component = HEXDIGIT_TO_DEC(substring(me.text, i+3, 1));
if (component >= 0) // ^xrg found
{
theTempColor_y = component/15;
-
+
component = HEXDIGIT_TO_DEC(substring(me.text, i+4, 1));
if (component >= 0) // ^xrgb found
{
theTempColor_z = component/15;
theColor = theTempColor;
w = draw_TextWidth(substring(me.text, i, 5), 0, me.realFontSize);
-
+
draw_Fill(p, eX * w + eY * me.realFontSize_y, '1 1 1', 0.5);
draw_Text(p, substring(me.text, i, 5), me.realFontSize, theColor, 1, 0); // theVariableAlpha instead of 1 using alpha tags ^ax
i += 3;
{
for(ff = f.prevSibling; ff; ff = ff.prevSibling)
{
- if not(ff.focusable)
+ if (!ff.focusable)
continue;
me.setFocus(me, ff);
return 1;
{
for(ff = me.lastChild; ff; ff = ff.prevSibling)
{
- if not(ff.focusable)
+ if (!ff.focusable)
continue;
me.setFocus(me, ff);
return 1;
{
for(ff = f.nextSibling; ff; ff = ff.nextSibling)
{
- if not(ff.focusable)
+ if (!ff.focusable)
continue;
me.setFocus(me, ff);
return 1;
{
for(ff = me.firstChild; ff; ff = ff.nextSibling)
{
- if not(ff.focusable)
+ if (!ff.focusable)
continue;
me.setFocus(me, ff);
return 1;
e = me.mouseFocusedChild;
ne = me.itemFromPoint(me, pos);
if(ne)
- if not(ne.focusable)
+ if (!ne.focusable)
ne = NULL;
me.mouseFocusedChild = ne;
if(ne)
float scale;
entity e, e2;
vector emins, emaxs, e2mins, e2maxs;
-
+
for(scale = 0.7;; scale *= 0.99)
{
Nexposee_Calc_Scale(me, scale);
}
else if(me.animationState == 2)
{
- if not(SUPER(Nexposee).mousePress(me, pos))
+ if (!(SUPER(Nexposee).mousePress(me, pos)))
{
me.animationState = 3;
SUPER(Nexposee).setFocus(me, NULL);
{
if(me.selectedChild)
me.selectedChild = me.selectedChild.prevSibling;
- if not(me.selectedChild)
+ if (!me.selectedChild)
me.selectedChild = me.lastChild;
}
else
{
if(me.selectedChild)
me.selectedChild = me.selectedChild.nextSibling;
- if not(me.selectedChild)
+ if (!me.selectedChild)
me.selectedChild = me.firstChild;
}
}
}
if(me.focusedChild)
me.selectedChild = me.focusedChild;
- if not(me.selectedChild)
+ if (!me.selectedChild)
me.animationState = 0;
SUPER(Nexposee).setFocus(me, NULL);
return 1;
ATTRIB(Tab, rootDialog, float, 0)
ATTRIB(Tab, title, string, string_null)
ATTRIB(Tab, titleFontSize, float, 0) // pixels
-
+
// still to be customized
ATTRIB(Tab, intendedWidth, float, 0)
ATTRIB(Tab, rows, float, 3)
{
float i;
for (i = me.nValues; i > pos; --i)
+ {
me.(valueStrings[i]) = me.(valueStrings[i-1]);
me.(valueIdentifiers[i]) = me.(valueIdentifiers[i-1]);
+ }
me.(valueStrings[pos]) = theString;
me.(valueIdentifiers[pos]) = theIdentifier;
me.nValues += 1;
float menuMouseMode;
float conwidth_s, conheight_s, vidwidth_s, vidheight_s, vidpixelheight_s,
- realconwidth, realconheight, screenconwidth, screenconheight;
+ realconwidth, realconheight;
void m_sync()
{
for(i = 0; ; ++i)
{
s = getgamedirinfo(i, GETGAMEDIRINFO_NAME);
- if not(s)
+ if (!s)
break;
dprint(s, ": ", getgamedirinfo(i, GETGAMEDIRINFO_DESCRIPTION));
}
}
const float MENU_ASPECT = 1.25; // 1280x1024
-const float MENU_MINHEIGHT = 600;
void draw_reset_cropped()
{
- draw_reset(screenconwidth, screenconheight, 0.5 * (realconwidth - screenconwidth), 0.5 * (realconheight - screenconheight));
+ draw_reset(conwidth, conheight, 0.5 * (realconwidth - conwidth), 0.5 * (realconheight - conheight));
}
void draw_reset_full()
{
{
if (w != vidwidth_s || h != vidheight_s || p != vidpixelheight_s)
{
- updateConwidths(w, h, p);
+ if (updateConwidths(w, h, p))
+ localcmd(sprintf("\nexec %s\n", cvar_string("menu_font_cfg")));
vidwidth_s = w;
vidheight_s = h;
vidpixelheight_s = p;
conwidth = realconwidth;
conheight = realconwidth / MENU_ASPECT;
}
- screenconwidth = conwidth;
- screenconheight = conheight;
- if(conwidth < MENU_MINHEIGHT * MENU_ASPECT)
- {
- conheight *= MENU_MINHEIGHT * MENU_ASPECT / conwidth;
- conwidth = MENU_MINHEIGHT * MENU_ASPECT;
- }
- if(conheight < MENU_MINHEIGHT)
- {
- conwidth *= MENU_MINHEIGHT / conheight;
- conheight = MENU_MINHEIGHT;
- }
if(main)
{
if(conwidth_s != conwidth || conheight_s != conheight)
v = pos + avoidplus;
if(m_testtooltipbox(v))
return TRUE;
-
+
// bottom center
v_x = pos_x - menuTooltipSize_x * 0.5;
if(m_testtooltipbox(v))
v_x = pos_x - menuTooltipSize_x * 0.5;
if(m_testtooltipbox(v))
return TRUE;
-
+
// top right
v_x = pos_x + avoidplus_x;
if(m_testtooltipbox(v))
return TRUE;
-
+
return FALSE;
}
entity m_findtooltipitem(entity root, vector pos)
for(e = NULL; (e = find(e, name, itemname)); )
if(e.classname != "vtbl")
break;
-
+
if((e) && (!e.requiresConnection || (gamestatus & (GAME_ISSERVER | GAME_CONNECTED))))
{
m_hide();
#endif
#define CLASS(cname) entity spawn##cname(); entity cname##_vtbl;
-#define EXTENDS(base)
+#define EXTENDS(base)
#define METHOD(cname,name,prototype) prototype cname##_##name; .prototype name;
#define ATTRIB(cname,name,type,val) .type name;
#define ATTRIBARRAY(cname,name,type,cnt) .type name[cnt];
../common/urllib.qc
../warpzonelib/mathlib.qc
-
-../common/if-this-file-errors-scroll-up-and-fix-the-warnings.fteqccfail
{
float m, d;
- if not(me.cvarName)
+ if (!me.cvarName)
return;
m = (me.yesValue + me.noValue) * 0.5;
}
void XonoticCheckBox_saveCvars(entity me)
{
- if not(me.cvarName)
+ if (!me.cvarName)
return;
if(me.checked)
if(theControlledSlider.value == median(theControlledSlider.valueMin, theControlledSlider.value, theControlledSlider.valueMax))
me.savedValue = theControlledSlider.value;
else
- me.savedValue = theControlledSlider.valueMin;
+ me.savedValue = theControlledSlider.valueMin;
me.controlledSlider = theControlledSlider;
me.configureCheckBox(me, theText, me.fontSize, me.image);
me.tooltip = theControlledSlider.tooltip;
}
void XonoticCheckBoxString_loadCvars(entity me)
{
- if not(me.cvarName)
+ if (!me.cvarName)
return;
if(cvar_string(me.cvarName) == me.yesString)
}
void XonoticCheckBoxString_saveCvars(entity me)
{
- if not(me.cvarName)
+ if (!me.cvarName)
return;
if(me.checked)
}
void XonoticColorButton_loadCvars(entity me)
{
- if not(me.cvarName)
+ if (!me.cvarName)
return;
if(cvar_string(me.cvarName) == cvar_defstring(me.cvarName))
}
void XonoticColorButton_saveCvars(entity me)
{
- if not(me.cvarName)
+ if (!me.cvarName)
return;
if(me.checked)
// for this to work, C/(1-B) must be in 0..1
// B must be < 1
// C must be < 1-B
-
+
B = bound(0, B, 1);
C = bound(0, C, 1-B);
void XonoticColorPickerString_loadCvars(entity me)
{
- if not(me.cvarName)
+ if (!me.cvarName)
return;
if(substring(me.cvarName, -1, 1) == "_")
void XonoticColorPickerString_saveCvars(entity me)
{
- if not(me.cvarName)
+ if (!me.cvarName)
return;
if(substring(me.cvarName, -1, 1) == "_")
}
void XonoticCrosshairButton_loadCvars(entity me)
{
- if not(me.cvarName)
+ if (!me.cvarName)
return;
me.checked = (cvar(me.cvarName) == me.cvarValueFloat);
}
void XonoticCrosshairButton_saveCvars(entity me)
{
- if not(me.cvarName)
+ if (!me.cvarName)
return;
if(me.checked)
{
if(cvar("crosshair_dot_color_custom") && (cvar_string("crosshair_dot_color") != "0"))
rgb = stov(cvar_string("crosshair_dot_color"));
-
+
draw_Picture('0.5 0.5 0' - 0.5 * sz * cvar("crosshair_dot_size"), me.src4, sz * cvar("crosshair_dot_size"), rgb, a * cvar("crosshair_dot_alpha"));
}
}
SUPER(XonoticCvarList).setSelected(me, i);
if(me.nItems == 0)
return;
-
+
if(me.cvarName)
strunzone(me.cvarName);
if(me.cvarDescription)
if(isSelected)
draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, SKINALPHA_LISTBOX_SELECTED);
-
+
k = bufstr_get(me.handle, i);
v = cvar_string(k);
METHOD(XonoticDemoList, resizeNotify, void(entity, vector, vector, vector, vector))
METHOD(XonoticDemoList, drawListBoxItem, void(entity, float, vector, float))
METHOD(XonoticDemoList, getDemos, void(entity))
- METHOD(XonoticDemoList, startDemo, void(entity))
+ METHOD(XonoticDemoList, startDemo, void(entity))
METHOD(XonoticDemoList, demoName, string(entity, float))
METHOD(XonoticDemoList, clickListBoxItem, void(entity, float, vector))
METHOD(XonoticDemoList, keyDown, float(entity, float, float, float))
METHOD(XonoticDemoList, destroy, void(entity))
METHOD(XonoticDemoList, showNotify, void(entity))
-
+
ATTRIB(XonoticDemoList, listDemo, float, -1)
ATTRIB(XonoticDemoList, realFontSize, vector, '0 0 0')
ATTRIB(XonoticDemoList, columnNameOrigin, float, 0)
ATTRIB(XonoticDemoList, realUpperMargin, float, 0)
ATTRIB(XonoticDemoList, origin, vector, '0 0 0')
ATTRIB(XonoticDemoList, itemAbsSize, vector, '0 0 0')
-
+
ATTRIB(XonoticDemoList, lastClickedDemo, float, -1)
ATTRIB(XonoticDemoList, lastClickedTime, float, 0)
- ATTRIB(XonoticDemoList, filterString, string, string_null)
+ ATTRIB(XonoticDemoList, filterString, string, string_null)
ENDCLASS(XonoticDemoList)
entity makeXonoticDemoList();
void XonoticDemoList_configureXonoticDemoList(entity me)
{
me.configureXonoticListBox(me);
- me.getDemos(me);
+ me.getDemos(me);
}
string XonoticDemoList_demoName(entity me, float i )
void XonoticDemoList_getDemos(entity me)
{
string s;
-
+
if(me.filterString)
- //subdirectory in filterString allowed
- s=strcat("demos/*", me.filterString, "*.dem");
+ //subdirectory in filterString allowed
+ s=strcat("demos/*", me.filterString, "*.dem");
else
s="demos/*.dem";
-
- //dprint("Search demos with the pattern ", s, "\n");
+
+ //dprint("Search demos with the pattern ", s, "\n");
if(me.listDemo >= 0)
search_end(me.listDemo);
-
+
me.listDemo = search_begin(s, FALSE, TRUE);
if(me.listDemo < 0)
me.nItems=0;
else
- me.nItems=search_getsize(me.listDemo);
+ me.nItems=search_getsize(me.listDemo);
}
void XonoticDemoList_destroy(entity me)
string s;
if(isSelected)
draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, SKINALPHA_LISTBOX_SELECTED);
-
+
s = me.demoName(me,i);
s = draw_TextShortenToWidth(s, me.columnNameSize, 0, me.realFontSize);
- draw_Text(me.realUpperMargin * eY + (me.columnNameOrigin + 0.00 * (me.columnNameSize - draw_TextWidth(s, 0, me.realFontSize))) * eX, s, me.realFontSize, '1 1 1', SKINALPHA_TEXT, 0);
+ draw_Text(me.realUpperMargin * eY + (me.columnNameOrigin + 0.00 * (me.columnNameSize - draw_TextWidth(s, 0, me.realFontSize))) * eX, s, me.realFontSize, '1 1 1', SKINALPHA_TEXT, 0);
}
void XonoticDemoList_showNotify(entity me)
}
void DemoList_Filter_Change(entity box, entity me)
-{
+{
if(me.filterString)
strunzone(me.filterString);
-
+
if(box.text != "")
me.filterString = strzone(box.text);
else
me.filterString = string_null;
-
+
me.getDemos(me);
}
{
string s;
s = me.demoName(me,me.selectedItem);
- localcmd("playdemo \"demos/", s, ".dem\" \nwait \ntogglemenu\n");
+ localcmd("playdemo \"demos/", s, ".dem\" \nwait \ntogglemenu\n");
}
void StartDemo_Click(entity btn, entity me)
{
string s;
s = me.demoName(me,me.selectedItem);
- localcmd("timedemo \"demos/", s, ".dem\" \nwait \ntogglemenu\n");
+ localcmd("timedemo \"demos/", s, ".dem\" \nwait \ntogglemenu\n");
}
void XonoticDemoList_clickListBoxItem(entity me, float i, vector where)
{
if(cvar_string("_cl_name") != "Player")
return 1;
-
+
if(cvar_string("_menu_prvm_language") != prvm_language)
return 1; // OK will then reopen the dialog in another language
-
+
if(cvar_string("cl_allow_uid2name") != "-1")
- return 1;
-
+ return 1;
+
return 0;
}
me.TR(me);
me.TR(me);
me.TR(me);
-
+
me.gotoRC(me, 3, 4); me.setFirstColumn(me, me.currentColumn);
me.TR(me);
me.TD(me, 1, 2, e = makeXonoticTextLabel(0, _("Text language:")));
me.gotoRC(me, me.rows - 4, 0);
me.TD(me, 1, me.columns, e = makeXonoticTextLabel(0.5, _("Allow player statistics to use your nickname at stats.xonotic.org?")));
-
+
me.gotoRC(me, me.rows - 3, 0);
me.TDempty(me, 1.5);
me.TD(me, 1, 1, e = makeXonoticRadioButton(1, "cl_allow_uid2name", "1", ZCTX(_("ALWU2N^Yes"))));
me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Color:")));
me.TD(me, 2, 2.6, e = makeXonoticColorpickerString("hud_dock_color", "hud_dock_color"));
me.TR(me);
- me.TR(me);
+ me.TR(me);
me.TDempty(me, 0.2);
me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Alpha:")));
me.TD(me, 1, 2.6, e = makeXonoticTextSlider("hud_dock_alpha"));
ATTRIB(XonoticServerCreateTab, title, string, _("Create"))
ATTRIB(XonoticServerCreateTab, intendedWidth, float, 0.9)
ATTRIB(XonoticServerCreateTab, rows, float, 22)
- ATTRIB(XonoticServerCreateTab, columns, float, 6.2) // added extra .2 for center space
+ ATTRIB(XonoticServerCreateTab, columns, float, 6.2) // added extra .2 for center space
ATTRIB(XonoticServerCreateTab, mapListBox, entity, NULL)
ATTRIB(XonoticServerCreateTab, sliderFraglimit, entity, NULL)
ATTRIB(XonoticDemoBrowserTab, intendedWidth, float, 0.9)
ATTRIB(XonoticDemoBrowserTab, rows, float, 22)
ATTRIB(XonoticDemoBrowserTab, columns, float, 4)
- ATTRIB(XonoticDemoBrowserTab, name, string, "DemoBrowser")
+ ATTRIB(XonoticDemoBrowserTab, name, string, "DemoBrowser")
ENDCLASS(XonoticDemoBrowserTab)
entity makeXonoticDemoBrowserTab();
#endif
e.onChange = DemoList_Filter_Change;
e.onChangeEntity = dlist;
dlist.controlledTextbox = e;
-
+
me.TR(me);
me.TD(me, me.rows - 4, me.columns, dlist);
-
+
me.gotoRC(me, me.rows - 1, 0);
me.TD(me, 1, me.columns / 2, e = makeXonoticButton(_("Timedemo"), '0 0 0'));
e.onClick = TimeDemo_Click;
if(me.currentServerName)
strunzone(me.currentServerName);
me.currentServerName = string_null;
-
+
if(me.currentServerCName)
strunzone(me.currentServerCName);
me.currentServerCName = string_null;
-
+
if(me.currentServerType)
strunzone(me.currentServerType);
me.currentServerType = string_null;
-
+
if(me.currentServerMap)
strunzone(me.currentServerMap);
me.currentServerMap = string_null;
-
+
if(me.currentServerPlayers)
strunzone(me.currentServerPlayers);
me.currentServerPlayers = string_null;
-
+
if(me.currentServerNumPlayers)
strunzone(me.currentServerNumPlayers);
me.currentServerNumPlayers = string_null;
-
+
if(me.currentServerNumBots)
strunzone(me.currentServerNumBots);
me.currentServerNumBots = string_null;
-
+
if(me.currentServerNumFreeSlots)
strunzone(me.currentServerNumFreeSlots);
me.currentServerNumFreeSlots = string_null;
-
+
if(me.currentServerMod)
strunzone(me.currentServerMod);
me.currentServerMod = string_null;
-
+
if(me.currentServerVersion)
strunzone(me.currentServerVersion);
me.currentServerVersion = string_null;
-
+
// not zoned!
//if(me.currentServerEncrypt)
// strunzone(me.currentServerEncrypt);
if(me.currentServerPure)
strunzone(me.currentServerPure);
me.currentServerPure = string_null;
-
+
if(me.currentServerKey)
strunzone(me.currentServerKey);
me.currentServerKey = string_null;
-
+
if(me.currentServerID)
strunzone(me.currentServerID);
me.currentServerID = string_null;
j = MapInfo_Type_FromString(typestr); // try and get the real name of the game type
if(j) { typestr = MapInfo_Type_ToText(j); } // only set it if we actually found it
-
+
me.currentServerType = strzone(typestr);
me.typeLabel.setText(me.typeLabel, me.currentServerType);
s = ftos(numb);
me.currentServerNumBots = strzone(s);
me.numBotsLabel.setText(me.numBotsLabel, me.currentServerNumBots);
-
+
if(freeslots < 0) { freeslots = maxp - numh - numb; }
s = ftos(freeslots);
me.currentServerNumFreeSlots = strzone(s);
break;
}
me.encryptLabel.setText(me.encryptLabel, me.currentServerEncrypt);
-
+
s = crypto_getidfp(me.currentServerCName);
- if not(s) { s = _("N/A"); }
+ if (!s) { s = _("N/A"); }
me.currentServerID = strzone(s);
me.idLabel.setText(me.idLabel, me.currentServerID);
s = crypto_getkeyfp(me.currentServerCName);
- if not(s) { s = _("N/A"); }
+ if (!s) { s = _("N/A"); }
me.currentServerKey = strzone(s);
me.keyLabel.setText(me.keyLabel, me.currentServerKey);
}
e.colorL = SKINCOLOR_SERVERINFO_IP;
e.allowCut = 1;
me.cnameLabel = e;
-
+
me.TR(me);
me.TR(me);
me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Gametype:")));
me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, ""));
e.allowCut = 1;
me.pureLabel = e;
-
+
me.TR(me);
me.TR(me);
me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Players:")));
me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, ""));
e.allowCut = 1;
me.numFreeSlotsLabel = e;
-
+
me.gotoRC(me, me.rows - 5, 0);
me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Encryption:")));
me.TD(me, 1, 5.4, e = makeXonoticTextLabel(0, ""));
ATTRIB(XonoticPlayerSettingsTab, title, string, _("Player Setup"))
ATTRIB(XonoticPlayerSettingsTab, intendedWidth, float, 0.9)
ATTRIB(XonoticPlayerSettingsTab, rows, float, 22)
- ATTRIB(XonoticPlayerSettingsTab, columns, float, 6.2) // added extra .2 for center space
+ ATTRIB(XonoticPlayerSettingsTab, columns, float, 6.2) // added extra .2 for center space
ATTRIB(XonoticPlayerSettingsTab, playerNameLabel, entity, NULL)
ATTRIB(XonoticPlayerSettingsTab, playerNameLabelAlpha, float, 0)
ENDCLASS(XonoticPlayerSettingsTab)
e.onClickEntity = main.weaponsDialog;
// I don't really think this is useful as is, and especially it doesn't look very clean...
// In the future, if ALL of these buttons had some information, then it would be justified/clean
- //me.TD(me, 1, 1, e0 = makeXonoticTextLabel(0, string_null));
+ //me.TD(me, 1, 1, e0 = makeXonoticTextLabel(0, string_null));
// e0.textEntity = main.weaponsDialog;
// e0.allowCut = 1;
me.TR(me);
me.TD(me, 1, 2, e = makeXonoticButton(_("HUD settings"), '0 0 0'));
e.onClick = DialogOpenButton_Click;
e.onClickEntity = main.hudDialog;
- // TODO: show hud config name with text here
+ // TODO: show hud config name with text here
me.gotoRC(me, me.rows - 1, 0);
me.TD(me, 1, me.columns, makeXonoticCommandButton(_("Apply immediately"), '0 0 0', "color -1 -1;name \"$_cl_name\";sendcvar cl_weaponpriority;sendcvar cl_autoswitch;sendcvar cl_forceplayermodels;sendcvar cl_forceplayermodelsfromxonotic;playermodel $_cl_playermodel;playerskin $_cl_playerskin", COMMANDBUTTON_APPLY));
void XonoticCrosshairDialog_fill(entity me)
{
entity e;
-
+
me.TR(me);
me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "crosshair_dot", _("Enable center crosshair dot")));
setDependent(e, "crosshair_enabled", 1, 2);
me.TDempty(me, 0.2);
me.TD(me, 1, 2.8, e = makeXonoticCheckBoxEx(0.25, 0, "crosshair_pickup", _("Animate when picking up an item")));
setDependent(e, "crosshair_enabled", 1, 2);
-
+
me.TR(me);
-
+
me.gotoRC(me, me.rows - 1, 0);
me.TD(me, 1, me.columns, e = makeXonoticButton(_("OK"), '0 0 0'));
e.onClick = Dialog_Close;
#ifdef IMPLEMENTATION
void HUDSetup_Check_Gamestatus(entity me, entity btn)
{
- if not(gamestatus & (GAME_CONNECTED | GAME_ISSERVER)) // we're not in a match, ask the player if they want to start one anyway
+ if(!(gamestatus & (GAME_CONNECTED | GAME_ISSERVER))) // we're not in a match, ask the player if they want to start one anyway
{
DialogOpenButton_Click(me, main.hudconfirmDialog);
}
}
string XonoticHUDDialog_toString(entity me)
{
- return "hi"; // TODO: show hud config name with text here
+ return "hi"; // TODO: show hud config name with text here
}
void XonoticHUDDialog_fill(entity me)
{
entity e;
-
+
me.TR(me);
me.TD(me, 1, 3, e = makeXonoticTextLabel(0, _("Damage:")));
me.TR(me);
me.TD(me, 1, 2, e = makeXonoticSlider(0.25, 1, 0.05, "hud_damage_fade_rate"));
setDependent(e, "hud_damage", 0.001, 100);
me.TR(me);
-
+
me.TR(me);
me.TD(me, 1, 3, e = makeXonoticCheckBox(1, "cl_hidewaypoints", _("Waypoints")));
me.TR(me);
makeMulti(e, "g_waypointsprite_edgeoffset_top g_waypointsprite_edgeoffset_left g_waypointsprite_edgeoffset_right");
setDependent(e, "cl_hidewaypoints", 0, 0);
me.TR(me);
-
+
me.TR(me);
me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_shownames", _("Show names above players")));
me.TR(me);
me.TD(me, 1, 2, e = makeXonoticButton(_("Enter HUD editor"), '0 0 0'));
e.onClick = HUDSetup_Check_Gamestatus;
e.onClickEntity = me;
- // TODO: show hud config name with text here
-
+ // TODO: show hud config name with text here
+
me.gotoRC(me, me.rows - 1, 0);
me.TD(me, 1, me.columns, e = makeXonoticButton(_("OK"), '0 0 0'));
e.onClick = Dialog_Close;
e.onClickEntity = me;
}
-#endif
\ No newline at end of file
+#endif
#ifdef IMPLEMENTATION
void HUDSetup_Start(entity me, entity btn)
{
- if not(gamestatus & (GAME_CONNECTED | GAME_ISSERVER))
+ if (!(gamestatus & (GAME_CONNECTED | GAME_ISSERVER)))
localcmd("map hudsetup/hudsetup", "\n");
else
localcmd("togglemenu 0\n");
-
+
localcmd("_hud_configure 1", "\n");
}
void XonoticModelDialog_fill(entity me)
{
entity e;
-
+
me.TR(me);
me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Body fading:")));
me.TD(me, 1, 2, e = makeXonoticSlider(0, 2, 0.2, "cl_deathglow"));
me.TR(me);
me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "cl_forceplayercolors", _("Force player colors to mine")));
me.TR(me);
-
+
me.gotoRC(me, me.rows - 1, 0);
me.TD(me, 1, me.columns, e = makeXonoticButton(_("OK"), '0 0 0'));
e.onClick = Dialog_Close;
ATTRIB(XonoticViewDialog, color, vector, SKINCOLOR_DIALOG_VIEW)
ATTRIB(XonoticViewDialog, intendedWidth, float, 0.9)
ATTRIB(XonoticViewDialog, rows, float, 11)
- ATTRIB(XonoticViewDialog, columns, float, 6.2) // added extra .2 for center space
+ ATTRIB(XonoticViewDialog, columns, float, 6.2) // added extra .2 for center space
ENDCLASS(XonoticViewDialog)
#endif
void XonoticViewDialog_fill(entity me)
{
entity e;
-
+
me.TR(me);
me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Field of view:")));
me.TD(me, 1, 2, e = makeXonoticSlider(60, 130, 5, "fov"));
me.TR(me);
me.TR(me);
me.TD(me, 1, 3, e = makeXonoticCheckBox(1, "cl_clippedspectating", _("Allow passing through walls while spectating")));
-
+
me.gotoRC(me, 0, 3.2); me.setFirstColumn(me, me.currentColumn);
me.TD(me, 1, 3, e = makeXonoticRadioButton(1, "chase_active", "0", _("1st person perspective")));
makeMulti(e, "crosshair_hittest_showimpact");
me.TD(me, 1, 2, e = makeXonoticSlider(10, 50, 1, "chase_up"));
setDependent(e, "chase_active", 1, 1);
me.TR(me);
-
+
me.gotoRC(me, me.rows - 1, 0);
me.TD(me, 1, me.columns, e = makeXonoticButton(_("OK"), '0 0 0'));
e.onClick = Dialog_Close;
me.TD(me, 1, 1, e = makeXonoticButton(_("Down"), '0 0 0'));
e.onClick = WeaponsList_MoveDown_Click;
e.onClickEntity = me.weaponsList;
-
+
me.gotoRC(me, 0, 2.2); me.setFirstColumn(me, me.currentColumn);
me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "cl_weaponpriority_useforcycling", _("Use priority list for weapon cycling")));
me.TR(me);
// setDependent(e, "r_drawviewmodel", 1, 1);
// me.TD(me, 1, 2, e = makeXonoticSlider(0.1, 2, 0.1, "cl_viewmodel_scale"));
// setDependent(e, "r_drawviewmodel", 1, 1);
-
+
me.gotoRC(me, me.rows - 1, 0);
me.TD(me, 1, me.columns, e = makeXonoticButton(_("OK"), '0 0 0'));
e.onClick = Dialog_Close;
ATTRIB(XonoticAudioSettingsTab, title, string, _("Audio"))
ATTRIB(XonoticAudioSettingsTab, intendedWidth, float, 0.9)
ATTRIB(XonoticAudioSettingsTab, rows, float, 17)
- ATTRIB(XonoticAudioSettingsTab, columns, float, 6.2) // added extra .2 for center space
+ ATTRIB(XonoticAudioSettingsTab, columns, float, 6.2) // added extra .2 for center space
ENDCLASS(XonoticAudioSettingsTab)
entity makeXonoticAudioSettingsTab();
#endif
me.TD(me, 1, 3, makeXonoticCheckBox(0, "menu_snd_attenuation_method", _("New style sound attenuation")));
me.TR(me);
me.TD(me, 1, 3, makeXonoticCheckBox(0, "snd_mutewhenidle", _("Mute sounds when not active")));
-
+
me.gotoRC(me, 0, 3.2); me.setFirstColumn(me, me.currentColumn);
me.TD(me, 1, 1, makeXonoticTextLabel(0, _("Frequency:")));
me.TD(me, 1, 2, e = makeXonoticTextSlider("snd_speed"));
ATTRIB(XonoticEffectsSettingsTab, title, string, _("Effects"))
ATTRIB(XonoticEffectsSettingsTab, intendedWidth, float, 0.9)
ATTRIB(XonoticEffectsSettingsTab, rows, float, 17)
- ATTRIB(XonoticEffectsSettingsTab, columns, float, 6.2) // added extra .2 for center space
+ ATTRIB(XonoticEffectsSettingsTab, columns, float, 6.2) // added extra .2 for center space
ENDCLASS(XonoticEffectsSettingsTab)
entity makeXonoticEffectsSettingsTab();
float updateCompression();
setDependent(e, "cl_decals", 1, 1);
me.TD(me, 1, 2, e = makeXonoticSlider(1, 20, 1, "cl_decals_time"));
setDependent(e, "cl_decals", 1, 1);
-
+
me.gotoRC(me, me.rows - 1, 0);
me.TD(me, 1, me.columns, makeXonoticCommandButton(_("Apply immediately"), '0 0 0', "vid_restart", COMMANDBUTTON_APPLY));
}
ATTRIB(XonoticInputSettingsTab, title, string, _("Input"))
ATTRIB(XonoticInputSettingsTab, intendedWidth, float, 0.9)
ATTRIB(XonoticInputSettingsTab, rows, float, 17)
- ATTRIB(XonoticInputSettingsTab, columns, float, 6.2) // added extra .2 for center space
+ ATTRIB(XonoticInputSettingsTab, columns, float, 6.2) // added extra .2 for center space
ENDCLASS(XonoticInputSettingsTab)
entity makeXonoticInputSettingsTab();
#endif
me.TR(me);
me.TDempty(me, 0.2);
me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "m_accelerate", _("Enable built in mouse acceleration")));
-
-
+
+
me.gotoRC(me, me.rows - 1, 0);
me.TD(me, 1, me.columns, makeXonoticCommandButton(_("Apply immediately"), '0 0 0', "sendcvar cl_movement_track_canjump", COMMANDBUTTON_APPLY));
}
me.TD(me, 1, 1.8, e = makeXonoticTextLabel(0, _("Client UDP port:")));
me.TD(me, 1, 1, e = makeXonoticInputBox(0, "cl_port"));
e.enableClearButton = 0;
+ me.TR(me);
+ me.TDempty(me, 0.2);
+ if(cvar_type("crypto_aeslevel") & CVAR_TYPEFLAG_ENGINE)
+ me.TD(me, 1, 2.8, e = makeXonoticCheckBoxEx(2, 1, "crypto_aeslevel", _("Use encryption (AES) when available")));
me.TR(me);
me.TR(me);
me.TDempty(me, 0.2);
{
loadAllCvars(me);
}
-void XonoticCvarsDialog_fill(entity me) // in this dialog, use SKINCOLOR_CVARLIST_CONTROLS to color ALL controls
+void XonoticCvarsDialog_fill(entity me) // in this dialog, use SKINCOLOR_CVARLIST_CONTROLS to color ALL controls
{
entity e, cvarlist;
cvarlist = makeXonoticCvarList();
- cvarlist.color =
- cvarlist.colorF =
- cvarlist.color2 =
- cvarlist.colorC =
+ cvarlist.color =
+ cvarlist.colorF =
+ cvarlist.color2 =
+ cvarlist.colorC =
SKINCOLOR_CVARLIST_CONTROLS;
me.TR(me);
me.TD(me, 1, 1.5, e = makeXonoticButton(_("Set font"), '0 0 0'));
e.onClick = SetLanguage_Click;
e.onClickEntity = sk;*/
-
+
me.gotoRC(me, 0, 2.85); me.setFirstColumn(me, me.currentColumn);
me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Text language:")));
me.TR(me);
me.TD(me, 1, 1.5, e = makeXonoticButton(_("Set language"), '0 0 0'));
e.onClick = SetLanguage_Click;
e.onClickEntity = sk;
-
+
me.gotoRC(me, 9, 2.2); me.setFirstColumn(me, me.currentColumn);
me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "cl_gentle", _("Disable gore effects and harsh language")));
me.TR(me);
me.TR(me);
me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "cl_allow_uid2name", _("Allow player statistics to use your nickname")));
setDependent(e, "cl_allow_uidtracking", 1, 1);
-
+
me.gotoRC(me, me.rows - 3, 2.6);
me.TD(me, 1, 2, makeXonoticCommandButton(_("Apply immediately"), '0 0 0', "sendcvar cl_gentle; sendcvar cl_allow_uidtracking; sendcvar cl_allow_uid2name;", COMMANDBUTTON_APPLY));
ATTRIB(XonoticVideoSettingsTab, title, string, _("Video"))
ATTRIB(XonoticVideoSettingsTab, intendedWidth, float, 0.9)
ATTRIB(XonoticVideoSettingsTab, rows, float, 17)
- ATTRIB(XonoticVideoSettingsTab, columns, float, 6.2) // added extra .2 for center space
+ ATTRIB(XonoticVideoSettingsTab, columns, float, 6.2) // added extra .2 for center space
ATTRIB(XonoticVideoSettingsTab, name, string, "videosettings")
ENDCLASS(XonoticVideoSettingsTab)
entity makeXonoticVideoSettingsTab();
me.TR(me);
me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "vid_fullscreen", _("Full screen")));
me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "vid_vsync", _("Vertical Synchronization")));
-
+
me.TR(me);
me.TR(me);
me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Anisotropy:")));
me.TR(me);
me.TD(me, 1, 3, e = makeXonoticCheckBoxEx(2, 0, "r_viewfbo", _("High-quality frame buffer")));
setDependent(e, "vid_samples", 1, 1);
-
+
me.TR(me);
me.TR(me);
me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Depth first:")));
}
me.gotoRC(me, me.rows - 1, 0);
- me.TD(me, 1, me.columns, makeXonoticCommandButton(_("Apply immediately"), '0 0 0', "vid_width $_menu_vid_width; vid_height $_menu_vid_height; vid_pixelheight $_menu_vid_pixelheight; vid_desktopfullscreen $_menu_vid_desktopfullscreen; vid_restart; menu_restart; menu_cmd videosettings", COMMANDBUTTON_APPLY));
+ me.TD(me, 1, me.columns, makeXonoticCommandButton(_("Apply immediately"), '0 0 0', "vid_width $_menu_vid_width; vid_height $_menu_vid_height; vid_pixelheight $_menu_vid_pixelheight; vid_desktopfullscreen $_menu_vid_desktopfullscreen; menu_cmd update_conwidths_before_vid_restart; vid_restart; menu_cmd sync", COMMANDBUTTON_APPLY));
}
#endif
}
void XonoticGametypeButton_loadCvars(entity me)
{
- if not(me.cvarName)
+ if (!me.cvarName)
return;
me.checked = cvar(me.cvarName);
}
void XonoticGametypeButton_saveCvars(entity me)
{
- if not(me.cvarName)
+ if (!me.cvarName)
return;
cvar_set(me.cvarName, ftos(me.checked));
void XonoticGametypeList_drawListBoxItem(entity me, float i, vector absSize, float isSelected)
{
string s;
-
+
if(isSelected)
draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, SKINALPHA_LISTBOX_SELECTED);
{
me.itemAbsSize = '0 0 0';
SUPER(XonoticServerList).resizeNotify(me, relOrigin, relSize, absOrigin, absSize);
-
+
me.realFontSize_y = me.fontSize / (me.itemAbsSize_y = (absSize_y * me.itemHeight));
me.realFontSize_x = me.fontSize / (me.itemAbsSize_x = (absSize_x * (1 - me.controlWidth)));
me.realUpperMargin1 = 0.5 * (1 - me.realFontSize_y);
}
void XonoticInputBox_loadCvars(entity me)
{
- if not(me.cvarName)
+ if (!me.cvarName)
return;
SUPER(XonoticInputBox).setText(me, cvar_string(me.cvarName));
}
void XonoticInputBox_saveCvars(entity me)
{
- if not(me.cvarName)
+ if (!me.cvarName)
return;
cvar_set(me.cvarName, me.text);
}
me.firstRunDialog = i = spawnXonoticFirstRunDialog();
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
-
-
+
+
// hud_configure dialogs
i = spawnXonoticHUDExitDialog();
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
-
+
i = spawnXonoticHUDNotificationDialog();
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
-
+
i = spawnXonoticHUDAmmoDialog();
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
-
+
i = spawnXonoticHUDHealthArmorDialog();
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
-
+
i = spawnXonoticHUDChatDialog();
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
-
+
i = spawnXonoticHUDModIconsDialog();
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
-
+
i = spawnXonoticHUDPowerupsDialog();
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
-
+
i = spawnXonoticHUDPressedKeysDialog();
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
-
+
i = spawnXonoticHUDRaceTimerDialog();
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
-
+
i = spawnXonoticHUDRadarDialog();
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
-
+
i = spawnXonoticHUDScoreDialog();
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
-
+
i = spawnXonoticHUDTimerDialog();
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
-
+
i = spawnXonoticHUDVoteDialog();
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
-
+
i = spawnXonoticHUDWeaponsDialog();
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
i = spawnXonoticHUDCenterprintDialog();
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
-
-
+
+
// dialogs used by settings
me.userbindEditDialog = i = spawnXonoticUserbindEditDialog();
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
-
+
me.cvarsDialog = i = spawnXonoticCvarsDialog();
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
-
-
+
+
// dialog used by singleplayer
me.winnerDialog = i = spawnXonoticWinnerDialog();
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
-
-
+
+
// dialog used by multiplayer/join
me.serverInfoDialog = i = spawnXonoticServerInfoDialog();
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
-
-
+
+
// dialogs used by multiplayer/create
me.mapInfoDialog = i = spawnXonoticMapInfoDialog();
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
-
+
me.advancedDialog = i = spawnXonoticAdvancedDialog();
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
me.mutatorsDialog = i = spawnXonoticMutatorsDialog();
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
-
+
// dialogs used by multiplayer/player setup
me.crosshairDialog = i = spawnXonoticCrosshairDialog();
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
-
+
me.hudDialog = i = spawnXonoticHUDDialog();
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
me.hudconfirmDialog = i = spawnXonoticHUDConfirmDialog();
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
-
+
me.modelDialog = i = spawnXonoticModelDialog();
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
-
+
me.viewDialog = i = spawnXonoticViewDialog();
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
-
+
me.weaponsDialog = i = spawnXonoticWeaponsDialog();
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
-
+
// mutator dialogs
i = spawnXonoticSandboxToolsDialog();
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z * SKINALPHA_DIALOG_SANDBOXTOOLS);
-
-
+
+
// miscellaneous dialogs
i = spawnXonoticTeamSelectDialog();
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
-
-
+
+
// main dialogs/windows
me.mainNexposee = n = spawnXonoticNexposee();
/*
i.configureDialog(i);
n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
n.setNexposee(n, i, SKINPOSITION_DIALOG_SINGLEPLAYER, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
-
+
i = spawnXonoticMultiplayerDialog();
i.configureDialog(i);
n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
n.setNexposee(n, i, SKINPOSITION_DIALOG_QUIT, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
n.pullNexposee(n, i, eY * (SKINHEIGHT_TITLE * SKINFONTSIZE_TITLE / conheight));
-
+
me.addItem(me, n, '0 0 0', '1 1 0', SKINALPHAS_MAINMENU_z);
me.moveItemAfter(me, n, NULL);
string a, b, c, s, bspname;
float n;
s = me.g_maplistCache;
- if not(s)
+ if (!s)
return;
b = substring(s, i, 1);
if(b == "0")
strunzone(s);
me.g_maplistCache = strzone(strcat(a, b, c));
// TODO also update the actual cvar
- if not((bspname = MapInfo_BSPName_ByID(i)))
+ if (!((bspname = MapInfo_BSPName_ByID(i))))
return;
if(b == "1")
cvar_set("g_maplist", strcat(bspname, " ", cvar_string("g_maplist")));
return;
m = MapInfo_BSPName_ByID(i);
- if not(m)
+ if (!m)
{
print(_("Huh? Can't play this (m is NULL). Refiltering so this won't happen again.\n"));
me.refilter(me);
}
else if(ascii == 43) // +
{
- if not(me.g_maplistCacheQuery(me, me.selectedItem))
+ if (!me.g_maplistCacheQuery(me, me.selectedItem))
me.g_maplistCacheToggle(me, me.selectedItem);
}
else if(ascii == 45) // -
rgb = colormapPaletteColor(9, 0);
else
rgb = '1 1 1';
-
+
s = me.getPlayerList(me, i, PLAYERPARM_NAME);
score = me.getPlayerList(me, i, PLAYERPARM_SCORE);
score = substring(score, 0, t);
if((t = strstrofs(score, ",", 0)) >= 0)
score = substring(score, 0, t);
-
+
if(stof(score) == -666)
score = _("spectator");
}
}
void XonoticRadioButton_draw(entity me)
{
- if not(me.cvarValue)
- if not(me.cvarName)
+ if (!me.cvarValue)
+ if (!me.cvarName)
{
// this is the "other" option
// always select this if none other is
f = 1;
--i;
}
-
+
if(!f)
{
s1 = "";
theAlpha = SKINALPHA_SERVERLIST_FULL;
else if(freeslots == 0)
theAlpha = SKINALPHA_SERVERLIST_FULL; // g_maxplayers support
- else if not(gethostcachenumber(SLIST_FIELD_NUMHUMANS, i))
+ else if (!gethostcachenumber(SLIST_FIELD_NUMHUMANS, i))
theAlpha = SKINALPHA_SERVERLIST_EMPTY;
else
theAlpha = 1;
string n;
- if not(me.seenIPv4 && me.seenIPv6)
+ if (!(me.seenIPv4 && me.seenIPv6))
{
iconPos_x += iconSize_x * 0.5;
}
void XonoticSkinList_drawListBoxItem(entity me, float i, vector absSize, float isSelected)
{
string s;
-
+
if(isSelected)
draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, SKINALPHA_LISTBOX_SELECTED);
-
+
s = me.skinParameter(me, i, SKINPARM_PREVIEW);
draw_Picture(me.columnPreviewOrigin * eX, s, me.columnPreviewSize * eX + eY, '1 1 1', 1);
-
+
s = me.skinParameter(me, i, SKINPARM_NAME);
s = sprintf(_("%s: %s"), s, me.skinParameter(me, i, SKINPARM_TITLE));
s = draw_TextShortenToWidth(s, me.columnNameSize, 0, me.realFontSize);
}
void XonoticSlider_loadCvars(entity me)
{
- if not(me.cvarName)
+ if (!me.cvarName)
return;
me.setValue( me, cvar(me.cvarName) );
}
void XonoticSlider_saveCvars(entity me)
{
- if not(me.cvarName)
+ if (!me.cvarName)
return;
cvar_set(me.cvarName, ftos(me.value));
{
float v;
- if not(me.cvarName)
+ if (!me.cvarName)
return;
v = cvar(me.cvarName);
}
void XonoticDecibelsSlider_saveCvars(entity me)
{
- if not(me.cvarName)
+ if (!me.cvarName)
return;
if(me.value > me.valueMax - 0.5 * me.valueStep)
ATTRIB(XonoticResolutionSlider, vid_fullscreen, float, -1)
ENDCLASS(XonoticResolutionSlider)
entity makeXonoticResolutionSlider();
-void updateConwidths(float width, float height, float pixelheight);
+float updateConwidths(float width, float height, float pixelheight);
#endif
#ifdef IMPLEMENTATION
/* private static */ float XonoticResolutionSlider_DataHasChanged;
// Updates cvars (to be called by menu.qc at startup or on detected res change)
-void updateConwidths(float width, float height, float pixelheight)
+float updateConwidths(float width, float height, float pixelheight)
{
vector r, c;
float minfactor, maxfactor;
float sz, f;
+ sz = cvar("menu_vid_scale");
+ if (sz < -1)
+ return 0; // No recalculation.
+
// Save off current settings.
cvar_set("_menu_vid_width", ftos(width));
cvar_set("_menu_vid_height", ftos(height));
r_x = width;
r_y = height;
r_z = pixelheight;
- sz = cvar("menu_vid_scale");
// calculate the base resolution
c_z = 0;
f = 1;
c = c * f; // fteqcc fail
- cvar_set("vid_conwidth", ftos(rint(c_x)));
- cvar_set("vid_conheight", ftos(rint(c_y)));
+ c_x = rint(c_x);
+ c_y = rint(c_y);
+
+ // Please reload resolutions list and such stuff.
XonoticResolutionSlider_DataHasChanged = TRUE;
+
+ if (c_x != cvar("vid_conwidth") || c_y != cvar("vid_conheight"))
+ {
+ cvar_set("vid_conwidth", ftos(c_x));
+ cvar_set("vid_conheight", ftos(c_y));
+ return 1;
+ }
+ return 0;
}
entity makeXonoticResolutionSlider()
{
if(me.nValues == 0)
{
me.addResolution(me, 640, 480, 1); // pc res
+#if 0
me.addResolution(me, 720, 480, 1.125); // DVD NTSC 4:3
me.addResolution(me, 720, 576, 0.9375); // DVD PAL 4:3
me.addResolution(me, 720, 480, 0.84375); // DVD NTSC 16:9
me.addResolution(me, 720, 576, 0.703125); // DVD PAL 16:9
+#endif
me.addResolution(me, 800, 480, 1); // 480p at 1:1 pixel aspect
me.addResolution(me, 800, 600, 1); // pc res
me.addResolution(me, 1024, 600, 1); // notebook res
}
void XonoticTextSlider_loadCvars(entity me)
{
- if not(me.cvarName)
+ if (!me.cvarName)
return;
var float n = tokenize_console(me.cvarName);
}
void XonoticTextSlider_saveCvars(entity me)
{
- if not(me.cvarName)
+ if (!me.cvarName)
return;
if(me.value >= 0 && me.value < me.nValues)
n = 0;
else
n = tokenizebyseparator(data, "\n");
-
+
if(n >= 1)
{
_Nex_ExtResponseSystem_UpdateTo = argv(0);
boxA = '0.05 0.5 0' + 0.25 * sz_y * eY;
boxB = '0.95 0.5 0' + 1.25 * sz_y * eY;
draw_Fill(boxA, boxB - boxA, '1 1 1', 1);
-
+
boxA += sz * 0.1;
boxB -= sz * 0.1;
draw_Fill(boxA, boxB - boxA, '0.1 0.1 0.1', 1);
draw_CenterText(mid - 1 * line, l1, fs, '1 0 0', 1, 0);
draw_CenterText(mid - 0 * line, l2, fs, '0 0 1', 1, 0);
}
- if not(campaign_name_previous)
+ if (!campaign_name_previous)
campaign_name_previous = strzone(strcat(campaign_name, "x")); // force unequal
if(campaign_name == campaign_name_previous)
{
{
float i;
i = 0;
-
+
#define GAMETYPE(id) if(i++ == cnt) return id;
GAMETYPES
#undef GAMETYPE
unused_float = i;
-
+
return 0;
}
{
float i;
i = 0;
-
+
#define GAMETYPE(id) ++i;
GAMETYPES
#undef GAMETYPE
-
+
return i;
}
string GameType_GetName(float cnt)
{
float i = GameType_GetID(cnt);
-
+
if(i)
return MapInfo_Type_ToText(i);
-
+
return "";
}
string GameType_GetIcon(float cnt)
{
float i = GameType_GetID(cnt);
-
+
if(i)
return strcat("gametype_", MapInfo_Type_ToString(i));
-
+
return "";
}
{
float i = GameType_GetID(cnt);
string s = _MapInfo_GetDefaultEx(i);
-
+
if(i)
{
if(strstrofs(s, "teams", 0) >= 0)
else
return _("free for all");
}
-
+
return _("tuba for all");
}*/
float f, i;
i = me.selectedItem;
f = SUPER(XonoticWeaponsList).mouseDrag(me, pos);
-
+
if(me.pressed != 1) // don't change priority if the person is just scrolling
{
if(me.selectedItem != i)
cvar_set("cl_weaponpriority", swapInPriorityList(cvar_string("cl_weaponpriority"), me.selectedItem, i));
}
-
+
return f;
}
string XonoticWeaponsList_toString(entity me)
dprint("TESTCASE: START\n");
r = test();
if(r == 1)
- error("TESTCASE: PASS");
+ error("TESTCASE: PASS");
else if(r == 0)
- error("TESTCASE: FAIL");
+ error("TESTCASE: FAIL");
else
- error("TESTCASE: INVALID");
+ error("TESTCASE: INVALID");
}
a = a.accuracy;
if(to != a.owner)
- if not(self.owner.cvar_cl_accuracy_data_share && autocvar_sv_accuracy_data_share)
+ if (!(self.owner.cvar_cl_accuracy_data_share && autocvar_sv_accuracy_data_share))
sf = 0;
// note: zero sendflags can never be sent... so we can use that to say that we send no accuracy!
WriteInt24_t(MSG_ENTITY, sf);
{
if (e.vehicle && e.vehicle.vehicle_flags == VHF_PLAYERSLOT)
return;
-
+
if(e.vehicle)
antilag_record(e.vehicle, t);
#define autocvar_fraglimit_override cvar("fraglimit_override")
float autocvar_g_allow_oldnexbeam;
float autocvar_g_antilag;
-float autocvar_g_antilag_bullets;
float autocvar_g_antilag_nudge;
float autocvar_g_balance_armor_blockpercent;
float autocvar_g_balance_armor_limit;
return FALSE;
if(e.flags & FL_NOTARGET)
return FALSE;
-
+
checkentity = e;
if(MUTATOR_CALLHOOK(BotShouldAttack))
return FALSE;
-
+
return TRUE;
}
void bot_clientdisconnect()
{
- if not(IS_BOT_CLIENT(self))
+ if (!IS_BOT_CLIENT(self))
return;
bot_clearqueue(self);
if(self.cleanname)
void bot_clientconnect()
{
- if not(IS_BOT_CLIENT(self))
+ if (!IS_BOT_CLIENT(self))
return;
self.bot_preferredcolors = self.clientcolors;
self.bot_nextthink = time - random();
}
else
{
- if not(self.jumppadcount)
+ if (!self.jumppadcount)
self.havocbot_role();
}
havocbot_movetogoal();
// if the bot is not attacking, consider reloading weapons
- if not(self.aistatus & AI_STATUS_ATTACKING)
+ if (!(self.aistatus & AI_STATUS_ATTACKING))
{
float i;
entity e;
if(self.aistatus & AI_STATUS_ROAMING)
if(self.goalcurrent.classname=="waypoint")
- if not(self.goalcurrent.wpflags & WAYPOINTFLAG_PERSONAL)
+ if (!(self.goalcurrent.wpflags & WAYPOINTFLAG_PERSONAL))
if(fabs(gco_z - self.origin_z) < self.maxs_z - self.mins_z)
if(self.goalstack01!=world)
{
}
// Take off
- if not(self.aistatus & AI_STATUS_JETPACK_FLYING)
+ if (!(self.aistatus & AI_STATUS_JETPACK_FLYING))
{
// Brake almost completely so it can get a good direction
if(vlen(self.velocity)>10)
// If there is a trigger_hurt right below try to use the jetpack or make a rocketjump
if(skill>6)
- if not(self.flags & FL_ONGROUND)
+ if (!(self.flags & FL_ONGROUND))
{
tracebox(self.origin, self.mins, self.maxs, self.origin + '0 0 -65536', MOVE_NOMONSTERS, self);
if(tracebox_hits_trigger_hurt(self.origin, self.mins, self.maxs, trace_endpos ))
cp = world;
for (; cp1; cp1 = cp1.chain)
{
- if not(cp1.wpconsidered)
+ if (!cp1.wpconsidered)
continue;
if(cp1.wpcost<bestvalue)
}
}
- if not(cp)
+ if (!cp)
return;
// dprint(self.netname, " chose cp ranked ", ftos(bestvalue), "\n");
found = FALSE;
// Look for auto generated waypoint
- if not(bot_waypoints_for_items)
+ if (!bot_waypoints_for_items)
for (wp = findradius(cp.origin,100); wp; wp = wp.chain)
{
if(wp.classname=="waypoint")
}
// Nothing found, rate the controlpoint itself
- if not(found)
+ if (!found)
navigation_routerating(cp, ratingscale, 10000);
}
}
break;
}
- if not (pointcontents(org + '0 0 1') == CONTENT_EMPTY)
+ if (!(pointcontents(org + '0 0 1') == CONTENT_EMPTY))
{
if(autocvar_bot_debug_tracewalk)
debugnodestatus(org, DEBUG_NODE_FAIL);
{
float c;
c = pointcontents(org + '0 0 1');
- if not(c == CONTENT_WATER || c == CONTENT_LAVA || c == CONTENT_SLIME)
+ if (!(c == CONTENT_WATER || c == CONTENT_LAVA || c == CONTENT_SLIME))
swimming = FALSE;
else
continue;
t = zdistance / autocvar_g_jetpack_maxspeed_up;
t += xydistance / autocvar_g_jetpack_maxspeed_side;
fuel = t * autocvar_g_jetpack_fuel * 0.8;
-
+
bot_debug(strcat("jetpack ai: required fuel ", ftos(fuel), " self.ammo_fuel ", ftos(self.ammo_fuel), "\n"));
// enough fuel ?
if(e.flags & FL_ITEM)
{
- if not(e.flags & FL_WEAPON)
+ if (!(e.flags & FL_WEAPON))
if(e.nearestwaypoint)
search = FALSE;
}
bot_debug(strcat("best goal ", self.goalcurrent.classname , "\n"));
// If the bot got stuck then try to reach the farthest waypoint
- if not (self.navigation_hasgoals)
+ if (!self.navigation_hasgoals)
if (autocvar_bot_wander_enable)
{
- if not(self.aistatus & AI_STATUS_STUCK)
+ if (!(self.aistatus & AI_STATUS_STUCK))
{
bot_debug(strcat(self.netname, " cannot walk to any goal\n"));
self.aistatus |= AI_STATUS_STUCK;
{
float search_radius = 1000;
- if not(autocvar_bot_wander_enable)
+ if (!autocvar_bot_wander_enable)
return;
- if not(bot_waypoint_queue_owner)
+ if (!bot_waypoint_queue_owner)
{
bot_debug(strcat(self.netname, " sutck, taking over the waypoints queue\n"));
bot_waypoint_queue_owner = self;
}
bot_waypoint_queue_goal = bot_waypoint_queue_goal.bot_waypoint_queue_nextgoal;
- if not(bot_waypoint_queue_goal)
+ if (!bot_waypoint_queue_goal)
{
if (bot_waypoint_queue_bestgoal)
{
void debugnode(vector node)
{
- if not(IS_PLAYER(self))
+ if (!IS_PLAYER(self))
return;
if(debuglastnode=='0 0 0')
ispressingkey = !!bot_presskeys();
// Handle conditions
- if not(bot_cmd.bot_cmd_type==BOT_CMD_FI||bot_cmd.bot_cmd_type==BOT_CMD_ELSE)
+ if (!(bot_cmd.bot_cmd_type==BOT_CMD_FI||bot_cmd.bot_cmd_type==BOT_CMD_ELSE))
if(self.bot_cmd_condition_status & CMD_CONDITION_TRUE && self.bot_cmd_condition_status & CMD_CONDITION_FALSE_BLOCK)
{
bot_command_executed(TRUE);
entity w;
w = find(world, classname, "waypoint");
- if not(f & WAYPOINTFLAG_PERSONAL)
+ if (!(f & WAYPOINTFLAG_PERSONAL))
while (w)
{
// if a matching spawnfunc_waypoint already exists, don't add a duplicate
{
m1 = stov(s);
s = fgets(file);
- if not(s)
+ if (!s)
break;
m2 = stov(s);
s = fgets(file);
- if not(s)
+ if (!s)
break;
fl = stof(s);
waypoint_spawn(m1, m2, fl);
return 1;
}
-string cvar_campaignwrapper_list; // string of format ; var value; var value; var value;
+string cvar_campaignwrapper_list; // string of format ; var value; var value; var value;
string cvar_string_campaignwrapper(string theCvar)
{
float p, q;
return 0;
if(gamestart_sv_cheats < 2 && !IS_PLAYER(self))
return 0;
-
+
// sv_clones
if(i == CHIMPULSE_CLONE_MOVING || i == CHIMPULSE_CLONE_STANDING)
if(self.lip < sv_clones)
// haha
if(self.maycheat)
return 1;
-
+
// sv_cheats
if(gamestart_sv_cheats && autocvar_sv_cheats)
return 1;
self.oldvelocity = self.velocity = self.personal.velocity;
self.angles = self.personal.v_angle;
self.fixangle = TRUE;
-
+
MUTATOR_CALLHOOK(AbortSpeedrun);
}
END_CHEAT_FUNCTION();
}
-float Drag(entity e, float grab, float ischeat);
+float Drag(float force_allow_pick, float ischeat);
void Drag_Begin(entity dragger, entity draggee, vector touchpoint);
void Drag_Finish(entity dragger);
float Drag_IsDraggable(entity draggee);
{
// use cheat dragging if cheats are enabled
crosshair_trace_plusvisibletriggers(self);
- Drag(trace_ent, TRUE, TRUE);
+ Drag(TRUE, TRUE);
}
else
{
- // drag is TRUE if the object can be picked up. While an object is being carried, the Drag() function
- // must execute for it either way, otherwise it would cause bugs if it went out of the player's trace.
- // This also makes sure that an object can only pe picked up if in range, but does not get dropped if
- // it goes out of range while slinging it around.
-
- float drag;
- crosshair_trace_plusvisibletriggers(self);
- drag = FALSE;
- if(vlen(self.origin - trace_ent.origin) <= autocvar_g_grab_range)
- {
- switch(trace_ent.grab)
- {
- case 0: // can't grab
- break;
- case 1: // owner can grab
- if(trace_ent.owner == self || trace_ent.realowner == self)
- drag = TRUE;
- break;
- case 2: // owner and team mates can grab
- if(SAME_TEAM(trace_ent.owner, self) || SAME_TEAM(trace_ent.realowner, self) || trace_ent.team == self.team)
- drag = TRUE;
- break;
- case 3: // anyone can grab
- drag = TRUE;
- break;
- default:
- break;
- }
- }
- Drag(trace_ent, drag, FALSE); // execute dragging
+ Drag(FALSE, FALSE); // execute dragging
}
break;
}
// ENTITY DRAGGING
-float Drag(entity e, float pick, float ischeat)
+float Drag(float force_allow_pick, float ischeat)
{
BEGIN_CHEAT_FUNCTION();
else
{
if(Drag_CanDrag(self))
- if(self.BUTTON_DRAG && pick)
+ if(self.BUTTON_DRAG)
{
- if(e)
+ crosshair_trace_plusvisibletriggers(self);
+ entity e = trace_ent;
+ float pick = force_allow_pick;
+ if (e && !pick)
+ {
+ // pick is TRUE if the object can be picked up. While an object is being carried, the Drag() function
+ // must execute for it either way, otherwise it would cause bugs if it went out of the player's trace.
+ // This also makes sure that an object can only pe picked up if in range, but does not get dropped if
+ // it goes out of range while slinging it around.
+
+ if(vlen(self.origin - e.origin) <= autocvar_g_grab_range)
+ {
+ switch(e.grab)
+ {
+ case 0: // can't grab
+ break;
+ case 1: // owner can grab
+ if(e.owner == self || e.realowner == self)
+ pick = TRUE;
+ break;
+ case 2: // owner and team mates can grab
+ if(SAME_TEAM(e.owner, self) || SAME_TEAM(e.realowner, self) || e.team == self.team)
+ pick = TRUE;
+ break;
+ case 3: // anyone can grab
+ pick = TRUE;
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ // Find e and pick
+ if(e && pick)
if(Drag_IsDraggable(e))
{
if(ischeat)
MUTATOR_CALLHOOK(MakePlayerObserver);
Portal_ClearAll(self);
-
+
if(self.alivetime)
{
if(!warmup_stage)
}
if(self.vehicle)
- vehicles_exit(VHEF_RELESE);
+ vehicles_exit(VHEF_RELESE);
WaypointSprite_PlayerDead();
- if not(g_ca) // don't reset teams when moving a ca player to the spectators
+ if (!g_ca) // don't reset teams when moving a ca player to the spectators
self.team = -1; // move this as it is needed to log the player spectating in eventlog
if(self.killcount != -666)
accuracy_resend(self);
self.spectatortime = time;
-
+
self.classname = "observer";
self.iscreature = FALSE;
self.teleportable = TELEPORT_SIMPLE;
self.ammo_fuel = warmup_start_ammo_fuel;
self.health = warmup_start_health;
self.armorvalue = warmup_start_armorvalue;
- self.weapons = warmup_start_weapons;
+ self.weapons = WARMUP_START_WEAPONS;
}
else
{
//stuffcmd(self, "chase_active 0");
//stuffcmd(self, "set viewsize $tmpviewsize \n");
-
+
target_voicescript_clear(self);
// reset fields the weapons may use
if(!self.killindicator_teamchange)
{
self.vehicle_health = -1;
- Damage(self, self, self, 1 , DEATH_KILL, self.origin, '0 0 0');
+ Damage(self, self, self, 1 , DEATH_KILL, self.origin, '0 0 0');
}
}
if(gameover) return;
if(self.player_blocked) return;
if(self.freezetag_frozen) return;
-
+
ClientKill_TeamChange(0);
}
string s;
// NOTE: we do NOT check crypto_keyfp here, an unsigned ID is fine too for this
- if not(p.crypto_idfp)
+ if (!p.crypto_idfp)
return 0;
// this function allows abbreviated player IDs too!
if(self.vehicle)
vehicles_exit(VHEF_RELESE);
- if not(IS_CLIENT(self))
+ if (!IS_CLIENT(self))
{
print("Warning: ClientDisconnect without ClientConnect\n");
return;
if(autocvar_sv_eventlog)
GameLogEcho(strcat(":part:", ftos(self.playerid)));
-
+
Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_QUIT_DISCONNECT, self.netname);
MUTATOR_CALLHOOK(ClientDisconnect);
Fire_ApplyDamage(self);
Fire_ApplyEffect(self);
- if not(g_minstagib)
+ if (!g_minstagib)
{
if (self.items & IT_STRENGTH)
{
self.superweapons_finished = 0;
}
}
-
+
if(autocvar_g_nodepthtestplayers)
self.effects = self.effects | EF_NODEPTHTEST;
self.event_damage(self, self, 1, DEATH_ROT, self.origin, '0 0 0');
}
- if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
+ if (!(self.items & IT_UNLIMITED_WEAPON_AMMO))
self.ammo_fuel = CalcRotRegen(self.ammo_fuel, minf, autocvar_g_balance_fuel_regen, autocvar_g_balance_fuel_regenlinear, regen_mod * frametime * (time > self.pauseregen_finished) * ((self.items & IT_FUEL_REGEN) != 0), maxf, autocvar_g_balance_fuel_rot, autocvar_g_balance_fuel_rotlinear, rot_mod * frametime * (time > self.pauserotfuel_finished), limitf);
}
setorigin(self, spectatee.origin);
setsize(self, spectatee.mins, spectatee.maxs);
SetZoomState(spectatee.zoomstate);
-
+
anticheat_spectatecopy(spectatee);
self.hud = spectatee.hud;
if(spectatee.vehicle)
self.vehicle_reload2 = spectatee.vehicle_reload2;
msg_entity = self;
-
+
WriteByte (MSG_ONE, SVC_SETVIEWANGLES);
WriteAngle(MSG_ONE, spectatee.v_angle_x);
WriteAngle(MSG_ONE, spectatee.v_angle_y);
WriteAngle(MSG_ONE, spectatee.v_angle_z);
//WriteByte (MSG_ONE, SVC_SETVIEW);
- // WriteEntity(MSG_ONE, self);
+ // WriteEntity(MSG_ONE, self);
//makevectors(spectatee.v_angle);
- //setorigin(self, spectatee.origin - v_forward * 400 + v_up * 300);*/
+ //setorigin(self, spectatee.origin - v_forward * 400 + v_up * 300);*/
}
}
float SpectateUpdate() {
if(!self.enemy)
- return 0;
+ return 0;
if (self == self.enemy)
return 0;
- if not(IS_PLAYER(self.enemy))
+ if (!IS_PLAYER(self.enemy))
return 0;
SpectateCopy(self.enemy);
if (start.team == self.team) {
return start;
}
-
+
other = start;
// continue from current player
while(other && other.team != self.team) {
other = find(other, classname, "player");
}
-
+
if (!other) {
// restart from begining
other = find(other, classname, "player");
other = find(other, classname, "player");
}
}
-
+
return other;
}
{
// NOTE: chain order is from the highest to the lower entnum (unlike find)
other = findchain(classname, "player");
- if not(other) // no player
+ if (!other) // no player
return FALSE;
entity first = other;
do { other = other.chain; }
while(other && other.team != self.team);
- if not(other)
+ if (!other)
{
other = first;
while(other.team != self.team)
void PlayerUseKey()
{
- if not(IS_PLAYER(self))
+ if (!IS_PLAYER(self))
return;
if(self.vehicle)
vehicles_exit(VHEF_NORMAL);
return;
}
-
+
// a use key was pressed; call handlers
MUTATOR_CALLHOOK(PlayerUseKey);
}
if(frametime)
player_anim();
button_pressed = (self.BUTTON_ATCK || self.BUTTON_JUMP || self.BUTTON_ATCK2 || self.BUTTON_HOOK || self.BUTTON_USE);
-
+
if (self.deadflag == DEAD_DYING)
{
if(self.respawn_flags & RESPAWN_FORCE)
if(frametime)
player_anim();
-
+
// secret status
secrets_setstatus();
-
+
self.dmg_team = max(0, self.dmg_team - autocvar_g_teamdamage_resetspeed * frametime);
//self.angles_y=self.v_angle_y + 90; // temp
return; // intermission or finale
GetPressedKeys();
}
-
+
#ifdef TETRIS
}
#endif
if((g_cts || g_race) && self.cvar_cl_allow_uidtracking == 1 && self.cvar_cl_allow_uid2name == 1)
{
- if not(self.stored_netname)
+ if (!self.stored_netname)
self.stored_netname = strzone(uid2name(self.crypto_idfp));
if(self.stored_netname != self.netname)
{
if (timeout_status == TIMEOUT_ACTIVE) //don't allow any impulses while the game is paused
return;
-
+
if(self.vehicle)
if(self.vehicle.deadflag == DEAD_NO)
if(self.vehicle.vehicles_impusle)
if(self.vehicle.vehicles_impusle(imp))
return;
-
+
if(CheatImpulse(imp))
{
}
case 33:
if(self.deadflag == DEAD_NO && teamplay)
{
- if not(MUTATOR_CALLHOOK(HelpMePing))
+ if (!MUTATOR_CALLHOOK(HelpMePing))
{
wp = WaypointSprite_Attach("helpme", TRUE, RADARICON_HELPME, '1 0.5 0');
if(!wp)
case 104:
e = navigation_findnearestwaypoint(self, FALSE);
if (e)
- if not(e.wpflags & WAYPOINTFLAG_GENERATED)
+ if (!(e.wpflags & WAYPOINTFLAG_GENERATED))
{
bprint(strcat("Waypoint removed at ",vtos(e.origin),"\n"));
waypoint_remove(e);
{
print("cannot reach me: ", etos(e), " ", vtos(e.origin), "\n");
e.colormod_x = 8;
- if not(e.effects & EF_NODEPTHTEST) // not already reported before
+ if(!(e.effects & EF_NODEPTHTEST)) // not already reported before
++m;
e.effects |= EF_NODEPTHTEST | EF_RED;
++i;
player_multijump = doublejump;
if(MUTATOR_CALLHOOK(PlayerJump))
return;
-
+
doublejump = player_multijump;
float mjumpheight;
-
+
if (autocvar_sv_doublejump)
{
tracebox(self.origin + '0 0 0.01', self.mins, self.maxs, self.origin - '0 0 0.01', MOVE_NORMAL, self);
self.flags &= ~FL_JUMPRELEASED;
animdecide_setaction(self, ANIMACTION_JUMP, TRUE);
-
+
if(autocvar_g_jump_grunt)
PlayerSound(playersound_jump, CH_PLAYER, VOICETYPE_PLAYERSOUND);
}
else
vel_perpend = vel_perpend * max(0, 1 - frametime * wishspeed * sidefric);
-
+
vel_xy = vel_straight * wishdir + vel_perpend;
-
+
if(speedclamp >= 0)
{
float vel_xy_preclamp;
string c;
WarpZone_PlayerPhysics_FixVAngle();
-
+
maxspd_mod = 1;
if(self.ballcarried)
if(g_nexball)
return;
bot_think();
}
-
+
self.items &= ~IT_USING_JETPACK;
if(IS_PLAYER(self))
if(self.conveyor.state)
self.velocity -= self.conveyor.movedir;
- if not(IS_PLAYER(self))
+ if (!IS_PLAYER(self))
{
maxspd_mod = autocvar_sv_spectator_speed_multiplier;
if(!self.spectatorspeed)
if(self.waterlevel < WATERLEVEL_SWIMMING)
if(time >= self.ladder_time)
- if not(self.hook)
+ if (!self.hook)
{
self.nextstep = time + 0.3 + random() * 0.1;
trace_dphitq3surfaceflags = 0;
tracebox(self.origin, self.mins, self.maxs, self.origin - '0 0 1', MOVE_NOMONSTERS, self);
- if not(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOSTEPS)
+ if (!(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOSTEPS))
{
if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_METALSTEPS)
GlobalSound(globalsound_metalfall, CH_PLAYER, VOICETYPE_PLAYERSOUND);
if (f > 0 && wishvel != '0 0 0')
{
self.velocity = self.velocity + wishvel * f * frametime;
- if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
+ if (!(self.items & IT_UNLIMITED_WEAPON_AMMO))
self.ammo_fuel -= autocvar_g_jetpack_fuel * frametime * fvel * f;
self.flags &= ~FL_ONGROUND;
self.items |= IT_USING_JETPACK;
ear1 += v_right * -10;
ear2 += v_right * +10;
d = inflictor.origin - self.origin;
- f = (d * v_right) / vlen(d); // this is cos of angle of d and v_right!
+ if (d)
+ f = (d * v_right) / vlen(d); // this is cos of angle of d and v_right!
+ else
+ f = 0; // Assum ecenter.
force = v_right * vlen(force);
Violence_GibSplash_At(ear1, force * -1, 2, bound(0, damage, 25) / 2 * (0.5 - 0.5 * f), self, attacker);
Violence_GibSplash_At(ear2, force, 2, bound(0, damage, 25) / 2 * (0.5 + 0.5 * f), self, attacker);
msgin = formatmessage(msgin);
- if not(IS_PLAYER(source))
+ if (!IS_PLAYER(source))
colorstr = "^0"; // black for spectators
else if(teamplay)
colorstr = Team_ColorCode(source.team);
}
if(!privatesay)
- if not(IS_PLAYER(source))
+ if (!IS_PLAYER(source))
{
- if not(intermission_running)
+ if (!intermission_running)
if(teamsay || (autocvar_g_chat_nospectators == 1) || (autocvar_g_chat_nospectators == 2 && !(warmup_stage || gameover)))
teamsay = -1; // spectators
}
{
sprint(source, sourcemsgstr);
sprint(privatesay, msgstr);
- if not(autocvar_g_chat_tellprivacy) { dedicated_print(msgstr); } // send to server console too if "tellprivacy" is disabled
+ if (!autocvar_g_chat_tellprivacy) { dedicated_print(msgstr); } // send to server console too if "tellprivacy" is disabled
if(cmsgstr != "")
centerprint(privatesay, cmsgstr);
}
{
sprint(source, sourcemsgstr);
dedicated_print(msgstr); // send to server console too
- FOR_EACH_REALCLIENT(head) if not(IS_PLAYER(head))
+ FOR_EACH_REALCLIENT(head) if (!IS_PLAYER(head))
if(head != source)
sprint(head, msgstr);
}
}
fclose(fh);
- if not(allvoicesamples)
+ if (!allvoicesamples)
{
#define _VOICEMSG(m) allvoicesamples = strcat(allvoicesamples, " ", #m);
ALLVOICEMSGS
return 0;
if(w == 0)
return 0;
-
+
wa = W_AmmoItemCode(w);
if(start_weapons & WepSet_FromWeapon(w))
{
W_SwitchWeapon_Force(self, w_getbestweapon(self));
a = W_ThrowNewWeapon(self, w, doreduce, self.origin + delta, velo);
-
- if not(a) return;
+
+ if (!a) return;
Send_Notification(NOTIF_ONE, self, MSG_MULTI, ITEM_WEAPON_DROP, a, w);
}
self.switchingweapon = self.switchweapon;
entity oldwep = get_weaponinfo(self.weapon);
-
+
#ifndef INDEPENDENT_ATTACK_FINISHED
if(ATTACK_FINISHED(self) <= time + self.weapon_frametime * 0.5)
{
lag = ANTILAG_LATENCY(player);
if(lag < 0.001)
lag = 0;
- if not(IS_REAL_CLIENT(player))
+ if (!IS_REAL_CLIENT(player))
lag = 0; // only antilag for clients
org = player.origin + player.view_ofs;
}
self.angles = '0 0 0';
-
+
float f = (self.owner.weapon_nextthink - time);
if (self.state == WS_RAISE && !intermission_running)
{
complain = 0;
if(complain)
self.hasweapon_complain_spam = time + 0.2;
-
+
if(wpn == WEP_HOOK && !g_grappling_hook && autocvar_g_nades && !((cl.weapons | weaponsInMap) & WepSet_FromWeapon(wpn)))
complain = 0;
{
if(e.classname == "droppedweapon")
continue;
- if not(e.flags & FL_ITEM)
+ if (!(e.flags & FL_ITEM))
continue;
WaypointSprite_Spawn(
s,
.float prevwarntime;
float weapon_prepareattack_checkammo(float secondary)
{
- if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
+ if (!(self.items & IT_UNLIMITED_WEAPON_AMMO))
if (!weapon_action(self.weapon, WR_CHECKAMMO1 + secondary))
{
// always keep the Mine Layer if we placed mines, so that we can detonate them
{
W_SwitchToOtherWeapon(self);
}
-
+
return FALSE;
}
return TRUE;
if(spread <= 0)
return forward;
sstyle = autocvar_g_projectiles_spread_style;
-
+
if(sstyle == 0)
{
// this is the baseline for the spread value!
e = get_weaponinfo(self.weapon);
// don't reload weapons that don't have the RELOADABLE flag
- if not(e.spawnflags & WEP_FLAG_RELOADABLE)
+ if (!(e.spawnflags & WEP_FLAG_RELOADABLE))
{
dprint("Warning: Attempted to reload a weapon that does not have the WEP_FLAG_RELOADABLE flag. Fix your code!\n");
return;
// no ammo, so nothing to load
if(!self.(self.current_ammo) && self.reload_ammo_min)
- if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
+ if (!(self.items & IT_UNLIMITED_WEAPON_AMMO))
{
if(IS_REAL_CLIENT(self) && self.reload_complain < time)
{
self.reload_complain = time + 1;
}
// switch away if the amount of ammo is not enough to keep using this weapon
- if not(weapon_action(self.weapon, WR_CHECKAMMO1) + weapon_action(self.weapon, WR_CHECKAMMO2))
+ if (!(weapon_action(self.weapon, WR_CHECKAMMO1) + weapon_action(self.weapon, WR_CHECKAMMO2)))
{
self.clip_load = -1; // reload later
W_SwitchToOtherWeapon(self);
string ip = argv(1);
float reason_arg, bantime;
string reason;
-
- reason_arg = 2;
-
+
+ reason_arg = 2;
+
GET_BAN_ARG(bantime, autocvar_g_ban_default_bantime);
GET_BAN_REASON(reason, "No reason provided");
return;
}
}
-
+
default:
print("Incorrect parameters for ^2ban^7\n");
case CMD_REQUEST_USAGE:
Ban_View();
return;
}
-
+
default:
case CMD_REQUEST_USAGE:
{
float accepted = VerifyClientEntity(client, TRUE, FALSE);
float reason_arg, bantime, masksize;
string reason;
-
- if(accepted > 0)
+
+ if(accepted > 0)
{
- reason_arg = next_token;
+ reason_arg = next_token;
GET_BAN_ARG(bantime, autocvar_g_ban_default_bantime);
GET_BAN_ARG(masksize, autocvar_g_ban_default_masksize);
GET_BAN_REASON(reason, "No reason provided");
Ban_KickBanClient(client, bantime, masksize, reason);
-
+
return;
}
else
{
- print("kickban: ", GetClientErrorString(accepted, argv(1)), ".\n");
+ print("kickban: ", GetClientErrorString(accepted, argv(1)), ".\n");
}
}
}
-
+
default:
print("Incorrect parameters for ^2kickban^7\n");
case CMD_REQUEST_USAGE:
{
entity client = GetFilteredEntity(argv(1));
float accepted = VerifyClientEntity(client, TRUE, FALSE);
-
- if(accepted > 0)
+
+ if(accepted > 0)
{
client.muted = TRUE;
return;
}
else
{
- print("mute: ", GetClientErrorString(accepted, argv(1)), ".\n");
+ print("mute: ", GetClientErrorString(accepted, argv(1)), ".\n");
}
}
}
-
+
default:
print("Incorrect parameters for ^2mute^7\n");
case CMD_REQUEST_USAGE:
switch(request)
{
case CMD_REQUEST_COMMAND:
- {
+ {
if(argv(1))
{
float tmp_number = -1;
string tmp_string;
-
+
if(substring(argv(1), 0, 1) == "#")
{
tmp_string = substring(argv(1), 1, -1);
-
+
if(tmp_string != "") // is it all one token? like #1
{
tmp_number = stof(tmp_string);
else // maybe it's ONLY a number?
{
tmp_number = stof(argv(1));
-
+
if((tmp_number == 0) && (argv(1) != "0"))
{ tmp_number = -1; }
}
}
}
}
-
+
default:
case CMD_REQUEST_USAGE:
{
{
entity client = GetFilteredEntity(argv(1));
float accepted = VerifyClientEntity(client, TRUE, FALSE);
-
- if(accepted > 0)
+
+ if(accepted > 0)
{
client.muted = FALSE;
return;
}
else
{
- print("unmute: ", GetClientErrorString(accepted, argv(1)), ".\n");
+ print("unmute: ", GetClientErrorString(accepted, argv(1)), ".\n");
}
}
}
-
+
default:
print("Incorrect parameters for ^2mute^7\n");
case CMD_REQUEST_USAGE:
{
case CMD_REQUEST_COMMAND:
{
-
+
return;
}
-
+
default:
case CMD_REQUEST_USAGE:
{
{
#define BAN_COMMAND(name,function,description) \
{ if(strtolower(description) != "") { print(" ^2", name, "^7: ", description, "\n"); } }
-
+
BAN_COMMANDS(0, 0, "")
#undef BAN_COMMAND
-
+
return;
}
{
#define BAN_COMMAND(name,function,description) \
{ if(name == strtolower(argv(0))) { function; return TRUE; } }
-
+
BAN_COMMANDS(CMD_REQUEST_COMMAND, argc, command)
#undef BAN_COMMAND
-
+
return FALSE;
}
{
#define BAN_COMMAND(name,function,description) \
{ if(name == strtolower(argv(1))) { function; return TRUE; } }
-
+
BAN_COMMANDS(CMD_REQUEST_USAGE, argc, "")
#undef BAN_COMMAND
-
+
return FALSE;
}
{
#define BAN_COMMAND(name,function,description) \
{ if(strtolower(description) != "") { CMD_Write_Alias("qc_cmd_sv", name, description); } }
-
+
BAN_COMMANDS(0, 0, "")
#undef BAN_COMMAND
-
+
return;
}
float BanCommand(string command)
{
float argc = tokenize_console(command);
-
+
// Guide for working with argc arguments by example:
// argc: 1 - 2 - 3 - 4
- // argv: 0 - 1 - 2 - 3
+ // argv: 0 - 1 - 2 - 3
// cmd vote - master - login - password
if(BanCommand_macro_command(argc, command)) // continue as usual and scan for normal commands
{
return TRUE; // handled by one of the above GenericCommand_* functions
}
-
+
return FALSE;
}
float SV_ParseClientCommand_floodcheck()
{
- if not(timeout_status) // not while paused
+ if (!timeout_status) // not while paused
{
if(time <= (self.cmd_floodtime + autocvar_sv_clientcommand_antispam_time))
{
return;
}
}
-
+
default:
sprint(self, "Incorrect parameters for ^2autoswitch^7\n");
case CMD_REQUEST_USAGE:
{
sprint(self, "\nUsage:^3 cmd autoswitch selection\n");
- sprint(self, " Where 'selection' controls if autoswitch is on or off.\n");
+ sprint(self, " Where 'selection' controls if autoswitch is on or off.\n");
return;
}
}
self.checkfail = 1;
return; // never fall through to usage
}
-
+
default:
sprint(self, "Incorrect parameters for ^2checkfail^7\n");
case CMD_REQUEST_USAGE:
if(IS_CLIENT(self))
{
self.version = ((argv(1) == "$gameversion") ? 1 : stof(argv(1)));
-
+
if(self.version < autocvar_gameversion_min || self.version > autocvar_gameversion_max)
{
self.version_mismatch = 1;
ClientKill_TeamChange(-2); // observe
- }
- else if(autocvar_g_campaign || autocvar_g_balance_teams)
+ }
+ else if(autocvar_g_campaign || autocvar_g_balance_teams)
{
//JoinBestTeam(self, FALSE, TRUE);
- }
- else if(teamplay && !autocvar_sv_spectate && !(self.team_forced > 0))
+ }
+ else if(teamplay && !autocvar_sv_spectate && !(self.team_forced > 0))
{
self.classname = "observer"; // really?
stuffcmd(self, "menu_showteamselect\n");
}
}
-
+
return;
}
}
-
+
default:
sprint(self, "Incorrect parameters for ^2clientversion^7\n");
case CMD_REQUEST_USAGE:
{
if(argv(1) != "")
{
- if(intermission_running)
+ if(intermission_running)
MapVote_SendPicture(stof(argv(1)));
return;
}
}
-
+
default:
sprint(self, "Incorrect parameters for ^2mv_getpicture^7\n");
case CMD_REQUEST_USAGE:
}
}
-void ClientCommand_join(float request)
+void ClientCommand_join(float request)
{
switch(request)
{
{
if(!IS_PLAYER(self) && !lockteams)
{
- if(nJoinAllowed(self))
+ if(nJoinAllowed(self))
{
if(autocvar_g_campaign) { campaign_bots_may_start = 1; }
Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_JOIN_PLAY, self.netname);
PutClientInServer();
}
- else
+ else
{
//player may not join because of g_maxplayers is set
Send_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, CENTER_JOIN_PREVENT);
}
return; // never fall through to usage
}
-
+
default:
case CMD_REQUEST_USAGE:
{
}
// cannot reset the game while a timeout is active!
- if not(timeout_status)
+ if (!timeout_status)
ReadyCount();
} else {
sprint(self, "^1Game has already been restarted\n");
}
return; // never fall through to usage
}
-
+
default:
case CMD_REQUEST_USAGE:
{
if(argc >= 2) { Say(self, FALSE, world, substring(command, argv_start_index(1), argv_end_index(-1) - argv_start_index(1)), 1); }
return; // never fall through to usage
}
-
+
default:
case CMD_REQUEST_USAGE:
{
if(argc >= 2) { Say(self, TRUE, world, substring(command, argv_start_index(1), argv_end_index(-1) - argv_start_index(1)), 1); }
return; // never fall through to usage
}
-
+
default:
case CMD_REQUEST_USAGE:
{
if(IS_CLIENT(self))
{
if(teamplay)
- if not(self.team_forced > 0)
- if not(lockteams)
+ if(self.team_forced <= 0)
+ if (!lockteams)
{
float selection;
-
+
switch(argv(1))
{
case "red": selection = NUM_TEAM_1; break;
case "yellow": selection = NUM_TEAM_3; break;
case "pink": selection = NUM_TEAM_4; break;
case "auto": selection = (-1); break;
-
+
default: selection = 0; break;
}
-
+
if(selection)
{
if(self.team == selection && self.deadflag == DEAD_NO)
else
sprint(self, "^7selectteam can only be used in teamgames\n");
}
- return;
+ return;
}
}
return;
}
}
-
+
default:
sprint(self, "Incorrect parameters for ^2selectteam^7\n");
case CMD_REQUEST_USAGE:
{
//float tokens;
string s;
-
+
if(argc == 2) // undefined cvar: use the default value on the server then
{
s = strcat(substring(command, argv_start_index(0), argv_end_index(1) - argv_start_index(0)), " \"", cvar_defstring(argv(1)), "\"");
tokenize_console(s);
}
-
+
GetCvars(1);
-
+
return;
}
}
-
+
default:
sprint(self, "Incorrect parameters for ^2sentcvar^7\n");
case CMD_REQUEST_USAGE:
}
}
-void ClientCommand_spectate(float request)
+void ClientCommand_spectate(float request)
{
switch(request)
{
return;
}
}
-
- if(IS_PLAYER(self) && autocvar_sv_spectate == 1)
+
+ if(IS_PLAYER(self) && autocvar_sv_spectate == 1)
ClientKill_TeamChange(-2); // observe
// in CA, allow a dead player to move to spectators (without that, caplayer!=0 will be moved back to the player list)
}
return; // never fall through to usage
}
-
+
default:
case CMD_REQUEST_USAGE:
{
return;
}
}
-
+
default:
sprint(self, "Incorrect parameters for ^2suggestmap^7\n");
case CMD_REQUEST_USAGE:
{
entity tell_to = GetIndexedEntity(argc, 1);
float tell_accepted = VerifyClientEntity(tell_to, TRUE, FALSE);
-
+
if(tell_accepted > 0) // the target is a real client
{
if(tell_to != self) // and we're allowed to send to them :D
}
else { print_to(self, "You can't ^2tell^7 a message to yourself."); return; }
}
- else if(argv(1) == "#0")
- {
+ else if(argv(1) == "#0")
+ {
trigger_magicear_processmessage_forallears(self, -1, world, substring(command, argv_start_index(next_token), argv_end_index(-1) - argv_start_index(next_token)));
return;
}
else { print_to(self, strcat("tell: ", GetClientErrorString(tell_accepted, argv(1)), ".")); return; }
}
}
-
+
default:
sprint(self, "Incorrect parameters for ^2tell^7\n");
case CMD_REQUEST_USAGE:
}
}
-void ClientCommand_voice(float request, float argc, string command)
+void ClientCommand_voice(float request, float argc, string command)
{
switch(request)
{
VoiceMessage(argv(1), substring(command, argv_start_index(2), argv_end_index(-1) - argv_start_index(2)));
else
VoiceMessage(argv(1), "");
-
+
return;
}
}
-
+
default:
sprint(self, "Incorrect parameters for ^2voice^7\n");
case CMD_REQUEST_USAGE:
{
case CMD_REQUEST_COMMAND:
{
-
+
return; // never fall through to usage
}
-
+
default:
case CMD_REQUEST_USAGE:
{
CLIENT_COMMAND("tell", ClientCommand_tell(request, arguments, command), "Send a message directly to a player") \
CLIENT_COMMAND("voice", ClientCommand_voice(request, arguments, command), "Send voice message via sound") \
/* nothing */
-
+
void ClientCommand_macro_help()
{
#define CLIENT_COMMAND(name,function,description) \
{ sprint(self, " ^2", name, "^7: ", description, "\n"); }
-
+
CLIENT_COMMANDS(0, 0, "")
#undef CLIENT_COMMAND
-
+
return;
}
{
#define CLIENT_COMMAND(name,function,description) \
{ if(name == strtolower(argv(0))) { function; return TRUE; } }
-
+
CLIENT_COMMANDS(CMD_REQUEST_COMMAND, argc, command)
#undef CLIENT_COMMAND
-
+
return FALSE;
}
{
#define CLIENT_COMMAND(name,function,description) \
{ if(name == strtolower(argv(1))) { function; return TRUE; } }
-
+
CLIENT_COMMANDS(CMD_REQUEST_USAGE, argc, "")
#undef CLIENT_COMMAND
-
+
return FALSE;
}
void ClientCommand_macro_write_aliases(float fh)
{
#define CLIENT_COMMAND(name,function,description) \
- { CMD_Write_Alias("qc_cmd_cmd", name, description); }
-
+ { CMD_Write_Alias("qc_cmd_cmd", name, description); }
+
CLIENT_COMMANDS(0, 0, "")
#undef CLIENT_COMMAND
-
+
return;
}
return;
float argc = tokenize_console(command);
-
+
// for the mutator hook system
cmd_name = strtolower(argv(0));
cmd_argc = argc;
cmd_string = command;
-
+
// Guide for working with argc arguments by example:
// argc: 1 - 2 - 3 - 4
- // argv: 0 - 1 - 2 - 3
+ // argv: 0 - 1 - 2 - 3
// cmd vote - master - login - password
-
+
// for floodcheck
switch(strtolower(argv(0)))
{
case "prespawn": break; // handled by engine in host_cmd.c
case "sentcvar": break; // handled by server in this file
case "spawn": break; // handled by engine in host_cmd.c
-
- default:
+
+ default:
if(SV_ParseClientCommand_floodcheck())
break; // "TRUE": continue, as we're not flooding yet
else
return; // "FALSE": not allowed to continue, halt // print("^1ERROR: ^7ANTISPAM CAUGHT: ", command, ".\n");
}
-
+
/* NOTE: should this be disabled? It can be spammy perhaps, but hopefully it's okay for now */
- if(argv(0) == "help")
+ if(argv(0) == "help")
{
- if(argc == 1)
+ if(argc == 1)
{
sprint(self, "\nClient networked commands:\n");
ClientCommand_macro_help();
-
+
sprint(self, "\nCommon networked commands:\n");
CommonCommand_macro_help(self);
-
+
sprint(self, "\nUsage:^3 cmd COMMAND...^7, where possible commands are listed above.\n");
sprint(self, "For help about a specific command, type cmd help COMMAND\n");
return;
- }
+ }
else if(CommonCommand_macro_usage(argc, self)) // Instead of trying to call a command, we're going to see detailed information about it
{
return;
{
return;
}
- }
+ }
else if(MUTATOR_CALLHOOK(SV_ParseClientCommand))
{
return; // handled by a mutator
}
- else if(CheatCommand(argc))
+ else if(CheatCommand(argc))
{
return; // handled by server/cheats.qc
}
// verify that the client provided is acceptable for use
float VerifyClientEntity(entity client, float must_be_real, float must_be_bots)
{
- if not(IS_CLIENT(client))
+ if (!IS_CLIENT(client))
return CLIENT_DOESNT_EXIST;
else if(must_be_real && !IS_REAL_CLIENT(client))
return CLIENT_NOT_REAL;
else if(must_be_bots && !IS_BOT_CLIENT(client))
return CLIENT_NOT_BOT;
-
+
return CLIENT_ACCEPTABLE;
}
entity tmp_player, selection;
float tmp_number, index;
string tmp_string;
-
+
next_token = -1;
index = start_index;
selection = world;
-
+
if(argc > start_index)
{
if(substring(argv(index), 0, 1) == "#")
{
tmp_string = substring(argv(index), 1, -1);
++index;
-
+
if(tmp_string != "") // is it all one token? like #1
{
tmp_number = stof(tmp_string);
tmp_number = stof(argv(index));
++index;
}
-
+
if(VerifyClientNumber(tmp_number))
{
selection = edict_num(tmp_number); // yes, it was a number
FOR_EACH_CLIENT(tmp_player)
if (strdecolorize(tmp_player.netname) == strdecolorize(argv(start_index)))
selection = tmp_player;
-
+
index = (start_index + 1);
}
}
-
+
next_token = index;
//print(strcat("start_index: ", ftos(start_index), ", next_token: ", ftos(next_token), ", edict: ", ftos(num_for_edict(selection)), ".\n"));
return selection;
{
entity tmp_player, selection;
float tmp_number;
-
+
if(substring(input, 0, 1) == "#")
tmp_number = stof(substring(input, 1, -1));
else
tmp_number = stof(input);
-
+
if(VerifyClientNumber(tmp_number))
{
selection = edict_num(tmp_number);
if (strdecolorize(tmp_player.netname) == strdecolorize(input))
selection = tmp_player;
}
-
+
return selection;
}
{
entity selection = GetFilteredEntity(input);
float output;
-
+
output = num_for_edict(selection);
return output;
timeout_caller = world;
timeout_time = 0;
timeout_leadtime = 0;
-
+
remove(self);
}
-void timeout_handler_think()
+void timeout_handler_think()
{
entity tmp_player;
-
+
switch(timeout_status)
{
case TIMEOUT_ACTIVE:
else // time to end the timeout
{
timeout_status = TIMEOUT_INACTIVE;
-
+
// reset the slowmo value back to normal
cvar_set("slowmo", ftos(orig_slowmo));
-
+
// unlock the view for players so they can move around again
- FOR_EACH_REALPLAYER(tmp_player)
+ FOR_EACH_REALPLAYER(tmp_player)
tmp_player.fixangle = FALSE;
-
+
timeout_handler_reset();
}
-
+
return;
}
-
+
case TIMEOUT_LEADTIME:
{
if(timeout_leadtime > 0) // countdown is still going
{
Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_TIMEOUT_BEGINNING, timeout_leadtime);
-
+
self.nextthink = time + 1; // think again in one second
timeout_leadtime -= 1; // decrease the time counter
}
else // time to begin the timeout
{
timeout_status = TIMEOUT_ACTIVE;
-
+
// set the slowmo value to the timeout default slowmo value
cvar_set("slowmo", ftos(TIMEOUT_SLOWMO_VALUE));
-
+
// reset all the flood variables
FOR_EACH_CLIENT(tmp_player)
tmp_player.nickspamcount = tmp_player.nickspamtime = tmp_player.floodcontrol_chat =
- tmp_player.floodcontrol_chatteam = tmp_player.floodcontrol_chattell =
+ tmp_player.floodcontrol_chatteam = tmp_player.floodcontrol_chattell =
tmp_player.floodcontrol_voice = tmp_player.floodcontrol_voiceteam = 0;
-
+
// copy .v_angle to .lastV_angle for every player in order to fix their view during pause (see PlayerPreThink)
- FOR_EACH_REALPLAYER(tmp_player)
+ FOR_EACH_REALPLAYER(tmp_player)
tmp_player.lastV_angle = tmp_player.v_angle;
-
+
self.nextthink = time; // think again next frame to handle it under TIMEOUT_ACTIVE code
}
-
+
return;
}
-
-
+
+
case TIMEOUT_INACTIVE:
default:
{
print_to(caller, cvar_changes);
return; // never fall through to usage
}
-
+
default:
case CMD_REQUEST_USAGE:
{
print_to(caller, cvar_purechanges);
return; // never fall through to usage
}
-
+
default:
case CMD_REQUEST_USAGE:
{
}
}
-void CommonCommand_info(float request, entity caller, float argc)
-{
+void CommonCommand_info(float request, entity caller, float argc)
+{
switch(request)
{
case CMD_REQUEST_COMMAND:
{
- string command = builtin_cvar_string(strcat("sv_info_", argv(1)));
-
+ string command = builtin_cvar_string(strcat("sv_info_", argv(1)));
+
if(command)
- wordwrap_sprint(command, 1000);
+ wordwrap_sprint(command, 1000);
else
print_to(caller, "ERROR: unsupported info command");
-
+
return; // never fall through to usage
}
-
+
default:
case CMD_REQUEST_USAGE:
{
print_to(caller, ladder_reply);
return; // never fall through to usage
}
-
+
default:
case CMD_REQUEST_USAGE:
{
print_to(caller, lsmaps_reply);
return; // never fall through to usage
}
-
+
default:
case CMD_REQUEST_USAGE:
{
print_to(caller, maplist_reply);
return; // never fall through to usage
}
-
+
default:
case CMD_REQUEST_USAGE:
{
print_to(caller, rankings_reply);
return; // never fall through to usage
}
-
+
default:
case CMD_REQUEST_USAGE:
{
}
void CommonCommand_records(float request, entity caller)
-{
+{
switch(request)
{
case CMD_REQUEST_COMMAND:
{
float i;
-
+
for(i = 0; i < 10; ++i)
if(records_reply[i] != "")
print_to(caller, records_reply[i]);
-
+
return; // never fall through to usage
}
-
+
default:
case CMD_REQUEST_USAGE:
{
Score_NicePrint(caller);
return; // never fall through to usage
}
-
+
default:
case CMD_REQUEST_USAGE:
{
print_to(caller, strcat("gmtime = ", strftime(FALSE, "%a %b %e %H:%M:%S %Z %Y")));
return;
}
-
+
default:
case CMD_REQUEST_USAGE:
{
{
if(!caller || autocvar_sv_timeout)
{
- if not(timeout_status) { print_to(caller, "^7Error: There is no active timeout called."); }
+ if (!timeout_status) { print_to(caller, "^7Error: There is no active timeout called."); }
else if(caller && (caller != timeout_caller)) { print_to(caller, "^7Error: You are not allowed to stop the active timeout."); }
-
+
else // everything should be okay, continue aborting timeout
{
switch(timeout_status)
bprint(strcat("^7The timeout was aborted by ", GetCallerName(caller), " !\n"));
return;
}
-
+
case TIMEOUT_ACTIVE:
{
timeout_time = autocvar_sv_timeout_resumetime;
bprint(strcat("^1Attention: ^7", GetCallerName(caller), " resumed the game! Prepare for battle!\n"));
return;
}
-
+
default: dprint("timeout status was inactive, but this code was executed anyway?"); return;
}
}
}
else { print_to(caller, "^1Timeins are not allowed to be called, enable them with sv_timeout 1.\n"); }
-
+
return; // never fall through to usage
}
-
+
default:
case CMD_REQUEST_USAGE:
{
if(!caller || autocvar_sv_timeout)
{
float last_possible_timeout = ((autocvar_timelimit * 60) - autocvar_sv_timeout_leadtime - 1);
-
+
if(timeout_status) { print_to(caller, "^7Error: A timeout is already active."); }
else if(vote_called) { print_to(caller, "^7Error: You can not call a timeout while a vote is active."); }
else if(warmup_stage && !g_warmup_allow_timeout) { print_to(caller, "^7Error: You can not call a timeout in warmup-stage."); }
else if(caller && (caller.allowed_timeouts < 1)) { print_to(caller, "^7Error: You already used all your timeout calls for this map."); }
else if(caller && !IS_PLAYER(caller)) { print_to(caller, "^7Error: You must be a player to call a timeout."); }
else if((autocvar_timelimit) && (last_possible_timeout < time - game_starttime)) { print_to(caller, "^7Error: It is too late to call a timeout now!"); }
-
+
else // everything should be okay, proceed with starting the timeout
- {
+ {
if(caller) { caller.allowed_timeouts -= 1; }
-
+
bprint(GetCallerName(caller), " ^7called a timeout", (caller ? strcat(" (", ftos(caller.allowed_timeouts), " timeout(s) left)") : ""), "!\n"); // write a bprint who started the timeout (and how many they have left)
-
+
timeout_status = TIMEOUT_LEADTIME;
timeout_caller = caller;
timeout_time = autocvar_sv_timeout_length;
timeout_leadtime = autocvar_sv_timeout_leadtime;
-
+
timeout_handler = spawn();
timeout_handler.think = timeout_handler_think;
timeout_handler.nextthink = time; // always let the entity think asap
}
}
else { print_to(caller, "^1Timeouts are not allowed to be called, enable them with sv_timeout 1.\n"); }
-
+
return; // never fall through to usage
}
-
+
default:
case CMD_REQUEST_USAGE:
{
{
float total_listed_players, is_bot;
entity tmp_player;
-
+
float privacy = (caller && autocvar_sv_status_privacy);
string separator = strreplace("%", " ", strcat((argv(1) ? argv(1) : " "), "^7"));
string tmp_netaddress, tmp_crypto_idfp;
-
+
print_to(caller, strcat("List of client information", (privacy ? " (some data is hidden for privacy)" : ""), ":"));
- print_to(caller, sprintf(strreplace(" ", separator, " %-4s %-20s %-5s %-3s %-9s %-16s %s "),
+ print_to(caller, sprintf(strreplace(" ", separator, " %-4s %-20s %-5s %-3s %-9s %-16s %s "),
"ent", "nickname", "ping", "pl", "time", "ip", "crypto_id"));
-
+
total_listed_players = 0;
FOR_EACH_CLIENT(tmp_player)
{
is_bot = (IS_BOT_CLIENT(tmp_player));
-
+
if(is_bot)
{
tmp_netaddress = "null/botclient";
tmp_crypto_idfp = tmp_player.crypto_idfp;
}
- print_to(caller, sprintf(strreplace(" ", separator, " #%-3d %-20.20s %-5d %-3d %-9s %-16s %s "),
- num_for_edict(tmp_player),
+ print_to(caller, sprintf(strreplace(" ", separator, " #%-3d %-20.20s %-5d %-3d %-9s %-16s %s "),
+ num_for_edict(tmp_player),
tmp_player.netname,
- tmp_player.ping,
- tmp_player.ping_packetloss,
+ tmp_player.ping,
+ tmp_player.ping_packetloss,
process_time(1, time - tmp_player.jointime),
tmp_netaddress,
tmp_crypto_idfp));
-
+
++total_listed_players;
}
-
+
print_to(caller, strcat("Finished listing ", ftos(total_listed_players), " client(s) out of ", ftos(maxclients), " slots."));
-
+
return; // never fall through to usage
}
-
+
default:
case CMD_REQUEST_USAGE:
{
{
case CMD_REQUEST_COMMAND:
{
-
+
return; // never fall through to usage
}
-
+
default:
case CMD_REQUEST_USAGE:
{
{
#define COMMON_COMMAND(name,function,description) \
{ print_to(caller, strcat(" ^2", name, "^7: ", description)); }
-
+
COMMON_COMMANDS(0, caller, 0, "")
#undef COMMON_COMMAND
-
+
return;
}
{
#define COMMON_COMMAND(name,function,description) \
{ if(name == strtolower(argv(0))) { function; return TRUE; } }
-
+
COMMON_COMMANDS(CMD_REQUEST_COMMAND, caller, argc, command)
#undef COMMON_COMMAND
-
+
return FALSE;
}
{
#define COMMON_COMMAND(name,function,description) \
{ if(name == strtolower(argv(1))) { function; return TRUE; } }
-
+
COMMON_COMMANDS(CMD_REQUEST_USAGE, caller, argc, "")
#undef COMMON_COMMAND
-
+
return FALSE;
}
{
#define COMMON_COMMAND(name,function,description) \
{ CMD_Write_Alias("qc_cmd_svcmd", name, description); }
-
+
COMMON_COMMANDS(0, world, 0, "")
#undef COMMON_COMMAND
-
+
return;
}
// without using any extra processing time.
// See common.qc for their proper commands
-
+
string getrecords(float page) // 50 records per page
-{
+{
float rec = 0, r, i;
string h, s;
-
+
s = "";
if (g_ctf)
if (MapInfo_Get_ByID(i))
{
r = stof(db_get(ServerProgsDB, strcat(MapInfo_Map_bspname, "/captimerecord/time")));
-
- if not(r)
+
+ if (!r)
continue;
-
+
// TODO: uid2name
h = db_get(ServerProgsDB, strcat(MapInfo_Map_bspname, "/captimerecord/netname"));
s = strcat(s, strpad(32, MapInfo_Map_bspname), " ", strpad(-6, ftos_decimals(r, 2)), " ", h, "\n");
if (MapInfo_Get_ByID(i))
{
r = race_readTime(MapInfo_Map_bspname, 1);
-
- if not(r)
+
+ if (!r)
continue;
-
+
h = race_readName(MapInfo_Map_bspname, 1);
s = strcat(s, strpad(32, MapInfo_Map_bspname), " ", strpad(-8, TIME_ENCODED_TOSTRING(r)), " ", h, "\n");
++rec;
if (MapInfo_Get_ByID(i))
{
r = race_readTime(MapInfo_Map_bspname, 1);
-
- if not(r)
+
+ if (!r)
continue;
-
+
h = race_readName(MapInfo_Map_bspname, 1);
s = strcat(s, strpad(32, MapInfo_Map_bspname), " ", strpad(-8, TIME_ENCODED_TOSTRING(r)), " ", h, "\n");
++rec;
for (i = 1; i <= RANKINGS_CNT; ++i)
{
t = race_readTime(map, i);
-
+
if (t == 0)
continue;
-
+
n = race_readName(map, i);
p = count_ordinal(i);
s = strcat(s, strpad(8, p), " ", strpad(-8, TIME_ENCODED_TOSTRING(t)), " ", n, "\n");
{
float i, j, k, uidcnt = 0, thiscnt;
string s, temp_s, rr, myuid, thisuid;
-
+
if(g_cts)
rr = CTS_RECORD;
else
// LADDER_CNT+1 = total points
temp_s = db_get(TemporaryDB, strcat("ladder", myuid));
-
+
if(temp_s == "")
{
db_put(TemporaryDB, strcat("uid", ftos(uidcnt)), myuid);
++uidcnt;
-
+
for(j = 0; j <= LADDER_CNT + 1; ++j)
{
if(j != LADDER_CNT + 1)
top_uids[k] = top_uids[k-1];
top_scores[k] = top_scores[k-1];
}
-
+
top_uids[j] = thisuid;
top_scores[j] = thiscnt;
break;
}
}
}
-
+
s = "^3-----------------------\n\n";
-
+
s = strcat(s, "Pos ^3|");
s = strcat(s, " ^7Total ^3|");
-
+
for(i = 1; i <= LADDER_CNT; ++i)
{ s = strcat(s, " ^7", count_ordinal(i), " ^3|"); }
-
+
s = strcat(s, " ^7Speed awards ^3| ^7Name");
s = strcat(s, "\n^3----+--------");
-
+
for(i = 1; i <= min(9, LADDER_CNT); ++i)
{ s = strcat(s, "+-----"); }
-
+
#if LADDER_CNT > 9
for(i = 1; i <= LADDER_CNT - 9; ++i)
{ s = strcat(s, "+------"); }
{
temp_s = db_get(TemporaryDB, strcat("ladder", top_uids[i]));
tokenize_console(temp_s);
-
+
if(argv(LADDER_CNT+1) == "") // total is 0, skip
continue;
-
+
s = strcat(s, strpad(4, count_ordinal(i+1)), "^3| ^7"); // pos
s = strcat(s, strpad(7, argv(LADDER_CNT+1)), "^3| ^7"); // total
-
+
for(j = 1; j <= min(9, LADDER_CNT); ++j)
{ s = strcat(s, strpad(4, argv(j)), "^3| ^7"); } // 1st, 2nd, 3rd etc cnt
-
+
#if LADDER_CNT > 9
for(j = 10; j <= LADDER_CNT; ++j)
{ s = strcat(s, strpad(4, argv(j)), " ^3| ^7"); } // 1st, 2nd, 3rd etc cnt
{
string maplist = "", col;
float i, argc;
-
+
argc = tokenize_console(autocvar_g_maplist);
for(i = 0; i < argc; ++i)
{
return sprintf("^7Maps in list: %s\n", maplist);
}
-
+
string getlsmaps()
{
string lsmaps = "", col;
float i, newmaps = 0;
-
+
for(i = 0; i < MapInfo_count; ++i)
{
if((MapInfo_Get_ByID(i)) && !(MapInfo_Map_flags & MapInfo_ForbiddenFlags()))
// size: pixel width/height
// maxs: cell width/height
// frame: counter
-
+
float i, x, l;
string si;
float RadarMap_Make(float argc)
{
float i;
-
+
if(!radarmapper)
{
radarmapper = spawn();
case "--resolution": { ++i; radarmapper.size_x = stof(argv(i)); ++i; radarmapper.size_y = stof(argv(i)); break; }
case "--qual": // minor alias
case "--quality": { ++i; radarmapper.size_z = stof(argv(i)); break; }
-
- default:
- i = argc;
+
+ default:
+ i = argc;
remove(radarmapper);
radarmapper = world;
break;
}
}
-
- if(radarmapper) // after doing the arguments, see if we successfully went forward.
+
+ if(radarmapper) // after doing the arguments, see if we successfully went forward.
{
print("Radarmap entity spawned.\n");
return TRUE; // if so, don't print usage.
}
}
-
+
return FALSE;
}
{
entity client;
float accepted;
-
+
string targets = strreplace(",", " ", argv(1));
string original_targets = strreplace(" ", ", ", targets);
string admin_message = argv(2);
float infobartime = stof(argv(3));
-
+
string successful, t;
successful = string_null;
-
+
if((targets) && (admin_message))
{
for(;targets;)
{
t = car(targets); targets = cdr(targets);
-
+
// Check to see if the player is a valid target
client = GetFilteredEntity(t);
accepted = VerifyClientEntity(client, TRUE, FALSE);
-
- if not(accepted > 0)
+
+ if(accepted <= 0)
{
- print("adminmsg: ", GetClientErrorString(accepted, t), (targets ? ", skipping to next player.\n" : ".\n"));
+ print("adminmsg: ", GetClientErrorString(accepted, t), (targets ? ", skipping to next player.\n" : ".\n"));
continue;
}
-
+
// send the centerprint/console print or infomessage
if(infobartime)
{
centerprint(client, strcat("^3", admin_name(), ":\n^7", admin_message));
sprint(client, strcat("\{1}\{13}^3", admin_name(), "^7: ", admin_message, "\n"));
}
-
+
successful = strcat(successful, (successful ? ", " : ""), client.netname);
dprint("Message sent to ", client.netname, "\n");
continue;
}
-
+
if(successful)
bprint("Successfully sent message '", admin_message, "' to ", successful, ".\n");
else
print("No players given (", original_targets, ") could receive the message.\n");
-
+
return;
}
}
-
+
default:
print("Incorrect parameters for ^2adminmsg^7\n");
case CMD_REQUEST_USAGE:
ReadyRestart();
return;
}
-
+
default:
case CMD_REQUEST_USAGE:
{
}
void GameCommand_allspec(float request, float argc)
-{
+{
switch(request)
{
case CMD_REQUEST_COMMAND:
entity client;
string reason = argv(1);
float i = 0;
-
+
FOR_EACH_REALPLAYER(client)
{
self = client;
else { print("No players found to spectate.\n"); }
return;
}
-
+
default:
case CMD_REQUEST_USAGE:
{
}
}
-void GameCommand_anticheat(float request, float argc)
+void GameCommand_anticheat(float request, float argc)
{
switch(request)
{
{
entity client = GetIndexedEntity(argc, 1);
float accepted = VerifyClientEntity(client, FALSE, FALSE);
-
- if(accepted > 0)
+
+ if(accepted > 0)
{
self = client;
anticheat_report();
}
else
{
- print("anticheat: ", GetClientErrorString(accepted, argv(1)), ".\n");
+ print("anticheat: ", GetClientErrorString(accepted, argv(1)), ".\n");
}
}
-
+
default:
print("Incorrect parameters for ^2anticheat^7\n");
case CMD_REQUEST_USAGE:
}
}
-void GameCommand_bbox(float request)
+void GameCommand_bbox(float request)
{
switch(request)
{
print(" ", ftos(world.absmax_z));
else
print(" ", ftos(trace_endpos_z));
-
+
print("\n");
return;
}
-
+
default:
case CMD_REQUEST_USAGE:
{
case CMD_REQUEST_COMMAND:
{
entity bot;
-
+
if(argv(1) == "reset")
{
bot_resetqueues();
print(strcat("Error: Can't find bot with the name or id '", argv(1),"' - Did you mistype the command?\n")); // don't return so that usage is shown
}
}
-
+
default:
print("Incorrect parameters for ^2bot_cmd^7\n");
case CMD_REQUEST_USAGE:
string result1 = (argv(2) ? strcat("^7", argv(1), "^3!\n") : "^1HEADS^3!\n");
string result2 = (argv(2) ? strcat("^7", argv(2), "^3!\n") : "^4TAILS^3!\n");
string choice = ((random() > 0.5) ? result1 : result2);
-
+
FOR_EACH_CLIENT(client)
centerprint(client, strcat("^3Throwing coin... Result: ", choice));
bprint(strcat("^3Throwing coin... Result: ", choice));
return;
}
-
+
default:
case CMD_REQUEST_USAGE:
{
}
}
-void GameCommand_database(float request, float argc)
+void GameCommand_database(float request, float argc)
{
switch(request)
{
}
}
}
-
+
default:
print("Incorrect parameters for ^2database^7\n");
case CMD_REQUEST_USAGE:
}
void GameCommand_defer_clear(float request, float argc)
-{
+{
switch(request)
{
case CMD_REQUEST_COMMAND:
{
entity client;
float accepted;
-
+
if(argc >= 2)
{
client = GetIndexedEntity(argc, 1);
accepted = VerifyClientEntity(client, TRUE, FALSE);
-
+
if(accepted > 0)
{
stuffcmd(client, "defer clear\n");
print("defer clear stuffed to ", client.netname, "\n");
}
else { print("defer_clear: ", GetClientErrorString(accepted, argv(1)), ".\n"); }
-
+
return;
}
}
-
+
default:
print("Incorrect parameters for ^2defer_clear^7\n");
case CMD_REQUEST_USAGE:
}
void GameCommand_defer_clear_all(float request)
-{
+{
switch(request)
{
case CMD_REQUEST_COMMAND:
entity client;
float i = 0;
float argc;
-
+
FOR_EACH_CLIENT(client)
{
argc = tokenize_console(strcat("defer_clear ", ftos(num_for_edict(client))));
- GameCommand_defer_clear(CMD_REQUEST_COMMAND, argc);
+ GameCommand_defer_clear(CMD_REQUEST_COMMAND, argc);
++i;
}
- if(i) { print(strcat("Successfully stuffed defer clear to all clients (", ftos(i), ")\n")); } // should a message be added if no players were found?
+ if(i) { print(strcat("Successfully stuffed defer clear to all clients (", ftos(i), ")\n")); } // should a message be added if no players were found?
return;
}
-
+
default:
case CMD_REQUEST_USAGE:
{
race_deleteTime(GetMapname(), stof(argv(1)));
return;
}
- }
-
+ }
+
default:
print("Incorrect parameters for ^2delrec^7\n");
case CMD_REQUEST_USAGE:
}
}
-void GameCommand_effectindexdump(float request)
+void GameCommand_effectindexdump(float request)
{
switch(request)
{
{
float fh, d;
string s;
-
+
d = db_create();
print("begin of effects list\n");
db_put(d, "TE_GUNSHOT", "1"); print("effect TE_GUNSHOT is ", ftos(particleeffectnum("TE_GUNSHOT")), "\n");
db_close(d);
return;
}
-
+
default:
case CMD_REQUEST_USAGE:
{
}
}
-void GameCommand_extendmatchtime(float request)
+void GameCommand_extendmatchtime(float request)
{
switch(request)
{
changematchtime(autocvar_timelimit_increment * 60, autocvar_timelimit_min * 60, autocvar_timelimit_max * 60);
return;
}
-
+
default:
case CMD_REQUEST_USAGE:
{
}
void GameCommand_find(float request, float argc) // is this even needed? We have prvm_edicts command and such ANYWAY
-{
+{
switch(request)
{
case CMD_REQUEST_COMMAND:
{
entity client;
-
+
for(client = world; (client = find(client, classname, argv(1))); )
print(etos(client), "\n");
-
+
return;
}
-
+
default:
print("Incorrect parameters for ^2find^7\n");
case CMD_REQUEST_USAGE:
}
}
-void GameCommand_gametype(float request, float argc)
-{
+void GameCommand_gametype(float request, float argc)
+{
switch(request)
{
case CMD_REQUEST_COMMAND:
{
string s = argv(1);
float t = MapInfo_Type_FromString(s), tsave = MapInfo_CurrentGametype();
-
+
if(t)
{
MapInfo_SwitchGameType(t);
}
else
bprint("Game type switch to ", s, " failed: this type does not exist!\n");
-
+
return;
}
}
-
+
default:
print("Incorrect parameters for ^2gametype^7\n");
case CMD_REQUEST_USAGE:
}
}
-void GameCommand_gettaginfo(float request, float argc)
-{
+void GameCommand_gettaginfo(float request, float argc)
+{
switch(request)
{
case CMD_REQUEST_COMMAND:
entity tmp_entity;
float i;
vector v;
-
+
if(argc >= 4)
{
tmp_entity = spawn();
}
else
print("bone not found\n");
-
+
remove(tmp_entity);
return;
}
}
-
+
default:
print("Incorrect parameters for ^2gettaginfo^7\n");
case CMD_REQUEST_USAGE:
}
}
-void GameCommand_animbench(float request, float argc)
+void GameCommand_animbench(float request, float argc)
{
switch(request)
{
return;
}
}
-
+
default:
print("Incorrect parameters for ^2gotomap^7\n");
case CMD_REQUEST_USAGE:
}
return;
}
-
+
default:
case CMD_REQUEST_USAGE:
{
}
}
-void GameCommand_make_mapinfo(float request)
+void GameCommand_make_mapinfo(float request)
{
switch(request)
{
case CMD_REQUEST_COMMAND:
- {
+ {
entity tmp_entity;
-
+
tmp_entity = spawn();
tmp_entity.classname = "make_mapinfo";
tmp_entity.think = make_mapinfo_Think;
MapInfo_Enumerate();
return;
}
-
+
default:
case CMD_REQUEST_USAGE:
{
{
float accepted;
entity client;
-
+
string targets = strreplace(",", " ", argv(1));
string original_targets = strreplace(" ", ", ", targets);
string destination = argv(2);
-
+
string successful, t;
successful = string_null;
-
+
// lets see if the target(s) even actually exist.
if((targets) && (destination))
- {
+ {
for(;targets;)
{
t = car(targets); targets = cdr(targets);
// Check to see if the player is a valid target
client = GetFilteredEntity(t);
accepted = VerifyClientEntity(client, FALSE, FALSE);
-
- if not(accepted > 0)
+
+ if(accepted <= 0)
{
- print("moveplayer: ", GetClientErrorString(accepted, t), (targets ? ", skipping to next player.\n" : ".\n"));
+ print("moveplayer: ", GetClientErrorString(accepted, t), (targets ? ", skipping to next player.\n" : ".\n"));
continue;
}
-
+
// Where are we putting this player?
- if(destination == "spec" || destination == "spectator")
+ if(destination == "spec" || destination == "spectator")
{
if(!IS_SPEC(client) && !IS_OBSERVER(client))
{
self = client;
PutObserverInServer();
-
+
successful = strcat(successful, (successful ? ", " : ""), client.netname);
}
else
// keep the forcing undone
print("Player ", ftos(GetFilteredNumber(t)), " (", client.netname, ") is already on the ", Team_ColoredFullName(client.team), (targets ? "^7, skipping to next player.\n" : "^7.\n"));
continue;
- }
+ }
else if(team_id == 0) // auto team
{
team_id = Team_NumberToTeam(FindSmallestTeam(client, FALSE));
CheckAllowedTeams(client);
}
client.team_forced = save;
-
+
// Check to see if the destination team is even available
- switch(team_id)
+ switch(team_id)
{
case NUM_TEAM_1: if(c1 == -1) { print("Sorry, can't move player to red team if it doesn't exist.\n"); return; } break;
case NUM_TEAM_2: if(c2 == -1) { print("Sorry, can't move player to blue team if it doesn't exist.\n"); return; } break;
case NUM_TEAM_3: if(c3 == -1) { print("Sorry, can't move player to yellow team if it doesn't exist.\n"); return; } break;
case NUM_TEAM_4: if(c4 == -1) { print("Sorry, can't move player to pink team if it doesn't exist.\n"); return; } break;
-
+
default: print("Sorry, can't move player here if team ", destination, " doesn't exist.\n"); return;
}
-
+
// If so, lets continue and finally move the player
client.team_forced = 0;
MoveToTeam(client, team_id, 6);
}
else
{
- print("Can't change teams if the player isn't in the game.\n"); // well technically we could, but should we allow that? :P
+ print("Can't change teams if the player isn't in the game.\n"); // well technically we could, but should we allow that? :P
return;
}
}
}
-
+
if(successful)
bprint("Successfully moved players ", successful, " to destination ", destination, ".\n");
else
print("No players given (", original_targets, ") are able to move.\n");
-
+
return; // still correct parameters so return to avoid usage print
}
}
-
+
default:
print("Incorrect parameters for ^2moveplayer^7\n");
case CMD_REQUEST_USAGE:
}
}
-void GameCommand_nospectators(float request)
+void GameCommand_nospectators(float request)
{
switch(request)
{
bprint(strcat("^7All spectators will be automatically kicked when not joining the game after ", ftos(autocvar_g_maxplayers_spectator_blocktime), " seconds!\n"));
return;
}
-
+
default:
case CMD_REQUEST_USAGE:
{
}
void GameCommand_playerdemo(float request, float argc)
-{
+{
switch(request)
{
case CMD_REQUEST_COMMAND:
{
entity client;
float i, n, accepted;
-
+
switch(argv(1))
{
case "read":
{
client = GetIndexedEntity(argc, 2);
accepted = VerifyClientEntity(client, FALSE, TRUE);
-
- if not(accepted > 0)
+
+ if(accepted <= 0)
{
- print("playerdemo: read: ", GetClientErrorString(accepted, argv(2)), ".\n");
+ print("playerdemo: read: ", GetClientErrorString(accepted, argv(2)), ".\n");
return;
}
-
+
self = client;
playerdemo_open_read(argv(next_token));
return;
}
-
+
case "write":
{
client = GetIndexedEntity(argc, 2);
accepted = VerifyClientEntity(client, FALSE, FALSE);
-
- if not(accepted > 0)
+
+ if(accepted <= 0)
{
- print("playerdemo: write: ", GetClientErrorString(accepted, argv(2)), ".\n");
+ print("playerdemo: write: ", GetClientErrorString(accepted, argv(2)), ".\n");
return;
}
-
+
self = client;
playerdemo_open_write(argv(next_token));
return;
}
-
+
case "auto_read_and_write":
{
n = GetFilteredNumber(argv(3));
cvar_set("bot_number", ftos(n));
-
+
localcmd("wait; wait; wait\n");
for(i = 0; i < n; ++i) { localcmd("sv_cmd playerdemo read ", ftos(i+2), " ", argv(2), ftos(i+1), "\n"); }
-
+
localcmd("sv_cmd playerdemo write 1 ", ftos(n+1), "\n");
return;
}
-
+
case "auto_read":
{
n = GetFilteredNumber(argv(3));
cvar_set("bot_number", ftos(n));
-
+
localcmd("wait; wait; wait\n");
for(i = 0; i < n; ++i) { localcmd("sv_cmd playerdemo read ", ftos(i+2), " ", argv(2), ftos(i+1), "\n"); }
return;
}
}
}
-
+
default:
print("Incorrect parameters for ^2playerdemo^7\n");
case CMD_REQUEST_USAGE:
}
}
-void GameCommand_printstats(float request)
+void GameCommand_printstats(float request)
{
switch(request)
{
print("stats dumped.\n");
return;
}
-
+
default:
case CMD_REQUEST_USAGE:
{
if(RadarMap_Make(argc))
return;
}
-
+
default:
print("Incorrect parameters for ^2radarmap^7\n");
case CMD_REQUEST_USAGE:
}
}
-void GameCommand_reducematchtime(float request)
+void GameCommand_reducematchtime(float request)
{
switch(request)
{
changematchtime(autocvar_timelimit_decrement *-60, autocvar_timelimit_min * 60, autocvar_timelimit_max * 60);
return;
}
-
+
default:
case CMD_REQUEST_USAGE:
{
return;
}
}
-
+
default:
print("Incorrect parameters for ^2setbots^7\n");
case CMD_REQUEST_USAGE:
FOR_EACH_PLAYER(tmp_player)
{
CheckAllowedTeams(tmp_player);
-
+
if(c1 >= 0) t_teams = max(1, t_teams);
if(c2 >= 0) t_teams = max(2, t_teams);
if(c3 >= 0) t_teams = max(3, t_teams);
if(c4 >= 0) t_teams = max(4, t_teams);
-
+
++t_players;
}
-
+
// build a list of the players in a random order
FOR_EACH_PLAYER(tmp_player)
{
for(;;)
{
i = bound(1, floor(random() * maxclients) + 1, maxclients);
-
+
if(shuffleteams_players[i])
{
continue; // a player is already assigned to this slot
}
}
- // finally, from the list made earlier, re-join the players in different order.
+ // finally, from the list made earlier, re-join the players in different order.
for(i = 1; i <= t_teams; ++i)
{
// find out how many players to assign to this team
x = (t_players / t_teams);
x = ((i == 1) ? ceil(x) : floor(x));
-
+
team_color = Team_NumberToTeam(i);
-
- // sort through the random list of players made earlier
+
+ // sort through the random list of players made earlier
for(z = 1; z <= maxclients; ++z)
- {
- if not(shuffleteams_teams[i] >= x)
+ {
+ if (!(shuffleteams_teams[i] >= x))
{
- if not(shuffleteams_players[z])
+ if (!(shuffleteams_players[z]))
continue; // not a player, move on to next random slot
-
+
if(VerifyClientNumber(shuffleteams_players[z]))
self = edict_num(shuffleteams_players[z]);
- if(self.team != team_color)
+ if(self.team != team_color)
MoveToTeam(self, team_color, 6);
shuffleteams_players[z] = 0;
}
}
}
-
+
bprint("Successfully shuffled the players around randomly.\n");
-
+
// clear the buffers now
for (i=0; i<SHUFFLETEAMS_MAX_PLAYERS; ++i)
shuffleteams_players[i] = 0;
-
+
for (i=0; i<SHUFFLETEAMS_MAX_TEAMS; ++i)
shuffleteams_teams[i] = 0;
}
{
print("Can't shuffle teams when currently not playing a team game.\n");
}
-
+
return;
}
-
+
default:
case CMD_REQUEST_USAGE:
{
{
entity client = GetIndexedEntity(argc, 1);
float accepted = VerifyClientEntity(client, TRUE, FALSE);
-
+
if(accepted > 0)
{
stuffcmd(client, strcat("\n", argv(next_token), "\n"));
print(strcat("Command: \"", argv(next_token), "\" sent to ", GetCallerName(client), " (", argv(1) ,").\n"));
}
else
- print("stuffto: ", GetClientErrorString(accepted, argv(1)), ".\n");
-
+ print("stuffto: ", GetClientErrorString(accepted, argv(1)), ".\n");
+
return;
}
}
-
+
default:
print("Incorrect parameters for ^2stuffto^7\n");
case CMD_REQUEST_USAGE:
entity e;
vector org, delta, start, end, p, q, q0, pos, vv, dv;
float i, f, safe, unsafe, dq, dqf;
-
+
switch(argv(1))
{
case "debug":
}
return;
}
-
+
case "debug2":
{
e = nextent(world);
print("highest possible dist: ", ftos(f), "\n");
return;
}
-
+
case "walk":
{
if(argc == 4)
return;
}
}
-
+
case "showline":
{
if(argc == 4)
return;
}
}
-
+
// no default case, just go straight to invalid
}
}
-
+
default:
print("Incorrect parameters for ^2trace^7\n");
case CMD_REQUEST_USAGE:
}
return;
}
-
+
default:
case CMD_REQUEST_USAGE:
{
{
CampaignLevelWarp(stof(argv(1)));
print("Successfully warped to campaign level ", stof(argv(1)), ".\n");
- }
+ }
else
{
CampaignLevelWarp(-1);
print("Not in campaign, can't level warp\n");
return;
}
-
+
default:
case CMD_REQUEST_USAGE:
{
{
case CMD_REQUEST_COMMAND:
{
-
+
return;
}
-
+
default:
case CMD_REQUEST_USAGE:
{
{
#define SERVER_COMMAND(name,function,description) \
{ print(" ^2", name, "^7: ", description, "\n"); }
-
+
SERVER_COMMANDS(0, 0, "")
#undef SERVER_COMMAND
-
+
return;
}
{
#define SERVER_COMMAND(name,function,description) \
{ if(name == strtolower(argv(0))) { function; return TRUE; } }
-
+
SERVER_COMMANDS(CMD_REQUEST_COMMAND, argc, command)
#undef SERVER_COMMAND
-
+
return FALSE;
}
{
#define SERVER_COMMAND(name,function,description) \
{ if(name == strtolower(argv(1))) { function; return TRUE; } }
-
+
SERVER_COMMANDS(CMD_REQUEST_USAGE, argc, "")
#undef SERVER_COMMAND
-
+
return FALSE;
}
{
#define SERVER_COMMAND(name,function,description) \
{ CMD_Write_Alias("qc_cmd_sv", name, description); }
-
+
SERVER_COMMANDS(0, 0, "")
#undef SERVER_COMMAND
-
+
return;
}
-
+
// =========================================
// Main Function Called By Engine (sv_cmd)
void GameCommand(string command)
{
float argc = tokenize_console(command);
-
+
// Guide for working with argc arguments by example:
// argc: 1 - 2 - 3 - 4
- // argv: 0 - 1 - 2 - 3
+ // argv: 0 - 1 - 2 - 3
// cmd vote - master - login - password
- if(strtolower(argv(0)) == "help")
+ if(strtolower(argv(0)) == "help")
{
- if(argc == 1)
+ if(argc == 1)
{
print("\nServer console commands:\n");
GameCommand_macro_help();
-
+
print("\nBanning commands:\n");
BanCommand_macro_help();
-
+
print("\nCommon networked commands:\n");
CommonCommand_macro_help(world);
-
+
print("\nGeneric commands shared by all programs:\n");
GenericCommand_macro_help();
-
+
print("\nUsage:^3 sv_cmd COMMAND...^7, where possible commands are listed above.\n");
print("For help about a specific command, type sv_cmd help COMMAND\n");
-
+
return;
- }
+ }
else if(BanCommand_macro_usage(argc)) // Instead of trying to call a command, we're going to see detailed information about it
{
return;
{
return;
}
- }
- else if(BanCommand(command))
+ }
+ else if(BanCommand(command))
{
return; // handled by server/command/ipban.qc
}
{
return; // handled by server/command/common.qc
}
- else if(GenericCommand(command))
+ else if(GenericCommand(command))
{
return; // handled by common/command/generic.qc
}
{
return; // handled by one of the above GameCommand_* functions
}
-
+
// nothing above caught the command, must be invalid
print(((command != "") ? strcat("Unknown server command \"", command, "\"") : "No command provided"), ". For a list of supported commands, try sv_cmd help.\n");
-
+
return;
}
// Game logic for voting
// =======================
-void VoteReset()
+void VoteReset()
{
entity tmp_player;
vote_called = VOTE_NULL;
vote_caller = world;
vote_endtime = 0;
-
+
vote_called_command = string_null;
vote_called_display = string_null;
-
+
vote_parsed_command = string_null;
vote_parsed_display = string_null;
Nagger_VoteChanged();
}
-void VoteStop(entity stopper)
+void VoteStop(entity stopper)
{
bprint("\{1}^2* ^3", GetCallerName(stopper), "^2 stopped ^3", GetCallerName(vote_caller), "^2's vote\n");
if(autocvar_sv_eventlog) { GameLogEcho(strcat(":vote:vstop:", ftos(stopper.playerid))); }
-
+
// Don't force them to wait for next vote, this way they can e.g. correct their vote.
if((vote_caller) && (stopper == vote_caller)) { vote_caller.vote_waittime = time + autocvar_sv_vote_stop; }
VoteReset();
}
-void VoteAccept()
+void VoteAccept()
{
bprint("\{1}^2* ^3", GetCallerName(vote_caller), "^2's vote for ^1", vote_called_display, "^2 was accepted\n");
-
+
if((vote_called == VOTE_MASTER) && vote_caller)
vote_caller.vote_master = 1;
else
localcmd(strcat(vote_called_command, "\n"));
-
+
if(vote_caller) { vote_caller.vote_waittime = 0; } // people like your votes, you don't need to wait to vote again
VoteReset();
Send_Notification(NOTIF_ALL, world, MSG_ANNCE, ANNCE_VOTE_ACCEPT);
}
-void VoteReject()
+void VoteReject()
{
bprint("\{1}^2* ^3", GetCallerName(vote_caller), "^2's vote for ", vote_called_display, "^2 was rejected\n");
VoteReset();
Send_Notification(NOTIF_ALL, world, MSG_ANNCE, ANNCE_VOTE_FAIL);
}
-void VoteTimeout()
+void VoteTimeout()
{
bprint("\{1}^2* ^3", GetCallerName(vote_caller), "^2's vote for ", vote_called_display, "^2 timed out\n");
VoteReset();
((mincount >= 0) ? strcat("^2 (^1", ftos(mincount), "^2 needed)") : "^2"),
strcat(", ^1", ftos(vote_abstain_count), "^2 didn't care"),
strcat(", ^1", ftos(notvoters), strcat("^2 didn't ", ((mincount >= 0) ? "" : "have to "), "vote\n"))));
-
+
if(autocvar_sv_eventlog)
{
GameLogEcho(strcat(
}
}
-void VoteCount(float first_count)
+void VoteCount(float first_count)
{
// declarations
vote_accept_count = vote_reject_count = vote_abstain_count = 0;
-
- float spectators_allowed = ((autocvar_sv_vote_nospectators != 2)
+
+ float spectators_allowed = ((autocvar_sv_vote_nospectators != 2)
|| ((autocvar_sv_vote_nospectators == 1) && (warmup_stage || gameover))
|| (autocvar_sv_vote_nospectators == 0));
-
+
float vote_player_count = 0, notvoters = 0;
float vote_real_player_count = 0, vote_real_accept_count = 0;
float vote_real_reject_count = 0, vote_real_abstain_count = 0;
float vote_needed_of_voted, final_needed_votes;
float vote_factor_overall, vote_factor_of_voted;
-
+
entity tmp_player;
Nagger_VoteCountChanged();
-
+
// add up all the votes from each connected client
FOR_EACH_REALCLIENT(tmp_player)
{
++vote_player_count;
if(IS_PLAYER(tmp_player)) { ++vote_real_player_count; }
-
+
switch(tmp_player.vote_selection)
{
case VOTE_SELECT_REJECT: { ++vote_reject_count; { if(IS_PLAYER(tmp_player)) ++vote_real_reject_count; } break; }
default: break;
}
}
-
+
// Check to see if there are enough players on the server to allow master voting... otherwise, vote master could be used for evil.
- if((vote_called == VOTE_MASTER) && autocvar_sv_vote_master_playerlimit > vote_player_count)
+ if((vote_called == VOTE_MASTER) && autocvar_sv_vote_master_playerlimit > vote_player_count)
{
if(vote_caller) { vote_caller.vote_waittime = 0; }
print_to(vote_caller, "^1There are not enough players on this server to allow you to become vote master.");
VoteReset();
return;
}
-
- // if spectators aren't allowed to vote and there are players in a match, then only count the players in the vote and ignore spectators.
+
+ // if spectators aren't allowed to vote and there are players in a match, then only count the players in the vote and ignore spectators.
if(!spectators_allowed && (vote_real_player_count > 0))
{
vote_accept_count = vote_real_accept_count;
vote_abstain_count = vote_real_abstain_count;
vote_player_count = vote_real_player_count;
}
-
+
// people who have no opinion in any way :D
notvoters = (vote_player_count - vote_accept_count - vote_reject_count - vote_abstain_count);
// determine the goal for the vote to be passed or rejected normally
vote_factor_overall = bound(0.5, autocvar_sv_vote_majority_factor, 0.999);
vote_needed_overall = floor((vote_player_count - vote_abstain_count) * vote_factor_overall) + 1;
-
+
// if the vote times out, determine the amount of votes needed of the people who actually already voted
vote_factor_of_voted = bound(0.5, autocvar_sv_vote_majority_factor_of_voted, 0.999);
vote_needed_of_voted = floor((vote_accept_count + vote_reject_count) * vote_factor_of_voted) + 1;
-
+
// are there any players at all on the server? it could be an admin vote
if(vote_player_count == 0 && first_count)
{
- VoteSpam(0, -1, "yes"); // no players at all, just accept it
+ VoteSpam(0, -1, "yes"); // no players at all, just accept it
VoteAccept();
return;
}
-
- // since there ARE players, finally calculate the result of the vote
+
+ // since there ARE players, finally calculate the result of the vote
if(vote_accept_count >= vote_needed_overall)
{
VoteSpam(notvoters, -1, "yes"); // there is enough acceptions to pass the vote
VoteAccept();
return;
}
-
+
if(vote_reject_count > vote_player_count - vote_abstain_count - vote_needed_overall)
{
VoteSpam(notvoters, -1, "no"); // there is enough rejections to deny the vote
VoteReject();
return;
}
-
+
// there is not enough votes in either direction, now lets just calculate what the voters have said
if(time > vote_endtime)
{
final_needed_votes = vote_needed_overall;
-
+
if(autocvar_sv_vote_majority_factor_of_voted)
{
if(vote_accept_count >= vote_needed_of_voted)
VoteAccept();
return;
}
-
+
if(vote_accept_count + vote_reject_count > 0)
{
VoteSpam(notvoters, min(vote_needed_overall, vote_needed_of_voted), "no");
VoteReject();
return;
}
-
+
final_needed_votes = min(vote_needed_overall, vote_needed_of_voted);
}
- // it didn't pass or fail, so not enough votes to even make a decision.
+ // it didn't pass or fail, so not enough votes to even make a decision.
VoteSpam(notvoters, final_needed_votes, "timeout");
VoteTimeout();
}
}
-void VoteThink()
+void VoteThink()
{
if(vote_endtime > 0) // a vote was called
if(time > vote_endtime) // time is up
{
VoteCount(FALSE);
}
-
+
return;
}
}
// Restarts the map after the countdown is over (and cvar sv_ready_restart_after_countdown is set)
-void ReadyRestart_think()
+void ReadyRestart_think()
{
restart_mapalreadyrestarted = 1;
reset_map(TRUE);
Score_ClearAll();
remove(self);
-
+
return;
}
if(autocvar_sv_timeout) { FOR_EACH_REALPLAYER(tmp_player) { tmp_player.allowed_timeouts = autocvar_sv_timeout_number; } }
//reset map immediately if this cvar is not set
- if not(autocvar_sv_ready_restart_after_countdown) { reset_map(TRUE); }
+ if (!autocvar_sv_ready_restart_after_countdown) { reset_map(TRUE); }
if(autocvar_sv_eventlog) { GameLogEcho(":restart"); }
}
// Reset ALL scores, but only do that at the beginning of the countdown if sv_ready_restart_after_countdown is off!
// Otherwise scores could be manipulated during the countdown.
- if not(autocvar_sv_ready_restart_after_countdown) { Score_ClearAll(); }
+ if (!autocvar_sv_ready_restart_after_countdown) { Score_ClearAll(); }
ReadyRestart_force();
-
+
return;
}
ready_needed_factor = bound(0.5, cvar("g_warmup_majority_factor"), 0.999);
ready_needed_count = floor(t_players * ready_needed_factor) + 1;
-
+
if(readycount >= ready_needed_count)
{
ReadyRestart();
}
-
+
return;
}
float Votecommand_check_assignment(entity caller, float assignment)
{
float from_server = (!caller);
-
- if((assignment == VC_ASGNMNT_BOTH)
- || ((!from_server && assignment == VC_ASGNMNT_CLIENTONLY)
+
+ if((assignment == VC_ASGNMNT_BOTH)
+ || ((!from_server && assignment == VC_ASGNMNT_CLIENTONLY)
|| (from_server && assignment == VC_ASGNMNT_SERVERONLY)))
{
return TRUE;
return FALSE;
}
-string VoteCommand_extractcommand(string input, float startpos, float argc)
+string VoteCommand_extractcommand(string input, float startpos, float argc)
{
string output;
-
+
if((argc - 1) < startpos)
output = "";
else
output = substring(input, argv_start_index(startpos), argv_end_index(-1) - argv_start_index(startpos));
-
+
return output;
}
|| (strstrofs(vote_command, "\r", 0) >= 0)
|| (strstrofs(vote_command, "$", 0) >= 0))
return FALSE;
-
+
return TRUE;
}
float VoteCommand_checkinlist(string vote_command, string list)
{
string l = strcat(" ", list, " ");
-
+
if(strstrofs(l, strcat(" ", vote_command, " "), 0) >= 0)
return TRUE;
-
+
return FALSE;
}
string ValidateMap(string validated_map, entity caller)
{
validated_map = MapInfo_FixName(validated_map);
-
- if not(validated_map)
+
+ if (!validated_map)
{
print_to(caller, "This map is not available on this server.");
return string_null;
}
-
+
if(!autocvar_sv_vote_override_mostrecent && caller)
{
if(Map_IsRecent(validated_map))
return string_null;
}
}
-
+
if(!MapInfo_CheckMap(validated_map))
{
print_to(caller, strcat("^1Invalid mapname, \"^3", validated_map, "^1\" does not support the current game mode."));
float VoteCommand_parse(entity caller, string vote_command, string vote_list, float startpos, float argc)
{
string first_command;
-
+
first_command = argv(startpos);
/*dprint(sprintf("VoteCommand_parse(): Command: '%s', Length: %f.\n",
)
return FALSE;
- if not(VoteCommand_checkinlist(first_command, vote_list))
+ if (!VoteCommand_checkinlist(first_command, vote_list))
return FALSE;
- if not(VoteCommand_checkargs(startpos, argc))
+ if (!VoteCommand_checkargs(startpos, argc))
return FALSE;
switch(first_command) // now go through and parse the proper commands to adjust as needed.
{
entity victim = GetIndexedEntity(argc, (startpos + 1));
float accepted = VerifyClientEntity(victim, TRUE, FALSE);
-
+
if(accepted > 0)
{
string reason = ((argc > next_token) ? substring(vote_command, argv_start_index(next_token), strlen(vote_command) - argv_start_index(next_token)) : "No reason provided");
string command_arguments;
-
+
if(first_command == "kickban")
command_arguments = strcat(ftos(autocvar_g_ban_default_bantime), " ", ftos(autocvar_g_ban_default_masksize), " ~");
else
command_arguments = reason;
-
+
vote_parsed_command = strcat(first_command, " # ", ftos(num_for_edict(victim)), " ", command_arguments);
vote_parsed_display = strcat("^1", vote_command, " (^7", victim.netname, "^1): ", reason);
}
else { print_to(caller, strcat("vcall: ", GetClientErrorString(accepted, argv(startpos + 1)), ".\n")); return FALSE; }
-
+
break;
}
-
+
case "map":
case "chmap":
case "gotomap": // re-direct all map selection commands to gotomap
{
vote_command = ValidateMap(argv(startpos + 1), caller);
- if not(vote_command) { return FALSE; }
+ if (!vote_command) { return FALSE; }
vote_parsed_command = strcat("gotomap ", vote_command);
vote_parsed_display = strzone(strcat("^1", vote_parsed_command));
-
+
break;
}
-
- default:
- {
+
+ default:
+ {
vote_parsed_command = vote_command;
vote_parsed_display = strzone(strcat("^1", vote_command));
-
- break;
+
+ break;
}
}
{
case CMD_REQUEST_COMMAND:
{
- if not(vote_called) { print_to(caller, "^1No vote called."); }
- else if not(caller.vote_selection == VOTE_SELECT_NULL || autocvar_sv_vote_change) { print_to(caller, "^1You have already voted."); }
-
+ if (!vote_called) { print_to(caller, "^1No vote called."); }
+ else if(caller.vote_selection != VOTE_SELECT_NULL && !autocvar_sv_vote_change) { print_to(caller, "^1You have already voted."); }
+
else // everything went okay, continue changing vote
{
print_to(caller, "^1You abstained from your vote.");
msg_entity = caller;
if(!autocvar_sv_vote_singlecount) { VoteCount(FALSE); }
}
-
+
return;
}
-
+
default:
case CMD_REQUEST_USAGE:
{
{
case CMD_REQUEST_COMMAND:
{
- float spectators_allowed = ((autocvar_sv_vote_nospectators != 2)
- || ((autocvar_sv_vote_nospectators == 1) && warmup_stage)
+ float spectators_allowed = ((autocvar_sv_vote_nospectators != 2)
+ || ((autocvar_sv_vote_nospectators == 1) && warmup_stage)
|| (autocvar_sv_vote_nospectators == 0));
-
+
float tmp_playercount = 0;
entity tmp_player;
-
+
vote_command = VoteCommand_extractcommand(vote_command, 2, argc);
-
- if not(autocvar_sv_vote_call || !caller) { print_to(caller, "^1Vote calling is not allowed."); }
+
+ if(!autocvar_sv_vote_call && caller) { print_to(caller, "^1Vote calling is not allowed."); }
else if(!autocvar_sv_vote_gamestart && time < game_starttime) { print_to(caller, "^1Vote calling is not allowed before the match has started."); }
else if(vote_called) { print_to(caller, "^1There is already a vote called."); }
else if(!spectators_allowed && (caller && !IS_PLAYER(caller))) { print_to(caller, "^1Only players can call a vote."); }
else if(timeout_status) { print_to(caller, "^1You can not call a vote while a timeout is active."); }
else if(caller && (time < caller.vote_waittime)) { print_to(caller, strcat("^1You have to wait ^2", ftos(ceil(caller.vote_waittime - time)), "^1 seconds before you can again call a vote.")); }
- else if not(VoteCommand_checknasty(vote_command)) { print_to(caller, "^1Syntax error in command, see 'vhelp' for more info."); }
- else if not(VoteCommand_parse(caller, vote_command, autocvar_sv_vote_commands, 2, argc)) { print_to(caller, "^1This command is not acceptable, see 'vhelp' for more info."); }
+ else if (!VoteCommand_checknasty(vote_command)) { print_to(caller, "^1Syntax error in command, see 'vhelp' for more info."); }
+ else if (!VoteCommand_parse(caller, vote_command, autocvar_sv_vote_commands, 2, argc)) { print_to(caller, "^1This command is not acceptable, see 'vhelp' for more info."); }
else // everything went okay, continue with calling the vote
{
vote_called_command = strzone(vote_parsed_command);
vote_called_display = strzone(vote_parsed_display);
vote_endtime = time + autocvar_sv_vote_timeout;
-
+
if(caller)
{
caller.vote_selection = VOTE_SELECT_ACCEPT;
caller.vote_waittime = time + autocvar_sv_vote_wait;
msg_entity = caller;
}
-
+
FOR_EACH_REALCLIENT(tmp_player) { ++tmp_playercount; }
if(tmp_playercount > 1) { Send_Notification(NOTIF_ALL, world, MSG_ANNCE, ANNCE_VOTE_CALL); } // don't announce a "vote now" sound if player is alone
-
+
bprint("\{1}^2* ^3", GetCallerName(vote_caller), "^2 calls a vote for ", vote_called_display, "\n");
if(autocvar_sv_eventlog) { GameLogEcho(strcat(":vote:vcall:", ftos(vote_caller.playerid), ":", vote_called_display)); }
Nagger_VoteChanged();
VoteCount(TRUE); // needed if you are the only one
}
-
+
return;
}
-
+
default:
case CMD_REQUEST_USAGE:
{
case "do":
{
vote_command = VoteCommand_extractcommand(vote_command, 3, argc);
-
- if not(caller.vote_master) { print_to(caller, "^1You do not have vote master privelages."); }
- else if not(VoteCommand_checknasty(vote_command)) { print_to(caller, "^1Syntax error in command, see 'vhelp' for more info."); }
- else if not(VoteCommand_parse(caller, vote_command, strcat(autocvar_sv_vote_commands, " ", autocvar_sv_vote_master_commands), 3, argc)) { print_to(caller, "^1This command is not acceptable, see 'vhelp' for more info."); }
-
+
+ if (!caller.vote_master) { print_to(caller, "^1You do not have vote master privelages."); }
+ else if (!VoteCommand_checknasty(vote_command)) { print_to(caller, "^1Syntax error in command, see 'vhelp' for more info."); }
+ else if (!VoteCommand_parse(caller, vote_command, strcat(autocvar_sv_vote_commands, " ", autocvar_sv_vote_master_commands), 3, argc)) { print_to(caller, "^1This command is not acceptable, see 'vhelp' for more info."); }
+
else // everything went okay, proceed with command
{
localcmd(strcat(vote_parsed_command, "\n"));
bprint("\{1}^2* ^3", GetCallerName(caller), "^2 used their ^3master^2 status to do \"^2", vote_parsed_display, "^2\".\n");
if(autocvar_sv_eventlog) { GameLogEcho(strcat(":vote:vdo:", ftos(caller.playerid), ":", vote_parsed_display)); }
}
-
+
return;
}
-
+
case "login":
{
- if not(autocvar_sv_vote_master_password != "") { print_to(caller, "^1Login to vote master is not allowed."); }
+ if(autocvar_sv_vote_master_password == "") { print_to(caller, "^1Login to vote master is not allowed."); }
else if(caller.vote_master) { print_to(caller, "^1You are already logged in as vote master."); }
- else if not(autocvar_sv_vote_master_password == argv(3)) { print_to(caller, strcat("Rejected vote master login from ", GetCallerName(caller))); }
+ else if(autocvar_sv_vote_master_password != argv(3)) { print_to(caller, strcat("Rejected vote master login from ", GetCallerName(caller))); }
else // everything went okay, proceed with giving this player master privilages
{
bprint("\{1}^2* ^3", GetCallerName(caller), "^2 logged in as ^3master^2\n");
if(autocvar_sv_eventlog) { GameLogEcho(strcat(":vote:vlogin:", ftos(caller.playerid))); }
}
-
+
return;
}
-
+
default: // calling a vote for master
{
- float spectators_allowed = ((autocvar_sv_vote_nospectators != 2)
- || ((autocvar_sv_vote_nospectators == 1) && warmup_stage)
+ float spectators_allowed = ((autocvar_sv_vote_nospectators != 2)
+ || ((autocvar_sv_vote_nospectators == 1) && warmup_stage)
|| (autocvar_sv_vote_nospectators == 0));
-
- if not(autocvar_sv_vote_master_callable) { print_to(caller, "^1Vote to become vote master is not allowed."); }
+
+ if (!autocvar_sv_vote_master_callable) { print_to(caller, "^1Vote to become vote master is not allowed."); }
else if(vote_called) { print_to(caller, "^1There is already a vote called."); }
else if(!spectators_allowed && (caller && !IS_PLAYER(caller))) { print_to(caller, "^1Only players can call a vote."); }
else if(timeout_status) { print_to(caller, "^1You can not call a vote while a timeout is active."); }
-
+
else // everything went okay, continue with creating vote
{
vote_caller = caller;
vote_called_command = strzone("XXX");
vote_called_display = strzone("^3master");
vote_endtime = time + autocvar_sv_vote_timeout;
-
+
caller.vote_selection = VOTE_SELECT_ACCEPT;
caller.vote_waittime = time + autocvar_sv_vote_wait;
-
+
bprint("\{1}^2* ^3", GetCallerName(vote_caller), "^2 calls a vote to become ^3master^2.\n");
if(autocvar_sv_eventlog) { GameLogEcho(strcat(":vote:vcall:", ftos(vote_caller.playerid), ":", vote_called_display)); }
Nagger_VoteChanged();
VoteCount(TRUE); // needed if you are the only one
}
-
+
return;
}
}
}
else { print_to(caller, "^1Master control of voting is not allowed."); }
-
+
return;
}
-
+
default:
case CMD_REQUEST_USAGE:
{
{
case CMD_REQUEST_COMMAND:
{
- if not(vote_called) { print_to(caller, "^1No vote called."); }
- else if not(caller.vote_selection == VOTE_SELECT_NULL || autocvar_sv_vote_change) { print_to(caller, "^1You have already voted."); }
+ if (!vote_called) { print_to(caller, "^1No vote called."); }
+ else if(caller.vote_selection != VOTE_SELECT_NULL && !autocvar_sv_vote_change) { print_to(caller, "^1You have already voted."); }
else if(((caller == vote_caller) || caller.vote_master) && autocvar_sv_vote_no_stops_vote) { VoteStop(caller); }
-
+
else // everything went okay, continue changing vote
{
print_to(caller, "^1You rejected the vote.");
msg_entity = caller;
if(!autocvar_sv_vote_singlecount) { VoteCount(FALSE); }
}
-
+
return;
}
-
+
default:
case CMD_REQUEST_USAGE:
{
print_to(caller, strcat("^7Vote for ", vote_called_display, "^7 called by ^7", GetCallerName(vote_caller), "^7."));
else
print_to(caller, "^1No vote called.");
-
+
return;
}
-
+
default:
case CMD_REQUEST_USAGE:
{
{
case CMD_REQUEST_COMMAND:
{
- if not(vote_called) { print_to(caller, "^1No vote called."); }
+ if (!vote_called) { print_to(caller, "^1No vote called."); }
else if((caller == vote_caller) || !caller || caller.vote_master) { VoteStop(caller); }
else { print_to(caller, "^1You are not allowed to stop that vote."); }
-
+
return;
}
-
+
default:
case CMD_REQUEST_USAGE:
{
{
case CMD_REQUEST_COMMAND:
{
- if not(vote_called) { print_to(caller, "^1No vote called."); }
- else if not(caller.vote_selection == VOTE_SELECT_NULL || autocvar_sv_vote_change) { print_to(caller, "^1You have already voted."); }
-
+ if (!vote_called) { print_to(caller, "^1No vote called."); }
+ else if(caller.vote_selection != VOTE_SELECT_NULL && autocvar_sv_vote_change) { print_to(caller, "^1You have already voted."); }
+
else // everything went okay, continue changing vote
{
print_to(caller, "^1You accepted the vote.");
msg_entity = caller;
if(!autocvar_sv_vote_singlecount) { VoteCount(FALSE); }
}
-
+
return;
}
-
+
default:
case CMD_REQUEST_USAGE:
{
{
case CMD_REQUEST_COMMAND:
{
-
+
return;
}
-
+
default:
case CMD_REQUEST_USAGE:
{
print_to(caller, "\nVoting commands:\n");
#define VOTE_COMMAND(name,function,description,assignment) \
{ if(Votecommand_check_assignment(caller, assignment)) { print_to(caller, strcat(" ^2", name, "^7: ", description)); } }
-
+
VOTE_COMMANDS(0, caller, 0, "")
#undef VOTE_COMMAND
-
+
print_to(caller, strcat("\nUsage:^3 ", command_origin, " vote COMMAND...^7, where possible commands are listed above.\n"));
print_to(caller, strcat("For help about a specific command, type ", command_origin, " vote help COMMAND"));
print_to(caller, strcat("\n^7You can call a vote for or execute these commands: ^3", autocvar_sv_vote_commands, "^7 and maybe further ^3arguments^7"));
{
#define VOTE_COMMAND(name,function,description,assignment) \
{ if(Votecommand_check_assignment(caller, assignment)) { if(name == strtolower(argv(2))) { function; return; } } }
-
+
VOTE_COMMANDS(CMD_REQUEST_USAGE, caller, argc, "")
#undef VOTE_COMMAND
}
-
+
return;
}
{
#define VOTE_COMMAND(name,function,description,assignment) \
{ if(Votecommand_check_assignment(caller, assignment)) { if(name == strtolower(argv(1))) { function; return TRUE; } } }
-
+
VOTE_COMMANDS(CMD_REQUEST_COMMAND, caller, argc, vote_command)
#undef VOTE_COMMAND
-
+
return FALSE;
}
// Main function handling vote commands
// ======================================
-void VoteCommand(float request, entity caller, float argc, string vote_command)
+void VoteCommand(float request, entity caller, float argc, string vote_command)
{
// Guide for working with argc arguments by example:
// argc: 1 - 2 - 3 - 4
- // argv: 0 - 1 - 2 - 3
+ // argv: 0 - 1 - 2 - 3
// cmd vote - master - login - password
-
+
switch(request)
{
case CMD_REQUEST_COMMAND:
if(VoteCommand_macro_command(caller, argc, vote_command))
return;
}
-
+
default:
print_to(caller, strcat(((argv(1) != "") ? strcat("Unknown vote command \"", argv(1), "\"") : "No command provided"), ". For a list of supported commands, try ", GetCommandPrefix(caller), " vote help.\n"));
case CMD_REQUEST_USAGE:
float vote_reject_count; // same as above, but rejected
float vote_abstain_count; // same as above, but abstained
float vote_needed_overall; // total amount of players NEEDED for a vote to pass (based on sv_vote_majority_factor)
-.float vote_master; // flag for if the player has vote master privelages
+.float vote_master; // flag for if the player has vote master privelages
.float vote_waittime; // flag for how long the player must wait before they can vote again
.float vote_selection; // flag for which vote selection the player has made (See VOTE_SELECT_*)
string vote_called_command; // command sent by client
if(sf & 2)
WriteByte(MSG_ENTITY, self.csqcprojectile_type); // TODO maybe put this into sf?
-
+
return 1;
}
void CSQCProjectile(entity e, float clientanimate, float type, float docull)
{
Net_LinkEntity(e, docull, 0, CSQCProjectile_SendEntity);
-
+
e.csqcprojectile_clientanimate = clientanimate;
-
+
if(e.movetype == MOVETYPE_TOSS || e.movetype == MOVETYPE_BOUNCE)
{
if(e.gravity == 0)
float maxclients;
// flag set on worldspawn so that the code knows if it is dedicated or not
-float server_is_dedicated;
+float server_is_dedicated;
// Fields
//.float style;
//.float skill;
.float sounds;
-.float platmovetype;
+.string platmovetype;
+.float platmovetype_start, platmovetype_end;
.string killtarget;
.string target2;
.string target3;
.string target4;
+.string curvetarget;
.float target_random;
.float trigger_reverse;
-// Nexball
+// Nexball
.entity ballcarried; // Also used for keepaway
.float metertime;
float g_nexball_meter_period;
.float last_pickup;
-.float hit_time;
-.float typehit_time;
+.float hit_time;
+.float typehit_time;
.float stat_leadlimit;
o = self.owner;
if(o.deadflag != DEAD_NO)
return FALSE;
- if not(IS_PLAYER(o))
+ if (!IS_PLAYER(o))
return FALSE;
if(other == o)
return FALSE;
if((IS_PLAYER(other)) || other.caplayer)
if(!teamplay || o.team != other.team)
- if not (radar_showennemies)
+ if (!radar_showennemies)
return FALSE;
return TRUE;
}
void func_breakable_colormod()
{
float h;
- if not(self.spawnflags & 2)
+ if (!(self.spawnflags & 2))
return;
h = self.health / self.max_health;
if(h < 0.25)
}
if(warmup_stage)
- GiveFrags_randomweapons.weapons = warmup_start_weapons;
+ GiveFrags_randomweapons.weapons = WARMUP_START_WEAPONS;
else
GiveFrags_randomweapons.weapons = start_weapons;
}
// after a frag, choose another random weapon set
- if not(attacker.weapons & WepSet_FromWeapon(attacker.weapon))
+ if (!(attacker.weapons & WepSet_FromWeapon(attacker.weapon)))
W_SwitchWeapon_Force(attacker, w_getbestweapon(attacker));
}
if(DEATH_ISSPECIAL(deathtype))
{
entity deathent = deathtypes[(deathtype - DT_FIRST)];
- if not(deathent) { backtrace("Obituary_SpecialDeath: Could not find deathtype entity!\n"); return; }
+ if (!deathent) { backtrace("Obituary_SpecialDeath: Could not find deathtype entity!\n"); return; }
if(murder)
{
void Obituary(entity attacker, entity inflictor, entity targ, float deathtype)
{
// Sanity check
- if not(IS_PLAYER(targ)) { backtrace("Obituary called on non-player?!\n"); return; }
+ if (!IS_PLAYER(targ)) { backtrace("Obituary called on non-player?!\n"); return; }
// Declarations
float notif_firstblood = FALSE;
)
);
#endif
-
+
// =======
// SUICIDE
// =======
Obituary_SpecialDeath(targ, FALSE, deathtype, targ.netname, deathlocation, "", targ.killcount, 0, 0);
break;
}
-
+
default:
{
Obituary_SpecialDeath(targ, FALSE, deathtype, targ.netname, deathlocation, "", targ.killcount, 0, 0);
}
}
}
- else if not(Obituary_WeaponDeath(targ, FALSE, deathtype, targ.netname, deathlocation, "", targ.killcount, 0))
+ else if (!Obituary_WeaponDeath(targ, FALSE, deathtype, targ.netname, deathlocation, "", targ.killcount, 0))
{
backtrace("SUICIDE: what the hell happened here?\n");
return;
GiveFrags(attacker, targ, -1, deathtype);
attacker.killcount = 0;
-
+
Send_Notification(NOTIF_ONE, attacker, MSG_CENTER, CENTER_DEATH_TEAMKILL_FRAG, targ.netname);
Send_Notification(NOTIF_ONE, targ, MSG_CENTER, CENTER_DEATH_TEAMKILL_FRAGGED, attacker.netname);
Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_NUM_4(targ.team, INFO_DEATH_TEAMKILL_), targ.netname, attacker.netname, deathlocation, targ.killcount);
);
}
- if not(Obituary_WeaponDeath(targ, TRUE, deathtype, targ.netname, attacker.netname, deathlocation, targ.killcount, kill_count_to_attacker))
+ if (!Obituary_WeaponDeath(targ, TRUE, deathtype, targ.netname, attacker.netname, deathlocation, targ.killcount, kill_count_to_attacker))
Obituary_SpecialDeath(targ, TRUE, deathtype, targ.netname, attacker.netname, deathlocation, targ.killcount, kill_count_to_attacker, 0);
}
}
0);
break;
}
-
+
default:
{
Obituary_SpecialDeath(targ, FALSE, deathtype, targ.netname, deathlocation, "", targ.killcount, 0, 0);
{
float mirrordamage;
float mirrorforce;
- float complainteamdamage = 0;
+ float complainteamdamage = 0;
entity attacker_save;
mirrordamage = 0;
mirrorforce = 0;
// exit the vehicle before killing (fixes a crash)
if(IS_PLAYER(targ) && targ.vehicle)
vehicles_exit(VHEF_RELESE);
-
+
// These are ALWAYS lethal
// No damage modification here
// Instead, prepare the victim for his death...
}
}
- if not(DEATH_ISSPECIAL(deathtype))
+ if (!DEATH_ISSPECIAL(deathtype))
{
damage *= g_weapondamagefactor;
mirrordamage *= g_weapondamagefactor;
force = force * g_weaponforcefactor;
mirrorforce *= g_weaponforcefactor;
}
-
+
// should this be changed at all? If so, in what way?
frag_attacker = attacker;
frag_target = targ;
damage = frag_damage;
mirrordamage = frag_mirrordamage;
force = frag_force;
-
- if not(g_minstagib)
+
+ if (!g_minstagib)
{
// apply strength multiplier
if (attacker.items & IT_STRENGTH)
damage_goodhits += 1;
damage_gooddamage += damage;
- if not(DEATH_ISSPECIAL(deathtype))
+ if (!DEATH_ISSPECIAL(deathtype))
{
if(IS_PLAYER(targ)) // don't do this for vehicles
if(IsFlying(victim))
if(maxtime > mintime || maxdps > mindps)
{
// Constraints:
-
+
// damage we have right now
mindamage = mindps * mintime;
float t, d, hi, ty;
entity o;
- if not(Fire_IsBurning(e))
+ if (!Fire_IsBurning(e))
return;
for(t = 0, o = e.owner; o.owner && t < 16; o = o.owner, ++t);
}
e.fire_hitsound = TRUE;
- if not(IS_INDEPENDENT_PLAYER(e))
+ if (!IS_INDEPENDENT_PLAYER(e))
FOR_EACH_PLAYER(other) if(e != other)
{
if(IS_PLAYER(other))
if(other.deadflag == DEAD_NO)
- if not(IS_INDEPENDENT_PLAYER(other))
+ if (!IS_INDEPENDENT_PLAYER(other))
if(boxesoverlap(e.absmin, e.absmax, other.absmin, other.absmax))
{
t = autocvar_g_balance_firetransfer_time * (e.fire_endtime - time);
{
if(self.health <= 0)
return;
-
+
if (!W_CheckProjectileDamage(inflictor.realowner, self.realowner, deathtype, -1)) // no exceptions
return; // g_balance_projectiledamage says to halt
-
+
self.health = self.health - damage;
-
+
if (self.health <= 0)
{
if(attacker != self.realowner)
// offhand hook controls
if(self.BUTTON_HOOK)
{
- if not(self.hook || (self.hook_state & HOOK_WAITING_FOR_RELEASE))
+ if (!(self.hook || (self.hook_state & HOOK_WAITING_FOR_RELEASE)))
{
self.hook_state |= HOOK_FIRING;
self.hook_state |= HOOK_WAITING_FOR_RELEASE;
sf |= 0x40;
if(self.lodmodelindex1)
sf |= 0x80;
-
+
WriteByte(MSG_ENTITY, ENT_CLIENT_WALL);
WriteByte(MSG_ENTITY, sf);
void SUB_NullThink(void) { }
-void(vector destangle, float tspeed, void() func) SUB_CalcAngleMove;
void() SUB_CalcMoveDone;
void() SUB_CalcAngleMoveDone;
//void() SUB_UseTargets;
void setanim(entity e, vector anim, float looping, float override, float restart)
{
if (!anim)
- return; // no animation was given to us! We can't use this.
-
+ return; // no animation was given to us! We can't use this.
+
if (anim_x == e.animstate_startframe)
if (anim_y == e.animstate_numframes)
if (anim_z == e.animstate_framerate)
self.think1 ();
}
+.float platmovetype_turn;
void SUB_CalcMove_controller_think (void)
{
entity oldself;
vector delta;
vector delta2;
vector veloc;
+ vector angloc;
vector nextpos;
delta = self.destvec;
delta2 = self.destvec2;
traveltime = self.animstate_endtime - self.animstate_starttime;
phasepos = (nexttick - self.animstate_starttime) / traveltime; // range: [0, 1]
- if(self.platmovetype != 1)
- {
- phasepos = 3.14159265 + (phasepos * 3.14159265); // range: [pi, 2pi]
- phasepos = cos(phasepos); // cos [pi, 2pi] is in [-1, 1]
- phasepos = phasepos + 1; // correct range to [0, 2]
- phasepos = phasepos / 2; // correct range to [0, 1]
- }
+ phasepos = cubic_speedfunc(self.platmovetype_start, self.platmovetype_end, phasepos);
nextpos = self.origin + (delta * phasepos) + (delta2 * phasepos * phasepos);
// derivative: delta + 2 * delta2 * phasepos (e.g. for angle positioning)
- if(nexttick < self.animstate_endtime) {
+ if(self.owner.platmovetype_turn)
+ {
+ vector destangle;
+ destangle = delta + 2 * delta2 * phasepos;
+ destangle = vectoangles(destangle);
+ destangle_x = -destangle_x; // flip up / down orientation
+
+ // take the shortest distance for the angles
+ self.owner.angles_x -= 360 * floor((self.owner.angles_x - destangle_x) / 360 + 0.5);
+ self.owner.angles_y -= 360 * floor((self.owner.angles_y - destangle_y) / 360 + 0.5);
+ self.owner.angles_z -= 360 * floor((self.owner.angles_z - destangle_z) / 360 + 0.5);
+ angloc = destangle - self.owner.angles;
+ angloc = angloc * (1 / sys_frametime); // so it arrives for the next frame
+ self.owner.avelocity = angloc;
+ }
+ if(nexttick < self.animstate_endtime)
veloc = nextpos - self.owner.origin;
- veloc = veloc * (1 / sys_frametime); // so it arrives for the next frame
- } else {
+ else
veloc = self.finaldest - self.owner.origin;
- veloc = veloc * (1 / sys_frametime); // so it arrives for the next frame
- }
+ veloc = veloc * (1 / sys_frametime); // so it arrives for the next frame
+
self.owner.velocity = veloc;
self.nextthink = nexttick;
} else {
controller.destvec = 2 * control; // control point
controller.destvec2 = dest - 2 * control; // quadratic part required to reach end point
+ // also: initial d/dphasepos origin = 2 * control, final speed = 2 * (dest - control)
}
void SUB_CalcMove_controller_setlinear (entity controller, vector org, vector dest)
controller.destvec2 = '0 0 0';
}
-void SUB_CalcMove_Bezier (vector tcontrol, vector tdest, float tspeed, void() func)
+float TSPEED_TIME = -1;
+float TSPEED_LINEAR = 0;
+float TSPEED_START = 1;
+float TSPEED_END = 2;
+// TODO average too?
+
+void SUB_CalcMove_Bezier (vector tcontrol, vector tdest, float tspeedtype, float tspeed, void() func)
{
float traveltime;
entity controller;
self.finaldest = tdest;
self.think = SUB_CalcMoveDone;
- if(tspeed > 0) // positive: start speed
- traveltime = 2 * vlen(tcontrol - self.origin) / tspeed;
- else // negative: end speed
- traveltime = 2 * vlen(tcontrol - tdest) / -tspeed;
+ switch(tspeedtype)
+ {
+ default:
+ case TSPEED_START:
+ traveltime = 2 * vlen(tcontrol - self.origin) / tspeed;
+ break;
+ case TSPEED_END:
+ traveltime = 2 * vlen(tcontrol - tdest) / tspeed;
+ break;
+ case TSPEED_LINEAR:
+ traveltime = vlen(tdest - self.origin) / tspeed;
+ break;
+ case TSPEED_TIME:
+ traveltime = tspeed;
+ break;
+ }
if (traveltime < 0.1) // useless anim
{
controller.classname = "SUB_CalcMove_controller";
controller.owner = self;
controller.platmovetype = self.platmovetype;
+ controller.platmovetype_start = self.platmovetype_start;
+ controller.platmovetype_end = self.platmovetype_end;
SUB_CalcMove_controller_setbezier(controller, self.origin, tcontrol, tdest);
controller.finaldest = (tdest + '0 0 0.125'); // where do we want to end? Offset to overshoot a bit.
controller.animstate_starttime = time;
// the thinking is now done by the controller
self.think = SUB_NullThink; // for PushMove
self.nextthink = self.ltime + traveltime;
-
+
// invoke controller
self = controller;
self.think();
self = self.owner;
}
-void SUB_CalcMove (vector tdest, float tspeed, void() func)
+void SUB_CalcMove (vector tdest, float tspeedtype, float tspeed, void() func)
{
vector delta;
float traveltime;
}
delta = tdest - self.origin;
- traveltime = vlen (delta) / tspeed;
+
+ switch(tspeedtype)
+ {
+ default:
+ case TSPEED_START:
+ case TSPEED_END:
+ case TSPEED_LINEAR:
+ traveltime = vlen (delta) / tspeed;
+ break;
+ case TSPEED_TIME:
+ traveltime = tspeed;
+ break;
+ }
// Very short animations don't really show off the effect
// of controlled animation, so let's just use linear movement.
// Alternatively entities can choose to specify non-controlled movement.
// The only currently implemented alternative movement is linear (value 1)
- if (traveltime < 0.15 || self.platmovetype == 1)
+ if (traveltime < 0.15 || (self.platmovetype_start == 1 && self.platmovetype_end == 1)) // is this correct?
{
self.velocity = delta * (1/traveltime); // QuakeC doesn't allow vector/float division
self.nextthink = self.ltime + traveltime;
}
// now just run like a bezier curve...
- SUB_CalcMove_Bezier((self.origin + tdest) * 0.5, tdest, tspeed, func);
+ SUB_CalcMove_Bezier((self.origin + tdest) * 0.5, tdest, tspeedtype, tspeed, func);
}
-void SUB_CalcMoveEnt (entity ent, vector tdest, float tspeed, void() func)
+void SUB_CalcMoveEnt (entity ent, vector tdest, float tspeedtype, float tspeed, void() func)
{
entity oldself;
oldself = self;
self = ent;
- SUB_CalcMove (tdest, tspeed, func);
+ SUB_CalcMove (tdest, tspeedtype, tspeed, func);
self = oldself;
}
}
// FIXME: I fixed this function only for rotation around the main axes
-void SUB_CalcAngleMove (vector destangle, float tspeed, void() func)
+void SUB_CalcAngleMove (vector destangle, float tspeedtype, float tspeed, void() func)
{
vector delta;
float traveltime;
self.angles_y -= 360 * floor((self.angles_y - destangle_y) / 360 + 0.5);
self.angles_z -= 360 * floor((self.angles_z - destangle_z) / 360 + 0.5);
delta = destangle - self.angles;
- traveltime = vlen (delta) / tspeed;
+
+ switch(tspeedtype)
+ {
+ default:
+ case TSPEED_START:
+ case TSPEED_END:
+ case TSPEED_LINEAR:
+ traveltime = vlen (delta) / tspeed;
+ break;
+ case TSPEED_TIME:
+ traveltime = tspeed;
+ break;
+ }
self.think1 = func;
self.finalangle = destangle;
self.nextthink = self.ltime + traveltime;
}
-void SUB_CalcAngleMoveEnt (entity ent, vector destangle, float tspeed, void() func)
+void SUB_CalcAngleMoveEnt (entity ent, vector destangle, float tspeedtype, float tspeed, void() func)
{
entity oldself;
oldself = self;
self = ent;
- SUB_CalcAngleMove (destangle, tspeed, func);
+ SUB_CalcAngleMove (destangle, tspeedtype, tspeed, func);
self = oldself;
}
// check whether antilagged traces are enabled
if (lag < 0.001)
lag = 0;
- if not(IS_REAL_CLIENT(forent))
+ if (!IS_REAL_CLIENT(forent))
lag = 0; // only antilag for clients
// change shooter to SOLID_BBOX so the shot can hit corpses
}
if(self.lodmodelindex1)
- if not(self.SendEntity)
+ if (!self.SendEntity)
SetCustomizer(self, LOD_customize, LOD_uncustomize);
}
if (self.classname == "trigger_secret")
{
- if not(IS_PLAYER(self.enemy))
+ if (!IS_PLAYER(self.enemy))
return;
found_secrets = found_secrets + 1;
WriteByte (MSG_ALL, SVC_FOUNDSECRET);
void multi_touch()
{
- if not(self.spawnflags & 2)
- if not(other.iscreature)
+ if (!(self.spawnflags & 2))
+ if (!other.iscreature)
return;
if(self.team)
.float triggerhurttime;
void trigger_hurt_touch()
{
- if (self.active != ACTIVE_ACTIVE)
+ if (self.active != ACTIVE_ACTIVE)
return;
if(self.team)
entity own;
own = self.enemy;
- if not(IS_PLAYER(own))
+ if (!IS_PLAYER(own))
{
own = self;
self.enemy = world; // I still hate you all
.float triggerhealtime;
void trigger_heal_touch()
{
- if (self.active != ACTIVE_ACTIVE)
+ if (self.active != ACTIVE_ACTIVE)
return;
-
+
// only do the EXACTTRIGGER_TOUCH checks when really needed (saves some cpu)
if (other.iscreature)
{
{
EXACTTRIGGER_TOUCH;
other.triggerhealtime = time + 1;
-
+
if (other.health < self.max_health)
{
other.health = min(other.health + self.health, self.max_health);
void spawnfunc_trigger_heal()
{
self.active = ACTIVE_ACTIVE;
-
+
EXACTTRIGGER_INIT;
self.touch = trigger_heal_touch;
if (!self.health)
g = self.gravity;
- if not(self.spawnflags & 1)
+ if (!(self.spawnflags & 1))
{
if(other.trigger_gravity_check)
{
void target_speaker_use_off();
void target_speaker_use_activator()
{
- if not(IS_REAL_CLIENT(activator))
+ if (!IS_REAL_CLIENT(activator))
return;
string snd;
if(substring(self.noise, 0, 1) == "*")
setmodel(self, self.model);
if(self.noise != "")
precache_sound (self.noise);
-
+
if(!self.bgmscriptsustain)
self.bgmscriptsustain = 1;
else if(self.bgmscriptsustain < 0)
if(self.enemy)
{
o = self.enemy.origin;
- if not(self.spawnflags & 2)
+ if (!(self.spawnflags & 2))
o = self.origin + normalize(o - self.origin) * 32768;
}
else
float pushdeltatime;
float str;
- if (self.active != ACTIVE_ACTIVE)
+ if (self.active != ACTIVE_ACTIVE)
return;
if (!isPushable(other))
{
float pushdeltatime;
- if (self.active != ACTIVE_ACTIVE)
+ if (self.active != ACTIVE_ACTIVE)
return;
if (!isPushable(other))
float pushdeltatime;
float str;
- if (self.active != ACTIVE_ACTIVE)
+ if (self.active != ACTIVE_ACTIVE)
return;
if (!isPushable(other))
return;
if(vs.message == "")
return;
- if not(IS_PLAYER(pl))
+ if (!IS_PLAYER(pl))
return;
if(gameover)
return;
// added after this message
// wait: average time between messages
// delay: initial delay before the first message
-
+
float i, n;
self.use = target_voicescript_use;
dotrigger = ((IS_PLAYER(source)) && (source.deadflag == DEAD_NO) && ((ear.radius == 0) || (vlen(source.origin - ear.origin) <= ear.radius)));
domatch = ((ear.spawnflags & 32) || dotrigger);
- if not(domatch)
+ if (!domatch)
return msgin;
- if not(msgin)
+ if (!msgin)
{
// we are in TUBA mode!
- if not(ear.spawnflags & 256)
+ if (!(ear.spawnflags & 256))
return msgin;
if(!W_Tuba_HasPlayed(source, ear.message, ear.movedir_x, !(ear.spawnflags & 512), ear.movedir_y, ear.movedir_z))
if(ear.spawnflags & 8)
return msgin;
}
-
+
matchstart = -1;
l = strlen(ear.message);
for(ear = magicears; ear; ear = ear.enemy)
{
msgout = trigger_magicear_processmessage(ear, source, teamsay, privatesay, msgin);
- if not(ear.spawnflags & 64)
+ if (!(ear.spawnflags & 64))
if(magicear_matched)
return msgout;
msgin = msgout;
void relay_activators_use()
{
entity trg, os;
-
+
os = self;
-
+
for(trg = world; (trg = find(trg, targetname, os.target)); )
{
self = trg;
if(os.cnt == ACTIVE_TOGGLE)
if(trg.active == ACTIVE_ACTIVE)
trg.active = ACTIVE_NOT;
- else
+ else
trg.active = ACTIVE_ACTIVE;
else
trg.active = os.cnt;
- }
+ }
}
self = os;
}
void spawnfunc_relay_deactivate()
{
self.cnt = ACTIVE_NOT;
- self.use = relay_activators_use;
+ self.use = relay_activators_use;
}
void spawnfunc_relay_activatetoggle()
{
self.cnt = ACTIVE_TOGGLE;
- self.use = relay_activators_use;
+ self.use = relay_activators_use;
}
.string chmap, gametype;
BADCVAR("g_nix");
BADCVAR("g_grappling_hook");
BADCVAR("g_jetpack");
-
+
#undef BADPREFIX
#undef BADCVAR
PlayerStats_AddGlobalInfo(e);
PlayerStats_Shutdown();
WeaponStats_Shutdown();
-
+
Kill_Notification(NOTIF_ALL, world, MSG_CENTER, 0); // kill all centerprints now
if(autocvar_sv_eventlog)
if(mapvote_initialized)
return "Can't suggest - voting is already in progress!";
m = MapInfo_FixName(m);
- if not(m)
+ if (!m)
return "The map you suggested is not available on this server.";
if(!autocvar_g_maplist_votable_suggestions_override_mostrecent)
if(Map_IsRecent(m))
* GET g_ban_sync_uri?action=unban&hostname=...&ip=xxx.xxx.xxx
* - Querying the ban list
* GET g_ban_sync_uri?action=list&hostname=...&servers=xxx.xxx.xxx.xxx;xxx.xxx.xxx.xxx;...
- *
+ *
* shows the bans from the listed servers, and possibly others.
* Format of a ban is ASCII plain text, four lines per ban, delimited by
* newline ONLY (no carriage return):
}
if(syncinterval > 0)
syncinterval *= 60;
-
+
if(status != 0)
{
print("error: status is ", ftos(status), "\n");
float argc;
string uri;
float i, n;
-
+
if(autocvar_g_ban_sync_uri == "")
goto killme;
if(autocvar_g_ban_sync_interval == 0) // < 0 is okay, it means "sync on level start only"
for(i = 1; i < argc; ++i)
OnlineBanList_Servers = strcat(OnlineBanList_Servers, ";", argv(i));
OnlineBanList_Servers = strzone(OnlineBanList_Servers);
-
+
uri = strcat( "action=list&hostname=", uri_escape(autocvar_hostname));
uri = strcat(uri, "&servers=", uri_escape(OnlineBanList_Servers));
else
uri_get(strcat(argv(i), "?", uri), URI_GET_IPBAN + i); // 1000 = "banlist" callback target
}
-
+
if(autocvar_g_ban_sync_interval > 0)
self.nextthink = time + max(60, autocvar_g_ban_sync_interval * 60);
else
{
float i, n;
string msg;
-
+
print("^2Listing all existing active bans:\n");
-
+
n = 0;
for(i = 0; i < ban_count; ++i)
{
if(time > ban_expire[i])
continue;
-
+
++n; // total number of existing bans
-
+
msg = strcat("#", ftos(i), ": ");
msg = strcat(msg, ban_ip[i], " is still banned for ");
msg = strcat(msg, ftos(ban_expire[i] - time), " seconds");
-
+
print(" ", msg, "\n");
}
-
+
print("^2Done listing all active (", ftos(n), ") bans.\n");
}
i4 = strstrofs(s, ".", i3 + 1);
if(i4 >= 0)
s = substring(s, 0, i4);
-
+
ban_ip1 = substring(s, 0, i1); // 8
ban_ip2 = substring(s, 0, i2); // 16
ban_ip3 = substring(s, 0, i3); // 24
{
if(!autocvar_g_banned_list_idmode)
return TRUE;
- if not(ban_idfp)
+ if (!ban_idfp)
return TRUE;
}
return FALSE;
float item_keys_usekey(entity l, entity p) {
float valid = l.itemkeys & p.itemkeys;
-
- if not(valid) {
+
+ if (!valid) {
// other has none of the needed keys
return FALSE;
} else if (l.itemkeys == valid) {
string item_keys_keylist(float keylist) {
float base, l;
string n;
-
+
// no keys
- if not(keylist)
+ if (!keylist)
return "";
-
+
// one key
if ((keylist & (keylist-1)) != 0)
return strcat("the ", item_keys_names[lowestbit(keylist)]);
-
+
n = "";
base = 0;
while (keylist) {
n = strcat(n, ", the ", item_keys_names[base + l]);
else
n = strcat("the ", item_keys_names[base + l]);
-
+
keylist = bitshift(keylist, -(l + 1));
base+= l + 1;
}
-
+
return n;
}
* Key touch handler.
*/
void item_key_touch(void) {
- if not(IS_PLAYER(other))
+ if (!IS_PLAYER(other))
return;
-
+
// player already picked up this key
if (other.itemkeys & self.itemkeys)
return;
-
+
other.itemkeys |= self.itemkeys;
play2(other, self.noise);
-
+
centerprint(other, self.message);
};
*/
void spawn_item_key() {
precache_model(self.model);
-
+
if (self.spawnflags & 1) // FLOATING
self.noalign = 1;
-
+
if (self.noalign)
self.movetype = MOVETYPE_NONE;
else
self.movetype = MOVETYPE_TOSS;
-
+
precache_sound(self.noise);
-
+
self.mdl = self.model;
self.effects = EF_LOWPRECISION;
setmodel(self, self.model);
setsize(self, '-16 -16 -56', '16 16 0');
self.modelflags |= MF_ROTATE;
self.solid = SOLID_TRIGGER;
-
+
if (!self.noalign)
{
// first nudge it off the floor a little bit to avoid math errors
/*QUAKED item_key (0 .5 .8) (-16 -16 -24) (16 16 32) FLOATING
A key entity.
The itemkeys should contain one of the following key IDs:
-1 - GOLD key -
+1 - GOLD key -
2 - SILVER key
4 - BRONZE key
8 - RED keycard
void spawnfunc_item_key() {
local string _model, _netname;
local vector _colormod;
-
+
// reject this entity if more than one key was set!
if (self.itemkeys>0 && (self.itemkeys & (self.itemkeys-1)) != 0) {
objerror("item_key.itemkeys must contain only 1 bit set specifying the key it represents!");
_netname = "GOLD key";
_colormod = '1 .9 0';
break;
-
+
case 2:
_netname = "SILVER key";
_colormod = '.9 .9 .9';
break;
-
+
case 4:
_netname = "BRONZE key";
_colormod = '.6 .25 0';
break;
-
+
case 8:
_netname = "RED keycard";
_colormod = '.9 0 0';
break;
-
+
case 16:
_netname = "BLUE keycard";
_colormod = '0 0 .9';
break;
-
+
case 32:
_netname = "GREEN keycard";
_colormod = '0 .9 0';
break;
-
+
default:
_netname = "FLUFFY PINK keycard";
_colormod = '1 1 1';
return;
}
break;
-
+
}
-
+
// find default model
#ifdef GMQCC
_model = string_null;
remove(self);
return;
}
-
+
// set defailt netname
if (self.netname == "")
self.netname = _netname;
-
+
// set default colormod
if (!self.colormod)
self.colormod = _colormod;
-
+
// set default model
if (self.model == "")
self.model = _model;
-
+
// set default pickup message
if (self.message == "")
self.message = strzone(strcat("You've picked up the ", self.netname, "!"));
if (self.noise == "")
self.noise = "misc/itempickup.wav";
-
+
// save the name for later
item_keys_names[lowestbit(self.itemkeys)] = self.netname;
- // put the key on the map
+ // put the key on the map
spawn_item_key();
}
*/
void trigger_keylock_trigger(string s) {
local entity t, stemp, otemp, atemp;
-
+
stemp = self;
otemp = other;
atemp = activator;
-
-
+
+
for(t = world; (t = find(t, targetname, s)); )
if (t.use) {
self = t;
activator = atemp;
self.use();
}
-
+
self = stemp;
other = otemp;
activator = atemp;
void trigger_keylock_touch(void) {
local float key_used, started_delay;
-
+
key_used = FALSE;
started_delay = FALSE;
-
+
// only player may trigger the lock
- if not(IS_PLAYER(other))
+ if (!IS_PLAYER(other))
return;
-
-
+
+
// check silver key
if (self.itemkeys)
key_used = item_keys_usekey(self, other);
-
+
activator = other;
-
+
if (self.itemkeys) {
// at least one of the keys is missing
if (key_used) {
centerprint(other, strcat("You need ", item_keys_keylist(self.itemkeys), "!"));
other.key_door_messagetime = time + 2;
}
-
+
// trigger target2
if (self.delay <= time || started_delay == TRUE)
if (self.target2) {
// all keys were given!
play2(other, self.noise);
centerprint(other, self.message);
-
+
if (self.target)
trigger_keylock_trigger(self.target);
-
+
if (self.killtarget)
trigger_keylock_kill(self.killtarget);
-
+
remove(self);
}
-
+
};
/*QUAKED trigger_keylock (.0 .5 .8) ?
return;
}
- // set unlocked message
+ // set unlocked message
if (self.message == "")
self.message = "Unlocked!";
-
+
// set default unlock noise
if (self.noise == "") {
if (self.sounds == 1)
else //if (self.sounds == 3) {
self.noise = "misc/trigger1.wav";
}
-
+
// set default use key sound
if (self.noise1 == "")
self.noise1 = "misc/decreasevalue.wav";
-
+
// set closed sourd
if (self.noise2 == "")
self.noise2 = "misc/talk.wav";
-
+
// delay between triggering message2 and trigger2
if (!self.wait)
self.wait = 5;
-
+
// precache sounds
precache_sound(self.noise);
precache_sound(self.noise1);
precache_sound(self.noise2);
-
+
EXACTTRIGGER_INIT;
-
+
self.touch = trigger_keylock_touch;
};
#define FOR_EACH_REALCLIENT(v) FOR_EACH_CLIENT(v) if(IS_REAL_CLIENT(v))
#define FOR_EACH_PLAYER(v) FOR_EACH_CLIENT(v) if(IS_PLAYER(v))
-#define FOR_EACH_SPEC(v) FOR_EACH_CLIENT(v) if not(IS_PLAYER(v)) // Samual: shouldn't this be IS_SPEC(v)? and rather create a separate macro to include observers too
+#define FOR_EACH_SPEC(v) FOR_EACH_CLIENT(v) if (!IS_PLAYER(v)) // Samual: shouldn't this be IS_SPEC(v)? and rather create a separate macro to include observers too
#define FOR_EACH_REALPLAYER(v) FOR_EACH_REALCLIENT(v) if(IS_PLAYER(v))
#define CENTER_OR_VIEWOFS(ent) (ent.origin + (IS_PLAYER(ent) ? ent.view_ofs : ((ent.mins + ent.maxs) * 0.5)))
WepSet warmup_start_weapons;
WepSet warmup_start_weapons_default;
WepSet warmup_start_weapons_defaultmask;
+#define WARMUP_START_WEAPONS ((g_warmup_allguns == 1) ? (warmup_start_weapons & (weaponsInMap | start_weapons)) : warmup_start_weapons)
float warmup_start_ammo_shells;
float warmup_start_ammo_nails;
float warmup_start_ammo_rockets;
d = 0; // weapon is set a few lines later
else
d = (i == WEP_LASER || i == WEP_SHOTGUN);
-
+
if(g_grappling_hook) // if possible, redirect off-hand hook to on-hand hook
d |= (i == WEP_HOOK);
if(weaponinfo.spawnflags & WEP_FLAG_MUTATORBLOCKED) // never default mutator blocked guns
d = 0;
var float t = cvar(strcat(cvarprefix, weaponinfo.netname));
-
+
//print(strcat("want_weapon: ", weaponinfo.netname, " - d: ", ftos(d), ", t: ", ftos(t), ". \n"));
-
+
// bit order in t:
// 1: want or not
// 2: is default?
for (j = WEP_FIRST; j <= WEP_LAST; ++j)
{
e = get_weaponinfo(j);
- if not(e.spawnflags & WEP_FLAG_MUTATORBLOCKED)
+ if (!(e.spawnflags & WEP_FLAG_MUTATORBLOCKED))
g_weaponarena_weapons |= WepSet_FromWeapon(j);
}
}
for (j = WEP_FIRST; j <= WEP_LAST; ++j)
{
e = get_weaponinfo(j);
- if not(e.spawnflags & WEP_FLAG_MUTATORBLOCKED)
+ if (!(e.spawnflags & WEP_FLAG_MUTATORBLOCKED))
if (e.spawnflags & WEP_FLAG_NORMAL)
g_weaponarena_weapons |= WepSet_FromWeapon(j);
}
if(!cvar("g_use_ammunition"))
start_items |= IT_UNLIMITED_AMMO;
-
+
if(start_items & IT_UNLIMITED_WEAPON_AMMO)
{
start_ammo_rockets = 999;
for (i = WEP_FIRST; i <= WEP_LAST; ++i)
{
e = get_weaponinfo(i);
- float w = want_weapon("g_start_weapon_", e, cvar("g_warmup_allguns"));
+ float w = want_weapon("g_start_weapon_", e, g_warmup_allguns);
if(w & 1)
warmup_start_weapons |= WepSet_FromWeapon(i);
if(w & 2)
warmup_start_ammo_fuel = max(warmup_start_ammo_fuel, cvar("g_balance_fuel_rotstable"));
}
+ WepSet precache_weapons = start_weapons;
+ if (g_warmup_allguns != 1)
+ precache_weapons |= warmup_start_weapons;
for (i = WEP_FIRST; i <= WEP_LAST; ++i)
{
e = get_weaponinfo(i);
- if((start_weapons | warmup_start_weapons) & WepSet_FromWeapon(i))
+ if(precache_weapons & WepSet_FromWeapon(i))
weapon_action(i, WR_PRECACHE);
}
// load mutators
#define CHECK_MUTATOR_ADD(mut_cvar,mut_name,dependence) \
{ if(cvar(mut_cvar) && dependence) { MUTATOR_ADD(mut_name); } }
-
+
CHECK_MUTATOR_ADD("g_dodging", mutator_dodging, 1);
CHECK_MUTATOR_ADD("g_spawn_near_teammate", mutator_spawn_near_teammate, 1);
CHECK_MUTATOR_ADD("g_physical_items", mutator_physical_items, 1);
CHECK_MUTATOR_ADD("g_nades", mutator_nades, 1);
CHECK_MUTATOR_ADD("g_sandbox", sandbox, 1);
CHECK_MUTATOR_ADD("g_campcheck", mutator_campcheck, 1);
-
+
#undef CHECK_MUTATOR_ADD
-
+
if(cvar("sv_allow_fullbright"))
serverflags |= SERVERFLAG_ALLOW_FULLBRIGHT;
g_bugrigs_speed_ref = cvar("g_bugrigs_speed_ref");
g_bugrigs_speed_pow = cvar("g_bugrigs_speed_pow");
g_bugrigs_steer = cvar("g_bugrigs_steer");
-
+
g_minstagib = cvar("g_minstagib");
sv_clones = cvar("sv_clones");
if(!g_weapon_stay)
g_weapon_stay = cvar("g_weapon_stay");
- if not(warmup_stage)
+ if (!warmup_stage)
game_starttime = time + cvar("g_start_delay");
readplayerstartcvars();
void adaptor_think2use_hittype_splash() // for timed projectile detonation
{
- if not(self.flags & FL_ONGROUND) // if onground, we ARE touching something, but HITTYPE_SPLASH is to be networked if the damage causing projectile is not touching ANYTHING
+ if(!(self.flags & FL_ONGROUND)) // if onground, we ARE touching something, but HITTYPE_SPLASH is to be networked if the damage causing projectile is not touching ANYTHING
self.projectiledeathtype |= HITTYPE_SPLASH;
adaptor_think2use();
}
db_put(ServerProgsDB, strcat("uid2name", myuid), "");
}
}
-
+
if(s == "")
s = "^1Unregistered Player";
return s;
float randombit(float bits)
{
- if not(bits & (bits-1)) // this ONLY holds for powers of two!
+ if(!(bits & (bits-1))) // this ONLY holds for powers of two!
return bits;
float n, f, b, r;
#else
string cvar_string_normal(string n)
{
- if not(cvar_type(n) & 1)
+ if (!(cvar_type(n) & 1))
backtrace(strcat("Attempt to access undefined cvar: ", n));
return builtin_cvar_string(n);
}
-#ifdef SVQC
+#ifdef SVQC
.vector moveto;
/**
{
if(name == loaded_mutators[i])
return 1; // already added
- if not(loaded_mutators[i])
+ if (!(loaded_mutators[i]))
j = i;
}
if(j < 0)
entity frag_attacker;
entity frag_target; // same as self
float frag_deathtype;
-
+
MUTATOR_HOOKABLE(PlayerJump);
// called when a player presses the jump key
// INPUT, OUTPUT:
// appends ", Mutator name" to ret_string for display
// INPUT, OUTPUT:
string ret_string;
-
+
MUTATOR_HOOKABLE(CustomizeWaypoint);
// called every frame
// customizes the waypoint for spectators
MUTATOR_HOOKABLE(TurretSpawn);
// return error to request removal
// INPUT: self - turret
-
+
MUTATOR_HOOKABLE(OnEntityPreSpawn);
// return error to prevent entity spawn, or modify the entity
// INPUT, OUTPUT:
float damage_take;
float damage_save;
-
+
MUTATOR_HOOKABLE(PlayerDamage_Calculate);
// called to adjust damage and force values which are applied to the player, used for e.g. strength damage/force multiplier
// i'm not sure if I should change this around slightly (Naming of the entities, and also how they're done in g_damage).
// called at the end of player_powerups() in cl_client.qc, used for manipulating the values which are set by powerup items.
// INPUT
entity self;
- float olditems; // also technically output, but since it is at the end of the function it's useless for that :P
+ float olditems; // also technically output, but since it is at the end of the function it's useless for that :P
MUTATOR_HOOKABLE(PlayerUseKey);
// called when the use key is pressed
MUTATOR_HOOKABLE(SetModname);
// OUT
string modname; // name of the mutator/mod if it warrants showing as such in the server browser
-
+
MUTATOR_HOOKABLE(Item_Spawn);
// called for each item being spawned on a map, including dropped weapons
// return 1 to remove an item
entity other; // weapon info
// IN+OUT
string ret_string;
-
+
MUTATOR_HOOKABLE(Item_RespawnCountdown);
// called when an item is about to respawn
// INPUT+OUTPUT:
string item_name;
vector item_color;
-
+
MUTATOR_HOOKABLE(BotShouldAttack);
// called when a bot checks a target to attack
// INPUT
// allows you to strip a player of an item if they go through the teleporter to help prevent cheating
// INPUT
entity self;
-
+
MUTATOR_HOOKABLE(HelpMePing);
// called whenever a player uses impulse 33 (help me) in cl_impulse.qc
// normally help me ping uses self.waypointsprite_attachedforcarrier,
// in a special manner using this hook
// INPUT
entity self; // the player who pressed impulse 33
-
+
MUTATOR_HOOKABLE(VehicleSpawn);
// called when a vehicle initializes
// return TRUE to remove the vehicle
-
+
MUTATOR_HOOKABLE(VehicleEnter);
// called when a player enters a vehicle
// allows mutators to set special settings in this event
// INPUT
entity vh_player; // player
entity vh_vehicle; // vehicle
-
+
MUTATOR_HOOKABLE(VehicleTouch);
// called when a player touches a vehicle
// return TRUE to stop player from entering the vehicle
// INPUT
entity self; // vehicle
entity other; // player
-
+
MUTATOR_HOOKABLE(VehicleExit);
// called when a player exits a vehicle
// allows mutators to set special settings in this event
// INPUT
entity vh_player; // player
entity vh_vehicle; // vehicle
-
+
MUTATOR_HOOKABLE(AbortSpeedrun);
// called when a speedrun is aborted and the player is teleported back to start position
// INPUT
// spawnfuncs
void spawnfunc_info_player_attacker()
{
- if not(g_assault) { remove(self); return; }
-
+ if (!g_assault) { remove(self); return; }
+
self.team = NUM_TEAM_1; // red, gets swapped every round
spawnfunc_info_player_deathmatch();
}
void spawnfunc_info_player_defender()
{
- if not(g_assault) { remove(self); return; }
-
+ if (!g_assault) { remove(self); return; }
+
self.team = NUM_TEAM_2; // blue, gets swapped every round
spawnfunc_info_player_deathmatch();
}
void spawnfunc_target_objective()
{
- if not(g_assault) { remove(self); return; }
-
+ if (!g_assault) { remove(self); return; }
+
self.classname = "target_objective";
self.use = assault_objective_use;
assault_objective_reset();
void spawnfunc_target_objective_decrease()
{
- if not(g_assault) { remove(self); return; }
+ if (!g_assault) { remove(self); return; }
self.classname = "target_objective_decrease";
// destructible walls that can be used to trigger target_objective_decrease
void spawnfunc_func_assault_destructible()
{
- if not(g_assault) { remove(self); return; }
-
+ if (!g_assault) { remove(self); return; }
+
self.spawnflags = 3;
self.classname = "func_assault_destructible";
-
+
if(assault_attacker_team == NUM_TEAM_1)
self.team = NUM_TEAM_2;
else
void spawnfunc_func_assault_wall()
{
- if not(g_assault) { remove(self); return; }
-
+ if (!g_assault) { remove(self); return; }
+
self.classname = "func_assault_wall";
self.mdl = self.model;
setmodel(self, self.mdl);
void spawnfunc_target_assault_roundend()
{
- if not(g_assault) { remove(self); return; }
+ if (!g_assault) { remove(self); return; }
self.winning = 0; // round not yet won by attackers
self.classname = "target_assault_roundend";
void spawnfunc_target_assault_roundstart()
{
- if not(g_assault) { remove(self); return; }
-
+ if (!g_assault) { remove(self); return; }
+
assault_attacker_team = NUM_TEAM_1;
self.classname = "target_assault_roundstart";
self.use = assault_roundstart_use;
if (ad.target == "")
continue;
- if not(ad.bot_attack)
+ if (!ad.bot_attack)
continue;
found = FALSE;
centerprint(self, "You are attacking!");
else
centerprint(self, "You are defending!");
-
+
return FALSE;
}
MUTATOR_HOOKFUNCTION(assault_TurretSpawn)
{
- if not (self.team)
+ if (!self.team)
self.team = 14;
return FALSE;
MUTATOR_HOOK(TurretSpawn, assault_TurretSpawn, CBC_ORDER_ANY);
MUTATOR_HOOK(VehicleSpawn, assault_VehicleSpawn, CBC_ORDER_ANY);
MUTATOR_HOOK(HavocBot_ChooseRule, assault_BotRoles, CBC_ORDER_ANY);
-
+
MUTATOR_ONADD
{
if(time > 1) // game loads at time 1
start_ammo_rockets = cvar("g_lms_start_ammo_rockets");
start_ammo_cells = cvar("g_lms_start_ammo_cells");
start_ammo_fuel = cvar("g_lms_start_ammo_fuel");
-
+
start_items &= ~IT_UNLIMITED_AMMO;
return 0;
if(frag_target.deadflag == DEAD_NO)
if(frag_target == frag_attacker || SAME_TEAM(frag_target, frag_attacker) || frag_deathtype == DEATH_FALL)
frag_damage = 0;
-
+
frag_mirrordamage = 0;
-
+
return FALSE;
}
if(autocvar_g_powerups <= 0)
if(self.flags & FL_POWERUP)
return TRUE;
-
+
if(autocvar_g_pickup_items <= 0)
return TRUE;
-
+
return FALSE;
}
MUTATOR_HOOKFUNCTION(ca_PlayerDamage_SplitHealthArmor)
{
float excess = max(0, frag_damage - damage_take - damage_save);
-
+
if(frag_target != frag_attacker && IS_PLAYER(frag_attacker))
PlayerTeamScore_Add(frag_attacker, SP_SCORE, ST_SCORE, (frag_damage - excess) * autocvar_g_ca_damage2score_multiplier);
-
+
return FALSE;
}
float cap_record = ctf_captimerecord;
float cap_time = (time - flag.ctf_pickuptime);
string refername = db_get(ServerProgsDB, strcat(GetMapname(), "/captimerecord/netname"));
-
+
// notify about shit
if(!ctf_captimerecord) { Send_Notification(NOTIF_ALL, world, MSG_CHOICE, APP_TEAM_ENT_2(flag, CHOICE_CTF_CAPTURE_TIME_), player.netname, (cap_time * 100)); }
else if(cap_time < cap_record) { Send_Notification(NOTIF_ALL, world, MSG_CHOICE, APP_TEAM_ENT_2(flag, CHOICE_CTF_CAPTURE_BROKEN_), player.netname, refername, (cap_time * 100), (cap_record * 100)); }
else { Send_Notification(NOTIF_ALL, world, MSG_CHOICE, APP_TEAM_ENT_2(flag, CHOICE_CTF_CAPTURE_UNBROKEN_), player.netname, refername, (cap_time * 100), (cap_record * 100)); }
-
+
// write that shit in the database
if((!ctf_captimerecord) || (cap_time < cap_record))
{
ctf_captimerecord = cap_time;
db_put(ServerProgsDB, strcat(GetMapname(), "/captimerecord/time"), ftos(cap_time));
db_put(ServerProgsDB, strcat(GetMapname(), "/captimerecord/netname"), player.netname);
- write_recordmarker(player, (time - cap_time), cap_time);
- }
+ write_recordmarker(player, (time - cap_time), cap_time);
+ }
}
void ctf_FlagcarrierWaypoints(entity player)
float ang; // angle between shotdir and h
float h; // hypotenuse, which is the distance between attacker to head
float a; // adjacent side, which is the distance between attacker and the point on w_shotdir that is closest to head.origin
-
+
h = vlen(head_center - passer_center);
ang = acos(dotproduct(normalize(head_center - passer_center), v_forward));
a = h * cos(ang);
// =======================
-// CaptureShield Functions
+// CaptureShield Functions
// =======================
-float ctf_CaptureShield_CheckStatus(entity p)
+float ctf_CaptureShield_CheckStatus(entity p)
{
float s, se;
entity e;
// player is in the worse half, if >= half the players are better than him, or consequently, if < half of the players are worse
// use this rule here
-
+
if(players_worseeq >= players_total * ctf_captureshield_max_ratio)
return FALSE;
{
if(!other.ctf_captureshielded) { return FALSE; }
if(SAME_TEAM(self, other)) { return FALSE; }
-
+
return TRUE;
}
{
if(!other.ctf_captureshielded) { return; }
if(SAME_TEAM(self, other)) { return; }
-
+
vector mymid = (self.absmin + self.absmax) * 0.5;
vector othermid = (other.absmin + other.absmax) * 0.5;
void ctf_CaptureShield_Spawn(entity flag)
{
entity shield = spawn();
-
+
shield.enemy = self;
shield.team = self.team;
shield.touch = ctf_CaptureShield_Touch;
shield.solid = SOLID_TRIGGER;
shield.avelocity = '7 0 11';
shield.scale = 0.5;
-
+
setorigin(shield, self.origin);
setmodel(shield, "models/ctf/shield.md3");
setsize(shield, shield.scale * shield.mins, shield.scale * shield.maxs);
flag.ctf_droptime = time;
flag.ctf_dropper = player;
flag.ctf_status = FLAG_DROPPED;
-
+
// messages and sounds
Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_LOST_), player.netname);
sound(flag, CH_TRIGGER, flag.snd_flag_dropped, VOL_BASE, ATTEN_NONE);
ctf_EventLog("dropped", player.team, player);
// scoring
- PlayerTeamScore_AddScore(player, -autocvar_g_ctf_score_penalty_drop);
+ PlayerTeamScore_AddScore(player, -autocvar_g_ctf_score_penalty_drop);
PlayerScore_Add(player, SP_CTF_DROPS, 1);
-
+
// waypoints
if(autocvar_g_ctf_flag_dropped_waypoint)
WaypointSprite_Spawn("flagdropped", 0, 0, flag, FLAG_WAYPOINT_OFFSET, world, ((autocvar_g_ctf_flag_dropped_waypoint == 2) ? 0 : player.team), flag, wps_flagdropped, TRUE, RADARICON_FLAG, WPCOLOR_DROPPEDFLAG(flag.team));
WaypointSprite_UpdateMaxHealth(flag.wps_flagdropped, flag.max_flag_health);
WaypointSprite_UpdateHealth(flag.wps_flagdropped, flag.health);
}
-
+
player.throw_antispam = time + autocvar_g_ctf_pass_wait;
-
+
if(droptype == DROP_PASS)
{
flag.pass_distance = 0;
{
entity tmp_player; // temporary entity which the FOR_EACH_PLAYER loop uses to scan players
entity sender = flag.pass_sender;
-
+
// transfer flag to player
flag.owner = player;
flag.owner.flagcarried = flag;
-
+
// reset flag
setattachment(flag, player, "");
setorigin(flag, FLAG_CARRY_OFFSET);
// messages and sounds
sound(player, CH_TRIGGER, flag.snd_flag_pass, VOL_BASE, ATTEN_NORM);
ctf_EventLog("receive", flag.team, player);
-
+
FOR_EACH_REALPLAYER(tmp_player)
{
if(tmp_player == sender)
else if(SAME_TEAM(tmp_player, sender))
Send_Notification(NOTIF_ONE, tmp_player, MSG_CENTER, APP_TEAM_ENT_2(flag, CENTER_CTF_PASS_OTHER_), sender.netname, player.netname);
}
-
+
// create new waypoint
ctf_FlagcarrierWaypoints(player);
-
+
sender.throw_antispam = time + autocvar_g_ctf_pass_wait;
player.throw_antispam = sender.throw_antispam;
{
entity flag = player.flagcarried;
vector targ_origin, flag_velocity;
-
+
if(!flag) { return; }
if((droptype == DROP_PASS) && !receiver) { return; }
-
+
if(flag.speedrunning) { ctf_RespawnFlag(flag); return; }
-
+
// reset the flag
setattachment(flag, world, "");
setorigin(flag, player.origin + FLAG_DROP_OFFSET);
flag.solid = SOLID_TRIGGER;
flag.ctf_dropper = player;
flag.ctf_droptime = time;
-
+
flag.flags = FL_ITEM | FL_NOTARGET; // clear FL_ONGROUND for MOVETYPE_TOSS
-
+
switch(droptype)
{
case DROP_PASS:
flag.pass_sender = player;
flag.pass_target = receiver;
flag.ctf_status = FLAG_PASSING;
-
+
// other
sound(player, CH_TRIGGER, flag.snd_flag_touch, VOL_BASE, ATTEN_NORM);
WarpZone_TrailParticles(world, particleeffectnum(flag.passeffect), player.origin, targ_origin);
ctf_EventLog("pass", flag.team, player);
break;
}
-
+
case DROP_THROW:
{
makevectors((player.v_angle_y * '0 1 0') + (bound(autocvar_g_ctf_throw_angle_min, player.v_angle_x, autocvar_g_ctf_throw_angle_max) * '1 0 0'));
-
+
flag_velocity = (('0 0 1' * autocvar_g_ctf_throw_velocity_up) + ((v_forward * autocvar_g_ctf_throw_velocity_forward) * ((player.items & IT_STRENGTH) ? autocvar_g_ctf_throw_strengthmultiplier : 1)));
flag.velocity = W_CalculateProjectileVelocity(player.velocity, flag_velocity, FALSE);
ctf_Handle_Drop(flag, player, droptype);
break;
}
-
+
case DROP_RESET:
{
flag.velocity = '0 0 0'; // do nothing
break;
}
-
+
default:
case DROP_NORMAL:
{
// kill old waypointsprite
WaypointSprite_Ping(player.wps_flagcarrier);
WaypointSprite_Kill(player.wps_flagcarrier);
-
+
if(player.wps_enemyflagcarrier)
WaypointSprite_Kill(player.wps_enemyflagcarrier);
-
+
// captureshield
ctf_CaptureShield_Update(player, 0); // shield player from picking up flag
}
{
entity enemy_flag = ((capturetype == CAPTURE_NORMAL) ? toucher.flagcarried : toucher);
entity player = ((capturetype == CAPTURE_NORMAL) ? toucher : enemy_flag.ctf_dropper);
- float old_time, new_time;
-
- if not(player) { return; } // without someone to give the reward to, we can't possibly cap
-
+ float old_time, new_time;
+
+ if (!player) { return; } // without someone to give the reward to, we can't possibly cap
+
// messages and sounds
Send_Notification(NOTIF_ONE, player, MSG_CENTER, APP_TEAM_ENT_2(enemy_flag, CENTER_CTF_CAPTURE_));
ctf_CaptureRecord(enemy_flag, player);
sound(player, CH_TRIGGER, flag.snd_flag_capture, VOL_BASE, ATTEN_NONE);
-
+
switch(capturetype)
{
case CAPTURE_NORMAL: ctf_EventLog("capture", enemy_flag.team, player); break;
case CAPTURE_DROPPED: ctf_EventLog("droppedcapture", enemy_flag.team, player); break;
default: break;
}
-
+
// scoring
PlayerTeamScore_AddScore(player, autocvar_g_ctf_score_capture);
PlayerTeamScore_Add(player, SP_CTF_CAPS, ST_CTF_CAPS, 1);
{
WaypointSprite_Kill(player.wps_flagcarrier);
if(flag.speedrunning) { ctf_FakeTimeLimit(player, -1); }
-
+
if((enemy_flag.ctf_dropper) && (player != enemy_flag.ctf_dropper))
{ PlayerTeamScore_AddScore(enemy_flag.ctf_dropper, autocvar_g_ctf_score_capture_assist); }
}
-
+
// reset the flag
player.next_take_time = time + autocvar_g_ctf_flag_collect_delay;
ctf_RespawnFlag(enemy_flag);
PlayerScore_Add(player, SP_CTF_RETURNS, 1); // add to count of returns
TeamScore_AddToTeam(flag.team, ST_SCORE, -autocvar_g_ctf_score_penalty_returned); // punish the team who was last carrying it
-
- if(flag.ctf_dropper)
+
+ if(flag.ctf_dropper)
{
PlayerScore_Add(flag.ctf_dropper, SP_SCORE, -autocvar_g_ctf_score_penalty_returned); // punish the player who dropped the flag
- ctf_CaptureShield_Update(flag.ctf_dropper, 0); // shield player from picking up flag
+ ctf_CaptureShield_Update(flag.ctf_dropper, 0); // shield player from picking up flag
flag.ctf_dropper.next_take_time = time + autocvar_g_ctf_flag_collect_delay; // set next take time
}
-
+
// reset the flag
ctf_RespawnFlag(flag);
}
{
// declarations
float pickup_dropped_score; // used to calculate dropped pickup score
-
+
// attach the flag to the player
flag.owner = player;
player.flagcarried = flag;
setattachment(flag, player, "");
setorigin(flag, FLAG_CARRY_OFFSET);
-
+
// flag setup
flag.movetype = MOVETYPE_NONE;
flag.takedamage = DAMAGE_NO;
flag.solid = SOLID_NOT;
flag.angles = '0 0 0';
flag.ctf_status = FLAG_CARRY;
-
+
switch(pickuptype)
{
case PICKUP_BASE: flag.ctf_pickuptime = time; break; // used for timing runs
}
// messages and sounds
- Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_PICKUP_), player.netname);
+ Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_PICKUP_), player.netname);
Send_Notification(NOTIF_ONE, player, MSG_CENTER, APP_TEAM_ENT_2(flag, CENTER_CTF_PICKUP_));
if(ctf_stalemate) { Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_CTF_STALEMATE_CARRIER); }
-
+
Send_Notification(NOTIF_TEAM_EXCEPT, player, MSG_CHOICE, CHOICE_CTF_PICKUP_TEAM, Team_ColorCode(player.team), player.netname);
Send_Notification(NOTIF_TEAM, flag, MSG_CHOICE, CHOICE_CTF_PICKUP_ENEMY, Team_ColorCode(player.team), player.netname);
-
+
sound(player, CH_TRIGGER, flag.snd_flag_taken, VOL_BASE, ATTEN_NONE);
-
+
// scoring
PlayerScore_Add(player, SP_CTF_PICKUPS, 1);
switch(pickuptype)
- {
+ {
case PICKUP_BASE:
{
PlayerTeamScore_AddScore(player, autocvar_g_ctf_score_pickup_base);
ctf_EventLog("steal", flag.team, player);
break;
}
-
+
case PICKUP_DROPPED:
{
pickup_dropped_score = (autocvar_g_ctf_flag_return_time ? bound(0, ((flag.ctf_droptime + autocvar_g_ctf_flag_return_time) - time) / autocvar_g_ctf_flag_return_time, 1) : 1);
ctf_EventLog("pickup", flag.team, player);
break;
}
-
+
default: break;
}
-
+
// speedrunning
if(pickuptype == PICKUP_BASE)
{
if((player.speedrunning) && (ctf_captimerecord))
ctf_FakeTimeLimit(player, time + ctf_captimerecord);
}
-
+
// effects
pointparticles(particleeffectnum(flag.toucheffect), player.origin, '0 0 0', 1);
-
- // waypoints
+
+ // waypoints
if(pickuptype == PICKUP_DROPPED) { WaypointSprite_Kill(flag.wps_flagdropped); }
ctf_FlagcarrierWaypoints(player);
WaypointSprite_Ping(player.wps_flagcarrier);
if((flag.ctf_status == FLAG_DROPPED) || (flag.ctf_status == FLAG_PASSING))
{
if(flag.wps_flagdropped) { WaypointSprite_UpdateHealth(flag.wps_flagdropped, flag.health); }
-
+
if((flag.health <= 0) || (time >= flag.ctf_droptime + autocvar_g_ctf_flag_return_time))
{
switch(returntype)
case RETURN_DAMAGE: Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_FLAGRETURN_DAMAGED_)); break;
case RETURN_SPEEDRUN: Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_FLAGRETURN_SPEEDRUN_), ctf_captimerecord); break;
case RETURN_NEEDKILL: Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_FLAGRETURN_NEEDKILL_)); break;
-
+
default:
case RETURN_TIMEOUT:
{ Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_FLAGRETURN_TIMEOUT_)); break; }
{
tmp_entity.ctf_staleflagnext = ctf_staleflaglist; // link flag into staleflaglist
ctf_staleflaglist = tmp_entity;
-
+
switch(tmp_entity.team)
{
case NUM_TEAM_1: ++stale_red_flags; break;
{ ctf_stalemate = FALSE; wpforenemy_announced = FALSE; }
else if((!stale_red_flags || !stale_blue_flags) && autocvar_g_ctf_stalemate_endcondition == 1)
{ ctf_stalemate = FALSE; wpforenemy_announced = FALSE; }
-
+
// if sufficient stalemate, then set up the waypointsprite and announce the stalemate if necessary
if(ctf_stalemate)
{
if((tmp_entity.owner) && (!tmp_entity.owner.wps_enemyflagcarrier))
WaypointSprite_Spawn("enemyflagcarrier", 0, 0, tmp_entity.owner, FLAG_WAYPOINT_OFFSET, world, tmp_entity.team, tmp_entity.owner, wps_enemyflagcarrier, TRUE, RADARICON_FLAG, WPCOLOR_ENEMYFC(tmp_entity.owner.team));
}
-
- if not(wpforenemy_announced)
+
+ if (!wpforenemy_announced)
{
FOR_EACH_REALPLAYER(tmp_entity)
Send_Notification(NOTIF_ONE, tmp_entity, MSG_CENTER, ((tmp_entity.flagcarried) ? CENTER_CTF_STALEMATE_CARRIER : CENTER_CTF_STALEMATE_OTHER));
-
+
wpforenemy_announced = TRUE;
}
}
ctf_CheckFlagReturn(self, RETURN_NEEDKILL);
return;
}
- if(autocvar_g_ctf_flag_return_damage)
+ if(autocvar_g_ctf_flag_return_damage)
{
// reduce health and check if it should be returned
self.health = self.health - damage;
tracebox(self.origin, FLAG_MIN, FLAG_MAX, self.origin, MOVE_NOMONSTERS, self);
if(!trace_startsolid) // can we resize it without getting stuck?
setsize(self, FLAG_MIN, FLAG_MAX); }
-
+
switch(self.ctf_status) // reset flag angles in case warpzones adjust it
{
case FLAG_DROPPED:
self.angles = '0 0 0';
break;
}
-
+
default: break;
}
// main think method
switch(self.ctf_status)
- {
+ {
case FLAG_BASE:
{
if(autocvar_g_ctf_dropped_capture_radius)
}
return;
}
-
+
case FLAG_DROPPED:
{
if(autocvar_g_ctf_flag_dropped_floatinwater)
if(pointcontents(midpoint) == CONTENT_WATER)
{
self.velocity = self.velocity * 0.5;
-
+
if(pointcontents(midpoint + FLAG_FLOAT_OFFSET) == CONTENT_WATER)
{ self.velocity_z = autocvar_g_ctf_flag_dropped_floatinwater; }
else
self.health -= ((self.max_flag_health / autocvar_g_ctf_flag_return_time) * FLAG_THINKRATE);
ctf_CheckFlagReturn(self, RETURN_TIMEOUT);
return;
- }
+ }
return;
}
-
+
case FLAG_CARRY:
{
- if(self.speedrunning && ctf_captimerecord && (time >= self.ctf_pickuptime + ctf_captimerecord))
+ if(self.speedrunning && ctf_captimerecord && (time >= self.ctf_pickuptime + ctf_captimerecord))
{
self.health = 0;
ctf_CheckFlagReturn(self, RETURN_SPEEDRUN);
}
return;
}
-
+
case FLAG_PASSING:
{
vector targ_origin = ((self.pass_target.absmin + self.pass_target.absmax) * 0.5);
targ_origin = WarpZone_RefSys_TransformOrigin(self.pass_target, self, targ_origin); // origin of target as seen by the flag (us)
WarpZone_TraceLine(self.origin, targ_origin, MOVE_NOMONSTERS, self);
-
+
if((self.pass_target == world)
|| (self.pass_target.deadflag != DEAD_NO)
|| (vlen(self.origin - targ_origin) > autocvar_g_ctf_pass_radius)
void ctf_FlagTouch()
{
if(gameover) { return; }
-
+
entity toucher = other;
-
+
// automatically kill the flag and return it if it touched lava/slime/nodrop surfaces
if(ITEM_TOUCH_NEEDKILL())
{
ctf_CheckFlagReturn(self, RETURN_NEEDKILL);
return;
}
-
+
// special touch behaviors
if(toucher.vehicle_flags & VHF_ISVEHICLE)
{
else
return; // do nothing
}
- else if not(IS_PLAYER(toucher)) // The flag just touched an object, most likely the world
+ else if (!IS_PLAYER(toucher)) // The flag just touched an object, most likely the world
{
if(time > self.wait) // if we haven't in a while, play a sound/effect
{
}
else if(toucher.deadflag != DEAD_NO) { return; }
- switch(self.ctf_status)
- {
+ switch(self.ctf_status)
+ {
case FLAG_BASE:
{
if(SAME_TEAM(toucher, self) && (toucher.flagcarried) && DIFF_TEAM(toucher.flagcarried, self))
ctf_Handle_Pickup(self, toucher, PICKUP_BASE); // toucher just stole the enemies flag
break;
}
-
+
case FLAG_DROPPED:
{
if(SAME_TEAM(toucher, self))
ctf_Handle_Pickup(self, toucher, PICKUP_DROPPED); // toucher just picked up a dropped enemy flag
break;
}
-
+
case FLAG_CARRY:
{
dprint("Someone touched a flag even though it was being carried?\n");
break;
}
-
+
case FLAG_PASSING:
{
if((IS_PLAYER(toucher)) && (toucher.deadflag == DEAD_NO) && (toucher != self.pass_sender))
{ backtrace("flag respawn called twice quickly! please notify Samual about this..."); }
flag.last_respawn = time;
-
+
// reset the player (if there is one)
if((flag.owner) && (flag.owner.flagcarried == flag))
{
if(flag.owner.wps_enemyflagcarrier)
WaypointSprite_Kill(flag.owner.wps_enemyflagcarrier);
-
+
WaypointSprite_Kill(flag.wps_flagcarrier);
-
+
flag.owner.flagcarried = world;
if(flag.speedrunning)
// reset the flag
setattachment(flag, world, "");
setorigin(flag, flag.ctf_spawnorigin);
-
+
flag.movetype = ((flag.noalign) ? MOVETYPE_NONE : MOVETYPE_TOSS);
flag.takedamage = DAMAGE_NO;
flag.health = flag.max_flag_health;
flag.velocity = '0 0 0';
flag.angles = flag.mangle;
flag.flags = FL_ITEM | FL_NOTARGET;
-
+
flag.ctf_status = FLAG_BASE;
flag.owner = world;
flag.pass_distance = 0;
if(self.owner)
if(IS_PLAYER(self.owner))
ctf_Handle_Throw(self.owner, world, DROP_RESET);
-
+
ctf_RespawnFlag(self);
}
ctf_CaptureShield_Spawn(self);
}
-void ctf_FlagSetup(float teamnumber, entity flag) // called when spawning a flag entity on the map as a spawnfunc
-{
+void ctf_FlagSetup(float teamnumber, entity flag) // called when spawning a flag entity on the map as a spawnfunc
+{
// declarations
- teamnumber = fabs(teamnumber - bound(0, autocvar_g_ctf_reverse, 1)); // if we were originally 1, this will become 0. If we were originally 0, this will become 1.
+ teamnumber = fabs(teamnumber - bound(0, autocvar_g_ctf_reverse, 1)); // if we were originally 1, this will become 0. If we were originally 0, this will become 1.
self = flag; // for later usage with droptofloor()
-
+
// main setup
flag.ctf_worldflagnext = ctf_worldflaglist; // link flag into ctf_worldflaglist
ctf_worldflaglist = flag;
flag.flags = FL_ITEM | FL_NOTARGET;
flag.solid = SOLID_TRIGGER;
flag.takedamage = DAMAGE_NO;
- flag.damageforcescale = autocvar_g_ctf_flag_damageforcescale;
+ flag.damageforcescale = autocvar_g_ctf_flag_damageforcescale;
flag.max_flag_health = ((autocvar_g_ctf_flag_return_damage && autocvar_g_ctf_flag_health) ? autocvar_g_ctf_flag_health : 100);
flag.health = flag.max_flag_health;
flag.event_damage = ctf_FlagDamage;
if(flag.toucheffect == "") { flag.toucheffect = ((teamnumber) ? "redflag_touch" : "blueflag_touch"); }
if(flag.passeffect == "") { flag.passeffect = ((teamnumber) ? "red_pass" : "blue_pass"); }
if(flag.capeffect == "") { flag.capeffect = ((teamnumber) ? "red_cap" : "blue_cap"); }
-
- // sound
+
+ // sound
if(flag.snd_flag_taken == "") { flag.snd_flag_taken = ((teamnumber) ? "ctf/red_taken.wav" : "ctf/blue_taken.wav"); }
if(flag.snd_flag_returned == "") { flag.snd_flag_returned = ((teamnumber) ? "ctf/red_returned.wav" : "ctf/blue_returned.wav"); }
if(flag.snd_flag_capture == "") { flag.snd_flag_capture = ((teamnumber) ? "ctf/red_capture.wav" : "ctf/blue_capture.wav"); } // blue team scores by capturing the red flag
if(flag.snd_flag_dropped == "") { flag.snd_flag_dropped = ((teamnumber) ? "ctf/red_dropped.wav" : "ctf/blue_dropped.wav"); }
if(flag.snd_flag_touch == "") { flag.snd_flag_touch = "ctf/touch.wav"; } // again has no team-based sound
if(flag.snd_flag_pass == "") { flag.snd_flag_pass = "ctf/pass.wav"; } // same story here
-
+
// precache
precache_sound(flag.snd_flag_taken);
precache_sound(flag.snd_flag_returned);
setmodel(flag, flag.model); // precision set below
setsize(flag, FLAG_MIN, FLAG_MAX);
setorigin(flag, (flag.origin + FLAG_SPAWN_OFFSET));
-
+
if(autocvar_g_ctf_flag_glowtrails)
{
flag.glow_color = ((teamnumber) ? 251 : 210); // 251: red - 210: blue
flag.glow_size = 25;
flag.glow_trail = 1;
}
-
+
flag.effects |= EF_LOWPRECISION;
if(autocvar_g_ctf_fullbrightflags) { flag.effects |= EF_FULLBRIGHT; }
if(autocvar_g_ctf_dynamiclights) { flag.effects |= ((teamnumber) ? EF_RED : EF_BLUE); }
-
+
// flag placement
if((flag.spawnflags & 1) || flag.noalign) // don't drop to floor, just stay at fixed location
- {
- flag.dropped_origin = flag.origin;
+ {
+ flag.dropped_origin = flag.origin;
flag.noalign = TRUE;
flag.movetype = MOVETYPE_NONE;
}
else // drop to floor, automatically find a platform and set that as spawn origin
- {
+ {
flag.noalign = FALSE;
self = flag;
droptofloor();
- flag.movetype = MOVETYPE_TOSS;
- }
-
+ flag.movetype = MOVETYPE_TOSS;
+ }
+
InitializeEntity(flag, ctf_DelayedFlagSetup, INITPRIO_SETLOCATION);
}
float havocbot_ctf_teamcount(entity bot, vector org, float tc_radius)
{
- if not(teamplay)
+ if (!teamplay)
return 0;
float c = 0;
break;
head = head.ctf_worldflagnext;
}
- if not(head)
+ if (!head)
return;
navigation_routerating(head.bot_basewaypoint, ratingscale, 10000);
void havocbot_goalrating_ctf_enemybase(float ratingscale)
{
- if not(bot_waypoints_for_items)
+ if (!bot_waypoints_for_items)
{
havocbot_goalrating_ctf_enemyflag(ratingscale);
return;
head = havocbot_ctf_find_enemy_flag(self);
- if not(head)
+ if (!head)
return;
navigation_routerating(head.bot_basewaypoint, ratingscale, 10000);
MUTATOR_HOOKFUNCTION(ctf_PlayerPreThink)
{
entity flag;
-
+
// initially clear items so they can be set as necessary later.
self.items &= ~(IT_RED_FLAG_CARRYING | IT_RED_FLAG_TAKEN | IT_RED_FLAG_LOST
| IT_BLUE_FLAG_CARRYING | IT_BLUE_FLAG_TAKEN | IT_BLUE_FLAG_LOST | IT_CTF_SHIELDED);
- // scan through all the flags and notify the client about them
+ // scan through all the flags and notify the client about them
for(flag = ctf_worldflaglist; flag; flag = flag.ctf_worldflagnext)
{
switch(flag.ctf_status)
{
if((flag.owner == self) || (flag.pass_sender == self))
self.items |= ((flag.items & IT_KEY2) ? IT_RED_FLAG_CARRYING : IT_BLUE_FLAG_CARRYING); // carrying: self is currently carrying the flag
- else
+ else
self.items |= ((flag.items & IT_KEY2) ? IT_RED_FLAG_TAKEN : IT_BLUE_FLAG_TAKEN); // taken: someone on self's team is carrying the flag
break;
}
}
}
}
-
+
// item for stopping players from capturing the flag too often
if(self.ctf_captureshielded)
self.items |= IT_CTF_SHIELDED;
-
+
// update the health of the flag carrier waypointsprite
- if(self.wps_flagcarrier)
+ if(self.wps_flagcarrier)
WaypointSprite_UpdateHealth(self.wps_flagcarrier, '1 0 0' * healtharmor_maxdamage(self.health, self.armorvalue, autocvar_g_balance_armor_blockpercent, DEATH_WEAPON));
-
+
return FALSE;
}
PlayerTeamScore_AddScore(frag_attacker, autocvar_g_ctf_score_kill);
PlayerScore_Add(frag_attacker, SP_CTF_FCKILLS, 1);
}
-
+
if(frag_target.flagcarried)
{ ctf_Handle_Throw(frag_target, world, DROP_NORMAL); }
-
+
return FALSE;
}
MUTATOR_HOOKFUNCTION(ctf_RemovePlayer)
{
entity flag; // temporary entity for the search method
-
+
if(self.flagcarried)
{ ctf_Handle_Throw(self, world, DROP_NORMAL); }
-
+
for(flag = ctf_worldflaglist; flag; flag = flag.ctf_worldflagnext)
{
if(flag.pass_sender == self) { flag.pass_sender = world; }
if(flag.pass_target == self) { flag.pass_target = world; }
if(flag.ctf_dropper == self) { flag.ctf_dropper = world; }
}
-
+
return FALSE;
}
MUTATOR_HOOKFUNCTION(ctf_PortalTeleport)
{
- if(self.flagcarried)
+ if(self.flagcarried)
if(!autocvar_g_ctf_portalteleport)
{ ctf_Handle_Throw(self, world, DROP_NORMAL); }
MUTATOR_HOOKFUNCTION(ctf_PlayerUseKey)
{
if(MUTATOR_RETURNVALUE || gameover) { return FALSE; }
-
+
entity player = self;
if((time > player.throw_antispam) && (player.deadflag == DEAD_NO) && !player.speedrunning && (!player.vehicle || autocvar_g_ctf_allow_vehicle_touch))
{
entity head, closest_target = world;
head = WarpZone_FindRadius(player.origin, autocvar_g_ctf_pass_radius, TRUE);
-
+
while(head) // find the closest acceptable target to pass to
{
if(IS_PLAYER(head) && head.deadflag == DEAD_NO)
if(head != player && SAME_TEAM(head, player))
if(!head.speedrunning && !head.vehicle)
{
- // if it's a player, use the view origin as reference (stolen from RadiusDamage functions in g_damage.qc)
+ // if it's a player, use the view origin as reference (stolen from RadiusDamage functions in g_damage.qc)
vector head_center = WarpZone_UnTransformOrigin(head, CENTER_OR_VIEWOFS(head));
vector passer_center = CENTER_OR_VIEWOFS(player);
-
+
if(ctf_CheckPassDirection(head_center, passer_center, player.v_angle, head.WarpZone_findradius_nearest))
{
- if(autocvar_g_ctf_pass_request && !player.flagcarried && head.flagcarried)
- {
+ if(autocvar_g_ctf_pass_request && !player.flagcarried && head.flagcarried)
+ {
if(IS_BOT_CLIENT(head))
{
Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_CTF_PASS_REQUESTING, head.netname);
Send_Notification(NOTIF_ONE, head, MSG_CENTER, CENTER_CTF_PASS_REQUESTED, player.netname);
Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_CTF_PASS_REQUESTING, head.netname);
}
- player.throw_antispam = time + autocvar_g_ctf_pass_wait;
- return TRUE;
+ player.throw_antispam = time + autocvar_g_ctf_pass_wait;
+ return TRUE;
}
else if(player.flagcarried)
{
}
head = head.chain;
}
-
+
if(closest_target) { ctf_Handle_Throw(player, closest_target, DROP_PASS); return TRUE; }
}
-
+
// throw the flag in front of you
if(autocvar_g_ctf_throw && player.flagcarried)
{
if(time > player.throw_prevtime + autocvar_g_ctf_throw_punish_time) { player.throw_count = 1; }
else { player.throw_count += 1; }
if(player.throw_count >= autocvar_g_ctf_throw_punish_count) { player.throw_count = -1; }
-
+
player.throw_prevtime = time;
ctf_Handle_Throw(player, world, DROP_THROW);
return TRUE;
}
}
}
-
+
return FALSE;
}
{
self.wps_helpme_time = time;
WaypointSprite_HelpMePing(self.wps_flagcarrier);
- }
+ }
else // create a normal help me waypointsprite
{
WaypointSprite_Spawn("helpme", waypointsprite_deployed_lifetime, waypointsprite_limitedrange, self, FLAG_WAYPOINT_OFFSET, world, self.team, self, wps_helpme, FALSE, RADARICON_HELPME, '1 0.5 0');
ctf_Handle_Throw(vh_player, world, DROP_NORMAL);
}
else
- {
- setattachment(vh_player.flagcarried, vh_vehicle, "");
+ {
+ setattachment(vh_player.flagcarried, vh_vehicle, "");
setorigin(vh_player.flagcarried, VEHICLE_FLAG_OFFSET);
vh_player.flagcarried.scale = VEHICLE_FLAG_SCALE;
- //vh_player.flagcarried.angles = '0 0 0';
+ //vh_player.flagcarried.angles = '0 0 0';
}
return TRUE;
}
-
+
return FALSE;
}
{
if(vh_player.flagcarried)
{
- setattachment(vh_player.flagcarried, vh_player, "");
+ setattachment(vh_player.flagcarried, vh_player, "");
setorigin(vh_player.flagcarried, FLAG_CARRY_OFFSET);
vh_player.flagcarried.scale = FLAG_SCALE;
vh_player.flagcarried.angles = '0 0 0';
ctf_RespawnFlag(self.flagcarried);
return TRUE;
}
-
+
return FALSE;
}
MUTATOR_HOOKFUNCTION(ctf_MatchEnd)
{
entity flag; // temporary entity for the search method
-
+
for(flag = ctf_worldflaglist; flag; flag = flag.ctf_worldflagnext)
{
switch(flag.ctf_status)
flag.takedamage = DAMAGE_NO;
flag.solid = SOLID_NOT;
flag.nextthink = FALSE; // stop thinking
-
+
//dprint("stopping the ", flag.netname, " from moving.\n");
break;
}
-
+
default:
case FLAG_BASE:
case FLAG_CARRY:
}
}
}
-
+
return FALSE;
}
void spawnfunc_info_player_team1()
{
if(g_assault) { remove(self); return; }
-
+
self.team = NUM_TEAM_1; // red
spawnfunc_info_player_deathmatch();
}
void spawnfunc_info_player_team2()
{
if(g_assault) { remove(self); return; }
-
+
self.team = NUM_TEAM_2; // blue
spawnfunc_info_player_deathmatch();
}
void spawnfunc_info_player_team3()
{
if(g_assault) { remove(self); return; }
-
+
self.team = NUM_TEAM_3; // yellow
spawnfunc_info_player_deathmatch();
}
void spawnfunc_info_player_team4()
{
if(g_assault) { remove(self); return; }
-
+
self.team = NUM_TEAM_4; // purple
spawnfunc_info_player_deathmatch();
}
/*QUAKED spawnfunc_item_flag_team1 (0 0.5 0.8) (-48 -48 -37) (48 48 37)
CTF flag for team one (Red).
-Keys:
-"angle" Angle the flag will point (minus 90 degrees)...
+Keys:
+"angle" Angle the flag will point (minus 90 degrees)...
"model" model to use, note this needs red and blue as skins 0 and 1...
"noise" sound played when flag is picked up...
"noise1" sound played when flag is returned by a teammate...
"noise2" sound played when flag is captured...
-"noise3" sound played when flag is lost in the field and respawns itself...
+"noise3" sound played when flag is lost in the field and respawns itself...
"noise4" sound played when flag is dropped by a player...
"noise5" sound played when flag touches the ground... */
void spawnfunc_item_flag_team1()
/*QUAKED spawnfunc_item_flag_team2 (0 0.5 0.8) (-48 -48 -37) (48 48 37)
CTF flag for team two (Blue).
-Keys:
-"angle" Angle the flag will point (minus 90 degrees)...
+Keys:
+"angle" Angle the flag will point (minus 90 degrees)...
"model" model to use, note this needs red and blue as skins 0 and 1...
"noise" sound played when flag is picked up...
"noise1" sound played when flag is returned by a teammate...
"noise2" sound played when flag is captured...
-"noise3" sound played when flag is lost in the field and respawns itself...
+"noise3" sound played when flag is lost in the field and respawns itself...
"noise4" sound played when flag is dropped by a player...
"noise5" sound played when flag touches the ground... */
void spawnfunc_item_flag_team2()
void spawnfunc_ctf_team()
{
if(!g_ctf) { remove(self); return; }
-
+
self.classname = "ctf_team";
self.team = self.cnt + 1;
}
ctf_SpawnTeam("Red", NUM_TEAM_1 - 1);
ctf_SpawnTeam("Blue", NUM_TEAM_2 - 1);
}
-
+
ctf_ScoreRules();
}
ctf_captureshield_min_negscore = autocvar_g_ctf_shield_min_negscore;
ctf_captureshield_max_ratio = autocvar_g_ctf_shield_max_ratio;
ctf_captureshield_force = autocvar_g_ctf_shield_force;
-
+
InitializeEntity(world, ctf_DelayedInit, INITPRIO_GAMETYPE);
}
MUTATOR_HOOK(VehicleExit, ctf_VehicleExit, CBC_ORDER_ANY);
MUTATOR_HOOK(AbortSpeedrun, ctf_AbortSpeedrun, CBC_ORDER_ANY);
MUTATOR_HOOK(HavocBot_ChooseRule, ctf_BotRoles, CBC_ORDER_ANY);
-
+
MUTATOR_ONADD
{
if(time > 1) // game loads at time 1
#define WPCOLOR_FLAGCARRIER(t) ('0.8 0.8 0')
#define WPCOLOR_DROPPEDFLAG(t) (('0.25 0.25 0.25' + colormapPaletteColor(t - 1, FALSE)) * 0.5)
-// sounds
+// sounds
#define snd_flag_taken noise
#define snd_flag_returned noise1
#define snd_flag_capture noise2
// waypoint sprites
.entity bot_basewaypoint; // flag waypointsprite
.entity wps_helpme;
-.entity wps_flagbase;
+.entity wps_flagbase;
.entity wps_flagcarrier;
.entity wps_flagdropped;
.entity wps_enemyflagcarrier;
self.model = head.mdl;
self.modelindex = head.dmg;
self.skin = head.skin;
-
+
float points, wait_time;
if (autocvar_g_domination_point_amt)
points = autocvar_g_domination_point_amt;
SUB_UseTargets ();
self.delay = old_delay;
self.team = old_team;
-
+
switch(self.team)
{
case NUM_TEAM_1: msg = "dom-red"; break;
}
WaypointSprite_UpdateSprites(self.sprite, msg, "", "");
-
+
total_pps = 0, pps_red = 0, pps_blue = 0, pps_yellow = 0, pps_pink = 0;
for(head = world; (head = find(head, classname, "dom_controlpoint")) != world; )
{
void dompointtouch()
{
entity head;
- if not(IS_PLAYER(other))
+ if (!IS_PLAYER(other))
return;
if (other.health < 1)
return;
print("No ""dom_team"" entities found on this map, creating them anyway.\n");
dom_spawnteams();
}
-
+
ScoreRules_dom();
}
precache_model("models/domination/dom_pink.md3");
precache_model("models/domination/dom_unclaimed.md3");
precache_sound("domination/claim.wav");
-
+
addstat(STAT_DOM_TOTAL_PPS, AS_FLOAT, dom_total_pps);
addstat(STAT_DOM_PPS_RED, AS_FLOAT, dom_pps_red);
addstat(STAT_DOM_PPS_BLUE, AS_FLOAT, dom_pps_blue);
if(c3 >= 0) addstat(STAT_DOM_PPS_YELLOW, AS_FLOAT, dom_pps_yellow);
if(c4 >= 0) addstat(STAT_DOM_PPS_PINK, AS_FLOAT, dom_pps_pink);
-
+
InitializeEntity(world, dom_DelayedInit, INITPRIO_GAMETYPE);
}
{
MUTATOR_HOOK(ClientConnect, dom_ClientConnect, CBC_ORDER_ANY);
MUTATOR_HOOK(HavocBot_ChooseRule, dom_BotRoles, CBC_ORDER_ANY);
-
+
MUTATOR_ONADD
{
if(time > 1) // game loads at time 1
}
else
self.movement = '0 0 0';
-
+
self.disableclientprediction = 1;
}
return 1;
Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_FREEZETAG_REVIVED_FALL, frag_target.netname);
Send_Notification(NOTIF_ONE, frag_target, MSG_CENTER, CENTER_FREEZETAG_REVIVE_FALL);
}
-
+
frag_damage = 0;
frag_force = frag_force * autocvar_g_freezetag_frozen_force;
}
{
if(self.freezetag_frozen)
return TRUE; // no jumping in freezetag when frozen
-
+
return FALSE;
}
MUTATOR_HOOKFUNCTION(freezetag_BotRoles)
{
- if not(self.deadflag)
+ if (!self.deadflag)
{
if (random() < 0.5)
self.havocbot_role = havocbot_role_ft_freeing;
{
if(other.freezetag_frozen)
return TRUE;
-
+
return FALSE;
}
// Last updated: September, 2012
// ===========================================================
-float ka_ballcarrier_waypointsprite_visible_for_player(entity e) // runs on waypoints which are attached to ballcarriers, updates once per frame
+float ka_ballcarrier_waypointsprite_visible_for_player(entity e) // runs on waypoints which are attached to ballcarriers, updates once per frame
{
if(e.ballcarried)
- if(IS_SPEC(other))
+ if(IS_SPEC(other))
return FALSE; // we don't want spectators of the ballcarrier to see the attached waypoint on the top of their screen
-
+
// TODO: Make the ballcarrier lack a waypointsprite whenever they have the invisibility powerup
return TRUE;
{
if(gameover) { return; }
vector oldballorigin = self.origin;
-
+
if(MoveToRandomMapLocation(self, DPCONTENTS_SOLID | DPCONTENTS_CORPSE | DPCONTENTS_PLAYERCLIP, DPCONTENTS_SLIME | DPCONTENTS_LAVA | DPCONTENTS_SKY | DPCONTENTS_BODY | DPCONTENTS_DONOTENTER, Q3SURFACEFLAG_SKY, 10, 1024, 256))
{
makevectors(self.angles);
self.effects = autocvar_g_keepawayball_effects;
self.think = ka_RespawnBall;
self.nextthink = time + autocvar_g_keepawayball_respawntime;
-
+
pointparticles(particleeffectnum("electro_combo"), oldballorigin, '0 0 0', 1);
pointparticles(particleeffectnum("electro_combo"), self.origin, '0 0 0', 1);
WaypointSprite_Spawn("ka-ball", 0, 0, self, '0 0 64', world, self.team, self, waypointsprite_attachedforcarrier, FALSE, RADARICON_FLAGCARRIER, '0 1 1');
- WaypointSprite_Ping(self.waypointsprite_attachedforcarrier);
+ WaypointSprite_Ping(self.waypointsprite_attachedforcarrier);
- sound(self, CH_TRIGGER, "keepaway/respawn.wav", VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere)
+ sound(self, CH_TRIGGER, "keepaway/respawn.wav", VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere)
}
else
{
- ka_RespawnBall(); // finding a location failed, retry
+ ka_RespawnBall(); // finding a location failed, retry
}
}
{ // add points for holding the ball after a certain amount of time
if(autocvar_g_keepaway_score_timepoints)
PlayerScore_Add(self.owner, SP_SCORE, autocvar_g_keepaway_score_timepoints);
-
+
PlayerScore_Add(self.owner, SP_KEEPAWAY_BCTIME, (autocvar_g_keepaway_score_timeinterval / 1)); // interval is divided by 1 so that time always shows "seconds"
self.nextthink = time + autocvar_g_keepaway_score_timeinterval;
}
return;
}
if(other.deadflag != DEAD_NO) { return; }
- if not(IS_PLAYER(other))
+ if (!IS_PLAYER(other))
{ // The ball just touched an object, most likely the world
pointparticles(particleeffectnum("kaball_sparks"), self.origin, '0 0 0', 1);
sound(self, CH_TRIGGER, "keepaway/touch.wav", VOL_BASE, ATTEN_NORM);
- return;
+ return;
}
else if(self.wait > time) { return; }
other.ballcarried = self;
setattachment(self, other, "");
setorigin(self, '0 0 0');
-
+
// make the ball invisible/unable to do anything/set up time scoring
self.velocity = '0 0 0';
self.movetype = MOVETYPE_NONE;
other.glow_color = autocvar_g_keepawayball_trail_color;
other.glow_trail = TRUE;
other.effects |= autocvar_g_keepaway_ballcarrier_effects;
-
+
// messages and sounds
ka_EventLog("pickup", other);
Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_KEEPAWAY_PICKUP, other.netname);
Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_KEEPAWAY_PICKUP, other.netname);
- sound(self.owner, CH_TRIGGER, "keepaway/pickedup.wav", VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere)
-
+ sound(self.owner, CH_TRIGGER, "keepaway/pickedup.wav", VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere)
+
// scoring
PlayerScore_Add(other, SP_KEEPAWAY_PICKUPS, 1);
WaypointSprite_AttachCarrier("ka-ballcarrier", other, RADARICON_FLAGCARRIER, '1 0 0');
other.waypointsprite_attachedforcarrier.waypointsprite_visible_for_player = ka_ballcarrier_waypointsprite_visible_for_player;
WaypointSprite_UpdateRule(other.waypointsprite_attachedforcarrier, 0, SPRITERULE_DEFAULT);
- WaypointSprite_Ping(other.waypointsprite_attachedforcarrier);
+ WaypointSprite_Ping(other.waypointsprite_attachedforcarrier);
WaypointSprite_Kill(self.waypointsprite_attachedforcarrier);
}
ball = plyr.ballcarried;
if(!ball) { return; }
-
+
// reset the ball
setattachment(ball, world, "");
ball.movetype = MOVETYPE_BOUNCE;
- ball.wait = time + 1;
+ ball.wait = time + 1;
ball.touch = ka_TouchEvent;
ball.think = ka_RespawnBall;
ball.nextthink = time + autocvar_g_keepawayball_respawntime;
ball.takedamage = DAMAGE_YES;
- ball.effects &= ~EF_NODRAW;
+ ball.effects &= ~EF_NODRAW;
setorigin(ball, plyr.origin + '0 0 10');
ball.velocity = '0 0 200' + '0 100 0'*crandom() + '100 0 0'*crandom();
- ball.owner.ballcarried = world; // I hope nothing checks to see if the world has the ball in the rest of my code :P
+ ball.owner.ballcarried = world; // I hope nothing checks to see if the world has the ball in the rest of my code :P
ball.owner = world;
-
+
// reset the player effects
plyr.glow_trail = FALSE;
plyr.effects &= ~autocvar_g_keepaway_ballcarrier_effects;
ka_EventLog("dropped", plyr);
Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_KEEPAWAY_DROPPED, plyr.netname);
Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_KEEPAWAY_DROPPED, plyr.netname);
- sound(other, CH_TRIGGER, "keepaway/dropped.wav", VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere)
-
+ sound(other, CH_TRIGGER, "keepaway/dropped.wav", VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere)
+
// scoring
// PlayerScore_Add(plyr, SP_KEEPAWAY_DROPS, 1); Not anymore, this is 100% the same as pickups and is useless.
-
+
// waypoints
WaypointSprite_Spawn("ka-ball", 0, 0, ball, '0 0 64', world, ball.team, ball, waypointsprite_attachedforcarrier, FALSE, RADARICON_FLAGCARRIER, '0 1 1');
WaypointSprite_UpdateRule(ball.waypointsprite_attachedforcarrier, 0, SPRITERULE_DEFAULT);
- WaypointSprite_Ping(ball.waypointsprite_attachedforcarrier);
+ WaypointSprite_Ping(ball.waypointsprite_attachedforcarrier);
WaypointSprite_Kill(plyr.waypointsprite_attachedforcarrier);
}
MUTATOR_HOOKFUNCTION(ka_GiveFragsForKill)
{
frag_score = 0; // no frags counted in keepaway
- return 1; // you deceptive little bugger ;3 This needs to be true in order for this function to even count.
+ return 1; // you deceptive little bugger ;3 This needs to be true in order for this function to even count.
}
MUTATOR_HOOKFUNCTION(ka_PlayerPreThink)
{
// clear the item used for the ball in keepaway
self.items &= ~IT_KEY1;
-
+
// if the player has the ball, make sure they have the item for it (Used for HUD primarily)
if(self.ballcarried)
self.items |= IT_KEY1;
frag_force *= autocvar_g_keepaway_ballcarrier_force;
}
}
- else if not(frag_target.ballcarried) // if the target is a noncarrier
+ else if (!frag_target.ballcarried) // if the target is a noncarrier
{
if(frag_target == frag_attacker) // damage done to yourself
{
MUTATOR_HOOKFUNCTION(ka_PlayerPowerups)
{
// In the future this hook is supposed to allow me to do some extra stuff with waypointsprites and invisibility powerup
- // So bare with me until I can fix a certain bug with ka_ballcarrier_waypointsprite_visible_for_player()
-
+ // So bare with me until I can fix a certain bug with ka_ballcarrier_waypointsprite_visible_for_player()
+
self.effects &= ~autocvar_g_keepaway_ballcarrier_effects;
if(self.ballcarried)
self.effects |= autocvar_g_keepaway_ballcarrier_effects;
-
+
return 0;
}
void ka_SpawnBall() // loads various values for the ball, runs only once at start of match
{
if(!g_keepaway) { return; }
-
+
entity e;
e = spawn();
- e.model = "models/orbs/orbblue.md3";
+ e.model = "models/orbs/orbblue.md3";
precache_model(e.model);
setmodel(e, e.model);
setsize(e, '-16 -16 -20', '16 16 20'); // 20 20 20 was too big, player is only 16 16 24... gotta cheat with the Z (20) axis so that the particle isn't cut off
e.owner = world;
ka_ball = e;
- InitializeEntity(e, ka_RespawnBall, INITPRIO_SETLOCATION); // is this the right priority? Neh, I have no idea.. Well-- it works! So.
+ InitializeEntity(e, ka_RespawnBall, INITPRIO_SETLOCATION); // is this the right priority? Neh, I have no idea.. Well-- it works! So.
}
void ka_ScoreRules()
{
if(!g_keepaway)
return;
-
+
precache_sound("keepaway/pickedup.wav");
precache_sound("keepaway/dropped.wav");
precache_sound("keepaway/respawn.wav");
// maybe start a shorter countdown?
}
- if not(IS_PLAYER(other))
+ if (!IS_PLAYER(other))
return;
if(other.deadflag != DEAD_NO)
return;
--j;
}
}
-
+
Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_ENT_4(lostkey, INFO_KEYHUNT_LOST_), lostkey.kh_previous_owner.netname);
-
+
play2all(kh_sound_destroy);
te_tarexplosion(lostkey.origin);
kh_Scores_Event(player, key, "dropkey", 0, 0);
PlayerScore_Add(player, SP_KH_LOSSES, 1);
Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_ENT_4(key, INFO_KEYHUNT_DROP_), player.netname);
-
+
kh_Key_AssignTo(key, world);
makevectors(player.v_angle);
key.velocity = W_CalculateProjectileVelocity(player.velocity, autocvar_g_balance_keyhunt_throwvelocity * v_forward, FALSE);
if(!tmp_player.BUTTON_CHAT)
if(tmp_player.team == t_team)
++players;
-
- if not(players) { return t_team; }
+
+ if (!players) { return t_team; }
}
return 0;
}
}
float p1 = kh_CheckPlayers(0), p2 = kh_CheckPlayers(1), p3 = kh_CheckPlayers(2), p4 = kh_CheckPlayers(3);
- if not(p1 || p2 || p3 || p4)
+ if (!(p1 || p2 || p3 || p4))
{
Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_KEYHUNT_ROUNDSTART, autocvar_g_balance_keyhunt_delay_round);
kh_Controller_SetThink(autocvar_g_balance_keyhunt_delay_round, kh_StartRound);
Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_KEYHUNT_WAIT, p1, p2, p3, p4);
return;
}
-
+
Kill_Notification(NOTIF_ALL, world, MSG_CENTER_CPID, CPID_KEYHUNT);
Kill_Notification(NOTIF_ALL, world, MSG_CENTER_CPID, CPID_KEYHUNT_OTHER);
{
lms_lowest_lives = 999;
lms_next_place = player_count;
-
+
return FALSE;
}
FOR_EACH_CLIENT(self)
if(IS_PLAYER(self))
PlayerScore_Add(self, SP_LMS_LIVES, LMS_NewPlayerLives());
-
+
return FALSE;
}
MUTATOR_HOOKFUNCTION(lms_PlayerDies)
{
self.respawn_flags |= RESPAWN_FORCE;
-
+
return FALSE;
}
self.frags = FRAGS_SPECTATOR;
else
self.frags = FRAGS_LMS_LOSER;
-
+
if(self.killcount != -666)
if(PlayerScore_Add(self, SP_LMS_RANK, 0) > 0 && self.lms_spectate_warning != 2)
Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_LMS_NOLIVES, self.netname);
else
Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_LMS_FORFEIT, self.netname);
-
+
return FALSE;
}
{
self.classname = "player";
campaign_bots_may_start = 1;
-
+
if(PlayerScore_Add(self, SP_LMS_LIVES, LMS_NewPlayerLives()) <= 0)
{
PlayerScore_Add(self, SP_LMS_RANK, 666);
self.frags = FRAGS_SPECTATOR;
}
-
+
return FALSE;
}
{
if(self.deadflag == DEAD_DYING)
self.deadflag = DEAD_RESPAWNING;
-
+
return FALSE;
}
--lms_next_place;
}
frag_score = 0;
-
+
return TRUE;
}
self.max_health = 1;
return FALSE;
}
-
+
return TRUE;
}
Send_Notification(NOTIF_ONE, other, MSG_CENTER, CENTER_EXTRALIVES);
PlayerScore_Add(other, SP_LMS_LIVES, autocvar_g_lms_extra_lives);
}
-
+
return MUT_ITEMTOUCH_CONTINUE;
}
{
lms_lowest_lives = 9999;
lms_next_place = 0;
-
+
lms_ScoreRules();
}
{
WaypointSprite_Kill(ball.waypointsprite_attachedforcarrier);
}
-
+
//setattachment(ball, plyr, "");
setorigin(ball, plyr.origin + plyr.view_ofs);
ball.think = DropOwner;
ball.nextthink = time + autocvar_g_nexball_basketball_delay_hold;
}
-
+
ownr = self;
- self = plyr;
+ self = plyr;
self.weaponentity.weapons = self.weapons;
self.weaponentity.switchweapon = self.weapon;
self.weapons = WEPSET_PORTO;
self.nextthink = time + autocvar_g_nexball_delay_idle;
return;
}
- if not(IS_PLAYER(other))
+ if (!IS_PLAYER(other))
return;
if(other.health < 1)
return;
{
nexball_mode |= NBM_BASKETBALL;
self.classname = "nexball_basketball";
- if not(balls & BALL_BASKET)
+ if (!(balls & BALL_BASKET))
{
/*
CVTOV(g_nexball_basketball_effects_default);
//dprint("W_Nexball_Think\n");
//vector new_dir = steerlib_arrive(self.enemy.origin, 2500);
vector new_dir = normalize(self.enemy.origin + '0 0 50' - self.origin);
- vector old_dir = normalize(self.velocity);
- float _speed = vlen(self.velocity);
+ vector old_dir = normalize(self.velocity);
+ float _speed = vlen(self.velocity);
vector new_vel = normalize(old_dir + (new_dir * autocvar_g_nexball_safepass_turnrate)) * _speed;
//vector new_vel = (new_dir * autocvar_g_nexball_safepass_turnrate
-
+
self.velocity = new_vel;
-
+
self.nextthink = time;
}
attacker = self.owner;
//self.think = func_null;
//self.enemy = world;
-
+
PROJECTILE_TOUCH;
if(attacker.team != other.team || autocvar_g_nexball_basketball_teamsteal)
if((ball = other.ballcarried) && (IS_PLAYER(attacker)))
mul = 2 - mul;
mul = mi + (ma - mi) * mul; // range from the minimal power to the maximal power
}
-
+
DropBall(ball, w_shotorg, W_CalculateProjectileVelocity(self.velocity, w_shotdir * autocvar_g_balance_nexball_primary_speed * mul, FALSE));
-
+
//TODO: use the speed_up cvar too ??
}
_ball.nextthink = time;
return;
}
-
+
if(!autocvar_g_nexball_tackling)
return;
-
+
entity missile;
if(!(balls & BALL_BASKET))
return;
self.scale = 1;
self.customizeentityforclient = func_null;
return TRUE;
- }
-
+ }
+
if(other == self.owner)
{
self.scale = autocvar_g_nexball_viewmodel_scale;
self.effects |= EF_FLAME;
else
self.effects &= ~EF_FLAME;
- }
+ }
else
{
self.effects &= ~EF_FLAME;
self.scale = 1;
}
-
+
return TRUE;
}
{
makevectors(self.v_angle);
if(nexball_mode & NBM_BASKETBALL)
- {
+ {
if(self.ballcarried)
{
// 'view ball'
- self.ballcarried.velocity = self.velocity;
+ self.ballcarried.velocity = self.velocity;
self.ballcarried.customizeentityforclient = ball_customize;
-
- setorigin(self.ballcarried, self.origin + self.view_ofs +
- v_forward * autocvar_g_nexball_viewmodel_offset_x +
- v_right * autocvar_g_nexball_viewmodel_offset_y +
- v_up * autocvar_g_nexball_viewmodel_offset_z);
-
+
+ setorigin(self.ballcarried, self.origin + self.view_ofs +
+ v_forward * autocvar_g_nexball_viewmodel_offset_x +
+ v_right * autocvar_g_nexball_viewmodel_offset_y +
+ v_up * autocvar_g_nexball_viewmodel_offset_z);
+
// 'safe passing'
if(autocvar_g_nexball_safepass_maxdist)
{
//centerprint(self, sprintf("Lost lock on %s", self.ballcarried.enemy.netname));
self.ballcarried.enemy = world;
}
-
-
+
+
//tracebox(self.origin + self.view_ofs, '-2 -2 -2', '2 2 2', self.origin + self.view_ofs + v_forward * autocvar_g_nexball_safepass_maxdist);
crosshair_trace(self);
- if( trace_ent &&
+ if( trace_ent &&
IS_CLIENT(trace_ent) &&
trace_ent.deadflag == DEAD_NO &&
trace_ent.team == self.team &&
vlen(trace_ent.origin - self.origin) <= autocvar_g_nexball_safepass_maxdist )
{
-
+
//if(self.ballcarried.enemy != trace_ent)
// centerprint(self, sprintf("Locked to %s", trace_ent.netname));
self.ballcarried.enemy = trace_ent;
self.ballcarried.wait = time + autocvar_g_nexball_safepass_holdtime;
-
-
+
+
}
}
}
else
- {
+ {
if(self.weaponentity.weapons)
{
self.weapons = self.weaponentity.weapons;
weapon_action(WEP_PORTO, WR_RESETPLAYER);
self.switchweapon = self.weaponentity.switchweapon;
W_SwitchWeapon(self.switchweapon);
-
+
self.weaponentity.weapons = '0 0 0';
}
}
-
+
}
-
+
nexball_setstatus();
-
+
return FALSE;
}
MUTATOR_HOOKFUNCTION(nexball_PlayerSpawn)
-{
+{
self.weaponentity.weapons = '0 0 0';
-
+
if(nexball_mode & NBM_BASKETBALL)
self.weapons |= WEPSET_PORTO;
else
MUTATOR_HOOKFUNCTION(nexball_SetStartItems)
{
start_items |= IT_UNLIMITED_SUPERWEAPONS; // FIXME BAD BAD BAD BAD HACK, NEXBALL SHOULDN'T ABUSE PORTO'S WEAPON SLOT
-
+
return FALSE;
}
d = d + 1;
e = e.chain;
}
-
+
if(autocvar_g_campaign && autocvar__campaign_testrun)
d = d * self.max_health;
else
d = d * self.max_health / max(30, 60 * autocvar_timelimit_suddendeath);
-
+
Damage(self, self, self, d, DEATH_HURTTRIGGER, self.origin, '0 0 0');
}
else if (overtime_msg_time)
vector org;
float i;
- if not (self.count)
+ if (!self.count)
self.count = 40;
// White shockwave
#endif
self.lasthealth = self.health;
}
- else if not(warmup_stage)
+ else if (!warmup_stage)
{
if (attacker == self)
bprint(Team_ColoredFullName(self.team), " generator spontaneously exploded due to overtime!\n");
precache_sound("onslaught/electricity_explode.wav");
if (!self.team)
objerror("team must be set");
-
+
if(self.team == NUM_TEAM_1)
ons_red_generator = self;
if(self.team == NUM_TEAM_2)
ons_blue_generator = self;
-
+
self.team_saved = self.team;
self.colormap = 1024 + (self.team - 1) * 17;
self.solid = SOLID_BBOX;
waypoint_spawnforitem(self);
onslaught_updatelinks();
-
+
self.reset = onslaught_generator_reset;
}
float _friendly_count = 0;
float _dist;
entity _player;
-
+
FOR_EACH_PLAYER(_player)
{
if(!_player.deadflag)
a = onslaught_controlpoint_can_be_linked(self.owner, self.owner.team);
if(!a)
return;
-
+
self.health = self.health + self.count;
if (self.health >= self.max_health)
{
entity e;
float a;
- if not(IS_PLAYER(other))
+ if (!IS_PLAYER(other))
return;
a = onslaught_controlpoint_attackable(self, other.team);
if(a != 2 && a != 4)
MUTATOR_HOOKFUNCTION(ons_Spawn_Score)
{
-
+
/*
float _neer_home = (random() > 0.5 ? TRUE : FALSE);
-
+
RandomSelection_Init();
-
+
if(self.team == NUM_TEAM_1)
RandomSelection_Add(ons_red_generator, 0, string_null, 1, 1);
-
+
if(self.team == NUM_TEAM_2)
RandomSelection_Add(ons_blue_generator, 0, string_null, 1, 1);
-
+
entity _cp = findchain(classname, "onslaught_controlpoint"):
while _cp;
{
- if(_cp.team == self.team)
+ if(_cp.team == self.team)
RandomSelection_Add(_cp, 0, string_null, 1, 1);
-
+
_cp = _cp.chain;
}
}
else if(self.team == spawn_spot.team)
spawn_score_x += SPAWN_PRIO_NEAR_TEAMMATE_SAMETEAM; // prefer same team, if we can't find a spawn near teammate
-
+
*/
-
+
return 0;
}
{
if(!autocvar_g_onslaught_spawn_at_controlpoints)
return 0;
-
+
if(random() < 0.5) // 50/50 chane to use default spawnsystem.
return 0;
-
+
float _close_to_home = ((random() > 0.5) ? TRUE : FALSE);
entity _best = world, _trg_gen = world;
float _score, _best_score = MAX_SHOT_DISTANCE;
-
+
RandomSelection_Init();
-
+
if(self.team == NUM_TEAM_1)
{
if(!_close_to_home)
_trg_gen = ons_blue_generator;
- else
- _trg_gen = ons_red_generator;
+ else
+ _trg_gen = ons_red_generator;
}
-
+
if(self.team == NUM_TEAM_2)
{
if(_close_to_home)
_trg_gen = ons_blue_generator;
- else
- _trg_gen = ons_red_generator;
+ else
+ _trg_gen = ons_red_generator;
}
-
+
entity _cp = findchain(classname, "onslaught_controlpoint");
while(_cp)
{
- if(_cp.team == self.team)
- {
+ if(_cp.team == self.team)
+ {
_score = vlen(_trg_gen.origin - _cp.origin);
if(_score < _best_score)
{
_best = _cp;
- _best_score = _score;
+ _best_score = _score;
}
- }
+ }
_cp = _cp.chain;
}
-
- vector _loc;
- float i;
+
+ vector _loc;
+ float i;
if(_best)
{
for(i = 0; i < 10; ++i)
{
_loc = _best.origin + '0 0 96';
- _loc += ('0 1 0' * random()) * 128;
+ _loc += ('0 1 0' * random()) * 128;
tracebox(_loc, PL_MIN, PL_MAX, _loc, MOVE_NORMAL, self);
if(trace_fraction == 1.0 && !trace_startsolid)
{
{
if(!autocvar_g_onslaught_spawn_at_generator)
return 0;
-
+
_trg_gen = ((self.team == NUM_TEAM_1) ? ons_red_generator : ons_blue_generator);
-
+
for(i = 0; i < 10; ++i)
{
_loc = _trg_gen.origin + '0 0 96';
- _loc += ('0 1 0' * random()) * 128;
+ _loc += ('0 1 0' * random()) * 128;
tracebox(_loc, PL_MIN, PL_MAX, _loc, MOVE_NORMAL, self);
if(trace_fraction == 1.0 && !trace_startsolid)
{
}
}
}
-
+
return 0;
}
if(self.health <= autocvar_g_bloodloss && self.deadflag == DEAD_NO)
{
self.BUTTON_CROUCH = TRUE;
-
+
if(time >= self.bloodloss_timer)
{
self.event_damage(self, self, 1, DEATH_ROT, self.origin, '0 0 0');
self.bloodloss_timer = time + 0.5 + random() * 0.5;
}
}
-
+
return FALSE;
}
{
if(self.health <= autocvar_g_bloodloss)
return TRUE;
-
+
return FALSE;
}
MUTATOR_HOOKFUNCTION(campcheck_PlayerDies)
{
Kill_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER_CPID, CPID_CAMPCHECK);
-
+
return FALSE;
}
frag_target.campcheck_traveled_distance = autocvar_g_campcheck_distance;
frag_attacker.campcheck_traveled_distance = autocvar_g_campcheck_distance;
}
-
+
return FALSE;
}
{
self.campcheck_nextcheck = time + autocvar_g_campcheck_interval * 2;
self.campcheck_traveled_distance = 0;
-
+
return FALSE;
}
float velocity_difference;
float clean_up_and_do_nothing;
float horiz_speed = autocvar_sv_dodging_horiz_speed;
-
+
if(self.freezetag_frozen)
horiz_speed = autocvar_sv_dodging_horiz_speed_frozen;
// make sure v_up, v_right and v_forward are sane
makevectors(self.angles);
- // if we have e.g. 0.5 sec ramptime and a frametime of 0.25, then the ramp code
- // will be called ramp_time/frametime times = 2 times. so, we need to
+ // if we have e.g. 0.5 sec ramptime and a frametime of 0.25, then the ramp code
+ // will be called ramp_time/frametime times = 2 times. so, we need to
// add 0.5 * the total speed each frame until the dodge action is done..
common_factor = sys_frametime / autocvar_sv_dodging_ramp_time;
// if ramp time is smaller than frametime we get problems ;D
- if (common_factor > 1)
+ if (common_factor > 1)
common_factor = 1;
new_velocity_gain = self.dodging_velocity_gain - (common_factor * horiz_speed);
//disable jump key during dodge accel phase
if (self.movement_z > 0) self.movement_z = 0;
- self.velocity =
- self.velocity
+ self.velocity =
+ self.velocity
+ ((self.dodging_direction_y * velocity_difference) * v_right)
+ ((self.dodging_direction_x * velocity_difference) * v_forward);
if (self.dodging_single_action == 1) {
self.flags &= ~FL_ONGROUND;
- self.velocity =
- self.velocity
+ self.velocity =
+ self.velocity
+ (autocvar_sv_dodging_up_speed * v_up);
if (autocvar_sv_dodging_sound == 1)
tap_direction_x = 0;
tap_direction_y = 0;
-
+
float frozen_dodging;
frozen_dodging = (self.freezetag_frozen && autocvar_sv_dodging_frozen);
if ((time - self.last_dodging_time) < autocvar_sv_dodging_delay)
return 0;
- if (check_close_to_ground(autocvar_sv_dodging_height_threshold) != 1
+ if (check_close_to_ground(autocvar_sv_dodging_height_threshold) != 1
&& check_close_to_wall(autocvar_sv_dodging_wall_distance_threshold) != 1)
return 0;
if (self.movement_x > 0) {
// is this a state change?
if (!(self.pressedkeys & KEY_FORWARD) || frozen_dodging) {
- if ((time - self.last_FORWARD_KEY_time) < self.cvar_cl_dodging_timeout) {
+ if ((time - self.last_FORWARD_KEY_time) < self.cvar_cl_dodging_timeout) {
tap_direction_x = 1.0;
dodge_detected = 1;
}
// is this a state change?
if (!(self.pressedkeys & KEY_BACKWARD) || frozen_dodging) {
tap_direction_x = -1.0;
- if ((time - self.last_BACKWARD_KEY_time) < self.cvar_cl_dodging_timeout) {
+ if ((time - self.last_BACKWARD_KEY_time) < self.cvar_cl_dodging_timeout) {
dodge_detected = 1;
}
self.last_BACKWARD_KEY_time = time;
// is this a state change?
if (!(self.pressedkeys & KEY_RIGHT) || frozen_dodging) {
tap_direction_y = 1.0;
- if ((time - self.last_RIGHT_KEY_time) < self.cvar_cl_dodging_timeout) {
+ if ((time - self.last_RIGHT_KEY_time) < self.cvar_cl_dodging_timeout) {
dodge_detected = 1;
}
self.last_RIGHT_KEY_time = time;
// is this a state change?
if (!(self.pressedkeys & KEY_LEFT) || frozen_dodging) {
tap_direction_y = -1.0;
- if ((time - self.last_LEFT_KEY_time) < self.cvar_cl_dodging_timeout) {
+ if ((time - self.last_LEFT_KEY_time) < self.cvar_cl_dodging_timeout) {
dodge_detected = 1;
}
self.last_LEFT_KEY_time = time;
{
start_ammo_shells = 0;
warmup_start_ammo_shells = 0;
-
+
start_weapons = WEPSET_SHOTGUN;
warmup_start_weapons = WEPSET_SHOTGUN;
-
+
return FALSE;
}
case IT_ARMOR_SHARD:
return FALSE;
}
-
+
return TRUE;
}
self.effects |= (EF_ADDITIVE | EF_FULLBRIGHT);
self.midair_shieldtime = max(self.midair_shieldtime, time + autocvar_g_midair_shieldtime);
}
-
+
return FALSE;
}
-void spawnfunc_item_minst_cells (void)
+void spawnfunc_item_minst_cells (void)
{
- if not(g_minstagib) { remove(self); return; }
- if not(self.ammo_cells)
+ if (!g_minstagib) { remove(self); return; }
+ if (!self.ammo_cells)
self.ammo_cells = autocvar_g_minstagib_ammo_drop;
-
+
StartItem ("models/items/a_cells.md3",
"misc/itempickup.wav", 45, 0,
"MinstaNex Ammo", IT_CELLS, 0, 0, generic_pickupevalfunc, 100);
}
void minstagib_ammocheck()
{
- if not(IS_PLAYER(self))
+ if (!IS_PLAYER(self))
return; // not a player
if (time < self.minstagib_nextthink)
return;
entity head;
FOR_EACH_PLAYER(head)
minstagib_stop_countdown(head);
-
+
return FALSE;
}
{
if(checkentity.items & IT_STRENGTH)
return TRUE;
-
+
return FALSE;
}
MUTATOR_HOOKFUNCTION(minstagib_PlayerPowerups)
{
- if not(self.effects & EF_FULLBRIGHT)
+ if (!(self.effects & EF_FULLBRIGHT))
self.effects |= EF_FULLBRIGHT;
if (self.items & IT_STRENGTH)
{
if(self.items & IT_INVINCIBLE)
self.stat_sv_maxspeed = self.stat_sv_maxspeed * autocvar_g_minstagib_speed_highspeed;
-
+
return FALSE;
}
{
damage_save = 0;
damage_take = frag_damage;
-
+
return FALSE;
}
{
if(autocvar_g_friendlyfire == 0 && SAME_TEAM(frag_target, frag_attacker) && IS_PLAYER(frag_target) && IS_PLAYER(frag_attacker))
frag_damage = 0;
-
+
if(IS_PLAYER(frag_target))
{
if ((frag_deathtype == DEATH_FALL) ||
{
frag_damage = 0;
}
-
+
if(IS_PLAYER(frag_attacker))
if(DEATH_ISWEAPON(frag_deathtype, WEP_MINSTANEX))
if(frag_target.armorvalue)
frag_target.hitsound += 1;
frag_attacker.hitsound += 1; // TODO change this to a future specific hitsound for armor hit
}
-
+
if(IS_PLAYER(frag_attacker))
if (DEATH_ISWEAPON(frag_deathtype, WEP_LASER))
{
}
}
}
-
+
if(IS_PLAYER(frag_attacker))
if(frag_mirrordamage > 0)
{
}
frag_mirrordamage = 0;
}
-
+
if(frag_target.items & IT_STRENGTH)
yoda = 1;
-
+
return FALSE;
}
MUTATOR_HOOKFUNCTION(minstagib_SetStartItems)
{
start_ammo_cells = cvar("g_minstagib_ammo_start");
-
+
start_health = 100;
start_armorvalue = 0;
start_weapons = WEPSET_MINSTANEX;
warmup_start_weapons = WEPSET_MINSTANEX;
start_items |= IT_UNLIMITED_SUPERWEAPONS;
-
+
return FALSE;
}
{
if(self.classname == "item_cells")
return TRUE; // no normal cells?
-
+
if(self.weapon == WEP_MINSTANEX && self.classname == "droppedweapon")
{
self.ammo_cells = autocvar_g_minstagib_ammo_drop;
return FALSE;
}
-
+
if(self.weapon == WEP_ROCKET_LAUNCHER || self.weapon == WEP_NEX)
{
entity e = spawn();
self = oldself;
return TRUE;
}
-
+
if(self.flags & FL_POWERUP)
return FALSE;
-
+
if(self.ammo_cells > autocvar_g_minstagib_ammo_drop && self.classname != "item_minst_cells")
self.ammo_cells = autocvar_g_minstagib_ammo_drop;
-
+
if(self.ammo_cells && !self.weapon)
return FALSE;
-
+
return TRUE;
}
MUTATOR_HOOKFUNCTION(minstagib_CustomizeWaypoint)
{
entity e = WaypointSprite_getviewentity(other);
-
+
// if you have the invisibility powerup, sprites ALWAYS are restricted to your team
// but only apply this to real players, not to spectators
if((self.owner.flags & FL_CLIENT) && (self.owner.items & IT_STRENGTH) && (e == other))
if(DIFF_TEAM(self.owner, e))
return TRUE;
-
+
return FALSE;
}
return MUT_ITEMTOUCH_CONTINUE;
}
-
+
if(self.max_health)
{
other.armorvalue = bound(other.armorvalue, 999, other.armorvalue + autocvar_g_minstagib_extralives);
Send_Notification(NOTIF_ONE, other, MSG_CENTER, CENTER_EXTRALIVES);
return MUT_ITEMTOUCH_PICKUP;
}
-
+
return MUT_ITEMTOUCH_CONTINUE;
}
MUTATOR_HOOKFUNCTION(minstagib_OnEntityPreSpawn)
{
- if not(autocvar_g_powerups) { return FALSE; }
- if not(self.classname == "item_strength" || self.classname == "item_invincible" || self.classname == "item_health_mega")
+ if (!autocvar_g_powerups) { return FALSE; }
+ if (!(self.classname == "item_strength" || self.classname == "item_invincible" || self.classname == "item_health_mega"))
return FALSE;
-
+
entity e = spawn();
-
+
if(random() < 0.3)
e.think = spawnfunc_item_strength;
else if(random() < 0.6)
e.think = minstagib_health_mega;
else
e.think = spawnfunc_item_invincible;
-
+
e.nextthink = time + 0.1;
e.spawnflags = self.spawnflags;
e.noalign = self.noalign;
setorigin(e, self.origin);
-
+
return TRUE;
}
else
self.multijump_count = -2; // the cvar value for infinite jumps is -1, so this needs to be smaller
}
-
+
return FALSE;
}
self.multijump_ready = TRUE; // this is necessary to check that we released the jump button and pressed it again
else
self.multijump_ready = FALSE;
-
+
if(!player_multijump && self.multijump_ready && self.multijump_count < autocvar_g_multijump && self.velocity_z > autocvar_g_multijump_speed)
{
if (autocvar_g_multijump)
self.nextthink = time;
if(!self.owner || wasfreed(self.owner))
remove(self);
-
+
}
void nade_burn_spawn(entity _nade)
{
float p;
-
+
switch(_nade.realowner.team)
{
case NUM_TEAM_1: p = PROJECTILE_NADE_RED_BURN; break;
case NUM_TEAM_4: p = PROJECTILE_NADE_PINK_BURN; break;
default: p = PROJECTILE_NADE_BURN; break;
}
-
+
CSQCProjectile(_nade, TRUE, p, TRUE);
}
timer.think = nade_timer_think;
timer.nextthink = time;
timer.wait = _nade.wait;
- timer.owner = _nade;
+ timer.owner = _nade;
timer.skin = 10;
-
+
switch(_nade.realowner.team)
{
case NUM_TEAM_1: p = PROJECTILE_NADE_RED; break;
case NUM_TEAM_4: p = PROJECTILE_NADE_PINK; break;
default: p = PROJECTILE_NADE; break;
}
-
+
CSQCProjectile(_nade, TRUE, p, TRUE);
-
+
}
void nade_boom()
{
string expef;
-
+
switch(self.realowner.team)
{
case NUM_TEAM_1: expef = "nade_red_explode"; break;
case NUM_TEAM_4: expef = "nade_pink_explode"; break;
default: expef = "nade_explode"; break;
}
-
+
sound(self, CH_SHOTS_SINGLE, "misc/null.wav", VOL_BASE, ATTEN_NORM);
sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
pointparticles(particleeffectnum(expef), self.origin + '0 0 1', '0 0 0', 1);
-
+
Damage_DamageInfo(self.origin, autocvar_g_nades_nade_damage, autocvar_g_nades_nade_edgedamage, autocvar_g_nades_nade_radius, '1 1 1' * autocvar_g_nades_nade_force, self.projectiledeathtype, 0, self);
self.takedamage = DAMAGE_NO;
if(DEATH_ISWEAPON(deathtype, WEP_SHOTGUN) && !(deathtype & HITTYPE_SECONDARY))
damage = self.max_health * 1.1;
-
+
if(DEATH_ISWEAPON(deathtype, WEP_SHOTGUN) && (deathtype & HITTYPE_SECONDARY))
{
damage = self.max_health * 0.1;
force *= 15;
}
-
+
self.velocity += force;
if(!damage || (self.flags & FL_ONGROUND && IS_PLAYER(attacker)))
{
entity _nade = e.nade;
e.nade = world;
-
+
remove(e.fake_nade);
e.fake_nade = world;
-
+
makevectors(e.v_angle);
-
+
W_SetupShot(e, FALSE, FALSE, "", CH_WEAPON_A, 0);
-
+
Kill_Notification(NOTIF_ONE_ONLY, e, MSG_CENTER_CPID, CPID_NADES);
-
+
//setorigin(_nade, CENTER_OR_VIEWOFS(e) + (v_right * 10) * -1);
setorigin(_nade, w_shotorg + (v_right * 25) * -1);
setmodel(_nade, "models/weapons/v_ok_grenade.md3");
PROJECTILE_MAKETRIGGER(_nade);
setsize(_nade, '-16 -16 -16', '16 16 16');
_nade.movetype = MOVETYPE_BOUNCE;
-
+
tracebox(_nade.origin, _nade.mins, _nade.maxs, _nade.origin, FALSE, _nade);
if (trace_startsolid)
setorigin(_nade, e.origin);
-
+
if(e.crouch)
_nade.velocity = '0 0 -10';
else if(autocvar_g_nades_nade_newton_style == 1)
{
if(self.nade)
remove(self.nade);
-
+
if(self.fake_nade)
remove(self.fake_nade);
-
+
self.nade = spawn();
setmodel(self.nade, "null");
setattachment(self.nade, self, "bip01 l hand");
{
if(self.vehicle)
return FALSE;
-
+
if(gameover)
return FALSE;
-
+
if(self.deadflag != DEAD_NO)
return FALSE;
-
- if not(autocvar_g_nades)
+
+ if (!autocvar_g_nades)
return FALSE; // allow turning them off mid match
-
+
if(forbidWeaponUse())
return FALSE;
-
- if not(IS_PLAYER(self))
+
+ if (!IS_PLAYER(self))
return FALSE;
-
+
return TRUE;
}
{
if(!CanThrowNade())
return;
-
+
if(!self.nade)
{
if(self.nade_refire < time)
{
if(other.nade)
toss_nade(other, '0 0 100', max(other.nade.wait, time + 0.05));
-
+
return FALSE;
}
MUTATOR_HOOKFUNCTION(nades_PlayerPreThink)
{
float key_pressed = ((g_grappling_hook || client_hasweapon(self, WEP_HOOK, FALSE, FALSE) || (weaponsInMap & WEPSET_HOOK)) ? self.button16 : self.BUTTON_HOOK);
-
+
if(self.nade)
if(self.nade.wait - 0.1 <= time)
toss_nade(self, '0 0 0', time + 0.05);
-
+
if(CanThrowNade())
if(self.nade_refire < time)
{
makevectors(self.v_angle);
float _force = time - self.nade.lifetime;
_force /= autocvar_g_nades_nade_lifetime;
- _force = autocvar_g_nades_nade_minforce + (_force * (autocvar_g_nades_nade_maxforce - autocvar_g_nades_nade_minforce));
+ _force = autocvar_g_nades_nade_minforce + (_force * (autocvar_g_nades_nade_maxforce - autocvar_g_nades_nade_minforce));
toss_nade(self, (v_forward * 0.7 + v_up * 0.2 + v_right * 0.1) * _force, 0);
}
}
{
if(self.nade)
toss_nade(self, '0 0 100', max(self.nade.wait, time + 0.05));
-
+
return FALSE;
}
if(self.fake_nade)
remove(self.fake_nade);
-
+
return FALSE;
}
MUTATOR_HOOK(ClientDisconnect, nades_RemovePlayer, CBC_ORDER_ANY);
MUTATOR_HOOK(BuildMutatorsString, nades_BuildMutatorsString, CBC_ORDER_ANY);
MUTATOR_HOOK(BuildMutatorsPrettyString, nades_BuildMutatorsPrettyString, CBC_ORDER_ANY);
-
+
MUTATOR_ONADD
{
precache_model("models/ok_nade_counter/ok_nade_counter.md3");
-
+
precache_model("models/weapons/h_ok_grenade.iqm");
precache_model("models/weapons/v_ok_grenade.md3");
precache_sound("weapons/rocket_impact.wav");
minsta porto
tuba
-NEW rifle hlac minel seeker
+NEW rifle hlac minel seeker
IDEAS OPEN flak OPEN FUN FUN FUN FUN
if(m == NT_AUTOREPLACE_NEVER)
return w;
string s = nt_GetFullReplacement(w);
- if not(s)
+ if (!s)
return w;
if(m == NT_AUTOREPLACE_RANDOM)
s = strcat(w, " ", s);
WepSet newdefault;
WepSet warmup_newdefault;
-
+
newdefault = '0 0 0';
warmup_newdefault = '0 0 0';
return FALSE;
if(e.spawnflags & WEP_FLAG_MUTATORBLOCKED)
return FALSE;
- if not(e.spawnflags & WEP_FLAG_NORMAL)
+ if (!(e.spawnflags & WEP_FLAG_NORMAL))
return FALSE;
}
return TRUE;
// check if we have a physics engine
MUTATOR_ONADD
{
- if not(autocvar_physics_ode && checkextension("DP_PHYSICS_ODE"))
+ if (!(autocvar_physics_ode && checkextension("DP_PHYSICS_ODE")))
{
dprint("Warning: Physical items are enabled but no physics engine can be used. Reverting to old items.\n");
return -1;
if(self.switchweapon != j)
if(W_IsWeaponThrowable(j))
W_ThrowNewWeapon(self, j, FALSE, self.origin + (self.mins + self.maxs) * 0.5, randomvec() * 175 + '0 0 325');
-
+
return TRUE;
}
MUTATOR_HOOKFUNCTION(gravity_StartFrame)
{
- if(gameover || !cvar("g_random_gravity")) return FALSE;
+ if(gameover || !cvar("g_random_gravity")) return FALSE;
if(time < gravity_delay) return FALSE;
if(time < game_starttime) return FALSE;
if(round_handler_IsActive() && !round_handler_IsRoundStarted()) return FALSE;
-
- if(random() >= autocvar_g_random_gravity_negative_chance)
+
+ if(random() >= autocvar_g_random_gravity_negative_chance)
cvar_set("sv_gravity", ftos(bound(autocvar_g_random_gravity_min, random() - random() * -autocvar_g_random_gravity_negative, autocvar_g_random_gravity_max)));
else
cvar_set("sv_gravity", ftos(bound(autocvar_g_random_gravity_min, random() * autocvar_g_random_gravity_positive, autocvar_g_random_gravity_max)));
-
+
gravity_delay = time + autocvar_g_random_gravity_delay;
-
+
dprint("Gravity is now: ", ftos(autocvar_sv_gravity), "\n");
-
+
return FALSE;
}
MUTATOR_HOOK(SV_StartFrame, gravity_StartFrame, CBC_ORDER_ANY);
MUTATOR_HOOK(BuildMutatorsString, gravity_BuildMutatorsString, CBC_ORDER_ANY);
MUTATOR_HOOK(BuildMutatorsPrettyString, gravity_BuildMutatorsPrettyString, CBC_ORDER_ANY);
-
+
MUTATOR_ONADD
{
cvar_settemp("sv_gravity", cvar_string("sv_gravity")); // settemp current gravity so it's restored on match end
string fn = "superspec-local.options";
float fh;
- if not(_ISLOCAL)
+ if (!_ISLOCAL)
{
if(self.crypto_idfp == "")
return;
return;
if(_spamlevel > 1)
- if not(_to.superspec_flags & SSF_VERBOSE)
+ if (!(_to.superspec_flags & SSF_VERBOSE))
return;
centerprint(_to, strcat(_center_title, _msg));
_hello.think = superspec_hello;
_hello.nextthink = time + 5;
- if not(_ISLOCAL)
+ if (!_ISLOCAL)
{
if(self.crypto_idfp == "")
return FALSE;
MUTATOR_HOOKFUNCTION(touchexplode_PlayerThink)
{
if(time > self.touchexplode_time)
- if not(gameover)
+ if (!gameover)
if(IS_PLAYER(self))
if(self.deadflag == DEAD_NO)
- if not(IS_INDEPENDENT_PLAYER(self))
+ if (!IS_INDEPENDENT_PLAYER(self))
FOR_EACH_PLAYER(other) if(self != other)
{
if(time > other.touchexplode_time)
if(other.deadflag == DEAD_NO)
- if not(IS_INDEPENDENT_PLAYER(other))
+ if (!IS_INDEPENDENT_PLAYER(other))
if(boxesoverlap(self.absmin, self.absmax, other.absmin, other.absmax))
{
PlayerTouchExplode(self, other);
frag_attacker.health += bound(0, damage_take, frag_target.health);
frag_attacker.health = bound(0, frag_attacker.health, autocvar_g_balance_health_limit);
}
-
+
return FALSE;
}
intensity = vlen(self.velocity) + vlen(other.velocity);
if(intensity) // avoid divisions by 0
intensity /= 2; // average the two velocities
- if not(intensity >= autocvar_g_sandbox_object_material_velocity_min)
+ if (!(intensity >= autocvar_g_sandbox_object_material_velocity_min))
return; // impact not strong enough to do anything
// now offset intensity and apply it to the effects
intensity -= autocvar_g_sandbox_object_material_velocity_min; // start from minimum velocity, not actual velocity
return trace_ent; // don't check permissions, anyone can edit this object
if(trace_ent.crypto_idfp == "")
return trace_ent; // the player who spawned this object did not have an UID, so anyone can edit it
- if not(trace_ent.realowner != self && autocvar_g_sandbox_editor_free < 2)
+ if (!(trace_ent.realowner != self && autocvar_g_sandbox_editor_free < 2))
return trace_ent; // object does not belong to the player, and players can only edit their own objects on this server
return world;
}
print_to(self, "^1SANDBOX - WARNING: ^7Attempted to spawn an object without specifying a model. Please specify the path to your model file after the 'object_spawn' command");
return TRUE;
}
- if not(fexists(argv(2)))
+ if (!(fexists(argv(2))))
{
print_to(self, "^1SANDBOX - WARNING: ^7Attempted to spawn an object with a non-existent model. Make sure the path to your model file is correct");
return TRUE;
case CONTENT_SKY:
return 0;
case CONTENT_EMPTY:
- if not (pointcontents(point - '0 0 1') == CONTENT_SOLID)
+ if (!(pointcontents(point - '0 0 1') == CONTENT_SOLID))
return 0;
break;
case CONTENT_WATER:
}
*/
-#define _pcheck(p) traceline(p+z_up,p-z_down,MOVE_WORLDONLY,self); if not(floor_ok(trace_endpos)) return 1
+#define _pcheck(p) traceline(p+z_up,p-z_down,MOVE_WORLDONLY,self); if (!floor_ok(trace_endpos)) return 1
float edge_check(vector point,float fsize)
{
vector z_up,z_down;
traceline(end + ('0 0 0.25' * pathlib_gridsize),end - ('0 0 1' * pathlib_gridsize),MOVE_WORLDONLY,self);
end = trace_endpos;
- if not(pointcontents(end - '0 0 1') == CONTENT_SOLID)
+ if (!(pointcontents(end - '0 0 1') == CONTENT_SOLID))
return end;
for(surface = start ; surface_z < (end_z + 32); ++surface_z)
return trace_endpos;
point = trace_endpos;
- if not(floor_ok(trace_endpos))
+ if (!floor_ok(trace_endpos))
return trace_endpos;
tracebox(last_point + walknode_boxup, walknode_boxmin,walknode_boxmax, point + walknode_boxup, MOVE_WORLDONLY, self);
point = trace_endpos;
- if not(floor_ok(trace_endpos))
+ if (!floor_ok(trace_endpos))
return trace_endpos;
tracebox(last_point + walknode_boxup, walknode_boxmin,walknode_boxmax, point + walknode_boxup, MOVE_WORLDONLY, self);
}
where = pathlib_movenode(parent.origin,to,0);
- if not(pathlib_movenode_goodnode)
+ if (!pathlib_movenode_goodnode)
return 0;
if(doedge)
node.path_prev = parent;
}
- if not (best_open_node)
+ if (!best_open_node)
best_open_node = node;
else if(best_open_node.pathlib_node_f > node.pathlib_node_f)
best_open_node = node;
node.pathlib_node_g = g;
node.pathlib_node_f = f;
- if not (best_open_node)
+ if (!best_open_node)
best_open_node = node;
else if(best_open_node.pathlib_node_f > node.pathlib_node_f)
best_open_node = node;
pathlib_movenode = pathlib_swimnode;
}
- if not(openlist)
+ if (!openlist)
openlist = spawn();
- if not(closedlist)
+ if (!closedlist)
closedlist = spawn();
- if not(scraplist)
+ if (!scraplist)
scraplist = spawn();
pathlib_closed_cnt = 0;
void __showpath2_think()
{
- #ifdef TURRET_DEBUG
+ #ifdef TURRET_DEBUG
mark_info(self.origin,1);
#endif
if(self.path_next)
node.path_prev = parent;
}
- if not (best_open_node)
+ if (!best_open_node)
best_open_node = node;
else if(best_open_node.pathlib_node_f > node.pathlib_node_f)
best_open_node = node;
where = pathlib_movenode(parent.origin, to, 0);
- if not(pathlib_movenode_goodnode)
+ if (!pathlib_movenode_goodnode)
{
//pathlib_showsquare(where, 0 ,30);
//pathlib_showsquare(parent.origin, 1 ,30);
if(doedge)
- if not (tile_check(where))
+ if (!tile_check(where))
{
dprint("tile_check fail\n");
pathlib_showsquare(where, 0 ,30);
//}
}
- if not (best_open_node)
+ if (!best_open_node)
best_open_node = node;
else if(best_open_node.pathlib_node_f > node.pathlib_node_f)
best_open_node = node;
node.pathlib_node_g = g;
node.pathlib_node_f = f;
- if not (best_open_node)
+ if (!best_open_node)
best_open_node = node;
else if(best_open_node.pathlib_node_f > node.pathlib_node_f)
best_open_node = node;
pathlib_movenode = pathlib_swimnode;
}
- if not(openlist)
+ if (!openlist)
openlist = spawn();
- if not(closedlist)
+ if (!closedlist)
closedlist = spawn();
pathlib_closed_cnt = 0;
traceline(end + ('0 0 0.25' * pathlib_gridsize),end - ('0 0 1' * pathlib_gridsize),MOVE_WORLDONLY,self);
end = trace_endpos;
- if not(pointcontents(end - '0 0 1') == CONTENT_SOLID)
+ if (!(pointcontents(end - '0 0 1') == CONTENT_SOLID))
return end;
for(surface = start ; surface_z < (end_z + 32); ++surface_z)
// FIXME! wp.wp##mincost is NOT distance. Make it distance or add a field for distance to be used here (for better speed)
cost = vlen(child.origin - wp.origin);
-
+
child.path_prev = wp;
child.pathlib_list = openlist;
child.pathlib_node_g = wp.pathlib_node_g + cost;
child.pathlib_node_h = pathlib_heuristic(child.origin, goal_node.origin);
child.pathlib_node_c = pathlib_wpp_waypointcallback(child, wp);
child.pathlib_node_f = child.pathlib_node_g + child.pathlib_node_h + child.pathlib_node_c;
-
+
if(child == goal_node)
pathlib_foundgoal = TRUE;
// FIXME! wp.wp##mincost is NOT distance. Make it distance or add a field for distance to be used here (for better speed)
cost = vlen(child.origin - wp.origin);
-
+
child.path_prev = wp;
child.pathlib_list = openlist;
child.pathlib_node_g = wp.pathlib_node_g + cost;
- child.pathlib_node_h = pathlib_heuristic(child.origin, goal_node.origin);
+ child.pathlib_node_h = pathlib_heuristic(child.origin, goal_node.origin);
child.pathlib_node_f = child.pathlib_node_g + child.pathlib_node_h;
if(child == goal_node)
if(wp.wp29) pathlib_wpp_open(wp,wp.wp29,wp.wp29mincost); else return 29;
if(wp.wp30) pathlib_wpp_open(wp,wp.wp30,wp.wp30mincost); else return 30;
if(wp.wp31) pathlib_wpp_open(wp,wp.wp31,wp.wp31mincost); else return 31;
-
+
return 32;
}
float ptime;
ptime = gettime(GETTIME_REALTIME);
- pathlib_starttime = ptime;
+ pathlib_starttime = ptime;
pathlib_movecost = 300;
pathlib_movecost_diag = vlen('1 1 0' * pathlib_movecost);
-
- if not (pathlib_wpp_waypointcallback)
+
+ if (!pathlib_wpp_waypointcallback)
callback = FALSE;
-
+
if (callback)
pathlib_wpp_open = pathlib_wpp_opencb;
else
pathlib_wpp_open = pathlib_wpp_openncb;
-
+
pathlib_heuristic = pathlib_h_none;
-
- if not(openlist)
+
+ if (!openlist)
openlist = spawn();
- if not(closedlist)
+ if (!closedlist)
closedlist = spawn();
pathlib_closed_cnt = 0;
n.pathlib_node_g = 0;
n.pathlib_node_f = 0;
n.pathlib_node_h = 0;
-
+
//setmodel(n, "models/runematch/rune.mdl");
//n.effects = EF_LOWPRECISION;
//n.colormod = '0 0 0';
//n.scale = 1;
-
+
}
goal_node = wp_to;
}
pathlib_wpp_close(n);
dprint("Expanding ",ftos(pathlib_wpp_expand(n))," links\n");
-
+
if(pathlib_foundgoal)
{
entity start, end, open, ln;
-
+
dprint("Target found. Rebuilding and filtering path...\n");
-
+
buildpath_nodefilter = buildpath_nodefilter_none;
start = path_build(world, start_node.origin, world, world);
end = path_build(world, goal_node.origin, world, start);
ln = end;
-
+
for(open = goal_node; open.path_prev != start_node; open = open.path_prev)
{
n = path_build(ln,open.origin,open.path_prev,start);
ln = n;
}
start.path_next = n;
- n.path_prev = start;
-
+ n.path_prev = start;
+
return start;
}
// forward-right
p = where + f + r;
traceline(p + tile_check_up, p - tile_check_down, MOVE_WORLDONLY, self);
- if not (location_isok(trace_endpos, 1, 0))
+ if (!location_isok(trace_endpos, 1, 0))
return 0;
// Forward-left
p = where + f - r;
traceline(p + tile_check_up, p - tile_check_down, MOVE_WORLDONLY, self);
- if not (location_isok(trace_endpos, 1, 0))
+ if (!location_isok(trace_endpos, 1, 0))
return 0;
// Back-right
p = where - f + r;
traceline(p + tile_check_up, p - tile_check_down, MOVE_WORLDONLY, self);
- if not (location_isok(trace_endpos, 1 ,0))
+ if (!location_isok(trace_endpos, 1 ,0))
return 0;
//Back-left
p = where - f - r;
traceline(p + tile_check_up, p - tile_check_down, MOVE_WORLDONLY, self);
- if not (location_isok(trace_endpos, 1, 0))
+ if (!location_isok(trace_endpos, 1, 0))
return 0;
return 1;
// forward
p = where + f;
traceline(p+tile_check_up,p-tile_check_down,MOVE_WORLDONLY,self);
- if not (location_isok(trace_endpos,1,0))
+ if (!location_isok(trace_endpos,1,0))
return 0;
//left
p = where - r;
traceline(p+tile_check_up,p-tile_check_down,MOVE_WORLDONLY,self);
- if not (location_isok(trace_endpos,1,0))
+ if (!location_isok(trace_endpos,1,0))
return 0;
// Right
p = where + r;
traceline(p+tile_check_up,p-tile_check_down,MOVE_WORLDONLY,self);
- if not (location_isok(trace_endpos,1,0))
+ if (!location_isok(trace_endpos,1,0))
return 0;
//Back
p = where - f;
traceline(p+tile_check_up,p-tile_check_down,MOVE_WORLDONLY,self);
- if not (location_isok(trace_endpos,1,0))
+ if (!location_isok(trace_endpos,1,0))
return 0;
return 1;
if(playerstats_db >= 0)
playerstats_waitforme = FALSE; // must wait for it at match end
- serverflags |= SERVERFLAG_PLAYERSTATS;
+ serverflags |= SERVERFLAG_PLAYERSTATS;
PlayerStats_AddEvent(PLAYERSTATS_ALIVETIME);
PlayerStats_AddEvent(PLAYERSTATS_AVGLATENCY);
string key;
key = sprintf("%s:*", e.playerstats_id);
-
+
string p;
p = db_get(playerstats_db, key);
if(p == "")
string key;
key = sprintf("%d", t);
-
+
string p;
p = db_get(playerstats_db, key);
if(p == "")
{
if(playerstats_db < 0)
return;
-
+
string key;
key = sprintf("*:%s", event_id);
-
+
string p;
p = db_get(playerstats_db, key);
if(p == "")
{
if((e.playerstats_id == "") || playerstats_db < 0)
return 0;
-
+
string key;
float val;
key = sprintf("%s:%s", e.playerstats_id, event_id);
U: UDP port number of the server
D: duration of the match
P: player ID of an existing player; this also sets the owner for all following "n", "e" and "t" lines (lower case!)
- Q: team number of an existing team (format: team#NN); this also sets the owner for all following "e" lines (lower case!)
+ Q: team number of an existing team (format: team#NN); this also sets the owner for all following "e" lines (lower case!)
n: nickname of the player (optional)
t: team ID
i: player index
vector from, to, safe, step, transform, ang, newvel;
float planeshift, s, t;
- if not(teleporter.enemy)
+ if (!teleporter.enemy)
{
backtrace("Portal_TeleportPlayer called without other portal being set. Stop.");
return 0;
player = self;
self = oldself;
- if not(teleporter.enemy)
+ if (!teleporter.enemy)
{
backtrace("Portal_TeleportPlayer ended up without other portal being set BEFORE TeleportPlayer. Stop.");
return 0;
Send_Notification(NOTIF_ONE, player, MSG_ANNCE, ANNCE_ACHIEVEMENT_AMAZING);
}
- if not(teleporter.enemy)
+ if (!teleporter.enemy)
{
backtrace("Portal_TeleportPlayer ended up without other portal being set AFTER TeleportPlayer. Stop.");
return 0;
../common/test.qc
../common/util.qc
../common/notifications.qc
-
-../common/if-this-file-errors-scroll-up-and-fix-the-warnings.fteqccfail
oldrec = race_readTime(GetMapname(), newpos);
oldrec_holder = race_readName(GetMapname(), newpos);
-
+
// store new ranking
race_writeTime(GetMapname(), t, myuid);
if(rankings_reply)
strunzone(rankings_reply);
rankings_reply = strzone(getrankings());
-
+
if(newpos == player_prevpos)
{
Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_RACE_NEW_IMPROVED, mynetname, newpos, t, oldrec);
if(tvalid)
if(cp == race_timed_checkpoint) // finish line
- if not(e.race_completed)
+ if (!e.race_completed)
{
float s;
if(g_race_qualifying)
/*
* Trigger targets
*/
- if not((self.spawnflags & 2) && (IS_PLAYER(other)))
+ if (!((self.spawnflags & 2) && (IS_PLAYER(other))))
{
activator = other;
oldmsg = self.message;
self.message = oldmsg;
}
- if not(IS_PLAYER(other))
+ if (!IS_PLAYER(other))
return;
/*
other.porto_forbidden = 2; // decreased by 1 each StartFrame
if(defrag_ents) {
- if(self.race_checkpoint == -2)
+ if(self.race_checkpoint == -2)
{
self.race_checkpoint = other.race_checkpoint;
}
for(cp = world; (cp = find(cp, classname, "target_checkpoint"));) {
if(cp.race_checkpoint == -2) // set defragcpexists to -1 so that the cp id file will be rewritten when someone finishes
defragcpexists = -1;
- }
+ }
}
}
if(cp_amount == 0) {
if(have_verified)
return;
have_verified = 1;
-
+
qual = g_race_qualifying;
oldself = self;
self.race_place = race_lowest_place_spawn;
if(!Spawn_FilterOutBadSpots(findchain(classname, "info_player_deathmatch"), 0, FALSE))
error(strcat("Checkpoint ", ftos(i), " misses a spawnpoint with race_place==", ftos(self.race_place), " (used for qualifying) - bailing out"));
-
+
// race only (initial spawn)
g_race_qualifying = 0;
for(p = 1; p <= race_highest_place_spawn; ++p)
self.race_checkpoint = race_NextCheckpoint(0);
g_race_qualifying = 1;
self.race_place = 0; // there's only one spawn on defrag maps
-
+
// check if a defragcp file already exists, then read it and apply the checkpoint order
float fh;
float len;
targ.wait = 0;
targ.delay = 0;
- // These just make the game crash on some maps with oddly shaped triggers.
- // (on the other hand they used to fix the case when two players ran through a checkpoint at once,
+ // These just make the game crash on some maps with oddly shaped triggers.
+ // (on the other hand they used to fix the case when two players ran through a checkpoint at once,
// and often one of them just passed through without being registered. Hope it's fixed in a better way now.
// (happened on item triggers too)
//
EXACTTRIGGER_INIT;
self.use = checkpoint_use;
- if not(self.spawnflags & 1)
+ if (!(self.spawnflags & 1))
self.touch = checkpoint_touch;
o = (self.absmin + self.absmax) * 0.5;
self.message2 = "was pushed backwards by";
if (self.race_penalty_reason == "")
self.race_penalty_reason = "missing a checkpoint";
-
+
self.race_checkpoint = self.cnt;
if(self.race_checkpoint > race_highest_checkpoint)
EXACTTRIGGER_INIT;
self.use = checkpoint_use;
- if not(self.spawnflags & 1)
+ if (!(self.spawnflags & 1))
self.touch = checkpoint_touch;
o = (self.absmin + self.absmax) * 0.5;
EXACTTRIGGER_INIT;
self.use = penalty_use;
- if not(self.spawnflags & 1)
+ if (!(self.spawnflags & 1))
self.touch = penalty_touch;
if (self.race_penalty_reason == "")
l = PlayerScore_Add(e, SP_RACE_LAPS, 0);
if(e.race_completed)
return l; // not fractional
-
+
vector o0, o1;
float bestfraction, fraction;
entity lastcp, cp0, cp1;
if(nextcpindex == lastcpindex)
return l; // finish
-
+
bestfraction = 1;
for(cp0 = world; (cp0 = find(cp0, classname, "trigger_race_checkpoint")); )
{
entity s;
if(gameover)
- if not(g_lms && scorefield == SP_LMS_RANK) // allow writing to this field in intermission as it is needed for newly joining players
+ if(!(g_lms && scorefield == SP_LMS_RANK)) // allow writing to this field in intermission as it is needed for newly joining players
score = 0;
if(!scores_initialized) return 0; // FIXME remove this when everything uses this system
if(teams < 0)
return 0;
}
-
+
return PlayerScore_Compare(p1.scorekeeper, p2.scorekeeper, strict);
}
plist = p;
}
// Now plist points to the whole list.
-
+
pfirst = plast = world;
i = j = 0;
pbest.field = j;
- if not(pfirst)
+ if (!pfirst)
pfirst = pbest;
if(plast)
plast.chain = pbest;
}
sk = teamscorekeepers[t - 1];
- if not(sk)
+ if (!sk)
return -999999999;
s = sk.teamscores_primary;
if(teamscores_flags_primary & SFL_ZERO_IS_WORST)
s = "Scores:";
s = strcat(s, strpad(max(0, NAMEWIDTH - strlennocol(s)), ""));
-
+
for(i = 0; i < MAX_SCORE; ++i)
if(scores_label[i] != "")
{
break;
}
}
-
+
for(i = 0; i < MAX_SCORE; ++i)
if(scores_label[i] != "")
{
t = p.team;
p = p.chain;
}
-
+
t = 0;
FOR_EACH_CLIENT(p)
- if not(IS_PLAYER(p))
+ if (!IS_PLAYER(p))
{
- if not(t)
+ if (!t)
Score_NicePrint_Spectators(to);
Score_NicePrint_Spectator(to, p);
t = 1;
if(score_enabled)
ScoreInfo_SetLabel_TeamScore (ST_SCORE, "score", stprio);
- if not(INDEPENDENT_PLAYERS)
+ if (!INDEPENDENT_PLAYERS)
ScoreInfo_SetLabel_PlayerScore(SP_KILLS, "kills", 0);
ScoreInfo_SetLabel_PlayerScore(SP_DEATHS, "deaths", SFL_LOWER_IS_BETTER);
- if not(INDEPENDENT_PLAYERS)
+ if (!INDEPENDENT_PLAYERS)
ScoreInfo_SetLabel_PlayerScore(SP_SUICIDES, "suicides", SFL_LOWER_IS_BETTER);
if(score_enabled)
*/
void trigger_secret_touch() {
// only a player can trigger this
- if not(IS_PLAYER(other))
+ if (!IS_PLAYER(other))
return;
-
+
// update secrets found counter
secrets_found += 1;
//print("Secret found: ", ftos(secret_counter.cnt), "/");
// centerprint message (multi_touch() doesn't always call centerprint())
centerprint(other, self.message);
self.message = "";
-
+
// handle normal trigger features
multi_touch();
remove(self);
*/
void spawnfunc_trigger_secret() {
// FIXME: should it be disabled in most modes?
-
+
// update secrets count
secrets_total += 1;
-
+
// add default message
if (self.message == "")
self.message = "You found a secret!";
-
+
// set default sound
if (self.noise == "")
- if not(self.sounds)
+ if (!self.sounds)
self.sounds = 1; // misc/secret.wav
-
+
// this entity can't be a target itself!!!!
self.targetname = "";
-
+
// you can't just shoot a room to find it, can you?
self.health = 0;
-
+
// a secret can not be delayed
self.delay = 0;
-
+
// convert this trigger to trigger_once
self.classname = "trigger_once";
spawnfunc_trigger_once();
-
+
// take over the touch() function, so we can mark secret as found
self.touch = trigger_secret_touch;
// ignore triggering;
float SpawnEvent_Send(entity to, float sf)
{
float send;
-
+
WriteByte(MSG_ENTITY, ENT_CLIENT_SPAWNEVENT);
if(autocvar_g_spawn_alloweffects)
{
entity oldself;
float dm;
-
+
oldself = self;
for(self = world; (self = findfloat(self, damagedbycontents, TRUE)); )
{
if (self.movetype == MOVETYPE_NOCLIP) { continue; }
-
+
float vehic = (self.vehicle_flags & VHF_ISVEHICLE);
float projectile = (self.flags & FL_PROJECTILE);
-
+
if (self.watertype <= CONTENT_WATER && self.waterlevel > 0) // workaround a retarded bug made by id software :P (yes, it's that old of a bug)
{
if (!(self.flags & FL_INWATER))
}
}
}
-
+
if (self.dmgtime < time)
{
- self.dmgtime = time + autocvar_g_balance_contents_damagerate;
-
+ self.dmgtime = time + autocvar_g_balance_contents_damagerate;
+
if (projectile)
{
if (self.watertype == CONTENT_LAVA)
else
dprint(ftos(trace_dphitq3surfaceflags), "\n");
*/
- if not(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOSTEPS)
+ if (!(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOSTEPS))
{
if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_METALSTEPS)
GlobalSound(globalsound_metalstep, CH_PLAYER, VOICETYPE_PLAYERSOUND);
}
}
}
-
+
self.oldvelocity = self.velocity;
}
self = oldself;
{
if (self)
if (self.gametypefilter != "")
- if not(isGametypeInFilter(MapInfo_LoadedGametype, teamplay, have_team_spawns, self.gametypefilter))
+ if (!isGametypeInFilter(MapInfo_LoadedGametype, teamplay, have_team_spawns, self.gametypefilter))
{
remove(self);
return;
else
{
k = s;
- if not(cvar(k))
+ if (!cvar(k))
goto cvar_fail;
}
}
inv = !inv;
:cvar_fail
// now inv is 1 if we want to keep the item, and 0 if we want to get rid of it
- if not(inv)
+ if (!inv)
{
//print("cvarfilter fail\n");
remove(self);
void func_ladder_touch()
{
- if not(other.iscreature)
+ if (!other.iscreature)
return;
if (other.vehicle_flags & VHF_ISVEHICLE)
return;
.float gravity;
.vector colormod;
void ItemDraw()
-{
+{
if(self.gravity)
- {
+ {
Movetype_Physics_MatchServer(autocvar_cl_projectiles_sloppy);
- if(self.move_flags & FL_ONGROUND)
+ if(self.move_flags & FL_ONGROUND)
{ // For some reason move_avelocity gets set to '0 0 0' here ...
self.oldorigin = self.origin;
self.gravity = 0;
- if(autocvar_cl_animate_items)
- { // ... so reset it if animations are requested.
+ if(autocvar_cl_animate_items)
+ { // ... so reset it if animations are requested.
if(self.ItemStatus & ITS_ANIMATE1)
self.move_avelocity = '0 180 0';
-
+
if(self.ItemStatus & ITS_ANIMATE2)
self.move_avelocity = '0 -90 0';
}
}
}
else if (autocvar_cl_animate_items)
- {
+ {
if(self.ItemStatus & ITS_ANIMATE1)
{
self.angles += self.move_avelocity * frametime;
- setorigin(self, '0 0 10' + self.oldorigin + '0 0 8' * sin(time * 2));
- }
-
+ setorigin(self, '0 0 10' + self.oldorigin + '0 0 8' * sin(time * 2));
+ }
+
if(self.ItemStatus & ITS_ANIMATE2)
{
self.angles += self.move_avelocity * frametime;
- setorigin(self, '0 0 8' + self.oldorigin + '0 0 4' * sin(time * 3));
+ setorigin(self, '0 0 8' + self.oldorigin + '0 0 4' * sin(time * 3));
}
}
}
void ItemDrawSimple()
{
if(self.gravity)
- {
- Movetype_Physics_MatchServer(autocvar_cl_projectiles_sloppy);
-
+ {
+ Movetype_Physics_MatchServer(autocvar_cl_projectiles_sloppy);
+
if(self.move_flags & FL_ONGROUND)
self.gravity = 0;
}
setorigin(self, self.origin);
self.oldorigin = self.origin;
}
-
- if(sf & ISF_ANGLES)
+
+ if(sf & ISF_ANGLES)
{
self.angles_x = ReadCoord();
self.angles_y = ReadCoord();
- self.angles_z = ReadCoord();
+ self.angles_z = ReadCoord();
self.move_angles = self.angles;
}
-
+
if(sf & ISF_STATUS) // need to read/write status frist so model can handle simple, fb etc.
{
- self.ItemStatus = ReadByte();
-
+ self.ItemStatus = ReadByte();
+
if(self.ItemStatus & ITS_AVAILABLE)
{
self.alpha = 1;
}
else
self.alpha = -1;
- }
-
+ }
+
if(autocvar_cl_fullbright_items)
if(self.ItemStatus & ITS_ALLOWFB)
self.effects |= EF_FULLBRIGHT;
-
+
if(self.ItemStatus & ITS_STAYWEP)
{
self.colormod = self.glowmod = autocvar_cl_weapon_stay_color;
self.alpha = autocvar_cl_weapon_stay_alpha;
-
+
}
-
+
if(self.ItemStatus & ITS_POWERUP)
{
if(self.ItemStatus & ITS_AVAILABLE)
self.effects &= ~(EF_ADDITIVE | EF_FULLBRIGHT);
}
}
-
+
if(sf & ISF_MODEL)
{
self.drawmask = MASK_NORMAL;
self.movetype = MOVETYPE_NOCLIP;
self.draw = ItemDraw;
-
+
if(self.mdl)
strunzone(self.mdl);
-
+
self.mdl = "";
string _fn = ReadString();
-
+
if(autocvar_cl_simple_items && (self.ItemStatus & ITS_ALLOWSI))
{
string _fn2 = substring(_fn, 0 , strlen(_fn) -4);
self.draw = ItemDrawSimple;
-
-
-
+
+
+
if(fexists(sprintf("%s%s.md3", _fn2, autocvr_cl_simpleitems_postfix)))
self.mdl = strzone(sprintf("%s%s.md3", _fn2, autocvr_cl_simpleitems_postfix));
else if(fexists(sprintf("%s%s.dpm", _fn2, autocvr_cl_simpleitems_postfix)))
dprint("Simple item requested for ", _fn, " but no model exsist for it\n");
}
}
-
- if(self.draw != ItemDrawSimple)
- self.mdl = strzone(_fn);
-
-
+
+ if(self.draw != ItemDrawSimple)
+ self.mdl = strzone(_fn);
+
+
if(self.mdl == "")
dprint("^1WARNING!^7 self.mdl is unset for item ", self.classname, " tell tZork aboute this!\n");
-
+
precache_model(self.mdl);
setmodel(self, self.mdl);
}
-
+
if(sf & ISF_COLORMAP)
self.colormap = ReadShort();
-
+
if(sf & ISF_DROP)
{
self.gravity = 1;
self.move_velocity_z = ReadCoord();
self.velocity = self.move_velocity;
self.move_origin = self.oldorigin;
-
+
if(!self.move_time)
{
self.move_time = time;
else
self.move_time = max(self.move_time, time);
}
-
+
if(autocvar_cl_animate_items)
- {
+ {
if(self.ItemStatus & ITS_ANIMATE1)
self.move_avelocity = '0 180 0';
-
+
if(self.ItemStatus & ITS_ANIMATE2)
self.move_avelocity = '0 -90 0';
}
sf |= ISF_DROP;
else
sf &= ~ISF_DROP;
-
- WriteByte(MSG_ENTITY, ENT_CLIENT_ITEM);
+
+ WriteByte(MSG_ENTITY, ENT_CLIENT_ITEM);
WriteByte(MSG_ENTITY, sf);
//WriteByte(MSG_ENTITY, self.cnt);
WriteCoord(MSG_ENTITY, self.origin_y);
WriteCoord(MSG_ENTITY, self.origin_z);
}
-
+
if(sf & ISF_ANGLES)
{
WriteCoord(MSG_ENTITY, self.angles_x);
if(sf & ISF_MODEL)
{
-
+
if(self.mdl == "")
dprint("^1WARNING!^7 self.mdl is unset for item ", self.classname, "exspect a crash just aboute now\n");
-
+
WriteString(MSG_ENTITY, self.mdl);
}
-
-
+
+
if(sf & ISF_COLORMAP)
WriteShort(MSG_ENTITY, self.colormap);
WriteCoord(MSG_ENTITY, self.velocity_y);
WriteCoord(MSG_ENTITY, self.velocity_z);
}
-
+
return TRUE;
}
*/
void Item_Show (entity e, float mode)
-{
+{
e.effects &= ~(EF_ADDITIVE | EF_STARDUST | EF_FULLBRIGHT | EF_NODEPTHTEST);
e.ItemStatus &= ~ITS_STAYWEP;
if (mode > 0)
e.spawnshieldtime = 1;
e.ItemStatus &= ~ITS_AVAILABLE;
}
-
+
if (e.items & IT_STRENGTH || e.items & IT_INVINCIBLE)
- e.ItemStatus |= ITS_POWERUP;
-
+ e.ItemStatus |= ITS_POWERUP;
+
if (autocvar_g_nodepthtestitems)
e.effects |= EF_NODEPTHTEST;
-
-
+
+
if (autocvar_g_fullbrightitems)
e.ItemStatus |= ITS_ALLOWFB;
-
+
if (autocvar_sv_simple_items)
e.ItemStatus |= ITS_ALLOWSI;
if (player.switchweapon == w_getbestweapon(player))
_switchweapon = TRUE;
- if not(player.weapons & WepSet_FromWeapon(player.switchweapon))
+ if (!(player.weapons & WepSet_FromWeapon(player.switchweapon)))
_switchweapon = TRUE;
pickedup |= Item_GiveAmmoTo(item, player, ammo_fuel, g_pickup_fuel_max, ITEM_MODE_FUEL);
}
:skip
-
+
// always eat teamed entities
if(item.team)
pickedup = TRUE;
void Item_Touch (void)
{
entity e, head;
-
+
// remove the item if it's currnetly in a NODROP brush or hits a NOIMPACT surface (such as sky)
if(self.classname == "droppedweapon")
{
}
}
- if not(IS_PLAYER(other))
+ if (!IS_PLAYER(other))
return;
if (other.deadflag)
return;
if (self.classname == "droppedweapon")
remove (self);
- else if not(self.spawnshieldtime)
+ else if (!self.spawnshieldtime)
return;
else
{
{
wi = get_weaponinfo(i);
- if not(player.weapons & WepSet_FromWeapon(i))
+ if (!(player.weapons & WepSet_FromWeapon(i)))
continue;
if(wi.items & IT_SHELLS)
if(self.model == "")
self.model = itemmodel;
-
+
if(self.model == "")
{
error(strcat("^1Tried to spawn ", itemname, " with no model!\n"));
return;
}
-
+
if(self.item_pickupsound == "")
self.item_pickupsound = pickupsound;
-
+
if(!self.respawntime) // both need to be set
{
self.respawntime = defaultrespawntime;
if(weaponid)
self.weapons = WepSet_FromWeapon(weaponid);
-
+
self.flags = FL_ITEM | itemflags;
if(MUTATOR_CALLHOOK(FilterItem)) // error means we do not want the item
remove (self);
return;
}
-
+
if(self.angles != '0 0 0')
self.SendFlags |= ISF_ANGLES;
self.netname = itemname;
self.touch = Item_Touch;
setmodel(self, "null"); // precision set below
- //self.effects |= EF_LOWPRECISION;
-
+ //self.effects |= EF_LOWPRECISION;
+
if((itemflags & FL_POWERUP) || self.health || self.armorvalue)
{
self.pos1 = '-16 -16 0';
self.pos2 = '16 16 32';
}
setsize (self, self.pos1, self.pos2);
-
- if(itemflags & FL_POWERUP)
+
+ if(itemflags & FL_POWERUP)
self.ItemStatus |= ITS_ANIMATE1;
-
+
if(self.armorvalue || self.health)
self.ItemStatus |= ITS_ANIMATE2;
-
+
if(itemflags & FL_WEAPON)
{
if (self.classname != "droppedweapon") // if dropped, colormap is already set up nicely
self.colormap = 1024; // color shirt=0 pants=0 grey
else
self.gravity = 1;
-
+
self.ItemStatus |= ITS_ANIMATE1;
self.ItemStatus |= ISF_COLORMAP;
}
{
if(!self.cnt)
self.cnt = 1; // item probability weight
-
+
self.effects |= EF_NODRAW; // marker for item team search
InitializeEntity(self, Item_FindTeam, INITPRIO_FINDTARGET);
}
else
Item_Reset();
-
+
Net_LinkEntity(self, FALSE, 0, ItemSend);
// call this hook after everything else has been done
return;
}
- if not(IS_PLAYER(activator))
+ if (!IS_PLAYER(activator))
return;
if(activator.deadflag != DEAD_NO)
return;
e.strength_finished = max(0, e.strength_finished - time);
e.invincible_finished = max(0, e.invincible_finished - time);
e.superweapons_finished = max(0, e.superweapons_finished - time);
-
+
PREGIVE(e, items);
PREGIVE_WEAPONS(e);
PREGIVE(e, strength_finished);
{
wi = get_weaponinfo(j);
if(wi.weapon)
- if not(wi.spawnflags & WEP_FLAG_MUTATORBLOCKED)
+ if (!(wi.spawnflags & WEP_FLAG_MUTATORBLOCKED))
got += GiveWeapon(e, j, op, val);
}
case "allammo":
if(wi.weapon)
{
POSTGIVE_WEAPON(e, j, "weapons/weaponpickup.wav", string_null);
- if not(save_weapons & WepSet_FromWeapon(j))
+ if (!(save_weapons & WepSet_FromWeapon(j)))
if(e.weapons & WepSet_FromWeapon(j))
weapon_action(wi.weapon, WR_PRECACHE);
}
else
e.superweapons_finished += time;
- if not(e.weapons & WepSet_FromWeapon(e.switchweapon))
+ if (!(e.weapons & WepSet_FromWeapon(e.switchweapon)))
_switchweapon = TRUE;
if(_switchweapon)
W_SwitchWeapon_Force(e, w_getbestweapon(e));
self.speed = 1000;
self.movedir = self.movedir * self.speed * 10;
- if not(self.noise)
+ if (!self.noise)
self.noise = "misc/jumppad.wav";
precache_sound (self.noise);
{
sound (self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTEN_NORM);
self.state = 3;
- SUB_CalcMove (self.pos2, self.speed, plat_hit_bottom);
+ SUB_CalcMove (self.pos2, TSPEED_LINEAR, self.speed, plat_hit_bottom);
}
void plat_go_up()
{
sound (self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTEN_NORM);
self.state = 4;
- SUB_CalcMove (self.pos1, self.speed, plat_hit_top);
+ SUB_CalcMove (self.pos1, TSPEED_LINEAR, self.speed, plat_hit_top);
}
void plat_center_touch()
{
- if not(other.iscreature)
+ if (!other.iscreature)
return;
if (other.health <= 0)
void plat_outside_touch()
{
- if not(other.iscreature)
+ if (!other.iscreature)
return;
if (other.health <= 0)
}
}
-void spawnfunc_path_corner() { }
+.float platmovetype_start_default, platmovetype_end_default;
+float set_platmovetype(entity e, string s)
+{
+ // sets platmovetype_start and platmovetype_end based on a string consisting of two values
+
+ float n;
+ n = tokenize_console(s);
+ if(n > 0)
+ e.platmovetype_start = stof(argv(0));
+ else
+ e.platmovetype_start = 0;
+
+ if(n > 1)
+ e.platmovetype_end = stof(argv(1));
+ else
+ e.platmovetype_end = e.platmovetype_start;
+
+ if(n > 2)
+ if(argv(2) == "force")
+ return TRUE; // no checking, return immediately
+
+ if(!cubic_speedfunc_is_sane(e.platmovetype_start, e.platmovetype_end))
+ {
+ objerror("Invalid platform move type; platform would go in reverse, which is not allowed.");
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+void spawnfunc_path_corner()
+{
+ // setup values for overriding train movement
+ // if a second value does not exist, both start and end speeds are the single value specified
+ if(!set_platmovetype(self, self.platmovetype))
+ return;
+}
void spawnfunc_func_plat()
{
if (self.sounds == 0)
self.angles = '0 0 0';
self.classname = "plat";
- if not(InitMovingBrushTrigger())
+ if (!InitMovingBrushTrigger())
return;
self.effects |= EF_LOWPRECISION;
setsize (self, self.mins , self.maxs);
plat_spawn_inside_trigger (); // the "start moving" trigger
}
-
+.float train_wait_turning;
void() train_next;
void train_wait()
{
+ entity oldself;
+ oldself = self;
+ self = self.enemy;
+ SUB_UseTargets();
+ self = oldself;
+ self.enemy = world;
+
+ // if turning is enabled, the train will turn toward the next point while waiting
+ if(self.platmovetype_turn && !self.train_wait_turning)
+ {
+ entity targ, cp;
+ vector ang;
+ targ = find(world, targetname, self.target);
+ if((self.spawnflags & 1) && targ.curvetarget)
+ cp = find(world, targetname, targ.curvetarget);
+ else
+ cp = world;
+
+ if(cp) // bezier curves movement
+ ang = cp.origin - (self.origin - self.view_ofs); // use the origin of the control point of the next path_corner
+ else // linear movement
+ ang = targ.origin - (self.origin - self.view_ofs); // use the origin of the next path_corner
+ ang = vectoangles(ang);
+ ang_x = -ang_x; // flip up / down orientation
+
+ if(self.wait > 0) // slow turning
+ SUB_CalcAngleMove(ang, TSPEED_TIME, self.ltime - time + self.wait, train_wait);
+ else // instant turning
+ SUB_CalcAngleMove(ang, TSPEED_TIME, 0.0000001, train_wait);
+ self.train_wait_turning = TRUE;
+ return;
+ }
+
if(self.noise != "")
stopsoundto(MSG_BROADCAST, self, CH_TRIGGER_SINGLE); // send this as unreliable only, as the train will resume operation shortly anyway
- if(self.wait < 0)
+ if(self.wait < 0 || self.train_wait_turning) // no waiting or we already waited while turning
{
+ self.train_wait_turning = FALSE;
train_next();
}
else
self.think = train_next;
self.nextthink = self.ltime + self.wait;
}
-
- entity oldself;
- oldself = self;
- self = self.enemy;
- SUB_UseTargets();
- self = oldself;
- self.enemy = world;
}
void train_next()
{
- entity targ;
+ entity targ, cp = world;
+ vector cp_org = '0 0 0';
+
targ = find(world, targetname, self.target);
- self.enemy = targ;
self.target = targ.target;
+ if (self.spawnflags & 1)
+ {
+ if(targ.curvetarget)
+ {
+ cp = find(world, targetname, targ.curvetarget); // get its second target (the control point)
+ cp_org = cp.origin - self.view_ofs; // no control point found, assume a straight line to the destination
+ }
+ }
if (self.target == "")
objerror("train_next: no next target");
self.wait = targ.wait;
if (!self.wait)
self.wait = 0.1;
+ if(targ.platmovetype)
+ {
+ // this path_corner contains a movetype overrider, apply it
+ self.platmovetype_start = targ.platmovetype_start;
+ self.platmovetype_end = targ.platmovetype_end;
+ }
+ else
+ {
+ // this path_corner doesn't contain a movetype overrider, use the train's defaults
+ self.platmovetype_start = self.platmovetype_start_default;
+ self.platmovetype_end = self.platmovetype_end_default;
+ }
+
if (targ.speed)
- SUB_CalcMove(targ.origin - self.mins, targ.speed, train_wait);
+ {
+ if (cp)
+ SUB_CalcMove_Bezier(cp_org, targ.origin - self.view_ofs, TSPEED_LINEAR, targ.speed, train_wait);
+ else
+ SUB_CalcMove(targ.origin - self.view_ofs, TSPEED_LINEAR, targ.speed, train_wait);
+ }
else
- SUB_CalcMove(targ.origin - self.mins, self.speed, train_wait);
+ {
+ if (cp)
+ SUB_CalcMove_Bezier(cp_org, targ.origin - self.view_ofs, TSPEED_LINEAR, self.speed, train_wait);
+ else
+ SUB_CalcMove(targ.origin - self.view_ofs, TSPEED_LINEAR, self.speed, train_wait);
+ }
if(self.noise != "")
sound(self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTEN_IDLE);
self.target = targ.target;
if (self.target == "")
objerror("func_train_find: no next target");
- setorigin(self, targ.origin - self.mins);
+ setorigin(self, targ.origin - self.view_ofs);
self.nextthink = self.ltime + 1;
self.think = train_next;
}
if (!self.speed)
self.speed = 100;
- if not(InitMovingBrushTrigger())
+ if (self.spawnflags & 2)
+ {
+ self.platmovetype_turn = TRUE;
+ self.view_ofs = '0 0 0'; // don't offset a rotating train, origin works differently now
+ }
+ else
+ self.view_ofs = self.mins;
+
+ if (!InitMovingBrushTrigger())
return;
self.effects |= EF_LOWPRECISION;
self.dmgtime = 0.25;
self.dmgtime2 = time;
+ if(!set_platmovetype(self, self.platmovetype))
+ return;
+ self.platmovetype_start_default = self.platmovetype_start;
+ self.platmovetype_end_default = self.platmovetype_end;
+
// TODO make a reset function for this one
}
void func_rotating_setactive(float astate)
{
-
+
if (astate == ACTIVE_TOGGLE)
- {
+ {
if(self.active == ACTIVE_ACTIVE)
self.active = ACTIVE_NOT;
else
}
else
self.active = astate;
-
- if(self.active == ACTIVE_NOT)
+
+ if(self.active == ACTIVE_NOT)
self.avelocity = '0 0 0';
else
self.avelocity = self.pos1;
precache_sound(self.noise);
ambientsound(self.origin, self.noise, VOL_BASE, ATTEN_IDLE);
}
-
+
self.active = ACTIVE_ACTIVE;
self.setactive = func_rotating_setactive;
-
+
if (!self.speed)
self.speed = 100;
// FIXME: test if this turns the right way, then remove this comment (negate as needed)
// FIXME: test if this turns the right way, then remove this comment (negate as needed)
else // Z
self.avelocity = '0 1 0' * self.speed;
-
+
self.pos1 = self.avelocity;
-
+
if(self.dmg && (self.message == ""))
self.message = " was squished";
if(self.dmg && (self.message2 == ""))
self.dmgtime2 = time;
- if not(InitMovingBrushTrigger())
+ if (!InitMovingBrushTrigger())
return;
// no EF_LOWPRECISION here, as rounding angles is bad
{
vector v;
self.nextthink = time + 0.1;
-
- if not (self.owner.active == ACTIVE_ACTIVE)
+
+ if (!(self.owner.active == ACTIVE_ACTIVE))
{
- self.owner.velocity = '0 0 0';
+ self.owner.velocity = '0 0 0';
return;
}
-
+
// calculate sinewave using makevectors
makevectors((self.nextthink * self.owner.cnt + self.owner.phase * 360) * '0 1 0');
v = self.owner.destvec + self.owner.movedir * v_forward_y;
else // Z
self.movedir = '0 0 1' * self.height;
- if not(InitMovingBrushTrigger())
+ if (!InitMovingBrushTrigger())
return;
// wait for targets to spawn
float v;
self.nextthink = time + 0.1;
- if not (self.owner.active == ACTIVE_ACTIVE)
+ if (!(self.owner.active == ACTIVE_ACTIVE))
{
self.owner.avelocity_x = 0;
return;
self.blocked = generic_plat_blocked;
self.avelocity_z = 0.0000001;
- if not(InitMovingBrushTrigger())
+ if (!InitMovingBrushTrigger())
return;
if(!self.freq)
void button_return()
{
self.state = STATE_DOWN;
- SUB_CalcMove (self.pos1, self.speed, button_done);
+ SUB_CalcMove (self.pos1, TSPEED_LINEAR, self.speed, button_done);
self.frame = 0; // use normal textures
if (self.health)
self.takedamage = DAMAGE_YES; // can be shot again
sound (self, CH_TRIGGER, self.noise, VOL_BASE, ATTEN_NORM);
self.state = STATE_UP;
- SUB_CalcMove (self.pos2, self.speed, button_wait);
+ SUB_CalcMove (self.pos2, TSPEED_LINEAR, self.speed, button_wait);
}
void button_reset()
void button_use()
{
- if not (self.active == ACTIVE_ACTIVE)
+ if (!(self.active == ACTIVE_ACTIVE))
return;
self.enemy = activator;
{
if (!other)
return;
- if not(other.iscreature)
+ if (!other.iscreature)
return;
if(other.velocity * self.movedir < 0)
return;
{
SetMovedir ();
- if not(InitMovingBrushTrigger())
+ if (!InitMovingBrushTrigger())
return;
self.effects |= EF_LOWPRECISION;
}
self.state = STATE_DOWN;
- SUB_CalcMove (self.pos1, self.speed, door_hit_bottom);
+ SUB_CalcMove (self.pos1, TSPEED_LINEAR, self.speed, door_hit_bottom);
}
void door_go_up()
if (self.noise2 != "")
sound (self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM);
self.state = STATE_UP;
- SUB_CalcMove (self.pos2, self.speed, door_hit_top);
+ SUB_CalcMove (self.pos2, TSPEED_LINEAR, self.speed, door_hit_top);
string oldmessage;
oldmessage = self.message;
float door_check_keys(void) {
local entity door;
-
-
+
+
if (self.owner)
door = self.owner;
else
door = self;
-
+
// no key needed
- if not(door.itemkeys)
+ if (!door.itemkeys)
return TRUE;
// this door require a key
// only a player can have a key
- if not(IS_PLAYER(other))
+ if (!IS_PLAYER(other))
return FALSE;
-
+
if (item_keys_usekey(door, other)) {
// some keys were used
if (other.key_door_messagetime <= time) {
entity oself;
//dprint("door_use (model: ");dprint(self.model);dprint(")\n");
-
+
if (self.owner)
{
oself = self;
void door_trigger_touch()
{
if (other.health < 1)
- if not(other.iscreature && other.deadflag == DEAD_NO)
+ if (!(other.iscreature && other.deadflag == DEAD_NO))
return;
if (time < self.attack_finished_single)
return;
-
+
// check if door is locked
if (!door_check_keys())
return;
-
+
self.attack_finished_single = time + 1;
activator = other;
if(!(DEATH_ISSPECIAL(deathtype)) && (deathtype & HITTYPE_SPLASH))
return;
self.health = self.health - damage;
-
+
if (self.itemkeys) {
// don't allow opening doors through damage if keys are required
return;
}
-
+
if (self.health <= 0)
{
oself = self;
*/
void door_touch()
{
- if not(IS_PLAYER(other))
+ if (!IS_PLAYER(other))
return;
if (self.owner.attack_finished_single > time)
return;
}
self.state = STATE_DOWN;
- SUB_CalcAngleMove (self.pos1, self.speed, door_rotating_hit_bottom);
+ SUB_CalcAngleMove (self.pos1, TSPEED_LINEAR, self.speed, door_rotating_hit_bottom);
}
void door_rotating_go_up()
if (self.noise2 != "")
sound (self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM);
self.state = STATE_UP;
- SUB_CalcAngleMove (self.pos2, self.speed, door_rotating_hit_top);
+ SUB_CalcAngleMove (self.pos2, TSPEED_LINEAR, self.speed, door_rotating_hit_top);
string oldmessage;
oldmessage = self.message;
self.itemkeys |= ITEM_KEY_BIT(0);
if (self.spawnflags & SPAWNFLAGS_SILVER_KEY)
self.itemkeys |= ITEM_KEY_BIT(1);
-
+
//if (!self.deathtype) // map makers can override this
// self.deathtype = " got in the way";
SetMovedir ();
self.max_health = self.health;
- if not(InitMovingBrushTrigger())
+ if (!InitMovingBrushTrigger())
return;
self.effects |= EF_LOWPRECISION;
self.classname = "door";
self.max_health = self.health;
self.avelocity = self.movedir;
- if not(InitMovingBrushTrigger())
+ if (!InitMovingBrushTrigger())
return;
self.velocity = '0 0 0';
//self.effects |= EF_LOWPRECISION;
self.dest1 = self.origin + v_right * (self.t_width * temp);
self.dest2 = self.dest1 + v_forward * self.t_length;
- SUB_CalcMove(self.dest1, self.speed, fd_secret_move1);
+ SUB_CalcMove(self.dest1, TSPEED_LINEAR, self.speed, fd_secret_move1);
if (self.noise2 != "")
sound(self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM);
}
{
if (self.noise2 != "")
sound(self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM);
- SUB_CalcMove(self.dest2, self.speed, fd_secret_move3);
+ SUB_CalcMove(self.dest2, TSPEED_LINEAR, self.speed, fd_secret_move3);
}
// Wait here until time to go back...
{
if (self.noise2 != "")
sound(self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM);
- SUB_CalcMove(self.dest1, self.speed, fd_secret_move5);
+ SUB_CalcMove(self.dest1, TSPEED_LINEAR, self.speed, fd_secret_move5);
}
// Wait 1 second...
{
if (self.noise2 != "")
sound(self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM);
- SUB_CalcMove(self.oldorigin, self.speed, fd_secret_done);
+ SUB_CalcMove(self.oldorigin, TSPEED_LINEAR, self.speed, fd_secret_done);
}
void fd_secret_done()
*/
void secret_touch()
{
- if not(other.iscreature)
+ if (!other.iscreature)
return;
if (self.attack_finished_single > time)
return;
self.mangle = self.angles;
self.angles = '0 0 0';
self.classname = "door";
- if not(InitMovingBrushTrigger())
+ if (!InitMovingBrushTrigger())
return;
self.effects |= EF_LOWPRECISION;
float n, i, t;
self.nextthink = time + 0.1;
- if not (self.owner.active == ACTIVE_ACTIVE)
+ if (!(self.owner.active == ACTIVE_ACTIVE))
{
- self.owner.velocity = '0 0 0';
+ self.owner.velocity = '0 0 0';
return;
}
if(self.netname == "")
self.netname = "1 0 0 0 1";
- if not(InitMovingBrushTrigger())
+ if (!InitMovingBrushTrigger())
return;
self.active = ACTIVE_ACTIVE;
{
self.nextthink = time + 0.1;
- if not (self.owner.active == ACTIVE_ACTIVE)
+ if (!(self.owner.active == ACTIVE_ACTIVE))
{
- self.owner.velocity = '0 0 0';
+ self.owner.velocity = '0 0 0';
return;
}
if(self.netname == "")
self.netname = "1 0 0 0 1";
- if not(InitMovingBrushTrigger())
+ if (!InitMovingBrushTrigger())
return;
// wait for targets to spawn
return 1;
if(self.notta)
- if not(!teamplay || g_tdm || g_ctf)
+ if (!(!teamplay || g_tdm || g_ctf))
return 1;
if(self.notsingle)
/*
* t_swamp.c
* Adds spawnfunc_trigger_swamp and suppoart routines for xonotic 1.2.1+
-* Author tZork (Jakob MG)
+* Author tZork (Jakob MG)
* jakob@games43.se
* 2005 11 29
*/
* It works like this: When the plyer enters teh swamp the spawnfunc_trigger_swamp
* attaches a new "swampslug" to the player. As long as the plyer is inside
* the swamp the swamp gives the slug new health. But the slug slowly kills itself
-* so when the player goes outside the swamp, it dies and releases the player from the
-* swamps curses (dmg/slowdown)
-*
+* so when the player goes outside the swamp, it dies and releases the player from the
+* swamps curses (dmg/slowdown)
+*
* I do it this way becuz there is no "untouch" event.
*
-* --NOTE--
+* --NOTE--
* THE ACCTUAL slowdown is done in cl_physics.c on line 57-60
* --NOTE--
*/
-void swampslug_think(void)
+void swampslug_think(void)
{
//Slowly kill the slug
self.health = self.health - 1;
//centerprint(self.owner,"Killing slug...\n");
return;
}
-
+
// Slug still alive, so we are still in the swamp
// Or we have exited it very recently.
// Do the damage and renew the timer.
self.nextthink = time + self.swamp_interval;
}
-void swamp_touch(void)
+void swamp_touch(void)
{
// If whatever thats touching the swamp is not a player
// or if its a dead player, just dont care abt it.
}
/*QUAKED spawnfunc_trigger_swamp (.5 .5 .5) ?
-Players gettin into the swamp will
+Players gettin into the swamp will
get slowd down and damaged
*/
void spawnfunc_trigger_swamp(void)
{
// Init stuff
EXACTTRIGGER_INIT;
- self.touch = swamp_touch;
+ self.touch = swamp_touch;
// Setup default keys, if missing
- if(self.dmg <= 0)
+ if(self.dmg <= 0)
self.dmg = 5;
- if(self.swamp_interval <= 0)
+ if(self.swamp_interval <= 0)
self.swamp_interval = 1;
- if(self.swamp_slowdown <= 0)
+ if(self.swamp_slowdown <= 0)
self.swamp_slowdown = 0.5;
}
if(head != player) \
if(head.takedamage) \
if(boxesoverlap(deathmin, deathmax, head.absmin, head.absmax))
-
+
float check_tdeath(entity player, vector org, vector telefragmin, vector telefragmax)
{
{
TDEATHLOOP(org)
{
- if not(teamplay && autocvar_g_telefrags_teamplay && head.team == player.team)
+ if (!(teamplay && autocvar_g_telefrags_teamplay && head.team == player.team))
if(IS_PLAYER(head))
if(head.health >= 1)
return 1;
{
if (IS_PLAYER(player) && player.health >= 1)
{
- if not(teamplay && autocvar_g_telefrags_teamplay && head.team == player.team)
+ if (!(teamplay && autocvar_g_telefrags_teamplay && head.team == player.team))
{
if(IS_PLAYER(head))
if(head.health >= 1)
vector locout;
entity e;
float p;
-
+
// Find the output teleporter
if(teleporter.enemy)
{
e = teleporter.enemy;
}
else
- {
+ {
RandomSelection_Init();
for(e = world; (e = find(e, targetname, teleporter.target)); )
{
}
if(!e) { sprint(player, "Teleport destination vanished. Sorry... please complain to the mapper.\n"); }
-
+
makevectors(e.mangle);
if(e.speed)
if(vlen(player.velocity) > e.speed)
player.velocity = normalize(player.velocity) * max(0, e.speed);
-
+
if(autocvar_g_teleport_maxspeed)
if(vlen(player.velocity) > autocvar_g_teleport_maxspeed)
player.velocity = normalize(player.velocity) * max(0, autocvar_g_teleport_maxspeed);
if (self.active != ACTIVE_ACTIVE)
return;
-
- if not(other.teleportable)
+
+ if (!other.teleportable)
return;
-
+
if(other.vehicle)
if(!other.vehicle.teleportable)
return;
-
+
if(other.turrcaps_flags & TFL_TURRCAPS_ISTURRET)
return;
-
+
if(other.deadflag != DEAD_NO)
return;
if(IS_PLAYER(other))
RemoveGrapplingHook(other);
-
+
entity e;
e = Simple_TeleportPlayer(self, other);
activator = other;
s = self.target; self.target = string_null;
SUB_UseTargets();
- if not(self.target) self.target = s;
+ if (!self.target) self.target = s;
oldself = self;
self = e;
return world;
}
-entity teleport_first;
+entity teleport_first;
.entity teleport_next;
void spawnfunc_trigger_teleport (void)
{
self.angles = '0 0 0';
EXACTTRIGGER_INIT;
-
- self.active = ACTIVE_ACTIVE;
-
+
+ self.active = ACTIVE_ACTIVE;
+
self.use = trigger_teleport_use;
// this must be called to spawn the teleport waypoints for bots
objerror ("Teleporter with no target");
return;
}
-
+
self.teleport_next = teleport_first;
teleport_first = self;
}
++c; // increase count to not include MYSELF
for(e = world; (e = findfloat(e, target_spawn_id, self.target_spawn_id)); --c)
;
-
+
// if c now is 0, we have AT LEAST the given count (maybe more), so don't spawn any more
if(c == 0)
return 0;
teamplay = 0;
serverflags &= ~SERVERFLAG_TEAMPLAY;
- if not(cvar_value_issafe(world.fog))
+ if (!cvar_value_issafe(world.fog))
{
print("The current map contains a potentially harmful fog setting, ignored\n");
world.fog = string_null;
have_team_spawns = -1; // request team spawns
MUTATOR_ADD(gamemode_nexball);
}
-
+
if(g_keepaway)
{
MUTATOR_ADD(gamemode_keepaway);
cb -= cbb * 0.999;
}
}
-
+
// keep teams alive (teams of size 0 always count as smaller, ignoring score)
if(ca < 1)
if(cb >= 1)
GetTeamCounts(world);
RandomSelection_Init();
-
+
t = 1;
if(TeamSmallerEqThanTeam(2, t, pl))
t = 2;
// Lead?
if (self.aim_flags & TFL_AIM_LEAD)
- {
+ {
if (self.aim_flags & TFL_AIM_SHOTTIMECOMPENSATE) // Need to conpensate for shot traveltime
{
// FIXME: this cant be the best way to do this..
prep = pre_pos + (self.enemy.velocity * (impact_time + mintime));
if(self.aim_flags & TFL_AIM_ZPREDICT)
- if not(self.enemy.flags & FL_ONGROUND)
+ if (!(self.enemy.flags & FL_ONGROUND))
if(self.enemy.movetype == MOVETYPE_WALK || self.enemy.movetype == MOVETYPE_TOSS || self.enemy.movetype == MOVETYPE_BOUNCE)
{
float vz;
else
pre_pos = pre_pos + self.enemy.velocity * mintime;
}
-
+
if(self.aim_flags & TFL_AIM_GROUNDGROUND)
{
//tracebox(pre_pos + '0 0 32',self.enemy.mins,self.enemy.maxs,pre_pos -'0 0 64',MOVE_WORLDONLY,self.enemy);
self.SendFlags |= TNSF_STATUS;
self.nextthink = time + 0.2;
self.think = turret_hide;
-
+
if (self.turret_diehook)
self.turret_diehook();
}
self.deadflag = DEAD_NO;
self.effects = EF_LOWPRECISION;
self.solid = SOLID_BBOX;
-
+
self.takedamage = DAMAGE_AIM;
self.event_damage = turret_stdproc_damage;
self.nextthink = time + self.ticrate;
self.think = turret_think;
-
+
self.SendFlags = TNSF_FULL_UPDATE;
if (self.turret_respawnhook)
return;
// Inactive turrets take no damage. (hm..)
- if not (self.active)
+ if (!self.active)
return;
if (teamplay)
{
self.tur_head.angles_x = self.tur_head.angles_x + (-0.5 + random()) * damage;
self.tur_head.angles_y = self.tur_head.angles_y + (-0.5 + random()) * damage;
-
+
self.SendFlags |= TNSF_ANG;
}
if (self.turrcaps_flags & TFL_TURRCAPS_MOVE)
self.velocity = self.velocity + vforce;
-
+
if (self.health <= 0)
{
self.event_damage = func_null;
self.nextthink = time;
self.think = turret_stdproc_die;
}
-
+
self.SendFlags |= TNSF_STATUS;
}
#define cvar_base "g_turrets_unit_"
.float clientframe;
void turrets_setframe(float _frame, float client_only)
-{
+{
if((client_only ? self.clientframe : self.frame ) != _frame)
{
self.SendFlags |= TNSF_ANIM;
self.anim_start_time = time;
}
-
+
if(client_only)
self.clientframe = _frame;
else
self.frame = _frame;
-
+
}
float turret_send(entity to, float sf)
{
-
- WriteByte(MSG_ENTITY, ENT_CLIENT_TURRET);
+
+ WriteByte(MSG_ENTITY, ENT_CLIENT_TURRET);
WriteByte(MSG_ENTITY, sf);
if(sf & TNSF_SETUP)
{
WriteByte(MSG_ENTITY, self.turret_type);
-
+
WriteCoord(MSG_ENTITY, self.origin_x);
WriteCoord(MSG_ENTITY, self.origin_y);
WriteCoord(MSG_ENTITY, self.origin_z);
-
+
WriteAngle(MSG_ENTITY, self.angles_x);
WriteAngle(MSG_ENTITY, self.angles_y);
}
-
+
if(sf & TNSF_ANG)
{
WriteShort(MSG_ENTITY, rint(self.tur_head.angles_x));
WriteShort(MSG_ENTITY, rint(self.tur_head.angles_y));
}
-
+
if(sf & TNSF_AVEL)
- {
+ {
WriteShort(MSG_ENTITY, rint(self.tur_head.avelocity_x));
WriteShort(MSG_ENTITY, rint(self.tur_head.avelocity_y));
}
-
+
if(sf & TNSF_MOVE)
{
WriteShort(MSG_ENTITY, rint(self.origin_x));
WriteShort(MSG_ENTITY, rint(self.velocity_x));
WriteShort(MSG_ENTITY, rint(self.velocity_y));
- WriteShort(MSG_ENTITY, rint(self.velocity_z));
-
- WriteShort(MSG_ENTITY, rint(self.angles_y));
+ WriteShort(MSG_ENTITY, rint(self.velocity_z));
+
+ WriteShort(MSG_ENTITY, rint(self.angles_y));
}
-
+
if(sf & TNSF_ANIM)
{
WriteCoord(MSG_ENTITY, self.anim_start_time);
WriteByte(MSG_ENTITY, self.frame);
}
-
+
if(sf & TNSF_STATUS)
{
WriteByte(MSG_ENTITY, self.team);
-
+
if(self.health <= 0)
WriteByte(MSG_ENTITY, 0);
else
WriteByte(MSG_ENTITY, ceil((self.health / self.tur_health) * 255));
}
-
+
return TRUE;
}
if (ent == world)
return;
- if not (ent.turret_scale_damage) ent.turret_scale_damage = 1;
- if not (ent.turret_scale_range) ent.turret_scale_range = 1;
- if not (ent.turret_scale_refire) ent.turret_scale_refire = 1;
- if not (ent.turret_scale_ammo) ent.turret_scale_ammo = 1;
- if not (ent.turret_scale_aim) ent.turret_scale_aim = 1;
- if not (ent.turret_scale_health) ent.turret_scale_health = 1;
- if not (ent.turret_scale_respawn) ent.turret_scale_respawn = 1;
+ if (!ent.turret_scale_damage) ent.turret_scale_damage = 1;
+ if (!ent.turret_scale_range) ent.turret_scale_range = 1;
+ if (!ent.turret_scale_refire) ent.turret_scale_refire = 1;
+ if (!ent.turret_scale_ammo) ent.turret_scale_ammo = 1;
+ if (!ent.turret_scale_aim) ent.turret_scale_aim = 1;
+ if (!ent.turret_scale_health) ent.turret_scale_health = 1;
+ if (!ent.turret_scale_respawn) ent.turret_scale_respawn = 1;
sbase = strcat(cvar_base,unitname);
if (is_reload)
void turret_projectile_explode()
{
-
+
self.takedamage = DAMAGE_NO;
- self.event_damage = func_null;
+ self.event_damage = func_null;
#ifdef TURRET_DEBUG
float d;
d = RadiusDamage (self, self.owner, self.owner.shot_dmg, 0, self.owner.shot_radius, self, self.owner.shot_force, self.totalfrags, world);
proj.owner = self;
proj.realowner = self;
proj.bot_dodge = TRUE;
- proj.bot_dodgerating = self.shot_dmg;
+ proj.bot_dodgerating = self.shot_dmg;
proj.think = turret_projectile_explode;
proj.touch = turret_projectile_touch;
- proj.nextthink = time + 9;
+ proj.nextthink = time + 9;
proj.movetype = MOVETYPE_FLYMISSILE;
- proj.velocity = normalize(self.tur_shotdir_updated + randomvec() * self.shot_spread) * self.shot_speed;
+ proj.velocity = normalize(self.tur_shotdir_updated + randomvec() * self.shot_spread) * self.shot_speed;
proj.flags = FL_PROJECTILE;
proj.enemy = self.enemy;
proj.totalfrags = _death;
proj.flags |= FL_NOTARGET;
CSQCProjectile(proj, _cli_anim, _proj_type, _cull);
-
+
return proj;
}
}
else*/
tracebox(self.tur_shotorg, '-1 -1 -1','1 1 1', self.tur_shotorg + (self.tur_shotdir_updated * self.tur_dist_aimpos), MOVE_NORMAL,self);
-
- self.tur_dist_impact_to_aimpos = vlen(trace_endpos - self.tur_aimpos) - (vlen(self.enemy.maxs - self.enemy.mins) * 0.5);
+
+ self.tur_dist_impact_to_aimpos = vlen(trace_endpos - self.tur_aimpos) - (vlen(self.enemy.maxs - self.enemy.mins) * 0.5);
self.tur_impactent = trace_ent;
self.tur_impacttime = vlen(self.tur_shotorg - trace_endpos) / self.shot_speed;
vector v1, v2;
v1 = self.tur_head.angles;
v2 = self.tur_head.avelocity;
-
+
if (self.track_flags == TFL_TRACK_NO)
return;
- if not (self.active)
+ if (!self.active)
target_angle = self.idle_aim - ('1 0 0' * self.aim_maxpitch);
else if (self.enemy == world)
{
}
else
{
- target_angle = vectoangles(normalize(self.tur_aimpos - self.tur_shotorg));
+ target_angle = vectoangles(normalize(self.tur_aimpos - self.tur_shotorg));
}
-
+
self.tur_head.angles_x = anglemods(self.tur_head.angles_x);
self.tur_head.angles_y = anglemods(self.tur_head.angles_y);
// Find the diffrence between where we currently aim and where we want to aim
//move_angle = target_angle - (self.angles + self.tur_head.angles);
//move_angle = shortangle_vxy(move_angle,(self.angles + self.tur_head.angles));
-
- move_angle = AnglesTransform_ToAngles(AnglesTransform_LeftDivide(AnglesTransform_FromAngles(self.angles), AnglesTransform_FromAngles(target_angle))) - self.tur_head.angles;
+
+ move_angle = AnglesTransform_ToAngles(AnglesTransform_LeftDivide(AnglesTransform_FromAngles(self.angles), AnglesTransform_FromAngles(target_angle))) - self.tur_head.angles;
move_angle = shortangle_vxy(move_angle, self.tur_head.angles);
switch(self.track_type)
if(self.tur_head.angles_y < -self.aim_maxrot)
self.tur_head.angles_y = self.aim_maxrot;
}
-
+
// CSQC
self.SendFlags |= TNSF_ANG;
-
+
return;
case TFL_TRACKTYPE_FLUIDINERTIA:
{
self.tur_head.avelocity_x = 0;
self.tur_head.angles_x = self.aim_maxpitch;
-
+
self.SendFlags |= TNSF_ANG;
}
-
+
if((self.tur_head.angles_x + self.tur_head.avelocity_x * self.ticrate) < -self.aim_maxpitch)
{
self.tur_head.avelocity_x = 0;
self.tur_head.angles_x = -self.aim_maxpitch;
-
+
self.SendFlags |= TNSF_ANG;
}
}
{
self.tur_head.avelocity_y = 0;
self.tur_head.angles_y = self.aim_maxrot;
-
+
self.SendFlags |= TNSF_ANG;
}
{
self.tur_head.avelocity_y = 0;
self.tur_head.angles_y = -self.aim_maxrot;
-
+
self.SendFlags |= TNSF_ANG;
}
}
-
+
self.SendFlags |= TNSF_AVEL;
-
+
// Force a angle update every 10'th frame
self.turret_framecounter += 1;
if(self.turret_framecounter >= 10)
- {
+ {
self.SendFlags |= TNSF_ANG;
self.turret_framecounter = 0;
- }
+ }
}
float turret_stdproc_firecheck()
{
// This one just dont care =)
- if (self.firecheck_flags & TFL_FIRECHECK_NO)
+ if (self.firecheck_flags & TFL_FIRECHECK_NO)
return 1;
if (self.enemy == world)
if (self.shoot_flags & TFL_SHOOT_VOLLYALWAYS)
if (self.volly_counter != self.shot_volly)
if(self.ammo >= self.shot_dmg)
- return 1;
+ return 1;
// Lack of zombies makes shooting dead things unnecessary :P
if (self.firecheck_flags & TFL_FIRECHECK_DEAD)
if (self.firecheck_flags & TFL_FIRECHECK_OTHER_AMMO)
if (self.enemy.ammo >= self.enemy.ammo_max)
return 0;
-
+
// Target of opertunity?
if(turret_validate_target(self, self.tur_impactent, self.target_validate_flags) > 0)
{
self.enemy = self.tur_impactent;
return 1;
- }
+ }
if (self.firecheck_flags & TFL_FIRECHECK_DISTANCES)
{
// To close?
if (self.tur_dist_aimpos < self.target_range_min)
- if(turret_validate_target(self, self.tur_impactent, self.target_validate_flags) > 0)
+ if(turret_validate_target(self, self.tur_impactent, self.target_validate_flags) > 0)
return 1; // Target of opertunity?
- else
- return 0;
+ else
+ return 0;
}
// Try to avoid FF?
float turret_validate_target(entity e_turret, entity e_target, float validate_flags)
{
vector v_tmp;
-
+
//if(!validate_flags & TFL_TARGETSELECT_NOBUILTIN)
// return -0.5;
if(e_target.owner == e_turret)
return -0.5;
- if not(checkpvs(e_target.origin, e_turret))
- return -1;
+ if (!checkpvs(e_target.origin, e_turret))
+ return -1;
- if not (e_target)
+ if (!e_target)
return -2;
if(g_onslaught)
return -5;
// Cant touch this
- if(e_target.vehicle_flags & VHF_ISVEHICLE)
+ if(e_target.vehicle_flags & VHF_ISVEHICLE)
{
if (e_target.vehicle_health <= 0)
return -6;
// player
if (IS_CLIENT(e_target))
{
- if not (validate_flags & TFL_TARGETSELECT_PLAYERS)
+ if (!(validate_flags & TFL_TARGETSELECT_PLAYERS))
return -7;
if (e_target.deadflag != DEAD_NO)
// Missile
if (e_target.flags & FL_PROJECTILE)
- if not (validate_flags & TFL_TARGETSELECT_MISSILES)
+ if (!(validate_flags & TFL_TARGETSELECT_MISSILES))
return -10;
if (validate_flags & TFL_TARGETSELECT_MISSILESONLY)
- if not (e_target.flags & FL_PROJECTILE)
+ if (!(e_target.flags & FL_PROJECTILE))
return -10.5;
// Team check
e = findradius(self.origin, self.target_range);
// Nothing to aim at?
- if (!e)
+ if (!e)
return world;
while (e)
entity e;
self.nextthink = time + self.ticrate;
-
+
// ONS uses somewhat backwards linking.
if (teamplay)
{
#endif
// Handle ammo
- if not (self.spawnflags & TSF_NO_AMMO_REGEN)
+ if (!(self.spawnflags & TSF_NO_AMMO_REGEN))
if (self.ammo < self.ammo_max)
self.ammo = min(self.ammo + self.ammo_recharge, self.ammo_max);
-
+
// Inactive turrets needs to run the think loop,
// So they can handle animation and wake up if need be.
- if not (self.active)
+ if (!self.active)
{
turret_stdproc_track();
return;
// This one is doing something.. oddball. assume its handles what needs to be handled.
// Predict?
- if not(self.aim_flags & TFL_AIM_NO)
+ if (!(self.aim_flags & TFL_AIM_NO))
self.tur_aimpos = turret_stdproc_aim_generic();
// Turn & pitch?
- if not(self.track_flags & TFL_TRACK_NO)
+ if (!(self.track_flags & TFL_TRACK_NO))
turret_stdproc_track();
turret_do_updates(self);
if(self.volly_counter != self.shot_volly)
{
// Predict or whatnot
- if not(self.aim_flags & TFL_AIM_NO)
+ if (!(self.aim_flags & TFL_AIM_NO))
self.tur_aimpos = turret_stdproc_aim_generic();
// Turn & pitch
- if not(self.track_flags & TFL_TRACK_NO)
+ if (!(self.track_flags & TFL_TRACK_NO))
turret_stdproc_track();
turret_do_updates(self);
if (self.enemy == world)
{
// Turn & pitch
- if not(self.track_flags & TFL_TRACK_NO)
+ if (!(self.track_flags & TFL_TRACK_NO))
turret_stdproc_track();
// do any per-turret stuff
self.lip = time + autocvar_g_turrets_aimidle_delay; // Keep track of the last time we had a target.
// Predict?
- if not(self.aim_flags & TFL_AIM_NO)
+ if (!(self.aim_flags & TFL_AIM_NO))
self.tur_aimpos = turret_stdproc_aim_generic();
// Turn & pitch?
- if not(self.track_flags & TFL_TRACK_NO)
+ if (!(self.track_flags & TFL_TRACK_NO))
turret_stdproc_track();
turret_do_updates(self);
// Are turrets allowed?
if (autocvar_g_turrets == 0)
return 0;
-
+
if(_turret_type < 1 || _turret_type > TID_LAST)
{
dprint("Invalid / Unkown turret type\"", ftos(_turret_type), "\", aborting!\n");
return 0;
- }
+ }
self.turret_type = _turret_type;
-
+
e = find(world, classname, "turret_manager");
- if not (e)
+ if (!e)
{
e = spawn();
e.classname = "turret_manager";
e.think = turrets_manager_think;
e.nextthink = time + 2;
}
-
- if not (self.spawnflags & TSF_SUSPENDED)
+
+ if (!(self.spawnflags & TSF_SUSPENDED))
builtin_droptofloor(); // why can't we use regular droptofloor here?
// Terrainbase spawnflag. This puts a enlongated model
load_unit_settings(self, self.cvar_basename, 0);
self.effects = EF_NODRAW;
-
+
// Handle turret teams.
- if not (teamplay)
+ if (!teamplay)
self.team = MAX_SHOT_DISTANCE; // Group all turrets into the same team, so they dont kill eachother.
else if(g_onslaught && self.targetname)
{
* if it hits a glitch in my logic :P so try to set as mutch
* as possible beforehand.
*/
- if not(self.ticrate)
- {
+ if (!self.ticrate)
+ {
if (self.turrcaps_flags & TFL_TURRCAPS_SUPPORT)
self.ticrate = 0.2; // Support units generaly dont need to have a high speed ai-loop
else
self.ticrate = 0.1; // 10 fps for normal turrets
}
-
+
self.ticrate = bound(sys_frametime, self.ticrate, 60); // keep it sane
// General stuff
if (self.netname == "")
self.netname = self.classname;
- if not (self.respawntime)
+ if (!self.respawntime)
self.respawntime = 60;
self.respawntime = max(-1, self.respawntime);
- if not (self.health)
+ if (!self.health)
self.health = 1000;
self.tur_health = max(1, self.health);
- if not (self.turrcaps_flags)
+ if (!self.turrcaps_flags)
self.turrcaps_flags = TFL_TURRCAPS_RADIUSDMG | TFL_TURRCAPS_MEDPROJ | TFL_TURRCAPS_PLAYERKILL;
- if not (self.damage_flags)
+ if (!self.damage_flags)
self.damage_flags = TFL_DMG_YES | TFL_DMG_RETALIATE | TFL_DMG_AIMSHAKE;
// Shot stuff.
- if not (self.shot_refire)
+ if (!self.shot_refire)
self.shot_refire = 1;
self.shot_refire = bound(0.01, self.shot_refire, 9999);
- if not (self.shot_dmg)
+ if (!self.shot_dmg)
self.shot_dmg = self.shot_refire * 50;
self.shot_dmg = max(1, self.shot_dmg);
- if not (self.shot_radius)
+ if (!self.shot_radius)
self.shot_radius = self.shot_dmg * 0.5;
self.shot_radius = max(1, self.shot_radius);
- if not (self.shot_speed)
+ if (!self.shot_speed)
self.shot_speed = 2500;
self.shot_speed = max(1, self.shot_speed);
- if not (self.shot_spread)
+ if (!self.shot_spread)
self.shot_spread = 0.0125;
self.shot_spread = bound(0.0001, self.shot_spread, 500);
- if not (self.shot_force)
+ if (!self.shot_force)
self.shot_force = self.shot_dmg * 0.5 + self.shot_radius * 0.5;
self.shot_force = bound(0.001, self.shot_force, 5000);
- if not (self.shot_volly)
+ if (!self.shot_volly)
self.shot_volly = 1;
self.shot_volly = bound(1, self.shot_volly, floor(self.ammo_max / self.shot_dmg));
- if not (self.shot_volly_refire)
+ if (!self.shot_volly_refire)
self.shot_volly_refire = self.shot_refire * self.shot_volly;
self.shot_volly_refire = bound(self.shot_refire, self.shot_volly_refire, 60);
- if not (self.firecheck_flags)
+ if (!self.firecheck_flags)
self.firecheck_flags = TFL_FIRECHECK_DEAD | TFL_FIRECHECK_DISTANCES |
TFL_FIRECHECK_LOS | TFL_FIRECHECK_AIMDIST | TFL_FIRECHECK_TEAMCECK |
TFL_FIRECHECK_OWM_AMMO | TFL_FIRECHECK_REFIRE;
// Range stuff.
- if not (self.target_range)
+ if (!self.target_range)
self.target_range = self.shot_speed * 0.5;
self.target_range = bound(0, self.target_range, MAX_SHOT_DISTANCE);
- if not (self.target_range_min)
+ if (!self.target_range_min)
self.target_range_min = self.shot_radius * 2;
self.target_range_min = bound(0, self.target_range_min, MAX_SHOT_DISTANCE);
- if not (self.target_range_optimal)
+ if (!self.target_range_optimal)
self.target_range_optimal = self.target_range * 0.5;
self.target_range_optimal = bound(0, self.target_range_optimal, MAX_SHOT_DISTANCE);
// Aim stuff.
- if not (self.aim_maxrot)
+ if (!self.aim_maxrot)
self.aim_maxrot = 90;
self.aim_maxrot = bound(0, self.aim_maxrot, 360);
- if not (self.aim_maxpitch)
+ if (!self.aim_maxpitch)
self.aim_maxpitch = 20;
self.aim_maxpitch = bound(0, self.aim_maxpitch, 90);
- if not (self.aim_speed)
+ if (!self.aim_speed)
self.aim_speed = 36;
self.aim_speed = bound(0.1, self.aim_speed, 1000);
- if not (self.aim_firetolerance_dist)
+ if (!self.aim_firetolerance_dist)
self.aim_firetolerance_dist = 5 + (self.shot_radius * 2);
self.aim_firetolerance_dist = bound(0.1, self.aim_firetolerance_dist, MAX_SHOT_DISTANCE);
- if not (self.aim_flags)
+ if (!self.aim_flags)
{
self.aim_flags = TFL_AIM_LEAD | TFL_AIM_SHOTTIMECOMPENSATE;
if(self.turrcaps_flags & TFL_TURRCAPS_RADIUSDMG)
self.aim_flags |= TFL_AIM_GROUNDGROUND;
}
- if not (self.track_type)
+ if (!self.track_type)
self.track_type = TFL_TRACKTYPE_STEPMOTOR;
if (self.track_type != TFL_TRACKTYPE_STEPMOTOR)
// Fluid / Ineria mode. Looks mutch nicer.
// Can reduce aim preformance alot, needs a bit diffrent aimspeed
- if not (self.aim_speed)
+ if (!self.aim_speed)
self.aim_speed = 180;
self.aim_speed = bound(0.1, self.aim_speed, 1000);
- if not (self.track_accel_pitch)
+ if (!self.track_accel_pitch)
self.track_accel_pitch = 0.5;
- if not (self.track_accel_rot)
+ if (!self.track_accel_rot)
self.track_accel_rot = 0.5;
- if not (self.track_blendrate)
+ if (!self.track_blendrate)
self.track_blendrate = 0.35;
}
// Target selection stuff.
- if not (self.target_select_rangebias)
+ if (!self.target_select_rangebias)
self.target_select_rangebias = 1;
self.target_select_rangebias = bound(-10, self.target_select_rangebias, 10);
- if not (self.target_select_samebias)
+ if (!self.target_select_samebias)
self.target_select_samebias = 1;
self.target_select_samebias = bound(-10, self.target_select_samebias, 10);
- if not (self.target_select_anglebias)
+ if (!self.target_select_anglebias)
self.target_select_anglebias = 1;
self.target_select_anglebias = bound(-10, self.target_select_anglebias, 10);
- if not (self.target_select_missilebias)
+ if (!self.target_select_missilebias)
self.target_select_missilebias = -10;
self.target_select_missilebias = bound(-10, self.target_select_missilebias, 10);
self.target_select_playerbias = bound(-10, self.target_select_playerbias, 10);
- if not (self.target_select_flags)
+ if (!self.target_select_flags)
{
self.target_select_flags = TFL_TARGETSELECT_LOS | TFL_TARGETSELECT_TEAMCHECK
| TFL_TARGETSELECT_RANGELIMTS | TFL_TARGETSELECT_ANGLELIMITS;
self.target_validate_flags = self.target_select_flags;
// Ammo stuff
- if not (self.ammo_max)
+ if (!self.ammo_max)
self.ammo_max = self.shot_dmg * 10;
self.ammo_max = max(self.shot_dmg, self.ammo_max);
- if not (self.ammo)
+ if (!self.ammo)
self.ammo = self.shot_dmg * 5;
self.ammo = bound(0,self.ammo, self.ammo_max);
- if not (self.ammo_recharge)
+ if (!self.ammo_recharge)
self.ammo_recharge = self.shot_dmg * 0.5;
self.ammo_recharge = max(0 ,self.ammo_recharge);
// Convert the recharge from X per sec to X per ticrate
self.ammo_recharge = self.ammo_recharge * self.ticrate;
- if not (self.ammo_flags)
+ if (!self.ammo_flags)
self.ammo_flags = TFL_AMMO_ENERGY | TFL_AMMO_RECHARGE;
// Damage stuff
if(self.spawnflags & TSL_NO_RESPAWN)
- if not (self.damage_flags & TFL_DMG_DEATH_NORESPAWN)
+ if (!(self.damage_flags & TFL_DMG_DEATH_NORESPAWN))
self.damage_flags |= TFL_DMG_DEATH_NORESPAWN;
// Offsets & origins
if (!self.tur_shotorg) self.tur_shotorg = '50 0 50';
-
+
if (!self.health)
self.health = 150;
self.tur_head.movetype = MOVETYPE_NOCLIP;
// Defend mode?
- if not (self.tur_defend)
+ if (!self.tur_defend)
if (self.target != "")
{
self.tur_defend = find(world, targetname, self.target);
self.turret_firecheckfunc = turret_stdproc_firecheck;
self.turret_firefunc = turret_stdproc_fire;
self.event_damage = turret_stdproc_damage;
-
+
if (self.turrcaps_flags & TFL_TURRCAPS_SUPPORT)
self.turret_score_target = turret_stdproc_targetscore_support;
else
activator = ee;
self.use();
}
-
+
turret_link();
- turret_stdproc_respawn();
+ turret_stdproc_respawn();
turret_tag_fire_update();
-
+
return 1;
}
float anglemods(float v)
{
v = v - 360 * floor(v / 360);
-
+
if(v >= 180)
return v - 360;
else if(v <= -180)
return v + 360;
- else
+ else
return v;
}
vector angleofs(entity from, entity to)
{
vector v_res;
-
+
v_res = normalize(to.origin - from.origin);
v_res = vectoangles(v_res);
v_res = v_res - from.angles;
vector angleofs3(vector from, vector from_a, entity to)
{
vector v_res;
-
+
v_res = normalize(to.origin - from);
v_res = vectoangles(v_res);
v_res = v_res - from_a;
}
/*
-* Railgun-like beam, but has thickness and suppots slowing of target
+* Railgun-like beam, but has thickness and suppots slowing of target
*/
void FireImoBeam (vector start, vector end, vector smin, vector smax,
float bforce, float f_dmg, float f_velfactor, float deathtype)
e.colormod = v_color;
SUB_SetFade(e,time,f_time);
}
-#endif
+#endif
{
if(self.enemy)
te_lightning1(self,self.origin, self.enemy.origin);
-
+
self.nextthink = time + 0.25;
}
#endif
{
setorigin(self,self.origin);
self.think = turret_checkpoint_init;
- self.nextthink = time + 0.2;
+ self.nextthink = time + 0.2;
}
// Compat.
{
float i;
entity _mis;
-
+
for (i = 0; i < 1; ++i)
{
turret_do_updates(self);
- _mis = turret_projectile("weapons/lasergun_fire.wav", 1, 0, DEATH_TURRET_EWHEEL, PROJECTILE_LASER, TRUE, TRUE);
+ _mis = turret_projectile("weapons/lasergun_fire.wav", 1, 0, DEATH_TURRET_EWHEEL, PROJECTILE_LASER, TRUE, TRUE);
_mis.missile_flags = MIF_SPLASH;
pointparticles(particleeffectnum("laser_muzzleflash"), self.tur_shotorg, self.tur_shotdir_updated * 1000, 1);
self.pathcurrent = self.pathcurrent.path_next;
#else
- if (vlen(self.origin - self.pathcurrent.origin) < 64)
+ if (vlen(self.origin - self.pathcurrent.origin) < 64)
self.pathcurrent = self.pathcurrent.enemy;
#endif
{
float newframe;
-
+
self.steerto = steerlib_arrive(self.enemy.origin,self.target_range_optimal);
//self.steerto = steerlib_standoff(self.enemy.origin,self.target_range_optimal);
newframe = ewheel_amin_stop;
movelib_beak_simple(autocvar_g_turrets_unit_ewheel_speed_stop);
}
-
+
turrets_setframe(newframe , FALSE);
-
+
/*if(self.frame != newframe)
{
self.frame = newframe;
self.velocity_z = vz;
-
+
if(vlen(self.velocity))
self.SendFlags |= TNSF_MOVE;
}
// Respawn is called & first spawn to, to set team. need to make sure we do not move the initial spawn.
if(self.movetype != MOVETYPE_WALK)
return;
-
+
self.velocity = '0 0 0';
self.enemy = world;
{
entity e;
- if (self.netname == "")
+ if (self.netname == "")
self.netname = "eWheel Turret";
if (self.target != "")
remove(self);
return;
}
-
+
self.frame = 1;
self.target_select_flags = TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_RANGELIMTS | TFL_TARGETSELECT_TEAMCHECK | TFL_TARGETSELECT_LOS;
self.target_validate_flags = TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_RANGELIMTS | TFL_TARGETSELECT_TEAMCHECK | TFL_TARGETSELECT_LOS;
if(self.enemy != world)
if(vlen(self.origin - self.enemy.origin) < self.owner.shot_radius * 3)
setorigin(self,self.enemy.origin + randomvec() * self.owner.shot_radius);
-
+
#ifdef TURRET_DEBUG
float d;
d = RadiusDamage (self, self.owner, self.owner.shot_dmg, self.owner.shot_dmg, self.owner.shot_radius, self, self.owner.shot_force, self.totalfrags, world);
entity proj;
turret_tag_fire_update();
-
- proj = turret_projectile("weapons/hagar_fire.wav", 5, 0, DEATH_TURRET_FLAC, PROJECTILE_HAGAR, TRUE, TRUE);
+
+ proj = turret_projectile("weapons/hagar_fire.wav", 5, 0, DEATH_TURRET_FLAC, PROJECTILE_HAGAR, TRUE, TRUE);
pointparticles(particleeffectnum("laser_muzzleflash"), self.tur_shotorg, self.tur_shotdir_updated * 1000, 1);
proj.think = turret_flac_projectile_think_explode;
proj.nextthink = time + self.tur_impacttime + (random() * 0.01 - random() * 0.01);
proj.missile_flags = MIF_SPLASH | MIF_PROXY;
-
+
self.tur_head.frame = self.tur_head.frame + 1;
- if (self.tur_head.frame >= 4)
+ if (self.tur_head.frame >= 4)
self.tur_head.frame = 0;
}
void turret_flac_dinit()
{
- if (self.netname == "")
+ if (self.netname == "")
self.netname = "FLAC Cannon";
self.turrcaps_flags = TFL_TURRCAPS_RADIUSDMG | TFL_TURRCAPS_FASTPROJ | TFL_TURRCAPS_MISSILEKILL;
self.ammo_flags = TFL_AMMO_ROCKETS | TFL_AMMO_RECHARGE;
self.aim_flags = TFL_AIM_LEAD | TFL_AIM_SHOTTIMECOMPENSATE;
-
+
if (turret_stdproc_init("flac_std", "models/turrets/base.md3", "models/turrets/flac.md3", TID_FLAC) == 0)
{
remove(self);
self.damage_flags |= TFL_DMG_HEADSHAKE;
self.target_select_flags |= TFL_TARGETSELECT_NOTURRETS | TFL_TARGETSELECT_MISSILESONLY;
-
+
// Our fire routine
self.turret_firefunc = turret_flac_attack;
**/
float turret_fusionreactor_firecheck()
{
- if (self.attack_finished_single > time)
+ if (self.attack_finished_single > time)
return 0;
if (self.enemy.deadflag != DEAD_NO)
if (self.enemy.ammo >= self.enemy.ammo_max)
return 0;
-
+
if (vlen(self.enemy.origin - self.origin) > self.target_range)
- return 0;
-
+ return 0;
+
if(self.team != self.enemy.team)
return 0;
-
- if not (self.enemy.ammo_flags & TFL_AMMO_ENERGY)
- return 0;
-
+
+ if (!(self.enemy.ammo_flags & TFL_AMMO_ENERGY))
+ return 0;
+
return 1;
}
void turret_hellion_attack()
{
entity missile;
-
+
if(self.tur_head.frame != 0)
self.tur_shotorg = gettaginfo(self.tur_head, gettagindex(self.tur_head, "tag_fire"));
else
self.tur_shotorg = gettaginfo(self.tur_head, gettagindex(self.tur_head, "tag_fire2"));
-
+
missile = turret_projectile("weapons/rocket_fire.wav", 6, 10, DEATH_TURRET_HELLION, PROJECTILE_ROCKET, FALSE, FALSE);
te_explosion (missile.origin);
missile.think = turret_hellion_missile_think;
missile.cnt = time + 30;
missile.ticrate = max(autocvar_sys_ticrate, 0.05);
missile.missile_flags = MIF_SPLASH | MIF_PROXY | MIF_GUIDED_AI;
-
+
if (self.tur_head.frame == 0)
self.tur_head.frame = self.tur_head.frame + 1;
void turret_hk_dinit()
{
- if (self.netname == "")
+ if (self.netname == "")
self.netname = "Hunter-killer turret";
self.turrcaps_flags = TFL_TURRCAPS_RADIUSDMG | TFL_TURRCAPS_MEDPROJ | TFL_TURRCAPS_PLAYERKILL | TFL_TURRCAPS_RECIVETARGETS;
//.float bulletcounter;
void turret_machinegun_attack()
{
- fireBallisticBullet (self.tur_shotorg, self.tur_shotdir_updated,self.shot_spread, self.shot_speed, 5, self.shot_dmg, self.shot_force, DEATH_TURRET_MACHINEGUN, 0, 1, autocvar_g_balance_uzi_bulletconstant);
+ fireBallisticBullet (self.tur_shotorg, self.tur_shotdir_updated,self.shot_spread, self.shot_speed, 5, self.shot_dmg, self.shot_force, DEATH_TURRET_MACHINEGUN, 0, autocvar_g_balance_uzi_bulletconstant);
endFireBallisticBullet();
UziFlash();
self.ammo_flags = TFL_AMMO_BULLETS | TFL_AMMO_RECHARGE | TFL_AMMO_RECIVE;
self.turrcaps_flags = TFL_TURRCAPS_PLAYERKILL;
self.aim_flags = TFL_AIM_LEAD | TFL_AIM_SHOTTIMECOMPENSATE;
-
- if not (autocvar_g_antilag_bullets)
- self.turrcaps_flags |= TFL_TURRCAPS_HITSCAN;
+
+ self.turrcaps_flags |= TFL_TURRCAPS_HITSCAN;
if (turret_stdproc_init("machinegun_std", "models/turrets/base.md3", "models/turrets/machinegun.md3", TID_MACHINEGUN) == 0)
{
void turret_mlrs_attack()
{
entity missile;
-
- turret_tag_fire_update();
+
+ turret_tag_fire_update();
missile = turret_projectile("weapons/rocket_fire.wav", 6, 10, DEATH_TURRET_MLRS, PROJECTILE_ROCKET, TRUE, TRUE);
missile.nextthink = time + max(self.tur_impacttime,(self.shot_radius * 2) / self.shot_speed);
missile.missile_flags = MIF_SPLASH;
- te_explosion (missile.origin);
+ te_explosion (missile.origin);
}
void turret_mlrs_dinit()
{
float flying;
flying = IsFlying(self); // do this BEFORE to make the trace values from FireRailgunBullet last
-
+
FireRailgunBullet (self.tur_shotorg, self.tur_shotorg + self.tur_shotdir_updated * MAX_SHOT_DISTANCE, 10000000000,
800, 0, 0, 0, 0, DEATH_TURRET_PLASMA);
}
void turret_plasma_attack()
-{
- entity missile = turret_projectile("weapons/hagar_fire.wav", 1, 0, DEATH_TURRET_PLASMA, PROJECTILE_ELECTRO_BEAM, TRUE, TRUE);
+{
+ entity missile = turret_projectile("weapons/hagar_fire.wav", 1, 0, DEATH_TURRET_PLASMA, PROJECTILE_ELECTRO_BEAM, TRUE, TRUE);
missile.missile_flags = MIF_SPLASH;
-
+
pointparticles(particleeffectnum("laser_muzzleflash"), self.tur_shotorg, self.tur_shotdir_updated * 1000, 1);
if (self.tur_head.frame == 0)
self.tur_head.frame = 1;
void turret_plasma_dual_attack()
{
- entity missile = turret_projectile("weapons/hagar_fire.wav", 1, 0, DEATH_TURRET_PLASMA, PROJECTILE_ELECTRO_BEAM, TRUE, TRUE);
- missile.missile_flags = MIF_SPLASH;
+ entity missile = turret_projectile("weapons/hagar_fire.wav", 1, 0, DEATH_TURRET_PLASMA, PROJECTILE_ELECTRO_BEAM, TRUE, TRUE);
+ missile.missile_flags = MIF_SPLASH;
pointparticles(particleeffectnum("laser_muzzleflash"), self.tur_shotorg, self.tur_shotdir_updated * 1000, 1);
self.tur_head.frame += 1;
}
}
if (etarget)
- {
+ {
te_csqc_lightningarc(from.origin,etarget.origin);
Damage(etarget, self, self, damage, DEATH_TURRET_TESLA, etarget.origin, '0 0 0');
etarget.railgunhit = 1;
{
// g_turrets_targetscan_maxdelay forces a target re-scan at least this often
float do_target_scan = 0;
-
+
if((self.target_select_time + autocvar_g_turrets_targetscan_maxdelay) < time)
do_target_scan = 1;
self.target_select_time = time;
}
- if not (turret_stdproc_firecheck())
+ if (!turret_stdproc_firecheck())
return 0;
if(self.enemy)
void turret_tesla_postthink()
{
- if not (self.active)
+ if (!self.active)
{
self.tur_head.avelocity = '0 0 0';
return;
{
vector where;
entity e;
-
+
makevectors(self.angles);
where = self.origin + v_forward * 128;
e = findradius(where,32);
- while (e)
+ while (e)
{
if (turret_validate_target(self, e, self.target_validate_flags))
if (e != self && e.owner != self)
{
self.health = self.health - damage;
self.velocity = self.velocity + vforce;
-
+
if (self.health <= 0)
W_PrepareExplosionByDamage(self.owner, walker_rocket_explode);
}
void walker_fire_rocket(vector org)
{
entity rocket;
-
+
fixedmakevectors(self.angles);
te_explosion (org);
rocket.tur_shotorg = randomvec() * 512;
rocket.cnt = time + 1;
rocket.enemy = self.enemy;
-
+
if (random() < 0.01)
rocket.think = walker_rocket_loop;
else
rocket.solid = SOLID_BBOX;
rocket.tur_health = time + 9;
rocket.missile_flags = MIF_SPLASH | MIF_PROXY | MIF_GUIDED_HEAT;
-
+
CSQCProjectile(rocket, FALSE, PROJECTILE_ROCKET, FALSE); // no culling, has fly sound
}
if(self.enemy)
{
self.enemy_last_loc = _target;
- self.enemy_last_time = time;
+ self.enemy_last_time = time;
}
}
walker_move_to(self.moveto, 0);
#else
- if (vlen(self.origin - self.pathcurrent.origin) < 64)
+ if (vlen(self.origin - self.pathcurrent.origin) < 64)
self.pathcurrent = self.pathcurrent.enemy;
-
+
if(!self.pathcurrent)
return;
-
+
self.moveto = self.pathcurrent.origin;
self.steerto = steerlib_attract2(self.moveto, 0.5, 500, 0.95);
walker_move_to(self.moveto, 0);
{
if(vlen(self.origin - self.enemy_last_loc) < 128 || time - self.enemy_last_time > 10)
self.enemy_last_time = 0;
- else
+ else
walker_move_to(self.enemy_last_loc, 0);
}
else
- {
+ {
if(self.animflag != ANIM_NO)
- {
+ {
traceline(self.origin + '0 0 64', self.origin + '0 0 64' + v_forward * 128, MOVE_NORMAL, self);
-
+
if(trace_fraction != 1.0)
self.tur_head.idletime = -1337;
else
{
- traceline(trace_endpos, trace_endpos - '0 0 256', MOVE_NORMAL, self);
+ traceline(trace_endpos, trace_endpos - '0 0 256', MOVE_NORMAL, self);
if(trace_fraction == 1.0)
self.tur_head.idletime = -1337;
}
-
+
if(self.tur_head.idletime == -1337)
{
- self.moveto = self.origin + randomvec() * 256;
+ self.moveto = self.origin + randomvec() * 256;
self.tur_head.idletime = 0;
}
self.moveto = self.moveto * 0.9 + ((self.origin + v_forward * 500) + randomvec() * 400) * 0.1;
- self.moveto_z = self.origin_z + 64;
+ self.moveto_z = self.origin_z + 64;
walker_move_to(self.moveto, 0);
- }
-
+ }
+
if(self.idletime < time)
{
if(random() < 0.5 || !(self.spawnflags & TSL_ROAM))
{
self.animflag = ANIM_WALK;
self.idletime = time + 4 + random() * 2;
- self.moveto = self.origin + randomvec() * 256;
+ self.moveto = self.origin + randomvec() * 256;
self.tur_head.moveto = self.moveto;
self.tur_head.idletime = 0;
}
}
- }
+ }
}
}
else
if (self.tur_dist_enemy < autocvar_g_turrets_unit_walker_std_meele_range && self.animflag != ANIM_MEELE)
{
vector wish_angle;
-
- wish_angle = angleofs(self, self.enemy);
+
+ wish_angle = angleofs(self, self.enemy);
if (self.animflag != ANIM_SWIM)
if (fabs(wish_angle_y) < 15)
{
}
}
else if (self.tur_head.attack_finished_single < time)
- {
+ {
if(self.tur_head.shot_volly)
{
self.animflag = ANIM_NO;
-
+
self.tur_head.shot_volly = self.tur_head.shot_volly -1;
if(self.tur_head.shot_volly == 0)
self.tur_head.attack_finished_single = time + autocvar_g_turrets_unit_walker_std_rocket_refire;
else
self.tur_head.attack_finished_single = time + 0.2;
-
+
if(self.tur_head.shot_volly > 1)
walker_fire_rocket(gettaginfo(self, gettagindex(self, "tag_rocket01")));
else
}
else
{
- if (self.tur_dist_enemy > autocvar_g_turrets_unit_walker_std_rockets_range_min)
+ if (self.tur_dist_enemy > autocvar_g_turrets_unit_walker_std_rockets_range_min)
if (self.tur_dist_enemy < autocvar_g_turrets_unit_walker_std_rockets_range)
self.tur_head.shot_volly = 4;
}
}
else
- {
+ {
if (self.animflag != ANIM_MEELE)
walker_move_to(self.enemy.origin, self.tur_dist_enemy);
}
real_angle = vectoangles(self.steerto) - self.angles;
vz = self.velocity_z;
-
+
switch (self.animflag)
{
case ANIM_NO:
case ANIM_PAIN:
if(self.frame != ANIM_PAIN)
defer(0.25, walker_setnoanim);
-
+
break;
case ANIM_MEELE:
case ANIM_SWIM:
turny = autocvar_g_turrets_unit_walker_turn_swim;
turnx = autocvar_g_turrets_unit_walker_turn_swim;
-
+
self.angles_x += bound(-10, shortangle_f(real_angle_x, self.angles_x), 10);
movelib_move_simple(v_forward, autocvar_g_turrets_unit_walker_speed_swim, 0.3);
vz = self.velocity_z + sin(time * 4) * 8;
movelib_move_simple(v_forward ,autocvar_g_turrets_unit_walker_speed_roam, 0.5);
break;
}
-
+
if(turny)
- {
+ {
turny = bound( turny * -1, shortangle_f(real_angle_y, self.angles_y), turny );
self.angles_y += turny;
}
if(turnx)
- {
+ {
turnx = bound( turnx * -1, shortangle_f(real_angle_x, self.angles_x), turnx );
self.angles_x += turnx;
}
- self.velocity_z = vz;
+ self.velocity_z = vz;
}
-
+
if(self.origin != self.oldorigin)
self.SendFlags |= TNSF_MOVE;
-
+
self.oldorigin = self.origin;
turrets_setframe(self.animflag, FALSE);
}
void walker_attack()
{
sound (self, CH_WEAPON_A, "weapons/uzi_fire.wav", VOL_BASE, ATTEN_NORM);
- fireBallisticBullet (self.tur_shotorg, self.tur_shotdir_updated, self.shot_spread, self.shot_speed, 5, self.shot_dmg, self.shot_force, DEATH_TURRET_WALK_GUN, 0, 1, autocvar_g_balance_uzi_bulletconstant);
+ fireBallisticBullet (self.tur_shotorg, self.tur_shotdir_updated, self.shot_spread, self.shot_speed, 5, self.shot_dmg, self.shot_force, DEATH_TURRET_WALK_GUN, 0, autocvar_g_balance_uzi_bulletconstant);
endFireBallisticBullet();
pointparticles(particleeffectnum("laser_muzzleflash"), self.tur_shotorg, self.tur_shotdir_updated * 1000, 1);
}
// Respawn is called & first spawn to, to set team. need to make sure we do not move the initial spawn.
if(self.movetype != MOVETYPE_WALK)
return;
-
+
setorigin(self, self.pos1);
self.angles = self.pos2;
-
+
if (self.target != "")
{
e = find(world, targetname, self.target);
self.turrcaps_flags = TFL_TURRCAPS_PLAYERKILL | TFL_TURRCAPS_MOVE ;
self.aim_flags = TFL_AIM_LEAD;
- if (autocvar_g_antilag_bullets)
- self.turrcaps_flags |= TFL_TURRCAPS_HITSCAN;
- else
- self.aim_flags |= TFL_AIM_SHOTTIMECOMPENSATE;
+ self.turrcaps_flags |= TFL_TURRCAPS_HITSCAN;
self.turret_respawnhook = walker_respawnhook;
self.damagedbycontents = TRUE;
self.movetype = MOVETYPE_WALK;
self.solid = SOLID_SLIDEBOX;
- self.takedamage = DAMAGE_AIM;
+ self.takedamage = DAMAGE_AIM;
setorigin(self, self.origin);
tracebox(self.origin + '0 0 128', self.mins, self.maxs, self.origin - '0 0 10000', MOVE_NORMAL, self);
setorigin(self, trace_endpos + '0 0 4');
self = vehic;
-
-
+
+
vehic.solid = SOLID_NOT;
//setorigin(gunner, vehic.origin);
gunner.velocity = vehic.velocity;
-
+
float _in, _out;
vehic.angles_x *= -1;
makevectors(vehic.angles);
{
_in = autocvar_g_vehicle_bumblebee_cannon_turnlimit_out;
_out = autocvar_g_vehicle_bumblebee_cannon_turnlimit_in;
- setorigin(gunner, vehic.origin + v_up * -16 + v_forward * -16 + v_right * -128);
+ setorigin(gunner, vehic.origin + v_up * -16 + v_forward * -16 + v_right * -128);
}
-
+
crosshair_trace(gunner);
vector _ct = trace_endpos;
vector ad;
WriteAngle(MSG_ONE, self.vehicle.angles_y);
WriteAngle(MSG_ONE, 0);
}
-
+
CSQCVehicleSetup(self, HUD_NORMAL);
setsize(self, PL_MIN, PL_MAX);
if(self == self.vehicle.owner.gunner1)
{
- self.vehicle.owner.gunner1 = world;
+ self.vehicle.owner.gunner1 = world;
}
else if(self == self.vehicle.owner.gunner2)
{
- self.vehicle.owner.gunner2 = world;
+ self.vehicle.owner.gunner2 = world;
v_right *= -1;
- }
+ }
else
dprint("^1self != gunner1 or gunner2, this is a BIG PROBLEM, tell tZork this happend.\n");
-
+
vector spot = self.vehicle.owner.origin + + v_up * 128 + v_right * 300;
spot = vehicles_findgoodexit(spot);
//setorigin(self , spot);
_gun.vehicle_hudmodel.viewmodelforclient = other;
CSQCVehicleSetup(other, other.hud);
-
+
vh_player = other;
vh_vehicle = _gun;
MUTATOR_CALLHOOK(VehicleEnter);
float vehicles_valid_pilot()
{
- if not(IS_PLAYER(other))
+ if (!IS_PLAYER(other))
return FALSE;
if(other.deadflag != DEAD_NO)
if(other.vehicle != world)
return FALSE;
- if not(IS_REAL_CLIENT(other))
+ if (!IS_REAL_CLIENT(other))
if(!autocvar_g_vehicles_allow_bots)
return FALSE;
// Pitch
ftmp = 0;
- if(pilot.movement_x > 0 && vang_x < autocvar_g_vehicle_bumblebee_pitchlimit)
+ if(pilot.movement_x > 0 && vang_x < autocvar_g_vehicle_bumblebee_pitchlimit)
ftmp = 4;
- else if(pilot.movement_x < 0 && vang_x > -autocvar_g_vehicle_bumblebee_pitchlimit)
+ else if(pilot.movement_x < 0 && vang_x > -autocvar_g_vehicle_bumblebee_pitchlimit)
ftmp = -8;
newvel_x = bound(-autocvar_g_vehicle_bumblebee_pitchlimit, newvel_x , autocvar_g_vehicle_bumblebee_pitchlimit);
vehic.velocity += newvel * frametime;
pilot.velocity = pilot.movement = vehic.velocity;
-
+
if(autocvar_g_vehicle_bumblebee_healgun_locktime)
- {
+ {
if(vehic.tur_head.lock_time < time || vehic.tur_head.enemy.deadflag)
vehic.tur_head.enemy = world;
}
}
else
- {
+ {
vehic.tur_head.enemy = trace_ent;
vehic.tur_head.lock_time = time + autocvar_g_vehicle_bumblebee_healgun_locktime;
}
}
-
+
if(vehic.tur_head.enemy)
{
- trace_endpos = real_origin(vehic.tur_head.enemy);
- UpdateAuxiliaryXhair(pilot, trace_endpos, '0 0.75 0', 0);
+ trace_endpos = real_origin(vehic.tur_head.enemy);
+ UpdateAuxiliaryXhair(pilot, trace_endpos, '0 0.75 0', 0);
}
}
-
+
vang = vehicle_aimturret(vehic, trace_endpos, self.gun3, "fire",
autocvar_g_vehicle_bumblebee_raygun_pitchlimit_down * -1, autocvar_g_vehicle_bumblebee_raygun_pitchlimit_up,
autocvar_g_vehicle_bumblebee_raygun_turnlimit_sides * -1, autocvar_g_vehicle_bumblebee_raygun_turnlimit_sides, autocvar_g_vehicle_bumblebee_raygun_turnspeed);
{
vehic.gun3.enemy.realowner = pilot;
vehic.gun3.enemy.effects &= ~EF_NODRAW;
-
+
vehic.gun3.enemy.hook_start = gettaginfo(vehic.gun3, gettagindex(vehic.gun3, "fire"));
vehic.gun3.enemy.SendFlags |= BRG_START;
-
+
traceline(vehic.gun3.enemy.hook_start, vehic.gun3.enemy.hook_start + v_forward * autocvar_g_vehicle_bumblebee_raygun_range, MOVE_NORMAL, vehic);
-
+
if(trace_ent)
{
if(autocvar_g_vehicle_bumblebee_raygun)
}
}
}
-
+
vehic.gun3.enemy.hook_end = trace_endpos;
setorigin(vehic.gun3.enemy, trace_endpos);
vehic.gun3.enemy.SendFlags |= BRG_END;
-
+
vehic.wait = time + 1;
}
else
vehic.gun3.enemy = world;
}
*/
-
+
VEHICLE_UPDATE_PLAYER(pilot, health, bumblebee);
VEHICLE_UPDATE_PLAYER(pilot, energy, bumblebee);
if(vehic.vehicle_flags & VHF_HASSHIELD)
VEHICLE_UPDATE_PLAYER(pilot, shield, bumblebee);
-
+
vehic.angles_x *= -1;
makevectors(vehic.angles);
vehic.angles_x *= -1;
void bumb_think()
{
self.movetype = MOVETYPE_TOSS;
-
+
//self.velocity = self.velocity * 0.5;
self.angles_z *= 0.8;
self.angles_x *= 0.8;
-
+
self.nextthink = time + 0.05;
-
+
if(!self.owner)
{
- entity oldself = self;
+ entity oldself = self;
if(self.gunner1)
{
self = self.gunner1;
other = oldother;
return;
}
-
+
if(self.gunner2)
{
self = self.gunner2;
self.touch();
other = oldother;
return;
- }
+ }
}
-
+
}
void bumb_enter()
self.touch = vehicles_touch;
self.think = bumb_think;
self.nextthink = time;
-
+
if(!self.owner)
return;
-
+
fixedmakevectors(self.angles);
vector spot;
- if(vlen(self.velocity) > autocvar_g_vehicle_bumblebee_speed_forward * 0.5)
+ if(vlen(self.velocity) > autocvar_g_vehicle_bumblebee_speed_forward * 0.5)
spot = self.origin + v_up * 128 + v_forward * 200;
else
spot = self.origin + v_up * 128 - v_forward * 200;
-
+
spot = vehicles_findgoodexit(spot);
-
+
// Hide beam
if(self.gun3.enemy || !wasfreed(self.gun3.enemy)) {
self.gun3.enemy.effects |= EF_NODRAW;
self.owner.velocity = 0.75 * self.vehicle.velocity + normalize(spot - self.vehicle.origin) * 200;
self.owner.velocity_z += 10;
setorigin(self.owner, spot);
-
+
antilag_clear(self.owner);
self.owner = world;
}
sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
pointparticles(particleeffectnum("explosion_large"), randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1);
-
+
if(self.owner.deadflag == DEAD_DYING)
self.owner.deadflag = DEAD_DEAD;
-
+
remove(self);
}
void bumb_die()
{
entity oldself = self;
-
+
// Hide beam
if(self.gun3.enemy || !wasfreed(self.gun3.enemy))
self.gun3.enemy.effects |= EF_NODRAW;
-
+
if(self.gunner1)
{
self = self.gunner1;
_body.touch = bumb_blowup;
else
_body.touch = func_null;
-
+
_body.think = bumb_diethink;
_body.nextthink = time;
_body.wait = time + 2 + (random() * 8);
_body.owner = self;
_body.enemy = self.enemy;
-
+
pointparticles(particleeffectnum("explosion_medium"), findbetterlocation(self.origin, 16), '0 0 0', 1);
-
+
self.health = 0;
self.event_damage = func_null;
self.solid = SOLID_CORPSE;
void bumb_impact()
{
if(autocvar_g_vehicle_bumblebee_bouncepain_x)
- vehilces_impact(autocvar_g_vehicle_bumblebee_bouncepain_x,
- autocvar_g_vehicle_bumblebee_bouncepain_y,
+ vehilces_impact(autocvar_g_vehicle_bumblebee_bouncepain_x,
+ autocvar_g_vehicle_bumblebee_bouncepain_y,
autocvar_g_vehicle_bumblebee_bouncepain_z);
}
setorigin(self.gun2.vehicle_viewport, '-85 0 50');
self.scale = 1.5;
-
+
// Raygun beam
if(self.gun3.enemy == world)
- {
+ {
self.gun3.enemy = spawn();
Net_LinkEntity(self.gun3.enemy, TRUE, 0, bumble_raygun_send);
- self.gun3.enemy.SendFlags = BRG_SETUP;
- self.gun3.enemy.cnt = autocvar_g_vehicle_bumblebee_raygun;
+ self.gun3.enemy.SendFlags = BRG_SETUP;
+ self.gun3.enemy.cnt = autocvar_g_vehicle_bumblebee_raygun;
self.gun3.enemy.effects = EF_NODRAW | EF_LOWPRECISION;
}
}
self.movetype = MOVETYPE_TOSS;
self.vehicle_impact = bumb_impact;
self.damageforcescale = 0.025;
-
+
setorigin(self, self.origin + '0 0 25');
}
if(autocvar_g_vehicle_bumblebee_health_regen)
self.vehicle_flags |= VHF_HEALTHREGEN;
- if not(vehicle_initialize(
+ if(!vehicle_initialize(
"Bumblebee", "models/vehicles/bumblebee_body.dpm",
"", "models/vehicles/spiderbot_cockpit.dpm", "", "", "tag_viewport",
HUD_BUMBLEBEE, BUMB_MIN, BUMB_MAX, FALSE,
_len = vlen(self.origin - self.move_origin);
_dir = normalize(self.move_origin - self.origin);
-
+
if(self.total_damages < time)
{
boxparticles(self.traileffect, self, self.origin, self.origin + _dir * -64, _dir * -_len , _dir * -_len, 1, PARTICLES_USEALPHA);
self.cnt = ReadByte();
self.team = ReadByte();
self.cnt = ReadByte();
-
+
if(self.cnt)
self.colormod = '1 0 0';
else
self.colormod = '0 1 0';
self.traileffect = particleeffectnum("healray_muzzleflash");
- self.lip = particleeffectnum("healray_impact");
+ self.lip = particleeffectnum("healray_impact");
self.draw = bumble_raygun_draw;
}
-
-
+
+
if(sf & BRG_START)
{
self.origin_x = ReadCoord();
return;
}
- if not (self.realowner.vehicle)
+ if (!self.realowner.vehicle)
{
UpdateCSQCProjectile(self);
return;
return;
}
- if not (self.realowner.vehicle)
+ if (!self.realowner.vehicle)
{
UpdateCSQCProjectile(self);
return;
self.movetype = MOVETYPE_BOUNCE;
sound (self.tur_head, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_VEHICLEENGINE, ATTEN_NORM);
- if not (self.owner)
+ if (!self.owner)
return;
makevectors(self.angles);
{
remove(self);
return;
- }
-
+ }
+
self.vehicle_flags |= VHF_DMGSHAKE;
self.vehicle_flags |= VHF_DMGROLL;
if(autocvar_g_vehicle_racer_health_regen)
self.vehicle_flags |= VHF_HEALTHREGEN;
- if not (vehicle_initialize(
+ if(!vehicle_initialize(
"Wakizashi",
"models/vehicles/wakizashi.dpm",
"null", // we need this so tur_head is networked and usable for sounds
racer_frame,
racer_enter, racer_exit,
racer_die, racer_think,
- TRUE,
+ TRUE,
autocvar_g_vehicle_racer_health,
autocvar_g_vehicle_racer_shield))
{
if(self.owner.flagcarried)
setorigin(self.owner.flagcarried, '-20 0 96');
-
+
CSQCVehicleSetup(self.owner, 0);
}
void raptor_land()
-{
+{
float hgt;
-
- hgt = raptor_altitude(512);
+
+ hgt = raptor_altitude(512);
self.velocity = (self.velocity * 0.9) + ('0 0 -1800' * (hgt / 256) * sys_frametime);
self.angles_x *= 0.95;
self.angles_z *= 0.95;
self.nextthink = time;
}
- if not (self.owner)
+ if (!self.owner)
return;
-
+
makevectors(self.angles);
if(eject)
{
self.owner.oldvelocity = self.owner.velocity;
setorigin(self.owner , spot);
}
-
- antilag_clear(self.owner);
+
+ antilag_clear(self.owner);
self.owner = world;
}
float raptor_takeoff()
{
entity player, raptor;
-
+
player = self;
raptor = self.vehicle;
self = raptor;
if(self.sound_nexttime < time)
- {
+ {
self.sound_nexttime = time + 7.955812; //soundlength("vehicles/raptor_fly.wav");
sound (self, CH_TRIGGER_SINGLE, "vehicles/raptor_speed.wav", VOL_VEHICLEENGINE, ATTEN_NORM);
- }
+ }
// Takeoff sequense
if(raptor.frame < 25)
_missile.enemy = self;
_missile = _missile.chain;
}
-
+
if(self.tur_impacttime < time)
remove(self);
}
entity player, raptor;
float ftmp = 0;
vector df;
-
+
if(intermission_running)
return 1;
vehicles_painframe();
/*
ftmp = vlen(self.velocity);
- if(ftmp > autocvar_g_vehicle_raptor_speed_forward)
+ if(ftmp > autocvar_g_vehicle_raptor_speed_forward)
ftmp = 1;
- else
+ else
ftmp = ftmp / autocvar_g_vehicle_raptor_speed_forward;
*/
-
+
if(self.sound_nexttime < time)
- {
- self.sound_nexttime = time + 7.955812;
+ {
+ self.sound_nexttime = time + 7.955812;
//sound (self.tur_head, CH_TRIGGER_SINGLE, "vehicles/raptor_fly.wav", 1 - ftmp, ATTEN_NORM );
- sound (self, CH_TRIGGER_SINGLE, "vehicles/raptor_speed.wav", 1, ATTEN_NORM);
+ sound (self, CH_TRIGGER_SINGLE, "vehicles/raptor_speed.wav", 1, ATTEN_NORM);
self.wait = ftmp;
- }
+ }
/*
else if(fabs(ftmp - self.wait) > 0.2)
{
sound (self.tur_head, CH_TRIGGER_SINGLE, "", 1 - ftmp, ATTEN_NORM );
- sound (self, CH_TRIGGER_SINGLE, "", ftmp, ATTEN_NORM);
+ sound (self, CH_TRIGGER_SINGLE, "", ftmp, ATTEN_NORM);
self.wait = ftmp;
}
*/
-
+
if(raptor.deadflag != DEAD_NO)
{
self = player;
{
if(raptor.gun1.lock_time < time || raptor.gun1.enemy.deadflag)
raptor.gun1.enemy = world;
-
+
if(trace_ent)
if(trace_ent.movetype)
if(trace_ent.takedamage)
}
}
else
- {
+ {
raptor.gun1.enemy = trace_ent;
raptor.gun1.lock_time = time + 0.5;
}
}
-
+
if(raptor.gun1.enemy)
{
float i, distance, impact_time;
vector _vel = raptor.gun1.enemy.velocity;
if(raptor.gun1.enemy.movetype == MOVETYPE_WALK)
_vel_z *= 0.1;
-
+
if(autocvar_g_vehicle_raptor_cannon_predicttarget)
{
ad = vf;
impact_time = distance / autocvar_g_vehicle_raptor_cannon_speed;
ad = vf + _vel * impact_time;
}
- trace_endpos = ad;
+ trace_endpos = ad;
}
else
- trace_endpos = vf;
+ trace_endpos = vf;
}
}
else if(autocvar_g_vehicle_raptor_cannon_locktarget == 1)
}
- vehicle_aimturret(raptor, trace_endpos, raptor.gun1, "fire1",
- autocvar_g_vehicle_raptor_cannon_pitchlimit_down * -1, autocvar_g_vehicle_raptor_cannon_pitchlimit_up,
+ vehicle_aimturret(raptor, trace_endpos, raptor.gun1, "fire1",
+ autocvar_g_vehicle_raptor_cannon_pitchlimit_down * -1, autocvar_g_vehicle_raptor_cannon_pitchlimit_up,
autocvar_g_vehicle_raptor_cannon_turnlimit * -1, autocvar_g_vehicle_raptor_cannon_turnlimit, autocvar_g_vehicle_raptor_cannon_turnspeed);
- vehicle_aimturret(raptor, trace_endpos, raptor.gun2, "fire1",
- autocvar_g_vehicle_raptor_cannon_pitchlimit_down * -1, autocvar_g_vehicle_raptor_cannon_pitchlimit_up,
+ vehicle_aimturret(raptor, trace_endpos, raptor.gun2, "fire1",
+ autocvar_g_vehicle_raptor_cannon_pitchlimit_down * -1, autocvar_g_vehicle_raptor_cannon_pitchlimit_up,
autocvar_g_vehicle_raptor_cannon_turnlimit * -1, autocvar_g_vehicle_raptor_cannon_turnlimit, autocvar_g_vehicle_raptor_cannon_turnspeed);
/*
traceline(ad, ad + v_forward * MAX_SHOT_DISTANCE, MOVE_NORMAL, raptor);
UpdateAuxiliaryXhair(player, trace_endpos, '0 1 0', 0);
*/
-
+
if(player.BUTTON_ATCK)
if(raptor.attack_finished_single <= time)
if(raptor.vehicle_energy > autocvar_g_vehicle_raptor_cannon_cost)
raptor_bombdrop();
raptor.delay = time + autocvar_g_vehicle_raptor_bombs_refire;
raptor.lip = time;
- }
+ }
}
else
{
{
float i;
entity _flare;
-
+
for(i = 0; i < 3; ++i)
{
_flare = spawn();
- setmodel(_flare, "models/runematch/rune.mdl");
+ setmodel(_flare, "models/runematch/rune.mdl");
_flare.effects = EF_LOWPRECISION | EF_FLAME;
_flare.scale = 0.5;
setorigin(_flare, self.origin - '0 0 16');
raptor.lip = time;
}
}
-
+
raptor.bomb1.alpha = raptor.bomb2.alpha = (time - raptor.lip) / (raptor.delay - raptor.lip);
player.vehicle_reload2 = bound(0, raptor.bomb1.alpha * 100, 100);
_missile = _missile.chain;
}
-
+
if(_incomming)
sound(self, CH_PAIN_SINGLE, "vehicles/missile_alarm.wav", VOL_BASE, ATTEN_NONE);
-
+
self.bomb1.cnt = time + 1;
}
-
+
VEHICLE_UPDATE_PLAYER(player, health, raptor);
VEHICLE_UPDATE_PLAYER(player, energy, raptor);
VEHICLE_UPDATE_PLAYER(player, shield, raptor);
player.BUTTON_ATCK = player.BUTTON_ATCK2 = player.BUTTON_CROUCH = 0;
-
+
self = player;
return 1;
}
{
if(time >= self.wait)
self.think = raptor_blowup;
-
+
if(random() < 0.1)
{
sound (self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
self.think = raptor_diethink;
self.nextthink = time;
self.wait = time + 5 + (random() * 5);
-
+
pointparticles(particleeffectnum("explosion_medium"), findbetterlocation (self.origin, 16), '0 0 0', 1);
self.velocity_z += 600;
switch(_imp)
{
case 10:
- case 15:
+ case 15:
case 18:
self.vehicle.vehicle_weapon2mode += 1;
if(self.vehicle.vehicle_weapon2mode > RSM_LAST)
self.vehicle.vehicle_weapon2mode = RSM_FIRST;
-
+
CSQCVehicleSetup(self, 0);
return TRUE;
case 12:
self.vehicle.vehicle_weapon2mode -= 1;
if(self.vehicle.vehicle_weapon2mode < RSM_FIRST)
self.vehicle.vehicle_weapon2mode = RSM_LAST;
-
+
CSQCVehicleSetup(self, 0);
return TRUE;
- /*
+ /*
case 17: // toss gun, could be used to exit?
break;
case 20: // Manual minigun reload?
break;
*/
- }
+ }
return FALSE;
}
//FIXME: Camera is in a bad place in HUD model.
//setorigin(self.vehicle_viewport, '25 0 5');
-
+
self.vehicles_impusle = raptor_impulse;
-
+
self.frame = 0;
self.bomb1 = spawn();
setsize(self, RAPTOR_MIN, RAPTOR_MAX );
self.delay = time;
-
+
self.bouncefactor = autocvar_g_vehicle_raptor_bouncefactor;
- self.bouncestop = autocvar_g_vehicle_raptor_bouncestop;
- self.vehicle_impact = raptor_impact;
+ self.bouncestop = autocvar_g_vehicle_raptor_bouncestop;
+ self.vehicle_impact = raptor_impact;
self.damageforcescale = 0.25;
}
{
remove(self);
return;
- }
-
+ }
+
self.vehicle_flags |= VHF_DMGSHAKE;
self.vehicle_flags |= VHF_DMGROLL;
-
+
if(autocvar_g_vehicle_raptor_shield)
self.vehicle_flags |= VHF_HASSHIELD;
//precache_model ("models/vehicles/clusterbomb.md3");
precache_model ("models/vehicles/clusterbomb_folded.md3");
precache_model ("models/vehicles/raptor_body.dpm");
-
+
precache_sound ("vehicles/raptor_fly.wav");
precache_sound ("vehicles/raptor_speed.wav");
precache_sound ("vehicles/missile_alarm.wav");
-
- if not (vehicle_initialize(
+
+ if(!vehicle_initialize(
"Raptor",
"models/vehicles/raptor.dpm",
"",
raptor_frame,
raptor_enter, raptor_exit,
raptor_die, raptor_think,
- FALSE,
+ FALSE,
autocvar_g_vehicle_raptor_health,
autocvar_g_vehicle_raptor_shield))
{
remove(self);
return;
}
-
-
+
+
}
#endif // SVQC
self.nextthink = time;
- if not (self.realowner.vehicle)
+ if (!self.realowner.vehicle)
self.think = spiderbot_rocket_unguided;
crosshair_trace(self.realowner);
{
entity rkt;
rkt = findchainentity(realowner, self.owner);
- if not (rkt)
+ if (!rkt)
return;
crosshair_trace(self.owner);
}
}
-float spiberbot_calcartillery_flighttime;
+float spiberbot_calcartillery_flighttime;
vector spiberbot_calcartillery(vector org, vector tgt, float ht)
{
float grav, sdist, zdist, vs, vz, jumpheight;
vector sdir;
-
+
grav = autocvar_sv_gravity;
zdist = tgt_z - org_z;
sdist = vlen(tgt - org - zdist * '0 0 1');
entity rocket = world;
if (self.wait != -10)
- {
+ {
if (self.owner.BUTTON_ATCK2 && self.vehicle_weapon2mode == SBRM_GUIDE)
{
if (self.wait == 1)
self.wait = 0;
}
}
-
+
if(self.gun2.cnt > time)
return;
self.tur_head.frame = 1;
self.wait = 0;
}
-
+
if (self.wait != -10)
- if not (self.owner.BUTTON_ATCK2)
+ if (!self.owner.BUTTON_ATCK2)
return;
v = gettaginfo(self.tur_head,gettagindex(self.tur_head,"tag_fire"));
-
+
switch(self.vehicle_weapon2mode)
{
case SBRM_VOLLY:
rocket.nextthink = time;
rocket.think = spiderbot_rocket_guided;
-
+
break;
case SBRM_ARTILLERY:
rocket = vehicles_projectile("spiderbot_rocket_launch", "weapons/rocket_fire.wav",
v, normalize(v_forward) * autocvar_g_vehicle_spiderbot_rocket_speed,
autocvar_g_vehicle_spiderbot_rocket_damage, autocvar_g_vehicle_spiderbot_rocket_radius, autocvar_g_vehicle_spiderbot_rocket_force, 1,
DEATH_VH_SPID_ROCKET, PROJECTILE_SPIDERROCKET, autocvar_g_vehicle_spiderbot_rocket_health, FALSE, TRUE, self.owner);
-
+
crosshair_trace(self.owner);
-
+
rocket.pos1 = trace_endpos + randomvec() * (0.75 * autocvar_g_vehicle_spiderbot_rocket_radius);
rocket.pos1_z = trace_endpos_z;
-
- traceline(v, v + '0 0 1' * MAX_SHOT_DISTANCE, MOVE_WORLDONLY, self);
+
+ traceline(v, v + '0 0 1' * MAX_SHOT_DISTANCE, MOVE_WORLDONLY, self);
float h1 = 0.75 * vlen(v - trace_endpos);
-
+
//v = trace_endpos;
- traceline(v , rocket.pos1 + '0 0 1' * MAX_SHOT_DISTANCE, MOVE_WORLDONLY, self);
+ traceline(v , rocket.pos1 + '0 0 1' * MAX_SHOT_DISTANCE, MOVE_WORLDONLY, self);
float h2 = 0.75 * vlen(rocket.pos1 - v);
-
+
rocket.velocity = spiberbot_calcartillery(v, rocket.pos1, ((h1 < h2) ? h1 : h2));
- rocket.movetype = MOVETYPE_TOSS;
+ rocket.movetype = MOVETYPE_TOSS;
rocket.gravity = 1;
- //rocket.think = spiderbot_rocket_artillery;
+ //rocket.think = spiderbot_rocket_artillery;
break;
}
rocket.classname = "spiderbot_rocket";
-
+
rocket.cnt = time + autocvar_g_vehicle_spiderbot_rocket_lifetime;
-
+
self.tur_head.frame += 1;
if (self.tur_head.frame == 9)
self.attack_finished_single = autocvar_g_vehicle_spiderbot_rocket_reload;
if(intermission_running)
return 1;
-
+
player = self;
spider = self.vehicle;
self = spider;
vehicles_painframe();
-
+
player.BUTTON_ZOOM = 0;
player.BUTTON_CROUCH = 0;
player.switchweapon = 0;
-
+
#if 1 // 0 to enable per-gun impact aux crosshairs
// Avarage gun impact point's -> aux cross
ad = AnglesTransform_ToAngles(AnglesTransform_LeftDivide(AnglesTransform_FromAngles(spider.angles), AnglesTransform_FromAngles(ad))) - spider.tur_head.angles;
ad = AnglesTransform_Normalize(ad, TRUE);
//UpdateAuxiliaryXhair(player, trace_endpos, ('1 0 0' * player.vehicle_reload2) + ('0 1 0' * (1 - player.vehicle_reload2)), 2);
-
+
// Rotate head
- ftmp = autocvar_g_vehicle_spiderbot_head_turnspeed * sys_frametime;
+ ftmp = autocvar_g_vehicle_spiderbot_head_turnspeed * sys_frametime;
ad_y = bound(-ftmp, ad_y, ftmp);
spider.tur_head.angles_y = bound(autocvar_g_vehicle_spiderbot_head_turnlimit * -1, spider.tur_head.angles_y + ad_y, autocvar_g_vehicle_spiderbot_head_turnlimit);
//fixedmakevectors(spider.angles);
makevectors(spider.angles + '-2 0 0' * spider.angles_x);
-
+
movelib_groundalign4point(autocvar_g_vehicle_spiderbot_springlength, autocvar_g_vehicle_spiderbot_springup, autocvar_g_vehicle_spiderbot_springblend, autocvar_g_vehicle_spiderbot_tiltlimit);
if(spider.flags & FL_ONGROUND)
if(spider.frame == 4 && self.tur_head.wait != 0)
{
sound (self, CH_TRIGGER_SINGLE, "vehicles/spiderbot_land.wav", VOL_VEHICLEENGINE, ATTEN_NORM);
- spider.frame = 5;
+ spider.frame = 5;
}
-
+
if(player.BUTTON_JUMP && self.tur_head.wait < time)
- {
+ {
sound (self, CH_TRIGGER_SINGLE, "vehicles/spiderbot_jump.wav", VOL_VEHICLEENGINE, ATTEN_NORM);
//dprint("spiderbot_jump:", ftos(soundlength("vehicles/spiderbot_jump.wav")), "\n");
self.delay = 0;
if(vlen(player.movement) == 0)
{
if(self.sound_nexttime < time || self.delay != 3)
- {
+ {
self.delay = 3;
self.sound_nexttime = time + 6.486500; //soundlength("vehicles/spiderbot_idle.wav");
//dprint("spiderbot_idle:", ftos(soundlength("vehicles/spiderbot_idle.wav")), "\n");
sound (self, CH_TRIGGER_SINGLE, "vehicles/spiderbot_idle.wav", VOL_VEHICLEENGINE, ATTEN_NORM);
- }
+ }
movelib_beak_simple(autocvar_g_vehicle_spiderbot_speed_stop);
spider.frame = 5;
}
ftmp = autocvar_g_vehicle_spiderbot_turnspeed_strafe * sys_frametime;
else
ftmp = autocvar_g_vehicle_spiderbot_turnspeed * sys_frametime;
-
- ftmp = bound(-ftmp, spider.tur_head.angles_y, ftmp);
+
+ ftmp = bound(-ftmp, spider.tur_head.angles_y, ftmp);
spider.angles_y = anglemods(spider.angles_y + ftmp);
spider.tur_head.angles_y -= ftmp;
movelib_move_simple(normalize(v_forward * player.movement_x),autocvar_g_vehicle_spiderbot_speed_walk,autocvar_g_vehicle_spiderbot_movement_inertia);
if(self.sound_nexttime < time || self.delay != 1)
- {
+ {
self.delay = 1;
self.sound_nexttime = time + 6.486500; //soundlength("vehicles/spiderbot_walk.wav");
sound (self, CH_TRIGGER_SINGLE, "vehicles/spiderbot_walk.wav", VOL_VEHICLEENGINE, ATTEN_NORM);
}
movelib_move_simple(normalize(v_right * player.movement_y),autocvar_g_vehicle_spiderbot_speed_strafe,autocvar_g_vehicle_spiderbot_movement_inertia);
if(self.sound_nexttime < time || self.delay != 2)
- {
+ {
self.delay = 2;
self.sound_nexttime = time + 6.486500; //soundlength("vehicles/spiderbot_strafe.wav");
sound (self, CH_TRIGGER_SINGLE, "vehicles/spiderbot_strafe.wav", VOL_VEHICLEENGINE, ATTEN_NORM);
v_forward = normalize(v_forward);
v += v_forward * 50;
-//void fireBallisticBullet(vector start, vector dir, float spread, float pSpeed, float lifetime, float damage, float force, float dtype, float tracereffects, float gravityfactor, float bulletconstant)
+//void fireBallisticBullet(vector start, vector dir, float spread, float pSpeed, float lifetime, float damage, float force, float dtype, float tracereffects, float bulletconstant)
fireBallisticBullet(v, v_forward, autocvar_g_vehicle_spiderbot_minigun_spread, autocvar_g_vehicle_spiderbot_minigun_speed,
- 5, autocvar_g_vehicle_spiderbot_minigun_damage, autocvar_g_vehicle_spiderbot_minigun_force, DEATH_VH_SPID_MINIGUN, 0, 1, autocvar_g_vehicle_spiderbot_minigun_bulletconstant);
+ 5, autocvar_g_vehicle_spiderbot_minigun_damage, autocvar_g_vehicle_spiderbot_minigun_force, DEATH_VH_SPID_MINIGUN, 0, autocvar_g_vehicle_spiderbot_minigun_bulletconstant);
endFireBallisticBullet();
vehicles_regen(spider.cnt, vehicle_ammo1, autocvar_g_vehicle_spiderbot_minigun_ammo_max,
autocvar_g_vehicle_spiderbot_minigun_ammo_regen_pause,
autocvar_g_vehicle_spiderbot_minigun_ammo_regen, frametime, FALSE);
-
+
spiderbot_rocket_do();
VEHICLE_UPDATE_PLAYER(player, shield, spiderbot);
self = player;
- return 1;
+ return 1;
}
void spiderbot_think()
{
if(self.owner.flagcarried)
{
- setattachment(self.owner.flagcarried, self.tur_head, "");
- setorigin(self.owner.flagcarried, '-20 0 120');
+ setattachment(self.owner.flagcarried, self.tur_head, "");
+ setorigin(self.owner.flagcarried, '-20 0 120');
}
}
{
entity e;
vector spot;
-
+
e = findchain(classname,"spiderbot_rocket");
while(e)
{
self.nextthink = time;
self.frame = 5;
self.movetype = MOVETYPE_WALK;
-
- if not (self.owner)
+
+ if (!self.owner)
return;
makevectors(self.angles);
self.owner.oldvelocity = self.owner.velocity;
setorigin(self.owner , spot);
}
-
+
antilag_clear(self.owner);
self.owner = world;
}
void spider_impact()
{
if(autocvar_g_vehicle_spiderbot_bouncepain_x)
- vehilces_impact(autocvar_g_vehicle_spiderbot_bouncepain_x, autocvar_g_vehicle_spiderbot_bouncepain_y, autocvar_g_vehicle_spiderbot_bouncepain_z);
+ vehilces_impact(autocvar_g_vehicle_spiderbot_bouncepain_x, autocvar_g_vehicle_spiderbot_bouncepain_y, autocvar_g_vehicle_spiderbot_bouncepain_z);
}
void spiderbot_headfade()
self.nextthink = time + 0.1;
return;
}
-
+
entity h, g1, g2, b;
b = spawn();
h = spawn();
switch(_imp)
{
case 10:
- case 15:
+ case 15:
case 18:
self.vehicle.vehicle_weapon2mode += 1;
if(self.vehicle.vehicle_weapon2mode > SBRM_LAST)
self.vehicle.vehicle_weapon2mode = SBRM_FIRST;
-
+
//centerprint(self, strcat("Rocket mode is ", ftos(self.vehicle.vehicle_weapon2mode)));
CSQCVehicleSetup(self, 0);
return TRUE;
self.vehicle.vehicle_weapon2mode -= 1;
if(self.vehicle.vehicle_weapon2mode < SBRM_FIRST)
self.vehicle.vehicle_weapon2mode = SBRM_LAST;
-
+
//centerprint(self, strcat("Rocket mode is ", ftos(self.vehicle.vehicle_weapon2mode)));
CSQCVehicleSetup(self, 0);
return TRUE;
- /*
+ /*
case 17: // toss gun, could be used to exit?
break;
case 20: // Manual minigun reload?
break;
*/
- }
+ }
return FALSE;
}
void spiderbot_spawn(float _f)
{
if(!self.gun1)
- {
+ {
self.vehicles_impusle = spiderbot_impulse;
self.gun1 = spawn();
- self.gun2 = spawn();
+ self.gun2 = spawn();
setmodel(self.gun1, "models/vehicles/spiderbot_barrels.dpm");
setmodel(self.gun2, "models/vehicles/spiderbot_barrels.dpm");
setattachment(self.gun1, self.tur_head, "tag_hardpoint01");
self.movetype = MOVETYPE_WALK;
self.solid = SOLID_SLIDEBOX;
self.alpha = self.tur_head.alpha = self.gun1.alpha = self.gun2.alpha = 1;
- self.tur_head.angles = '0 0 0';
+ self.tur_head.angles = '0 0 0';
setorigin(self, self.pos1 + '0 0 128');
self.angles = self.pos2;
{
remove(self);
return;
- }
+ }
self.vehicle_flags |= VHF_DMGSHAKE;
//self.vehicle_flags |= VHF_DMGROLL;
//self.vehicle_flags |= VHF_DMGHEADROLL;
-
+
precache_model ( "models/vhshield.md3");
precache_model ( "models/vehicles/spiderbot.dpm");
precache_model ( "models/vehicles/spiderbot_top.dpm");
precache_sound ( "weapons/uzi_fire.wav" );
precache_sound ( "weapons/rocket_impact.wav");
-
+
precache_sound ( "vehicles/spiderbot_die.wav");
precache_sound ( "vehicles/spiderbot_idle.wav");
precache_sound ( "vehicles/spiderbot_jump.wav");
if(autocvar_g_vehicle_spiderbot_health_regen)
self.vehicle_flags |= VHF_HEALTHREGEN;
-
- if not (vehicle_initialize(
+
+ if(!vehicle_initialize(
"Spiderbot",
"models/vehicles/spiderbot.dpm",
"models/vehicles/spiderbot_top.dpm",
spiderbot_frame,
spiderbot_enter, spiderbot_exit,
spiderbot_die, spiderbot_think,
- FALSE,
+ FALSE,
autocvar_g_vehicle_spiderbot_health,
autocvar_g_vehicle_spiderbot_shield))
{
void UpdateAuxiliaryXhair(entity own, vector loc, vector clr, float axh_id)
{
- if not(IS_REAL_CLIENT(own))
+ if (!IS_REAL_CLIENT(own))
return;
entity axh;
**/
void CSQCVehicleSetup(entity own, float vehicle_id)
{
- if not(IS_REAL_CLIENT(own))
+ if (!IS_REAL_CLIENT(own))
return;
-
+
msg_entity = own;
WriteByte(MSG_ONE, SVC_TEMPENTITY);
WriteByte(MSG_ONE, TE_CSQC_VEHICLESETUP);
if(vehicle_id != 0)
- WriteByte(MSG_ONE, vehicle_id);
+ WriteByte(MSG_ONE, vehicle_id);
else
WriteByte(MSG_ONE, 1 + own.vehicle.vehicle_weapon2mode + HUD_VEHICLE_LAST);
}
if(trace_ent.deadflag != DEAD_NO)
trace_ent = world;
- if not (trace_ent.vehicle_flags & VHF_ISVEHICLE ||
+ if(!trace_ent.vehicle_flags & VHF_ISVEHICLE ||
trace_ent.turrcaps_flags & TFL_TURRCAPS_ISTURRET ||
trace_ent.takedamage == DAMAGE_TARGETDRONE)
trace_ent = world;
setorigin(self, self.pos1 + '0 0 0');
// Show it
pointparticles(particleeffectnum("teleport"), self.origin + '0 0 64', '0 0 0', 1);
-
+
if(self.vehicle_controller)
self.team = self.vehicle_controller.team;
-
+
vehicles_reset_colors();
self.vehicle_spawn(VHSF_NORMAL);
}
{
if(MUTATOR_CALLHOOK(VehicleTouch))
return;
-
+
// Vehicle currently in use
if(self.owner)
{
return;
}
- if not(IS_PLAYER(other))
+ if (!IS_PLAYER(other))
return;
if(other.deadflag != DEAD_NO)
void vehicles_enter()
{
// Remove this when bots know how to use vehicles
-
- if (IS_BOT_CLIENT(other))
+
+ if (IS_BOT_CLIENT(other))
if (autocvar_g_vehicles_allow_bots)
dprint("Bot enters vehicle\n"); // This is where we need to disconnect (some, all?) normal bot AI and hand over to vehicle's _aiframe()
else
self.team = self.owner.team;
self.flags -= FL_NOTARGET;
-
+
if (IS_REAL_CLIENT(other))
{
msg_entity = other;
WriteByte (MSG_ONE, SVC_SETVIEWPORT);
WriteEntity(MSG_ONE, self.vehicle_viewport);
-
+
WriteByte (MSG_ONE, SVC_SETVIEWANGLES);
if(self.tur_head)
{
vehicles_clearrturn();
CSQCVehicleSetup(self.owner, self.hud);
-
+
vh_player = other;
vh_vehicle = self;
MUTATOR_CALLHOOK(VehicleEnter);
entity _vehicle;
entity _player;
entity _oldself = self;
-
+
if(vehicles_exit_running)
{
dprint("^1vehicles_exit allready running! this is not good..\n");
return;
}
-
+
vehicles_exit_running = TRUE;
if(IS_CLIENT(self))
{
_vehicle = self.vehicle;
-
+
if (_vehicle.vehicle_flags & VHF_PLAYERSLOT)
{
_vehicle.vehicle_exit(eject);
self = _oldself;
vehicles_exit_running = FALSE;
- return;
+ return;
}
}
else
_vehicle = self;
-
+
_player = _vehicle.owner;
-
+
self = _vehicle;
if (_player)
WriteAngle(MSG_ONE, _vehicle.angles_y);
WriteAngle(MSG_ONE, 0);
}
-
+
setsize(_player, PL_MIN,PL_MAX);
_player.takedamage = DAMAGE_AIM;
CSQCVehicleSetup(_player, HUD_NORMAL);
}
_vehicle.flags |= FL_NOTARGET;
-
+
if(_vehicle.deadflag == DEAD_NO)
_vehicle.avelocity = '0 0 0';
-
+
_vehicle.tur_head.nodrawtoclient = world;
-
+
if(!teamplay)
_vehicle.team = 0;
_vehicle = vh_vehicle;
_vehicle.team = _vehicle.tur_head.team;
-
+
sound (_vehicle, CH_TRIGGER_SINGLE, "misc/null.wav", 1, ATTEN_NORM);
- _vehicle.vehicle_hudmodel.viewmodelforclient = _vehicle;
+ _vehicle.vehicle_hudmodel.viewmodelforclient = _vehicle;
_vehicle.phase = time + 1;
-
+
_vehicle.vehicle_exit(eject);
-
+
vehicles_setreturn();
- vehicles_reset_colors();
+ vehicles_reset_colors();
_vehicle.owner = world;
self = _oldself;
-
+
vehicles_exit_running = FALSE;
}
{
if(_healthscale)
regen = regen * (self.vehicle_health / self.tur_health);
-
+
self.regen_field = min(self.regen_field + regen * delta_time, field_max);
if(self.owner)
void vehicles_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
{
self.dmg_time = time;
-
+
if(DEATH_ISWEAPON(deathtype, WEP_NEX))
damage *= autocvar_g_vehicles_nex_damagerate;
-
+
if(DEATH_ISWEAPON(deathtype, WEP_UZI))
damage *= autocvar_g_vehicles_uzi_damagerate;
-
+
if(DEATH_ISWEAPON(deathtype, WEP_RIFLE))
damage *= autocvar_g_vehicles_rifle_damagerate;
-
+
if(DEATH_ISWEAPON(deathtype, WEP_MINSTANEX))
damage *= autocvar_g_vehicles_minstanex_damagerate;
if(DEATH_ISWEAPON(deathtype, WEP_SEEKER))
damage *= autocvar_g_vehicles_tag_damagerate;
-
+
self.enemy = attacker;
-
+
if((self.vehicle_flags & VHF_HASSHIELD) && (self.vehicle_shield > 0))
{
if (wasfreed(self.vehicle_shieldent) || self.vehicle_shieldent == world)
if(sound_allowed(MSG_BROADCAST, attacker))
spamsound (self, CH_PAIN, "onslaught/ons_hit2.wav", VOL_BASE, ATTEN_NORM); // FIXME: PLACEHOLDER
}
-
+
if(self.damageforcescale < 1 && self.damageforcescale > 0)
self.velocity += force * self.damageforcescale;
else
self.active = ACTIVE_NOT;
else
self.active = ACTIVE_ACTIVE;
-
+
if(self.active == ACTIVE_ACTIVE && self.deadflag == DEAD_NO)
{
dprint("^3Eat shit yall!\n");
}
else if(self.active == ACTIVE_NOT && self.deadflag != DEAD_NO)
{
-
+
}
}
-float vehicle_addplayerslot( entity _owner,
- entity _slot,
- float _hud,
+float vehicle_addplayerslot( entity _owner,
+ entity _slot,
+ float _hud,
string _hud_model,
- float() _framefunc,
+ float() _framefunc,
void(float) _exitfunc)
{
- if not (_owner.vehicle_flags & VHF_MULTISLOT)
+ if (!(_owner.vehicle_flags & VHF_MULTISLOT))
_owner.vehicle_flags |= VHF_MULTISLOT;
_slot.PlayerPhysplug = _framefunc;
_slot.vehicle_hudmodel = spawn();
_slot.vehicle_hudmodel.viewmodelforclient = _slot;
_slot.vehicle_viewport.effects = (EF_ADDITIVE | EF_DOUBLESIDED | EF_FULLBRIGHT | EF_NODEPTHTEST | EF_NOGUNBOB | EF_NOSHADOW | EF_LOWPRECISION | EF_SELECTABLE | EF_TELEPORT_BIT);
-
+
setmodel(_slot.vehicle_hudmodel, _hud_model);
setmodel(_slot.vehicle_viewport, "null");
-
+
setattachment(_slot.vehicle_hudmodel, _slot, "");
setattachment(_slot.vehicle_viewport, _slot.vehicle_hudmodel, "");
-
+
return TRUE;
}
{
if(!autocvar_g_vehicles)
return FALSE;
-
+
if(self.targetname)
{
self.vehicle_controller = find(world, target, self.targetname);
}
else
{
- self.team = self.vehicle_controller.team;
+ self.team = self.vehicle_controller.team;
self.use = vehicle_use;
-
+
if(teamplay)
{
if(self.vehicle_controller.team == 0)
self.active = ACTIVE_NOT;
else
- self.active = ACTIVE_ACTIVE;
+ self.active = ACTIVE_ACTIVE;
}
}
}
-
+
precache_sound("onslaught/ons_hit2.wav");
precache_sound("onslaught/electricity_explode.wav");
}
setsize(self, min_s, max_s);
- if not (nodrop)
+ if (!nodrop)
{
setorigin(self, self.origin);
tracebox(self.origin + '0 0 100', min_s, max_s, self.origin - '0 0 10000', MOVE_WORLDONLY, self);
setorigin(self, trace_endpos);
}
-
+
self.pos1 = self.origin;
self.pos2 = self.angles;
self.tur_head.team = self.team;
-
+
if(MUTATOR_CALLHOOK(VehicleSpawn))
return FALSE;
return TRUE;
}
-vector vehicle_aimturret(entity _vehic, vector _target, entity _turrret, string _tagname,
- float _pichlimit_min, float _pichlimit_max,
+vector vehicle_aimturret(entity _vehic, vector _target, entity _turrret, string _tagname,
+ float _pichlimit_min, float _pichlimit_max,
float _rotlimit_min, float _rotlimit_max, float _aimspeed)
{
vector vtmp, vtag;
ftmp = _aimspeed * frametime;
vtmp_y = bound(-ftmp, vtmp_y, ftmp);
vtmp_x = bound(-ftmp, vtmp_x, ftmp);
- _turrret.angles_y = bound(_rotlimit_min, _turrret.angles_y + vtmp_y, _rotlimit_max);
+ _turrret.angles_y = bound(_rotlimit_min, _turrret.angles_y + vtmp_y, _rotlimit_max);
_turrret.angles_x = bound(_pichlimit_min, _turrret.angles_x + vtmp_x, _pichlimit_max);
return vtag;
}
_gib.movetype = MOVETYPE_TOSS;
_gib.solid = SOLID_CORPSE;
_gib.colormod = '-0.5 -0.5 -0.5';
- _gib.effects = EF_LOWPRECISION;
+ _gib.effects = EF_LOWPRECISION;
_gib.avelocity = _rot;
-
+
if(_burn)
_gib.effects |= EF_FLAME;
-
+
if(_explode)
{
- _gib.think = vehicles_gib_explode;
+ _gib.think = vehicles_gib_explode;
_gib.nextthink = time + random() * _explode;
_gib.touch = vehicles_gib_explode;
}
else
{
_gib.cnt = time + _maxtime;
- _gib.think = vehicles_gib_think;
- _gib.nextthink = time + _maxtime - 1;
+ _gib.think = vehicles_gib_think;
+ _gib.nextthink = time + _maxtime - 1;
_gib.alpha = 1;
}
return _gib;
// Find all non-hit players the beam passed close by
if(deathtype == WEP_MINSTANEX || deathtype == WEP_NEX)
{
- FOR_EACH_REALCLIENT(msg_entity) if(msg_entity != self) if(!msg_entity.railgunhit) if not(IS_SPEC(msg_entity) && msg_entity.enemy == self) // we use realclient, so spectators can hear the whoosh too
+ FOR_EACH_REALCLIENT(msg_entity)
+ if(msg_entity != self)
+ if(!msg_entity.railgunhit)
+ if(!(IS_SPEC(msg_entity) && msg_entity.enemy == self)) // we use realclient, so spectators can hear the whoosh too
{
// nearest point on the beam
beampos = start + dir * bound(0, (msg_entity.origin - start) * dir, length);
/*if(yoda && (time > (self.last_yoda + 5)))
{
Send_Notification(NOTIF_ONE, self.realowner, MSG_ANNCE, ANNCE_ACHIEVEMENT_YODA);
- self.last_yoda = time;
+ self.last_yoda = time;
}*/
// calculate hits for ballistic weapons
if(self.origin_x > world.maxs_x || self.origin_y > world.maxs_y || self.origin_z > world.maxs_z || self.origin_x < world.mins_x || self.origin_y < world.mins_y || self.origin_z < world.mins_z)
return 0;
- // special case for zero density and zero bullet constant:
+ // special case for zero density and zero bullet constant:
if(self.dmg_radius == 0)
{
// common/weapclip (intended)
// common/noimpact (is supposed to eat projectiles, but is erased farther above)
if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NODRAW)
- if not(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NONSOLID)
- if not(trace_dphitcontents & DPCONTENTS_OPAQUE)
+ if (!(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NONSOLID))
+ if (!(trace_dphitcontents & DPCONTENTS_OPAQUE))
{
remove(self);
return;
self.owner = world;
}
-void fireBallisticBullet(vector start, vector dir, float spread, float pSpeed, float lifetime, float damage, float force, float dtype, float tracereffects, float gravityfactor, float bulletconstant)
+void fireBallisticBullet(vector start, vector dir, float spread, float pSpeed, float lifetime, float damage, float force, float dtype, float tracereffects, float bulletconstant)
{
float lag, dt, savetime; //, density;
entity pl, oldself;
- float antilagging;
-
- antilagging = (autocvar_g_antilag_bullets && (pSpeed >= autocvar_g_antilag_bullets));
entity proj;
proj = spawn();
proj.classname = "bullet";
proj.owner = proj.realowner = self;
PROJECTILE_MAKETRIGGER(proj);
- if(gravityfactor > 0)
- {
- proj.movetype = MOVETYPE_TOSS;
- proj.gravity = gravityfactor;
- }
- else
- proj.movetype = MOVETYPE_FLY;
+ proj.movetype = MOVETYPE_FLY;
proj.think = SUB_Remove;
proj.nextthink = time + lifetime; // min(pLifetime, vlen(world.maxs - world.mins) / pSpeed);
- W_SetupProjectileVelocityEx(proj, dir, v_up, pSpeed, 0, 0, spread, antilagging);
+ W_SetupProjectileVelocityEx(proj, dir, v_up, pSpeed, 0, 0, spread, TRUE);
proj.angles = vectoangles(proj.velocity);
if(bulletconstant > 0)
proj.dmg_radius = autocvar_g_ballistics_materialconstant / bulletconstant;
other = proj; MUTATOR_CALLHOOK(EditProjectile);
- if(antilagging)
- {
- float eff;
+ float eff;
- if(tracereffects & EF_RED)
- eff = particleeffectnum("tr_rifle");
- else if(tracereffects & EF_BLUE)
- eff = particleeffectnum("tr_rifle_weak");
- else
- eff = particleeffectnum("tr_bullet");
+ if(tracereffects & EF_RED)
+ eff = particleeffectnum("tr_rifle");
+ else if(tracereffects & EF_BLUE)
+ eff = particleeffectnum("tr_rifle_weak");
+ else
+ eff = particleeffectnum("tr_bullet");
+
+ // NOTE: this may severely throw off weapon balance
+ lag = ANTILAG_LATENCY(self);
+ if(lag < 0.001)
+ lag = 0;
+ if (!IS_REAL_CLIENT(self))
+ lag = 0;
+ if(autocvar_g_antilag == 0 || self.cvar_cl_noantilag)
+ lag = 0; // only do hitscan, but no antilag
+
+ if(lag)
+ FOR_EACH_PLAYER(pl)
+ if(pl != self)
+ antilag_takeback(pl, time - lag);
- // NOTE: this may severely throw off weapon balance
- lag = ANTILAG_LATENCY(self);
- if(lag < 0.001)
- lag = 0;
- if not(IS_REAL_CLIENT(self))
- lag = 0;
- if(autocvar_g_antilag == 0 || self.cvar_cl_noantilag)
- lag = 0; // only do hitscan, but no antilag
+ oldself = self;
+ self = proj;
- if(lag)
- FOR_EACH_PLAYER(pl)
- if(pl != self)
- antilag_takeback(pl, time - lag);
+ savetime = frametime;
+ frametime = 0.05;
- oldself = self;
- self = proj;
+ for(;;)
+ {
+ // DP tracetoss is stupid and always traces in 0.05s
+ // ticks. This makes it trace in 0.05*0.125s ticks
+ // instead.
+ vector v0;
+ v0 = self.velocity;
+ self.velocity = self.velocity * 0.125;
+ trace_fraction = 0;
+ fireBallisticBullet_trace_callback_ent = self;
+ fireBallisticBullet_trace_callback_eff = eff;
+ WarpZone_TraceToss_ThroughZone(self, self.owner, world, fireBallisticBullet_trace_callback);
+ self.velocity = v0;
+
+ if(trace_fraction == 1)
+ break;
+ // won't hit anything anytime soon (DP's
+ // tracetoss does 200 tics of, here,
+ // 0.05*0.125s, that is, 1.25 seconds
- savetime = frametime;
- frametime = 0.05;
+ other = trace_ent;
+ dt = WarpZone_tracetoss_time * 0.125; // this is only approximate!
+ setorigin(self, trace_endpos);
+ self.velocity = WarpZone_tracetoss_velocity * (1 / 0.125);
- for(;;)
+ if(!SUB_OwnerCheck())
{
- // DP tracetoss is stupid and always traces in 0.05s
- // ticks. This makes it trace in 0.05*0.125s ticks
- // instead.
- vector v0;
- float g0;
- v0 = self.velocity;
- g0 = self.gravity;
- self.velocity = self.velocity * 0.125;
- self.gravity *= 0.125 * 0.125;
- trace_fraction = 0;
- fireBallisticBullet_trace_callback_ent = self;
- fireBallisticBullet_trace_callback_eff = eff;
- WarpZone_TraceToss_ThroughZone(self, self.owner, world, fireBallisticBullet_trace_callback);
- self.velocity = v0;
- self.gravity = g0;
-
- if(trace_fraction == 1)
+ if(SUB_NoImpactCheck())
break;
- // won't hit anything anytime soon (DP's
- // tracetoss does 200 tics of, here,
- // 0.05*0.125s, that is, 1.25 seconds
-
- other = trace_ent;
- dt = WarpZone_tracetoss_time * 0.125; // this is only approximate!
- setorigin(self, trace_endpos);
- self.velocity = WarpZone_tracetoss_velocity * (1 / 0.125);
- if(!SUB_OwnerCheck())
- {
- if(SUB_NoImpactCheck())
- break;
-
- // hit the player
- W_BallisticBullet_Hit();
- }
-
- if(proj.dmg_radius < 0) // these NEVER penetrate solid
- break;
+ // hit the player
+ W_BallisticBullet_Hit();
+ }
- // if we hit "weapclip", bail out
- //
- // rationale of this check:
- //
- // any shader that is solid, nodraw AND trans is meant to clip weapon
- // shots and players, but has no other effect!
- //
- // if it is not trans, it is caulk and should not have this side effect
- //
- // matching shaders:
- // common/weapclip (intended)
- // common/noimpact (is supposed to eat projectiles, but is erased farther above)
- if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NODRAW)
- if not(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NONSOLID)
- if not(trace_dphitcontents & DPCONTENTS_OPAQUE)
- break;
+ if(proj.dmg_radius < 0) // these NEVER penetrate solid
+ break;
- // go through solid!
- if(!W_BallisticBullet_LeaveSolid((other && (other.solid != SOLID_BSP)) ? eff : -1))
- break;
+ // if we hit "weapclip", bail out
+ //
+ // rationale of this check:
+ //
+ // any shader that is solid, nodraw AND trans is meant to clip weapon
+ // shots and players, but has no other effect!
+ //
+ // if it is not trans, it is caulk and should not have this side effect
+ //
+ // matching shaders:
+ // common/weapclip (intended)
+ // common/noimpact (is supposed to eat projectiles, but is erased farther above)
+ if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NODRAW)
+ if (!(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NONSOLID))
+ if (!(trace_dphitcontents & DPCONTENTS_OPAQUE))
+ break;
- W_BallisticBullet_LeaveSolid_think();
+ // go through solid!
+ if(!W_BallisticBullet_LeaveSolid((other && (other.solid != SOLID_BSP)) ? eff : -1))
+ break;
- self.projectiledeathtype |= HITTYPE_BOUNCE;
- }
- frametime = savetime;
- self = oldself;
+ W_BallisticBullet_LeaveSolid_think();
- if(lag)
- FOR_EACH_PLAYER(pl)
- if(pl != self)
- antilag_restore(pl);
+ self.projectiledeathtype |= HITTYPE_BOUNCE;
+ }
+ frametime = savetime;
+ self = oldself;
- remove(proj);
+ if(lag)
+ FOR_EACH_PLAYER(pl)
+ if(pl != self)
+ antilag_restore(pl);
- return;
- }
+ remove(proj);
- if(tracereffects & EF_RED)
- CSQCProjectile(proj, TRUE, PROJECTILE_BULLET_GLOWING_TRACER, TRUE);
- else if(tracereffects & EF_BLUE)
- CSQCProjectile(proj, TRUE, PROJECTILE_BULLET_GLOWING, TRUE);
- else
- CSQCProjectile(proj, TRUE, PROJECTILE_BULLET, TRUE);
+ return;
}
void fireBullet (vector start, vector dir, float spread, float damage, float force, float dtype, float tracer)
if (pointcontents (trace_endpos) != CONTENT_SKY)
{
- if not (trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)
- Damage_DamageInfo(trace_endpos, damage, 0, 0, dir * max(1, force), dtype, trace_ent.species, self);
+ if (!(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT))
+ Damage_DamageInfo(trace_endpos, damage, 0, 0, dir * max(1, force), dtype, trace_ent.species, self);
Damage (trace_ent, self, self, damage, dtype, trace_endpos, dir * force);
}
float is_from_contents = (deathtype == DEATH_SLIME || deathtype == DEATH_LAVA);
float is_from_owner = (inflictor == projowner);
float is_from_exception = (exception != -1);
-
+
//dprint(strcat("W_CheckProjectileDamage: from_contents ", ftos(is_from_contents), " : from_owner ", ftos(is_from_owner), " : exception ", strcat(ftos(is_from_exception), " (", ftos(exception), "). \n")));
if(autocvar_g_projectiles_damage <= -2)
{
if(is_from_exception)
return (exception); // if exception is detected, allow it to override
- else if not(is_from_contents)
+ else if (!is_from_contents)
return FALSE; // otherwise, only allow damage from contents
- }
+ }
else if(autocvar_g_projectiles_damage == 1)
{
if(is_from_exception)
return (exception); // if exception is detected, allow it to override
- else if not(is_from_contents || is_from_owner)
+ else if (!(is_from_contents || is_from_owner))
return FALSE; // otherwise, only allow self damage and damage from contents
}
else if(autocvar_g_projectiles_damage == 2) // allow any damage, but override for exceptions
{
self.takedamage = DAMAGE_NO;
self.event_damage = func_null;
-
+
if(IS_CLIENT(attacker) && !autocvar_g_projectiles_keep_owner)
{
self.owner = attacker;
self.realowner = attacker;
}
-
+
// do not explode NOW but in the NEXT FRAME!
// because recursive calls to RadiusDamage are not allowed
self.nextthink = time;
else
++hit_enemy;
}
-
+
head = head.chain;
}
f *= a;
float totaldamage = RadiusDamage(self, self.realowner, autocvar_g_balance_crylink_primary_damage * f, autocvar_g_balance_crylink_primary_edgedamage * f, autocvar_g_balance_crylink_primary_radius, world, autocvar_g_balance_crylink_primary_force * f, self.projectiledeathtype, other);
-
+
if(totaldamage && ((autocvar_g_balance_crylink_primary_linkexplode == 2) || ((autocvar_g_balance_crylink_primary_linkexplode == 1) && !W_Crylink_Touch_WouldHitFriendly(self, autocvar_g_balance_crylink_primary_radius))))
{
if(self == self.realowner.crylink_lastgroup)
f *= a;
float totaldamage = RadiusDamage(self, self.realowner, autocvar_g_balance_crylink_secondary_damage * f, autocvar_g_balance_crylink_secondary_edgedamage * f, autocvar_g_balance_crylink_secondary_radius, world, autocvar_g_balance_crylink_secondary_force * f, self.projectiledeathtype, other);
-
+
if(totaldamage && ((autocvar_g_balance_crylink_secondary_linkexplode == 2) || ((autocvar_g_balance_crylink_secondary_linkexplode == 1) && !W_Crylink_Touch_WouldHitFriendly(self, autocvar_g_balance_crylink_secondary_radius))))
{
if(self == self.realowner.crylink_lastgroup)
proj.flags = FL_PROJECTILE;
proj.missile_flags = MIF_SPLASH;
-
+
CSQCProjectile(proj, TRUE, (proj.cnt ? PROJECTILE_CRYLINK_BOUNCING : PROJECTILE_CRYLINK), TRUE);
other = proj; MUTATOR_CALLHOOK(EditProjectile);
proj.flags = FL_PROJECTILE;
proj.missile_flags = MIF_SPLASH;
-
+
CSQCProjectile(proj, TRUE, (proj.cnt ? PROJECTILE_CRYLINK_BOUNCING : PROJECTILE_CRYLINK), TRUE);
other = proj; MUTATOR_CALLHOOK(EditProjectile);
}
self.crylink_waitrelease = 0;
if(!w_crylink(WR_CHECKAMMO1) && !w_crylink(WR_CHECKAMMO2))
- if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
+ if (!(self.items & IT_UNLIMITED_WEAPON_AMMO))
{
// ran out of ammo!
self.cnt = WEP_CRYLINK;
// note: combos are usually triggered by W_Plasma_TriggerCombo, not damage
float is_combo = (inflictor.classname == "plasma_chain" || inflictor.classname == "plasma_prim");
-
+
if (!W_CheckProjectileDamage(inflictor.realowner, self.realowner, deathtype, (is_combo ? 1 : -1)))
- return; // g_projectiles_damage says to halt
-
+ return; // g_projectiles_damage says to halt
+
self.health = self.health - damage;
if (self.health <= 0)
{
dt = frametime;
// if this weapon is reloadable, decrease its load. Else decrease the player's ammo
- if not(owner_player.items & IT_UNLIMITED_WEAPON_AMMO)
+ if (!(owner_player.items & IT_UNLIMITED_WEAPON_AMMO))
{
if(autocvar_g_balance_electro_primary_ammo)
{
{
if(self.health <= 0)
return;
-
+
if (!W_CheckProjectileDamage(inflictor.realowner, self.realowner, deathtype, -1)) // no exceptions
return; // g_projectiles_damage says to halt
-
+
self.health = self.health - damage;
if (self.health <= 0)
{
setsize(proj, '-16 -16 -16', '16 16 16');
proj.flags = FL_PROJECTILE;
proj.missile_flags = MIF_SPLASH | MIF_PROXY;
-
+
CSQCProjectile(proj, TRUE, PROJECTILE_FIREBALL, TRUE);
other = proj; MUTATOR_CALLHOOK(EditProjectile);
proj.angles = vectoangles(proj.velocity);
proj.flags = FL_PROJECTILE;
proj.missile_flags = MIF_SPLASH | MIF_PROXY | MIF_ARC;
-
+
CSQCProjectile(proj, TRUE, PROJECTILE_FIREMINE, TRUE);
other = proj; MUTATOR_CALLHOOK(EditProjectile);
{
if (self.health <= 0)
return;
-
+
if (!W_CheckProjectileDamage(inflictor.realowner, self.realowner, deathtype, -1)) // no exceptions
return; // g_projectiles_damage says to halt
-
+
self.health = self.health - damage;
-
+
if (self.health <= 0)
W_PrepareExplosionByDamage(attacker, self.use);
}
spamsound (self, CH_SHOTS, "weapons/grenade_bounce6.wav", VOL_BASE, ATTEN_NORM);
self.projectiledeathtype |= HITTYPE_BOUNCE;
self.gl_bouncecnt += 1;
-
+
if (autocvar_g_balance_grenadelauncher_secondary_lifetime_bounce && self.gl_bouncecnt == 1)
self.nextthink = time + autocvar_g_balance_grenadelauncher_secondary_lifetime_bounce;
-
+
}
else if(autocvar_g_balance_grenadelauncher_secondary_type == 2 && (!other || (other.takedamage != DAMAGE_AIM && other.movetype == MOVETYPE_NONE))) // stick
{
{
if (self.health <= 0)
return;
-
+
float is_linkexplode = ( ((inflictor.owner != world) ? (inflictor.owner == self.owner) : TRUE)
- && (inflictor.projectiledeathtype & HITTYPE_SECONDARY)
+ && (inflictor.projectiledeathtype & HITTYPE_SECONDARY)
&& (self.projectiledeathtype & HITTYPE_SECONDARY));
-
+
if(is_linkexplode)
is_linkexplode = (is_linkexplode && autocvar_g_balance_hagar_secondary_load_linkexplode);
else
self.health = self.health - damage;
self.angles = vectoangles(self.velocity);
-
+
if (self.health <= 0)
W_PrepareExplosionByDamage(attacker, self.think);
}
missile.classname = "missile";
missile.bot_dodge = TRUE;
missile.bot_dodgerating = autocvar_g_balance_hagar_primary_damage;
-
+
missile.takedamage = DAMAGE_YES;
missile.health = autocvar_g_balance_hagar_primary_health;
missile.damageforcescale = autocvar_g_balance_hagar_primary_damageforcescale;
missile.event_damage = W_Hagar_Damage;
missile.damagedbycontents = TRUE;
-
+
missile.touch = W_Hagar_Touch;
missile.use = W_Hagar_Explode;
missile.think = adaptor_think2use_hittype_splash;
missile.angles = vectoangles (missile.velocity);
missile.flags = FL_PROJECTILE;
- missile.missile_flags = MIF_SPLASH;
+ missile.missile_flags = MIF_SPLASH;
CSQCProjectile(missile, TRUE, PROJECTILE_HAGAR, TRUE);
missile.classname = "missile";
missile.bot_dodge = TRUE;
missile.bot_dodgerating = autocvar_g_balance_hagar_secondary_damage;
-
+
missile.takedamage = DAMAGE_YES;
missile.health = autocvar_g_balance_hagar_secondary_health;
missile.damageforcescale = autocvar_g_balance_hagar_secondary_damageforcescale;
missile.angles = vectoangles (missile.velocity);
missile.flags = FL_PROJECTILE;
- missile.missile_flags = MIF_SPLASH;
+ missile.missile_flags = MIF_SPLASH;
CSQCProjectile(missile, TRUE, PROJECTILE_HAGAR_BOUNCING, TRUE);
missile.classname = "missile";
missile.bot_dodge = TRUE;
missile.bot_dodgerating = autocvar_g_balance_hagar_secondary_damage;
-
+
missile.takedamage = DAMAGE_YES;
missile.health = autocvar_g_balance_hagar_secondary_health;
missile.damageforcescale = autocvar_g_balance_hagar_secondary_damageforcescale;
setorigin (missile, w_shotorg);
setsize(missile, '0 0 0', '0 0 0');
missile.movetype = MOVETYPE_FLY;
- missile.missile_flags = MIF_SPLASH;
-
+ missile.missile_flags = MIF_SPLASH;
+
// per-shot spread calculation: the more shots there are, the less spread is applied (based on the bias cvar)
- spread_pershot = ((shots - 1) / (autocvar_g_balance_hagar_secondary_load_max - 1));
+ spread_pershot = ((shots - 1) / (autocvar_g_balance_hagar_secondary_load_max - 1));
spread_pershot = (1 - (spread_pershot * autocvar_g_balance_hagar_secondary_load_spread_bias));
spread_pershot = (autocvar_g_balance_hagar_secondary_spread * spread_pershot * g_weaponspreadfactor);
-
+
// pattern spread calculation
s = '0 0 0';
if (counter == 0)
s_z = v_forward_y;
}
s = s * autocvar_g_balance_hagar_secondary_load_spread * g_weaponspreadfactor;
-
+
W_SetupProjectileVelocityEx(missile, w_shotdir + right * s_y + up * s_z, v_up, autocvar_g_balance_hagar_secondary_speed, 0, 0, spread_pershot, FALSE);
missile.angles = vectoangles (missile.velocity);
void W_Hagar_Attack2_Load (void)
{
// loadable hagar secondary attack, must always run each frame
-
+
if(time < game_starttime)
return;
self.hagar_warning = TRUE;
}
}
-
+
// release if player let go of button or if they've held it in too long
if(!self.BUTTON_ATCK2 || ((loaded || !enough_ammo) && self.hagar_loadstep < time && autocvar_g_balance_hagar_secondary_load_hold >= 0))
{
}
// we aren't checking ammo during an attack, so we must do it here
- if not(weapon_action(self.weapon, WR_CHECKAMMO1) + weapon_action(self.weapon, WR_CHECKAMMO2))
+ if (!(weapon_action(self.weapon, WR_CHECKAMMO1) + weapon_action(self.weapon, WR_CHECKAMMO2)))
{
// note: this doesn't force the switch
W_SwitchToOtherWeapon(self);
}
else if (req == WR_RELOAD)
{
- if not(self.hagar_load) // require releasing loaded rockets first
+ if (!self.hagar_load) // require releasing loaded rockets first
W_Reload(min(autocvar_g_balance_hagar_primary_ammo, autocvar_g_balance_hagar_secondary_ammo), autocvar_g_balance_hagar_reload_ammo, autocvar_g_balance_hagar_reload_time, "weapons/reload.wav");
}
else if (req == WR_SUICIDEMESSAGE)
PROJECTILE_TOUCH;
self.event_damage = func_null;
-
+
if(self.projectiledeathtype & HITTYPE_SECONDARY)
RadiusDamage (self, self.realowner, autocvar_g_balance_hlac_secondary_damage, autocvar_g_balance_hlac_secondary_edgedamage, autocvar_g_balance_hlac_secondary_radius, world, autocvar_g_balance_hlac_secondary_force, self.projectiledeathtype, other);
else
missile.nextthink = time + autocvar_g_balance_hlac_secondary_lifetime;
missile.flags = FL_PROJECTILE;
- missile.missile_flags = MIF_SPLASH;
+ missile.missile_flags = MIF_SPLASH;
missile.projectiledeathtype = WEP_HLAC | HITTYPE_SECONDARY;
CSQCProjectile(missile, TRUE, PROJECTILE_HLAC, TRUE);
if (self.BUTTON_ATCK)
{
if (!weapon_action(self.weapon, WR_CHECKAMMO1))
- if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
+ if (!(self.items & IT_UNLIMITED_WEAPON_AMMO))
{
W_SwitchWeapon_Force(self, w_getbestweapon(self));
w_ready();
{
if (self.health <= 0)
return;
-
+
if (!W_CheckProjectileDamage(inflictor.realowner, self.realowner, deathtype, -1)) // no exceptions
- return; // g_projectiles_damage says to halt
-
+ return; // g_projectiles_damage says to halt
+
self.health = self.health - damage;
-
+
if (self.health <= 0)
W_PrepareExplosionByDamage(self.realowner, W_Hook_Explode2);
}
gren.think = adaptor_think2use_hittype_splash;
gren.use = W_Hook_Explode2;
gren.touch = W_Hook_Touch2;
-
+
gren.takedamage = DAMAGE_YES;
gren.health = autocvar_g_balance_hook_secondary_health;
gren.damageforcescale = autocvar_g_balance_hook_secondary_damageforcescale;
float w_hook(float req)
{
float hooked_time_max, hooked_fuel;
-
+
if (req == WR_AIM)
{
// ... sorry ...
if (self.BUTTON_ATCK || (!(self.items & IT_JETPACK) && self.BUTTON_HOOK))
{
if(!self.hook)
- if not(self.hook_state & HOOK_WAITING_FOR_RELEASE)
- if not(self.hook_state & HOOK_FIRING)
+ if (!(self.hook_state & HOOK_WAITING_FOR_RELEASE))
+ if (!(self.hook_state & HOOK_FIRING))
if (time > self.hook_refire)
if (weapon_prepareattack(0, -1))
{
W_DecreaseAmmo(ammo_fuel, autocvar_g_balance_hook_primary_fuel, FALSE);
self.hook_state |= HOOK_FIRING;
- weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_hook_primary_animtime, w_ready);
+ weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_hook_primary_animtime, w_ready);
}
}
self.hook_refire = max(self.hook_refire, time + autocvar_g_balance_hook_primary_refire * W_WeaponRateFactor());
// hook also inhibits health regeneration, but only for 1 second
- if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
+ if (!(self.items & IT_UNLIMITED_WEAPON_AMMO))
self.pauseregen_finished = max(self.pauseregen_finished, time + autocvar_g_balance_pause_fuel_regen);
}
if(self.hook && self.hook.state == 1)
{
- hooked_time_max = autocvar_g_balance_hook_primary_hooked_time_max;
+ hooked_time_max = autocvar_g_balance_hook_primary_hooked_time_max;
if (hooked_time_max > 0)
{
if ( time > self.hook_time_hooked + hooked_time_max )
self.hook_state |= HOOK_REMOVING;
}
-
+
hooked_fuel = autocvar_g_balance_hook_primary_hooked_fuel;
if (hooked_fuel > 0)
{
if ( time > self.hook_time_fueldecrease )
{
- if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
+ if (!(self.items & IT_UNLIMITED_WEAPON_AMMO))
{
if ( self.ammo_fuel >= (time - self.hook_time_fueldecrease) * hooked_fuel )
{
}
else
{
- self.hook_time_hooked = time;
+ self.hook_time_hooked = time;
self.hook_time_fueldecrease = time + autocvar_g_balance_hook_primary_hooked_time_free;
}
missile.touch = W_Laser_Touch;
missile.flags = FL_PROJECTILE;
- missile.missile_flags = MIF_SPLASH;
+ missile.missile_flags = MIF_SPLASH;
missile.think = W_Laser_Think;
missile.nextthink = time + autocvar_g_balance_laser_primary_delay;
self.movetype = MOVETYPE_NONE;
}
}
-
+
// our lifetime has expired, it's time to die - mine_time just allows us to play a sound for this
// TODO: replace this mine_trigger.wav sound with a real countdown
if ((time > self.cnt) && (!self.mine_time))
{
if (self.health <= 0)
return;
-
+
float is_from_enemy = (inflictor.realowner != self.realowner);
-
+
if (!W_CheckProjectileDamage(inflictor.realowner, self.realowner, deathtype, (is_from_enemy ? 1 : -1)))
return; // g_projectiles_damage says to halt
-
+
self.health = self.health - damage;
self.angles = vectoangles(self.velocity);
-
+
if (self.health <= 0)
W_PrepareExplosionByDamage(attacker, W_Mine_Explode);
}
// common properties
other = mine; MUTATOR_CALLHOOK(EditProjectile);
-
+
self.minelayer_mines = W_Mine_Count(self);
}
if(autocvar_g_balance_minelayer_reload_ammo && self.clip_load < autocvar_g_balance_minelayer_ammo) // forced reload
{
// not if we're holding the minelayer without enough ammo, but can detonate existing mines
- if not (W_PlacedMines(FALSE) && self.ammo_rockets < autocvar_g_balance_minelayer_ammo)
+ if (!(W_PlacedMines(FALSE) && self.ammo_rockets < autocvar_g_balance_minelayer_ammo))
weapon_action(self.weapon, WR_RELOAD);
}
else if (self.BUTTON_ATCK)
WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3"), w_shotorg, v);
break;
}
-
+
W_DecreaseAmmo(ammo_cells, ((g_minstagib) ? 1 : autocvar_g_balance_minstanex_ammo), autocvar_g_balance_minstanex_reload_ammo);
}
{
// handle refire manually, so that primary and secondary can be fired without conflictions (important for minstagib)
self.jump_interval = time + autocvar_g_balance_minstanex_laser_refire * W_WeaponRateFactor();
-
+
// decrease ammo for the laser?
if(autocvar_g_balance_minstanex_laser_ammo)
W_DecreaseAmmo(ammo_cells, autocvar_g_balance_minstanex_laser_ammo, autocvar_g_balance_minstanex_reload_ammo);
self.weapon = WEP_LASER;
W_Laser_Attack(2);
self.weapon = w;
-
+
// now do normal refire
weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_minstanex_laser_animtime, w_ready);
}
FireRailgunBullet (w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, mydmg, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, WEP_NEX);
if(yoda && flying)
- Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_ACHIEVEMENT_YODA);
+ Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_ACHIEVEMENT_YODA);
//beam and muzzle flash done on client
SendCSQCNexBeamParticle(charge);
if(self.BUTTON_ATCK2) // only eat ammo when the button is pressed
{
dt = min(dt, (1 - self.nex_charge) / autocvar_g_balance_nex_secondary_charge_rate);
- if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
+ if (!(self.items & IT_UNLIMITED_WEAPON_AMMO))
{
// if this weapon is reloadable, decrease its load. Else decrease the player's ammo
if(autocvar_g_balance_nex_reload_ammo)
{
// don't allow charging if we don't have enough ammo
ammo_amount = self.ammo_cells >= autocvar_g_balance_nex_secondary_ammo;
- ammo_amount += self.(weapon_load[WEP_NEX]) >= autocvar_g_balance_nex_secondary_ammo;
+ ammo_amount += self.(weapon_load[WEP_NEX]) >= autocvar_g_balance_nex_secondary_ammo;
return ammo_amount;
}
else
W_DecreaseAmmo(ammo_nails, pAmmo, autocvar_g_balance_rifle_reload_ammo);
- W_SetupShot (self, autocvar_g_antilag_bullets && pSpeed >= autocvar_g_antilag_bullets, 2, pSound, CH_WEAPON_A, pDamage * pShots);
+ W_SetupShot (self, TRUE, 2, pSound, CH_WEAPON_A, pDamage * pShots);
pointparticles(particleeffectnum("rifle_muzzleflash"), w_shotorg, w_shotdir * 2000, 1);
}
for(i = 0; i < pShots; ++i)
- fireBallisticBullet(w_shotorg, w_shotdir, pSpread, pSpeed, pLifetime, pDamage, pForce, deathtype, (pTracer ? EF_RED : EF_BLUE), 1, pBulletConstant);
+ fireBallisticBullet(w_shotorg, w_shotdir, pSpread, pSpeed, pLifetime, pDamage, pForce, deathtype, (pTracer ? EF_RED : EF_BLUE), pBulletConstant);
endFireBallisticBullet();
if (autocvar_g_casings >= 2)
if (self.realowner.weapon == WEP_ROCKET_LAUNCHER)
{
if(self == self.realowner.lastrocket)
- if not(self.realowner.rl_release)
- if not(self.BUTTON_ATCK2)
+ if (!self.realowner.rl_release)
+ if (!self.BUTTON_ATCK2)
if(autocvar_g_balance_rocketlauncher_guiderate)
if(time > self.pushltime)
if(self.realowner.deadflag == DEAD_NO)
{
if (self.health <= 0)
return;
-
+
if (!W_CheckProjectileDamage(inflictor.realowner, self.realowner, deathtype, -1)) // no exceptions
return; // g_projectiles_damage says to halt
-
+
self.health = self.health - damage;
self.angles = vectoangles(self.velocity);
-
+
if (self.health <= 0)
W_PrepareExplosionByDamage(attacker, W_Rocket_Explode);
}
missile.nextthink = time;
missile.cnt = time + autocvar_g_balance_rocketlauncher_lifetime;
missile.flags = FL_PROJECTILE;
- missile.missile_flags = MIF_SPLASH;
+ missile.missile_flags = MIF_SPLASH;
CSQCProjectile(missile, autocvar_g_balance_rocketlauncher_guiderate == 0 && autocvar_g_balance_rocketlauncher_speedaccel == 0, PROJECTILE_ROCKET, FALSE); // because of fly sound
// Calc how important it is that we turn and add this to the desierd (enemy) dir.
desireddir = normalize(((trace_plane_normal * (1 - trace_fraction)) + (desireddir * trace_fraction)) * 0.5);
}
-
+
newdir = normalize(olddir + desireddir * turnrate); // take the average of the 2 directions; not the best method but simple & easy
self.velocity = newdir * spd; // make me fly in the new direction at my flight speed
}
{
if (self.health <= 0)
return;
-
+
if (!W_CheckProjectileDamage(inflictor.realowner, self.realowner, deathtype, -1)) // no exceptions
return; // g_projectiles_damage says to halt
self.health = self.health - (damage * 0.25);
else
self.health = self.health - damage;
-
+
if (self.health <= 0)
W_PrepareExplosionByDamage(attacker, Seeker_Missile_Explode);
}
missile.damageforcescale = autocvar_g_balance_seeker_missile_damageforcescale;
missile.damagedbycontents = TRUE;
//missile.think = Seeker_Missile_Animate; // csqc projectiles.
-
+
if (missile.enemy != world)
missile.projectiledeathtype = WEP_SEEKER | HITTYPE_SECONDARY;
- else
+ else
missile.projectiledeathtype = WEP_SEEKER;
missile.movetype = MOVETYPE_FLYMISSILE;
missile.flags = FL_PROJECTILE;
missile.missile_flags = MIF_SPLASH | MIF_GUIDED_TAG;
-
+
W_SETUPPROJECTILEVELOCITY_UP(missile, g_balance_seeker_missile);
missile.angles = vectoangles (missile.velocity);
}
// ============================
-// Begin: FLAC, close range attack meant for defeating rockets which are coming at you.
+// Begin: FLAC, close range attack meant for defeating rockets which are coming at you.
// ============================
void Seeker_Flac_Explode ()
{
missile.bot_dodge = TRUE;
missile.bot_dodgerating = autocvar_g_balance_seeker_flac_damage;
missile.touch = Seeker_Flac_Explode;
- missile.use = Seeker_Flac_Explode;
+ missile.use = Seeker_Flac_Explode;
missile.think = adaptor_think2use_hittype_splash;
missile.nextthink = time + autocvar_g_balance_seeker_flac_lifetime + autocvar_g_balance_seeker_flac_lifetime_rand;
missile.solid = SOLID_BBOX;
- missile.movetype = MOVETYPE_FLY;
+ missile.movetype = MOVETYPE_FLY;
missile.projectiledeathtype = WEP_SEEKER;
missile.projectiledeathtype = WEP_SEEKER | HITTYPE_SECONDARY;
missile.flags = FL_PROJECTILE;
- missile.missile_flags = MIF_SPLASH;
-
+ missile.missile_flags = MIF_SPLASH;
+
// csqc projectiles
- //missile.angles = vectoangles (missile.velocity);
- //missile.scale = 0.4; // BUG: the model is too big
-
+ //missile.angles = vectoangles (missile.velocity);
+ //missile.scale = 0.4; // BUG: the model is too big
+
setorigin (missile, w_shotorg);
setsize (missile, '-2 -2 -2', '2 2 2');
-
+
W_SETUPPROJECTILEVELOCITY_UP(missile, g_balance_seeker_flac);
CSQCProjectile(missile, TRUE, PROJECTILE_FLAC, TRUE);
}
// ============================
-// Begin: Tag and rocket controllers
+// Begin: Tag and rocket controllers
// ============================
entity Seeker_Tagged_Info(entity isowner, entity istarget)
{
entity tag;
- for(tag = world; (tag = find(tag, classname, "tag_tracker")); )
+ for(tag = world; (tag = find(tag, classname, "tag_tracker")); )
if ((tag.realowner == isowner) && (tag.tag_target == istarget))
return tag;
-
+
return world;
}
void Seeker_Attack()
{
entity tracker, closest_target;
-
+
closest_target = world;
for(tracker = world; (tracker = find(tracker, classname, "tag_tracker")); ) if (tracker.realowner == self)
{
if (vlen(self.origin - tracker.tag_target.origin) < vlen(self.origin - closest_target.origin))
closest_target = tracker.tag_target;
}
- else
+ else
closest_target = tracker.tag_target;
}
-
+
traceline(self.origin + self.view_ofs, closest_target.origin, MOVE_NOMONSTERS, self);
if ((!closest_target) || ((trace_fraction < 1) && (trace_ent != closest_target)))
closest_target = world;
-
+
Seeker_Fire_Missile('0 0 0', closest_target);
}
}
self.nextthink = time + autocvar_g_balance_seeker_missile_delay * W_WeaponRateFactor();
-
+
oldself = self;
self = self.realowner;
-
+
oldenemy = self.enemy;
self.enemy = oldself.enemy;
-
+
c = mod(self.cnt, 4);
switch(c)
{
self = oldself;
}
-void Seeker_Tracker_Think()
+void Seeker_Tracker_Think()
{
// commit suicide if: You die OR target dies OR you switch away from the seeker OR commit suicide if lifetime is up
if ((self.realowner.deadflag != DEAD_NO) || (self.tag_target.deadflag != DEAD_NO) || (self.realowner.switchweapon != WEP_SEEKER)
}
return;
}
-
+
// Update the think method information
self.nextthink = time;
}
// ============================
-// Begin: Tag projectile
+// Begin: Tag projectile
// ============================
void Seeker_Tag_Explode ()
{
vector dir;
vector org2;
entity e;
-
+
PROJECTILE_TOUCH;
dir = normalize (self.realowner.origin - self.origin);
{
// check to see if this person is already tagged by me
entity tag = Seeker_Tagged_Info(self.realowner, other);
-
+
if (tag != world)
{
if (other.wps_tag_tracker && (autocvar_g_balance_seeker_type == 1)) // don't attach another waypointsprite without killing the old one first
WaypointSprite_Kill(other.wps_tag_tracker);
-
+
tag.tag_time = time;
}
else
- {
+ {
//sprint(self.realowner, strcat("You just tagged ^2", other.netname, "^7 with a tracking device!\n"));
e = spawn();
e.cnt = autocvar_g_balance_seeker_missile_count;
e.classname = "tag_tracker";
e.owner = self.owner;
e.realowner = self.realowner;
-
+
if (autocvar_g_balance_seeker_type == 1)
{
e.tag_target = other;
e.tag_time = time;
e.think = Seeker_Tracker_Think;
}
- else
+ else
{
e.enemy = other;
e.think = Seeker_Vollycontroller_Think;
}
-
+
e.nextthink = time;
}
-
+
if (autocvar_g_balance_seeker_type == 1)
{
WaypointSprite_Spawn("tagged-target", autocvar_g_balance_seeker_tag_tracker_lifetime, 0, other, '0 0 64', self.realowner, 0, other, wps_tag_tracker, TRUE, RADARICON_TAGGED, '0.5 1 0');
setsize (missile, '-2 -2 -2', '2 2 2');
missile.flags = FL_PROJECTILE;
- //missile.missile_flags = MIF_..?;
+ //missile.missile_flags = MIF_..?;
missile.movetype = MOVETYPE_FLY;
W_SETUPPROJECTILEVELOCITY(missile, g_balance_seeker_tag);
if (req == WR_AIM)
{
- if (autocvar_g_balance_seeker_type == 1)
+ if (autocvar_g_balance_seeker_type == 1)
if (Seeker_Tagged_Info(self, self.enemy) != world)
self.BUTTON_ATCK = bot_aim(autocvar_g_balance_seeker_missile_speed_max, 0, autocvar_g_balance_seeker_missile_lifetime, FALSE);
else
{
if(autocvar_g_balance_seeker_reload_ammo && self.clip_load < min(autocvar_g_balance_seeker_missile_ammo, autocvar_g_balance_seeker_tag_ammo)) // forced reload
weapon_action(self.weapon, WR_RELOAD);
-
+
else if (self.BUTTON_ATCK)
{
- if (autocvar_g_balance_seeker_type == 1)
+ if (autocvar_g_balance_seeker_type == 1)
{
if (weapon_prepareattack(0, autocvar_g_balance_seeker_missile_refire))
{
weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_seeker_missile_animtime, w_ready);
}
}
- else
+ else
{
if (weapon_prepareattack(0, autocvar_g_balance_seeker_tag_refire))
{
else if (self.BUTTON_ATCK2)
{
- if (autocvar_g_balance_seeker_type == 1)
+ if (autocvar_g_balance_seeker_type == 1)
{
if (weapon_prepareattack(0, autocvar_g_balance_seeker_tag_refire))
{
weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_seeker_tag_animtime, w_ready);
}
}
- else
+ else
{
if (weapon_prepareattack(0, autocvar_g_balance_seeker_flac_refire))
{
}
else if (req == WR_CHECKAMMO1)
{
- if (autocvar_g_balance_seeker_type == 1)
+ if (autocvar_g_balance_seeker_type == 1)
{
ammo_amount = self.ammo_rockets >= autocvar_g_balance_seeker_missile_ammo;
ammo_amount += self.(weapon_load[WEP_SEEKER]) >= autocvar_g_balance_seeker_missile_ammo;
ammo_amount = self.ammo_rockets >= autocvar_g_balance_seeker_tag_ammo;
ammo_amount += self.(weapon_load[WEP_SEEKER]) >= autocvar_g_balance_seeker_tag_ammo;
}
-
+
return ammo_amount;
}
else if (req == WR_CHECKAMMO2)
{
- if (autocvar_g_balance_seeker_type == 1)
+ if (autocvar_g_balance_seeker_type == 1)
{
ammo_amount = self.ammo_rockets >= autocvar_g_balance_seeker_tag_ammo;
ammo_amount += self.(weapon_load[WEP_SEEKER]) >= autocvar_g_balance_seeker_tag_ammo;
ammo_amount = self.ammo_rockets >= autocvar_g_balance_seeker_flac_ammo;
ammo_amount += self.(weapon_load[WEP_SEEKER]) >= autocvar_g_balance_seeker_flac_ammo;
}
-
+
return ammo_amount;
}
else if (req == WR_RELOAD)
W_DecreaseAmmo(ammo_shells, ammoamount, autocvar_g_balance_shotgun_reload_ammo);
- W_SetupShot (self, autocvar_g_antilag_bullets && bulletspeed >= autocvar_g_antilag_bullets, 5, "weapons/shotgun_fire.wav", CH_WEAPON_A, d * bullets);
+ W_SetupShot (self, TRUE, 5, "weapons/shotgun_fire.wav", CH_WEAPON_A, d * bullets);
for (sc = 0;sc < bullets;sc = sc + 1)
- fireBallisticBullet(w_shotorg, w_shotdir, spread, bulletspeed, 5, d, f, WEP_SHOTGUN, 0, 1, bulletconstant);
+ fireBallisticBullet(w_shotorg, w_shotdir, spread, bulletspeed, 5, d, f, WEP_SHOTGUN, 0, bulletconstant);
endFireBallisticBullet();
pointparticles(particleeffectnum("shotgun_muzzleflash"), w_shotorg, w_shotdir * 1000, autocvar_g_balance_shotgun_primary_ammo);
if(!self.cnt) // set start time of melee
{
- self.cnt = time;
+ self.cnt = time;
W_PlayStrengthSound(self.realowner);
}
makevectors(self.realowner.v_angle); // update values for v_* vectors
-
+
// calculate swing percentage based on time
meleetime = autocvar_g_balance_shotgun_secondary_melee_time * W_WeaponRateFactor();
swing = bound(0, (self.cnt + meleetime - time) / meleetime, 10);
f = ((1 - swing) * autocvar_g_balance_shotgun_secondary_melee_traces);
-
+
// check to see if we can still continue, otherwise give up now
if((self.realowner.deadflag != DEAD_NO) && autocvar_g_balance_shotgun_secondary_melee_no_doubleslap)
{
remove(self);
return;
}
-
- // if okay, perform the traces needed for this frame
+
+ // if okay, perform the traces needed for this frame
for(i=self.swing_prev; i < f; ++i)
{
swing_factor = ((1 - (i / autocvar_g_balance_shotgun_secondary_melee_traces)) * 2 - 1);
-
- targpos = (self.realowner.origin + self.realowner.view_ofs
+
+ targpos = (self.realowner.origin + self.realowner.view_ofs
+ (v_forward * autocvar_g_balance_shotgun_secondary_melee_range)
+ (v_up * swing_factor * autocvar_g_balance_shotgun_secondary_melee_swing_up)
+ (v_right * swing_factor * autocvar_g_balance_shotgun_secondary_melee_swing_side));
WarpZone_traceline_antilag(self, self.realowner.origin + self.realowner.view_ofs, targpos, FALSE, self, ANTILAG_LATENCY(self.realowner));
-
+
// draw lightning beams for debugging
- //te_lightning2(world, targpos, self.realowner.origin + self.realowner.view_ofs + v_forward * 5 - v_up * 5);
+ //te_lightning2(world, targpos, self.realowner.origin + self.realowner.view_ofs + v_forward * 5 - v_up * 5);
//te_customflash(targpos, 40, 2, '1 1 1');
-
+
is_player = (IS_PLAYER(trace_ent) || trace_ent.classname == "body");
if((trace_fraction < 1) // if trace is good, apply the damage and remove self
- && (trace_ent.takedamage == DAMAGE_AIM)
+ && (trace_ent.takedamage == DAMAGE_AIM)
&& (trace_ent != self.swing_alreadyhit)
&& (is_player || autocvar_g_balance_shotgun_secondary_melee_nonplayerdamage))
{
target_victim = trace_ent; // so it persists through other calls
-
+
if(is_player) // this allows us to be able to nerf the non-player damage done in e.g. assault or onslaught.
swing_damage = (autocvar_g_balance_shotgun_secondary_damage * min(1, swing_factor + 1));
else
swing_damage = (autocvar_g_balance_shotgun_secondary_melee_nonplayerdamage * min(1, swing_factor + 1));
-
+
//print(strcat(self.realowner.netname, " hitting ", target_victim.netname, " with ", strcat(ftos(swing_damage), " damage (factor: ", ftos(swing_factor), ") at "), ftos(time), " seconds.\n"));
-
- Damage(target_victim, self.realowner, self.realowner,
- swing_damage, WEP_SHOTGUN | HITTYPE_SECONDARY,
- self.realowner.origin + self.realowner.view_ofs,
+
+ Damage(target_victim, self.realowner, self.realowner,
+ swing_damage, WEP_SHOTGUN | HITTYPE_SECONDARY,
+ self.realowner.origin + self.realowner.view_ofs,
v_forward * autocvar_g_balance_shotgun_secondary_force);
-
+
if(accuracy_isgooddamage(self.realowner, target_victim)) { accuracy_add(self.realowner, WEP_SHOTGUN, 0, swing_damage); }
-
+
// draw large red flash for debugging
//te_customflash(targpos, 200, 2, '15 0 0');
-
+
if(autocvar_g_balance_shotgun_secondary_melee_multihit) // allow multiple hits with one swing, but not against the same player twice.
{
self.swing_alreadyhit = target_victim;
}
}
}
-
+
if(time >= self.cnt + meleetime)
{
// melee is finished
}
else
{
- // set up next frame
+ // set up next frame
self.swing_prev = i;
self.nextthink = time;
}
if(vlen(self.origin-self.enemy.origin) <= autocvar_g_balance_shotgun_secondary_melee_range)
self.BUTTON_ATCK2 = bot_aim(1000000, 0, 0.001, FALSE);
else
- {
- if(autocvar_g_antilag_bullets)
- self.BUTTON_ATCK = bot_aim(1000000, 0, 0.001, FALSE);
- else
- self.BUTTON_ATCK = bot_aim(autocvar_g_balance_shotgun_primary_speed, 0, 0.001, FALSE);
- }
+ self.BUTTON_ATCK = bot_aim(1000000, 0, 0.001, FALSE);
else if (req == WR_THINK)
{
if(autocvar_g_balance_shotgun_reload_ammo && self.clip_load < autocvar_g_balance_shotgun_primary_ammo) // forced reload
{
// don't force reload an empty shotgun if its melee attack is active
- if not(autocvar_g_balance_shotgun_secondary && self.ammo_shells < autocvar_g_balance_shotgun_primary_ammo)
+ if (!(autocvar_g_balance_shotgun_secondary && self.ammo_shells < autocvar_g_balance_shotgun_primary_ammo))
weapon_action(self.weapon, WR_RELOAD);
}
else
note += 12;
if(hittype & HITTYPE_SECONDARY)
note += 7;
-
+
// we support two kinds of tubas, those tuned in Eb and those tuned in C
// kind of tuba currently is player slot number, or team number if in
// teamplay
if(pl.clientcolors & 1)
note += 3;
}
-
+
// total range of notes:
// 0
// *** ** ****
}
}
- if not(self.tuba_note)
+ if (!self.tuba_note)
{
self.tuba_note = spawn();
self.tuba_note.owner = self.tuba_note.realowner = self;
void W_UZI_Attack (float deathtype)
{
- W_SetupShot (self, autocvar_g_antilag_bullets && autocvar_g_balance_uzi_speed >= autocvar_g_antilag_bullets, 0, "weapons/uzi_fire.wav", CH_WEAPON_A, ((self.misc_bulletcounter == 1) ? autocvar_g_balance_uzi_first_damage : autocvar_g_balance_uzi_sustained_damage));
+ W_SetupShot (self, TRUE, 0, "weapons/uzi_fire.wav", CH_WEAPON_A, ((self.misc_bulletcounter == 1) ? autocvar_g_balance_uzi_first_damage : autocvar_g_balance_uzi_sustained_damage));
if (!autocvar_g_norecoil)
{
self.punchangle_x = random () - 0.5;
ATTACK_FINISHED(self) = time + autocvar_g_balance_uzi_first_refire * W_WeaponRateFactor();
if (self.misc_bulletcounter == 1)
- fireBallisticBullet(w_shotorg, w_shotdir, autocvar_g_balance_uzi_first_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_first_damage, autocvar_g_balance_uzi_first_force, deathtype, 0, 1, autocvar_g_balance_uzi_bulletconstant);
+ fireBallisticBullet(w_shotorg, w_shotdir, autocvar_g_balance_uzi_first_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_first_damage, autocvar_g_balance_uzi_first_force, deathtype, 0, autocvar_g_balance_uzi_bulletconstant);
else
- fireBallisticBullet(w_shotorg, w_shotdir, autocvar_g_balance_uzi_sustained_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_sustained_damage, autocvar_g_balance_uzi_sustained_force, deathtype, 0, 1, autocvar_g_balance_uzi_bulletconstant);
+ fireBallisticBullet(w_shotorg, w_shotdir, autocvar_g_balance_uzi_sustained_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_sustained_damage, autocvar_g_balance_uzi_sustained_force, deathtype, 0, autocvar_g_balance_uzi_bulletconstant);
endFireBallisticBullet();
pointparticles(particleeffectnum("uzi_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
if (self.BUTTON_ATCK)
{
if (!weapon_action(self.weapon, WR_CHECKAMMO2))
- if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
+ if (!(self.items & IT_UNLIMITED_WEAPON_AMMO))
{
W_SwitchWeapon_Force(self, w_getbestweapon(self));
w_ready();
}
if (!weapon_action(self.weapon, WR_CHECKAMMO1))
- if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
+ if (!(self.items & IT_UNLIMITED_WEAPON_AMMO))
{
W_SwitchWeapon_Force(self, w_getbestweapon(self));
w_ready();
W_DecreaseAmmo(ammo_nails, autocvar_g_balance_uzi_sustained_ammo, autocvar_g_balance_uzi_reload_ammo);
- W_SetupShot (self, autocvar_g_antilag_bullets && autocvar_g_balance_uzi_speed >= autocvar_g_antilag_bullets, 0, "weapons/uzi_fire.wav", CH_WEAPON_A, autocvar_g_balance_uzi_sustained_damage);
+ W_SetupShot (self, TRUE, 0, "weapons/uzi_fire.wav", CH_WEAPON_A, autocvar_g_balance_uzi_sustained_damage);
if (!autocvar_g_norecoil)
{
self.punchangle_x = random () - 0.5;
}
uzi_spread = bound(autocvar_g_balance_uzi_spread_min, autocvar_g_balance_uzi_spread_min + (autocvar_g_balance_uzi_spread_add * self.misc_bulletcounter), autocvar_g_balance_uzi_spread_max);
- fireBallisticBullet(w_shotorg, w_shotdir, uzi_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_sustained_damage, autocvar_g_balance_uzi_sustained_force, WEP_UZI, 0, 1, autocvar_g_balance_uzi_bulletconstant);
+ fireBallisticBullet(w_shotorg, w_shotdir, uzi_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_sustained_damage, autocvar_g_balance_uzi_sustained_force, WEP_UZI, 0, autocvar_g_balance_uzi_bulletconstant);
endFireBallisticBullet();
self.misc_bulletcounter = self.misc_bulletcounter + 1;
void uzi_mode1_fire_burst()
{
- W_SetupShot (self, autocvar_g_antilag_bullets && autocvar_g_balance_uzi_speed >= autocvar_g_antilag_bullets, 0, "weapons/uzi_fire.wav", CH_WEAPON_A, autocvar_g_balance_uzi_sustained_damage);
+ W_SetupShot (self, TRUE, 0, "weapons/uzi_fire.wav", CH_WEAPON_A, autocvar_g_balance_uzi_sustained_damage);
if (!autocvar_g_norecoil)
{
self.punchangle_x = random () - 0.5;
self.punchangle_y = random () - 0.5;
}
- fireBallisticBullet(w_shotorg, w_shotdir, autocvar_g_balance_uzi_burst_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_sustained_damage, autocvar_g_balance_uzi_sustained_force, WEP_UZI, 0, 1, autocvar_g_balance_uzi_bulletconstant);
+ fireBallisticBullet(w_shotorg, w_shotdir, autocvar_g_balance_uzi_burst_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_sustained_damage, autocvar_g_balance_uzi_sustained_force, WEP_UZI, 0, autocvar_g_balance_uzi_bulletconstant);
endFireBallisticBullet();
if(weapon_prepareattack(1, 0))
{
if (!weapon_action(self.weapon, WR_CHECKAMMO2))
- if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
+ if (!(self.items & IT_UNLIMITED_WEAPON_AMMO))
{
W_SwitchWeapon_Force(self, w_getbestweapon(self));
w_ready();
{
if(self.team != e.team)
return FALSE;
- if not(IS_PLAYER(e))
+ if (!IS_PLAYER(e))
return FALSE;
}
WriteByte(MSG_ENTITY, ENT_CLIENT_WAYPOINT);
sendflags = sendflags & 0x7F;
-
+
if(g_nexball)
sendflags &= ~0x80;
else if(self.max_health || (self.pain_finished && (time < self.pain_finished + 0.25)))
--- /dev/null
+FILES=`find client common menu server warpzonelib -name \*.c -o -name \*.h -o -name \*.qc -o -name \*.qh`
+out_raw()
+{
+ printf "%s\n" "$LINE"
+}
+out()
+{
+ printf "%-40s = %-8s # %s\n" "$KEY" "$VAL" "$COMMENT"
+}
+decide()
+{
+ verybestchoice=
+ verybestscore=2147483647
+ bestchoice=
+ bestscore=2147483647
+ secondbestchoice=
+ secondbestscore=2147483647
+ worstscore=0
+ haveignore=false
+ havefalse=false
+ have0=false
+ seen=
+ for choice in "$VAL" "$@"; do
+ case " $seen " in
+ *" $choice "*)
+ continue
+ ;;
+ *)
+ seen=$seen" $VAL"
+ ;;
+ esac
+ if [ x"$choice" = x"force" ]; then
+ continue
+ fi
+ if [ x"$choice" = x"ignore" ]; then
+ haveignore=true
+ fi
+ if [ x"$choice" = x"false" ]; then
+ havefalse=true
+ fi
+ if [ x"$choice" = x"0" ]; then
+ have0=true
+ fi
+ if [ x"$MODE" = x"initialize" ]; then
+ if [ x"$choice" = x"ignore" ]; then
+ score=0
+ else
+ score=2147483647
+ fi
+ else
+ {
+ cat uncrustify.cfg
+ printf "%s = %s\n" "$KEY" "$choice"
+ } > uncrustify.cfg.test
+ UNCRUSTIFY_CONFIG=uncrustify.cfg.test sh uncrustify.sh $FILES >/dev/null 2>&1
+ status=$?
+ if [ $status -gt 1 ]; then
+ echo "# ERROR: $KEY = $choice crashes with status $status."
+ continue
+ fi
+ score=0
+ git diff --numstat > diffstat.tmp
+ while read -r add del rest; do
+ if [ x"$add" != x"-" ]; then
+ score=$(($score + $add))
+ fi
+ if [ x"$del" != x"-" ]; then
+ score=$(($score + $del))
+ fi
+ done < diffstat.tmp
+ git reset --hard >/dev/null 2>&1
+ fi
+ echo >&2 "$KEY = $choice: $score"
+ if [ x"$choice" != x"ignore" ]; then
+ if [ $score -lt $bestscore ]; then
+ secondbestscore=$bestscore
+ secondbestchoice=$bestchoice
+ bestscore=$score
+ bestchoice=$choice
+ elif [ $score -lt $secondbestscore ]; then
+ secondbestscore=$score
+ secondbestchoice=$choice
+ fi
+ fi
+ if [ $score -lt $verybestscore ]; then
+ verybestscore=$score
+ verybestchoice=$choice
+ fi
+ if [ $score -gt $worstscore ]; then
+ worstscore=$score
+ worstchoice=$choice
+ fi
+ done
+ if [ -z "$bestchoice" ]; then
+ echo "# WARNING: No best choice identified"
+ elif [ $verybestscore -ge $worstscore ]; then
+ echo "# WARNING: Code doesn't seem to use this feature - delete from the config?"
+ if $haveignore; then
+ VAL=ignore
+ elif $havefalse; then
+ VAL=false
+ elif $have0; then
+ VAL=0
+ fi
+ elif [ $bestscore -ge $worstscore ]; then
+ echo "# WARNING: Indifferent... please decide manually."
+ elif [ $bestscore -ge $secondbestscore ]; then
+ echo "# WARNING: Best is not unique ($bestchoice $secondbestchoice)"
+ elif [ $bestscore -gt $verybestscore ]; then
+ echo "# NOTE: is $(($bestscore - $verybestscore)) worse than $verybestchoice"
+ VAL=$bestchoice
+ else
+ VAL=$bestchoice
+ fi
+}
+while read -r LINE; do
+ case "$LINE" in
+ "# NOTE: "*)
+ continue
+ ;;
+ "# WARNING: "*)
+ continue
+ ;;
+ "# ERROR: "*)
+ continue
+ ;;
+ "#"*)
+ out_raw
+ continue
+ ;;
+ *"#force"*|*"#ignore"*)
+ out_raw
+ continue
+ ;;
+ esac
+ printf "%s\n" "$LINE" | while read KEY EQ VAL DELIM COMMENT; do
+ if \
+ [ x"$EQ" != x"=" ] || \
+ [ x"$DELIM" != x"#" ]; then
+ out_raw
+ continue
+ fi
+ case "$COMMENT" in
+ number)
+ case "$KEY" in
+ indent_columns|*tab*)
+ decide 1 2 4 8
+ ;;
+ *)
+ decide 0 1 2 3 indent_columns
+ ;;
+ esac
+ out
+ ;;
+ string)
+ printf "# WARNING: unsupported %s\n" "$COMMENT"
+ out_raw
+ ;;
+ *[!a-z/_]*)
+ printf "# ERROR: invalid characters %s\n" "$COMMENT"
+ out_raw
+ ;;
+ */*)
+ decide `echo "$COMMENT" | tr / ' '`
+ out
+ ;;
+ *)
+ printf "# ERROR: only once choice %s\n" "$COMMENT"
+ out_raw
+ ;;
+ esac
+ done
+done < uncrustify.cfg
--- /dev/null
+# Uncrustify 0.60
+
+#
+# General options
+#
+
+# The type of line endings
+# WARNING: Best is not unique (auto lf)
+newlines = auto # auto/lf/crlf/cr
+
+# The original size of tabs in the input
+input_tab_size = 4 # number
+
+# The size of tabs in the output (only used if align_with_tabs=true)
+output_tab_size = 4 # number
+
+# The ASCII value of the string escape char, usually 92 (\) or 94 (^). (Pawn)
+string_escape_char = 92 # number #ignore
+
+# Alternate string escape char for Pawn. Only works right before the quote char.
+string_escape_char2 = 0 # number #ignore
+
+# Allow interpreting '>=' and '>>=' as part of a template in 'void f(list<list<B>>=val);'.
+# If true (default), 'assert(x<0 && y>=3)' will be broken.
+# Improvements to template detection may make this option obsolete.
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+tok_split_gte = false # false/true
+
+# Control what to do with the UTF-8 BOM (recommend 'remove')
+utf8_bom = remove # ignore/add/remove/force #force
+
+# If the file contains bytes with values between 128 and 255, but is not UTF-8, then output as UTF-8
+utf8_byte = true # false/true #force
+
+# Force the output encoding to UTF-8
+utf8_force = true # false/true #force
+
+#
+# Indenting
+#
+
+# The number of columns to indent per level.
+# Usually 2, 3, 4, or 8.
+indent_columns = 4 # number
+
+# The continuation indent. If non-zero, this overrides the indent of '(' and '=' continuation indents.
+# For FreeBSD, this is set to 4. Negative value is absolute and not increased for each ( level
+indent_continue = indent_columns # number
+
+# How to use tabs when indenting code
+# 0=spaces only
+# 1=indent with tabs to brace level, align with spaces
+# 2=indent and align with tabs, using spaces when not on a tabstop
+indent_with_tabs = 1 # number #force
+
+# Comments that are not a brace level are indented with tabs on a tabstop.
+# Requires indent_with_tabs=2. If false, will use spaces.
+indent_cmt_with_tabs = false # false/true
+
+# Whether to indent strings broken by '\' so that they line up
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+indent_align_string = false # false/true
+
+# The number of spaces to indent multi-line XML strings.
+# Requires indent_align_string=True
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+indent_xml_string = 0 # number
+
+# Spaces to indent '{' from level
+indent_brace = 0 # number
+
+# Whether braces are indented to the body level
+indent_braces = false # false/true
+
+# Disabled indenting function braces if indent_braces is true
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+indent_braces_no_func = false # false/true
+
+# Disabled indenting class braces if indent_braces is true
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+indent_braces_no_class = false # false/true
+
+# Disabled indenting struct braces if indent_braces is true
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+indent_braces_no_struct = false # false/true
+
+# Indent based on the size of the brace parent, i.e. 'if' => 3 spaces, 'for' => 4 spaces, etc.
+indent_brace_parent = false # false/true
+
+# Whether the 'namespace' body is indented
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+indent_namespace = false # false/true
+
+# The number of spaces to indent a namespace block
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+indent_namespace_level = 0 # number
+
+# If the body of the namespace is longer than this number, it won't be indented.
+# Requires indent_namespace=true. Default=0 (no limit)
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+indent_namespace_limit = 0 # number
+
+# Whether the 'extern "C"' body is indented
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+indent_extern = false # false/true
+
+# Whether the 'class' body is indented
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+indent_class = false # false/true
+
+# Whether to indent the stuff after a leading class colon
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+indent_class_colon = false # false/true
+
+# Virtual indent from the ':' for member initializers. Default is 2
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+indent_ctor_init_leading = 0 # number
+
+# Additional indenting for constructor initializer list
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+indent_ctor_init = 0 # number
+
+# False=treat 'else\nif' as 'else if' for indenting purposes
+# True=indent the 'if' one level
+indent_else_if = true # false/true
+
+# Amount to indent variable declarations after a open brace. neg=relative, pos=absolute
+indent_var_def_blk = 0 # number
+
+# Indent continued variable declarations instead of aligning.
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+indent_var_def_cont = false # false/true
+
+# True: force indentation of function definition to start in column 1
+# False: use the default behavior
+indent_func_def_force_col1 = false # false/true
+
+# True: indent continued function call parameters one indent level
+# False: align parameters under the open paren
+indent_func_call_param = true # false/true
+
+# Same as indent_func_call_param, but for function defs
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+indent_func_def_param = false # false/true
+
+# Same as indent_func_call_param, but for function protos
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+indent_func_proto_param = false # false/true
+
+# Same as indent_func_call_param, but for class declarations
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+indent_func_class_param = false # false/true
+
+# Same as indent_func_call_param, but for class variable constructors
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+indent_func_ctor_var_param = false # false/true
+
+# Same as indent_func_call_param, but for templates
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+indent_template_param = false # false/true
+
+# Double the indent for indent_func_xxx_param options
+indent_func_param_double = true # false/true
+
+# Indentation column for standalone 'const' function decl/proto qualifier
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+indent_func_const = 0 # number
+
+# Indentation column for standalone 'throw' function decl/proto qualifier
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+indent_func_throw = 0 # number
+
+# The number of spaces to indent a continued '->' or '.'
+# Usually set to 0, 1, or indent_columns.
+indent_member = 0 # number
+
+# Spaces to indent single line ('//') comments on lines before code
+indent_sing_line_comments = 0 # number
+
+# If set, will indent trailing single line ('//') comments relative
+# to the code instead of trying to keep the same absolute column
+indent_relative_single_line_comments = true # false/true #force
+
+# Spaces to indent 'case' from 'switch'
+# Usually 0 or indent_columns.
+indent_switch_case = indent_columns # number
+
+# Spaces to shift the 'case' line, without affecting any other lines
+# Usually 0.
+indent_case_shift = 0 # number
+
+# Spaces to indent '{' from 'case'.
+# By default, the brace will appear under the 'c' in case.
+# Usually set to 0 or indent_columns.
+indent_case_brace = 0 # number
+
+# Whether to indent comments found in first column
+indent_col1_comment = false # false/true
+
+# How to indent goto labels
+# >0 : absolute column where 1 is the leftmost column
+# <=0 : subtract from brace indent
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+indent_label = 0 # number
+
+# Same as indent_label, but for access specifiers that are followed by a colon
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+indent_access_spec = 0 # number
+
+# Indent the code after an access specifier by one level.
+# If set, this option forces 'indent_access_spec=0'
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+indent_access_spec_body = false # false/true
+
+# If an open paren is followed by a newline, indent the next line so that it lines up after the open paren (not recommended)
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+indent_paren_nl = false # false/true
+
+# Controls the indent of a close paren after a newline.
+# 0: Indent to body level
+# 1: Align under the open paren
+# 2: Indent to the brace level
+indent_paren_close = 1 # number #force
+
+# Controls the indent of a comma when inside a paren.If TRUE, aligns under the open paren
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+indent_comma_paren = false # false/true
+
+# Controls the indent of a BOOL operator when inside a paren.If TRUE, aligns under the open paren
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+indent_bool_paren = false # false/true
+
+# If 'indent_bool_paren' is true, controls the indent of the first expression. If TRUE, aligns the first expression to the following ones
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+indent_first_bool_expr = false # false/true
+
+# If an open square is followed by a newline, indent the next line so that it lines up after the open square (not recommended)
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+indent_square_nl = false # false/true
+
+# Don't change the relative indent of ESQL/C 'EXEC SQL' bodies
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+indent_preserve_sql = false # false/true
+
+# Align continued statements at the '='. Default=True
+# If FALSE or the '=' is followed by a newline, the next line is indent one tab.
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+indent_align_assign = false # false/true
+
+# Indent OC blocks at brace level instead of usual rules.
+indent_oc_block = false # false/true #ignore
+
+# Indent OC blocks in a message relative to the parameter name.
+# 0=use indent_oc_block rules, 1+=spaces to indent #ignore
+indent_oc_block_msg = 0 # number #ignore
+
+# Minimum indent for subsequent parameters
+indent_oc_msg_colon = 0 # number #ignore
+
+#
+# Spacing options
+#
+
+# Add or remove space around arithmetic operator '+', '-', '/', '*', etc
+sp_arith = ignore # ignore/add/remove/force #force
+
+# Add or remove space around assignment operator '=', '+=', etc
+# NOTE: is 54 worse than ignore
+sp_assign = add # ignore/add/remove/force
+
+# Add or remove space around '=' in C++11 lambda capture specifications. Overrides sp_assign
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_cpp_lambda_assign = ignore # ignore/add/remove/force
+
+# Add or remove space after the capture specification in C++11 lambda.
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_cpp_lambda_paren = ignore # ignore/add/remove/force
+
+# Add or remove space around assignment operator '=' in a prototype
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_assign_default = ignore # ignore/add/remove/force
+
+# Add or remove space before assignment operator '=', '+=', etc. Overrides sp_assign.
+sp_before_assign = ignore # ignore/add/remove/force #force
+
+# Add or remove space after assignment operator '=', '+=', etc. Overrides sp_assign.
+sp_after_assign = ignore # ignore/add/remove/force #force
+
+# Add or remove space around assignment '=' in enum
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_enum_assign = ignore # ignore/add/remove/force
+
+# Add or remove space before assignment '=' in enum. Overrides sp_enum_assign.
+sp_enum_before_assign = ignore # ignore/add/remove/force #force
+
+# Add or remove space after assignment '=' in enum. Overrides sp_enum_assign.
+sp_enum_after_assign = ignore # ignore/add/remove/force #force
+
+# Add or remove space around preprocessor '##' concatenation operator. Default=Add
+# NOTE: is 4 worse than ignore
+sp_pp_concat = remove # ignore/add/remove/force
+
+# Add or remove space after preprocessor '#' stringify operator. Also affects the '#@' charizing operator.
+sp_pp_stringify = remove # ignore/add/remove/force
+
+# Add or remove space before preprocessor '#' stringify operator as in '#define x(y) L#y'.
+sp_before_pp_stringify = add # ignore/add/remove/force
+
+# Add or remove space around boolean operators '&&' and '||'
+# NOTE: is 2 worse than ignore
+sp_bool = add # ignore/add/remove/force
+
+# Add or remove space around compare operator '<', '>', '==', etc
+# NOTE: is 198 worse than ignore
+sp_compare = add # ignore/add/remove/force
+
+# Add or remove space inside '(' and ')'
+# NOTE: is 10 worse than ignore
+sp_inside_paren = remove # ignore/add/remove/force
+
+# Add or remove space between nested parens
+# NOTE: is 18 worse than ignore
+sp_paren_paren = remove # ignore/add/remove/force
+
+# Whether to balance spaces inside nested parens
+sp_balance_nested_parens = false # false/true
+
+# Add or remove space between ')' and '{'
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_paren_brace = ignore # ignore/add/remove/force
+
+# Add or remove space before pointer star '*'
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_before_ptr_star = ignore # ignore/add/remove/force
+
+# Add or remove space before pointer star '*' that isn't followed by a variable name
+# If set to 'ignore', sp_before_ptr_star is used instead.
+sp_before_unnamed_ptr_star = add # ignore/add/remove/force
+
+# Add or remove space between pointer stars '*'
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_between_ptr_star = ignore # ignore/add/remove/force
+
+# Add or remove space after pointer star '*', if followed by a word.
+sp_after_ptr_star = add # ignore/add/remove/force
+
+# Add or remove space after a pointer star '*', if followed by a func proto/def.
+sp_after_ptr_star_func = add # ignore/add/remove/force
+
+# Add or remove space after a pointer star '*', if followed by an open paren (function types).
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_ptr_star_paren = ignore # ignore/add/remove/force
+
+# Add or remove space before a pointer star '*', if followed by a func proto/def.
+sp_before_ptr_star_func = add # ignore/add/remove/force
+
+# Add or remove space before a reference sign '&'
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_before_byref = ignore # ignore/add/remove/force
+
+# Add or remove space before a reference sign '&' that isn't followed by a variable name
+# If set to 'ignore', sp_before_byref is used instead.
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_before_unnamed_byref = ignore # ignore/add/remove/force
+
+# Add or remove space after reference sign '&', if followed by a word.
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_after_byref = ignore # ignore/add/remove/force
+
+# Add or remove space after a reference sign '&', if followed by a func proto/def.
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_after_byref_func = ignore # ignore/add/remove/force
+
+# Add or remove space before a reference sign '&', if followed by a func proto/def.
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_before_byref_func = ignore # ignore/add/remove/force
+
+# Add or remove space between type and word. Default=Force
+sp_after_type = add # ignore/add/remove/force
+
+# Add or remove space before the paren in the D constructs 'template Foo(' and 'class Foo('.
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_before_template_paren = ignore # ignore/add/remove/force
+
+# Add or remove space in 'template <' vs 'template<'.
+# If set to ignore, sp_before_angle is used.
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_template_angle = ignore # ignore/add/remove/force
+
+# Add or remove space before '<>'
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_before_angle = ignore # ignore/add/remove/force
+
+# Add or remove space inside '<' and '>'
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_inside_angle = ignore # ignore/add/remove/force
+
+# Add or remove space after '<>'
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_after_angle = ignore # ignore/add/remove/force
+
+# Add or remove space between '<>' and '(' as found in 'new List<byte>();'
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_angle_paren = ignore # ignore/add/remove/force
+
+# Add or remove space between '<>' and a word as in 'List<byte> m;'
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_angle_word = ignore # ignore/add/remove/force
+
+# Add or remove space between '>' and '>' in '>>' (template stuff C++/C# only). Default=Add
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_angle_shift = ignore # ignore/add/remove/force
+
+# Permit removal of the space between '>>' in 'foo<bar<int> >' (C++11 only). Default=False
+# sp_angle_shift cannot remove the space without this option.
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_permit_cpp11_shift = false # false/true
+
+# Add or remove space before '(' of 'if', 'for', 'switch', and 'while'
+sp_before_sparen = remove # ignore/add/remove/force #force
+
+# Add or remove space inside if-condition '(' and ')'
+# NOTE: is 42 worse than ignore
+sp_inside_sparen = remove # ignore/add/remove/force
+
+# Add or remove space before if-condition ')'. Overrides sp_inside_sparen.
+sp_inside_sparen_close = ignore # ignore/add/remove/force #force
+
+# Add or remove space before if-condition '('. Overrides sp_inside_sparen.
+sp_inside_sparen_open = ignore # ignore/add/remove/force #force
+
+# Add or remove space after ')' of 'if', 'for', 'switch', and 'while'
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_after_sparen = ignore # ignore/add/remove/force
+
+# Add or remove space between ')' and '{' of 'if', 'for', 'switch', and 'while'
+sp_sparen_brace = add # ignore/add/remove/force
+
+# Add or remove space between 'invariant' and '(' in the D language.
+sp_invariant_paren = ignore # ignore/add/remove/force #ignore
+
+# Add or remove space after the ')' in 'invariant (C) c' in the D language.
+sp_after_invariant_paren = ignore # ignore/add/remove/force #ignore
+
+# Add or remove space before empty statement ';' on 'if', 'for' and 'while'
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_special_semi = ignore # ignore/add/remove/force
+
+# Add or remove space before ';'. Default=Remove
+# NOTE: is 2 worse than ignore
+sp_before_semi = remove # ignore/add/remove/force
+
+# Add or remove space before ';' in non-empty 'for' statements
+sp_before_semi_for = remove # ignore/add/remove/force
+
+# Add or remove space before a semicolon of an empty part of a for statement.
+sp_before_semi_for_empty = add # ignore/add/remove/force
+
+# Add or remove space after ';', except when followed by a comment. Default=Add
+# NOTE: is 56 worse than ignore
+sp_after_semi = add # ignore/add/remove/force
+
+# Add or remove space after ';' in non-empty 'for' statements. Default=Force
+sp_after_semi_for = add # ignore/add/remove/force
+
+# Add or remove space after the final semicolon of an empty part of a for statement: for ( ; ; <here> ).
+sp_after_semi_for_empty = add # ignore/add/remove/force
+
+# Add or remove space before '[' (except '[]')
+sp_before_square = remove # ignore/add/remove/force
+
+# Add or remove space before '[]'
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_before_squares = ignore # ignore/add/remove/force
+
+# Add or remove space inside a non-empty '[' and ']'
+sp_inside_square = remove # ignore/add/remove/force
+
+# Add or remove space after ','
+sp_after_comma = add # ignore/add/remove/force #force
+
+# Add or remove space before ','
+# NOTE: is 58 worse than ignore
+sp_before_comma = remove # ignore/add/remove/force
+
+# Add or remove space between an open paren and comma: '(,' vs '( ,'
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_paren_comma = ignore # ignore/add/remove/force
+
+# Add or remove space before the variadic '...' when preceded by a non-punctuator
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_before_ellipsis = ignore # ignore/add/remove/force
+
+# Add or remove space after class ':'
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_after_class_colon = ignore # ignore/add/remove/force
+
+# Add or remove space before class ':'
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_before_class_colon = ignore # ignore/add/remove/force
+
+# Add or remove space before case ':'. Default=Remove
+sp_before_case_colon = remove # ignore/add/remove/force
+
+# Add or remove space between 'operator' and operator sign
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_after_operator = ignore # ignore/add/remove/force
+
+# Add or remove space between the operator symbol and the open paren, as in 'operator ++('
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_after_operator_sym = ignore # ignore/add/remove/force
+
+# Add or remove space after C/D cast, i.e. 'cast(int)a' vs 'cast(int) a' or '(int)a' vs '(int) a'
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_after_cast = ignore # ignore/add/remove/force
+
+# Add or remove spaces inside cast parens
+sp_inside_paren_cast = remove # ignore/add/remove/force
+
+# Add or remove space between the type and open paren in a C++ cast, i.e. 'int(exp)' vs 'int (exp)'
+sp_cpp_cast_paren = remove # ignore/add/remove/force
+
+# Add or remove space between 'sizeof' and '('
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_sizeof_paren = ignore # ignore/add/remove/force
+
+# Add or remove space after the tag keyword (Pawn)
+sp_after_tag = ignore # ignore/add/remove/force #ignore
+
+# Add or remove space inside enum '{' and '}'
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_inside_braces_enum = ignore # ignore/add/remove/force
+
+# Add or remove space inside struct/union '{' and '}'
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_inside_braces_struct = ignore # ignore/add/remove/force
+
+# Add or remove space inside '{' and '}'
+sp_inside_braces = add # ignore/add/remove/force
+
+# Add or remove space inside '{}'
+# NOTE: is 10 worse than ignore
+sp_inside_braces_empty = remove # ignore/add/remove/force
+
+# Add or remove space between return type and function name
+# A minimum of 1 is forced except for pointer return types.
+sp_type_func = add # ignore/add/remove/force
+
+# Add or remove space between function name and '(' on function declaration
+# NOTE: is 30 worse than ignore
+sp_func_proto_paren = remove # ignore/add/remove/force
+
+# Add or remove space between function name and '(' on function definition
+# NOTE: is 400 worse than ignore
+sp_func_def_paren = remove # ignore/add/remove/force
+
+# Add or remove space inside empty function '()'
+sp_inside_fparens = remove # ignore/add/remove/force
+
+# Add or remove space inside function '(' and ')'
+# NOTE: is 78 worse than ignore
+sp_inside_fparen = remove # ignore/add/remove/force
+
+# Add or remove space inside the first parens in the function type: 'void (*x)(...)'
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_inside_tparen = ignore # ignore/add/remove/force
+
+# Add or remove between the parens in the function type: 'void (*x)(...)'
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_after_tparen_close = ignore # ignore/add/remove/force
+
+# Add or remove space between ']' and '(' when part of a function call.
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_square_fparen = ignore # ignore/add/remove/force
+
+# Add or remove space between ')' and '{' of function
+sp_fparen_brace = add # ignore/add/remove/force
+
+# Add or remove space between function name and '(' on function calls
+# NOTE: is 940 worse than ignore
+sp_func_call_paren = remove # ignore/add/remove/force
+
+# Add or remove space between function name and '()' on function calls without parameters.
+# If set to 'ignore' (the default), sp_func_call_paren is used.
+sp_func_call_paren_empty = remove # ignore/add/remove/force
+
+# Add or remove space between the user function name and '(' on function calls
+# You need to set a keyword to be a user function, like this: 'set func_call_user _' in the config file.
+sp_func_call_user_paren = remove # ignore/add/remove/force
+
+# Add or remove space between a constructor/destructor and the open paren
+sp_func_class_paren = remove # ignore/add/remove/force
+
+# Add or remove space between 'return' and '('
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_return_paren = ignore # ignore/add/remove/force
+
+# Add or remove space between '__attribute__' and '('
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_attribute_paren = ignore # ignore/add/remove/force
+
+# Add or remove space between 'defined' and '(' in '#if defined (FOO)'
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_defined_paren = ignore # ignore/add/remove/force
+
+# Add or remove space between 'throw' and '(' in 'throw (something)'
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_throw_paren = ignore # ignore/add/remove/force
+
+# Add or remove space between 'throw' and anything other than '(' as in '@throw [...];'
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_after_throw = ignore # ignore/add/remove/force
+
+# Add or remove space between 'catch' and '(' in 'catch (something) { }'
+# If set to ignore, sp_before_sparen is used.
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_catch_paren = ignore # ignore/add/remove/force
+
+# Add or remove space between 'version' and '(' in 'version (something) { }' (D language)
+# If set to ignore, sp_before_sparen is used.
+sp_version_paren = ignore # ignore/add/remove/force #ignore
+
+# Add or remove space between 'scope' and '(' in 'scope (something) { }' (D language)
+# If set to ignore, sp_before_sparen is used.
+sp_scope_paren = ignore # ignore/add/remove/force #ignore
+
+# Add or remove space between macro and value
+sp_macro = remove # ignore/add/remove/force #force
+
+# Add or remove space between macro function ')' and value
+sp_macro_func = remove # ignore/add/remove/force #force
+
+# Add or remove space between 'else' and '{' if on the same line
+sp_else_brace = add # ignore/add/remove/force
+
+# Add or remove space between '}' and 'else' if on the same line
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_brace_else = ignore # ignore/add/remove/force
+
+# Add or remove space between '}' and the name of a typedef on the same line
+sp_brace_typedef = add # ignore/add/remove/force
+
+# Add or remove space between 'catch' and '{' if on the same line
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_catch_brace = ignore # ignore/add/remove/force
+
+# Add or remove space between '}' and 'catch' if on the same line
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_brace_catch = ignore # ignore/add/remove/force
+
+# Add or remove space between 'finally' and '{' if on the same line
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_finally_brace = ignore # ignore/add/remove/force
+
+# Add or remove space between '}' and 'finally' if on the same line
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_brace_finally = ignore # ignore/add/remove/force
+
+# Add or remove space between 'try' and '{' if on the same line
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_try_brace = ignore # ignore/add/remove/force
+
+# Add or remove space between get/set and '{' if on the same line
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_getset_brace = ignore # ignore/add/remove/force
+
+# Add or remove space before the '::' operator
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_before_dc = ignore # ignore/add/remove/force
+
+# Add or remove space after the '::' operator
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_after_dc = ignore # ignore/add/remove/force
+
+# Add or remove around the D named array initializer ':' operator
+sp_d_array_colon = ignore # ignore/add/remove/force #ignore
+
+# Add or remove space after the '!' (not) operator. Default=Remove
+sp_not = remove # ignore/add/remove/force
+
+# Add or remove space after the '~' (invert) operator. Default=Remove
+sp_inv = remove # ignore/add/remove/force
+
+# Add or remove space after the '&' (address-of) operator. Default=Remove
+# This does not affect the spacing after a '&' that is part of a type.
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_addr = ignore # ignore/add/remove/force
+
+# Add or remove space around the '.' or '->' operators. Default=Remove
+# NOTE: is 28 worse than ignore
+sp_member = remove # ignore/add/remove/force
+
+# Add or remove space after the '*' (dereference) operator. Default=Remove
+# This does not affect the spacing after a '*' that is part of a type.
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_deref = ignore # ignore/add/remove/force
+
+# Add or remove space after '+' or '-', as in 'x = -5' or 'y = +7'. Default=Remove
+# NOTE: is 4 worse than ignore
+sp_sign = remove # ignore/add/remove/force
+
+# Add or remove space before or after '++' and '--', as in '(--x)' or 'y++;'. Default=Remove
+sp_incdec = remove # ignore/add/remove/force
+
+# Add or remove space before a backslash-newline at the end of a line. Default=Add
+sp_before_nl_cont = add # ignore/add/remove/force #force
+
+# Add or remove space after the scope '+' or '-', as in '-(void) foo;' or '+(int) bar;'
+sp_after_oc_scope = ignore # ignore/add/remove/force #ignore
+
+# Add or remove space after the colon in message specs
+# '-(int) f:(int) x;' vs '-(int) f: (int) x;'
+sp_after_oc_colon = ignore # ignore/add/remove/force #ignore
+
+# Add or remove space before the colon in message specs
+# '-(int) f: (int) x;' vs '-(int) f : (int) x;'
+sp_before_oc_colon = ignore # ignore/add/remove/force #ignore
+
+# Add or remove space after the colon in immutable dictionary expression
+# 'NSDictionary *test = @{@"foo" :@"bar"};'
+sp_after_oc_dict_colon = ignore # ignore/add/remove/force #ignore
+
+# Add or remove space before the colon in immutable dictionary expression
+# 'NSDictionary *test = @{@"foo" :@"bar"};'
+sp_before_oc_dict_colon = ignore # ignore/add/remove/force #ignore
+
+# Add or remove space after the colon in message specs
+# '[object setValue:1];' vs '[object setValue: 1];'
+sp_after_send_oc_colon = ignore # ignore/add/remove/force #ignore
+
+# Add or remove space before the colon in message specs
+# '[object setValue:1];' vs '[object setValue :1];'
+sp_before_send_oc_colon = ignore # ignore/add/remove/force #ignore
+
+# Add or remove space after the (type) in message specs
+# '-(int)f: (int) x;' vs '-(int)f: (int)x;'
+sp_after_oc_type = ignore # ignore/add/remove/force #ignore
+
+# Add or remove space after the first (type) in message specs
+# '-(int) f:(int)x;' vs '-(int)f:(int)x;'
+sp_after_oc_return_type = ignore # ignore/add/remove/force #ignore
+
+# Add or remove space between '@selector' and '('
+# '@selector(msgName)' vs '@selector (msgName)'
+# Also applies to @protocol() constructs
+sp_after_oc_at_sel = ignore # ignore/add/remove/force #ignore
+
+# Add or remove space between '@selector(x)' and the following word
+# '@selector(foo) a:' vs '@selector(foo)a:'
+sp_after_oc_at_sel_parens = ignore # ignore/add/remove/force #ignore
+
+# Add or remove space inside '@selector' parens
+# '@selector(foo)' vs '@selector( foo )'
+# Also applies to @protocol() constructs
+sp_inside_oc_at_sel_parens = ignore # ignore/add/remove/force #ignore
+
+# Add or remove space before a block pointer caret
+# '^int (int arg){...}' vs. ' ^int (int arg){...}'
+sp_before_oc_block_caret = ignore # ignore/add/remove/force #ignore
+
+# Add or remove space after a block pointer caret
+# '^int (int arg){...}' vs. '^ int (int arg){...}'
+sp_after_oc_block_caret = ignore # ignore/add/remove/force #ignore
+
+# Add or remove space between the receiver and selector in a message.
+# '[receiver selector ...]'
+sp_after_oc_msg_receiver = ignore # ignore/add/remove/force #ignore
+
+# Add or remove space after @property.
+sp_after_oc_property = ignore # ignore/add/remove/force #ignore
+
+# Add or remove space around the ':' in 'b ? t : f'
+sp_cond_colon = add # ignore/add/remove/force
+
+# Add or remove space around the '?' in 'b ? t : f'
+sp_cond_question = add # ignore/add/remove/force
+
+# Fix the spacing between 'case' and the label. Only 'ignore' and 'force' make sense here.
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_case_label = ignore # ignore/add/remove/force
+
+# Control the space around the D '..' operator.
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_range = ignore # ignore/add/remove/force
+
+# Control the spacing after ':' in 'for (TYPE VAR : EXPR)' (Java)
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_after_for_colon = ignore # ignore/add/remove/force
+
+# Control the spacing before ':' in 'for (TYPE VAR : EXPR)' (Java)
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_before_for_colon = ignore # ignore/add/remove/force
+
+# Control the spacing in 'extern (C)' (D)
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_extern_paren = ignore # ignore/add/remove/force
+
+# Control the space after the opening of a C++ comment '// A' vs '//A'
+sp_cmt_cpp_start = add # ignore/add/remove/force #force
+
+# Controls the spaces between #else or #endif and a trailing comment
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_endif_cmt = ignore # ignore/add/remove/force
+
+# Controls the spaces after 'new', 'delete', and 'delete[]'
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_after_new = ignore # ignore/add/remove/force
+
+# Controls the spaces before a trailing or embedded comment
+sp_before_tr_emb_cmt = force # ignore/add/remove/force #force
+
+# Number of spaces before a trailing or embedded comment
+sp_num_before_tr_emb_cmt = 2 # number #force
+
+# Control space between a Java annotation and the open paren.
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+sp_annotation_paren = ignore # ignore/add/remove/force
+
+#
+# Code alignment (not left column spaces/tabs)
+#
+
+# Whether to keep non-indenting tabs
+align_keep_tabs = false # false/true #force
+
+# Whether to use tabs for aligning
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+align_with_tabs = false # false/true
+
+# Whether to bump out to the next tab when aligning
+align_on_tabstop = false # false/true
+
+# Whether to left-align numbers
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+align_number_left = false # false/true
+
+# Align variable definitions in prototypes and functions
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+align_func_params = false # false/true
+
+# Align parameters in single-line functions that have the same name.
+# The function names must already be aligned with each other.
+align_same_func_call_params = false # false/true
+
+# The span for aligning variable definitions (0=don't align)
+align_var_def_span = 0 # number
+
+# How to align the star in variable definitions.
+# 0=Part of the type 'void * foo;'
+# 1=Part of the variable 'void *foo;'
+# 2=Dangling 'void *foo;'
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+align_var_def_star_style = 0 # number
+
+# How to align the '&' in variable definitions.
+# 0=Part of the type
+# 1=Part of the variable
+# 2=Dangling
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+align_var_def_amp_style = 0 # number
+
+# The threshold for aligning variable definitions (0=no limit)
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+align_var_def_thresh = 0 # number
+
+# The gap for aligning variable definitions
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+align_var_def_gap = 0 # number
+
+# Whether to align the colon in struct bit fields
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+align_var_def_colon = false # false/true
+
+# Whether to align any attribute after the variable name
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+align_var_def_attribute = false # false/true
+
+# Whether to align inline struct/enum/union variable definitions
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+align_var_def_inline = false # false/true
+
+# The span for aligning on '=' in assignments (0=don't align)
+align_assign_span = 0 # number
+
+# The threshold for aligning on '=' in assignments (0=no limit)
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+align_assign_thresh = 0 # number
+
+# The span for aligning on '=' in enums (0=don't align)
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+align_enum_equ_span = 0 # number
+
+# The threshold for aligning on '=' in enums (0=no limit)
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+align_enum_equ_thresh = 0 # number
+
+# The span for aligning struct/union (0=don't align)
+align_var_struct_span = 0 # number
+
+# The threshold for aligning struct/union member definitions (0=no limit)
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+align_var_struct_thresh = 0 # number
+
+# The gap for aligning struct/union member definitions
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+align_var_struct_gap = 0 # number
+
+# The span for aligning struct initializer values (0=don't align)
+align_struct_init_span = 0 # number
+
+# The minimum space between the type and the synonym of a typedef
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+align_typedef_gap = 0 # number
+
+# The span for aligning single-line typedefs (0=don't align)
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+align_typedef_span = 0 # number
+
+# How to align typedef'd functions with other typedefs
+# 0: Don't mix them at all
+# 1: align the open paren with the types
+# 2: align the function type name with the other type names
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+align_typedef_func = 0 # number
+
+# Controls the positioning of the '*' in typedefs. Just try it.
+# 0: Align on typedef type, ignore '*'
+# 1: The '*' is part of type name: typedef int *pint;
+# 2: The '*' is part of the type, but dangling: typedef int *pint;
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+align_typedef_star_style = 0 # number
+
+# Controls the positioning of the '&' in typedefs. Just try it.
+# 0: Align on typedef type, ignore '&'
+# 1: The '&' is part of type name: typedef int &pint;
+# 2: The '&' is part of the type, but dangling: typedef int &pint;
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+align_typedef_amp_style = 0 # number
+
+# The span for aligning comments that end lines (0=don't align)
+align_right_cmt_span = 2 # number
+
+# If aligning comments, mix with comments after '}' and #endif with less than 3 spaces before the comment
+align_right_cmt_mix = false # false/true
+
+# If a trailing comment is more than this number of columns away from the text it follows,
+# it will qualify for being aligned. This has to be > 0 to do anything.
+# WARNING: Best is not unique (0 1)
+align_right_cmt_gap = 0 # number
+
+# Align trailing comment at or beyond column N; 'pulls in' comments as a bonus side effect (0=ignore)
+# WARNING: Best is not unique (1 2)
+align_right_cmt_at_col = 0 # number
+
+# The span for aligning function prototypes (0=don't align)
+align_func_proto_span = 0 # number
+
+# Minimum gap between the return type and the function name.
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+align_func_proto_gap = 0 # number
+
+# Align function protos on the 'operator' keyword instead of what follows
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+align_on_operator = false # false/true
+
+# Whether to mix aligning prototype and variable declarations.
+# If true, align_var_def_XXX options are used instead of align_func_proto_XXX options.
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+align_mix_var_proto = false # false/true
+
+# Align single-line functions with function prototypes, uses align_func_proto_span
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+align_single_line_func = false # false/true
+
+# Aligning the open brace of single-line functions.
+# Requires align_single_line_func=true, uses align_func_proto_span
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+align_single_line_brace = false # false/true
+
+# Gap for align_single_line_brace.
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+align_single_line_brace_gap = 0 # number
+
+# The span for aligning ObjC msg spec (0=don't align)
+align_oc_msg_spec_span = 0 # number #ignore
+
+# Whether to align macros wrapped with a backslash and a newline.
+# This will not work right if the macro contains a multi-line comment.
+align_nl_cont = false # false/true
+
+# # Align macro functions and variables together
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+align_pp_define_together = false # false/true
+
+# The minimum space between label and value of a preprocessor define
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+align_pp_define_gap = 0 # number
+
+# The span for aligning on '#define' bodies (0=don't align)
+align_pp_define_span = 0 # number
+
+# Align lines that start with '<<' with previous '<<'. Default=true
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+align_left_shift = false # false/true
+
+# Span for aligning parameters in an Obj-C message call on the ':' (0=don't align)
+align_oc_msg_colon_span = 0 # number #ignore
+
+# If true, always align with the first parameter, even if it is too short.
+align_oc_msg_colon_first = false # false/true #ignore
+
+# Aligning parameters in an Obj-C '+' or '-' declaration on the ':'
+align_oc_decl_colon = false # false/true #ignore
+
+#
+# Newline adding and removing options
+#
+
+# Whether to collapse empty blocks between '{' and '}'
+nl_collapse_empty_body = false # false/true
+
+# Don't split one-line braced assignments - 'foo_t f = { 1, 2 };'
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+nl_assign_leave_one_liners = false # false/true
+
+# Don't split one-line braced statements inside a class xx { } body
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+nl_class_leave_one_liners = false # false/true
+
+# Don't split one-line enums: 'enum foo { BAR = 15 };'
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+nl_enum_leave_one_liners = false # false/true
+
+# Don't split one-line get or set functions
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+nl_getset_leave_one_liners = false # false/true
+
+# Don't split one-line function definitions - 'int foo() { return 0; }'
+nl_func_leave_one_liners = true # false/true
+
+# Don't split one-line if/else statements - 'if(a) b++;'
+nl_if_leave_one_liners = true # false/true
+
+# Don't split one-line OC messages
+nl_oc_msg_leave_one_liner = false # false/true #ignore
+
+# Add or remove newlines at the start of the file
+nl_start_of_file = remove # ignore/add/remove/force #force
+
+# The number of newlines at the start of the file (only used if nl_start_of_file is 'add' or 'force'
+nl_start_of_file_min = 0 # number #force
+
+# Add or remove newline at the end of the file
+nl_end_of_file = add # ignore/add/remove/force #force
+
+# The number of newlines at the end of the file (only used if nl_end_of_file is 'add' or 'force')
+nl_end_of_file_min = 1 # number #force
+
+# Add or remove newline between '=' and '{'
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+nl_assign_brace = ignore # ignore/add/remove/force
+
+# Add or remove newline between '=' and '[' (D only)
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+nl_assign_square = ignore # ignore/add/remove/force
+
+# Add or remove newline after '= [' (D only). Will also affect the newline before the ']'
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+nl_after_square_assign = ignore # ignore/add/remove/force
+
+# The number of blank lines after a block of variable definitions at the top of a function body
+# 0 = No change (default)
+nl_func_var_def_blk = 0 # number #force
+
+# The number of newlines before a block of typedefs
+# 0 = No change (default)
+nl_typedef_blk_start = 0 # number #force
+
+# The number of newlines after a block of typedefs
+# 0 = No change (default)
+nl_typedef_blk_end = 0 # number #force
+
+# The maximum consecutive newlines within a block of typedefs
+# 0 = No change (default)
+# WARNING: Best is not unique (0 2)
+nl_typedef_blk_in = 0 # number
+
+# The number of newlines before a block of variable definitions not at the top of a function body
+# 0 = No change (default)
+# WARNING: Best is not unique (0 1)
+nl_var_def_blk_start = 0 # number
+
+# The number of newlines after a block of variable definitions not at the top of a function body
+# 0 = No change (default)
+# WARNING: Best is not unique (0 1)
+nl_var_def_blk_end = 0 # number
+
+# The maximum consecutive newlines within a block of variable definitions
+# 0 = No change (default)
+# WARNING: Best is not unique (0 3)
+nl_var_def_blk_in = 0 # number
+
+# Add or remove newline between a function call's ')' and '{', as in:
+# list_for_each(item, &list) { }
+# NOTE: is 28 worse than ignore
+nl_fcall_brace = add # ignore/add/remove/force
+
+# Add or remove newline between 'enum' and '{'
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+nl_enum_brace = ignore # ignore/add/remove/force
+
+# Add or remove newline between 'struct and '{'
+nl_struct_brace = add # ignore/add/remove/force
+
+# Add or remove newline between 'union' and '{'
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+nl_union_brace = ignore # ignore/add/remove/force
+
+# Add or remove newline between 'if' and '{'
+# NOTE: is 231 worse than ignore
+nl_if_brace = add # ignore/add/remove/force
+
+# Add or remove newline between '}' and 'else'
+nl_brace_else = add # ignore/add/remove/force
+
+# Add or remove newline between 'else if' and '{'
+# If set to ignore, nl_if_brace is used instead
+nl_elseif_brace = add # ignore/add/remove/force
+
+# Add or remove newline between 'else' and '{'
+nl_else_brace = add # ignore/add/remove/force
+
+# Add or remove newline between 'else' and 'if'
+nl_else_if = remove # ignore/add/remove/force
+
+# Add or remove newline between '}' and 'finally'
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+nl_brace_finally = ignore # ignore/add/remove/force
+
+# Add or remove newline between 'finally' and '{'
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+nl_finally_brace = ignore # ignore/add/remove/force
+
+# Add or remove newline between 'try' and '{'
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+nl_try_brace = ignore # ignore/add/remove/force
+
+# Add or remove newline between get/set and '{'
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+nl_getset_brace = ignore # ignore/add/remove/force
+
+# Add or remove newline between 'for' and '{'
+# NOTE: is 93 worse than ignore
+nl_for_brace = add # ignore/add/remove/force
+
+# Add or remove newline between 'catch' and '{'
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+nl_catch_brace = ignore # ignore/add/remove/force
+
+# Add or remove newline between '}' and 'catch'
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+nl_brace_catch = ignore # ignore/add/remove/force
+
+# Add or remove newline between 'while' and '{'
+# NOTE: is 21 worse than ignore
+nl_while_brace = add # ignore/add/remove/force
+
+# Add or remove newline between 'scope (x)' and '{' (D)
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+nl_scope_brace = ignore # ignore/add/remove/force
+
+# Add or remove newline between 'unittest' and '{' (D)
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+nl_unittest_brace = ignore # ignore/add/remove/force
+
+# Add or remove newline between 'version (x)' and '{' (D)
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+nl_version_brace = ignore # ignore/add/remove/force
+
+# Add or remove newline between 'using' and '{'
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+nl_using_brace = ignore # ignore/add/remove/force
+
+# Add or remove newline between two open or close braces.
+# Due to general newline/brace handling, REMOVE may not work.
+nl_brace_brace = remove # ignore/add/remove/force
+
+# Add or remove newline between 'do' and '{'
+# NOTE: is 3 worse than ignore
+nl_do_brace = add # ignore/add/remove/force
+
+# Add or remove newline between '}' and 'while' of 'do' statement
+nl_brace_while = add # ignore/add/remove/force #force
+
+# Add or remove newline between 'switch' and '{'
+# NOTE: is 21 worse than ignore
+nl_switch_brace = add # ignore/add/remove/force
+
+# Add a newline between ')' and '{' if the ')' is on a different line than the if/for/etc.
+# Overrides nl_for_brace, nl_if_brace, nl_switch_brace, nl_while_switch, and nl_catch_brace.
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+nl_multi_line_cond = false # false/true
+
+# Force a newline in a define after the macro name for multi-line defines.
+nl_multi_line_define = false # false/true
+
+# Whether to put a newline before 'case' statement
+nl_before_case = false # false/true
+
+# Add or remove newline between ')' and 'throw'
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+nl_before_throw = ignore # ignore/add/remove/force
+
+# Whether to put a newline after 'case' statement
+nl_after_case = false # false/true
+
+# Add or remove a newline between a case ':' and '{'. Overrides nl_after_case.
+# NOTE: is 27 worse than ignore
+nl_case_colon_brace = add # ignore/add/remove/force
+
+# Newline between namespace and {
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+nl_namespace_brace = ignore # ignore/add/remove/force
+
+# Add or remove newline between 'template<>' and whatever follows.
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+nl_template_class = ignore # ignore/add/remove/force
+
+# Add or remove newline between 'class' and '{'
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+nl_class_brace = ignore # ignore/add/remove/force
+
+# Add or remove newline after each ',' in the constructor member initialization
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+nl_class_init_args = ignore # ignore/add/remove/force
+
+# Add or remove newline between return type and function name in a function definition
+nl_func_type_name = remove # ignore/add/remove/force
+
+# Add or remove newline between return type and function name inside a class {}
+# Uses nl_func_type_name or nl_func_proto_type_name if set to ignore.
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+nl_func_type_name_class = ignore # ignore/add/remove/force
+
+# Add or remove newline between function scope and name in a definition
+# Controls the newline after '::' in 'void A::f() { }'
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+nl_func_scope_name = ignore # ignore/add/remove/force
+
+# Add or remove newline between return type and function name in a prototype
+# NOTE: is 6 worse than ignore
+nl_func_proto_type_name = remove # ignore/add/remove/force
+
+# Add or remove newline between a function name and the opening '('
+nl_func_paren = remove # ignore/add/remove/force
+
+# Add or remove newline between a function name and the opening '(' in the definition
+nl_func_def_paren = remove # ignore/add/remove/force
+
+# Add or remove newline after '(' in a function declaration
+# NOTE: is 6 worse than ignore
+nl_func_decl_start = remove # ignore/add/remove/force
+
+# Add or remove newline after '(' in a function definition
+# NOTE: is 23 worse than ignore
+nl_func_def_start = remove # ignore/add/remove/force
+
+# Overrides nl_func_decl_start when there is only one parameter.
+nl_func_decl_start_single = ignore # ignore/add/remove/force #force
+
+# Overrides nl_func_def_start when there is only one parameter.
+nl_func_def_start_single = ignore # ignore/add/remove/force #force
+
+# Add or remove newline after each ',' in a function declaration
+# NOTE: is 38 worse than ignore
+nl_func_decl_args = remove # ignore/add/remove/force
+
+# Add or remove newline after each ',' in a function definition
+# NOTE: is 37 worse than ignore
+nl_func_def_args = remove # ignore/add/remove/force
+
+# Add or remove newline before the ')' in a function declaration
+nl_func_decl_end = remove # ignore/add/remove/force
+
+# Add or remove newline before the ')' in a function definition
+nl_func_def_end = remove # ignore/add/remove/force
+
+# Overrides nl_func_decl_end when there is only one parameter.
+nl_func_decl_end_single = ignore # ignore/add/remove/force #force
+
+# Overrides nl_func_def_end when there is only one parameter.
+nl_func_def_end_single = ignore # ignore/add/remove/force #force
+
+# Add or remove newline between '()' in a function declaration.
+nl_func_decl_empty = remove # ignore/add/remove/force
+
+# Add or remove newline between '()' in a function definition.
+nl_func_def_empty = remove # ignore/add/remove/force
+
+# Whether to put each OC message parameter on a separate line
+# See nl_oc_msg_leave_one_liner #ignore
+nl_oc_msg_args = false # false/true #ignore
+
+# Add or remove newline between function signature and '{'
+# NOTE: is 156 worse than ignore
+nl_fdef_brace = add # ignore/add/remove/force
+
+# Add or remove a newline between the return keyword and return expression.
+# NOTE: is 15 worse than ignore
+nl_return_expr = remove # ignore/add/remove/force
+
+# Whether to put a newline after semicolons, except in 'for' statements
+nl_after_semicolon = false # false/true
+
+# Whether to put a newline after brace open.
+# This also adds a newline before the matching brace close.
+nl_after_brace_open = false # false/true
+
+# If nl_after_brace_open and nl_after_brace_open_cmt are true, a newline is
+# placed between the open brace and a trailing single-line comment.
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+nl_after_brace_open_cmt = false # false/true
+
+# Whether to put a newline after a virtual brace open with a non-empty body.
+# These occur in un-braced if/while/do/for statement bodies.
+nl_after_vbrace_open = false # false/true
+
+# Whether to put a newline after a virtual brace open with an empty body.
+# These occur in un-braced if/while/do/for statement bodies.
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+nl_after_vbrace_open_empty = false # false/true
+
+# Whether to put a newline after a brace close.
+# Does not apply if followed by a necessary ';'.
+nl_after_brace_close = false # false/true
+
+# Whether to put a newline after a virtual brace close.
+# Would add a newline before return in: 'if (foo) a++; return;'
+nl_after_vbrace_close = false # false/true
+
+# Control the newline between the close brace and 'b' in: 'struct { int a; } b;'
+# Affects enums, unions, and structures. If set to ignore, uses nl_after_brace_close
+nl_brace_struct_var = remove # ignore/add/remove/force
+
+# Whether to alter newlines in '#define' macros
+nl_define_macro = false # false/true
+
+# Whether to not put blanks after '#ifxx', '#elxx', or before '#endif'
+nl_squeeze_ifdef = false # false/true
+
+# Add or remove blank line before 'if'
+nl_before_if = ignore # ignore/add/remove/force #force
+
+# Add or remove blank line after 'if' statement
+nl_after_if = ignore # ignore/add/remove/force #force
+
+# Add or remove blank line before 'for'
+nl_before_for = ignore # ignore/add/remove/force #force
+
+# Add or remove blank line after 'for' statement
+nl_after_for = ignore # ignore/add/remove/force #force
+
+# Add or remove blank line before 'while'
+nl_before_while = ignore # ignore/add/remove/force #force
+
+# Add or remove blank line after 'while' statement
+nl_after_while = ignore # ignore/add/remove/force #force
+
+# Add or remove blank line before 'switch'
+nl_before_switch = ignore # ignore/add/remove/force #force
+
+# Add or remove blank line after 'switch' statement
+nl_after_switch = ignore # ignore/add/remove/force #force
+
+# Add or remove blank line before 'do'
+nl_before_do = ignore # ignore/add/remove/force #force
+
+# Add or remove blank line after 'do/while' statement
+nl_after_do = ignore # ignore/add/remove/force #force
+
+# Whether to double-space commented-entries in struct/enum
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+nl_ds_struct_enum_cmt = false # false/true
+
+# Whether to double-space before the close brace of a struct/union/enum
+# (lower priority than 'eat_blanks_before_close_brace')
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+nl_ds_struct_enum_close_brace = false # false/true
+
+# Add or remove a newline around a class colon.
+# Related to pos_class_colon, nl_class_init_args, and pos_comma.
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+nl_class_colon = ignore # ignore/add/remove/force
+
+# Change simple unbraced if statements into a one-liner
+# 'if(b)\n i++;' => 'if(b) i++;'
+nl_create_if_one_liner = false # false/true
+
+# Change simple unbraced for statements into a one-liner
+# 'for (i=0;i<5;i++)\n foo(i);' => 'for (i=0;i<5;i++) foo(i);'
+nl_create_for_one_liner = false # false/true
+
+# Change simple unbraced while statements into a one-liner
+# 'while (i<5)\n foo(i++);' => 'while (i<5) foo(i++);'
+nl_create_while_one_liner = false # false/true
+
+#
+# Positioning options
+#
+
+# The position of arithmetic operators in wrapped expressions
+pos_arith = lead # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force #force
+
+# The position of assignment in wrapped expressions.
+# Do not affect '=' followed by '{'
+pos_assign = trail # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force #force
+
+# The position of boolean operators in wrapped expressions
+pos_bool = lead # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force #force
+
+# The position of comparison operators in wrapped expressions
+pos_compare = lead # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force #force
+
+# The position of conditional (b ? t : f) operators in wrapped expressions
+pos_conditional = lead # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force #force
+
+# The position of the comma in wrapped expressions
+pos_comma = trail # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force #force
+
+# The position of the comma in the constructor initialization list
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+pos_class_comma = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force
+
+# The position of colons between constructor and member initialization
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+pos_class_colon = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force
+
+#
+# Line Splitting options
+#
+
+# Try to limit code width to N number of columns
+code_width = 0 # number
+
+# Whether to fully split long 'for' statements at semi-colons
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+ls_for_split_full = false # false/true
+
+# Whether to fully split long function protos/calls at commas
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+ls_func_split_full = false # false/true
+
+# Whether to split lines as close to code_width as possible and ignore some groupings
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+ls_code_width = false # false/true
+
+#
+# Blank line options
+#
+
+# The maximum consecutive newlines
+nl_max = 3 # number #force
+
+# The number of newlines after a function prototype, if followed by another function prototype
+# WARNING: Best is not unique (0 1)
+nl_after_func_proto = 0 # number
+
+# The number of newlines after a function prototype, if not followed by another function prototype
+# WARNING: Best is not unique (0 1)
+nl_after_func_proto_group = 0 # number
+
+# The number of newlines after '}' of a multi-line function body
+nl_after_func_body = 0 # number
+
+# The number of newlines after '}' of a multi-line function body in a class declaration
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+nl_after_func_body_class = 0 # number
+
+# The number of newlines after '}' of a single line function body
+# WARNING: Best is not unique (0 1)
+nl_after_func_body_one_liner = 0 # number
+
+# The minimum number of newlines before a multi-line comment.
+# Doesn't apply if after a brace open or another multi-line comment.
+# WARNING: Best is not unique (0 1)
+nl_before_block_comment = 0 # number
+
+# The minimum number of newlines before a single-line C comment.
+# Doesn't apply if after a brace open or other single-line C comments.
+# WARNING: Best is not unique (0 1)
+nl_before_c_comment = 0 # number
+
+# The minimum number of newlines before a CPP comment.
+# Doesn't apply if after a brace open or other CPP comments.
+# WARNING: Best is not unique (0 1)
+nl_before_cpp_comment = 0 # number
+
+# Whether to force a newline after a multi-line comment.
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+nl_after_multiline_comment = false # false/true
+
+# The number of newlines after '}' or ';' of a struct/enum/union definition
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+nl_after_struct = 0 # number
+
+# The number of newlines after '}' or ';' of a class definition
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+nl_after_class = 0 # number
+
+# The number of newlines before a 'private:', 'public:', 'protected:', 'signals:', or 'slots:' label.
+# Will not change the newline count if after a brace open.
+# 0 = No change.
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+nl_before_access_spec = 0 # number
+
+# The number of newlines after a 'private:', 'public:', 'protected:', 'signals:', or 'slots:' label.
+# 0 = No change.
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+nl_after_access_spec = 0 # number
+
+# The number of newlines between a function def and the function comment.
+# 0 = No change.
+nl_comment_func_def = 0 # number
+
+# The number of newlines after a try-catch-finally block that isn't followed by a brace close.
+# 0 = No change.
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+nl_after_try_catch_finally = 0 # number
+
+# The number of newlines before and after a property, indexer or event decl.
+# 0 = No change.
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+nl_around_cs_property = 0 # number
+
+# The number of newlines between the get/set/add/remove handlers in C#.
+# 0 = No change.
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+nl_between_get_set = 0 # number
+
+# Add or remove newline between C# property and the '{'
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+nl_property_brace = ignore # ignore/add/remove/force
+
+# Whether to remove blank lines after '{'
+eat_blanks_after_open_brace = true # false/true #force
+
+# Whether to remove blank lines before '}'
+eat_blanks_before_close_brace = true # false/true #force
+
+# How aggressively to remove extra newlines not in preproc.
+# 0: No change
+# 1: Remove most newlines not handled by other config
+# 2: Remove all newlines and reformat completely by config
+# ERROR: nl_remove_extra_newlines = 1 crashes with status 139.
+# ERROR: nl_remove_extra_newlines = 2 crashes with status 139.
+# WARNING: Best is not unique (0 indent_columns)
+nl_remove_extra_newlines = 0 # number
+
+# Whether to put a blank line before 'return' statements, unless after an open brace.
+nl_before_return = false # false/true #force
+
+# Whether to put a blank line after 'return' statements, unless followed by a close brace.
+nl_after_return = false # false/true #force
+
+# Whether to put a newline after a Java annotation statement.
+# Only affects annotations that are after a newline.
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+nl_after_annotation = ignore # ignore/add/remove/force
+
+# Controls the newline between two annotations.
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+nl_between_annotation = ignore # ignore/add/remove/force
+
+#
+# Code modifying options (non-whitespace)
+#
+
+# Add or remove braces on single-line 'do' statement
+mod_full_brace_do = add # ignore/add/remove/force
+
+# Add or remove braces on single-line 'for' statement
+# NOTE: is 5 worse than ignore
+mod_full_brace_for = remove # ignore/add/remove/force
+
+# Add or remove braces on single-line function definitions. (Pawn)
+mod_full_brace_function = ignore # ignore/add/remove/force #ignore
+
+# Add or remove braces on single-line 'if' statement. Will not remove the braces if they contain an 'else'.
+mod_full_brace_if = add # ignore/add/remove/force
+
+# Make all if/elseif/else statements in a chain be braced or not. Overrides mod_full_brace_if.
+# If any must be braced, they are all braced. If all can be unbraced, then the braces are removed.
+mod_full_brace_if_chain = true # false/true #force
+
+# Don't remove braces around statements that span N newlines
+mod_full_brace_nl = 2 # number #force
+
+# Add or remove braces on single-line 'while' statement
+mod_full_brace_while = remove # ignore/add/remove/force
+
+# Add or remove braces on single-line 'using ()' statement
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+mod_full_brace_using = ignore # ignore/add/remove/force
+
+# Add or remove unnecessary paren on 'return' statement
+# NOTE: is 42 worse than ignore
+mod_paren_on_return = remove # ignore/add/remove/force
+
+# Whether to change optional semicolons to real semicolons
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+mod_pawn_semicolon = false # false/true
+
+# Add parens on 'while' and 'if' statement around bools
+mod_full_paren_if_bool = false # false/true
+
+# Whether to remove superfluous semicolons
+mod_remove_extra_semicolon = false # false/true
+
+# If a function body exceeds the specified number of newlines and doesn't have a comment after
+# the close brace, a comment will be added.
+mod_add_long_function_closebrace_comment = 0 # number
+
+# If a switch body exceeds the specified number of newlines and doesn't have a comment after
+# the close brace, a comment will be added.
+mod_add_long_switch_closebrace_comment = 0 # number
+
+# If an #ifdef body exceeds the specified number of newlines and doesn't have a comment after
+# the #endif, a comment will be added.
+mod_add_long_ifdef_endif_comment = 0 # number
+
+# If an #ifdef or #else body exceeds the specified number of newlines and doesn't have a comment after
+# the #else, a comment will be added.
+mod_add_long_ifdef_else_comment = 0 # number
+
+# If TRUE, will sort consecutive single-line 'import' statements [Java, D]
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+mod_sort_import = false # false/true
+
+# If TRUE, will sort consecutive single-line 'using' statements [C#]
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+mod_sort_using = false # false/true
+
+# If TRUE, will sort consecutive single-line '#include' statements [C/C++] and '#import' statements [Obj-C]
+# This is generally a bad idea, as it may break your code.
+mod_sort_include = false # false/true
+
+# If TRUE, it will move a 'break' that appears after a fully braced 'case' before the close brace.
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+mod_move_case_break = false # false/true
+
+# Will add or remove the braces around a fully braced case statement.
+# Will only remove the braces if there are no variable declarations in the block.
+# NOTE: is 507 worse than ignore
+mod_case_brace = remove # ignore/add/remove/force
+
+# If TRUE, it will remove a void 'return;' that appears as the last statement in a function.
+mod_remove_empty_return = true # false/true #force
+
+#
+# Comment modifications
+#
+
+# Try to wrap comments at cmt_width columns
+cmt_width = 0 # number
+
+# Set the comment reflow mode (default: 0)
+# 0: no reflowing (apart from the line wrapping due to cmt_width)
+# 1: no touching at all
+# 2: full reflow
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+cmt_reflow_mode = 0 # number
+
+# If false, disable all multi-line comment changes, including cmt_width. keyword substitution, and leading chars.
+# Default is true.
+cmt_indent_multi = false # false/true
+
+# Whether to group c-comments that look like they are in a block
+cmt_c_group = false # false/true
+
+# Whether to put an empty '/*' on the first line of the combined c-comment
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+cmt_c_nl_start = false # false/true
+
+# Whether to put a newline before the closing '*/' of the combined c-comment
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+cmt_c_nl_end = false # false/true
+
+# Whether to group cpp-comments that look like they are in a block
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+cmt_cpp_group = false # false/true
+
+# Whether to put an empty '/*' on the first line of the combined cpp-comment
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+cmt_cpp_nl_start = false # false/true
+
+# Whether to put a newline before the closing '*/' of the combined cpp-comment
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+cmt_cpp_nl_end = false # false/true
+
+# Whether to change cpp-comments into c-comments
+cmt_cpp_to_c = false # false/true
+
+# Whether to put a star on subsequent comment lines
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+cmt_star_cont = false # false/true
+
+# The number of spaces to insert at the start of subsequent comment lines
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+cmt_sp_before_star_cont = 0 # number
+
+# The number of spaces to insert after the star on subsequent comment lines
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+cmt_sp_after_star_cont = 0 # number
+
+# For multi-line comments with a '*' lead, remove leading spaces if the first and last lines of
+# the comment are the same length. Default=True
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+cmt_multi_check_last = false # false/true
+
+# The filename that contains text to insert at the head of a file if the file doesn't start with a C/C++ comment.
+# Will substitute $(filename) with the current file's name.
+# WARNING: unsupported string
+cmt_insert_file_header = "" # string
+
+# The filename that contains text to insert at the end of a file if the file doesn't end with a C/C++ comment.
+# Will substitute $(filename) with the current file's name.
+# WARNING: unsupported string
+cmt_insert_file_footer = "" # string
+
+# The filename that contains text to insert before a function implementation if the function isn't preceded with a C/C++ comment.
+# Will substitute $(function) with the function name and $(javaparam) with the javadoc @param and @return stuff.
+# Will also substitute $(fclass) with the class name: void CFoo::Bar() { ... }
+# WARNING: unsupported string
+cmt_insert_func_header = "" # string
+
+# The filename that contains text to insert before a class if the class isn't preceded with a C/C++ comment.
+# Will substitute $(class) with the class name.
+# WARNING: unsupported string
+cmt_insert_class_header = "" # string
+
+# The filename that contains text to insert before a Obj-C message specification if the method isn't preceeded with a C/C++ comment.
+# Will substitute $(message) with the function name and $(javaparam) with the javadoc @param and @return stuff.
+cmt_insert_oc_msg_header = "" # string #ignore
+
+# If a preprocessor is encountered when stepping backwards from a function name, then
+# this option decides whether the comment should be inserted.
+# Affects cmt_insert_oc_msg_header, cmt_insert_func_header and cmt_insert_class_header. #ignore
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+cmt_insert_before_preproc = false # false/true
+
+#
+# Preprocessor options
+#
+
+# Control indent of preprocessors inside #if blocks at brace level 0
+# WARNING: Indifferent... please decide manually.
+pp_indent = ignore # ignore/add/remove/force
+
+# Whether to indent #if/#else/#endif at the brace level (true) or from column 1 (false)
+pp_indent_at_level = false # false/true
+
+# If pp_indent_at_level=false, specifies the number of columns to indent per level. Default=1.
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+pp_indent_count = 0 # number
+
+# Add or remove space after # based on pp_level of #if blocks
+# NOTE: is 28 worse than ignore
+pp_space = remove # ignore/add/remove/force
+
+# Sets the number of spaces added with pp_space
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+pp_space_count = 0 # number
+
+# The indent for #region and #endregion in C# and '#pragma region' in C/C++
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+pp_indent_region = 0 # number
+
+# Whether to indent the code between #region and #endregion
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+pp_region_indent_code = false # false/true
+
+# If pp_indent_at_level=true, sets the indent for #if, #else, and #endif when not at file-level
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+pp_indent_if = 0 # number
+
+# Control whether to indent the code between #if, #else and #endif when not at file-level
+pp_if_indent_code = false # false/true
+
+# Whether to indent '#define' at the brace level (true) or from column 1 (false)
+pp_define_at_level = true # false/true
+
+# You can force a token to be a type with the 'type' option.
+# Example:
+# type myfoo1 myfoo2
+
+type void
+type float
+type vector
+type entity
+type string
+type .void
+type .float
+type .vector
+type .entity
+type .string
+
+#
+# You can create custom macro-based indentation using macro-open,
+# macro-else and macro-close.
+# Example:
+# macro-open BEGIN_TEMPLATE_MESSAGE_MAP
+# macro-open BEGIN_MESSAGE_MAP
+# macro-close END_MESSAGE_MAP
+#
+# You can assign any keyword to any type with the set option.
+# set func_call_user _ N_
+
+# menu QC OO
+macro-open CLASS
+macro-else EXTENDS
+macro-close ENDCLASS
+
+# translations
+set func_call_user _
+
+#
+# The full syntax description of all custom definition config entries
+# is shown below:
+#
+# define custom tokens as:
+# - embed whitespace in token using '' escape character, or
+# put token in quotes
+# - these: ' " and ` are recognized as quote delimiters
+#
+# type token1 token2 token3 ...
+# ^ optionally specify multiple tokens on a single line
+# define def_token output_token
+# ^ output_token is optional, then NULL is assumed
+# macro-open token
+# macro-close token
+# macro-else token
+# set id token1 token2 ...
+# ^ optionally specify multiple tokens on a single line
+# ^ id is one of the names in token_enum.h sans the CT_ prefix,
+# e.g. PP_PRAGMA
+#
+# all tokens are separated by any mix of ',' commas, '=' equal signs
+# and whitespace (space, tab)
+#
--- /dev/null
+fix_function_types() {
+ # Uncrustify handles QC function types (example:
+ # void(void) func;
+ # ) wrong and removes the space between type and variable. Fix this by
+ # a simple sed on ")letter" which should normally not occur.
+ sed -e 's/)\([A-Za-z0-9]\)/) \1/g' "$@"
+}
+
+if [ -z "$UNCRUSTIFY_CONFIG" ]; then
+ UNCRUSTIFY_CONFIG=`git rev-parse --show-toplevel`/qcsrc/uncrustify.cfg
+fi
+
+case "$#" in
+ 0)
+ uncrustify --frag -c "$UNCRUSTIFY_CONFIG" |\
+ fix_function_types
+ ;;
+ *)
+ uncrustify --replace --no-backup -c "$UNCRUSTIFY_CONFIG" "$@" &&\
+ fix_function_types -i "$@"
+ ;;
+esac
float f;
warpzone_warpzones_exist = 1;
- if not(self.enemy)
+ if (!self.enemy)
{
self.enemy = spawn();
self.enemy.classname = "warpzone_from";
return 0;
}
#endif
- if not(trace_ent)
+ if (!trace_ent)
return 0;
if (trace_ent == WarpZoneLib_BoxTouchesBrush_ent)
return 1;
o10 = o1 = WarpZone_TransformOrigin(wz, o0);
v1 = WarpZone_TransformVelocity(wz, v0);
- if not(IS_NOT_A_CLIENT(player))
+ if (!IS_NOT_A_CLIENT(player))
a1 = WarpZone_TransformVAngles(wz, player.v_angle);
else
a1 = WarpZone_TransformAngles(wz, a0);
save1 = self.target; self.target = string_null;
save2 = self.target3; self.target3 = string_null;
SUB_UseTargets();
- if not(self.target) self.target = save1;
- if not(self.target3) self.target3 = save2;
+ if (!self.target) self.target = save1;
+ if (!self.target3) self.target3 = save2;
oldself = self;
self = self.enemy;
save1 = self.target; self.target = string_null;
save2 = self.target2; self.target2 = string_null;
SUB_UseTargets();
- if not(self.target) self.target = save1;
- if not(self.target2) self.target2 = save2;
+ if (!self.target) self.target = save1;
+ if (!self.target2) self.target2 = save2;
self = oldself;
}
else
save1 = self.target; self.target = string_null;
save2 = self.target3; self.target3 = string_null;
SUB_UseTargets();
- if not(self.target) self.target = save1;
- if not(self.target3) self.target3 = save2;
+ if (!self.target) self.target = save1;
+ if (!self.target3) self.target3 = save2;
self = self.enemy;
save1 = self.target; self.target = string_null;
save2 = self.target2; self.target2 = string_null;
SUB_UseTargets();
- if not(self.target) self.target = save1;
- if not(self.target2) self.target2 = save2;
+ if (!self.target) self.target = save1;
+ if (!self.target2) self.target2 = save2;
self = oldself;
}
else
for(i_s = 0; ; ++i_s)
{
tex = getsurfacetexture(self, i_s);
- if not(tex)
+ if (!tex)
break; // this is beyond the last one
if(tex == "textures/common/trigger" || tex == "trigger")
continue;
for(e = world; (e = nextent(e)); )
{
if(warpzone_warpzones_exist) { WarpZone_StoreProjectileData(e); }
-
+
if(IS_REAL_CLIENT(e))
{
if(e.solid == SOLID_NOT) // not spectating?
if(e.movetype == MOVETYPE_NOCLIP || e.movetype == MOVETYPE_FLY || e.movetype == MOVETYPE_FLY_WORLDONLY) // not spectating? (this is to catch observers)
{
other = e; // player
-
+
// warpzones
- if(warpzone_warpzones_exist) {
- self = WarpZone_Find(e.origin + e.mins, e.origin + e.maxs);
+ if(warpzone_warpzones_exist) {
+ self = WarpZone_Find(e.origin + e.mins, e.origin + e.maxs);
if(self)
if(!WarpZoneLib_ExactTrigger_Touch())
if(WarpZone_PlaneDist(self, e.origin + e.view_ofs) <= 0)
WarpZone_Teleport(self, e, -1, 0); } // NOT triggering targets by this!
-
+
// teleporters
self = Teleport_Find(e.origin + e.mins, e.origin + e.maxs);
if(self)
Simple_TeleportPlayer(self, other); // NOT triggering targets by this!
}
}
-
+
if(IS_NOT_A_CLIENT(e))
{
if(warpzone_warpzones_exist)
0
-\XonoticSingleplayerDialog\Jouer en mode un joueur contre des adversaires contrôlés par l'ordinateur
+\XonoticSingleplayerDialog\Jouer tout seul contre des adversaires contrôlés par ordinateur
-\XonoticMultiplayerDialog\Jouer en ligne avec des amis en réseau local ou sur Internet
-\XonoticMultiplayerDialog/Serveurs\Trouver des serveurs pour y jouer dessus
+\XonoticMultiplayerDialog\Jouer en ligne, en LAN avec vos amis, voir vos démos et modifier vos paramètres joueur
+\XonoticMultiplayerDialog/Serveurs\Trouver des serveurs où jouer
\menu_slist_showempty\Montrer les serveurs vides
\menu_slist_showfull\Montrer les serveurs où toutes les places sont prises
-\net_slist_pause\Ne met pas à jour la liste de serveurs pour éviter de "glisser" sur un autre serveur
-\XonoticMultiplayerDialog/Info...\Montrer plus d'information sur le serveur séléctionné
+\net_slist_pause\Ne pas mettre à jour la liste de serveurs pour éviter de "glisser" sur un autre serveur
+\XonoticMultiplayerDialog/Info...\Montrer plus d'informations sur le serveur sélectionné
\XonoticMultiplayerDialog/Marque-page\Mettre le serveur en haut de la liste pour pouvoir le repérer plus facilement plus tard
\XonoticMultiplayerDialog/Créer\Héberger votre propre partie
-\XonoticMultiplayerDialog/Vidéos\Regarder des Vidéos pré-enregistrées
-\XonoticMultiplayerDialog/Player Setup\Personaliser vos paramètres
+\XonoticMultiplayerDialog/Vidéos\Parcourir et regarder vos démos
+\XonoticMultiplayerDialog/Player Setup\Personnaliser vos paramètres joueur
-\XonoticTeamSelectDialog/join 'best' team (auto-select)\Auto-séléction de l'équipe qui a le plus besoin de vous (recommandé)
-\XonoticTeamSelectDialog/rouge\Joindre l'équipe rouge
-\XonoticTeamSelectDialog/bleu\Joindre l'équipe bleue
-\XonoticTeamSelectDialog/jaune\Joindre l'équipe jaune
-\XonoticTeamSelectDialog/rose\Joindre l'équipe rose
+\XonoticTeamSelectDialog/join 'best' team (auto-select)\Auto-séléction de l'équipe (recommandé)
+\XonoticTeamSelectDialog/rouge\Rejoindre l'équipe rouge
+\XonoticTeamSelectDialog/bleu\Rejoindre l'équipe bleue
+\XonoticTeamSelectDialog/jaune\Rejoindre l'équipe jaune
+\XonoticTeamSelectDialog/rose\Rejoindre l'équipe rose
-\timelimit_override\Limite de temps au match, le match se finit quand elle est atteinte
-\fraglimit_override\Limite de tués pour le match, le match se finit quand elle est atteinte
+\timelimit_override\Limite de temps, le match se termine lorsque celle-ci est atteinte
+\fraglimit_override\Limite de frags pour le match, le match se termine lorsque celle-ci est atteinte
\menu_maxplayers\Le nombre maximum de personnes pouvant jouer sur votre serveur en même temps
-\bot_number\Nombre d'adversaires ordinateur
+\bot_number\Nombre d'adversaires contrôlés par ordinateur
\skill\Spécifier la difficulté des adversaires ordinateur
\g_maplist_votable\Le nombre de cartes pouvant être votées à la fin du match
-\sv_vote_simple_majority_factor\À partir de 51% de oui seulement, un vote est gagné
-\XonoticMultiplayerDialog/Advanced settings...\Paramètres du serveur avancés
-\XonoticMultiplayerDialog/Mutators...\Spéciales et arènes d'une seule arme
-\g_dodging\Enable dodging
+\sv_vote_simple_majority_factor\La majorité simple remporte un vote
+\XonoticMultiplayerDialog/Advanced settings...\Paramètres serveur avancés
+\XonoticMultiplayerDialog/Mutators...\Mutators et arènes avec une seule arme
+\g_dodging\Activer les esquives
\g_cloaked\Tous les joueurs sont presque invisibles
-\g_footsteps\Activer les bruitages de pas
-\g_midair\Il faut que votre adversaire soit en l'air pour lui faire mal
-\g_vampire\Les dégâts faits à vos enemies vous font gagner de la santé
-\g_bloodloss\Si vous avez moins de santé que spécifié ici, vous perdrez du sang et mourez progressivement
-\sv_gravity\Vous tombez plus lentement, comme sur la lune
+\g_footsteps\Activer les bruits de pas
+\g_midair\Il faut que votre adversaire soit en l'air pour lui infliger des dégâts
+\g_vampire\Les dégâts infligés à vos ennemis vous rendent la santé
+\g_bloodloss\Si vous avez moins de santé que spécifié ici, vous perdrez du sang et mourrez progressivement
+\sv_gravity\Vous tombez plus lentement, une valeur peu élevée correspond à une faible gravité
\g_grappling_hook\Tous les joueurs ont un grappin
\g_jetpack\Tous les joueurs ont un jetpack
-\g_pinata\Tous les joueurs lâchent toutes leurs armes quand ils meurent
-\g_weapon_stay\Les armes restent où elles sont quand elles sont prises sur la carte
-\g_weaponarena\Séléctionner une arène d'une seule arme donne des munitions illimitées pour cette arme, et désactive toutes les autres armes
-\menu_weaponarena_with_laser\Also enable the laser in the weapon arena
-\g_minstagib\Tous les joueurs reçoivent un MinstaNex, qui est un sniper hyperpuissant qui tue d'un coup. Si vous n'avez plus de munitions, vous mourez progressivement.
-\g_nix\No Items Xonotic; tous les joueurs ont la même arme en même temps, et on change d'arme régulièrement
-\g_nix_with_laser\Porter le laser avec l'arme du No Items Xonotic
-\XonoticMultiplayerDialog/Select all\Séléctionner toutes les cartes
-\XonoticMultiplayerDialog/Select none\Déséléctionner toutes les cartes
+\g_pinata\Les joueurs lâchent toutes leurs armes quand ils meurent
+\g_weapon_stay\Les armes restent où elles sont lorsqu'elles sont ramassées
+\g_weaponarena\Sélectionner une arène avec une seule arme fera apparaître les joueurs avec cette arme et des munitions illimitées, et désactive toutes les autres armes
+\g_minstagib\Tous les joueurs reçoivent un Minstanex, qui est un fusil de précision d'une puissance infinie. Si vous êtes à court de munition, vous mourrez dans les 10 secondes à moins de parvenir à recharger votre arme. Le tir secondaire est un laser qui n'inflige aucun dégât et qui est utile pour sauter sur de longues distances.
+\g_nix\No Items Xonotic - tous les joueurs jouent avec la même arme, et celle-ci change régulièrement.
+\g_nix_with_laser\Autoriser le laser en plus de l'arme courante dans le mode Nix
+\XonoticMultiplayerDialog/Select all\Sélectionner toutes les cartes
+\XonoticMultiplayerDialog/Select none\Désélectionner toutes les cartes
-\XonoticMultiplayerDialog/Test Performance\Faire un test de performance en utilisant la vidéo choisie
+\XonoticMultiplayerDialog/Test Performance\Faire un test de performance en utilisant la démo sélectionnée
\fov\Champ de vision en degrés, par défaut 90, certains joueurs préfèrent entre 110 et 130
-\cl_bobcycle\Effet de "tremblement" de la caméra en courant
-\cl_zoomfactor\Facteur de Zoom
-\cl_zoomsensitivity\Changer la sensitivité du Zoom: 0 est la plus basse, 1 ne comporte pas de changement par rapport au mode dézoomé
-\cl_zoomspeed\Facteur "d'adoucissement" du Zoom, 0 désactive complètement
+\cl_bobcycle\Effet de "tremblement" de la vue lorsque vous courez
+\cl_zoomfactor\Facteur du zoom lorsque vous appuyez sur le bouton de zoom
+\cl_zoomsensitivity\Changer la sensibilité du zoom : 0 est la valeur la plus basse, 1 correspond à l'absence de zoom
+\cl_zoomspeed\Facteur "d'adoucissement" du zoom, 0 le désactive complètement
\XonoticMultiplayerDialog/Weapon settings...\Paramétrer les armes (affichage, priorité)
-\cl_weaponpriority_useforcycling\Utiliser la liste de priorité pour le changement d'armes à la molette
-\cl_autoswitch\Automatiquement changer d'arme si vous avez une meilleure arme que celle que vous portez
-\r_drawviewmodel\Afficher l'arme à la permière personne
+\cl_weaponpriority_useforcycling\Utiliser la liste de priorité pour le changement d'armes avec la molette de la souris
+\cl_autoswitch\Automatiquement changer d'arme si vous ramassez une meilleure arme que celle que vous portez
+\r_drawviewmodel\Afficher l'arme à la première personne
\cl_gunalign\Position de l'arme à l'écran, reconnection au serveur nécessaire pour prendre effet
-\crosshair_per_weapon\Set a different crosshair for each weapon, good if you play without weapon models
-\crosshair_color_per_weapon\Set the color of the crosshair depending on the weapon you are currently holding
+\crosshair_per_weapon\Définir un viseur différent pour chaque arme, utile si vous jouez sans afficher l'arme
+\crosshair_color_per_weapon\Définir la couleur du viseur selon l'arme que vous utilisez
\crosshair_size\Ajuster la taille du viseur
\crosshair_color_alpha\Ajuster l'opacité du viseur
-\crosshair_color\Ajuster le couleur du viseur
+\crosshair_color\Ajuster la couleur du viseur
\sbar_hudselector\Utiliser l'ancienne interface HUD
\XonoticMultiplayerDialog/Waypoints setup...\-
\_cl_name\Pseudonyme utilisé pour vous reconnaître dans le jeu
\XonoticSettingsDialog\Changer les paramètres du jeu
-\XonoticCreditsDialog\Les Crédits de Xonotic
+\XonoticCreditsDialog\Les crédits de Xonotic
\XonoticTeamSelectDialog\-
\XonoticMutatorsDialog\-
\XonoticMapInfoDialog\-
\XonoticQuitDialog/Non\'Faut que je fragge plus de monde!
\XonoticSettingsDialog/Contrôles\Paramètres contrôle souris/clavier
-\sensitivity\Sensitivité de la souris
-\menu_mouse_speed\Sensitivité de la souris dans les menus, n'affecte pas le jeu
-\m_filter\Adoucit le mouvement de souris, mais crée une légère latence de souris
+\sensitivity\Sensibilité de la souris
+\menu_mouse_speed\Sensibilité de la souris dans les menus, n'affecte pas le jeu
+\m_filter\Adoucit le mouvement de souris, mais crée une légère latence
\m_pitch\Inverser la souris sur l'axe vertical (mode jeu d'avion)
\vid_dgamouse\Utiliser une souris DGA
-\con_closeontoggleconsole\Autoriser la fermeture de console avec la touche d'ouverture de console (sinon, Shift+Échap)
+\con_closeontoggleconsole\Permet de fermer la console avec le même raccourci utilisé pour l'ouvrir
-\XonoticSettingsDialog/Vidéo\Video settings
+\XonoticSettingsDialog/Vidéo\Paramètres vidéo
\vid_width\Résolution de l'écran
-\vid_bitsperpixel\Profondeur des couleurs: 16 bits est plus rapide, mais 32 bits est de meilleure qualité (recommandé)
-\vid_fullscreen\Activer le mode plein écran (par défaut: activé)
-\vid_vsync\Activer la syncronisation verticale pour éviter des problèmes d'affichage, limite le nombre maximum d'images par seconde (par défaut: désactivé)
-\gl_texture_anisotropy\Qualité du filtrage anistrope (par défaut: 1x)
-\r_glsl\Activer les Shaders OpenGL 2.0 pour des effets de lumière améliorés
-\gl_vbo\Utiliser les VBOs pour stocker les modèles 3D statiques dans la mémoire pour une meilleure performance (par défaut: Points et Triangles)
-\r_depthfirst\Éviter des problèmes de profondeur de rendu en faisant un rendu de profondeur de la carte/joueurs avant le rendu "standard" (par défaut: désactivé)
-\gl_texturecompression\Compresser les textures pour économiser de la mémoire graphique (par défaut: aucun)
-\gl_finish\Faire attendre le processeur que le rendu graphique se finisse pour éviter des problèmes d'affichage divers (par défaut: désactivé)
-\v_brightness\Luminosité du noir (par défaut: 0)
-\v_contrast\Luminosité du blanc (par défaut: 1)
-\v_gamma\Correction du gamma ne changeant pas la luminosité du noir ou du blanc (par défaut: 1.125)
-\v_contrastboost\Multiplier le constraste dans des salles sombres (par défaut: 1)
-\r_glsl_saturation\Ajustement de la saturation (0 = noir et blanc, 1 = normal, 2 = saturé) des couleurs (par défaut: 1)
-\v_glslgamma\Utiliser GLSL pour corriger le gamma, attention, cela risque d'augementer fortement l'utilisation de ressources (par défaut: désactivé)
-\r_ambient\Lumière ambiente, si elle est trop élévée, les cartes auront un éclairage plus "plat" et moins contrasté
-\r_hdr_scenebrightness\Éclairage du rendu global (par défaut: 1)
-\vid_samples\Activer l'anticrénelage, réduit l'effet d'escalier sur les modèles 3D, mais augmente fortement l'utilisation des ressources
-\v_flipped\Mode mirroir (par défaut: désactivé)
+\vid_bitsperpixel\Profondeur des couleurs : 16 bits est plus rapide, mais 32 bits est de meilleure qualité (recommandé)
+\vid_fullscreen\Activer le mode plein écran (par défaut : activé)
+\vid_vsync\Activer la syncronisation verticale pour éviter des problèmes d'affichage, limite le nombre maximum d'images par seconde (par défaut : désactivé)
+\gl_texture_anisotropy\Qualité du filtrage anistrope (par défaut : 1x)
+\r_glsl\Activer les Shaders OpenGL 2.0 pour des effets de lumière améliorés (par défaut : désactivé)
+\gl_vbo\Utiliser les VBOs pour stocker les modèles 3D statiques dans la mémoire pour une meilleure performance (par défaut : Points et Triangles)
+\r_depthfirst\Éviter des problèmes de profondeur de rendu en faisant un rendu de profondeur de la carte/joueurs avant le rendu "standard" (par défaut : désactivé)
+\gl_texturecompression\Compresser les textures pour économiser de la mémoire graphique (par défaut : aucun)
+\gl_finish\Demander au processeur d'attendre la fin du rendu graphique afin éviter des problèmes d'affichage divers (par défaut : désactivé)
+\v_brightness\Luminosité du noir (par défaut : 0)
+\v_contrast\Luminosité du blanc (par défaut : 1)
+\v_gamma\Correction du gamma n'affectant pas la luminosité du noir ou du blanc (par défaut : 1.125)
+\v_contrastboost\Multiplier le constraste dans les salles sombres (par défaut : 1)
+\r_glsl_saturation\Ajustement de la saturation (0 = noir et blanc, 1 = normal, 2 = saturé) des couleurs (par défaut : 1)
+\v_glslgamma\Utiliser GLSL pour corriger le gamma, attention, cela risque d'augementer fortement l'utilisation de ressources (par défaut : désactivé)
+\r_ambient\Lumière ambiante, si elle est trop élévée, les cartes auront un éclairage plus "plat" et moins contrasté (par défaut : 4)
+\r_hdr_scenebrightness\Éclairage du rendu global (par défaut : 1)
+\vid_samples\Activer l'anticrénelage, réduit l'effet d'escalier sur les modèles 3D, mais augmente fortement l'utilisation des ressources (par défaut : désactivé)
+\v_flipped\Mode miroir (par défaut : désactivé)
\XonoticSettingsDialog/Graphiques\Paramètres des effets graphiques
-\r_subdivisions_tolerance\Ajuster la qualité des modèles 3D de carte (courbes, tuyaux) (par défaut: normal)
-\gl_picmip\Ajuster la qualité des textures. La baisser diminue l'utilisation des ressources, mais rend les textures floues. (par défaut: normal)
-\r_picmipworld\If set, only reduce the texture quality of models (default: enabled)
-\mod_q3bsp_nolightmaps\Utiliser des lightmaps haute résolution, augmente l'utilisation des resources, mais rend les lightmaps plus nettes (par défaut: activé)
-\cl_particles_quality\Nombre de particules; moins de particules consomment moins de ressources (par défaut: 1.0)
-\r_drawparticles_drawdistance\Toutes les particules qui sont plus loin que cette distance ne seront pas affichées (par défaut: 1000)
-\cl_decals\Activer les marques d'impacts et de sang (par défaut: activé)
-\r_drawdecals_drawdistance\Toutes les marques d'impacts qui sont plus loin que cette distance ne seront pas affichées (par défaut: 300)
-\cl_decals_time\Temps en secondes avant que les marques d'impacts disparaissent (par défaut: 2 secondes)
-\cl_gentle\Remplacer les effets gore par des effets moins violents (par défaut: désactivé)
-\cl_nogibs\Réduire le nombre de Gibs ou les désactiver totalement (par défaut: beaucoup)
-\v_kicktime\Faire trembler la vue en recevant des dégâts (par défaut: 0)
-\r_glsl_deluxemapping\Utiliser les effets lumineux avancés (par défaut: activé)
-\r_shadow_gloss\Utiliser le reflet des textures (par défaut: activé)
-\gl_flashblend\Enable faster but uglier dynamic lights by rendering bright coronas instead of real dynamic lights (default: disabled)
-\r_shadow_realtime_dlight\Activer le rendu des lumières dynamiques en temps réel (par défaut: activé)
-\r_shadow_realtime_dlight_shadows\Activer le rendu des ombres depuis les lumières dynamiques en temps réel (par défaut: désactivé)
-\r_shadow_realtime_world\Activer le rendu des lumières carte en temps réel, a un gros impact sur la performance (par défaut: désactivé)
-\r_shadow_realtime_world_shadows\Activer le rendu des ombres depuis les lumières carte en temps réel, a un impact sur la performance aussi (par défaut: désactivé)
-\r_shadow_usenormalmap\Utiliser des effets d'ombrage de lumière sur les textures (par défaut: activé)
-\r_showsurfaces\Désactiver les textures et les remplacer par des couleurs unies. Utile pour les configurations très faible, mais laid. (par défaut: désactivé)
-\r_glsl_offsetmapping\Activer l'effet de relief sur les textures, a un léger impact sur la performance (par défaut: désactivé)
-\r_glsl_offsetmapping_reliefmapping\Augmenter la qualité des effets de relief sur les textures, a un gros impact sur la performance (par défaut: désactivé)
-\r_water\Activer des reflets de réflecion et de réfraction d'eau et des portails Warpzone (par défaut: désactivé)
-\r_water_resolutionmultiplier\Qualité des reflets d'eau et des portails Warpzone, l'augmenter a un gros impact sur la performance (par défaut: bon)
-\r_coronas\Activer des effets d'éblouissement peu gourmands (par défaut: activé)
-\r_coronas_occlusionquery\Prendre en compte la visibilité pour les effets "Brillance Lumière" (par défaut: activé)
-\r_bloom\Activer un effet d'éblouissement plus beau, mais gourmand (par défaut: désactivé)
-\r_hdr\Activer un effet d'ébloissement encore plus beau, mais encore plus gourmand (par défaut: désactivé)
+\r_subdivisions_tolerance\Ajuster la qualité des modèles 3D de la carte (courbes, tuyaux) (par défaut : normal)
+\gl_picmip\Ajuster la qualité des textures. La baisser diminue l'utilisation des ressources, mais rend les textures floues. (par défaut : bon)
+\r_picmipworld\Si activé, réduira uniquement la qualité des textures des joueurs (par défaut : activé)
+\mod_q3bsp_nolightmaps\Utiliser des lightmaps haute résolution, augmente l'utilisation de la mémoire, mais rend les lightmaps plus nettes (par défaut : activé)
+\cl_particles_quality\Nombre de particules ; moins de particules consomment moins de ressources (par défaut : 1)
+\r_drawparticles_drawdistance\Toutes les particules situées au-delà de cette distance ne seront pas affichées (par défaut : 1000)
+\cl_decals\Activer les marques d'impacts et de sang (par défaut : activé)
+\r_drawdecals_drawdistance\Toutes les marques d'impacts qui sont plus loin que cette distance ne seront pas affichées (par défaut : 300)
+\cl_decals_time\Durée en secondes avant que les marques d'impacts ne disparaissent (par défaut : 2)
+\cl_gentle\Remplacer les effets gores par des effets moins violents (par défaut : désactivé)
+\cl_nogibs\Réduire les effets gores ou les désactiver totalement (par défaut : beaucoup)
+\v_kicktime\Faire trembler la vue lorsque vous êtes touché (durée par défaut : 0)
+\r_glsl_deluxemapping\Utiliser les effets lumineux avancés (par défaut : activé)
+\r_shadow_gloss\Utiliser le reflet des textures (par défaut : activé)
+\gl_flashblend\Activer les lumières dynamiques rapides - mais plus laides - en affichant des couronnes de lumière à la place des vraies lumières dynamiques (par défaut : désactivé)
+\r_shadow_realtime_dlight\Activer le rendu des lumières dynamiques des explosions et des roquettes (par défaut : activé)
+\r_shadow_realtime_dlight_shadows\Activer le rendu des ombres depuis les lumières dynamiques en temps réel (par défaut : désactivé)
+\r_shadow_realtime_world\Activer le rendu des lumières carte en temps réel, a un gros impact sur la performance (par défaut : désactivé)
+\r_shadow_realtime_world_shadows\Activer le rendu des ombres depuis les lumières carte en temps réel (par défaut : désactivé)
+\r_shadow_usenormalmap\Utiliser des effets d'ombrage de lumière sur les textures (par défaut : activé)
+\r_showsurfaces\Désactiver les textures et les remplacer par des couleurs unies. Utile pour les configurations très légères, mais le rendu est très laid. (par défaut : désactivé)
+\r_glsl_offsetmapping\Activer l'effet de relief sur les textures, a un léger impact sur la performance (par défaut : désactivé)
+\r_glsl_offsetmapping_reliefmapping\Augmenter la qualité des effets de relief sur les textures, a un gros impact sur la performance (par défaut : désactivé)
+\r_water\Qualité des reflets et de la réfraction de l'eau et des portails, a un gros impact sur la performance dans les cartes avec des surfaces réfléchissantes (par défaut : désactivé)
+\r_water_resolutionmultiplier\Résolution des reflets/réfractions (par défaut : bon)
+\r_coronas\Activer des effets d'éblouissement peu gourmands autour de certaines sources de lumière (par défaut : activé)
+\r_coronas_occlusionquery\Estomper les effets d'éblouissement pour ne pas perdre en visibilité (par défaut : activé)
+\r_bloom\Activer l'effet "bloom", qui éclaire les pixels situés au voisinage de pixels très brillants. A un gros impact sur la performance (par défaut : désactivé)
+\r_hdr\Effet "bloom" de qualité encore supérieure, mais encore plus gourmand (par défaut : désactivé)
\r_motionblur\Intensité du flou de mouvement - 0.4 est recommandé
+\hud_postprocessing_maxbluralpha\Activer des effets de postprocessing spéciaux lorque vous êtes touché, lorsque vous êtes sous l'eau ou lorsque vous utilisez un bonus (par défaut : désactivé)
-\XonoticSettingsDialog/Audio\Audio settings
+\XonoticSettingsDialog/Audio\Paramètres audio
\mastervolume\-
\bgmvolume\-
\snd_staticvolume\-
\snd_channel1volume\-
\snd_speed\Fréquence de la sortie audio
\snd_channels\Nombre de canaux pour la sortie audio
-\snd_swapstereo\Échanger les canneaux stéréo gauche/droite
-\snd_spatialization_control\Essayer de diminuer le "constraste" entre la partie gauche et droite du casque audio pour un meilleur son
-\cl_voice_directional\Activer les voix des personnages sur la carte
-\cl_voice_directional_taunt_attenuation\Distance à laquelle les voix sont audibles
-\cl_autotaunt\Automatiquement narguer les enemis quand vous les tuez
-\cl_sound_maptime_warning\Voix (en anglais) qui vous dit le temps restant avant la fin du match
-\cl_hitsound\Jouer un son quand vous touchez un enemi
-\menu_sounds\Jouer des sons en cliquant ou en passant la souris sur des options
-
-\XonoticSettingsDialog/Réseau\Paramètres du jeu en réseau
+\snd_swapstereo\Inverser les canaux stéréo gauche/droite
+\snd_spatialization_control\Essayer de diminuer le "contraste" entre la partie gauche et droite du casque pour un meilleur son
+\cl_voice_directional\Activer les voix directionnelles des personnages sur la carte
+\cl_voice_directional_taunt_attenuation\Distance jusqu'à laquelle les voix demeurent audibles
+\cl_autotaunt\Automatiquement narguer les ennemis lorsque vous les tuez
+\cl_sound_maptime_warning\Voix (en anglais) qui annonce le temps restant avant la fin du match
+\cl_hitsound\Jouer un son lorsque vous touchez un ennemi
+\menu_sounds\Jouer des sons en cliquant ou en survolant des boutons
+
+\XonoticSettingsDialog/Réseau\Paramètres réseau
\cl_movement\Activer la prédiction des mouvements du joueur pour éviter les saccades lors de parties en réseau
\cl_nolerp\Algorithme pour éviter les saccades lors de parties en réseau
-\shownetgraph\Show a graph of packet sizes and other information
-\_cl_rate\Specify your network speed with this slider
-\cl_netfps\Nombre maximum de paquets à envoyer au server chaque seconde
-\cl_curl_maxdownloads\Nombre maximum de téléchargements simultanés
-\cl_curl_maxspeed\Vitesse maximum de téléchargement
-\cl_port\Forcer le client à passer par le port défini (UDP) s'il n'est pas 0
+\shownetgraph\Afficher la taille des paquets et d'autres informations dans un graphique
+\_cl_rate\Spécifier la vitesse de votre réseau avec ce curseur
+\cl_netfps\Nombre maximum de paquets à envoyer au serveur chaque seconde
+\cl_curl_maxdownloads\Nombre maximum de téléchargements simultanés en HTTP/FTP
+\cl_curl_maxspeed\Vitesse maximale de téléchargement
+\cl_port\Forcer le client à passer par le port choisi sauf s'il est défini à 0
\XonoticSettingsDialog/Autres\Autres paramètres
-\menu_tooltips\Menu tooltips: disabled, standard or advanced (also shows cvar or console command bound to the menu item)
-\showtime\Montrer l'heure, utile pour les captures d'écran
-\showdate\Montrer la date, utile pour les captures d'écran
-\showfps\Montrer le nombre d'Images Par Seconde rendues (Frames Per Second = FPS)
+\menu_tooltips\Info-bulles : désactivé, standard ou avancé (affiche aussi la cvar ou la commande associée)
+\showtime\Afficher l'heure, utile pour les captures d'écran
+\showdate\Afficher la date, utile pour les captures d'écran
+\showfps\Afficher le nombre d'images par seconde actuel (FPS = Frames Per Second)
\XonoticSettingsDialog/Advanced settings...\Paramètres avancés pour configuer le jeu dans ses moindres détails
\g_friendlyfire\Pourcentage de dégâts infligés aux équipiers si vous les touchez
\g_mirrordamage\Pourcentage de dégâts infligés aux équipiers qui vous sera renvoyé
-\g_tdm_teams_override\Écraser le nombre d'équipes défini par la carte
+\g_tdm_teams_override\Outrepasser le nombre d'équipes définies par la carte
\viewsize\Enable/Désactiver l'arrière plan de l'interface
-\cl_hidewaypoints\Montrer/Cacher les Waypoints (flèches 3D)
-\g_waypointsprite_scale\Ajuster la taille des Waypoints
-\g_waypointsprite_alpha\Ajuster l'opacité des Waypoints
-\cl_shownames\Afficher le nom du joueur que vous pointez avec votre viseur
+\cl_hidewaypoints\Afficher les waypoints (flèches 3D)
+\g_waypointsprite_scale\Ajuster la taille des waypoints
+\g_waypointsprite_alpha\Ajuster l'opacité des waypoints
+\cl_shownames\Afficher le nom du joueur que vous avez dans votre viseur
-\crosshair_hittest\Aucun: aucun effet de viseur - TrueAim: rendre le viseur flou si vous risquez de vous blesser vous même ou un équipier - Enemis: rendre le viseur plus grand si vous pouvez toucher un enemi
+\crosshair_hittest\Aucun: aucun effet de viseur - TrueAim: rendre le viseur flou si vous risquez de tirer dans un mur - Ennemis: rendre le viseur plus grand si vous pouvez toucher un ennemi