* -crlf
-*.7z -crlf -diff
+*.0 -diff -crlf
+*.1 crlf=input
+*.3 crlf=input
+*.7z -diff -crlf
*.ac crlf=input
+*.a -diff -crlf
*.afm crlf=input
*.aft crlf=input
+*.ai -diff -crlf
*.aliases crlf=input
all crlf=input
*.am crlf=input
*.animinfo crlf=input
-*.aps -crlf -diff
+*.aps -diff -crlf
+*.asc -diff -crlf
*.ase -crlf
*.bat -crlf
*.bgs crlf=input
-*.blend -crlf -diff
-*.bmp -crlf -diff
+*.blend1 -diff -crlf
+*.blend -diff -crlf
+blind_id -diff -crlf
+*.bmp -diff -crlf
branch-manager crlf=input
+*.brand crlf=input
BSDmakefile crlf=input
bsp2ent crlf=input
-*.bsp -crlf -diff
-*.cache -crlf -diff
+*.bsp -diff -crlf
+*.cache -diff -crlf
*.cbp -crlf
-*.cbp -crlf -diff
+*.cbp -diff -crlf
*.c crlf=input
*.cfg crlf=input
*.cg crlf=input
ChangeLog crlf=input
CHANGES crlf=input
+cjpeg -diff -crlf
COMPILING crlf=input
compress-texture crlf=input
*.conf crlf=input
COPYING crlf=input
*.cpp crlf=input
create crlf=input
+*.cron crlf=input
*.css crlf=input
-Current -crlf -diff
-*.cvsignore crlf=input
*.cvswrappers crlf=input
-*.dat -crlf -diff
-*.db -crlf -diff
+*.d0pk -diff -crlf
+*.db -diff -crlf
*.default crlf=input
*.def crlf=input
-*.dem -crlf -diff
+*.dem -diff -crlf
*.dev -crlf
-*.dll -crlf -diff
-DOCS -crlf -diff
+dir -diff -crlf
+djpeg -diff -crlf
+*.dll -diff -crlf
+DOCS -diff -crlf
*.dot crlf=input
DoxyConfig crlf=input
+doxyfile crlf=input
Doxyfile crlf=input
*.doxygen crlf=input
-*.dpm -crlf -diff
+*.dpm -diff -crlf
*.dsp -crlf
*.dsw -crlf
*.dtd crlf=input
-*.dylib -crlf -diff
+*.dylib -diff -crlf
+empty -diff -crlf
*.EncoderPlugin crlf=input
-*.ent -crlf
+*.flac -diff -crlf
*.form crlf=input
*.framegroups crlf=input
*.game crlf=input
+*.gdb crlf=input
gendox crlf=input
gendoxfunctions crlf=input
genDoxyfile crlf=input
-*.gif -crlf -diff
+*.gif -diff -crlf
*.gitattributes crlf=input
git-branch-manager crlf=input
git-filter-index crlf=input
git-filter-repository crlf=input
*.gitignore crlf=input
+git-pk3-import crlf=input
+git-pk3-merge crlf=input
git-pullall crlf=input
+git-recurse crlf=input
git-split-repository crlf=input
git-svn-checkout crlf=input
git-svn-update crlf=input
*.hs crlf=input
*.html crlf=input
*.html-part crlf=input
-*.icns -crlf -diff
-*.ico -crlf -diff
+*.icns -diff -crlf
+*.ico -diff -crlf
+*.idl crlf=input
*.idsoftware crlf=input
*.inc crlf=input
*.in crlf=input
+*.info-1 -diff -crlf
+*.info-2 -diff -crlf
+*.info -diff -crlf
+*.inl crlf=input
*.instantaction crlf=input
-*.iqm -crlf -diff
+*.iqm -diff -crlf
*.java crlf=input
*.jhm crlf=input
*.jnlp crlf=input
-*.jpg -crlf -diff
+jpegtran -diff -crlf
+*.jpg -diff -crlf
*.jsmooth crlf=input
+*.la crlf=input
LGPL crlf=input
LICENSE crlf=input
-*.lmp -crlf -diff
+*.lmp -diff -crlf
*.loaders crlf=input
-*.lso -crlf -diff
+*.lso -diff -crlf
+*.m4 crlf=input
makefile crlf=input
Makefile crlf=input
-*.makespr32 crlf=input
makespr32 crlf=input
-*.map -crlf
+*.map -crlf filter=mapclean
*.mapinfo crlf=input
*.m crlf=input
-*.md3 -crlf -diff
+*.md3 -diff -crlf
*.md5anim -crlf
*.md5mesh -crlf
-*.mdl -crlf -diff
+*.mdl -diff -crlf
*.med crlf=input
*.mf crlf=input
-*.mid -crlf -diff
+*.mid -diff -crlf
*.mk crlf=input
-*.mkdir -crlf -diff
-*.mmpz -crlf -diff
-*.modinfo crlf=input
+*.mkdir -diff -crlf
+*.mmpz -diff -crlf
*.modules crlf=input
-nexuiz-map-compiler crlf=input
*.nib -crlf
*.obj -crlf
-OFFSETS -crlf -diff
-*.ogg -crlf -diff
+OFFSETS -diff -crlf
+*.ogg -diff -crlf
*.options crlf=input
pangorc crlf=input
*.patch crlf=input
*.patchsets crlf=input
-*.pcx -crlf -diff
-*.pfb -crlf -diff
-*.pfm -crlf -diff
-*.pk3 -crlf -diff
+*.pc crlf=input
+*.pcx -diff -crlf
+*.pfb -diff -crlf
+*.pfm -diff -crlf
+*.pk3 -diff -crlf
PkgInfo crlf=input
*.pl crlf=input
*.plist crlf=input
*.pm crlf=input
-*.png -crlf -diff
-POSITIONS -crlf -diff
+*.png -diff -crlf
+POSITIONS -diff -crlf
*.proj -crlf
*.properties crlf=input
-*.psd -crlf -diff
+*.psd -diff -crlf
*.py crlf=input
*.q3map1 crlf=input
*.qc crlf=input
*.rb crlf=input
*.rc2 crlf=input
*.rc -crlf
+rdjpgcom -diff -crlf
*.readme crlf=input
README crlf=input
-*.rtlights -crlf -diff
+*.rtlights -diff -crlf
SCHEMA crlf=input
*.scm crlf=input
-SDL -crlf -diff
-SDLMain.m crlf=input
+sdl-config crlf=input
+SDL -diff -crlf
*.shader crlf=input
*.sh crlf=input
*.skin crlf=input
*.sln -crlf
*.sounds crlf=input
-*.sp2 -crlf -diff
-*.spr32 -crlf -diff
-*.spr -crlf -diff
+*.sp2 -diff -crlf
+*.spr32 -diff -crlf
+*.spr -diff -crlf
*.src crlf=input
*.strings crlf=input
-*.strip crlf=input
strip crlf=input
-*.svg -crlf -diff
-*.TAB -crlf -diff
-*.tga -crlf -diff
-TMAP -crlf -diff
+*.svg -diff -crlf
+*.TAB -diff -crlf
+*.tga -diff -crlf
+TMAP -diff -crlf
todo crlf=input
TODO crlf=input
-*.ttf -crlf -diff
-*.TTF -crlf -diff
+*.ttf -diff -crlf
+*.TTF -diff -crlf
*.txt crlf=input
-*.TXT crlf=input
update-shaderlists crlf=input
+*.vbs -crlf
*.vcproj -crlf
-*.wav -crlf -diff
-*.waypoints -crlf -diff
+versionbuilder crlf=input
+*.wav -diff -crlf
+*.waypoints -diff -crlf
w crlf=input
*.width crlf=input
*.workspace -crlf
-*.xcf -crlf -diff
+wrjpgcom -diff -crlf
+*.xcf -diff -crlf
*.xlink crlf=input
*.xml crlf=input
xonotic-map-compiler-autobuild crlf=input
xonotic-map-compiler crlf=input
+xonotic-map-screenshot crlf=input
+xonotic-osx-agl crlf=input
+xonotic-osx-sdl crlf=input
*.xpm crlf=input
-*.zip -crlf -diff
+*.zip -diff -crlf
zipdiff crlf=input
-*.zym -crlf -diff
+*.zym -diff -crlf
set g_balance_nex_secondary_damagefalloff_forcehalflife 0
set g_balance_nex_charge 0
+set g_balance_nex_charge_mindmg 40
set g_balance_nex_charge_start 0
set g_balance_nex_charge_rate 0.1
+set g_balance_nex_charge_limit 0.5
set g_balance_nex_charge_shot_multiplier 0.5
set g_balance_nex_charge_velocity_rate 0.2
set g_balance_nex_charge_minspeed 400
set g_balance_nex_secondary_damagefalloff_forcehalflife 9999999
set g_balance_nex_charge 0
+set g_balance_nex_charge_mindmg 40
set g_balance_nex_charge_start 0
set g_balance_nex_charge_rate 0.1
+set g_balance_nex_charge_limit 0.5
set g_balance_nex_charge_shot_multiplier 0.5
set g_balance_nex_charge_velocity_rate 0.2
set g_balance_nex_charge_minspeed 400
set g_balance_nex_secondary_damagefalloff_forcehalflife 1500
set g_balance_nex_charge 0
+set g_balance_nex_charge_mindmg 40
set g_balance_nex_charge_start 0
set g_balance_nex_charge_rate 0.1
+set g_balance_nex_charge_limit 0.5
set g_balance_nex_charge_shot_multiplier 0.5
set g_balance_nex_charge_velocity_rate 0.2
set g_balance_nex_charge_minspeed 400
set g_balance_nex_secondary_damagefalloff_forcehalflife 1500
set g_balance_nex_charge 0
+set g_balance_nex_charge_mindmg 40
set g_balance_nex_charge_start 0
set g_balance_nex_charge_rate 0.1
+set g_balance_nex_charge_limit 0.5
set g_balance_nex_charge_shot_multiplier 0.5
set g_balance_nex_charge_velocity_rate 0.2
set g_balance_nex_charge_minspeed 400
set g_pickup_rockets 25
set g_pickup_rockets_weapon 15
set g_pickup_rockets_max 150
-set g_pickup_cells 25
-set g_pickup_cells_weapon 15
+set g_pickup_cells 30
+set g_pickup_cells_weapon 20
set g_pickup_cells_max 200
set g_pickup_fuel 25
set g_pickup_fuel_weapon 15
set g_balance_nex_secondary_force 0
set g_balance_nex_secondary_refire 0
set g_balance_nex_secondary_animtime 0
-set g_balance_nex_secondary_ammo 5
+set g_balance_nex_secondary_ammo 2
set g_balance_nex_secondary_damagefalloff_mindist 0
set g_balance_nex_secondary_damagefalloff_maxdist 0
set g_balance_nex_secondary_damagefalloff_halflife 0
set g_balance_nex_secondary_damagefalloff_forcehalflife 0
set g_balance_nex_charge 1
-set g_balance_nex_charge_start 0.25
-set g_balance_nex_charge_rate 0.025
+set g_balance_nex_charge_mindmg 40
+set g_balance_nex_charge_start 0.2
+set g_balance_nex_charge_rate 0.05
+set g_balance_nex_charge_limit 0.5
set g_balance_nex_charge_shot_multiplier 0.675
-set g_balance_nex_charge_velocity_rate 0.175
+set g_balance_nex_charge_velocity_rate 0.15
set g_balance_nex_charge_minspeed 400
set g_balance_nex_charge_maxspeed 1000
// }}}
set g_balance_campingrifle_primary_headshotaddeddamage 75
set g_balance_campingrifle_primary_spread 0
set g_balance_campingrifle_primary_force 2
-set g_balance_campingrifle_primary_speed 35000
+set g_balance_campingrifle_primary_speed 40000
set g_balance_campingrifle_primary_lifetime 5
set g_balance_campingrifle_primary_refire 1.5
set g_balance_campingrifle_primary_animtime 1.4
set g_balance_campingrifle_primary_ammo 10
-set g_balance_campingrifle_primary_bulletconstant 130 // 56.3qu
+set g_balance_campingrifle_primary_bulletconstant 110 // 62.2qu
set g_balance_campingrifle_primary_burstcost 0
set g_balance_campingrifle_primary_bullethail 0 // empty magazine on shot
set g_balance_campingrifle_secondary 1
set g_balance_campingrifle_secondary_headshotaddeddamage 50 // 50 damage only on head
set g_balance_campingrifle_secondary_spread 0
set g_balance_campingrifle_secondary_force 2
-set g_balance_campingrifle_secondary_speed 30000
+set g_balance_campingrifle_secondary_speed 20000
set g_balance_campingrifle_secondary_lifetime 5
set g_balance_campingrifle_secondary_refire 1.5
set g_balance_campingrifle_secondary_animtime 1.4
set g_balance_campingrifle_secondary_ammo 10
-set g_balance_campingrifle_secondary_bulletconstant 130 // 18.3qu
+set g_balance_campingrifle_secondary_bulletconstant 110 // 15.5qu
set g_balance_campingrifle_secondary_burstcost 0
set g_balance_campingrifle_secondary_bullethail 0 // empty magazine on shot
// }}}
seta crosshair_fireball_color_blue 0.2 "crosshair color blue component to display when wielding the fireball"
seta crosshair_fireball_color_alpha 1 "crosshair alpha value to display when wielding the fireball"
seta crosshair_fireball_size 1 "crosshair size when wielding the fireball"
-seta crosshair_ring_size 3 "bullet counter ring size for Rifle, velocity ring for Nex"
+seta crosshair_ring_size 2 "bullet counter ring size for Rifle, velocity ring for Nex"
seta crosshair_campingrifle_bulletcounter_alpha 0.15
seta crosshair_nexvelocity_alpha 0.15
seta cl_reticle_stretch 0 "whether to stretch reticles so they fit the screen (brakes image proportions)"
cl_deathfade 1 // fade screen to dark red when dead, value represents how fast the fade is (higher is faster)
cl_bobcycle 0 // how long the cycle of up/down view movement takes (only works if cl_bob is not 0), default is 0.6
cl_bob 0.01 // how much view moves up/down when moving (does not move if cl_bobcycle is 0, but still enables cl_bobmodel), default is 0.02
+cl_bob2cycle 0 // how long the cycle of left/right view movement takes (only works if cl_bob2 is not 0), default is 0.6
+cl_bob2 0.01 // how much view moves left/right when moving (does not move if cl_bob2cycle is 0), default is 0.01
+cl_bobfall 0.05 "how much the view swings down when falling (influenced by the speed you hit the ground with)"
+cl_bobfallcycle 3 "speed of the bobfall swing"
+cl_bobfallspeed 200 "necessary amount of speed for bob-falling to occur"
cl_bobmodel 1 // whether to have gun model move around on screen when moving (only works if cl_bob is not 0), default is 1
cl_leanmodel 1 // enables weapon leaning effect when looking around
cl_leanmodel_side_speed 0.7 "gun leaning sideways speed"
set g_grappling_hook 0 "let players spawn with the grappling hook which allows them to pull themselves up"
set g_dodging 0 "set to 1 to enable dodging in games"
+set g_rocket_flying 0 "set to 1 to enable rocket flying in all balance configs"
seta cl_dodging_timeout 0.2 "determines how long apart (in seconds) two taps on the same direction key are considered a dodge. use 0 to disable"
set g_arena_respawn_waves 0
set g_ca_respawn_delay 0
set g_ca_respawn_waves 0
+set g_ca_damage2score_multiplier 0.01
+set g_ca_round_timelimit 180
set g_nexball_respawn_delay 0
set g_nexball_respawn_waves 0
set g_as_respawn_delay 0
set sv_vote_timeout 30 "a vote will timeout after this many seconds"
set sv_vote_wait 120 "a player can not call a vote again for this many seconds when his vote was not accepted"
set sv_vote_stop 15 "a player can not call a vote again for this many seconds when he stopped this vote (e.g. to correct it)"
-set sv_vote_majority_factor 0.5 "which quotient of the PLAYERS constitute a majority? (try: 0.667, 0.75 when using the above)"
-set sv_vote_simple_majority_factor 0.667 "which quotient of the VOTERS constitute a majority too? (0 = off, otherwise it must be higher than or equal to sv_vote_majority_factor)"
+set sv_vote_majority_factor 0.5 "which quotient of the PLAYERS constitute a majority? (try: 0.666, 0.75 when using the above)"
+set sv_vote_simple_majority_factor 0.666 "which quotient of the VOTERS constitute a majority too? (0 = off, otherwise it must be higher than or equal to sv_vote_majority_factor)"
// when disabled, don't allow game type changes "note: set these two equal to JUST support simple majorities"
set sv_vote_override_mostrecent 0
alias vhelp "cmd vote help"
seta hud_panel_notify_time 10 "time that a new entry stays until it fades out"
seta hud_panel_notify_fadetime 3 "fade out time"
-seta hud_panel_modicons_dom_layout 0 "3 possible layouts: 0) only icons; 1) icons and percentage of average pps (points per second); 2) icons and average pps"
+seta hud_panel_modicons_dom_layout 1 "3 possible layouts: 0) only icons; 1) icons and percentage of average pps (points per second); 2) icons and average pps"
seta hud_panel_timer_increment 0 "show elapsed time instead of remaining time"
seta scoreboard_border_thickness 1 "scoreboard border thickness"
seta scoreboard_accuracy_border_thickness 1 "accuracy stats border thickness"
seta scoreboard_accuracy_doublerows 0 "use two rows instead of one"
-seta scoreboard_accuracy 1 "0 = no weapon accuracy stats panel on scoreboard"
-seta scoreboard_color_bg_r 0 "red color component of the HUD background"
-seta scoreboard_color_bg_g 0.4 "green color component of the HUD background"
-seta scoreboard_color_bg_b 0.6 "blue color component of the HUD background"
-seta scoreboard_color_bg_team 0.5 "team color multiplier of the HUD background"
+seta scoreboard_accuracy 1 "show weapon accuracy stats panel on scoreboard"
+seta scoreboard_color_bg_r 0 "red color component of the scoreboard background"
+seta scoreboard_color_bg_g 0.4 "green color component of the scoreboard background"
+seta scoreboard_color_bg_b 0.6 "blue color component of the scoreboard background"
+seta scoreboard_color_bg_team 0.5 "team color multiplier of the scoreboard background"
seta scoreboard_alpha_bg 0.6 "scoreboard background alpha"
seta scoreboard_alpha_fg 1 "scoreboard foreground alpha"
seta scoreboard_alpha_name 0.9 "alpha of player text in scoreboard list other than self"
seta scoreboard_highlight_alpha_self 0.25 "self highlight alpha value"
seta scoreboard_offset_left 0.04 "how many pixels the scoreboard is offset from the left screen edge"
seta scoreboard_offset_right 0.148 "how many pixels the scoreboard is offset from the right screen edge"
+seta scoreboard_bg_scale 0.25 "scale for the tiled scoreboard background"
// for menu server list (eventually make them have engine support?)
seta menu_slist_showfull 1 "show servers even if they are full and have no slots to join"
set menu_use_default_hostname 1
alias sethostname "set menu_use_default_hostname 0; hostname $*"
-// force fog for people who turn it off in game (set this to like 5 if you suspect people are "cheating" that way)
-set sv_foginterval 0
+set sv_foginterval 1 "force enable fog in regular intervals"
// Audio track names (for old-style "cd loop NUMBER" usage)
set _cdtrack_first "1"
// hud: font size
seta hud_fontsize 11
-seta hud_fontsize_spec 16
seta scr_centersize 12
seta hud_width 560
// alias hud_font "loadfont user1 ${1},gfx/fallback ${2-}; loadfont user2 ${1}-big ${2-}; scoreboard_columns_set"
set g_ban_sync_timeout 45 "time out in seconds for the ban sync requests"
set g_ban_sync_trusted_servers_verify 0 "when set to 1, additional bans sent by the servers are ignored, and only bans for the requested IP are used"
-set g_showweaponspawns 0 "1: display sprites for weapon spawns found on the map when a weapon key is pressed and the weapon is not available"
+set g_showweaponspawns 1 "display sprites for weapon spawns found on the map when a weapon key is pressed and the weapon is not available"
alias records "cmd records"
alias rankings "cmd rankings"
// use fake light if map has no lightmaps
r_fakelight 1
+
+// strength sound settings
+set sv_strengthsound_antispam_time 0.1 "minimum distance of strength sounds"
+set sv_strengthsound_antispam_refire_threshold 0.04 "apply minimum distance only if refire of the gun is smaller than this"
+
+// equalize looks better than fullbright
+r_equalize_entities_fullbright 1
+
+// UTF-8
+utf8_enable 1
+
+// safe font defaults
+r_font_hinting 1
+r_font_disable_freetype 0
+r_font_size_snapping 2
type static
color 0x202020 0x404040
size 2 2
-sizeincrease 2
-alpha 256 256 512
+sizeincrease 0.2
+alpha 256 256 256
airfriction -4
velocityjitter 4 4 4
type smoke
tex 62 62
color 0x404040 0x808080
size 1 1
-alpha 256 256 256
+alpha 256 256 128
gravity -0.125
bounce 1.5
liquidfriction 4
float nex_scope;
float cr_maxbullets;
+
+float bgmtime;
+
void PostInit(void);
void CSQC_Demo_Camera();
-float HUD_WouldDrawScoreboard ();
+float HUD_WouldDrawScoreboard();
float view_set;
float camera_mode;
float reticle_type;
}
}
- hud_accuracy_hud = cvar_or("hud_accuracy_hud", 1);
ColorTranslateMode = cvar("cl_stripcolorcodes");
activeweapon = getstati(STAT_SWITCHWEAPON);
f = cvar("teamplay");
}
// Draw the Crosshair
- float scoreboard_active;
- scoreboard_active = HUD_WouldDrawScoreboard();
R_SetView(VF_DRAWCROSSHAIR, 0); //Make sure engine crosshairs are always hidden
// Draw the Engine Status Bar (the default Quake HUD)
self.draw2d();
self = e;
+ scoreboard_active = HUD_WouldDrawScoreboard();
+
float hud;
hud = getstati(STAT_HUD);
if(hud == HUD_SPIDERBOT)
- {
CSQC_SPIDER_HUD();
- }
else if(hud == HUD_WAKIZASHI)
CSQC_WAKIZASHI_HUD();
else if(hud == HUD_RAPTOR)
// let's reset the view back to normal for the end
R_SetView(VF_MIN, '0 0 0');
R_SetView(VF_SIZE, '1 0 0' * w + '0 1 0' * h);
-
- // be safe against triggerbots until everyone has the fixed engine
- // this call is meant to overwrite the trace globals by something
- // unsuspicious
- traceline('0 0 0', '0 0 0', MOVE_WORLDONLY, world);
}
#define spider_h "gfx/vehicles/hud_bg.tga"
case HUD_NORMAL:
// do some accuracy var caching
float i;
+ if(cvar_string("hud_panel_weapons_accuracy_color_levels") != acc_color_levels)
if(!(gametype == GAME_RACE || gametype == GAME_CTS))
{
- acc_levels = tokenize(cvar_string("hud_panel_weapons_accuracy_color_levels"));
+ if(acc_color_levels)
+ strunzone(acc_color_levels);
+ acc_color_levels = strzone(cvar_string("hud_panel_weapons_accuracy_color_levels"));
+ acc_levels = tokenize(acc_color_levels);
if (acc_levels > MAX_ACCURACY_LEVELS)
acc_levels = MAX_ACCURACY_LEVELS;
HUD_Main(); // always run these functions for alpha checks
HUD_DrawScoreboard();
- if (scoreboard_showscores || scoreboard_showscores_force || getstati(STAT_HEALTH) <= 0 || intermission == 1) // scoreboard/accuracy
+ if (scoreboard_active) // scoreboard/accuracy
{
HUD_Reset();
// HUD_DrawScoreboard takes care of centerprint_start
var string autocvar_hud_panel_infomessages_bg_border;
var string autocvar_hud_panel_infomessages_bg_padding;
var float autocvar_hud_panel_infomessages_flip;
+
+var float autocvar_scoreboard_border_thickness;
float BGMScript(entity e)
{
- float t;
float amp, vel;
if(e.bgmscript == "")
e.just_toggled = FALSE;
- t = gettime(GETTIME_CDTRACK);
- if(t < 0)
+ if(bgmtime < 0)
return -1;
- if(t < e.bgmscripttime)
+ if(bgmtime < e.bgmscripttime)
{
//print("reset ", e.bgmscript, "\n");
amp = GetCurrentAmplitude(e, e.bgmscripttime - e.bgmscriptstatetime + drawframetime);
e.bgmscriptline = e.bgmscriptline0;
- e.bgmscripttime = t;
+ e.bgmscripttime = bgmtime;
// treat this as a stop event for all notes, to prevent sticking keys
e.bgmscriptstate = FALSE;
e.bgmscriptvolume = 1;
- e.bgmscriptstatetime = t - GetTimeForAmplitude(e, amp);
+ e.bgmscriptstatetime = bgmtime - GetTimeForAmplitude(e, amp);
}
// find the CURRENT line
for(;;)
{
tokenize_console(bufstr_get(bgmscriptbuf, e.bgmscriptline));
- if(stof(argv(1)) >= t || argv(0) != e.bgmscript)
+ if(stof(argv(1)) >= bgmtime || argv(0) != e.bgmscript)
{
- e.bgmscripttime = t;
- return GetCurrentAmplitude(e, t - e.bgmscriptstatetime);
+ e.bgmscripttime = bgmtime;
+ return GetCurrentAmplitude(e, bgmtime - e.bgmscriptstatetime);
}
- else if(t >= stof(argv(1)))
+ else if(bgmtime >= stof(argv(1)))
{
e.bgmscriptline += 1;
e.bgmscripttime = stof(argv(1));
string (float argnum) argv = #442;
string (string s) cvar_string = #448;
+string (string s) cvar_defstring = #482;
float () buf_create = #460;
void (float bufhandle) buf_del = #461;
sz = 0.8 + (a / 5);
- if(centerprint_num * cvar("scr_centersize") > 24 && HUD_WouldDrawScoreboard()) // 24 = height of Scoreboard text
- {
+ if(centerprint_num * cvar("scr_centersize") > 24 && scoreboard_active) // 24 = height of Scoreboard text
centerprint_start_y = scoreboard_bottom + centerprint_fontsize_y;
- }
+
pos = centerprint_start;
for (i=0; i<centerprint_num; i = i + 1)
{
float prevMouseClickedTime; // time during previous mouse click, to check for doubleclicks
vector prevMouseClickedPos; // pos during previous mouse click, to check for doubleclicks
-float menu_enabled;
-float menu_enabled_time;
float pressed_key_time;
void HUD_Panel_Arrow_Action(float nPrimary)
{
{
if (bInputType == 1)
return true;
- disable_menu_alphacheck = 1;
menu_enabled = 1;
menu_enabled_time = time;
localcmd("menu_showhudexit\n");
void HUD_Panel_Mouse()
{
// TODO: needs better check... is there any float that contains the current state of the menu? _menu_alpha isn't apparently updated the frame the menu gets enabled
- if (menu_enabled == 0) // menu dialog closed, enable normal alpha stuff again
- disable_menu_alphacheck = 0;
if (autocvar__menu_alpha == 0 && time - menu_enabled_time > 0.5)
menu_enabled = 0;
/*
- print("Disable menu_alphacheck: ", ftos(disable_menu_alphacheck), "\n");
+ print("menu_enabled: ", ftos(menu_enabled), "\n");
print("Highlighted: ", ftos(highlightedPanel), "\n");
print("Menu alpha: ", cvar_string("_menu_alpha"), "\n");
*/
- if(mouseClicked == 0 && disable_menu_alphacheck != 2 && highlightedPanel >= 0) { // don't reset these variables in disable_menu_alphacheck mode 2!
+ // instantly hide the editor cursor if we open the HUDExit dialog
+ // as hud_fade_alpha doesn't decrease to 0 in this case
+ // TODO: find a way to fade the cursor out even in this case
+ if(menu_enabled == 1 || (menu_enabled == 2 && !hud_fade_alpha))
+ return;
+
+ if(mouseClicked == 0 && menu_enabled != 2 && highlightedPanel >= 0) { // don't reset these variables in menu_enabled mode 2!
highlightedPanel = -1;
highlightedAction = 0;
}
if(time - prevMouseClickedTime < 0.4 && prevMouseClicked == 0 && prevMouseClickedPos == mousepos && highlightedPanel >= 0)
{
mouseClicked = 0; // to prevent spam, I guess.
- disable_menu_alphacheck = 2;
- menu_enabled = 1;
+ menu_enabled = 2;
menu_enabled_time = time;
HUD_Panel_GetName(highlightedPanel)
localcmd("menu_showhudoptions ", panel_name, "\n");
vector wpnpos;
vector wpnsize;
+ float show_accuracy;
+ if(autocvar_hud_panel_weapons_accuracy && acc_levels)
+ show_accuracy = true;
+
for(i = 0; i < weapon_cnt; ++i)
{
wpnpos = panel_pos + eX * column * panel_size_x*(1/columns) + eY * row * panel_size_y*(1/rows);
drawpic_aspect_skin(wpnpos, "weapon_current_bg", wpnsize, '1 1 1', fade * panel_fg_alpha, DRAWFLAG_NORMAL);
// draw the weapon accuracy
- if(acc_levels)
+ if(show_accuracy)
{
float weapon_hit, weapon_damage;
weapon_damage = weapon_fired[self.weapon-WEP_FIRST];
float mod_active; // is there any active mod icon?
+// Clan Arena HUD modicons
+void HUD_Mod_CA(vector pos, vector mySize)
+{
+ mod_active = 1; // CA should never hide the mod icons panel
+ float redalive, bluealive;
+ redalive = getstati(STAT_REDALIVE);
+ bluealive = getstati(STAT_BLUEALIVE);
+
+ drawfont = hud_bigfont;
+ vector redpos, bluepos;
+ if(mySize_x > mySize_y)
+ {
+ redpos = pos;
+ bluepos = pos + eY * 0.5 * mySize_y;
+ drawpic_aspect_skin(redpos, "player_red.tga", 0.5 * mySize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+ drawstring_aspect(redpos + eX * 0.5 * mySize_x, ftos(redalive), 0.5 * mySize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+ drawpic_aspect_skin(bluepos, "player_blue.tga", 0.5 * mySize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+ drawstring_aspect(bluepos + eX * 0.5 * mySize_x, ftos(bluealive), 0.5 * mySize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+ }
+ else
+ {
+ redpos = pos;
+ bluepos = pos + eY * 0.5 * mySize_y;
+ drawpic_aspect_skin(redpos, "player_red.tga", eX * mySize_x + eY * 0.3 * mySize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+ drawstring_aspect(redpos + eY * 0.3 * mySize_y, ftos(redalive), eX * mySize_x + eY * 0.2 * mySize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+ drawpic_aspect_skin(bluepos, "player_blue.tga", eX * mySize_x + eY * 0.3 * mySize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+ drawstring_aspect(bluepos + eY * 0.3 * mySize_y, ftos(bluealive), eX * mySize_x + eY * 0.2 * mySize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+ }
+ drawfont = hud_font;
+}
+
// CTF HUD modicon section
float redflag_prevframe, blueflag_prevframe; // status during previous frame
float redflag_prevstatus, blueflag_prevstatus; // last remembered status
crecordtime_prev = t;
crecordtime_change_time = time;
}
+
+ vector textPos, medalPos;
+ float squareSize;
+ if(mySize_x > mySize_y) {
+ // text on left side
+ squareSize = min(mySize_y, mySize_x/2);
+ textPos = pos + eX * 0.5 * max(0, mySize_x/2 - squareSize) + eY * 0.5 * (mySize_y - squareSize);
+ medalPos = pos + eX * 0.5 * max(0, mySize_x/2 - squareSize) + eX * 0.5 * mySize_x + eY * 0.5 * (mySize_y - squareSize);
+ } else {
+ // text on top
+ squareSize = min(mySize_x, mySize_y/2);
+ textPos = pos + eY * 0.5 * max(0, mySize_y/2 - squareSize) + eX * 0.5 * (mySize_x - squareSize);;
+ medalPos = pos + eY * 0.5 * max(0, mySize_y/2 - squareSize) + eY * 0.5 * mySize_y + eX * 0.5 * (mySize_x - squareSize);
+ }
+
f = time - crecordtime_change_time;
if (f > 1) {
- drawstring_aspect(pos, "Personal best", eX * 0.5 * mySize_x + eY * 0.25 * mySize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
- drawstring_aspect(pos + eY * 0.25 * mySize_y, TIME_ENCODED_TOSTRING(t), eX * 0.5 * mySize_x + eY * 0.25 * mySize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+ drawstring_aspect(textPos, "Personal best", eX * squareSize + eY * 0.25 * squareSize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+ drawstring_aspect(textPos + eY * 0.25 * squareSize, TIME_ENCODED_TOSTRING(t), eX * squareSize + eY * 0.25 * squareSize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
} else {
- drawstring_aspect(pos, "Personal best", eX * 0.5 * mySize_x + eY * 0.25 * mySize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
- drawstring_aspect(pos + eY * 0.25 * mySize_y, TIME_ENCODED_TOSTRING(t), eX * 0.5 * mySize_x + eY * 0.25 * mySize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
- drawstring_aspect_expanding(pos, "Personal best", eX * 0.5 * mySize_x + eY * 0.25 * mySize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL, f);
- drawstring_aspect_expanding(pos + eY * 0.25 * mySize_y, TIME_ENCODED_TOSTRING(t), eX * 0.5 * mySize_x + eY * 0.25 * mySize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL, f);
+ drawstring_aspect(textPos, "Personal best", eX * squareSize + eY * 0.25 * squareSize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+ drawstring_aspect(textPos + eY * 0.25 * squareSize, TIME_ENCODED_TOSTRING(t), eX * squareSize + eY * 0.25 * squareSize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+ drawstring_aspect_expanding(pos, "Personal best", eX * squareSize + eY * 0.25 * squareSize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL, f);
+ drawstring_aspect_expanding(pos + eY * 0.25 * squareSize, TIME_ENCODED_TOSTRING(t), eX * squareSize + eY * 0.25 * squareSize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL, f);
}
// server record
f = time - srecordtime_change_time;
if (f > 1) {
- drawstring_aspect(pos + eY * 0.5 * mySize_y, "Server best", eX * 0.5 * mySize_x + eY * 0.25 * mySize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
- drawstring_aspect(pos + eY * 0.75 * mySize_y, TIME_ENCODED_TOSTRING(t), eX * 0.5 * mySize_x + eY * 0.25 * mySize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+ drawstring_aspect(textPos + eY * 0.5 * squareSize, "Server best", eX * squareSize + eY * 0.25 * squareSize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+ drawstring_aspect(textPos + eY * 0.75 * squareSize, TIME_ENCODED_TOSTRING(t), eX * squareSize + eY * 0.25 * squareSize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
} else {
- drawstring_aspect(pos + eY * 0.5 * mySize_y, "Server best", eX * 0.5 * mySize_x + eY * 0.25 * mySize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
- drawstring_aspect(pos + eY * 0.75 * mySize_y, TIME_ENCODED_TOSTRING(t), eX * 0.5 * mySize_x + eY * 0.25 * mySize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
- drawstring_aspect_expanding(pos + eY * 0.5 * mySize_y, "Server best", eX * 0.5 * mySize_x + eY * 0.25 * mySize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL, f);
- drawstring_aspect_expanding(pos + eY * 0.75 * mySize_y, TIME_ENCODED_TOSTRING(t), eX * 0.5 * mySize_x + eY * 0.25 * mySize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL, f);
+ drawstring_aspect(textPos + eY * 0.5 * squareSize, "Server best", eX * squareSize + eY * 0.25 * squareSize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+ drawstring_aspect(textPos + eY * 0.75 * squareSize, TIME_ENCODED_TOSTRING(t), eX * squareSize + eY * 0.25 * squareSize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+ drawstring_aspect_expanding(textPos + eY * 0.5 * squareSize, "Server best", eX * squareSize + eY * 0.25 * squareSize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL, f);
+ drawstring_aspect_expanding(textPos + eY * 0.75 * squareSize, TIME_ENCODED_TOSTRING(t), eX * squareSize + eY * 0.25 * squareSize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL, f);
}
if (race_status != race_status_prev || race_status_name != race_status_name_prev) {
race_status_name_prev = strzone(race_status_name);
}
- pos_x += mySize_x/2;
// race "awards"
float a;
a = bound(0, race_status_time - time, 1);
string s;
- s = textShortenToWidth(race_status_name, mySize_y, '1 1 0' * 0.1 * mySize_y, stringwidth_colors);
+ s = textShortenToWidth(race_status_name, squareSize, '1 1 0' * 0.1 * squareSize, stringwidth_colors);
float rank;
if(race_status > 0)
rankname = race_PlaceName(rank);
vector namepos;
- namepos = pos + '0.5 0.9 0' * mySize_y - eX * stringwidth(s, TRUE, '1 1 0' * 0.1 * mySize_y);
+ namepos = medalPos + '0 0.8 0' * squareSize;
vector rankpos;
- rankpos = pos + '0.5 0.25 0' * mySize_y - eX * stringwidth(rankname, TRUE, '1 1 0' * 0.15 * mySize_y);
+ rankpos = medalPos + '0 0.15 0' * squareSize;
if(race_status == 0)
- drawpic_aspect_skin(pos, "race_newfail", '1 1 0' * mySize_y, '1 1 1', panel_fg_alpha * a, DRAWFLAG_NORMAL);
+ drawpic_aspect_skin(medalPos, "race_newfail", '1 1 0' * squareSize, '1 1 1', panel_fg_alpha * a, DRAWFLAG_NORMAL);
else if(race_status == 1) {
- drawpic_aspect_skin(pos, "race_newtime", '1 1 0' * 0.9 * mySize_y, '1 1 1', panel_fg_alpha * a, DRAWFLAG_NORMAL);
- drawcolorcodedstring(namepos, s, '1 1 0' * 0.1 * mySize_y, panel_fg_alpha * a, DRAWFLAG_NORMAL);
- drawstring(rankpos, rankname, '1 1 0' * 0.15 * mySize_y, '1 1 1', panel_fg_alpha * a, DRAWFLAG_NORMAL);
+ drawpic_aspect_skin(medalPos + '0.1 0 0' * squareSize, "race_newtime", '1 1 0' * 0.8 * squareSize, '1 1 1', panel_fg_alpha * a, DRAWFLAG_NORMAL);
+ drawcolorcodedstring_aspect(namepos, s, '1 0.2 0' * squareSize, panel_fg_alpha * a, DRAWFLAG_NORMAL);
+ drawstring_aspect(rankpos, rankname, '1 0.15 0' * squareSize, '1 1 1', panel_fg_alpha * a, DRAWFLAG_NORMAL);
} else if(race_status == 2) {
if(race_status_name == GetPlayerName(player_localentnum -1) || !race_myrank || race_myrank < rank)
- drawpic_aspect_skin(pos, "race_newrankgreen", '1 1 0' * 0.9 * mySize_y, '1 1 1', panel_fg_alpha * a, DRAWFLAG_NORMAL);
+ drawpic_aspect_skin(medalPos + '0.1 0 0' * squareSize, "race_newrankgreen", '1 1 0' * 0.8 * squareSize, '1 1 1', panel_fg_alpha * a, DRAWFLAG_NORMAL);
else
- drawpic_aspect_skin(pos, "race_newrankyellow", '1 1 0' * 0.9 * mySize_y, '1 1 1', panel_fg_alpha * a, DRAWFLAG_NORMAL);
- drawcolorcodedstring(namepos, s, '1 1 0' * 0.1 * mySize_y, panel_fg_alpha * a, DRAWFLAG_NORMAL);
- drawstring(rankpos, rankname, '1 1 0' * 0.15 * mySize_y, '1 1 1', panel_fg_alpha * a, DRAWFLAG_NORMAL);
+ drawpic_aspect_skin(medalPos + '0.1 0 0' * squareSize, "race_newrankyellow", '1 1 0' * 0.8 * squareSize, '1 1 1', panel_fg_alpha * a, DRAWFLAG_NORMAL);
+ drawcolorcodedstring_aspect(namepos, s, '1 0.2 0' * squareSize, panel_fg_alpha * a, DRAWFLAG_NORMAL);
+ drawstring_aspect(rankpos, rankname, '1 0.15 0' * squareSize, '1 1 1', panel_fg_alpha * a, DRAWFLAG_NORMAL);
} else if(race_status == 3) {
- drawpic_aspect_skin(pos, "race_newrecordserver", '1 1 0' * 0.9 * mySize_y, '1 1 1', panel_fg_alpha * a, DRAWFLAG_NORMAL);
- drawcolorcodedstring(namepos, s, '1 1 0' * 0.1 * mySize_y, panel_fg_alpha * a, DRAWFLAG_NORMAL);
- drawstring(rankpos, rankname, '1 1 0' * 0.15 * mySize_y, '1 1 1', panel_fg_alpha * a, DRAWFLAG_NORMAL);
+ drawpic_aspect_skin(medalPos + '0.1 0 0' * squareSize, "race_newrecordserver", '1 1 0' * 0.8 * squareSize, '1 1 1', panel_fg_alpha * a, DRAWFLAG_NORMAL);
+ drawcolorcodedstring_aspect(namepos, s, '1 0.2 0' * squareSize, panel_fg_alpha * a, DRAWFLAG_NORMAL);
+ drawstring_aspect(rankpos, rankname, '1 0.15 0' * squareSize, '1 1 1', panel_fg_alpha * a, DRAWFLAG_NORMAL);
}
if (race_status_time - time <= 0) {
void HUD_Mod_Dom(vector myPos, vector mySize)
{
+ mod_active = 1; // required in each mod function that always shows something
entity tm;
float teams_count;
for(tm = teams.sort_next; tm; tm = tm.sort_next)
if(!autocvar_hud_panel_modicons && !autocvar__hud_configure)
return;
- if (gametype != GAME_KEYHUNT && gametype != GAME_CTF && gametype != GAME_NEXBALL && gametype != GAME_CTS && gametype != GAME_RACE && gametype != GAME_DOMINATION && !autocvar__hud_configure)
+ if (gametype != GAME_KEYHUNT && gametype != GAME_CTF && gametype != GAME_NEXBALL && gametype != GAME_CTS && gametype != GAME_RACE && gametype != GAME_CA && gametype != GAME_DOMINATION && !autocvar__hud_configure)
return;
active_panel = HUD_PANEL_MODICONS;
HUD_Mod_Race(pos, mySize);
else if(gametype == GAME_DOMINATION)
HUD_Mod_Dom(pos, mySize);
+ else if(gametype == GAME_CA)
+ HUD_Mod_CA(pos, mySize);
}
// Draw pressed keys (#11)
pos = (vid_conheight - numsize_y) * cvar("cl_showspeed_position");
drawfont = hud_bigfont;
- drawstringcenter(eX + pos * eY, speed, numsize, '1 1 1', autocvar_hud_panel_fg_alpha, DRAWFLAG_NORMAL);
+ drawstringcenter(eX + pos * eY, speed, numsize, '1 1 1', autocvar_hud_panel_fg_alpha * hud_fade_alpha, DRAWFLAG_NORMAL);
if (cvar("cl_showspeed_z") == 1) {
zspeed = strcat(ftos(fabs(floor( pmove_vel_z * conversion_factor + 0.5 ))), unit);
- drawstringcenter(eX + pos * eY + numsize_y * eY, zspeed, numsize * 0.5, '1 1 1', autocvar_hud_panel_fg_alpha, DRAWFLAG_NORMAL);
+ drawstringcenter(eX + pos * eY + numsize_y * eY, zspeed, numsize * 0.5, '1 1 1', autocvar_hud_panel_fg_alpha * hud_fade_alpha, DRAWFLAG_NORMAL);
}
drawfont = hud_font;
f = bound(0, f * 10, 1);
acc_avg = acc_avg * (1 - f) + acceleration * f;
acceleration = acc_avg / getstatf(STAT_MOVEVARS_MAXSPEED);
+ if (acceleration == 0)
+ return;
pos = top - sz/2 * eY + (cvar("cl_showacceleration_position") * vid_conheight) * eY;
if (cvar("cl_showacceleration_color_custom"))
rgb = stov(cvar_string("cl_showacceleration_color"));
else {
- rgb = '1 1 1';
- if (acceleration < 0) {
+ if (acceleration < 0)
rgb = '1 .5 .5' - '0 .5 .5' * bound(0, -acceleration * 0.2, 1);
- } else if (acceleration > 0) {
+ else
rgb = '.5 1 .5' - '.5 0 .5' * bound(0, +acceleration * 0.2, 1);
- }
}
if (acceleration > 0)
- HUD_Panel_DrawProgressBar(pos, 0, acceleration * scale * '40 0 0' + sz * eY, rgb, alpha * autocvar_hud_panel_fg_alpha, DRAWFLAG_NORMAL);
- else if (acceleration < 0)
- HUD_Panel_DrawProgressBar(pos + acceleration * scale * '40 0 0', 0, -acceleration * scale * '40 0 0' + sz * eY, rgb, alpha * autocvar_hud_panel_fg_alpha, DRAWFLAG_NORMAL);
+ HUD_Panel_DrawProgressBar(pos, 0, acceleration * scale * '40 0 0' + sz * eY, rgb, alpha * autocvar_hud_panel_fg_alpha * hud_fade_alpha, DRAWFLAG_NORMAL);
+ else
+ HUD_Panel_DrawProgressBar(pos + acceleration * scale * '40 0 0', 0, -acceleration * scale * '40 0 0' + sz * eY, rgb, alpha * autocvar_hud_panel_fg_alpha * hud_fade_alpha, DRAWFLAG_NORMAL);
}
void HUD_Reset (void)
hud_skin_path = strcat("gfx/hud/", autocvar_hud_skin);
// global hud alpha fade
- if(disable_menu_alphacheck == 1)
+ if(menu_enabled == 1)
hud_fade_alpha = 1;
else
hud_fade_alpha = (1 - autocvar__menu_alpha);
else if(autocvar__menu_alpha == 0 && scoreboard_fade_alpha == 0)
hud_fade_alpha = 1;
- hud_border_thickness = bound(0, cvar("hud_border_thickness"), 5);
- hud_accuracy_border_thickness = bound(0, cvar_or("hud_accuracy_border_thickness", 1), 5);
-
hud_fontsize = HUD_GetFontsize("hud_fontsize");
- hud_fontsize_spec = HUD_GetFontsize("hud_fontsize_spec");
+
+ if(!autocvar__hud_configure && !hud_fade_alpha)
+ return;
// Drawing stuff
}
}
- float f;
- vector color;
- if((teamplay) && autocvar_hud_dock_color_team) {
- f = stof(getplayerkey(player_localentnum - 1, "colors"));
- color = colormapPaletteColor(mod(f, 16), 1) * autocvar_hud_dock_color_team;
- }
- else if(autocvar_hud_configure_teamcolorforced && autocvar__hud_configure && autocvar_hud_dock_color_team) {
- color = '1 0 0' * autocvar_hud_dock_color_team;
- }
- else if(autocvar_hud_dock_color == "shirt") {
- f = stof(getplayerkey(player_localentnum - 1, "colors"));
- color = colormapPaletteColor(floor(f / 16), 0);
- }
- else if(autocvar_hud_dock_color == "pants") {
- f = stof(getplayerkey(player_localentnum - 1, "colors"));
- color = colormapPaletteColor(mod(f, 16), 1);
- }
- else
- color = stov(autocvar_hud_dock_color);
-
// draw the dock
if(autocvar_hud_dock != "" && autocvar_hud_dock != "0")
{
+ float f;
+ vector color;
+ if((teamplay) && autocvar_hud_dock_color_team) {
+ f = stof(getplayerkey(player_localentnum - 1, "colors"));
+ color = colormapPaletteColor(mod(f, 16), 1) * autocvar_hud_dock_color_team;
+ }
+ else if(autocvar_hud_configure_teamcolorforced && autocvar__hud_configure && autocvar_hud_dock_color_team) {
+ color = '1 0 0' * autocvar_hud_dock_color_team;
+ }
+ else if(autocvar_hud_dock_color == "shirt") {
+ f = stof(getplayerkey(player_localentnum - 1, "colors"));
+ color = colormapPaletteColor(floor(f / 16), 0);
+ }
+ else if(autocvar_hud_dock_color == "pants") {
+ f = stof(getplayerkey(player_localentnum - 1, "colors"));
+ color = colormapPaletteColor(mod(f, 16), 1);
+ }
+ else
+ color = stov(autocvar_hud_dock_color);
+
string pic;
pic = strcat(hud_skin_path, "/", autocvar_hud_dock);
if(precache_pic(pic) == "") {
hud_configure_prev = autocvar__hud_configure;
if (!autocvar__hud_configure) // hud config mode disabled, enable normal alpha stuff again
- disable_menu_alphacheck = 0;
+ if (menu_enabled)
+ menu_enabled = 0;
}
#define MAX_ACCURACY_LEVELS 10
float acc_lev[MAX_ACCURACY_LEVELS];
float acc_levels;
+string acc_color_levels;
float complain_weapon;
string complain_weapon_name;
float weaponprevtime;
float teamnagger;
-float hud_accuracy_hud;
-float hud_border_thickness;
-float hud_accuracy_border_thickness;
float hud_configure_checkcollisions;
float hud_configure_prev;
const float S_CTRL = 2;
const float S_ALT = 4;
-float disable_menu_alphacheck; // 0 = enable alpha check, 1 = disable for entire hud, 2 = disable for one panel
+float menu_enabled; // 1 showing the entire HUD, 2 showing only the clicked panel
+float menu_enabled_time;
+
float hud_fade_alpha;
string hud_skin_path;
panel_bg_alpha_str = ftos(autocvar_hud_panel_bg_alpha);\
}\
panel_bg_alpha = stof(panel_bg_alpha_str);\
-if(autocvar__hud_configure && disable_menu_alphacheck == 2 && highlightedPanel == active_panel) {\
+if(autocvar__hud_configure && menu_enabled == 2 && highlightedPanel == active_panel) {\
panel_bg_alpha = (1 - autocvar__menu_alpha) * max(autocvar_hud_configure_bg_minalpha, panel_bg_alpha) + autocvar__menu_alpha * panel_bg_alpha;\
} else if(autocvar__hud_configure) {\
panel_bg_alpha = max(autocvar_hud_configure_bg_minalpha, panel_bg_alpha);\
} if(autocvar__hud_configure && !panel_enabled) {\
panel_bg_alpha = 0.25;\
-} if(!(disable_menu_alphacheck == 2 && highlightedPanel == active_panel)) {\
+} if(!(menu_enabled == 2 && highlightedPanel == active_panel)) {\
panel_bg_alpha *= hud_fade_alpha;\
}
panel_fg_alpha = autocvar_hud_panel_fg_alpha;\
if(autocvar__hud_configure && !panel_enabled)\
panel_fg_alpha = 0.25;\
-if(!(disable_menu_alphacheck == 2 && highlightedPanel == active_panel))\
+if(!(menu_enabled == 2 && highlightedPanel == active_panel))\
panel_fg_alpha *= hud_fade_alpha;
// Get border. See comments above, it's similar.
panel_bg_border_str = autocvar_hud_panel_##name##_bg_border; \
panel_bg_padding_str = autocvar_hud_panel_##name##_bg_padding; \
HUD_Panel_StringVars()\
-if(disable_menu_alphacheck == 2 && active_panel == highlightedPanel) {\
+if(menu_enabled == 2 && active_panel == highlightedPanel) {\
HUD_Panel_GetMenuSize()\
HUD_Panel_GetMenuPos()\
}
panel_pos = autocvar_hud_panel_##name##_pos; \
panel_size = autocvar_hud_panel_##name##_size; \
HUD_Panel_GetScaledVectors()\
-if(disable_menu_alphacheck == 2 && active_panel == highlightedPanel) {\
+if(menu_enabled == 2 && active_panel == highlightedPanel) {\
HUD_Panel_GetMenuSize()\
HUD_Panel_GetMenuPos()\
}\
vector hud_fontsize;
-vector hud_fontsize_spec;
float RANKINGS_RECEIVED_CNT;
string grecordholder[RANKINGS_CNT];
pos_x = pos_x + text_size*0.5 - img_size_x*0.5;
pos_y = pos_y - img_size_y;
- pos += hud_border_thickness * '1 1 0';
- img_size -= (hud_border_thickness * 2) * '1 1 0';
+ pos += autocvar_scoreboard_border_thickness * '1 1 0';
+ img_size -= (autocvar_scoreboard_border_thickness * 2) * '1 1 0';
if(pic == "")
{
drawfill(pos, img_size, '.5 .5 .5', .7, DRAWFLAG_NORMAL);
{
drawpic(pos, pic, img_size, '1 1 1', 1, DRAWFLAG_NORMAL);
}
-
- drawpic(pos + '1 0 0', strcat("gfx/hud/num_", ftos(id+1)), (img_size_y / 5) * '1 1 0', '1 1 1', 0.6, DRAWFLAG_NORMAL);
- if(id == mv_ownvote || pic == "")
- {
- drawborderlines(hud_border_thickness, pos, img_size, rgb, 1, DRAWFLAG_NORMAL);
- drawpic(pos + '1 0 0', strcat("gfx/hud/num_", ftos(id+1)), (img_size_y / 5) * '1 1 0', rgb, 0.6, DRAWFLAG_NORMAL);
- }
+ if(id == mv_ownvote)
+ drawborderlines(autocvar_scoreboard_border_thickness, pos, img_size, rgb, 1, DRAWFLAG_NORMAL);
else
- {
- drawborderlines(hud_border_thickness, pos, img_size, '0 0 0', 1, DRAWFLAG_NORMAL);
- drawpic(pos + '1 0 0', strcat("gfx/hud/num_", ftos(id+1)), (img_size_y / 5) * '1 1 0', '1 1 1', 0.6, DRAWFLAG_NORMAL);
- }
+ drawborderlines(autocvar_scoreboard_border_thickness, pos, img_size, '0 0 0', 1, DRAWFLAG_NORMAL);
+
+ if(id == mv_selection)
+ drawfill(pos, img_size, '1 1 1', 0.1, DRAWFLAG_NORMAL);
}
void MapVote_DrawAbstain(vector pos, float isize, float tsize, float count, float id)
}
// this draws the triangles of a model DIRECTLY. Don't expect high performance, really...
-void PolyDrawModel(entity e)
+float PolyDrawModelSurface(entity e, float i_s)
{
- float i_s, i_t;
+ float i_t;
float n_t;
vector tri;
string tex;
- for(i_s = 0; ; ++i_s)
+ tex = getsurfacetexture(e, i_s);
+ if not(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)
{
- tex = getsurfacetexture(e, i_s);
- if not(tex)
- break; // this is beyond the last one
- n_t = getsurfacenumtriangles(e, i_s);
- for(i_t = 0; i_t < n_t; ++i_t)
- {
- tri = getsurfacetriangle(e, i_s, i_t);
- R_BeginPolygon(tex, 0);
- R_PolygonVertex(getsurfacepoint(e, i_s, tri_x), getsurfacepointattribute(e, i_s, tri_x, SPA_TEXCOORDS0), '1 1 1', 1);
- R_PolygonVertex(getsurfacepoint(e, i_s, tri_y), getsurfacepointattribute(e, i_s, tri_y, SPA_TEXCOORDS0), '1 1 1', 1);
- R_PolygonVertex(getsurfacepoint(e, i_s, tri_z), getsurfacepointattribute(e, i_s, tri_z, SPA_TEXCOORDS0), '1 1 1', 1);
- R_EndPolygon();
- }
+ tri = getsurfacetriangle(e, i_s, i_t);
+ R_BeginPolygon(tex, 0);
+ R_PolygonVertex(getsurfacepoint(e, i_s, tri_x), getsurfacepointattribute(e, i_s, tri_x, SPA_TEXCOORDS0), '1 1 1', 1);
+ R_PolygonVertex(getsurfacepoint(e, i_s, tri_y), getsurfacepointattribute(e, i_s, tri_y, SPA_TEXCOORDS0), '1 1 1', 1);
+ R_PolygonVertex(getsurfacepoint(e, i_s, tri_z), getsurfacepointattribute(e, i_s, tri_z, SPA_TEXCOORDS0), '1 1 1', 1);
+ R_EndPolygon();
}
+ return 1;
+}
+void PolyDrawModel(entity e)
+{
+ float i_s;
+ for(i_s = 0; ; ++i_s)
+ if(!PolyDrawModelSurface(e, i_s))
+ break;
}
void DrawCircleClippedPic(vector centre, float radius, string pic, float f, vector rgb, float a, float drawflag)
void Net_ReadNexgunBeamParticle()
{
vector shotorg, endpos;
+ float charge;
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 = charge;
if (cvar("cl_particles_oldnexbeam") && (getstati(STAT_ALLOW_OLDNEXBEAM) || isdemo()))
- WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3"), shotorg, endpos);
+ WarpZone_TrailParticles_WithMultiplier(world, particleeffectnum("TE_TEI_G3"), shotorg, endpos, charge, 1);
else
- WarpZone_TrailParticles(world, particleeffectnum("nex_beam"), shotorg, endpos);
+ WarpZone_TrailParticles_WithMultiplier(world, particleeffectnum("nex_beam"), shotorg, endpos, charge, 1);
}
drawpic(pos, "gfx/scoreboard/scoreboard_tableheader", tmp, rgb + '0.5 0.5 0.5', scoreboard_alpha_bg, DRAWFLAG_NORMAL);
// table border
- tmp_y += hud_border_thickness;
+ tmp_y += autocvar_scoreboard_border_thickness;
tmp_y += body_table_height;
- drawborderlines(hud_border_thickness, pos, tmp, '0 0 0', scoreboard_alpha_bg, DRAWFLAG_NORMAL); // more transparency for the scoreboard
+ drawborderlines(autocvar_scoreboard_border_thickness, pos, tmp, '0 0 0', scoreboard_alpha_bg, DRAWFLAG_NORMAL); // more transparency for the scoreboard
// separator header/table
pos_y += 1.25 * hud_fontsize_y;
- tmp_y = hud_border_thickness;
+ tmp_y = autocvar_scoreboard_border_thickness;
drawfill(pos, tmp, '0 0 0', scoreboard_alpha_bg, DRAWFLAG_NORMAL);
- pos_y += hud_border_thickness;
+ pos_y += autocvar_scoreboard_border_thickness;
// table background
tmp_y = body_table_height;
// go back to the top to make alternated columns highlighting and to print the strings
pos_y -= 1.25 * hud_fontsize_y;
- pos_y -= hud_border_thickness;
+ pos_y -= autocvar_scoreboard_border_thickness;
pos += '1 1 0';
if (scoreboard_highlight)
{
column_dim_y = 1.25 * hud_fontsize_y; // header
- column_dim_y += hud_border_thickness;
+ column_dim_y += autocvar_scoreboard_border_thickness;
column_dim_y += body_table_height;
}
pos_x = xmin;
pos_y += 1.25 * hud_fontsize_y; // skip the header
- pos_y += hud_border_thickness;
+ pos_y += autocvar_scoreboard_border_thickness;
// fill the table and draw the rows
i = 0;
return 1;
else if (intermission == 1)
return 1;
- else if (intermission == 2 && scoreboard_showscores)
- return 1;
else if (getstati(STAT_HEALTH) <= 0 && cvar("cl_deathscoreboard"))
return 1;
- else if(scoreboard_showscores_force)
+ else if (scoreboard_showscores_force)
return 1;
return 0;
}
{
float i;
float weapon_hit, weapon_damage, weapon_stats;
- float fontsize = 40 * 1/3;
float weapon_cnt = WEP_COUNT - 3; // either minstanex/nex are hidden, no port-o-launch, no tuba
float rows;
if(cvar("scoreboard_accuracy_doublerows"))
else
rows = 1;
float height = 40;
-
- if(warmup_stage)
- {
- return pos;
- }
+ float fontsize = height * 1/3;
+ float weapon_height = height * 2/3;
+ float weapon_width = sbwidth / weapon_cnt;
drawstring(pos, strcat("Accuracy stats (average ", ftos(average_accuracy), "%)"), hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
pos_y += 1.25 * hud_fontsize_y;
drawpic_tiled(pos, "gfx/scoreboard/scoreboard_bg", bg_size, tmp, rgb * autocvar_scoreboard_color_bg_team, scoreboard_alpha_bg, DRAWFLAG_NORMAL);
else
drawpic_tiled(pos, "gfx/scoreboard/scoreboard_bg", bg_size, tmp, rgb, scoreboard_alpha_bg, DRAWFLAG_NORMAL);
- drawborderlines(hud_accuracy_border_thickness, pos, tmp, '0 0 0', scoreboard_alpha_bg * 0.75, DRAWFLAG_NORMAL);
+ drawborderlines(autocvar_scoreboard_border_thickness, pos, tmp, '0 0 0', scoreboard_alpha_bg * 0.75, DRAWFLAG_NORMAL);
// column highlighting
for(i = 0; i < weapon_cnt/rows; ++i)
{
if(!mod(i, 2))
- drawfill(pos + '1 0 0' * (sbwidth/weapon_cnt) * rows * i, '0 1 0' * height * rows + '1 0 0' * (sbwidth/weapon_cnt) * rows, '0 0 0', scoreboard_alpha_bg * 0.2, DRAWFLAG_NORMAL);
+ drawfill(pos + '1 0 0' * weapon_width * rows * i, '0 1 0' * height * rows + '1 0 0' * weapon_width * rows, '0 0 0', scoreboard_alpha_bg * 0.2, DRAWFLAG_NORMAL);
}
// row highlighting
for(i = 0; i < rows; ++i)
{
- drawfill(pos + '0 1 0' * height * (2/3) + '0 1 0' * height * i, '1 0 0' * sbwidth + '0 1 0' * fontsize, '1 1 1', scoreboard_highlight_alpha, DRAWFLAG_NORMAL);
+ drawfill(pos + '0 1 0' * weapon_height + '0 1 0' * height * i, '1 0 0' * sbwidth + '0 1 0' * fontsize, '1 1 1', scoreboard_highlight_alpha, DRAWFLAG_NORMAL);
}
drawfont = hud_bigfont;
float weapons_with_stats;
weapons_with_stats = 0;
if(rows == 2)
- pos_x += sbwidth/weapon_cnt / 2;
+ pos_x += weapon_width / 2;
if(getstati(STAT_SWITCHWEAPON) == WEP_MINSTANEX)
g_minstagib = 1; // TODO: real detection for minstagib?
+ if (!acc_levels)
+ rgb = '1 1 1';
+
for(i = WEP_FIRST; i <= WEP_LAST; ++i)
{
self = get_weaponinfo(i);
weapon_alpha = 0.2 * scoreboard_alpha_fg;
// weapon icon
- drawpic_aspect_skin(pos, strcat("weapon", self.netname), '1 0 0' * sbwidth * (1/weapon_cnt) + '0 1 0' * height * (2/3), '1 1 1', weapon_alpha, DRAWFLAG_NORMAL);
+ drawpic_aspect_skin(pos, strcat("weapon", self.netname), '1 0 0' * weapon_width + '0 1 0' * weapon_height, '1 1 1', weapon_alpha, DRAWFLAG_NORMAL);
// the accuracy
if(weapon_damage) {
weapons_with_stats += 1;
s = strcat(ftos(weapon_stats),"%");
float padding;
- padding = ((sbwidth/weapon_cnt) - stringwidth(s, FALSE, '1 0 0' * fontsize)) / 2; // center the accuracy value
+ padding = (weapon_width - stringwidth(s, FALSE, '1 0 0' * fontsize)) / 2; // center the accuracy value
float weapon_hit, weapon_damage;
weapon_damage = weapon_fired[self.weapon-WEP_FIRST];
weapon_stats = floor(100 * weapon_hit / weapon_damage);
}
- // find the max level lower than weapon_stats
- float j;
- j = acc_levels-1;
- while ( j && weapon_stats < acc_lev[j] )
- --j;
-
- // inject color j+1 in color j, how much depending on how much weapon_stats is higher than level j
- float factor;
- factor = (weapon_stats - acc_lev[j]) / (acc_lev[j+1] - acc_lev[j]);
- rgb = acc_color(j);
- rgb = rgb + factor * (acc_color(j+1) - rgb);
+ if (acc_levels)
+ {
+ // find the max level lower than weapon_stats
+ float j;
+ j = acc_levels-1;
+ while ( j && weapon_stats < acc_lev[j] )
+ --j;
+
+ // inject color j+1 in color j, how much depending on how much weapon_stats is higher than level j
+ float factor;
+ factor = (weapon_stats - acc_lev[j]) / (acc_lev[j+1] - acc_lev[j]);
+ rgb = acc_color(j);
+ rgb = rgb + factor * (acc_color(j+1) - rgb);
+ }
- drawstring(pos + '1 0 0' * padding + '0 1 0' * height * (2/3), s, '1 1 0' * fontsize, rgb, scoreboard_alpha_fg, DRAWFLAG_NORMAL);
+ drawstring(pos + '1 0 0' * padding + '0 1 0' * weapon_height, s, '1 1 0' * fontsize, rgb, scoreboard_alpha_fg, DRAWFLAG_NORMAL);
}
- pos_x += sbwidth/weapon_cnt * rows;
+ pos_x += weapon_width * rows;
if(rows == 2 && i == 6) {
pos_x -= sbwidth;
pos_y += height;
average_accuracy = floor(average_accuracy / weapons_with_stats);
if(rows == 2)
- pos_x -= sbwidth/weapon_cnt / 2;
+ pos_x -= weapon_width / 2;
pos_x -= sbwidth;
pos_y += height;
drawpic_tiled(pos, "gfx/scoreboard/scoreboard_bg", bg_size, tmp, rgb * autocvar_scoreboard_color_bg_team, scoreboard_alpha_bg, DRAWFLAG_NORMAL);
else
drawpic_tiled(pos, "gfx/scoreboard/scoreboard_bg", bg_size, tmp, rgb, scoreboard_alpha_bg, DRAWFLAG_NORMAL);
- drawborderlines(hud_border_thickness, pos, tmp, '0 0 0', scoreboard_alpha_bg * 0.75, DRAWFLAG_NORMAL);
+ drawborderlines(autocvar_scoreboard_border_thickness, pos, tmp, '0 0 0', scoreboard_alpha_bg * 0.75, DRAWFLAG_NORMAL);
// row highlighting
for(i = 0; i<RANKINGS_RECEIVED_CNT; ++i)
float hud_woulddrawscoreboard_change; // "time" at which HUD_WouldDrawScoreboard() changed
void HUD_DrawScoreboard()
{
- HUD_UpdatePlayerTeams();
-
float hud_woulddrawscoreboard;
- hud_woulddrawscoreboard = HUD_WouldDrawScoreboard();
+ hud_woulddrawscoreboard = scoreboard_active;
if(hud_woulddrawscoreboard != hud_woulddrawscoreboard_prev) {
hud_woulddrawscoreboard_change = time;
hud_woulddrawscoreboard_prev = hud_woulddrawscoreboard;
}
- float scoreboard_fadeinspeed = cvar_or("scoreboard_fadeinspeed", 10);
- float scoreboard_fadeoutspeed = cvar_or("scoreboard_fadeoutspeed", 5);
if(hud_woulddrawscoreboard) {
+ float scoreboard_fadeinspeed = cvar_or("scoreboard_fadeinspeed", 10);
if (scoreboard_fadeinspeed)
scoreboard_fade_alpha = bound (0, (time - hud_woulddrawscoreboard_change) * scoreboard_fadeinspeed, 1);
else
scoreboard_fade_alpha = 1;
}
- else
+ else {
+ float scoreboard_fadeoutspeed = cvar_or("scoreboard_fadeoutspeed", 5);
if (scoreboard_fadeoutspeed)
scoreboard_fade_alpha = bound (0, (1/scoreboard_fadeoutspeed - (time - hud_woulddrawscoreboard_change)) * scoreboard_fadeoutspeed, 1);
else
scoreboard_fade_alpha = 0;
+ }
if not(scoreboard_fade_alpha)
return;
+ HUD_UpdatePlayerTeams();
+
scoreboard_alpha_bg = cvar("scoreboard_alpha_bg") * scoreboard_fade_alpha * (1 - cvar("_menu_alpha"));
scoreboard_alpha_fg = cvar_or("scoreboard_alpha_fg", 1.0) * scoreboard_fade_alpha * (1 - cvar("_menu_alpha"));
scoreboard_highlight = cvar("scoreboard_highlight");
xmin = cvar("scoreboard_offset_left") * vid_conwidth;
ymin = cvar("con_notify") * cvar("con_notifysize");
- sbwidth = xmax = vid_conwidth - xmin - cvar("scoreboard_offset_right") * vid_conwidth;
+ xmax = (1 - cvar("scoreboard_offset_right")) * vid_conwidth;
ymax = vid_conheight - ymin;
+ sbwidth = xmax - xmin;
+
// Initializes position
pos_x = xmin;
pos_y = ymin;
drawfont = hud_font;
// Draw the scoreboard
- vector bg_size;
- bg_size = drawgetimagesize("gfx/hud/scoreboard_scoreboard_bg");
+ vector bg_size = drawgetimagesize("gfx/scoreboard/scoreboard_bg") * cvar("scoreboard_bg_scale");
if(teamplay)
{
}
pos = HUD_DrawScoreboardRankings(pos, pl, rgb, bg_size);
}
- else if(cvar("scoreboard_accuracy") && spectatee_status != -1) {
+ else if(cvar("scoreboard_accuracy") && spectatee_status != -1 && !warmup_stage) {
if(teamplay)
pos = HUD_DrawScoreboardAccuracyStats(pos, GetTeamRGB(myteam), bg_size);
else
// background
drawpic(pos, "gfx/scoreboard/accuracy_bg", fill_size , fill_colour, scoreboard_alpha_bg, DRAWFLAG_NORMAL);
- drawborderlines(hud_border_thickness, pos, fill_size, border_colour, scoreboard_alpha_bg, DRAWFLAG_NORMAL);
+ drawborderlines(autocvar_scoreboard_border_thickness, pos, fill_size, border_colour, scoreboard_alpha_bg, DRAWFLAG_NORMAL);
// the weapon
drawpic(pos, strcat("gfx/weapons/weapon", self.netname), '1 0.5 0' * fill_size_x , '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
// background
drawpic(pos, "gfx/scoreboard/accuracy_bg", fill_size , fill_colour, scoreboard_alpha_bg, DRAWFLAG_NORMAL);
- drawborderlines(hud_border_thickness, pos, fill_size, border_colour, scoreboard_alpha_bg, DRAWFLAG_NORMAL);
+ drawborderlines(autocvar_scoreboard_border_thickness, pos, fill_size, border_colour, scoreboard_alpha_bg, DRAWFLAG_NORMAL);
// the weapon
drawpic(pos, strcat("gfx/weapons/weapon", self.netname), '1 0.5 0' * fill_size_x , '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
float HUD_WouldDrawScoreboard(void);
+float scoreboard_active;
float scoreboard_fade_alpha;
}
}
music_trigger = world;
+
+ if(best)
+ bgmtime = getsoundtime(best, CHAN_VOICE);
+ else
+ bgmtime = gettime(GETTIME_CDTRACK);
}
void Net_TargetMusic()
float campaign_bots[CAMPAIGN_MAX_ENTRIES];
float campaign_botskill[CAMPAIGN_MAX_ENTRIES];
float campaign_fraglimit[CAMPAIGN_MAX_ENTRIES];
+float campaign_timelimit[CAMPAIGN_MAX_ENTRIES];
string campaign_mutators[CAMPAIGN_MAX_ENTRIES];
string campaign_shortdesc[CAMPAIGN_MAX_ENTRIES];
string campaign_longdesc[CAMPAIGN_MAX_ENTRIES];
CAMPAIGN_GETARG; campaign_bots[campaign_entries] = stof(a);
CAMPAIGN_GETARG; campaign_botskill[campaign_entries] = stof(a);
CAMPAIGN_GETARG; campaign_fraglimit[campaign_entries] = stof(a);
+ CAMPAIGN_GETARG; campaign_timelimit[campaign_entries] = stof(a);
CAMPAIGN_GETARG; campaign_mutators[campaign_entries] = strzone(a);
CAMPAIGN_GETARG; campaign_shortdesc[campaign_entries] = strzone(a);
CAMPAIGN_GETARG; campaign_longdesc[campaign_entries] = strzone(strreplace("\\n", "\n", a));
campaign_entries = campaign_entries + 1;
- if(campaign_entries >= n)
+ if(campaign_entries >= n)
break;
}
lineno = lineno + 1;
const float STAT_LEADLIMIT = 47;
const float STAT_BULLETS_LOADED = 48;
const float STAT_NEX_CHARGE = 49;
-
-const float STAT_DOM_TOTAL_PPS = 70;
-const float STAT_DOM_PPS_RED = 71;
-const float STAT_DOM_PPS_BLUE = 72;
-const float STAT_DOM_PPS_PINK = 73;
-const float STAT_DOM_PPS_YELLOW = 74;
+const float STAT_HUD = 50;
// see DP source, quakedef.h
const float STAT_MOVEVARS_AIRSPEEDLIMIT_NONQW = 222;
const float CTF_STATE_DEFEND = 2;
const float CTF_STATE_COMMANDER = 3;
-const float STAT_HUD = 50;
const float HUD_NORMAL = 0;
const float HUD_SPIDERBOT = 10;
const float HUD_WAKIZASHI = 11;
const float STAT_VEHICLESTAT_AMMO2 = 65;
const float STAT_VEHICLESTAT_RELOAD2 = 66;
+// mod stats (1xx)
+const float STAT_REDALIVE = 100;
+const float STAT_BLUEALIVE = 101;
+
+const float STAT_DOM_TOTAL_PPS = 100;
+const float STAT_DOM_PPS_RED = 101;
+const float STAT_DOM_PPS_BLUE = 102;
+const float STAT_DOM_PPS_PINK = 103;
+const float STAT_DOM_PPS_YELLOW = 104;
+
//const float STAT_SPIDERBOT_AIM 53 // compressShotOrigin
//const float STAT_SPIDERBOT_TARGET 54 // compressShotOrigin
MapInfo_Map_maxs = '0 0 0';
}
-string MapInfo_GetDefault(float t)
+string _MapInfo_GetDefault(float t)
{
switch(t)
{
return;
if(load_default)
- _MapInfo_Map_ApplyGametype(MapInfo_GetDefault(pThisType), pWantedType, pThisType, FALSE);
+ _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
{
}
}
+string _MapInfo_GetDefaultEx(float t)
+{
+ switch(t)
+ {
+ case MAPINFO_TYPE_DEATHMATCH: return "timelimit=20 pointlimit=30 leadlimit=0";
+ case MAPINFO_TYPE_TEAM_DEATHMATCH: return "timelimit=20 pointlimit=50 teams=2 leadlimit=0";
+ case MAPINFO_TYPE_DOMINATION: return "timelimit=20 pointlimit=200 teams=2 leadlimit=0";
+ case MAPINFO_TYPE_CTF: return "timelimit=20 pointlimit=300 caplimit=10 leadlimit=0";
+ case MAPINFO_TYPE_RUNEMATCH: return "timelimit=20 pointlimit=200 leadlimit=0";
+ case MAPINFO_TYPE_LMS: return "timelimit=20 lives=9 leadlimit=0";
+ case MAPINFO_TYPE_ARENA: return "timelimit=20 pointlimit=10 leadlimit=0";
+ case MAPINFO_TYPE_CA: return "timelimit=20 pointlimit=10 leadlimit=0";
+ case MAPINFO_TYPE_KEYHUNT: return "timelimit=20 pointlimit=1000 teams=3 leadlimit=0";
+ case MAPINFO_TYPE_ASSAULT: return "timelimit=20";
+ case MAPINFO_TYPE_RACE: return "timelimit=20 qualifying_timelimit=5 laplimit=7 teamlaplimit=15 leadlimit=0";
+ case MAPINFO_TYPE_ONSLAUGHT: return "timelimit=20";
+ case MAPINFO_TYPE_NEXBALL: return "timelimit=20 pointlimit=5 leadlimit=0";
+ case MAPINFO_TYPE_CTS: return "timelimit=20 skill=-1";
+ default: return "";
+ }
+}
+
+void _MapInfo_Map_ApplyGametypeEx(string s, float pWantedType, float pThisType)
+{
+ string sa, k, v;
+ float p;
+ string fraglimit_normal;
+ string fraglimit_caps;
+ string fraglimit_teams;
+
+ MapInfo_Map_supportedGametypes |= pThisType;
+ if(!(pThisType & pWantedType))
+ return;
+
+ // reset all the cvars to their defaults
+
+ cvar_set("timelimit", cvar_defstring("timelimit"));
+ cvar_set("leadlimit", cvar_defstring("leadlimit"));
+ cvar_set("fraglimit", cvar_defstring("fraglimit"));
+ cvar_set("g_tdm_teams", cvar_defstring("g_tdm_teams"));
+ cvar_set("g_keyhunt_teams", cvar_defstring("g_keyhunt_teams"));
+ cvar_set("g_domination_default_teams", cvar_defstring("g_domination_default_teams"));
+ cvar_set("g_race_qualifying_timelimit", cvar_defstring("g_race_qualifying_timelimit"));
+
+ fraglimit_normal = string_null;
+ fraglimit_caps = string_null;
+ fraglimit_teams = string_null;
+
+ s = strcat(_MapInfo_GetDefaultEx(pWantedType), " ", s);
+ while(s != "")
+ {
+ sa = car(s);
+ s = cdr(s);
+
+ if(sa == "")
+ continue;
+
+ p = strstrofs(sa, "=", 0);
+ if(p < 0)
+ {
+ k = "timelimit";
+ v = s;
+ }
+ else
+ {
+ k = substring(sa, 0, p);
+ v = substring(sa, p+1, -1);
+ }
+
+ if(k == "timelimit")
+ {
+ cvar_set("timelimit", v);
+ }
+ else if(k == "leadlimit")
+ {
+ cvar_set("leadlimit", v);
+ }
+ else if(k == "pointlimit" || k == "fraglimit" || k == "lives" || k == "laplimit")
+ {
+ fraglimit_normal = v;
+ }
+ else if(k == "caplimit")
+ {
+ fraglimit_caps = v;
+ }
+ else if(k == "teampointlimit" || k == "teamlaplimit")
+ {
+ fraglimit_teams = v;
+ }
+ else if(k == "teams")
+ {
+ cvar_set("g_tdm_teams", v);
+ cvar_set("g_keyhunt_teams", v);
+ cvar_set("g_domination_default_teams", v);
+ }
+ else if(k == "qualifying_timelimit")
+ {
+ cvar_set("g_race_qualifying_timelimit", v);
+ }
+ else if(k == "skill")
+ {
+ // ignore
+ }
+ else
+ {
+ print("Invalid gametype key in mapinfo: ", k, "\n");
+ }
+ }
+
+ if(pWantedType == MAPINFO_TYPE_CTF && cvar("g_ctf_win_mode") < 2)
+ {
+ if(fraglimit_caps)
+ cvar_set("fraglimit", fraglimit_caps);
+ }
+ else if(pWantedType == MAPINFO_TYPE_RACE && cvar("g_race_teams") >= 2)
+ {
+ if(fraglimit_teams)
+ cvar_set("fraglimit", fraglimit_teams);
+ }
+ else
+ {
+ if(fraglimit_normal)
+ cvar_set("fraglimit", fraglimit_normal);
+ }
+}
+
float MapInfo_Type_FromString(string t)
{
if (t == "dm") return MAPINFO_TYPE_DEATHMATCH;
string fn;
string s, t;
float fh, fh2;
- float r, f, n, i;
+ float r, f, n, i, p;
string acl;
acl = MAPINFO_SETTEMP_ACL_USER;
for(i = 1; i <= MapInfo_Map_supportedGametypes; i *= 2)
if(MapInfo_Map_supportedGametypes & i)
- fputs(fh, sprintf("type %s %s\n", MapInfo_Type_ToString(i), MapInfo_GetDefault(i)));
+ fputs(fh, sprintf("gametype %s // defaults: %s\n", MapInfo_Type_ToString(i), _MapInfo_GetDefaultEx(i)));
fh2 = fopen(strcat("scripts/", pFilename, ".arena"), FILE_READ);
if(fh2 >= 0)
if(substring(s, 0, 1) == "_") // q3map style
continue;
+ p = strstrofs(s, "//", 0);
+ if(p >= 0)
+ s = substring(s, 0, p);
+
t = car(s); s = cdr(s);
if(t == "title")
MapInfo_Map_title = s;
else
dprint("Map ", pFilename, " supports unknown game type ", t, ", ignored\n");
}
+ else if(t == "gametype")
+ {
+ t = car(s); s = cdr(s);
+ f = MapInfo_Type_FromString(t);
+ if(f)
+ _MapInfo_Map_ApplyGametypeEx (s, pGametypeToSet, f);
+ else
+ dprint("Map ", pFilename, " supports unknown game type ", t, ", ignored\n");
+ }
else if(t == "size")
{
float a, b, c, d, e;
if(!(MapInfo_Map_supportedGametypes & pGametypeToSet))
{
print("Can't select the requested game type. Trying anyway with stupid settings.\n");
- _MapInfo_Map_ApplyGametype(MapInfo_GetDefault(MAPINFO_TYPE_DEATHMATCH), pGametypeToSet, MAPINFO_TYPE_DEATHMATCH, FALSE);
+ _MapInfo_Map_ApplyGametypeEx("", pGametypeToSet, MAPINFO_TYPE_DEATHMATCH);
}
}
s = strcat(s, ", MinstaGib");
if(cvar("g_nix"))
s = strcat(s, ", NIX");
+ if(cvar("g_rocket_flying"))
+ s = strcat(s, ", Rocket Flying");
if(cvar_string("g_weaponarena") != "0")
s = strcat(s, ", ", WeaponArenaString());
if(cvar("g_start_weapon_laser") == 0)
s = strcat(s, ", Low gravity");
if(cvar("g_cloaked"))
s = strcat(s, ", Cloaked");
- if(cvar("g_footsteps"))
- s = strcat(s, ", Steps");
if(cvar("g_grappling_hook"))
s = strcat(s, ", Hook");
if(cvar("g_laserguided_missile"))
me.TR(me);
me.TDempty(me, 0.2);
me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "g_cloaked", "Cloaked"));
- me.TR(me);
- me.TDempty(me, 0.2);
- me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "g_footsteps", "Footsteps"));
me.TR(me);
me.TDempty(me, 0.2);
me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "g_midair", "Midair"));
me.TR(me);
me.TDempty(me, 0.2);
me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "g_laserguided_missile", "Laser guided missiles"));
+ me.TR(me);
+ me.TDempty(me, 0.2);
+ me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "g_rocket_flying", "Rocket Flying"));
me.TR(me);
me.TDempty(me, 0.2);
me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "g_pinata", "Pinata"));
entity spawnqueue_first;
entity spawnqueue_last;
entity champion;
+string champion_name;
float warmup;
-float allowed_to_spawn;
float ca_players;
float required_ca_players;
.float caplayer;
if(g_keyhunt)
kh_Controller_SetThink(cvar("g_balance_keyhunt_delay_round")+(game_starttime - time), "", kh_StartRound);
- if(g_arena || g_ca)
+ if(g_arena)
if(champion && champion.classname == "player" && player_count > 1)
UpdateFrags(champion, +1);
if((!g_arena && !g_ca) || (g_arena && !arena_roundbased) || (time < game_starttime))
return;
- f = floor(warmup - time + 1);
+ f = ceil(warmup - time);
+ if(f > 0)
+ champion = world; // this is done because a if(champion) will not execute if champion = world
allowed_to_spawn = 0;
- if(g_ca && (ca_players < required_ca_players || inWarmupStage))
+ if(inWarmupStage)
+ allowed_to_spawn = 1;
+ if(ca_players < required_ca_players)
allowed_to_spawn = 1;
msg = NEWLINES;
if (g_ca)
allowed_to_spawn = 1;
if(champion && g_arena)
- msg = strcat("The Champion is ", champion.netname, "^7\n");
+ msg = strcat("The Champion is ", champion_name, "^7\n");
//centerprint(self, strcat(msg, "The Champion is ", champion.netname, "^7\n"));
if(f != roundStartTime_prev) {
}
float next_round;
+float stopalivecheck;
+float redalive, bluealive;
+.float redalive_stat, bluealive_stat;
/**
* This function finds out whether an arena round is over 1 player is left.
* It determines the last player who's still alive and saves it's entity reference
*/
void Spawnqueue_Check()
{
+ if(g_ca) // we want to perform this before the return block below...
+ {
+ // this is STUPID to perform again, but has to be done so that we can give instant feedback when a round ends
+ // and so the code won't start searching for a champion using find() before all players are actually REMOVED
+ redalive = 0; bluealive = 0;
+ FOR_EACH_PLAYER(self) {
+ if (self.team == COLOR_TEAM1 && self.health >= 1) redalive += 1;
+ else if (self.team == COLOR_TEAM2 && self.health >= 1) bluealive += 1;
+ }
+ // as if the above stuff wasn't stupid enough, let's run it a third time! :D
+ // (so that we can send redalive/bluealive as a stat)
+ FOR_EACH_PLAYER(self) {
+ self.redalive_stat = redalive;
+ self.bluealive_stat = bluealive;
+ }
+ }
if(time < warmup + 1 || inWarmupStage)
return;
else if(ca_players < required_ca_players) {
FOR_EACH_PLAYER(self)
centerprint(self, strcat("^1Need at least 1 player in each team to play CA", "^7\n"));
-
- allowed_to_spawn = 1;
return;
}
else if(!next_round) {
if((redspawned && !bluespawned) || (bluespawned && !redspawned)) {
next_round = time + 5;
-
champion = find(world, classname, "player");
- string champion_team;
- if(champion.team == COLOR_TEAM1) {
- champion_team = "^1Red team";
- play2all("ctf/red_capture.wav");
- }
- else if(champion.team == COLOR_TEAM2) {
- champion_team = "^4Blue team";
- play2all("ctf/blue_capture.wav");
- }
- FOR_EACH_CLIENT(self) centerprint(self, strcat(champion_team, "^7 wins the round.", "^7\n"));
+ if(champion_name)
+ strunzone(champion_name);
+ champion_name = strzone(champion.netname);
}
- else if(!redspawned && !bluespawned) {
+ else if((!redspawned && !bluespawned) || time - warmup > cvar("g_ca_round_timelimit")) {
FOR_EACH_CLIENT(self) centerprint(self, strcat("^7Round tied.", "^7\n"));
next_round = time + 5;
}
+
+ }
+ if(!stopalivecheck)
+ {
+ if(redalive && !bluealive)
+ {
+ play2all("ctf/red_capture.wav");
+ FOR_EACH_CLIENT(self) centerprint(self, "^1 RED ^7team wins the round.\n");
+ TeamScore_AddToTeam(COLOR_TEAM1, ST_SCORE, +1);
+ stopalivecheck = TRUE;
+ }
+ else if(bluealive && !redalive)
+ {
+ play2all("ctf/blue_capture.wav");
+ FOR_EACH_CLIENT(self) centerprint(self, "^4 BLUE ^7team wins the round.\n");
+ TeamScore_AddToTeam(COLOR_TEAM2, ST_SCORE, +1);
+ stopalivecheck = TRUE;
+ }
}
if((next_round && next_round < time))
{
+ stopalivecheck = FALSE;
next_round = 0;
reset_map(TRUE);
}
if(Campaign_Invalid())
return;
cvar_set("fraglimit", ftos(campaign_fraglimit[0]));
- cvar_set("timelimit", "0");
+ cvar_set("timelimit", ftos(campaign_timelimit[0]));
cvar_set_normal("fraglimit", ftos(campaign_fraglimit[0]));
- cvar_set_normal("timelimit", "0");
+ cvar_set_normal("timelimit", ftos(campaign_timelimit[0]));
}
void CampaignSaveCvar(string cvarname, float value)
if(won == 1 && lost == 0 && checkrules_equality == 0 && cheatcount_total == 0)
{
+ if(cvar("timelimit") != 0 && time > cvar("timelimit") * 60) // checks if the timelimit has expired.
+ {
+ campaign_won = 0;
+ bprint("Time's up! The current level has been LOST.\n");
+ // sound!
+ }
+ else
+ {
campaign_won = 1;
bprint("The current level has been WON.\n");
+ // sound!
+ }
+ }
+ else if(cvar("timelimit") != 0 && time > cvar("timelimit") * 60)
+ {
+ campaign_won = 0;
+ bprint("Time's up! The current level has been LOST.\n");
// sound!
}
else
error("Sorry, cheater. You are NOT WELCOME.");
CampaignFile_Unload();
}
+
void ClientKill (void)
{
- ClientKill_TeamChange(0);
+ if((g_arena || g_ca) && ((champion && champion.classname == "player" && player_count > 1) || player_count == 1)) // don't allow a kill in this case either
+ {
+ // do nothing
+ }
+ else
+ ClientKill_TeamChange(0);
}
void DoTeamChange(float destteam)
string ColoredTeamName(float t);
void DecodeLevelParms (void);
//void dom_player_join_team(entity pl);
-void set_dom_state(entity e, float connecting);
+void set_dom_state(void);
void ClientConnect (void)
{
float t;
send_CSQC_teamnagger();
if (g_domination)
- set_dom_state(self, TRUE);
+ set_dom_state();
send_CSQC_cr_maxbullets(self);
CheatInitClient();
{
// add a maximum of charge_velocity_rate when going fast (f = 1), gradually increasing from minspeed (f = 0) to maxspeed
xyspeed = min(xyspeed, cvar("g_balance_nex_charge_maxspeed"));
- float f;
f = (xyspeed - cvar("g_balance_nex_charge_minspeed")) / (cvar("g_balance_nex_charge_maxspeed") - cvar("g_balance_nex_charge_minspeed"));
// add the extra charge
- self.nex_charge += cvar("g_balance_nex_charge_velocity_rate") * f * frametime;
+ self.nex_charge = min(1, self.nex_charge + cvar("g_balance_nex_charge_velocity_rate") * f * frametime);
}
:end
if(self.flags & FL_ONGROUND)
// this function calculates w_shotorg and w_shotdir based on the weapon model
// offset, trueaim and antilag, and won't put w_shotorg inside a wall.
// make sure you call makevectors first (FIXME?)
+.float prevstrengthsound;
+.float prevstrengthsoundattempt;
void W_SetupShot_Dir_ProjectileSize_Range(entity ent, vector s_forward, vector mi, vector ma, float antilag, float recoil, string snd, float maxdamage, float range)
{
float nudge = 1; // added to traceline target and subtracted from result
sound (ent, CHAN_WEAPON, snd, VOL_BASE, ATTN_NORM);
}
- if (ent.items & IT_STRENGTH)
- if (!g_minstagib)
- sound (ent, CHAN_AUTO, "weapons/strength_fire.wav", VOL_BASE, ATTN_NORM);
+ if(ent.items & IT_STRENGTH)
+ if(!g_minstagib)
+ if(
+ (time > ent.prevstrengthsound + cvar("sv_strengthsound_antispam_time"))
+ ||
+ (time > ent.prevstrengthsoundattempt + cvar("sv_strengthsound_antispam_refire_threshold"))
+ ) // prevent insane sound spam
+ {
+ sound(ent, CHAN_AUTO, "weapons/strength_fire.wav", VOL_BASE, ATTN_NORM);
+ ent.prevstrengthsound = time;
+ }
+ ent.prevstrengthsoundattempt = time;
// nudge w_shotend so a trace to w_shotend hits
w_shotend = w_shotend + normalize(w_shotend - w_shotorg) * nudge;
for(mine = world; (mine = find(mine, classname, "mine")); ) if(mine.owner == self)
return FALSE;
+ if(self.weapon == self.switchweapon) // only play once BEFORE starting to switch weapons
+ sound (self, CHAN_AUTO, "weapons/dryfire.wav", VOL_BASE, ATTN_NORM);
+
W_SwitchToOtherWeapon(self);
return FALSE;
}
readyrestart_happened = 1;
game_starttime = time;
- if(!g_ca)
+ if(!g_ca && !g_arena)
game_starttime += RESTART_COUNTDOWN;
restart_mapalreadyrestarted = 0; //reset this var, needed when cvar sv_ready_restart_repeatable is in use
}
//initiate the restart-countdown-announcer entity
- if(cvar("sv_ready_restart_after_countdown"))
+ if(cvar("sv_ready_restart_after_countdown") && !g_ca && !g_arena)
{
restartTimer = spawn();
restartTimer.think = restartTimer_Think;
// TODO implemented fall and falling
#define ALLPLAYERSOUNDS \
_VOICEMSG(death) \
+ _VOICEMSG(fall) \
_VOICEMSG(drown) \
_VOICEMSG(gasp) \
_VOICEMSG(jump) \
.entity realowner;
.float nex_charge;
+
+float allowed_to_spawn; // boolean variable used by the clan arena code to determine if a player can spawn (after the round has ended)
float pps_blue;
float pps_yellow;
float pps_pink;
-void set_dom_state(entity e, float connecting)
+void set_dom_state(void)
{
- if(connecting) e.dom_total_pps = total_pps;
- e.dom_pps_red = pps_red;
- e.dom_pps_blue = pps_blue;
- if(c3 >= 0) e.dom_pps_yellow = pps_yellow;
- if(c4 >= 0) e.dom_pps_pink = pps_pink;
+ // BIG ugly hack to make stat sending work
+ self.dom_total_pps = total_pps;
+ self.dom_pps_red = pps_red;
+ self.dom_pps_blue = pps_blue;
+ if(c3 >= 0)
+ {
+ self.dom_pps_yellow = pps_yellow;
+ }
+ if(c4 >= 0)
+ {
+ self.dom_pps_pink = pps_pink;
+ }
}
void() dom_controlpoint_setup;
WaypointSprite_UpdateSprites(self.sprite, "dom-pink", "", "");
}
- FOR_EACH_CLIENT(head)
- set_dom_state(head, FALSE);
+ FOR_EACH_PLAYER(self)
+ set_dom_state();
WaypointSprite_UpdateTeamRadar(self.sprite, RADARICON_DOMPOINT, colormapPaletteColor(self.goalentity.team - 1, 0));
WaypointSprite_Ping(self.sprite);
float points, waittime;
if (g_domination_point_rate)
- points += g_domination_point_rate;
+ points = g_domination_point_rate;
else
- points += self.frags;
+ points = self.frags;
+ if(points == 0) // default
+ points = 1;
+
if (g_domination_point_amt)
- waittime += g_domination_point_amt;
+ waittime = g_domination_point_amt;
else
- waittime += self.wait;
+ waittime = self.wait;
+ if(waittime == 0) // default
+ waittime = 5;
total_pps += points/waittime;
};
- //DarkPlaces supported extension list, draft version 1.04
-
- //things that don't have extensions yet:
- .float disableclientprediction;
-
- //definitions that id Software left out:
- //these are passed as the 'nomonsters' parameter to traceline/tracebox (yes really this was supported in all quake engines, nomonsters is misnamed)
- float MOVE_NORMAL = 0; // same as FALSE
- float MOVE_NOMONSTERS = 1; // same as TRUE
- float MOVE_MISSILE = 2; // save as movement with .movetype == MOVETYPE_FLYMISSILE
-
- //checkextension function
- //idea: expected by almost everyone
- //darkplaces implementation: LordHavoc
- float(string s) checkextension = #99;
- //description:
- //check if (cvar("pr_checkextension")) before calling this, this is the only
- //guaranteed extension to be present in the extension system, it allows you
- //to check if an extension is available, by name, to check for an extension
- //use code like this:
- //// (it is recommended this code be placed in worldspawn or a worldspawn called function somewhere)
- //if (cvar("pr_checkextension"))
- //if (checkextension("DP_SV_SETCOLOR"))
- // ext_setcolor = TRUE;
- //from then on you can check ext_setcolor to know if that extension is available
-
- //BX_WAL_SUPPORT
- //idea: id Software
- //darkplaces implementation: LordHavoc
- //description:
- //indicates the engine supports .wal textures for filenames in the textures/ directory
- //(note: DarkPlaces has supported this since 2001 or 2002, but did not advertise it as an extension, then I noticed Betwix was advertising it and added the extension accordingly)
-
- //DP_BUTTONCHAT
- //idea: Vermeulen
- //darkplaces implementation: LordHavoc
- //field definitions:
- .float buttonchat;
- //description:
- //true if the player is currently chatting (in messagemode, menus or console)
-
- //DP_BUTTONUSE
- //idea: id Software
- //darkplaces implementation: LordHavoc
- //field definitions:
- .float buttonuse;
- //client console commands:
- //+use
- //-use
- //description:
- //made +use and -use commands work, they now control the .buttonuse field (.button1 was used by many mods for other purposes).
-
- //DP_CL_LOADSKY
- //idea: Nehahra, LordHavoc
- //darkplaces implementation: LordHavoc
- //client console commands:
+//DarkPlaces supported extension list, draft version 1.04
+
+//things that don't have extensions yet:
+.float disableclientprediction;
+
+//definitions that id Software left out:
+//these are passed as the 'nomonsters' parameter to traceline/tracebox (yes really this was supported in all quake engines, nomonsters is misnamed)
+float MOVE_NORMAL = 0; // same as FALSE
+float MOVE_NOMONSTERS = 1; // same as TRUE
+float MOVE_MISSILE = 2; // save as movement with .movetype == MOVETYPE_FLYMISSILE
+
+//checkextension function
+//idea: expected by almost everyone
+//darkplaces implementation: LordHavoc
+float(string s) checkextension = #99;
+//description:
+//check if (cvar("pr_checkextension")) before calling this, this is the only
+//guaranteed extension to be present in the extension system, it allows you
+//to check if an extension is available, by name, to check for an extension
+//use code like this:
+//// (it is recommended this code be placed in worldspawn or a worldspawn called function somewhere)
+//if (cvar("pr_checkextension"))
+//if (checkextension("DP_SV_SETCOLOR"))
+// ext_setcolor = TRUE;
+//from then on you can check ext_setcolor to know if that extension is available
+
+//BX_WAL_SUPPORT
+//idea: id Software
+//darkplaces implementation: LordHavoc
+//description:
+//indicates the engine supports .wal textures for filenames in the textures/ directory
+//(note: DarkPlaces has supported this since 2001 or 2002, but did not advertise it as an extension, then I noticed Betwix was advertising it and added the extension accordingly)
+
+//DP_BUTTONCHAT
+//idea: Vermeulen
+//darkplaces implementation: LordHavoc
+//field definitions:
+.float buttonchat;
+//description:
+//true if the player is currently chatting (in messagemode, menus or console)
+
+//DP_BUTTONUSE
+//idea: id Software
+//darkplaces implementation: LordHavoc
+//field definitions:
+.float buttonuse;
+//client console commands:
+//+use
+//-use
+//description:
+//made +use and -use commands work, they now control the .buttonuse field (.button1 was used by many mods for other purposes).
+
+//DP_CL_LOADSKY
+//idea: Nehahra, LordHavoc
+//darkplaces implementation: LordHavoc
+//client console commands:
//"loadsky" (parameters: "basename", example: "mtnsun_" would load "mtnsun_up.tga" and "mtnsun_rt.tga" and similar names, use "" to revert to quake sky, note: this is the same as Quake2 skybox naming)
//description:
//sets global skybox for the map for this client (can be stuffed to a client by QC), does not hurt much to repeatedly execute this command, please don't use this in mods if it can be avoided (only if changing skybox is REALLY needed, otherwise please use DP_GFX_SKYBOX).
if(deathtype & HITTYPE_HEADSHOT)
headshot = 1;
}
+ if(g_ca)
+ PlayerScore_Add(attacker, SP_SCORE, damage * cvar("g_ca_damage2score_multiplier"));
}
}
else
if not(Fire_IsBurning(e))
return;
- o = e.owner;
- while(o.owner)
- o = o.owner;
+ for(t = 0, o = e.owner; o.owner && t < 16; o = o.owner, ++t);
if(clienttype(o) == CLIENTTYPE_NOTACLIENT)
o = e.fire_owner;
if (self.active != ACTIVE_ACTIVE)
return;
+ if(self.team)
+ if((self.spawnflags & 4 == 0) == (self.team != other.team))
+ return;
+
// only do the EXACTTRIGGER_TOUCH checks when really needed (saves some cpu)
if (other.iscreature)
{
{
vector o;
entity oldself;
+ entity hitent;
+ vector hitloc;
self.nextthink = time;
o = self.origin + v_forward * 32768;
}
- if(self.dmg)
+ if(self.dmg || self.enemy.target != "")
{
- if(self.dmg < 0)
- FireRailgunBullet(self.origin, o, 100000, 0, 0, 0, 0, 0, DEATH_HURTTRIGGER);
- else
- FireRailgunBullet(self.origin, o, self.dmg * frametime, 0, 0, 0, 0, 0, DEATH_HURTTRIGGER);
+ traceline(self.origin, o, MOVE_NORMAL, self);
}
+ hitent = trace_ent;
+ hitloc = trace_endpos;
if(self.enemy.target != "") // DETECTOR laser
{
- traceline(self.origin, o, MOVE_NORMAL, self);
if(trace_ent.iscreature)
{
- self.pusher = trace_ent;
+ self.pusher = hitent;
if(!self.count)
{
self.count = 1;
}
}
}
+
+ if(self.dmg)
+ {
+ if(self.team)
+ if((self.spawnflags & 8 == 0) == (self.team != hitent.team))
+ return;
+ if(hitent.takedamage)
+ Damage(hitent, self, self, ((self.dmg < 0) ? 100000 : (self.dmg * frametime)), DEATH_HURTTRIGGER, hitloc, '0 0 0');
+ }
}
float laser_SendEntity(entity to, float fl)
self.scale = 1;
if(!self.modelscale)
self.modelscale = 1;
+ else if(self.modelscale < 0)
+ self.modelscale = 0;
self.think = misc_laser_think;
self.nextthink = time;
InitializeEntity(self, misc_laser_init, INITPRIO_FINDTARGET);
BADCVAR("g_configversion");
BADCVAR("g_maplist_index");
BADCVAR("halflifebsp");
+ BADPREFIX("sv_world");
// client
BADPREFIX("cl_");
BADCVAR("sys_colortranslation");
BADCVAR("sys_specialcharactertranslation");
BADCVAR("timestamps");
+ BADCVAR("net_address");
+ BADCVAR("net_address_ipv6");
// mapinfo
BADCVAR("timelimit");
compressShortVector_init();
+ allowed_to_spawn = TRUE;
+
local entity head;
head = nextent(world);
maxclients = 0;
addstat(STAT_NEX_CHARGE, AS_FLOAT, nex_charge);
+ if(g_ca)
+ {
+ addstat(STAT_REDALIVE, AS_INT, redalive_stat);
+ addstat(STAT_BLUEALIVE, AS_INT, bluealive_stat);
+ }
// g_movementspeed hack
addstat(STAT_MOVEVARS_AIRSPEEDLIMIT_NONQW, AS_FLOAT, stat_sv_airspeedlimit_nonqw);
addstat(STAT_MOVEVARS_AIRACCEL_QW, AS_FLOAT, stat_sv_airaccel_qw);
float GetWinningCode(float fraglimitreached, float equality)
{
- if(equality)
- if(fraglimitreached)
- return WINNING_STARTSUDDENDEATHOVERTIME;
- else
- return WINNING_NEVER;
- else
+ if(cvar("g_campaign") == 1)
if(fraglimitreached)
return WINNING_YES;
else
return WINNING_NO;
+
+ else
+ if(equality)
+ if(fraglimitreached)
+ return WINNING_STARTSUDDENDEATHOVERTIME;
+ else
+ return WINNING_NEVER;
+ else
+ if(fraglimitreached)
+ return WINNING_YES;
+ else
+ return WINNING_NO;
}
// set the .winning flag for exactly those players with a given field value
TeamScore_AddToTeam(assault_attacker_team, ST_ASSAULT_OBJECTIVES, 666 - TeamScore_AddToTeam(assault_attacker_team, ST_ASSAULT_OBJECTIVES, 0));
- if(ent.cnt == 1) // this was the second round
+ if(ent.cnt == 1 || cvar("g_campaign")) // this was the second round
{
status = WINNING_YES;
}
// first load all the mutators
if(cvar("g_nix"))
MUTATOR_ADD(mutator_nix);
+ if(cvar("g_dodging"))
+ MUTATOR_ADD(mutator_dodging);
+ if(cvar("g_rocket_flying") || (cvar("g_balance_rocketlauncher_detonatedelay") == 0 && stof(cvar_defstring("g_balance_rocketlauncher_detonatedelay")) != 0))
+ MUTATOR_ADD(mutator_rocketflying);
g_bugrigs = cvar("g_bugrigs");
g_bugrigs_planar_movement = cvar("g_bugrigs_planar_movement");
precache_sound ("weapons/weapon_switch.wav");
precache_sound ("weapons/weaponpickup.wav");
precache_sound ("weapons/unavailable.wav");
+ precache_sound ("weapons/dryfire.wav");
if (g_grappling_hook)
{
precache_sound ("weapons/hook_fire.wav"); // hook
// INPUT:
float get_cvars_f;
string get_cvars_s;
+
+MUTATOR_HOOKABLE(EditProjectile);
+ // can edit any "just fired" projectile
+ // INPUT:
+ entity self;
+ entity other;
return 0;
}
-MUTATOR_DEFINITION(dodging)
+MUTATOR_DEFINITION(mutator_dodging)
{
// we need to be called before GetPressedKey does its thing so we can
// detect state changes and therefore dodging actions..
--- /dev/null
+MUTATOR_HOOKFUNCTION(rocketflying_EditProjectile)
+{
+ if(other.classname == "rocket")
+ {
+ // kill detonate delay of rockets
+ other.spawnshieldtime = time;
+ }
+ return 0;
+}
+
+MUTATOR_HOOKFUNCTION(rocketflying_BuildMutatorsString)
+{
+ ret_string = strcat(ret_string, ":RocketFlying");
+ return 0;
+}
+
+MUTATOR_HOOKFUNCTION(rocketflying_BuildMutatorsPrettyString)
+{
+ ret_string = strcat(ret_string, ", Rocket Flying");
+ return 0;
+}
+
+MUTATOR_DEFINITION(mutator_rocketflying)
+{
+ entity e;
+
+ MUTATOR_HOOK(EditProjectile, rocketflying_EditProjectile, CBC_ORDER_ANY);
+ MUTATOR_HOOK(BuildMutatorsString, rocketflying_BuildMutatorsString, CBC_ORDER_ANY);
+ MUTATOR_HOOK(BuildMutatorsPrettyString, rocketflying_BuildMutatorsPrettyString, CBC_ORDER_ANY);
+
+ return 0;
+}
MUTATOR_DECLARATION(gamemode_keyhunt);
MUTATOR_DECLARATION(mutator_nix);
-
-MUTATOR_DECLARATION(dodging);
+MUTATOR_DECLARATION(mutator_dodging);
+MUTATOR_DECLARATION(mutator_rocketflying);
mutators/gamemode_keyhunt.qc
mutators/mutator_nix.qc
mutators/mutator_dodging.qc
+mutators/mutator_rocketflying.qc
../warpzonelib/anglestransform.qc
../warpzonelib/mathlib.qc
if (dm > 0)
{
Damage (self, world, world, dm, DEATH_FALL, self.origin, '0 0 0');
+ // this must be allowed to cut the normal pain sounds (played after them and on the same channel)
+ // there's no way to detect falling damage and prevent the pain sounds for this to be played instead
+ if(self.health > 0)
+ PlayerSound(playersound_fall, CHAN_PAIN, VOICETYPE_PLAYERSOUND);
}
}
fraglimit_override = cvar("fraglimit_override");
leadlimit_override = cvar("leadlimit_override");
- if(cvar("g_dodging"))
- MUTATOR_ADD(dodging);
-
if(g_dm)
{
game = GAME_DEATHMATCH;
// Special case: volly fire turret that has to fire a full volly if a shot was fired.
if (self.shoot_flags & TFL_SHOOT_VOLLYALWAYS)
- if not (self.volly_counter == self.shot_volly)
- return 1;
+ if (self.volly_counter != self.shot_volly)
+ if(self.ammo >= self.shot_dmg)
+ return 1;
// Lack of zombies makes shooting dead things unnecessary :P
if (self.firecheck_flags & TFL_FIRECHECK_DEAD)
self.use();
}
+ turret_stdproc_respawn();
return 1;
}
}
if (self.tur_head.frame != 0)
- self.tur_head.frame = self.tur_head.frame + 1;
+ self.tur_head.frame += 1;
- if (self.tur_head.frame > 7)
+ if (self.tur_head.frame >= 7)
self.tur_head.frame = 0;
}
void turret_hellion_attack()
{
- local entity missile;
-
+ 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"));
+
sound (self, CHAN_WEAPON, "weapons/hagar_fire.wav", VOL_BASE, ATTN_NORM);
- // switch tubes
- //self.tur_shotorg_y = self.tur_shotorg_y * -1;
-
missile = spawn ();
setorigin(missile, self.tur_shotorg);
setsize (missile, '-3 -3 -3', '3 3 3'); // give it some size so it can be shot
missile.tur_health = time + 9;
missile.tur_aimpos = randomvec() * 128;
te_explosion (missile.origin);
-
CSQCProjectile(missile, FALSE, PROJECTILE_ROCKET, FALSE); // no culling, has fly sound
- if (self.tur_head.frame == 0)
- self.tur_head.frame = self.tur_head.frame + 1;
-
+ self.tur_head.frame += 1;
}
void turret_hellion_missile_damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector vforce)
//.float bulletcounter;
void turret_machinegun_attack()
{
-
- entity flash;
-
sound (self, CHAN_WEAPON, "weapons/uzi_fire.wav", VOL_BASE, ATTN_NORM);
fireBallisticBullet (self.tur_shotorg, self.tur_shotdir_updated,self.shot_spread, self.shot_speed, 5, self.shot_dmg, 0, self.shot_force, DEATH_TURRET, 0, 1, cvar("g_balance_uzi_bulletconstant"));
endFireBallisticBullet();
//w_deathtypestring = "had an alergic reaction due to 10 kilos of led";
te_smallflash(self.tur_shotorg);
- // muzzle flash for 3rd person view
- flash = spawn();
- setmodel(flash, "models/uziflash.md3"); // precision set below
- setattachment(flash, self.tur_head, "tag_fire");
- flash.think = W_Uzi_Flash_Go;
- flash.nextthink = time + 0.02;
- flash.frame = 2;
- flash.angles_z = flash.v_angle_z + random() * 180;
- flash.alpha = 1;
- flash.effects = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
+ UziFlash();
+ setattachment(self.muzzle_flash, self.tur_head, "tag_fire");
}
void turret_mlrs_postthink()
{
-
// 0 = full, 6 = empty
- self.tur_head.frame = rint(6 - (self.ammo / self.shot_dmg));
+ self.tur_head.frame = bound(0, 6 - floor(0.1 + self.ammo / self.shot_dmg), 6);
+ if(self.tur_head.frame < 0)
+ {
+ dprint("ammo:",ftos(self.ammo),"\n");
+ dprint("shot_dmg:",ftos(self.shot_dmg),"\n");
+ }
+
}
void turret_mlrs_attack()
void walker_attack()
{
- entity flash;
-
sound (self, CHAN_WEAPON, "weapons/uzi_fire.wav", VOL_BASE, ATTN_NORM);
fireBallisticBullet (self.tur_shotorg, self.tur_shotdir_updated,self.shot_spread, self.shot_speed, 5, self.shot_dmg, 0, self.shot_force, DEATH_TURRET, 0, 1, cvar("g_balance_uzi_bulletconstant"));
endFireBallisticBullet();
if (self.uzi_bulletcounter == 2)
{
- flash = spawn();
-
- setmodel(flash, "models/uziflash.md3");
- setattachment(flash, self.tur_head, "tag_fire");
-
- flash.scale = 3;
- flash.think = W_Uzi_Flash_Go;
- flash.nextthink = time + 0.02;
- flash.frame = 2;
- flash.angles_z = flash.v_angle_z + random() * 180;
- flash.alpha = 1;
- flash.effects = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
+ UziFlash();
+ setattachment(self.muzzle_flash, self.tur_head, "tag_fire");
self.uzi_bulletcounter = 0;
}
self.gun2.cnt = time + self.attack_finished_single;
}
+/*
void spiderbot_minigun_fire_Flash_Go() {
if (self.frame > 10)
{
self.scale -= 0.01;
self.nextthink = time + 0.02;
}
+*/
-void spiderbot_minigun_fire(entity gun,float trail)
+void spiderbot_minigun_fire(entity gun, float trail)
{
-
- entity flash;
vector v;
+
v = gettaginfo(gun,gettagindex(gun,"barrels"));
v_forward = normalize(v_forward);
fireBullet (v, v_forward, cvar("g_vehicle_spiderbot_minigun_spread"), cvar("g_vehicle_spiderbot_minigun_damage"),
cvar("g_vehicle_spiderbot_minigun_spread"), DEATH_SBMINIGUN, 0);
- if not (gun.enemy)
- {
- gun.enemy = spawn();
- setattachment(gun.enemy , gun, "barrels");
- setorigin(gun.enemy ,gun.enemy.origin + '52 0 0');
- }
- flash = gun.enemy;
- setmodel(flash, "models/uziflash.md3");
- flash.think = spiderbot_minigun_fire_Flash_Go;
- flash.nextthink = time + 0.02;
- flash.frame = 2;
- flash.angles_z = flash.v_angle_z + random() * 180;
- flash.alpha = 1;
- flash.effects = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
- flash.scale = 1;
+ UziFlash();
+ setattachment(self.muzzle_flash, self.tur_head, "tag_fire");
if(trail)
trailparticles(self, particleeffectnum("EF_MGTURRETTRAIL"), v, trace_endpos);
proj.oldvelocity = proj.velocity;
+ other = proj; MUTATOR_CALLHOOK(EditProjectile);
+
if(cvar("g_antilag_bullets"))
if(pSpeed >= cvar("g_antilag_bullets"))
{
CSQCProjectile(proj, TRUE, (proj.cnt ? PROJECTILE_CRYLINK_BOUNCING : PROJECTILE_CRYLINK), TRUE);
+ other = proj; MUTATOR_CALLHOOK(EditProjectile);
+
counter = counter + 1;
}
}
CSQCProjectile(proj, TRUE, (proj.cnt ? PROJECTILE_CRYLINK_BOUNCING : PROJECTILE_CRYLINK), TRUE);
+ other = proj; MUTATOR_CALLHOOK(EditProjectile);
+
counter = counter + 1;
}
}
//sounds bad
CSQCProjectile(proj, TRUE, PROJECTILE_ELECTRO_BEAM, TRUE);
+
+ other = proj; MUTATOR_CALLHOOK(EditProjectile);
}
void W_Electro_Attack2()
#endif
CSQCProjectile(proj, TRUE, PROJECTILE_ELECTRO, FALSE); // no culling, it has sound
+
+ other = proj; MUTATOR_CALLHOOK(EditProjectile);
}
.vector hook_start, hook_end;
if not(self.owner.items & IT_UNLIMITED_WEAPON_AMMO)
{
if(cvar("g_balance_electro_primary_ammo"))
- dt = min(frametime, self.owner.ammo_cells / cvar("g_balance_electro_primary_ammo"));
- self.owner.ammo_cells = max(0, self.owner.ammo_cells - cvar("g_balance_electro_primary_ammo") * frametime);
+ {
+ dt = min(dt, self.owner.ammo_cells / cvar("g_balance_electro_primary_ammo"));
+ self.owner.ammo_cells = max(0, self.owner.ammo_cells - cvar("g_balance_electro_primary_ammo") * frametime);
+ }
}
W_SetupShot_Range(self.owner, TRUE, 0, "", cvar("g_balance_electro_primary_damage") * dt, cvar("g_balance_electro_primary_range"));
proj.flags = FL_PROJECTILE;
CSQCProjectile(proj, TRUE, PROJECTILE_FIREBALL, TRUE);
+
+ other = proj; MUTATOR_CALLHOOK(EditProjectile);
}
void W_Fireball_AttackEffect(float i, vector f_diff)
proj.flags = FL_PROJECTILE;
CSQCProjectile(proj, TRUE, PROJECTILE_FIREMINE, TRUE);
+
+ other = proj; MUTATOR_CALLHOOK(EditProjectile);
}
void spawnfunc_weapon_fireball (void)
CSQCProjectile(gren, TRUE, PROJECTILE_GRENADE, TRUE);
else
CSQCProjectile(gren, TRUE, PROJECTILE_GRENADE_BOUNCING, TRUE);
+
+ other = gren; MUTATOR_CALLHOOK(EditProjectile);
}
void W_Grenade_Attack2 (void)
CSQCProjectile(gren, TRUE, PROJECTILE_GRENADE, TRUE);
else
CSQCProjectile(gren, TRUE, PROJECTILE_GRENADE_BOUNCING, TRUE);
+
+ other = gren; MUTATOR_CALLHOOK(EditProjectile);
}
void spawnfunc_weapon_grenadelauncher (void)
missile.flags = FL_PROJECTILE;
CSQCProjectile(missile, TRUE, PROJECTILE_HAGAR, TRUE);
+
+ other = missile; MUTATOR_CALLHOOK(EditProjectile);
}
void W_Hagar_Attack2 (void)
missile.flags = FL_PROJECTILE;
CSQCProjectile(missile, TRUE, PROJECTILE_HAGAR_BOUNCING, TRUE);
+
+ other = missile; MUTATOR_CALLHOOK(EditProjectile);
}
void spawnfunc_weapon_hagar (void)
missile.projectiledeathtype = WEP_HLAC;
CSQCProjectile(missile, TRUE, PROJECTILE_HLAC, TRUE);
+
+ other = missile; MUTATOR_CALLHOOK(EditProjectile);
}
void W_HLAC_Attack2f (void)
missile.projectiledeathtype = WEP_HLAC | HITTYPE_SECONDARY;
CSQCProjectile(missile, TRUE, PROJECTILE_HLAC, TRUE);
+
+ other = missile; MUTATOR_CALLHOOK(EditProjectile);
}
void W_HLAC_Attack2 (void)
gren.flags = FL_PROJECTILE;
CSQCProjectile(gren, TRUE, PROJECTILE_HOOKBOMB, TRUE);
+
+ other = gren; MUTATOR_CALLHOOK(EditProjectile);
}
void spawnfunc_weapon_hook (void)
missile.think = W_Laser_Think;
missile.nextthink = time + cvar("g_balance_laser_primary_delay");
+
+ other = missile; MUTATOR_CALLHOOK(EditProjectile);
+
if(time >= missile.nextthink)
{
entity oldself;
// in order for mines to face properly when sticking to the ground, they must be a server side entity rather than a csqc projectile
- local entity newmine;
+ entity newmine;
newmine = spawn();
newmine.classname = self.classname;
void W_Mine_Attack (void)
{
- local entity mine;
- local entity flash;
+ entity mine;
+ entity flash;
// scan how many mines we placed, and return if we reached our limit
if(cvar("g_balance_minelayer_limit"))
W_AttachToShotorg(flash, '5 0 0');
// common properties
+
+ other = mine; MUTATOR_CALLHOOK(EditProjectile);
}
void spawnfunc_weapon_minelayer (void); // defined in t_items.qc
if(skill >= 2) // skill 0 and 1 bots won't detonate mines!
{
// decide whether to detonate mines
- local entity mine, targetlist, targ;
- local float edgedamage, coredamage, edgeradius, recipricoledgeradius, d;
- local float selfdamage, teamdamage, enemydamage;
+ entity targetlist, targ;
+ float edgedamage, coredamage, edgeradius, recipricoledgeradius, d;
+ float selfdamage, teamdamage, enemydamage;
edgedamage = cvar("g_balance_minelayer_edgedamage");
coredamage = cvar("g_balance_minelayer_damage");
edgeradius = cvar("g_balance_minelayer_radius");
}
mine = find(mine, classname, "mine");
}
- local float desirabledamage;
+ float desirabledamage;
desirabledamage = enemydamage;
if (teamplay != 1 && time > self.invincible_finished && time > self.spawnshieldtime)
desirabledamage = desirabledamage - selfdamage * cvar("g_balance_selfdamagepercent");
targ = targ.chain;
}
}else{
- local float distance; distance= bound(300,vlen(self.origin-self.enemy.origin),30000);
+ float distance; distance= bound(300,vlen(self.origin-self.enemy.origin),30000);
//As the distance gets larger, a correct detonation gets near imposible
//Bots are assumed to use the mine spawnfunc_light to see if the mine gets near a player
if(v_forward * normalize(mine.origin - self.enemy.origin)< 0.1)
REGISTER_WEAPON(NEX, w_nex, IT_CELLS, 7, WEP_FLAG_NORMAL | WEP_TYPE_HITSCAN, BOT_PICKUP_RATING_HIGH, "nex", "nex", "Nex");
#else
#ifdef SVQC
-void SendCSQCNexBeamParticle() {
+void SendCSQCNexBeamParticle(float charge) {
vector v;
v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos);
WriteByte(MSG_BROADCAST, SVC_TEMPENTITY);
WriteByte(MSG_BROADCAST, TE_CSQC_NEXGUNBEAMPARTICLE);
-
WriteCoord(MSG_BROADCAST, w_shotorg_x);
WriteCoord(MSG_BROADCAST, w_shotorg_y);
WriteCoord(MSG_BROADCAST, w_shotorg_z);
WriteCoord(MSG_BROADCAST, v_x);
WriteCoord(MSG_BROADCAST, v_y);
WriteCoord(MSG_BROADCAST, v_z);
+ WriteByte(MSG_BROADCAST, bound(0, 255 * charge, 255));
}
void W_Nex_Attack (float issecondary)
{
- float mydmg, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, myammo;
+ float mydmg, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, myammo, charge;
if(issecondary)
{
mydmg = cvar("g_balance_nex_secondary_damage");
if(cvar("g_balance_nex_charge"))
{
- mydmg *= self.nex_charge;
- myforce *= self.nex_charge;
- //print("^1Damage: ^7", ftos(mydmg), "\n");
+ charge = cvar("g_balance_nex_charge_mindmg") / mydmg + (1 - cvar("g_balance_nex_charge_mindmg") / mydmg) * self.nex_charge;
self.nex_charge *= cvar("g_balance_nex_charge_shot_multiplier"); // do this AFTER setting mydmg/myforce
}
+ else
+ charge = 1;
+ mydmg *= charge;
+ myforce *= charge;
W_SetupShot (self, TRUE, 5, "weapons/nexfire.wav", mydmg);
AnnounceTo(self, "yoda");
//beam and muzzle flash done on client
- SendCSQCNexBeamParticle();
+ SendCSQCNexBeamParticle(charge);
// flash and burn the wall
if (trace_ent.solid == SOLID_BSP && !(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT))
float w_nex(float req)
{
+ float dt;
if (req == WR_AIM)
{
self.BUTTON_ATCK = bot_aim(1000000, 0, 1, FALSE);
}
else if (req == WR_THINK)
{
- if(cvar("g_balance_nex_charge"))
+ if(cvar("g_balance_nex_charge") && self.nex_charge < cvar("g_balance_nex_charge_limit"))
self.nex_charge = min(1, self.nex_charge + cvar("g_balance_nex_charge_rate") * frametime / W_TICSPERFRAME);
if (self.BUTTON_ATCK)
{
{
if(cvar("g_balance_nex_secondary_charge"))
{
- if(self.ammo_cells)
+ dt = frametime / W_TICSPERFRAME;
+ if(self.nex_charge < 1)
{
- self.nex_charge = min(1, self.nex_charge + cvar("g_balance_nex_secondary_charge_rate") * frametime / W_TICSPERFRAME);
- self.ammo_cells = max(0, self.ammo_cells - cvar("g_balance_nex_secondary_ammo") * frametime / W_TICSPERFRAME);
+ dt = min(dt, (1 - self.nex_charge) / cvar("g_balance_nex_secondary_charge_rate"));
+ if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
+ {
+ if(cvar("g_balance_nex_secondary_ammo"))
+ {
+ dt = min(dt, (self.ammo_cells - cvar("g_balance_nex_primary_ammo")) / cvar("g_balance_nex_secondary_ammo"));
+ dt = max(0, dt);
+ if(dt > 0)
+ {
+ self.ammo_cells = max(cvar("g_balance_nex_secondary_ammo"), self.ammo_cells - cvar("g_balance_nex_secondary_ammo") * dt);
+ }
+ }
+ }
+ self.nex_charge += dt * cvar("g_balance_nex_secondary_charge_rate");
}
}
else if(cvar("g_balance_nex_secondary"))
else if (req == WR_CHECKAMMO1)
return self.ammo_cells >= cvar("g_balance_nex_primary_ammo");
else if (req == WR_CHECKAMMO2)
+ {
+ if(cvar("g_balance_nex_secondary_charge"))
+ return self.ammo_cells >= cvar("g_balance_nex_primary_ammo");
return self.ammo_cells >= cvar("g_balance_nex_secondary_ammo");
+ }
return TRUE;
};
#endif
gren.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_PLAYERCLIP;
CSQCProjectile(gren, TRUE, PROJECTILE_PORTO_RED, TRUE);
+
+ other = gren; MUTATOR_CALLHOOK(EditProjectile);
}
void spawnfunc_weapon_porto (void)
void W_Rocket_Touch (void)
{
+ if(WarpZone_Projectile_Touch())
+ {
+ if(wasfreed(self))
+ W_Rocket_Unregister();
+ return;
+ }
W_Rocket_Unregister();
-
- PROJECTILE_TOUCH;
W_Rocket_Explode ();
}
W_AttachToShotorg(flash, '5 0 0');
// common properties
+ other = missile; MUTATOR_CALLHOOK(EditProjectile);
}
void spawnfunc_weapon_rocketlauncher (void); // defined in t_items.qc
missile.angles = vectoangles (missile.velocity);
CSQCProjectile(missile, FALSE, PROJECTILE_SEEKER, TRUE);
+
+ other = missile; MUTATOR_CALLHOOK(EditProjectile);
}
void Seeker_Vollycontroler_Think()
missile.angles = vectoangles (missile.velocity);
CSQCProjectile(missile, TRUE, PROJECTILE_TAG, FALSE); // has sound
+
+ other = missile; MUTATOR_CALLHOOK(EditProjectile);
}
missile.flags = FL_PROJECTILE;
CSQCProjectile(missile, TRUE, PROJECTILE_FLAC, TRUE);
+
+ other = missile; MUTATOR_CALLHOOK(EditProjectile);
}
void spawnfunc_weapon_seeker (void)
REGISTER_WEAPON(UZI, w_uzi, IT_NAILS, 3, WEP_FLAG_NORMAL | WEP_TYPE_HITSCAN, BOT_PICKUP_RATING_MID, "uzi", "uzi", "Machine Gun");
#else
#ifdef SVQC
+.entity muzzle_flash;
+
// leilei's fancy muzzleflash stuff
-void W_Uzi_Flash_Go() {
- if (self.alpha >= 0)
- {
- setmodel(self, "");
- return;
- }
+void Uzi_Flash_Go()
+{
self.frame = self.frame + 2;
self.scale = self.scale * 0.5;
self.alpha = self.alpha - 0.25;
- self.think = W_Uzi_Flash_Go;
self.nextthink = time + 0.05;
-};
+
+ if (self.alpha <= 0)
+ {
+ self.think = SUB_Remove;
+ self.nextthink = time;
+ self.owner.muzzle_flash = world;
+ return;
+ }
+
+}
+
+void UziFlash()
+{
+ if (self.muzzle_flash == world)
+ self.muzzle_flash = spawn();
+
+ // muzzle flash for 1st person view
+ setmodel(self.muzzle_flash, "models/uziflash.md3"); // precision set below
+
+ self.muzzle_flash.scale = 0.75;
+ self.muzzle_flash.think = Uzi_Flash_Go;
+ self.muzzle_flash.nextthink = time + 0.02;
+ self.muzzle_flash.frame = 2;
+ self.muzzle_flash.alpha = 0.75;
+ self.muzzle_flash.angles_z = random() * 180;
+ self.muzzle_flash.effects = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
+ self.muzzle_flash.owner = self;
+
+
+}
.float uzi_bulletcounter;
-.entity muzzleflash;
void W_Uzi_Attack (float deathtype)
{
- local entity flash;
-
if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
{
if (self.uzi_bulletcounter == 1)
pointparticles(particleeffectnum("uzi_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
- if ((self.muzzleflash == world) || wasfreed(self.muzzleflash))
- self.muzzleflash = spawn();
-
- // muzzle flash for 1st person view
- setmodel(self.muzzleflash, "models/uziflash.md3"); // precision set below
- //SUB_SetFade(flash, time + 0.06, 0);
- self.muzzleflash.scale = 0.75;
- self.muzzleflash.think = W_Uzi_Flash_Go;
- self.muzzleflash.nextthink = time + 0.02;
- self.muzzleflash.frame = 2;
- self.muzzleflash.alpha = 0.75;
- self.muzzleflash.angles_z = random() * 180;
- self.muzzleflash.effects = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
- W_AttachToShotorg(self.muzzleflash, '5 0 0');
+ UziFlash();
+ W_AttachToShotorg(self.muzzle_flash, '5 0 0');
// casing code
if (cvar("g_casings") >= 2)
entity WarpZone_TrailParticles_trace_callback_own;
float WarpZone_TrailParticles_trace_callback_eff;
+float WarpZone_TrailParticles_trace_callback_f;
+float WarpZone_TrailParticles_trace_callback_flags;
void WarpZone_TrailParticles_trace_callback(vector from, vector endpos, vector to)
{
trailparticles(WarpZone_TrailParticles_trace_callback_own, WarpZone_TrailParticles_trace_callback_eff, from, endpos);
WarpZone_TraceBox_ThroughZone(org, '0 0 0', '0 0 0', end, MOVE_NOMONSTERS, world, world, WarpZone_TrailParticles_trace_callback);
}
+#ifdef CSQC
+void WarpZone_TrailParticles_WithMultiplier_trace_callback(vector from, vector endpos, vector to)
+{
+ boxparticles(WarpZone_TrailParticles_trace_callback_eff, WarpZone_TrailParticles_trace_callback_own, from, endpos, WarpZone_TrailParticles_trace_callback_own.velocity, WarpZone_TrailParticles_trace_callback_own.velocity, WarpZone_TrailParticles_trace_callback_f, WarpZone_TrailParticles_trace_callback_flags);
+}
+
+void WarpZone_TrailParticles_WithMultiplier(entity own, float eff, vector org, vector end, float f, float boxflags)
+{
+ WarpZone_TrailParticles_trace_callback_own = own;
+ WarpZone_TrailParticles_trace_callback_eff = eff;
+ WarpZone_TrailParticles_trace_callback_f = f;
+ WarpZone_TrailParticles_trace_callback_flags = boxflags;
+ WarpZone_TraceBox_ThroughZone(org, '0 0 0', '0 0 0', end, MOVE_NOMONSTERS, world, world, WarpZone_TrailParticles_WithMultiplier_trace_callback);
+}
+#endif
+
float WarpZone_PlaneDist(entity wz, vector v)
{
return (v - wz.warpzone_origin) * wz.warpzone_forward;
void WarpZone_TraceToss(entity e, entity forent);
void WarpZone_TraceToss_ThroughZone(entity e, entity forent, entity zone, WarpZone_trace_callback_t cb);
void WarpZone_TrailParticles(entity own, float eff, vector org, vector end);
+#ifdef CSQC
+void WarpZone_TrailParticles_WithMultiplier(entity own, float eff, vector org, vector end, float f, float boxflags);
+#endif
.vector WarpZone_findradius_dist;
.vector WarpZone_findradius_nearest;
entity wz;
wz = WarpZone_Find(self.origin + self.mins, self.origin + self.maxs);
if(!wz)
- return FALSE;
+ return 0;
+ if(self.warpzone_teleport_time == time)
+ {
+ // just ignore if we got teleported this frame already and now hit a wall and are in a warpzone again (this will cause a detonation)
+ // print("2 warps 1 frame\n");
+ return -1;
+ }
o0 = self.origin;
v0 = self.velocity;
a0 = self.angles;
pd = WarpZone_TargetPlaneDist(wz, self.origin);
if(pd < mpd)
{
- dpd = normalize(self.velocity) * self.warpzone_targetforward;
+ dpd = normalize(self.velocity) * wz.warpzone_targetforward;
setorigin(self, self.origin + normalize(self.velocity) * ((mpd - pd) / dpd));
if(!WarpZoneLib_MoveOutOfSolid(self))
{
setorigin(self, o0);
self.angles = a0;
self.velocity = v0;
- return FALSE;
+ return 0;
}
}
WarpZone_RefSys_Add(self, wz);
WarpZone_StoreProjectileData(self);
self.warpzone_teleport_time = time;
- return TRUE;
+ return +1;
}
float WarpZone_Projectile_Touch()
{
+ float f;
if(other.classname == "trigger_warpzone")
return TRUE;
if(WarpZone_Projectile_Touch_ImpactFilter_Callback())
return TRUE;
- if(WarpZone_CheckProjectileImpact())
- return TRUE;
- if(self.warpzone_teleport_time == time) // already got teleported this frame? no collision then please
+ if((f = WarpZone_CheckProjectileImpact()) != 0)
+ return (f > 0);
+ if(self.warpzone_teleport_time == time)
{
+ // sequence: hit warpzone, get teleported, hit wall
+ // print("2 hits 1 frame\n");
setorigin(self, self.warpzone_oldorigin);
self.velocity = self.warpzone_oldvelocity;
self.angles = self.warpzone_oldangles;
return TRUE;
}
-
return FALSE;
}
+domination
electro
fireball
flags
set g_turrets_unit_hellion_std_respawntime 90
set g_turrets_unit_hellion_std_shot_dmg 50
-set g_turrets_unit_hellion_std_shot_refire 0.25
+set g_turrets_unit_hellion_std_shot_refire 0.2
set g_turrets_unit_hellion_std_shot_radius 80
set g_turrets_unit_hellion_std_shot_speed 650
set g_turrets_unit_mlrs_std_shot_force 25
set g_turrets_unit_mlrs_std_shot_volly 6
-set g_turrets_unit_mlrs_std_shot_volly_refire 1
+
+// !must be correctly matched with ammo_recharge as this unit use
+// volly_always. (means ammo_recharge * ammo_max must be eaqual to volly_refire)
+set g_turrets_unit_mlrs_std_shot_volly_refire 4
set g_turrets_unit_mlrs_std_target_range 3000
set g_turrets_unit_mlrs_std_target_range_min 500
set g_turrets_unit_mlrs_std_target_select_playerbias 1
set g_turrets_unit_mlrs_std_target_select_missilebias 0
-set g_turrets_unit_mlrs_std_ammo_max 420
-set g_turrets_unit_mlrs_std_ammo 420
-set g_turrets_unit_mlrs_std_ammo_recharge 70
+// !must be shot_dmg * 6 as this unit uses ammo to control the animation
+set g_turrets_unit_mlrs_std_ammo_max 300
+set g_turrets_unit_mlrs_std_ammo 300
+set g_turrets_unit_mlrs_std_ammo_recharge 75
set g_turrets_unit_mlrs_std_aim_firetolerance_dist 120
set g_turrets_unit_mlrs_std_aim_speed 100
*Music / Sound FX
mand1nga
Merlijn Hofstra
+remaxim
*Engine Code Additions & QA
Rudolf "divVerent" Polzer