ZIPEXCLUDE ?= -x\!*.pk3 -xr\!\.svn -x\!qcsrc
DIFF ?= diff
-FTEQCCFLAGS ?= -Werror -Wall -Wno-mundane -O3 -Ono-c -Ono-cs -flo
+FTEQCCFLAGS_WATERMARK ?= -DWATERMARK='"^1$(shell git describe) TEST BUILD"'
+FTEQCCFLAGS ?= -Werror -Wall -Wno-mundane -O3 -Ono-c -Ono-cs -flo $(FTEQCCFLAGS_EXTRA) $(FTEQCCFLAGS_WATERMARK)
FTEQCCFLAGS_PROGS ?=
FTEQCCFLAGS_MENU ?=
rm -f progs.dat menu.dat csprogs.dat
csprogs.dat: qcsrc/client/*.* qcsrc/common/*.* qcsrc/warpzonelib/*.*
+ @echo make[1]: Entering directory \`$(PWD)/qcsrc/client\'
cd qcsrc/client && $(FTEQCC) $(FTEQCCFLAGS) $(FTEQCCFLAGS_CSPROGS)
progs.dat: qcsrc/server/*.* qcsrc/common/*.* qcsrc/server/*/*.* qcsrc/server/*/*/*.* qcsrc/warpzonelib/*.*
+ @echo make[1]: Entering directory \`$(PWD)/qcsrc/server\'
cd qcsrc/server && $(FTEQCC) $(FTEQCCFLAGS) $(FTEQCCFLAGS_PROGS)
menu.dat: qcsrc/menu/*.* qcsrc/menu/*/*.* qcsrc/common/*.*
+ @echo make[1]: Entering directory \`$(PWD)/qcsrc/menu\'
cd qcsrc/menu && $(FTEQCC) $(FTEQCCFLAGS) $(FTEQCCFLAGS_MENU)
gfx/menu/default/skinvalues.txt: qcsrc/menu/skin-customizables.inc
-// {{{ weapon replacement
-// NOTE: this only replaces weapons on the map
-// use g_start_weapon_* to also replace the on-startup weapons!
-// example: g_weaponreplace_nex "nex minstanex", then Nexes become MinstaNexes 50% of the times
-// set the cvars to "0" to totally disable a weapon
-set sv_q3acompat_machineshotgunswap 0 "shorthand for swapping uzi and shotgun"
-set g_weaponreplace_laser ""
-set g_weaponreplace_shotgun ""
-set g_weaponreplace_uzi ""
-set g_weaponreplace_grenadelauncher ""
-set g_weaponreplace_electro ""
-set g_weaponreplace_crylink ""
-set g_weaponreplace_nex ""
-set g_weaponreplace_hagar ""
-set g_weaponreplace_rocketlauncher ""
-set g_weaponreplace_porto ""
-set g_weaponreplace_minstanex ""
-set g_weaponreplace_hook ""
-set g_weaponreplace_hlac ""
-set g_weaponreplace_campingrifle ""
-set g_weaponreplace_tuba ""
-set g_weaponreplace_fireball ""
-set g_weaponreplace_seeker ""
-set sv_q3acompat_machineshotgunswap 0 "shorthand for swapping uzi and shotgun (for Q3A map compatibility)"
-// }}}
-
// {{{ starting gear
set g_start_weapon_laser -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
set g_start_weapon_shotgun -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
set g_start_weapon_minstanex -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
set g_start_weapon_porto -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
set g_start_weapon_hook -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
-set g_start_weapon_hlac 0 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
+set g_start_weapon_hlac -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
set g_start_weapon_campingrifle -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
set g_start_weapon_tuba -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
-set g_start_weapon_fireball 0 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
-set g_start_weapon_seeker 0 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
+set g_start_weapon_fireball -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
+set g_start_weapon_seeker -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
set g_balance_health_start 100
set g_balance_armor_start 0
set g_start_ammo_shells 45
// }}}
// {{{ pickup items
+set g_pickup_ammo_anyway 0
+set g_pickup_weapons_anyway 0
set g_pickup_shells 30
set g_pickup_shells_max 120
set g_pickup_nails 80
set g_pickup_fuel_max 999
set g_pickup_armorsmall 10
set g_pickup_armorsmall_max 100
+set g_pickup_armorsmall_anyway 0
set g_pickup_armormedium 25
set g_pickup_armormedium_max 100
+set g_pickup_armormedium_anyway 0
set g_pickup_armorbig 50
set g_pickup_armorbig_max 100
+set g_pickup_armorbig_anyway 0
set g_pickup_armorlarge 100
set g_pickup_armorlarge_max 100
+set g_pickup_armorlarge_anyway 0
set g_pickup_healthsmall 10
set g_pickup_healthsmall_max 200
+set g_pickup_healthsmall_anyway 0
set g_pickup_healthmedium 25
set g_pickup_healthmedium_max 200
+set g_pickup_healthmedium_anyway 0
set g_pickup_healthlarge 50
set g_pickup_healthlarge_max 200
+set g_pickup_healthlarge_anyway 0
set g_pickup_healthmega 100
set g_pickup_healthmega_max 200
+set g_pickup_healthmega_anyway 0
set g_pickup_respawntime_short 15
set g_pickup_respawntime_medium 20
set g_pickup_respawntime_long 30
set g_balance_campingrifle_primary_ammo 10
set g_balance_campingrifle_primary_bulletconstant 130 // 56.3qu
set g_balance_campingrifle_primary_burstcost 0.35 // require same cooldown as secondary, note it's smaller than primary refire time
+set g_balance_campingrifle_primary_bullethail 0
set g_balance_campingrifle_secondary_damage 15
set g_balance_campingrifle_secondary_headshotaddeddamage 25
set g_balance_campingrifle_secondary_spread 0.02
set g_balance_campingrifle_secondary_ammo 4
set g_balance_campingrifle_secondary_bulletconstant 130 // 18.3qu
set g_balance_campingrifle_secondary_burstcost 0.35
+set g_balance_campingrifle_secondary_bullethail 0
// }}}
// {{{ tuba
set g_balance_tuba_refire 0.05
-// {{{ weapon replacement
-// NOTE: this only replaces weapons on the map
-// use g_start_weapon_* to also replace the on-startup weapons!
-// example: g_weaponreplace_nex "nex minstanex", then Nexes become MinstaNexes 50% of the times
-// set the cvars to "0" to totally disable a weapon
-set sv_q3acompat_machineshotgunswap 0 "shorthand for swapping uzi and shotgun"
-set g_weaponreplace_laser ""
-set g_weaponreplace_shotgun ""
-set g_weaponreplace_uzi ""
-set g_weaponreplace_grenadelauncher ""
-set g_weaponreplace_electro ""
-set g_weaponreplace_crylink ""
-set g_weaponreplace_nex ""
-set g_weaponreplace_hagar ""
-set g_weaponreplace_rocketlauncher ""
-set g_weaponreplace_porto ""
-set g_weaponreplace_minstanex ""
-set g_weaponreplace_hook ""
-set g_weaponreplace_hlac ""
-set g_weaponreplace_campingrifle ""
-set g_weaponreplace_tuba ""
-set g_weaponreplace_fireball ""
-set g_weaponreplace_seeker ""
-set sv_q3acompat_machineshotgunswap 0 "shorthand for swapping uzi and shotgun (for Q3A map compatibility)"
-// }}}
-
// {{{ starting gear
set g_start_weapon_laser -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
set g_start_weapon_shotgun -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
// }}}
// {{{ pickup items
+set g_pickup_ammo_anyway 0
+set g_pickup_weapons_anyway 0
set g_pickup_shells 15
set g_pickup_shells_max 999
set g_pickup_nails 80
set g_pickup_fuel_max 999
set g_pickup_armorsmall 5
set g_pickup_armorsmall_max 999
+set g_pickup_armorsmall_anyway 0
set g_pickup_armormedium 25
set g_pickup_armormedium_max 999
+set g_pickup_armormedium_anyway 0
set g_pickup_armorbig 50
set g_pickup_armorbig_max 999
+set g_pickup_armorbig_anyway 0
set g_pickup_armorlarge 100
set g_pickup_armorlarge_max 999
+set g_pickup_armorlarge_anyway 0
set g_pickup_healthsmall 5
set g_pickup_healthsmall_max 999
+set g_pickup_healthsmall_anyway 0
set g_pickup_healthmedium 25
set g_pickup_healthmedium_max 999
+set g_pickup_healthmedium_anyway 0
set g_pickup_healthlarge 50
set g_pickup_healthlarge_max 999
+set g_pickup_healthlarge_anyway 0
set g_pickup_healthmega 100
set g_pickup_healthmega_max 999
+set g_pickup_healthmega_anyway 0
set g_pickup_respawntime_short 15
set g_pickup_respawntime_medium 20
set g_pickup_respawntime_long 30
set g_balance_campingrifle_primary_ammo 10
set g_balance_campingrifle_primary_bulletconstant 130 // 56.3qu
set g_balance_campingrifle_primary_burstcost 0
+set g_balance_campingrifle_primary_bullethail 0 // empty magazine on shot
set g_balance_campingrifle_secondary_damage 35
set g_balance_campingrifle_secondary_headshotaddeddamage 15 // 50 damage only on head
set g_balance_campingrifle_secondary_spread 0.008
set g_balance_campingrifle_secondary_ammo 10
set g_balance_campingrifle_secondary_bulletconstant 130 // 18.3qu
set g_balance_campingrifle_secondary_burstcost 0
+set g_balance_campingrifle_secondary_bullethail 0 // empty magazine on shot
// }}}
// {{{ tuba
set g_balance_tuba_refire 0.05
--- /dev/null
+// {{{ starting gear
+set g_start_weapon_laser -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
+set g_start_weapon_shotgun -2 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
+set g_start_weapon_uzi 1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
+set g_start_weapon_grenadelauncher -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
+set g_start_weapon_electro -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
+set g_start_weapon_crylink -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
+set g_start_weapon_nex -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
+set g_start_weapon_hagar -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
+set g_start_weapon_rocketlauncher -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
+set g_start_weapon_minstanex 0 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
+set g_start_weapon_porto 0 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
+set g_start_weapon_hook 0 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
+set g_start_weapon_hlac 0 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
+set g_start_weapon_campingrifle 0 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
+set g_start_weapon_tuba 0 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
+set g_start_weapon_fireball 0 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
+set g_start_weapon_seeker 0 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
+set g_balance_health_start 125
+set g_balance_armor_start 0
+set g_start_ammo_shells 0
+set g_start_ammo_nails 90
+set g_start_ammo_rockets 0
+set g_start_ammo_cells 0
+set g_start_ammo_fuel 0
+set g_warmup_start_health 250 "starting values when being in warmup-stage"
+set g_warmup_start_armor 100 "starting values when being in warmup-stage"
+set g_warmup_start_ammo_shells 50 "starting values when being in warmup-stage"
+set g_warmup_start_ammo_nails 150 "starting values when being in warmup-stage"
+set g_warmup_start_ammo_rockets 50 "starting values when being in warmup-stage"
+set g_warmup_start_ammo_cells 50 "starting values when being in warmup-stage"
+set g_warmup_start_ammo_fuel 0 "starting values when being in warmup-stage"
+set g_lms_start_health 250
+set g_lms_start_armor 100
+set g_lms_start_ammo_shells 50
+set g_lms_start_ammo_nails 150
+set g_lms_start_ammo_rockets 50
+set g_lms_start_ammo_cells 50
+set g_lms_start_ammo_fuel 0
+set g_balance_nix_roundtime 25
+set g_balance_nix_incrtime 1.6
+set g_balance_nix_ammo_shells 15
+set g_balance_nix_ammo_nails 45
+set g_balance_nix_ammo_rockets 15
+set g_balance_nix_ammo_cells 15
+set g_balance_nix_ammo_fuel 0
+set g_balance_nix_ammoincr_shells 2
+set g_balance_nix_ammoincr_nails 6
+set g_balance_nix_ammoincr_rockets 2
+set g_balance_nix_ammoincr_cells 2
+set g_balance_nix_ammoincr_fuel 2
+// }}}
+
+// {{{ pickup items
+set g_pickup_ammo_anyway 1
+set g_pickup_weapons_anyway 1
+set g_pickup_shells 15
+set g_pickup_shells_max 100
+set g_pickup_nails 80
+set g_pickup_nails_max 400
+set g_pickup_rockets 15
+set g_pickup_rockets_max 200
+set g_pickup_cells 25
+set g_pickup_cells_max 200
+set g_pickup_fuel 25
+set g_pickup_fuel_jetpack 50
+set g_pickup_fuel_max 100
+set g_pickup_armorsmall 5
+set g_pickup_armorsmall_max 200
+set g_pickup_armorsmall_anyway 1
+set g_pickup_armormedium 25
+set g_pickup_armormedium_max 200
+set g_pickup_armormedium_anyway 1
+set g_pickup_armorbig 50
+set g_pickup_armorbig_max 200
+set g_pickup_armorbig_anyway 1
+set g_pickup_armorlarge 100
+set g_pickup_armorlarge_max 200
+set g_pickup_armorlarge_anyway 1
+set g_pickup_healthsmall 5
+set g_pickup_healthsmall_max 200
+set g_pickup_healthsmall_anyway 1
+set g_pickup_healthmedium 25
+set g_pickup_healthmedium_max 100
+set g_pickup_healthmedium_anyway 0
+set g_pickup_healthlarge 50
+set g_pickup_healthlarge_max 100
+set g_pickup_healthlarge_anyway 0
+set g_pickup_healthmega 100
+set g_pickup_healthmega_max 200
+set g_pickup_healthmega_anyway 1
+set g_pickup_respawntime_short 15
+set g_pickup_respawntime_medium 20
+set g_pickup_respawntime_long 30
+set g_pickup_respawntime_powerup 120
+set g_pickup_respawntime_weapon 5
+set g_pickup_respawntime_ammo 25
+set g_pickup_respawntimejitter_short 0
+set g_pickup_respawntimejitter_medium 0
+set g_pickup_respawntimejitter_long 0
+set g_pickup_respawntimejitter_powerup 10
+set g_pickup_respawntimejitter_weapon 0
+set g_pickup_respawntimejitter_ammo 0
+// }}}
+
+// {{{ regen/rot
+set g_balance_health_regen 0
+set g_balance_health_regenlinear 0
+set g_balance_pause_health_regen 0
+set g_balance_pause_health_regen_spawn 0
+set g_balance_health_rot 0
+set g_balance_health_rotlinear 1
+set g_balance_pause_health_rot 1
+set g_balance_pause_health_rot_spawn 0
+set g_balance_health_regenstable 100
+set g_balance_health_rotstable 100
+set g_balance_health_limit 200
+set g_balance_armor_regen 0
+set g_balance_armor_regenlinear 0
+set g_balance_armor_rot 0
+set g_balance_armor_rotlinear 1
+set g_balance_pause_armor_rot 1
+set g_balance_pause_armor_rot_spawn 0
+set g_balance_armor_regenstable 100
+set g_balance_armor_rotstable 100
+set g_balance_armor_limit 200
+set g_balance_armor_blockpercent 0.7
+set g_balance_fuel_regen 0.1 "fuel regeneration (only applies if the player owns IT_FUEL_REGEN)"
+set g_balance_fuel_regenlinear 0
+set g_balance_pause_fuel_regen 2 // other than this, fuel uses the health regen counter
+set g_balance_fuel_rot 0.05
+set g_balance_fuel_rotlinear 0
+set g_balance_pause_fuel_rot 5
+set g_balance_pause_fuel_rot_spawn 10
+set g_balance_fuel_regenstable 50
+set g_balance_fuel_rotstable 100
+set g_balance_fuel_limit 999
+// }}}
+
+// {{{ misc
+set g_balance_selfdamagepercent 0.65
+set g_balance_weaponswitchdelay 0.15
+set g_weaponspeedfactor 1 "weapon projectile speed multiplier"
+set g_weaponratefactor 1 "weapon fire rate multiplier"
+set g_weapondamagefactor 1 "weapon damage multiplier"
+set g_weaponforcefactor 1 "weapon force multiplier"
+set g_weaponspreadfactor 1 "weapon spread multiplier"
+set g_balance_firetransfer_time 0.9
+set g_balance_firetransfer_damage 0.8
+set g_throughfloor_damage 0.5
+set g_throughfloor_force 0.7
+set g_projectiles_newton_style 2
+// possible values:
+// 0: absolute velocity projectiles (like Quake)
+// 1: relative velocity projectiles, "Newtonian" (like Tribes 2)
+// 2: relative velocity projectiles, but aim is precorrected so projectiles hit the crosshair (note: strafe rockets then are SLOWER than ones shot while standing, happens in 1 too when aiming correctly which is hard)
+// 3: absolute velocity + player velocity component in shot direction (note: does NOT yield the right relative velocity, but may be good enough, but it is somewhat prone to sniper rockets)
+// 4: just add the player velocity length to the absolute velocity (tZork's sniper rockets)
+set g_projectiles_newton_style_2_minfactor 0.7
+set g_projectiles_newton_style_2_maxfactor 5
+set g_projectiles_spread_style 4
+// possible values:
+// 0: forward + solid sphere (like Quake) - varies velocity
+// 1: forward + flattened solid sphere
+// 2: forward + solid circle
+// 3: forward + normal distribution 3D - varies velocity
+// 4: forward + normal distribution on a plane
+// 5: forward + circle with 1-r falloff
+// 6: forward + circle with 1-r^2 falloff
+// 7: forward + circle with (1-r)(2-r) falloff
+set g_balance_falldamage_deadminspeed 150
+set g_balance_falldamage_minspeed 800
+set g_balance_falldamage_factor 0.20
+set g_balance_falldamage_maxdamage 15
+// }}}
+
+// {{{ powerups
+set g_balance_powerup_invincible_takedamage 0.3
+set g_balance_powerup_invincible_time 30
+set g_balance_powerup_strength_damage 3
+set g_balance_powerup_strength_force 4
+set g_balance_powerup_strength_time 30
+set g_balance_powerup_strength_selfdamage 1.5
+set g_balance_powerup_strength_selfforce 1.5
+// }}}
+
+// {{{ jetpack/hook
+set g_jetpack_antigravity 0.8 "factor of gravity compensation of the jetpack"
+set g_jetpack_acceleration_side 1200 "acceleration of the jetpack in xy direction"
+set g_jetpack_acceleration_up 600 "acceleration of the jetpack in z direction (note: you have to factor in gravity here, if antigravity is not 1)"
+set g_jetpack_maxspeed_side 1500 "max speed of the jetpack in xy direction"
+set g_jetpack_maxspeed_up 600 "max speed of the jetpack in z direction"
+set g_jetpack_fuel 8 "fuel per second for jetpack"
+set g_jetpack_attenuation 2 "jetpack sound attenuation"
+
+set g_grappling_hook_tarzan 2 // 2: can also pull players
+set g_balance_grapplehook_speed_fly 1800
+set g_balance_grapplehook_speed_pull 2000
+set g_balance_grapplehook_force_rubber 2000
+set g_balance_grapplehook_force_rubber_overstretch 1000
+set g_balance_grapplehook_length_min 50
+set g_balance_grapplehook_stretch 50
+set g_balance_grapplehook_airfriction 0.2
+set g_balance_grapplehook_health 130
+// }}}
+
+// {{{ weapon properties
+// {{{ laser
+set g_balance_laser_primary_damage 22
+set g_balance_laser_primary_edgedamage 0
+set g_balance_laser_primary_force 200
+set g_balance_laser_primary_radius 60
+set g_balance_laser_primary_speed 0
+set g_balance_laser_primary_spread 0
+set g_balance_laser_primary_refire 0.1
+set g_balance_laser_primary_animtime 0.1
+set g_balance_laser_primary_lifetime 0
+set g_balance_laser_primary_shotangle 0
+set g_balance_laser_primary_delay 0
+set g_balance_laser_gauntlet 1
+set g_balance_laser_secondary 0 // when 1, a secondary laser mode exists
+set g_balance_laser_secondary_damage 35
+set g_balance_laser_secondary_edgedamage 10
+set g_balance_laser_secondary_force 400
+set g_balance_laser_secondary_radius 70
+set g_balance_laser_secondary_speed 9000
+set g_balance_laser_secondary_spread 0
+set g_balance_laser_secondary_refire 0.7
+set g_balance_laser_secondary_animtime 0.3
+set g_balance_laser_secondary_lifetime 30
+set g_balance_laser_secondary_shotangle 0
+set g_balance_laser_secondary_delay 0
+// }}}
+// {{{ shotgun
+set g_balance_shotgun_primary_bullets 15
+set g_balance_shotgun_primary_damage 7
+set g_balance_shotgun_primary_force 20
+set g_balance_shotgun_primary_spread 0.16
+set g_balance_shotgun_primary_refire 1
+set g_balance_shotgun_primary_animtime 0.7
+set g_balance_shotgun_primary_ammo 1
+set g_balance_shotgun_primary_speed 12000
+set g_balance_shotgun_primary_bulletconstant 75 // 3.8qu
+set g_balance_shotgun_secondary 1
+set g_balance_shotgun_secondary_bullets 6 // one more per shot than 15/3 (primary bullets/amount of shots = 3)
+set g_balance_shotgun_secondary_damage 7
+set g_balance_shotgun_secondary_force 20
+set g_balance_shotgun_secondary_spread 0.20
+set g_balance_shotgun_secondary_refire 1.35
+set g_balance_shotgun_secondary_animtime 0.33
+set g_balance_shotgun_secondary_ammo 1
+set g_balance_shotgun_secondary_speed 12000
+set g_balance_shotgun_secondary_bulletconstant 75 // 3.8qu
+// }}}
+// {{{ uzi
+set g_balance_uzi_first 1
+set g_balance_uzi_first_damage 24
+set g_balance_uzi_first_force 30
+set g_balance_uzi_first_spread 0.0125
+set g_balance_uzi_first_refire 0.2
+set g_balance_uzi_first_ammo 1
+set g_balance_uzi_sustained_damage 12
+set g_balance_uzi_sustained_force 20
+set g_balance_uzi_sustained_spread 0.0125
+set g_balance_uzi_sustained_refire 0.1
+set g_balance_uzi_sustained_ammo 1
+set g_balance_uzi_speed 18000
+set g_balance_uzi_bulletconstant 115 // 13.1qu
+// }}}
+// {{{ mortar // TODO
+set g_balance_grenadelauncher_primary2secondary 0
+set g_balance_grenadelauncher_primary_damage 60
+set g_balance_grenadelauncher_primary_edgedamage 28
+set g_balance_grenadelauncher_primary_force 200
+set g_balance_grenadelauncher_primary_radius 140
+set g_balance_grenadelauncher_primary_speed 1200
+set g_balance_grenadelauncher_primary_speed_up 200
+set g_balance_grenadelauncher_primary_speed_z 0
+set g_balance_grenadelauncher_primary_spread 0
+set g_balance_grenadelauncher_primary_lifetime 10
+set g_balance_grenadelauncher_primary_refire 0.8
+set g_balance_grenadelauncher_primary_animtime 0.5
+set g_balance_grenadelauncher_primary_ammo 2
+set g_balance_grenadelauncher_secondary_damage 65
+set g_balance_grenadelauncher_secondary_edgedamage 30
+set g_balance_grenadelauncher_secondary_force 300
+set g_balance_grenadelauncher_secondary_radius 200
+set g_balance_grenadelauncher_secondary_speed 800
+set g_balance_grenadelauncher_secondary_speed_up 0
+set g_balance_grenadelauncher_secondary_speed_z 200
+set g_balance_grenadelauncher_secondary_spread 0
+set g_balance_grenadelauncher_secondary_lifetime 2
+set g_balance_grenadelauncher_secondary_refire 0.8
+set g_balance_grenadelauncher_secondary_animtime 0.5
+set g_balance_grenadelauncher_secondary_ammo 2
+set g_balance_grenadelauncher_secondary_health 0
+set g_balance_grenadelauncher_secondary_damageforcescale 0
+set g_balance_grenadelauncher_secondary_bouncefactor 0.5
+set g_balance_grenadelauncher_secondary_bouncestop 0.075
+// }}}
+// {{{ electro // TODO
+set g_balance_electro_lightning 0
+set g_balance_electro_primary_damage 65
+set g_balance_electro_primary_edgedamage 0
+set g_balance_electro_primary_force 200
+set g_balance_electro_primary_radius 150
+set g_balance_electro_primary_comboradius 0
+set g_balance_electro_primary_speed 2000
+set g_balance_electro_primary_spread 0
+set g_balance_electro_primary_lifetime 30
+set g_balance_electro_primary_refire 0.6
+set g_balance_electro_primary_animtime 0.3
+set g_balance_electro_primary_ammo 2
+set g_balance_electro_secondary_damage 50
+set g_balance_electro_secondary_spread 0.05
+set g_balance_electro_secondary_edgedamage 0
+set g_balance_electro_secondary_force 200
+set g_balance_electro_secondary_radius 150
+set g_balance_electro_secondary_speed 900
+set g_balance_electro_secondary_speed_up 200
+set g_balance_electro_secondary_speed_z 0
+set g_balance_electro_secondary_spread 0
+set g_balance_electro_secondary_lifetime 5
+set g_balance_electro_secondary_refire 0.3
+set g_balance_electro_secondary_refire2 0
+set g_balance_electro_secondary_animtime 0.3
+set g_balance_electro_secondary_ammo 2
+set g_balance_electro_secondary_health 5
+set g_balance_electro_secondary_damageforcescale 4
+set g_balance_electro_secondary_count 1
+set g_balance_electro_combo_damage 80
+set g_balance_electro_combo_edgedamage 0
+set g_balance_electro_combo_force 200
+set g_balance_electro_combo_radius 250
+set g_balance_electro_combo_comboradius 0
+set g_balance_electro_combo_speed 2000
+// }}}
+// {{{ crylink
+set g_balance_crylink_primary_damage 18
+set g_balance_crylink_primary_edgedamage 0
+set g_balance_crylink_primary_force -80
+set g_balance_crylink_primary_radius 100
+set g_balance_crylink_primary_speed 2000
+set g_balance_crylink_primary_spread 0.03
+set g_balance_crylink_primary_shots 4
+set g_balance_crylink_primary_bounces 1
+set g_balance_crylink_primary_refire 0.4
+set g_balance_crylink_primary_animtime 0.3
+set g_balance_crylink_primary_ammo 2
+set g_balance_crylink_primary_bouncedamagefactor 0.5
+
+set g_balance_crylink_primary_middle_lifetime 5 // range: 10000 full, fades to 20000
+set g_balance_crylink_primary_middle_fadetime 5
+set g_balance_crylink_primary_star_lifetime 0.4 // range: 800 full, fades to 1300
+set g_balance_crylink_primary_star_fadetime 0.25
+set g_balance_crylink_primary_other_lifetime 0.4 // range: 800 full, fades to 1300
+set g_balance_crylink_primary_other_fadetime 0.25
+
+set g_balance_crylink_secondary 1
+set g_balance_crylink_secondary_damage 18
+set g_balance_crylink_secondary_edgedamage 0
+set g_balance_crylink_secondary_force -80
+set g_balance_crylink_secondary_radius 5
+set g_balance_crylink_secondary_speed 2000
+set g_balance_crylink_secondary_spread 0.04
+set g_balance_crylink_secondary_shots 7
+set g_balance_crylink_secondary_bounces 0
+set g_balance_crylink_secondary_refire 0.5
+set g_balance_crylink_secondary_animtime 0.3
+set g_balance_crylink_secondary_ammo 2
+set g_balance_crylink_secondary_bouncedamagefactor 0.5
+
+set g_balance_crylink_secondary_middle_lifetime 5 // range: 10000 full, fades to 10000
+set g_balance_crylink_secondary_middle_fadetime 5
+set g_balance_crylink_secondary_line_lifetime 2 // range: 4000 full, fades to 8000
+set g_balance_crylink_secondary_line_fadetime 2
+// }}}
+// {{{ nex
+set g_balance_nex_damage 100
+set g_balance_nex_force 200
+set g_balance_nex_refire 1.25
+set g_balance_nex_animtime 1
+set g_balance_nex_ammo 5
+set g_balance_nex_damagefalloff_mindist 1000
+set g_balance_nex_damagefalloff_maxdist 3000
+set g_balance_nex_damagefalloff_halflife 2000
+set g_balance_nex_damagefalloff_forcehalflife 2000
+// }}}
+// {{{ minstanex
+set g_balance_minstanex_refire 1.25
+set g_balance_minstanex_animtime 1
+set g_balance_minstanex_ammo 10
+// }}}
+// {{{ hagar
+set g_balance_hagar_primary_damage 30
+set g_balance_hagar_primary_edgedamage 15
+set g_balance_hagar_primary_force 70
+set g_balance_hagar_primary_radius 50
+set g_balance_hagar_primary_spread 0.005
+set g_balance_hagar_primary_speed 2000
+set g_balance_hagar_primary_lifetime 30
+set g_balance_hagar_primary_refire 0.13
+set g_balance_hagar_primary_ammo 1
+set g_balance_hagar_secondary 1
+set g_balance_hagar_secondary_damage 30
+set g_balance_hagar_secondary_edgedamage 15
+set g_balance_hagar_secondary_force 70
+set g_balance_hagar_secondary_radius 50
+set g_balance_hagar_secondary_spread 0.01
+set g_balance_hagar_secondary_speed 1400
+set g_balance_hagar_secondary_lifetime_min 30
+set g_balance_hagar_secondary_lifetime_rand 0
+set g_balance_hagar_secondary_refire 0.13
+set g_balance_hagar_secondary_ammo 1
+// }}}
+// {{{ rocketlauncher // TODO
+set g_balance_rocketlauncher_damage 100
+set g_balance_rocketlauncher_edgedamage 33
+set g_balance_rocketlauncher_force 350
+set g_balance_rocketlauncher_radius 120
+set g_balance_rocketlauncher_speed 1000
+set g_balance_rocketlauncher_speedaccel 0
+set g_balance_rocketlauncher_speedstart 1000
+set g_balance_rocketlauncher_lifetime 30
+set g_balance_rocketlauncher_refire 1
+set g_balance_rocketlauncher_animtime 0.3
+set g_balance_rocketlauncher_ammo 3
+set g_balance_rocketlauncher_health 0
+set g_balance_rocketlauncher_damageforcescale 0
+set g_balance_rocketlauncher_detonatedelay 9999 // positive: timer till detonation is allowed, negative: "security device" that prevents ANY remote detonation if it could hurt its owner, zero: detonatable at any time
+set g_balance_rocketlauncher_guiderate 45 // max degrees per second
+set g_balance_rocketlauncher_guideratedelay 0.01 // immediate
+set g_balance_rocketlauncher_guidegoal 512 // goal distance for (non-laser) guiding (higher = less control, lower = erratic)
+set g_balance_rocketlauncher_guidedelay 0.15 // delay before guiding kicks in
+set g_balance_rocketlauncher_guidestop 0 // stop guiding when firing again
+set g_balance_rocketlauncher_laserguided_speed 1000 //650
+set g_balance_rocketlauncher_laserguided_speedaccel 0
+set g_balance_rocketlauncher_laserguided_speedstart 1000
+set g_balance_rocketlauncher_laserguided_turnrate 0.75 //0.5
+set g_balance_rocketlauncher_laserguided_allow_steal 1
+// }}}
+// {{{ porto
+set g_balance_porto_primary_refire 1.5
+set g_balance_porto_primary_animtime 0.3
+set g_balance_porto_primary_speed 2000
+set g_balance_porto_primary_lifetime 30
+set g_balance_portal_health 200 // these get recharged whenever the portal is used
+set g_balance_portal_lifetime 15 // these get recharged whenever the portal is used
+// }}}
+// {{{ hook
+set g_balance_hook_primary_fuel 5 // hook monkeys set 0
+set g_balance_hook_primary_refire 0 // hook monkeys set 0
+set g_balance_hook_primary_animtime 0.3 // good shoot anim
+set g_balance_hook_primary_hooked_time_max 0 // infinite
+set g_balance_hook_primary_hooked_time_free 2 // 2s being hooked are free
+set g_balance_hook_primary_hooked_fuel 5 // fuel per second hooked
+set g_balance_hook_secondary_damage 25 // not much
+set g_balance_hook_secondary_edgedamage 5 // not much
+set g_balance_hook_secondary_radius 500 // LOTS
+set g_balance_hook_secondary_force -2000 // LOTS
+set g_balance_hook_secondary_ammo 50 // a whole pack
+set g_balance_hook_secondary_lifetime 30 // infinite
+set g_balance_hook_secondary_speed 0 // not much throwing
+set g_balance_hook_secondary_gravity 5 // fast falling
+set g_balance_hook_secondary_refire 3 // don't drop too many bombs...
+set g_balance_hook_secondary_animtime 0.3 // good shoot anim
+set g_balance_hook_secondary_power 3 // effect behaves like a square function
+set g_balance_hook_secondary_duration 1.5 // effect runs for three seconds
+// }}}
+// {{{ hlac
+set g_balance_hlac_primary_spread_min 0.01
+set g_balance_hlac_primary_spread_max 0.25
+set g_balance_hlac_primary_spread_add 0.0045
+set g_balance_hlac_primary_spread_crouchmod 0.25
+
+set g_balance_hlac_primary_damage 23
+set g_balance_hlac_primary_edgedamage 10
+set g_balance_hlac_primary_force 100
+set g_balance_hlac_primary_radius 70
+set g_balance_hlac_primary_speed 9000
+set g_balance_hlac_primary_lifetime 5
+
+set g_balance_hlac_primary_refire 0.1
+set g_balance_hlac_primary_animtime 0.4
+set g_balance_hlac_primary_ammo 1
+
+set g_balance_hlac_secondary 1
+set g_balance_hlac_secondary_spread 0.15
+set g_balance_hlac_secondary_spread_crouchmod 0.5
+
+set g_balance_hlac_secondary_damage 23
+set g_balance_hlac_secondary_edgedamage 10
+set g_balance_hlac_secondary_force 100
+set g_balance_hlac_secondary_radius 70
+set g_balance_hlac_secondary_speed 9000
+set g_balance_hlac_secondary_lifetime 5
+
+set g_balance_hlac_secondary_refire 1
+set g_balance_hlac_secondary_animtime 0.3
+set g_balance_hlac_secondary_ammo 10
+set g_balance_hlac_secondary_shots 6
+// }}}
+// {{{ campingrifle
+set g_balance_campingrifle_magazinecapacity 8
+set g_balance_campingrifle_reloadtime 2 // matches reload anim
+set g_balance_campingrifle_auto_reload_after_changing_weapons 0
+set g_balance_campingrifle_bursttime 0
+set g_balance_campingrifle_tracer 0
+set g_balance_campingrifle_primary_damage 60
+set g_balance_campingrifle_primary_headshotaddeddamage 100
+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_lifetime 5
+set g_balance_campingrifle_primary_refire 0.8
+set g_balance_campingrifle_primary_animtime 0.3
+set g_balance_campingrifle_primary_ammo 10
+set g_balance_campingrifle_primary_bulletconstant 130 // 56.3qu
+set g_balance_campingrifle_primary_burstcost 0
+set g_balance_campingrifle_primary_bullethail 0 // empty magazine on shot
+set g_balance_campingrifle_secondary_damage 35
+set g_balance_campingrifle_secondary_headshotaddeddamage 15 // 50 damage only on head
+set g_balance_campingrifle_secondary_spread 0.008
+set g_balance_campingrifle_secondary_force 1
+set g_balance_campingrifle_secondary_speed 20000
+set g_balance_campingrifle_secondary_lifetime 5
+set g_balance_campingrifle_secondary_refire 0.15
+set g_balance_campingrifle_secondary_animtime 0.1
+set g_balance_campingrifle_secondary_ammo 10
+set g_balance_campingrifle_secondary_bulletconstant 130 // 18.3qu
+set g_balance_campingrifle_secondary_burstcost 0
+set g_balance_campingrifle_secondary_bullethail 0 // empty magazine on shot
+// }}}
+// {{{ tuba
+set g_balance_tuba_refire 0.05
+set g_balance_tuba_animtime 0.05
+set g_balance_tuba_attenuation 0.5
+set g_balance_tuba_volume 1
+set g_balance_tuba_fadetime 0.25
+set g_balance_tuba_damage 5
+set g_balance_tuba_edgedamage 0
+set g_balance_tuba_radius 200
+set g_balance_tuba_force 40
+// }}}
+// {{{ fireball
+set g_balance_fireball_primary_ammo 40
+set g_balance_fireball_primary_animtime 0.15
+set g_balance_fireball_primary_bfgdamage 100
+set g_balance_fireball_primary_bfgforce 0
+set g_balance_fireball_primary_bfgradius 1000
+set g_balance_fireball_primary_damage 200
+set g_balance_fireball_primary_damageforcescale 4
+set g_balance_fireball_primary_edgedamage 0
+set g_balance_fireball_primary_force 700
+set g_balance_fireball_primary_health 50
+set g_balance_fireball_primary_laserburntime 0.5
+set g_balance_fireball_primary_laserdamage 80
+set g_balance_fireball_primary_laseredgedamage 20
+set g_balance_fireball_primary_laserradius 256
+set g_balance_fireball_primary_lifetime 15
+set g_balance_fireball_primary_radius 200
+set g_balance_fireball_primary_refire 5
+set g_balance_fireball_primary_refire2 0
+set g_balance_fireball_primary_speed 650
+set g_balance_fireball_primary_spread 0
+set g_balance_fireball_secondary_ammo 5
+set g_balance_fireball_secondary_animtime 0.3
+set g_balance_fireball_secondary_damage 40
+set g_balance_fireball_secondary_damageforcescale 4
+set g_balance_fireball_secondary_damagetime 5
+set g_balance_fireball_secondary_force 100
+set g_balance_fireball_secondary_laserburntime 0.5
+set g_balance_fireball_secondary_laserdamage 50
+set g_balance_fireball_secondary_laseredgedamage 20
+set g_balance_fireball_secondary_laserradius 110
+set g_balance_fireball_secondary_lifetime 7
+set g_balance_fireball_secondary_refire 2
+set g_balance_fireball_secondary_speed 900
+set g_balance_fireball_secondary_speed_up 100
+set g_balance_fireball_secondary_speed_z 0
+set g_balance_fireball_secondary_spread 0
+// }}}
+// {{{ seeker
+set g_balance_seeker_flac_ammo 0.5
+set g_balance_seeker_flac_animtime 0.1
+set g_balance_seeker_flac_damage 15
+set g_balance_seeker_flac_edgedamage 10
+set g_balance_seeker_flac_force 50
+set g_balance_seeker_flac_lifetime 0.1
+set g_balance_seeker_flac_lifetime_rand 0.05
+set g_balance_seeker_flac_radius 100
+set g_balance_seeker_flac_refire 0.1
+set g_balance_seeker_flac_speed 3000
+set g_balance_seeker_flac_speed_up 1000
+set g_balance_seeker_flac_speed_z 0
+set g_balance_seeker_flac_spread 0.4
+set g_balance_seeker_missile_accel 1.05
+set g_balance_seeker_missile_ammo 2
+set g_balance_seeker_missile_animtime 0.3
+set g_balance_seeker_missile_count 4
+set g_balance_seeker_missile_damage 40
+set g_balance_seeker_missile_damageforcescale 4
+set g_balance_seeker_missile_decel 0.9
+set g_balance_seeker_missile_delay 0.25
+set g_balance_seeker_missile_edgedamage 10
+set g_balance_seeker_missile_force 250
+set g_balance_seeker_missile_health 5
+set g_balance_seeker_missile_lifetime 15
+set g_balance_seeker_missile_proxy 0
+set g_balance_seeker_missile_proxy_delay 0.2
+set g_balance_seeker_missile_proxy_maxrange 45
+set g_balance_seeker_missile_radius 80
+set g_balance_seeker_missile_refire 0.5
+set g_balance_seeker_missile_smart 1
+set g_balance_seeker_missile_smart_mindist 800
+set g_balance_seeker_missile_smart_trace_max 2500
+set g_balance_seeker_missile_smart_trace_min 1000
+set g_balance_seeker_missile_speed 700
+set g_balance_seeker_missile_speed_accel 0
+set g_balance_seeker_missile_speed_up 300
+set g_balance_seeker_missile_speed_z 0
+set g_balance_seeker_missile_speed_max 1250
+set g_balance_seeker_missile_spread 0
+set g_balance_seeker_missile_turnrate 0.65
+set g_balance_seeker_tag_ammo 1
+set g_balance_seeker_tag_animtime 0.3
+set g_balance_seeker_tag_damageforcescale 4
+set g_balance_seeker_tag_health 5
+set g_balance_seeker_tag_lifetime 15
+set g_balance_seeker_tag_refire 0.7
+set g_balance_seeker_tag_speed 9000
+set g_balance_seeker_tag_spread 0
+// End new seeker
-// {{{ weapon replacement
-// NOTE: this only replaces weapons on the map
-// use g_start_weapon_* to also replace the on-startup weapons!
-// example: g_weaponreplace_nex "nex minstanex", then Nexes become MinstaNexes 50% of the times
-// set the cvars to "0" to totally disable a weapon
-set sv_q3acompat_machineshotgunswap 0 "shorthand for swapping uzi and shotgun"
-set g_weaponreplace_laser ""
-set g_weaponreplace_shotgun ""
-set g_weaponreplace_uzi ""
-set g_weaponreplace_grenadelauncher ""
-set g_weaponreplace_electro ""
-set g_weaponreplace_crylink ""
-set g_weaponreplace_nex ""
-set g_weaponreplace_hagar ""
-set g_weaponreplace_rocketlauncher ""
-set g_weaponreplace_porto ""
-set g_weaponreplace_minstanex ""
-set g_weaponreplace_hook ""
-set g_weaponreplace_hlac 0 // I don't particularly like this weapon.
-set g_weaponreplace_campingrifle ""
-set g_weaponreplace_tuba ""
-set g_weaponreplace_fireball 0 // Don't kill me div0, just for now until I figure out a good balance for it.
-set g_weaponreplace_seeker ""
-set sv_q3acompat_machineshotgunswap 0 "shorthand for swapping uzi and shotgun (for Q3A map compatibility)"
-// }}}
-
// {{{ starting gear
set g_start_weapon_laser -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
set g_start_weapon_shotgun -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
set g_start_weapon_tuba -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
set g_start_weapon_fireball 0 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
set g_start_weapon_seeker 0 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
-set g_balance_health_start 100
+set g_balance_health_start 125
set g_balance_armor_start 0
-set g_start_ammo_shells 45
+set g_start_ammo_shells 30
set g_start_ammo_nails 0
set g_start_ammo_rockets 0
set g_start_ammo_cells 0
set g_warmup_start_ammo_cells 50 "starting values when being in warmup-stage"
set g_warmup_start_ammo_fuel 0 "starting values when being in warmup-stage"
set g_lms_start_health 200
-set g_lms_start_armor 100
-set g_lms_start_ammo_shells 50
-set g_lms_start_ammo_nails 150
-set g_lms_start_ammo_rockets 50
-set g_lms_start_ammo_cells 50
+set g_lms_start_armor 200
+set g_lms_start_ammo_shells 120
+set g_lms_start_ammo_nails 400
+set g_lms_start_ammo_rockets 120
+set g_lms_start_ammo_cells 200
set g_lms_start_ammo_fuel 0
set g_balance_nix_roundtime 25
set g_balance_nix_incrtime 1.6
-set g_balance_nix_ammo_shells 15
-set g_balance_nix_ammo_nails 45
-set g_balance_nix_ammo_rockets 15
-set g_balance_nix_ammo_cells 15
+set g_balance_nix_ammo_shells 120
+set g_balance_nix_ammo_nails 400
+set g_balance_nix_ammo_rockets 120
+set g_balance_nix_ammo_cells 200
set g_balance_nix_ammo_fuel 0
set g_balance_nix_ammoincr_shells 2
set g_balance_nix_ammoincr_nails 6
// }}}
// {{{ pickup items
+set g_pickup_ammo_anyway 1
+set g_pickup_weapons_anyway 1
set g_pickup_shells 30
set g_pickup_shells_max 120
set g_pickup_nails 80
set g_pickup_fuel_jetpack 50
set g_pickup_fuel_max 999
set g_pickup_armorsmall 10
-set g_pickup_armorsmall_max 100
+set g_pickup_armorsmall_max 200
+set g_pickup_armorsmall_anyway 1
set g_pickup_armormedium 25
-set g_pickup_armormedium_max 100
+set g_pickup_armormedium_max 200
+set g_pickup_armormedium_anyway 1
set g_pickup_armorbig 50
-set g_pickup_armorbig_max 100
+set g_pickup_armorbig_max 200
+set g_pickup_armorbig_anyway 1
set g_pickup_armorlarge 100
-set g_pickup_armorlarge_max 100
+set g_pickup_armorlarge_max 200
+set g_pickup_armorlarge_anyway 1
set g_pickup_healthsmall 10
set g_pickup_healthsmall_max 200
+set g_pickup_healthsmall_anyway 1
set g_pickup_healthmedium 25
set g_pickup_healthmedium_max 200
+set g_pickup_healthmedium_anyway 1
set g_pickup_healthlarge 50
set g_pickup_healthlarge_max 200
+set g_pickup_healthlarge_anyway 1
set g_pickup_healthmega 100
set g_pickup_healthmega_max 200
+set g_pickup_healthmega_anyway 1
set g_pickup_respawntime_short 15
set g_pickup_respawntime_medium 20
set g_pickup_respawntime_long 30
set g_balance_armor_regen 0
set g_balance_armor_regenlinear 0
set g_balance_armor_rot 0
-set g_balance_armor_rotlinear 0
+set g_balance_armor_rotlinear 3
set g_balance_pause_armor_rot 1
set g_balance_pause_armor_rot_spawn 1
set g_balance_armor_regenstable 100
// }}}
// {{{ misc
-set g_balance_selfdamagepercent 0.6
+set g_balance_selfdamagepercent 0.75
set g_balance_weaponswitchdelay 0.15
set g_weaponspeedfactor 1 "weapon projectile speed multiplier"
set g_weaponratefactor 1 "weapon fire rate multiplier"
// {{{ shotgun
set g_balance_shotgun_primary_bullets 6
set g_balance_shotgun_primary_damage 8
-set g_balance_shotgun_primary_force 0
+set g_balance_shotgun_primary_force 15
set g_balance_shotgun_primary_spread 0.11
set g_balance_shotgun_primary_refire 0.5
set g_balance_shotgun_primary_animtime 0.2
set g_balance_shotgun_secondary 1
set g_balance_shotgun_secondary_bullets 6
set g_balance_shotgun_secondary_damage 8
-set g_balance_shotgun_secondary_force 0
+set g_balance_shotgun_secondary_force 15
set g_balance_shotgun_secondary_spread 0.17
set g_balance_shotgun_secondary_refire 1.35
set g_balance_shotgun_secondary_animtime 0.2
// {{{ uzi
set g_balance_uzi_first 1
set g_balance_uzi_first_damage 12
-set g_balance_uzi_first_force 0
+set g_balance_uzi_first_force 5
set g_balance_uzi_first_spread 0.015
set g_balance_uzi_first_refire 0.15
set g_balance_uzi_first_ammo 1
set g_balance_uzi_sustained_damage 7
-set g_balance_uzi_sustained_force 0
+set g_balance_uzi_sustained_force 5
set g_balance_uzi_sustained_spread 0.05
set g_balance_uzi_sustained_refire 0.075
set g_balance_uzi_sustained_ammo 1
set g_balance_crylink_primary_damage 14
set g_balance_crylink_primary_edgedamage 0
set g_balance_crylink_primary_force -55
-set g_balance_crylink_primary_radius 80
+set g_balance_crylink_primary_radius 50
set g_balance_crylink_primary_speed 7000
-set g_balance_crylink_primary_spread 0.01
+set g_balance_crylink_primary_spread 0.02
set g_balance_crylink_primary_shots 4
set g_balance_crylink_primary_bounces 1
set g_balance_crylink_primary_refire 0.4
set g_balance_crylink_secondary_bounces 0
set g_balance_crylink_secondary_refire 0.1
set g_balance_crylink_secondary_animtime 0.1
-set g_balance_crylink_secondary_ammo 1
+set g_balance_crylink_secondary_ammo 2
set g_balance_crylink_secondary_bouncedamagefactor 0.5
set g_balance_crylink_secondary_middle_lifetime 5 // range: 35000 full, fades to 70000
// }}}
// {{{ nex
set g_balance_nex_damage 90
-set g_balance_nex_force 200
+set g_balance_nex_force 300
set g_balance_nex_refire 1.5
set g_balance_nex_animtime 0.3
set g_balance_nex_ammo 5
set g_balance_rocketlauncher_ammo 3
set g_balance_rocketlauncher_health 40
set g_balance_rocketlauncher_damageforcescale 4
-set g_balance_rocketlauncher_detonatedelay -1 // positive: timer till detonation is allowed, negative: "security device" that prevents ANY remote detonation if it could hurt its owner, zero: detonatable at any time
+set g_balance_rocketlauncher_detonatedelay 0.05 // positive: timer till detonation is allowed, negative: "security device" that prevents ANY remote detonation if it could hurt its owner, zero: detonatable at any time
set g_balance_rocketlauncher_guiderate 140 // max degrees per second
set g_balance_rocketlauncher_guideratedelay 0.01 // immediate
set g_balance_rocketlauncher_guidegoal 512 // goal distance for (non-laser) guiding (higher = less control, lower = erratic)
set g_balance_campingrifle_primary_damage 50
set g_balance_campingrifle_primary_headshotaddeddamage 50
set g_balance_campingrifle_primary_spread 0
-set g_balance_campingrifle_primary_force 0
+set g_balance_campingrifle_primary_force 50
set g_balance_campingrifle_primary_speed 35000
set g_balance_campingrifle_primary_lifetime 5
set g_balance_campingrifle_primary_refire 0.7
set g_balance_campingrifle_primary_ammo 10
set g_balance_campingrifle_primary_bulletconstant 130 // 56.3qu
set g_balance_campingrifle_primary_burstcost 0.35 // require same cooldown as secondary, note it's smaller than primary refire time
+set g_balance_campingrifle_primary_bullethail 0
set g_balance_campingrifle_secondary_damage 15
set g_balance_campingrifle_secondary_headshotaddeddamage 25
set g_balance_campingrifle_secondary_spread 0.02
-set g_balance_campingrifle_secondary_force 0
+set g_balance_campingrifle_secondary_force 30
set g_balance_campingrifle_secondary_speed 20000
set g_balance_campingrifle_secondary_lifetime 5
set g_balance_campingrifle_secondary_refire 0.1
set g_balance_campingrifle_secondary_ammo 4
set g_balance_campingrifle_secondary_bulletconstant 130 // 18.3qu
set g_balance_campingrifle_secondary_burstcost 0.35
+set g_balance_campingrifle_secondary_bullethail 0
// }}}
// {{{ tuba
set g_balance_tuba_refire 0.05
-// {{{ weapon replacement
-// NOTE: this only replaces weapons on the map
-// use g_start_weapon_* to also replace the on-startup weapons!
-// example: g_weaponreplace_nex "nex minstanex", then Nexes become MinstaNexes 50% of the times
-// set the cvars to "0" to totally disable a weapon
-set g_weaponreplace_laser ""
-set g_weaponreplace_shotgun "uzi"
-set g_weaponreplace_uzi "shotgun"
-set g_weaponreplace_grenadelauncher ""
-set g_weaponreplace_electro ""
-set g_weaponreplace_crylink ""
-set g_weaponreplace_nex ""
-set g_weaponreplace_hagar ""
-set g_weaponreplace_rocketlauncher ""
-set g_weaponreplace_porto ""
-set g_weaponreplace_minstanex ""
-set g_weaponreplace_hook 0
-set g_weaponreplace_hlac 0
-set g_weaponreplace_campingrifle 0
-set g_weaponreplace_tuba ""
-set g_weaponreplace_fireball 0
-set g_weaponreplace_seeker 0
-set sv_q3acompat_machineshotgunswap 0
-// }}}
-
// {{{ starting gear
set g_start_weapon_laser -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
set g_start_weapon_shotgun -2 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
// }}}
// {{{ pickup items
+set g_pickup_ammo_anyway 0
+set g_pickup_weapons_anyway 0
set g_pickup_shells 10
set g_pickup_shells_max 30
set g_pickup_nails 30
set g_pickup_fuel_max 999
set g_pickup_armorsmall 5
set g_pickup_armorsmall_max 200
+set g_pickup_armorsmall_anyway 0
set g_pickup_armormedium 25
set g_pickup_armormedium_max 200
+set g_pickup_armormedium_anyway 0
set g_pickup_armorbig 50
set g_pickup_armorbig_max 200
+set g_pickup_armorbig_anyway 0
set g_pickup_armorlarge 100
set g_pickup_armorlarge_max 200
+set g_pickup_armorlarge_anyway 0
set g_pickup_healthsmall 5
set g_pickup_healthsmall_max 200
+set g_pickup_healthsmall_anyway 0
set g_pickup_healthmedium 25
set g_pickup_healthmedium_max 100
+set g_pickup_healthmedium_anyway 0
set g_pickup_healthlarge 50
set g_pickup_healthlarge_max 100
+set g_pickup_healthlarge_anyway 0
set g_pickup_healthmega 100
set g_pickup_healthmega_max 200
+set g_pickup_healthmega_anyway 0
set g_pickup_respawntime_short 30
set g_pickup_respawntime_medium 30
set g_pickup_respawntime_long 30
set g_balance_laser_secondary_delay 0
// }}}
// {{{ shotgun
-set g_balance_shotgun_primary_bullets 36
-set g_balance_shotgun_primary_damage 3
+set g_balance_shotgun_primary_bullets 25
+set g_balance_shotgun_primary_damage 4
set g_balance_shotgun_primary_force 10
set g_balance_shotgun_primary_spread 0.18
set g_balance_shotgun_primary_refire 1
set g_balance_uzi_first_spread 0.007
set g_balance_uzi_first_refire 0.15
set g_balance_uzi_first_ammo 1
-set g_balance_uzi_sustained_damage 7
-set g_balance_uzi_sustained_force 30
+set g_balance_uzi_sustained_damage 5
+set g_balance_uzi_sustained_force 10
set g_balance_uzi_sustained_spread 0.02
set g_balance_uzi_sustained_refire 0.1
set g_balance_uzi_sustained_ammo 1
set g_balance_crylink_secondary_line_fadetime 2
// }}}
// {{{ nex
-set g_balance_nex_damage 100
+set g_balance_nex_damage 80
set g_balance_nex_force 200
set g_balance_nex_refire 1.25
-set g_balance_nex_animtime 0.8
+set g_balance_nex_animtime 1.25
set g_balance_nex_ammo 5
set g_balance_nex_damagefalloff_mindist 1000
set g_balance_nex_damagefalloff_maxdist 3000
set g_balance_campingrifle_primary_ammo 10
set g_balance_campingrifle_primary_bulletconstant 130 // 56.3qu
set g_balance_campingrifle_primary_burstcost 0.35 // require same cooldown as secondary, note it's smaller than primary refire time
+set g_balance_campingrifle_primary_bullethail 0
set g_balance_campingrifle_secondary_damage 15
set g_balance_campingrifle_secondary_headshotaddeddamage 25
set g_balance_campingrifle_secondary_spread 0.02
set g_balance_campingrifle_secondary_ammo 4
set g_balance_campingrifle_secondary_bulletconstant 130 // 18.3qu
set g_balance_campingrifle_secondary_burstcost 0.35
+set g_balance_campingrifle_secondary_bullethail 0
// }}}
// {{{ tuba
set g_balance_tuba_refire 0.05
//bot configuration: name model skin shirt pants team keyboard use moving dodging ping weapon use aggressivity range aiming calmhand mouse fightthink aithink
//default team values (team-override): 1 = red, 2 = blue, 3 = yellow, 4 = pink
//use -1 for shirt-color or pants-color to get random colors
-Hellfire nexus 0 4 0 0 0 0 -0.5 -1 1 1 -0.5 -1 -1 2 0.5 -1
-Toxic nexus 1 14 7 0 -1 -1.5 -0.5 0 1 0 0 0 2 -0.5 -0.5 1
-Discovery nexus 0 2 6 0 0 -1 -0.5 -0.5 1 -0.5 0.5 1.5 -0.5 -1 1 0.5
-Pegasus nexus 0 13 11 0 1 1 1 1 -1 0 0.5 0 -2 0 -1 0
-Eureka nexus 0 12 7 0 0 0 -1.5 -0.5 -0.5 0 0 0 0 -0.5 1.5 1.5
-Airhead nexus 0 11 1 0 -1 -1.5 -1 -0.5 1 1 -1 1 -0.5 1 0.5 0
-Gator nexus 0 3 10 0 0 1 0 0.5 -0.5 0.5 -0.5 -1 0 0 -0.5 0
-Delirium nexus 1 8 12 0 0 -1 -1 -1 0 2 0 1 0 2 -1 -1
-Death nexus 0 4 11 0 -0.5 0 0 1 -0.5 0 1 0 0 0 0 0
-Scorcher nexus 0 13 13 0 0 -1 0 -0.5 0.5 1 0 1 -2 1 0 0
-Necrotic nexus 0 12 14 0 0 0 0 1 0 -1 -0.5 -1 1 0 0 0
-Dominator nexus 1 3 9 0 0 0 0 2 -1 0 0 0 -1 0 0 0
-Thunderstorm nexus 2 13 6 0 0 0 0 -0.5 -1 1 0.5 0.5 -0.5 0 0.5 0
-Mystery nexus 0 9 14 0 1 1 1 1 -1 -1 0 1 1 -2 -1 -1
-Lion nexus 0 0 4 0 1 1.5 2 -1 -1 -1 1 0 1 -0.5 -1 -1
-Sensible nexus 0 9 9 0 0 0 0.5 -1 0 -1 0 -1 2.5 -1.5 1 0.5
-Shadow nexus 0 4 8 0 -0.5 2 1 0 0 -1 0 -1 0 1 -1 -0.5
-Resurrection nexus 0 1 1 0 0 -0.5 -0.5 0 2 -1 -1 -1 0 -1 1 1
+Hellfire umbra 0 4 0 0 0 0 -0.5 -1 1 1 -0.5 -1 -1 2 0.5 -1
+Toxic umbra 0 14 7 0 -1 -1.5 -0.5 0 1 0 0 0 2 -0.5 -0.5 1
+Discovery umbra 0 2 6 0 0 -1 -0.5 -0.5 1 -0.5 0.5 1.5 -0.5 -1 1 0.5
+Pegasus umbra 0 13 11 0 1 1 1 1 -1 0 0.5 0 -2 0 -1 0
+Eureka umbra 0 12 7 0 0 0 -1.5 -0.5 -0.5 0 0 0 0 -0.5 1.5 1.5
+Airhead umbra 0 11 1 0 -1 -1.5 -1 -0.5 1 1 -1 1 -0.5 1 0.5 0
+Gator umbra 0 3 10 0 0 1 0 0.5 -0.5 0.5 -0.5 -1 0 0 -0.5 0
+Delirium umbra 0 8 12 0 0 -1 -1 -1 0 2 0 1 0 2 -1 -1
+Death umbra 0 4 11 0 -0.5 0 0 1 -0.5 0 1 0 0 0 0 0
+Scorcher umbra 0 13 13 0 0 -1 0 -0.5 0.5 1 0 1 -2 1 0 0
+Necrotic umbra 0 12 14 0 0 0 0 1 0 -1 -0.5 -1 1 0 0 0
+Dominator umbra 0 3 9 0 0 0 0 2 -1 0 0 0 -1 0 0 0
+Thunderstorm umbra 0 13 6 0 0 0 0 -0.5 -1 1 0.5 0.5 -0.5 0 0.5 0
+Mystery umbra 0 9 14 0 1 1 1 1 -1 -1 0 1 1 -2 -1 -1
+Lion umbra 0 0 4 0 1 1.5 2 -1 -1 -1 1 0 1 -0.5 -1 -1
+Sensible umbra 0 9 9 0 0 0 0.5 -1 0 -1 0 -1 2.5 -1.5 1 0.5
+Shadow umbra 0 4 8 0 -0.5 2 1 0 0 -1 0 -1 0 1 -1 -0.5
+Resurrection umbra 0 1 1 0 0 -0.5 -0.5 0 2 -1 -1 -1 0 -1 1 1
exec defaultXonotic.cfg
-
-// we're not xonotic 2.6 yet
-//exec default25.cfg
+++ /dev/null
-cl_netfps 20
-sys_ticrate 0.05
-sv_gameplayfix_delayprojectiles 1
-exec physics25.cfg
-exec balance25.cfg
+++ /dev/null
-cl_netfps 60
-sys_ticrate 0.0166667
-sv_gameplayfix_delayprojectiles 0
-exec physics26.cfg
-exec balance.cfg
--- /dev/null
+// Samual's mod configuration file
+exec defaultXonotic.cfg
+
+// weapon replace options
+set g_weaponreplace_laser ""
+set g_weaponreplace_shotgun ""
+set g_weaponreplace_uzi ""
+set g_weaponreplace_grenadelauncher ""
+set g_weaponreplace_electro ""
+set g_weaponreplace_crylink ""
+set g_weaponreplace_nex ""
+set g_weaponreplace_hagar ""
+set g_weaponreplace_rocketlauncher ""
+set g_weaponreplace_porto ""
+set g_weaponreplace_minstanex ""
+set g_weaponreplace_hook ""
+set g_weaponreplace_hlac 0 // Maybe will be enabled later after I figure out what I want to do with it
+set g_weaponreplace_campingrifle ""
+set g_weaponreplace_tuba ""
+set g_weaponreplace_fireball 0 // Same with this
+set g_weaponreplace_seeker 0 // Same with this
+set sv_q3acompat_machineshotgunswap 0
+
+// other options
+set sv_fragmessage_information_ping 1
+set sv_fragmessage_information_handicap 2
+set sv_fragmessage_information_stats 1
+set sv_fragmessage_information_typefrag 1
+
+exec physicsSamual.cfg
+exec balanceSamual.cfg
--- /dev/null
+exec defaultXonotic.cfg
+
+set g_weaponreplace_laser ""
+set g_weaponreplace_shotgun "uzi"
+set g_weaponreplace_uzi "shotgun"
+set g_weaponreplace_grenadelauncher ""
+set g_weaponreplace_electro ""
+set g_weaponreplace_crylink ""
+set g_weaponreplace_nex ""
+set g_weaponreplace_hagar ""
+set g_weaponreplace_rocketlauncher ""
+set g_weaponreplace_porto ""
+set g_weaponreplace_minstanex ""
+set g_weaponreplace_hook 0
+set g_weaponreplace_hlac 0
+set g_weaponreplace_campingrifle 0
+set g_weaponreplace_tuba ""
+set g_weaponreplace_fireball 0
+set g_weaponreplace_seeker 0
+set sv_q3acompat_machineshotgunswap 0
+
+exec physicsXPM.cfg
+exec balanceXPM.cfg
set g_xonoticversion 2.5svn "Xonotic version (formatted for humans)"
-//!<showbrand
-showbrand 3
-echo
-echo A warning about this being a SVN development version was set up.
-echo This build shall be used for development and testing only!
-echo
-echo If you want to disable this warning, add the line
-echo showbrand 0
-echo to your autoexec.cfg.
-echo
-//!>showbrand
-
// changes a cvar and reports it to the server (for the menu to notify the
// server about changes)
alias setreport "set \"$1\" \"$2\" ; sendcvar \"$1\""
// player defaults
_cl_color 102
_cl_name Player
-_cl_playermodel models/player/marine.zym
+_cl_playermodel models/player/umbra.iqm
_cl_playerskin 0
crosshair 1
seta crosshair_per_weapon 0 "when 1, each gun will display a different crosshair"
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_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"
+cl_leanmodel_side_limit 35 "gun leaning sideways limit"
+cl_leanmodel_side_highpass1 30 "gun leaning sideways pre-highpass in 1/s"
+cl_leanmodel_side_highpass 3 "gun leaning sideways highpass in 1/s"
+cl_leanmodel_side_lowpass 20 "gun leaning sideways lowpass in 1/s"
+cl_leanmodel_up_speed 0.65 "gun leaning upward speed"
+cl_leanmodel_up_limit 50 "gun leaning upward limit"
+cl_leanmodel_up_highpass1 5 "gun leaning upward pre-highpass in 1/s"
+cl_leanmodel_up_highpass 15 "gun leaning upward highpass in 1/s"
+cl_leanmodel_up_lowpass 20 "gun leaning upward lowpass in 1/s"
cl_followmodel 1 // enables weapon pushing / pulling effect when walking
+cl_followmodel_side_speed 0.25 "gun following sideways speed"
+cl_followmodel_side_limit 6 "gun following sideways limit"
+cl_followmodel_side_highpass1 30 "gun following sideways pre-highpass in 1/s"
+cl_followmodel_side_highpass 5 "gun following sideways highpass in 1/s"
+cl_followmodel_side_lowpass 10 "gun following sideways lowpass in 1/s"
+cl_followmodel_up_speed 0.5 "gun following upward speed"
+cl_followmodel_up_limit 5 "gun following upward limit"
+cl_followmodel_up_highpass1 60 "gun following upward pre-highpass in 1/s"
+cl_followmodel_up_highpass 2 "gun following upward highpass in 1/s"
+cl_followmodel_up_lowpass 10 "gun following upward lowpass in 1/s"
+
cl_rollangle 0 // amount of view tilt when strafing, default is 2.0
v_kicktime 0 // how long damage kicks of the view last, default is 0 seconds
gl_polyblend 0.5 // whether to use screen tints, default is 1
set g_telefrags_avoid 0
set g_teleport_maxspeed 0 "maximum speed that a player can keep when going through a teleporter (if a misc_teleporter_dest also has a cap the smallest one of these will be used), 0 = don't limit, -1 = keep no speed"
-set g_respawn_ghosts 1 "if 1 dead bodies become ghosts and float away when the player respawns"
+set g_respawn_ghosts 0 "if 1 dead bodies become ghosts and float away when the player respawns"
set g_respawn_ghosts_speed 5 "the speed with which respawn ghosts float and rotate"
set g_respawn_ghosts_maxtime 6 "maximum amount of time a respawn ghost can last, minimum time is half this value. 0 disables and ghosts fade when the body would"
set sv_pogostick 1 "don't require releasing the space bar for jumping again"
set sv_doublejump 0 "allow Quake 2-style double jumps"
-set sv_jumpspeedcap_min "" "wont perform a doublejump if z-axis speed is higher than sv_jumpvelocity * this"
-set sv_jumpspeedcap_max "" "wont perform a doublejump if z-axis speed is higher than sv_jumpvelocity * this"
-set sv_jumpspeedcap_max_disable_on_ramps 0 "disable max jumpspeedcap on ramps to preserve the old rampjump style"
+set sv_jumpspeedcap_min "" "lower bound on the baseline velocity of a jump; final velocity will be >= (jumpheight * min + jumpheight)"
+set sv_jumpspeedcap_max "" "upper bound on the baseline velocity of a jump; final velocity will be <= (jumpheight * max + jumpheight)"
+set sv_jumpspeedcap_max_disable_on_ramps 0 "disable upper baseline velocity bound on ramps to preserve the old rampjump style"
seta sv_precacheplayermodels 1
seta sv_precacheweapons 0
set g_waypointeditor 0
set bot_ignore_bots 0 "When set, bots don't shoot at other bots"
set bot_join_empty 0 "When set, bots also play if no player has joined the server"
-set bot_vs_human 0 "Bots and humans play in different teams when set. positive values to make an all-bot blue team, set to negative values to make an all-bot red team, the absolute value is the ratio bots vs humans (1 for equal count)"
+set bot_vs_human 0 "Bots and humans play in different teams when set. positive values to make an all-bot blue team, set to negative values to make an all-bot red team, the absolute value is the ratio bots vs humans (1 for equal count). Changes will be correctly applied only from the next game"
alias g_waypointeditor_spawn "impulse 103"
alias g_waypointeditor_remove "impulse 104"
alias -zoom -button4
alias +crouch +button5
alias -crouch -button5
-alias weapnext "_weapnext_${_supports_weaponpriority}${hud_hudselector}${cl_weaponpriority_useforcycling}"
-alias _weapnext_000 "impulse 10"
-alias _weapnext_001 "impulse 10"
-alias _weapnext_010 "impulse 10"
-alias _weapnext_011 "impulse 10"
-alias _weapnext_020 "impulse 10"
-alias _weapnext_021 "impulse 10"
-alias _weapnext_100 "impulse 10"
-alias _weapnext_101 "impulse 15"
-alias _weapnext_110 "impulse 18"
-alias _weapnext_111 "impulse 15"
-alias _weapnext_120 "impulse 18"
-alias _weapnext_121 "impulse 15"
+alias weapnext "_weapnext_${cl_weaponpriority_useforcycling}"
+alias _weapnext_0 "impulse 18"
+alias _weapnext_1 "impulse 15"
+alias _weapnext_2 "impulse 10"
alias weaplast "impulse 11"
-alias weapprev "_weapprev_${_supports_weaponpriority}${hud_hudselector}${cl_weaponpriority_useforcycling}"
-alias _weapprev_000 "impulse 12"
-alias _weapprev_001 "impulse 12"
-alias _weapprev_010 "impulse 12"
-alias _weapprev_011 "impulse 12"
-alias _weapprev_020 "impulse 12"
-alias _weapprev_021 "impulse 12"
-alias _weapprev_100 "impulse 12"
-alias _weapprev_101 "impulse 16"
-alias _weapprev_110 "impulse 19"
-alias _weapprev_111 "impulse 16"
-alias _weapprev_120 "impulse 19"
-alias _weapprev_121 "impulse 16"
-set _supports_weaponpriority 0 "set to 1 by csqc if supported, and to 0 on disconnect"
+alias weapprev "_weapprev_${cl_weaponpriority_useforcycling}"
+alias _weapprev_0 "impulse 19"
+alias _weapprev_1 "impulse 16"
+alias _weapprev_2 "impulse 12"
alias weapbest "impulse 13"
alias reload "impulse 20"
bind F11 disconnect
bind F12 screenshot
bind F4 ready
-bind m radar
bind ALT +showaccuracy
// Gamepad defaults. Tested with Logitech Rumblepad 2, I hope similar ones works as well.
// hud variables
set _hud_configure 0 "1 = configure the HUD"
-seta hud_accuracy_yellow 40 "percentage at which the accuracy color is yellow"
-seta hud_progressbar_alpha "0.5" "alpha of progressbars"
-seta hud_bg 0 "sets the default background for the panels, file must exist in data/gfx/hud/. 0 = disable background by default"
-seta hud_bg_color "0 0.6 0.9" "sets the default background color for the panels"
-seta hud_bg_alpha 0.8 "alpha of the background"
-seta hud_bg_border 10 "sets the default border size for the panels"
-seta hud_fg_alpha 1 "alpha of the foreground"
-
seta hud_configure_checkcollisions 1 "check for collisions against other panels when in hud configure mode"
-seta hud_configure_bg_minalpha 0.5 "minimum panel background alpha when in hud configure mode"
-
-seta hud_dock dock_oldhud "overlay the whole screen with this dock background, 0 = disable"
-seta hud_dock_color "0 0.6 0.9" "dock color"
-seta hud_dock_alpha 0.8 "alpha of the dock"
-
-seta sbar_info_pos 50
-
-seta hud_hudselector 1 "0 = health/armor positions flipped, 1 = default hud layout, 2 = combined health and armor display"
-seta hud_showcurrentammo 0 "0 = show all ammo types, 1 = show only the ammo type of the current weapon"
-
-seta hud_weaponicons 1 "enable/disable this panel"
-seta hud_weaponicons_pos "-0.635295 -0.134116" "position of this panel"
-seta hud_weaponicons_size "0.352942 0.064845" "size of this panel"
-seta hud_weaponicons_number 1 "show number of weapon"
-seta hud_weaponicons_accuracybar_height 3 "height of accuracy bar"
-seta hud_weaponicons_bg "" "if set to something else than \"\" = override default background, if set to 0 = disable background"
-seta hud_weaponicons_bg_color "" "optional R G B string of the background color, otherwise use hud default"
-seta hud_weaponicons_bg_alpha 0 "if set to something else than 0 = override default alpha"
-seta hud_weaponicons_bg_border 0 "if set to something else than 0 = override size of border around the background"
-
-seta hud_inventory 1 "enable/disable this panel"
-seta hud_inventory_pos "0.179783 -0.092189" "position of this panel"
-seta hud_inventory_size "0.174227 0.092189" "size of this panel"
-seta hud_inventory_onlycurrent 0 "1 = show only current ammo type"
-seta hud_inventory_bg "" "if set to something else than \"\" = override default background, if set to 0 = disable background"
-seta hud_inventory_bg_color "" "optional R G B string of the background color, otherwise use hud default"
-seta hud_inventory_bg_alpha 0 "if set to something else than 0 = override default alpha"
-seta hud_inventory_bg_border 0 "if set to something else than 0 = override size of border around the background"
-
-seta hud_powerups 1 "enable/disable this panel"
-seta hud_powerups_pos "-0.311922 -0.084896" "position of this panel"
-seta hud_powerups_size "0.086719 0.077084" "size of this panel"
-seta hud_powerups_flip 1 "flip strength/shield positions"
-seta hud_powerups_bg "" "if set to something else than \"\" = override default background, if set to 0 = disable background"
-seta hud_powerups_bg_color "" "optional R G B string of the background color, otherwise use hud default"
-seta hud_powerups_bg_alpha 0 "if set to something else than 0 = override default alpha"
-seta hud_powerups_bg_border 0 "if set to something else than 0 = override size of border around the background"
-seta hud_progressbar_strength_color "0 0 0.6" "R G B vector of the progress bar background color"
-seta hud_progressbar_shield_color "0.6 0 0.6" "R G B vector of the progress bar background color"
-
-seta hud_healtharmor 1 "enable/disable this panel"
-seta hud_healtharmor_pos "-0.627451 -0.066667" "position of this panel"
-seta hud_healtharmor_size "0.291174 0.066667" "size of this panel"
-seta hud_healtharmor_flip 1 "flip health/armor positions"
-seta hud_healtharmor_bg "" "if set to something else than \"\" = override default background, if set to 0 = disable background"
-seta hud_healtharmor_bg_color "" "optional R G B string of the background color, otherwise use hud default"
-seta hud_healtharmor_bg_alpha 0 "if set to something else than 0 = override default alpha"
-seta hud_healtharmor_bg_border 0 "if set to something else than 0 = override size of border around the background"
-seta hud_progressbar_health_color "0.6 0 0" "R G B vector of the progress bar background color"
-seta hud_progressbar_armor_color "0 0.6 0" "R G B vector of the progress bar background color"
-seta hud_progressbar_fuel_color "0.6 0.6 0" "R G B vector of the progress bar background color"
-
-seta hud_notify 0 "enable/disable this panel"
-seta hud_notify_pos "0.1 0" "position of this base of the panel"
-seta hud_notify_size "0.1 0.1" "size of this panel with all notifications on"
-seta hud_notify_bg "" "if set to something else than \"\" = override default background, if set to 0 = disable background"
-seta hud_notify_bg_color "" "optional R G B string of the background color, otherwise use hud default"
-seta hud_notify_bg_alpha 0 "if set to something else than 0 = override default alpha"
-seta hud_notify_bg_border 0 "if set to something else than 0 = override size of border around the background"
-
-seta hud_timer 1 "enable/disable this panel"
-seta hud_timer_pos "-0.213725 0" "position of this base of the panel"
-seta hud_timer_size "0.212735 0.054427" "size of this panel"
-seta hud_timer_increment 0 "show elapsed time instead of remaining time"
-seta hud_timer_bg border_oldhud "if set to something else than \"\" = override default background, if set to 0 = disable background"
-seta hud_timer_bg_color "" "optional R G B string of the background color, otherwise use hud default"
-seta hud_timer_bg_alpha 0 "if set to something else than 0 = override default alpha"
-seta hud_timer_bg_border 0 "if set to something else than 0 = override size of border around the background"
-
-seta hud_radar 1 "enable/disable this panel"
-seta hud_radar_pos "0 0" "position of this base of the panel"
-seta hud_radar_size "0.215687 0.266667" "size of this panel"
-seta hud_radar_bg "" "if set to something else than \"\" = override default background, if set to 0 = disable background"
-seta hud_radar_bg_color "" "optional R G B string of the background color, otherwise use hud default"
-seta hud_radar_bg_alpha 0 "if set to something else than 0 = override default alpha"
-seta hud_radar_bg_border 0 "if set to something else than 0 = override size of border around the background"
-
-seta hud_score 1 "enable/disable this panel"
-seta hud_score_pos "-0.225469 -0.084404" "position of this base of the panel"
-seta hud_score_size "0.225469 0.075156" "size of this panel"
-seta hud_score_bg "" "if set to something else than \"\" = override default background, if set to 0 = disable background"
-seta hud_score_bg_color "" "optional R G B string of the background color, otherwise use hud default"
-seta hud_score_bg_alpha 0 "if set to something else than 0 = override default alpha"
-seta hud_score_bg_border 0 "if set to something else than 0 = override size of border around the background"
-
-seta hud_racetimer 1 "enable/disable this panel"
-seta hud_racetimer_pos "-0.614706 0" "position of this base of the panel"
-seta hud_racetimer_size "0.231373 0.077124" "size of this panel"
-seta hud_racetimer_bg "" "if set to something else than \"\" = override default background, if set to 0 = disable background"
-seta hud_racetimer_bg_color "" "optional R G B string of the background color, otherwise use hud default"
-seta hud_racetimer_bg_alpha 0 "if set to something else than 0 = override default alpha"
-seta hud_racetimer_bg_border 0 "if set to something else than 0 = override size of border around the background"
-
-seta hud_vote 1 "enable/disable this panel"
-seta hud_vote_pos "-0.321140 -0.268230" "position of this base of the panel"
-seta hud_vote_size "0.320156 0.106719" "size of this panel"
-seta hud_vote_alreadyvoted_alpha 0.75 "alpha of the vote dialog after you have voted"
-seta hud_vote_bg "" "if set to something else than \"\" = override default background, if set to 0 = disable background"
-seta hud_vote_bg_color "" "optional R G B string of the background color, otherwise use hud default"
-seta hud_vote_bg_alpha 0 "if set to something else than 0 = override default alpha"
-seta hud_vote_bg_border 0 "if set to something else than 0 = override size of border around the background"
-
-seta hud_pressedkeys 1 "enable/disable this panel"
-seta hud_pressedkeys_pos "-0.571569 -0.265625" "position of this base of the panel"
-seta hud_pressedkeys_size "0.145098 0.114105" "size of this panel"
-seta hud_pressedkeys_bg "" "if set to something else than \"\" = override default background, if set to 0 = disable background"
-seta hud_pressedkeys_bg_color "" "optional R G B string of the background color, otherwise use hud default"
-seta hud_pressedkeys_bg_alpha 0 "if set to something else than 0 = override default alpha"
-seta hud_pressedkeys_bg_border 0 "if set to something else than 0 = override size of border around the background"
+seta hud_configure_bg_minalpha 0.25 "minimum panel background alpha when in hud configure mode"
+seta hud_configure_grid 1 "snap to grid when moving/resizing panels"
+seta hud_configure_grid_x 5 "snap each X pixels"
+seta hud_configure_grid_y 5 "snap each Y pixels"
+seta hud_configure_grid_alpha 0.15 "alpha for visible grid when in configure mode"
+
+seta sbar_info_pos 0 "Y-axis distance from lower right corner for engine info prints"
+
+exec hud_wickedhud_default.cfg
// scoreboard
+seta scoreboard_columns default
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 hud_fontsize_spec 16
seta scr_centersize 11
seta hud_width 560
-// alias hud_font "loadfont user1 ${1},gfx/fallback ${2-}; loadfont user2 ${1}-big ${2-}; hud_columns_set"
+// alias hud_font "loadfont user1 ${1},gfx/fallback ${2-}; loadfont user2 ${1}-big ${2-}; scoreboard_columns_set"
alias sbar_font "set _requested_sbar_font \"${*}\""
-seta hud_columns default
sbar_font gfx/vera-sans 8 12 16 24 32
seta hud_showbinds 1 "display actions / bound keys in the strings shown during the game. 0 displays only actions, 1 displays only bound keys, 2 displays both"
seta hud_showbinds_limit 2 "maximum number of bound keys to show for an action. 0 for unlimited"
// note: these cvars use weapon NUMBERS. Use the menu to edit this cvar, or look the numbers up in qcsrc/common/constants.qh.
seta cl_weaponpriority "minstanex rocketlauncher nex grenadelauncher fireball hlac hagar seeker crylink campingrifle uzi electro tuba shotgun laser hook porto" "weapon priority list"
-seta cl_weaponpriority_useforcycling 0 "when set, weapon cycling by the mouse wheel makes use of the weapon priority list"
+seta cl_weaponpriority_useforcycling 0 "when set, weapon cycling by the mouse wheel makes use of the weapon priority list (the special value 2 uses the weapon ID list for cycling)"
seta cl_weaponpriority0 "rocketlauncher grenadelauncher hagar seeker fireball" "use impulse 200 for prev gun from this list, 210 for best gun, 220 for next gun. Default value: explosives"
seta cl_weaponpriority1 "minstanex nex crylink hlac electro laser" "use impulse 201 for prev gun from this list, 211 for best gun, 221 for next gun. Default value: energy"
seta cl_weaponpriority2 "minstanex nex campingrifle" "use impulse 202 for prev gun from this list, 212 for best gun, 222 for next gun. Default value: hitscan exact"
seta sv_status_privacy 1 "hide IP addresses from \"status\" replies shown to clients"
-
-seta cl_teamradar 1 "show radar in teammatches when available"
-seta cl_teamradar_background_alpha 0 "set to -1 to disable"
-seta cl_teamradar_foreground_alpha 0.8 "alpha of the map"
-seta cl_teamradar_scale 4096 "distance you can see on the team radar"
-seta cl_teamradar_rotation 0 "rotation mode: you set what points up. 0 = player, 1 = west, 2 = south, 3 = east, 4 = north"
-seta cl_teamradar_size "128 128" "size of the team radar in pixels"
-seta cl_teamradar_position "1 0" "1 0 would be upper right corner, 0.5 0.5 the center, append a 2 at the end to disable the corner hack, and a 1 to disable half the hack"
-seta cl_teamradar_zoommode 0 "zoom mode: 0 = zoomed by default, 1 = zoomed when +zoom, 2 = always zoomed, 3 = always zoomed out"
-alias cl_teamradar_rotate "toggle cl_teamradar_rotation 0 1 2 3 4"
-
set g_maplist_allow_hidden 0 "allow hidden maps to be, e.g., voted for and in the maplist"
set g_maplist_allow_frustrating 0 "allow impossible maps to be, e.g., voted for and in the maplist (if set to 2, ONLY impossible maps are allowed)"
alias ons_map "cl_cmd radar" // legacy alias
alias radar "cl_cmd radar"
-alias hud_columns_set "cl_cmd hud_columns_set $*"
-alias hud_columns_help "cl_cmd hud_columns_help $*"
+alias scoreboard_columns_set "cl_cmd scoreboard_columns_set $*"
+alias scoreboard_columns_help "cl_cmd scoreboard_columns_help $*"
alias _gl_flashblend_update_00 "gl_flashblend 1"
alias _gl_flashblend_update_10 "gl_flashblend 0"
// must be at the bottom of this file:
// alias for switching the teamselect menu
alias menu_showteamselect "menu_cmd directmenu TeamSelect"
+alias menu_showhudexit "menu_cmd directmenu HUDExit"
+alias menu_showhudoptions "menu_cmd directpanelhudmenu $*"
alias menu_sync "menu_cmd sync"
bind f5 menu_showteamselect
set g_ballistics_materialconstant 1414213562
set g_ballistics_mindistance 16
+set g_ballistics_density_player 0.50 // players are 2x as easy to pass as walls
+set g_ballistics_density_corpse 0.10 // corpses are 10x as easy to pass as walls
// unit: qJ / qu^3 (energy needed per volume unit of solid to push/burn away
// parameter: bullet constant: mass / area in g/qu^2
// = mass / (pi/4 * caliber^2)
set sv_pitch_min -35 "minimum aiming angle for shooting direction display of the gun"
set sv_pitch_max 35 "maximum aiming angle for shooting direction display of the gun"
-set sv_pitch_fixyaw 1 "workaround to fix the aiming direction on stupidly made player models, FIXME fix the models and set this to 0"
+set sv_pitch_fixyaw 0 "workaround to fix the aiming direction on stupidly made player models, FIXME fix the models and set this to 0"
set rescan_pending 0 "set to 1 to schedule a fs_rescan at the end of this match"
// sucks less than the old one
cl_decals_newsystem 1
+
+// NOTE: this only replaces weapons on the map
+// use g_start_weapon_* to also replace the on-startup weapons!
+// example: g_weaponreplace_nex "nex minstanex", then Nexes become MinstaNexes 50% of the times
+// set the cvars to "0" to totally disable a weapon
+set g_weaponreplace_laser ""
+set g_weaponreplace_shotgun ""
+set g_weaponreplace_uzi ""
+set g_weaponreplace_grenadelauncher ""
+set g_weaponreplace_electro ""
+set g_weaponreplace_crylink ""
+set g_weaponreplace_nex ""
+set g_weaponreplace_hagar ""
+set g_weaponreplace_rocketlauncher ""
+set g_weaponreplace_porto ""
+set g_weaponreplace_minstanex ""
+set g_weaponreplace_hook ""
+set g_weaponreplace_hlac ""
+set g_weaponreplace_campingrifle ""
+set g_weaponreplace_tuba ""
+set g_weaponreplace_fireball ""
+set g_weaponreplace_seeker ""
+set sv_q3acompat_machineshotgunswap 0 "shorthand for swapping uzi and shotgun (for Q3A map compatibility in mapinfo files)"
+
+set g_movement_highspeed 1 "movement speed modification factor (only changes movement when above maxspeed)"
lightcolor 0.4 0.9 0.9
// cloud of particles which expand rapidly and then slow to form a ball
effect TE_WIZSPIKE
-count 100
+count 50
type static
color 0x63F2EA 0x63f2EA
size 2 2
size 24 24
// sparks that rapidly expand and rapidly slow down to form an interesting spherical effect
effect TE_KNIGHTSPIKE
-count 256
+count 128
type spark
color 0x800000 0xFF8020
alpha 256 256 1024
originjitter 6 6 6
// dust/smoke drifting away from the impact
effect TE_SPIKE
-count 8
+count 4
type smoke
tex 0 8
color 0x101010 0x101010
velocityjitter 8 8 8
// dust/smoke staying at the impact
effect TE_SPIKE
-count 1
+count 0.5
type smoke
tex 0 8
color 0x505050 0x505050
velocityjitter 0 0 0
// bouncing sparks
effect TE_SPIKE
-count 20
+count 10
type spark
color 0x8f4333 0xfff31b
size 0.4 0.4
alpha 256 256 128
// large sparks
effect TE_SPIKEQUAD
-count 20
+count 10
type static
color 0x2030FF 0x80C0FF
size 32 32
originjitter 6 6 6
// dust/smoke drifting away from the impact
effect TE_SUPERSPIKE
-count 8
+count 4
type smoke
tex 0 8
color 0x101010 0x101010
velocityjitter 8 8 8
// dust/smoke staying at the impact
effect TE_SUPERSPIKE
-count 1
+count 0.5
type smoke
tex 0 8
color 0x505050 0x505050
velocityjitter 0 0 0
// sparks that disappear on impact
effect TE_SUPERSPIKE
-count 30
+count 15
type spark
color 0x8f4333 0xfff31b
size 0.4 0.4
lightcolor 0.15 0.15 1.5
// dust/smoke drifting away from the impact
effect TE_SUPERSPIKEQUAD
-count 8
+count 4
type smoke
tex 0 8
color 0x101010 0x101010
velocityjitter 8 8 8
// dust/smoke staying at the impact
effect TE_SUPERSPIKEQUAD
-count 1
+count 0.5
type smoke
tex 0 8
color 0x505050 0x505050
velocityjitter 0 0 0
// sparks that disappear on impact
effect TE_SUPERSPIKEQUAD
-count 30
+count 15
type spark
color 0x8f4333 0xfff31b
size 0.4 0.4
originjitter 6 6 6
// dust/smoke drifting away from the impact
effect TE_GUNSHOT
-count 4
+count 2
type smoke
tex 0 8
color 0x101010 0x101010
velocityjitter 8 8 8
// dust/smoke staying at the impact
effect TE_GUNSHOT
-count 1
+count 0.5
type smoke
tex 0 8
color 0x505050 0x505050
velocityjitter 0 0 0
// bouncing sparks
effect TE_GUNSHOT
-count 10
+count 5
type spark
color 0x8f4333 0xfff31b
size 0.4 0.4
alpha 256 256 512
// purple sparks
effect TE_GUNSHOTQUAD
-count 12
+count 6
type spark
color 0xA040C0 0xFFFFFF
size 1 1
// fire effect which expands then slows
effect TE_EXPLOSION
notunderwater
-count 128
+count 64
type static
tex 48 55
color 0x902010 0xFFD080
// underwater bubbles
effect TE_EXPLOSION
underwater
-count 32
+count 16
type bubble
tex 62 62
color 0x404040 0x808080
// bouncing sparks
effect TE_EXPLOSION
notunderwater
-count 32
+count 16
type spark
color 0x903010 0xFFD030
size 2 2
// smoke cloud
effect TE_EXPLOSIONQUAD
notunderwater
-count 32
+count 16
type smoke
color 0x202020 0x404040
tex 0 8
// underwater bubbles
effect TE_EXPLOSIONQUAD
underwater
-count 32
+count 16
type bubble
tex 62 62
color 0x404040 0x808080
// sparks which go through walls
effect TE_EXPLOSIONQUAD
notunderwater
-count 128
+count 64
type spark
color 0x903010 0xFFD030
size 1 1
// smoke cloud
effect TE_TAREXPLOSION
notunderwater
-count 32
+count 16
type smoke
color 0x202020 0x404040
tex 0 8
// underwater bubbles
effect TE_TAREXPLOSION
underwater
-count 32
+count 16
type bubble
tex 62 62
color 0x404040 0x808080
// sparks which go through walls
effect TE_TAREXPLOSION
notunderwater
-count 128
+count 64
type spark
color 0x903010 0xFFD030
size 1 1
// bloody impact effect indicating damage
// used nowhere in code
effect TE_BLOOD
-count 0.333
+count 0.167
type blood
tex 24 32
size 8 8
// used in qcsrc/server/antilag.qc: te_spark(antilag_takebackorigin(e, time - e.antilag_debug), '0 0 0', 32)
// used in qcsrc/server/g_triggers.qc: self.mdl = "TE_SPARK"
effect TE_SPARK
-count 1
+count 0.5
type spark
tex 40 40
color 0x8f4333 0xfff31b
alpha 256 256 512
// small sparks which form a sphere as they slow down
effect TE_PLASMABURN
-count 256
+count 128
type spark
color 0x2030FF 0x80C0FF
size 1 2
// quake effect
// used nowhere in code
effect TE_FLAMEJET
-count 1
+count 0.5
type smoke
color 0x6f0f00 0xe3974f
size 4 4
// quake effect
// used nowhere in code
effect TE_LAVASPLASH
-count 64
+count 32
type alphastatic
color 0x6f0f00 0xe3974f
size 12 12
// player teleport effect
// used nowhere in code
effect TE_TELEPORT
-count 112
+count 56
type static
color 0xA0A0A0 0xFFFFFF
size 10 10
alpha 128 128 256
// experimental
effect TE_TEI_G3
-trailspacing 2
+trailspacing 4
type static
color 0x202020 0x404040
size 1 1
// smoke effect
// used nowhere in code
effect TE_TEI_SMOKE
-count 0.333
+count 0.167
type smoke
color 0x202020 0x404040
tex 0 8
// fire effect
effect TE_TEI_BIGEXPLOSION
notunderwater
-count 256
+count 128
type static
tex 48 55
color 0x902010 0xFFD080
// underwater bubbles
effect TE_TEI_BIGEXPLOSION
underwater
-count 64
+count 32
type bubble
tex 62 62
color 0x404040 0x808080
// bouncing sparks
effect TE_TEI_BIGEXPLOSION
notunderwater
-count 128
+count 64
type spark
color 0x903010 0xFFD030
size 2 2
alpha 256 256 512
// cloud of bouncing sparks
effect TE_TEI_PLASMAHIT
-count 1
+count 0.5
type spark
color 0x2030FF 0x80C0FF
size 2 4
// used in qcsrc/client/gibs.qc: pointparticles(particleeffectnum("blood"), self.origin + '0 0 1', '0 0 30', 10)
// used in qcsrc/client/gibs.qc: pointparticles(particleeffectnum("blood"), org, vel, amount * 16)
effect blood
-count 0.333
+count 0.167
type blood
tex 24 32
size 3 8
// used in qcsrc/server/t_teleporters.qc: pointparticles(particleeffectnum("teleport"), player.origin, '0 0 0', 1)
// used in qcsrc/server/t_teleporters.qc: pointparticles(particleeffectnum("teleport"), to + v_forward * 32, '0 0 0', 1)
effect teleport
-count 1000
+count 500
type spark
tex 64 64
color 0xff8400 0xff2a00
// normal super gory blood trail (used by gibs)
// used in qcsrc/client/gibs.qc: trailparticles(self, particleeffectnum("TR_BLOOD"), oldorg, self.origin)
effect TR_BLOOD
-trailspacing 16
+trailspacing 32
type blood
color 0xA8FFFF 0xA8FFFF
tex 24 32
// thinner blood trail (used by quake zombies)
// used in qcsrc/client/gibs.qc: trailparticles(self, particleeffectnum("TR_SLIGHTBLOOD"), oldorg, self.origin)
effect TR_SLIGHTBLOOD
-trailspacing 32
+trailspacing 64
type blood
color 0xA8FFFF 0xA8FFFF
tex 24 32
// used in qcsrc/server/g_triggers.qc: self.effects = EF_STARDUST
// used in qcsrc/server/portals.qc: portal.effects = EF_STARDUST | EF_BLUE
effect EF_STARDUST
-count 75
+count 37.5
type static
color 0xfff368 0xfff368
size 1.0 2.0
alpha 128 128 128
// cloud of particles which expand rapidly and then slow to form a ball
effect item_respawn
-count 256
+count 128
type spark
tex 41 41
color 0x63F2EA 0x63f2EA
lightcolor 3 0.1 0.1
// electricity
effect laser_muzzleflash
-count 6
+count 3
type spark
color 0xb44215 0xff0000
tex 43 43
rotate -180 180 4000 -4000
// fire
effect laser_muzzleflash
-count 12
+count 6
type spark
color 0xff4200 0xff0000
tex 8 15
size 24 24
// sparks that rapidly expand and rapidly slow down to form an interesting spherical effect
effect laser_impact
-count 256
+count 128
type spark
color 0x800000 0xFF8020
alpha 256 256 1024
//originjitter 32 32 32
velocityjitter 256 256 256
effect laser_impact
-count 8
+count 4
type smoke
tex 48 55
color 0x800000 0xFF8020
// used in qcsrc/server/w_shotgun.qc: pointparticles(particleeffectnum("shotgun_muzzleflash"), w_shotorg, w_shotdir * 1000, cvar("g_balance_shotgun_primary_ammo"))
// used in qcsrc/server/w_shotgun.qc: pointparticles(particleeffectnum("shotgun_muzzleflash"), w_shotorg, w_shotdir * 1000, cvar("g_balance_shotgun_secondary_ammo"))
effect shotgun_muzzleflash
-count 3
+count 1.5
type smoke
color 0x202020 0x404040
tex 0 8
sizeincrease 12
velocitymultiplier 0.05
effect shotgun_muzzleflash
-count 32
+count 16
type spark
tex 48 55
color 0xffdb96 0xff5400
type alphastatic
notunderwater
tex 0 8
-count 6
+count 3
size 10 20
sizeincrease 25
alpha 300 550 756
type alphastatic
notunderwater
tex 36 36
-count 1
+count 0.5
size 10 11
sizeincrease 74
alpha 200 350 500
// sparks
effect shotgun_impact
notunderwater
-count 3
+count 1.5
type spark
tex 40 40
color 0xFDFFD9 0xFDFFD9
// used in qcsrc/server/w_uzi.qc: pointparticles(particleeffectnum("uzi_muzzleflash"), w_shotorg, w_shotdir * 1000, 1)
effect uzi_muzzleflash
-count 2
+count 1
type static
color 0x202020 0x404040
tex 0 8
lightcolor 2 1.5 0.2
gravity -0.1
effect uzi_muzzleflash
-count 20
+count 10
type spark
tex 40 40
color 0xFFFDD9 0xFFFDD9
type alphastatic
notunderwater
tex 0 8
-count 6
+count 3
size 10 20
sizeincrease 15
alpha 300 550 456
type alphastatic
notunderwater
tex 36 36
-count 1
+count 0.5
size 10 11
sizeincrease 74
alpha 200 350 500
type alphastatic
notunderwater
tex 66 68
-count 2
+count 1
size 1 5
airfriction 1
gravity 1.4
// sparks
effect machinegun_impact
notunderwater
-count 2
+count 1
type spark
tex 40 40
color 0xFDFFD9 0xFDFFD9
// used in qcsrc/server/w_grenadelauncher.qc: pointparticles(particleeffectnum("grenadelauncher_muzzleflash"), w_shotorg, w_shotdir * 1000, 1)
// used in qcsrc/server/w_porto.qc: //pointparticles(particleeffectnum("grenadelauncher_muzzleflash"), w_shotorg, w_shotdir * 1000, 1)
effect grenadelauncher_muzzleflash
-count 3
+count 1.5
type smoke
color 0x202020 0x404040
tex 0 8
lightradiusfade 2000
lightcolor 2 1.5 0.2
effect grenadelauncher_muzzleflash
-count 32
+count 16
type spark
tex 48 55
color 0xffdb96 0xff5400
// used in qcsrc/client/projectile.qc: trailparticles(self, particleeffectnum("TR_GRENADE"), from, to)
// used in qcsrc/client/projectile.qc: trailparticles(self, particleeffectnum("TR_GRENADE"), from, to)
effect TR_GRENADE
-trailspacing 2
+trailspacing 4
type smoke
color 0x101010 0x000000
tex 0 8
// fire
effect TR_GRENADE
notunderwater
-trailspacing 2
+trailspacing 4
type static
color 0xffdf72 0x811200
tex 48 55
// bubbles
effect TR_GRENADE
underwater
-trailspacing 8
+trailspacing 16
type bubble
tex 62 62
color 0x404040 0x808080
// used in qcsrc/client/projectile.qc: trailparticles(self, particleeffectnum("TR_KNIGHTSPIKE"), from, to)
effect TR_KNIGHTSPIKE // used for MF_TRACER2
notunderwater
-trailspacing 3
+trailspacing 6
type smoke
color 0x303030 0x000000
tex 0 8
tex 62 62
size 1 1
sizeincrease -0.1
-trailspacing 1
+trailspacing 2
alpha 256 256 720
// bubbles
effect TR_KNIGHTSPIKE // used for MF_TRACER2
underwater
-trailspacing 16
+trailspacing 32
type bubble
tex 62 62
color 0x404040 0x808080
// fire effect which expands then slows
effect grenade_explode
notunderwater
-count 80
+count 40
type static
tex 48 55
color 0xe03f00 0x5e0000
// fire effect which make brigt dot inside
effect grenade_explode
notunderwater
-count 30
+count 15
type static
tex 48 55
color 0xe03f00 0xffdf92
type alphastatic
notunderwater
tex 0 8
-count 20
+count 10
size 20 40
sizeincrease 34
alpha 300 550 556
// underwater bubbles
effect grenade_explode
underwater
-count 64
+count 32
type bubble
tex 62 62
color 0x404040 0x808080
// bouncing sparks
effect grenade_explode
notunderwater
-count 32
+count 16
type spark
tex 40 40
color 0xffa35b 0xfff2be
// derbis
effect grenade_explode
notunderwater
-count 24
+count 12
type alphastatic
tex 66 68
color 0x6a3d25 0xcac5b4
lightcolor 1.5 3 6
effect electro_muzzleflash
-count 14
+count 7
type spark
tex 8 15
color 0xD9FDFF 0xD9FDFF
stretchfactor 1.5
effect electro_muzzleflash
-count 10
+count 5
type spark
tex 41 41
color 0xD9FDFF 0xD9FDFF
// glowing vapor trail
// used in qcsrc/client/projectile.qc: trailparticles(self, particleeffectnum("TR_NEXUIZPLASMA"), from, to)
effect TR_NEXUIZPLASMA
-trailspacing 1
+trailspacing 2
type static
color 0x283880 0x283880
size 3 3
velocitymultiplier -0.1
// bright sparks
effect TR_NEXUIZPLASMA
-trailspacing 6
-count 3
+trailspacing 12
+count 1.5
type snow
tex 42 42
color 0x629dff 0x0018ff
alpha 256 256 512
// cloud of bouncing sparks
effect electro_impact
-count 60
+count 30
type smoke
tex 42 42
color 0x629dff 0x0018ff
rotate -180 180 -9999 9999
// inner cloud of smoke
effect electro_impact
-count 60
+count 30
type smoke
color 0x629dff 0x0018ff
tex 0 8
alpha 256 256 512
// cloud of bouncing sparks
effect electro_ballexplode
-count 128
+count 64
type spark
tex 41 41
color 0xFDFFD9 0xFDFFD9
velocityjitter 512 512 512
// inner cloud of smoke
effect electro_ballexplode
-count 16
+count 8
type smoke
color 0x202020 0x404040
tex 0 8
alpha 128 128 64
// large sparks
effect electro_combo
-count 10
+count 5
type static
color 0x2030FF 0x80C0FF
size 32 32
//velocityoffset 0 0 120
velocityjitter 512 512 512
effect electro_combo
-count 64
+count 32
type spark
tex 41 41
color 0xa9cacf 0x0054ff
velocityjitter 312 312 312
// inner cloud of smoke
effect electro_combo
-count 0.25
+count 0.125
type smoke
color 0x202020 0x404040
tex 0 8
// used in qcsrc/server/w_crylink.qc: pointparticles(particleeffectnum("crylink_muzzleflash"), w_shotorg, w_shotdir * 1000, shots)
// used in qcsrc/server/w_crylink.qc: pointparticles(particleeffectnum("crylink_muzzleflash"), w_shotorg, w_shotdir * 1000, shots)
effect crylink_muzzleflash
-count 1
+count 0.5
type smoke
color 0xdd9cff 0xff0090
tex 65 65
lightradiusfade 2000
lightcolor 1.6 0.2 2
effect crylink_muzzleflash
-count 10
+count 5
type spark
tex 35 36
color 0xA080C0 0xA080C0
alpha 256 256 512
// purple sparks
effect crylink_impact
-count 20
+count 10
type spark
tex 41 41
color 0xA040C0 0xA040C0
velocityjitter 256 256 256
// purple splash
effect crylink_impact
-count 3
+count 1.5
type static
color 0xE070FF 0xE070FF
size 8 8
velocityjitter 8 8 8
// purple splash
effect crylink_impact
-count 3
+count 1.5
type static
color 0xE070FF 0xE070FF
size 8 8
// used in qcsrc/server/w_minstanex.qc: pointparticles(particleeffectnum("nex_muzzleflash"), w_shotorg, w_shotdir * 1000, 1)
// used in qcsrc/client/particles.qc: pointparticles(particleeffectnum("nex_muzzleflash"), shotorg, normalize(endpos - shotorg) * 1000, 1)
effect nex_muzzleflash
-count 24
+count 12
type spark
color 0x202020 0x0072ff
tex 48 55
lightradiusfade 200
lightcolor 2 2.5 3
effect nex_muzzleflash
-count 100
+count 50
type spark
tex 41 41
color 0xD9FDFF 0xD9FDFF
// nex beam: ring smoke
// used in qcsrc/client/particles.qc: trailparticles(world, particleeffectnum("nex_beam"), shotorg, endpos)
effect nex_beam
-trailspacing 32
+trailspacing 64
color 0x1680A0 0x1680A0
size 4 4
tex 32 32
type static
// nex beam: drifting smoke
effect nex_beam
-trailspacing 6
+trailspacing 12
color 0x5080A0 0x5080A0
size 1 1
tex 0 8
type static
// nex beam: bright core
effect nex_beam
-trailspacing 6
+trailspacing 12
color 0x80CDFF 0x80CDFF
size 4 4
//tex 48 55
type static
//sparks
effect nex_beam
-trailspacing 8
+trailspacing 16
color 0x1680A0 0x1680A0
size 1 1
tex 63 63
rotate -180 180 0 0
// rotating something
effect nex_impact
-count 10
+count 5
type smoke
tex 46 46
color 0x1680A0 0x1680A0
//velocityjitter 384 384 384
// small sparks which glow brightly but live briefly
effect nex_impact
-count 128
+count 64
type spark
tex 41 41
color 0xD9FDFF 0xD9FDFF
airfriction 9
// small sparks that live longer
effect nex_impact
-count 32
+count 16
type spark
tex 41 41
color 0xD9FDFF 0xD9FDFF
// used in qcsrc/server/w_hagar.qc: pointparticles(particleeffectnum("hagar_muzzleflash"), w_shotorg, w_shotdir * 1000, 1)
// used in qcsrc/server/w_seeker.qc: pointparticles(particleeffectnum("hagar_muzzleflash"), w_shotorg, w_shotdir * 1000, 1)
effect hagar_muzzleflash
-count 4
+count 2
type smoke
color 0x202020 0x404040
tex 0 8
lightradiusfade 2000
lightcolor 2 1.5 0.2
effect hagar_muzzleflash
-count 30
+count 15
type spark
tex 48 55
color 0xff8400 0xff4200
// used in qcsrc/server/w_hagar.qc: pointparticles(particleeffectnum("hagar_bounce"), self.origin, self.velocity, 1)
effect hagar_bounce
-count 4
+count 2
type smoke
color 0x202020 0x404040
tex 0 8
lightradiusfade 300
lightcolor 2 1.5 0.2
effect hagar_bounce
-count 30
+count 15
type spark
tex 40 40
color 0xFFFDD9 0xFFFDD9
// fire effect which make bright dot inside
effect hagar_explode
notunderwater
-count 10
+count 5
type smoke
tex 48 55
color 0xffe955 0xff5a00
// fire effect which expands then slows
effect hagar_explode
notunderwater
-count 24
+count 12
type static
tex 48 55
color 0x8f0d00 0xff5a00
type alphastatic
notunderwater
tex 0 8
-count 20
+count 10
size 20 40
sizeincrease 20
alpha 200 500 600
// underwater bubbles
effect hagar_explode
underwater
-count 32
+count 16
type bubble
tex 62 62
color 0x404040 0x808080
// bouncing sparks
effect hagar_explode
notunderwater
-count 8
+count 4
type spark
tex 40 40
color 0xffa35b 0xfff2be
// used in qcsrc/server/w_rocketlauncher.qc: pointparticles(particleeffectnum("rocketlauncher_muzzleflash"), w_shotorg, w_shotdir * 1000, 1)
effect rocketlauncher_muzzleflash
-count 20
+count 10
type smoke
color 0x202020 0x404040
tex 0 8
//lightradiusfade 2000
//lightcolor 2 1.5 0.2
effect rocketlauncher_muzzleflash
-count 12
+count 6
type smoke
tex 35 36
color 0xFFFDD9 0xFFFDD9
// used in qcsrc/client/projectile.qc: trailparticles(self, particleeffectnum("TR_ROCKET"), from, to)
// used in qcsrc/client/projectile.qc: trailparticles(self, particleeffectnum("TR_ROCKET"), from, to)
effect TR_ROCKET
-trailspacing 5
+trailspacing 10
type smoke
notunderwater
color 0x000000 0x666666
//gravity -0.11
// fire
effect TR_ROCKET
-trailspacing 2
+trailspacing 4
type static
color 0xffdf72 0x811200
tex 48 55
effect TR_ROCKET
type bubble
underwater
-trailspacing 8
+trailspacing 16
tex 62 62
size 1 2
alpha 256 256 256
// sparks
effect TR_ROCKET
notunderwater
-trailspacing 10
+trailspacing 20
type spark
tex 40 40
color 0xFFFDD9 0xFFFDD9
// fire effect
effect rocket_explode
notunderwater
-count 64
+count 32
type static
tex 48 55
color 0x8f0d00 0xff5a00
// fire effect 2
effect rocket_explode
notunderwater
-count 28
+count 14
type smoke
tex 48 55
color 0xea691b 0xeed05a
type alphastatic
notunderwater
tex 0 8
-count 64
+count 32
size 20 40
sizeincrease 44
alpha 200 450 456
// underwater bubbles
effect rocket_explode
underwater
-count 64
+count 32
type bubble
tex 62 62
color 0x404040 0x808080
// bouncing sparks
effect rocket_explode
notunderwater
-count 32
+count 16
type spark
tex 40 40
color 0xffa35b 0xfff2be
// derbis
effect rocket_explode
notunderwater
-count 24
+count 12
type alphastatic
tex 66 68
color 0x6a3d25 0xcac5b4
// used nowhere in code
effect nex242_misc_laser_beam_end
-count 1
+count 0.5
type spark
color 0x8f4333 0xfff31b
size 0.4 0.4
// used nowhere in code
effect nex242_misc_laser_beam_fast_end
-count 1
+count 0.5
type spark
color 0x8f4333 0xfff31b
size 0.4 0.4
// used nowhere in code
effect nex242_misc_laser_green_beam_end
-count 1
+count 0.5
type spark
color 0x8f4333 0xfff31b
size 0.4 0.4
// used nowhere in code
effect nex242_misc_laser_blue_beam_end
-count 1
+count 0.5
type spark
color 0x8f4333 0xfff31b
size 0.4 0.4
// used nowhere in code
effect nex242_misc_laser_yellow_beam_end
-count 1
+count 0.5
type spark
color 0x8f4333 0xfff31b
size 0.4 0.4
// used nowhere in code
effect nex242_misc_laser_cyan_beam_end
-count 1
+count 0.5
type spark
color 0x8f4333 0xfff31b
size 0.4 0.4
// used nowhere in code
effect nex242_misc_laser_magenta_beam_end
-count 1
+count 0.5
type spark
color 0x8f4333 0xfff31b
size 0.4 0.4
// used nowhere in code
effect nex242_misc_laser_white_beam_end
-count 1
+count 0.5
type spark
color 0x8f4333 0xfff31b
size 0.4 0.4
// used nowhere in code
effect nex242_misc_laser_black_beam_end
-count 1
+count 0.5
type spark
color 0x8f4333 0xfff31b
size 0.4 0.4
// used nowhere in code
effect nex242_misc_laser_orange_beam_end
-count 1
+count 0.5
type spark
color 0x8f4333 0xfff31b
size 0.4 0.4
alpha 256 256 512
// purple sparks
effect crylink_impactbig
-count 80
+count 40
type spark
tex 41 41
color 0xA040C0 0xA040C0
velocityjitter 512 512 512
// purple splash
effect crylink_impactbig
-count 3
+count 1.5
type static
color 0xE070FF 0xE070FF
size 16 16
velocityjitter 32 32 32
// purple splash
effect crylink_impactbig
-count 6
+count 3
type static
color 0xE070FF 0xE070FF
size 16 16
// used in qcsrc/client/gibs.qc: pointparticles(particleeffectnum("damage_hit"), org, vel, amount * 16)
effect damage_hit
tex 48 55
-count 1
+count 0.5
type alphastatic
color 0x00FFFF 0xFF00FF
size 16 16
velocityjitter 256 256 256
effect damage_hit
tex 48 55
-count 1
+count 0.5
type alphastatic
color 0xFF00FF 0xFFFF00
size 16 16
velocityjitter 256 256 256
effect damage_hit
tex 48 55
-count 1
+count 0.5
type alphastatic
color 0xFFFF00 0x00FFFF
size 16 16
// used in qcsrc/client/gibs.qc: pointparticles(particleeffectnum("damage_dissolve"), org, vel, amount)
effect damage_dissolve
tex 48 55
-count 30
+count 15
type alphastatic
color 0x00FFFF 0xFF00FF
size 32 32
velocityjitter 512 512 512
effect damage_dissolve
tex 48 55
-count 30
+count 15
type alphastatic
color 0xFF00FF 0xFFFF00
size 32 32
velocityjitter 512 512 512
effect damage_dissolve
tex 48 55
-count 30
+count 15
type alphastatic
color 0xFFFF00 0x00FFFF
size 32 32
originjitter 6 6 6
// dust/smoke drifting away from the impact
effect laser_deadly
-count 0.05 // 50 per second
+count 0.025
type smoke
tex 48 55
color 0xFFFFFF 0xFFFFFF
// sparks
effect laser_deadly
notunderwater
-count 0.05 // 50 per second
+count 0.025
type spark
tex 40 40
color 0xFDFFD9 0xFDFFD9
// used nowhere in code
effect torch_small
//notunderwater
-count 16
+count 8
type smoke
tex 48 55
size 1 11
// smoke
effect torch_small
type alphastatic
-count 8
+count 4
tex 0 8
size 5 10
sizeincrease 5
//fountain01
// used nowhere in code
effect fountain01
-count 32
+count 16
tex 0 8
size 10 15
alpha 0 100 100
// decal
// used in qcsrc/client/damage.qc: pointparticles(particleeffectnum("hookbomb_explode"), org2, '0 0 0', 1)
effect hookbomb_explode
-count 50
+count 25
type static
tex 38 38
color 0x807aff 0x4463d5
originjitter 6 6 6
// some sparks
effect hookbomb_explode
-count 60
+count 30
type spark
tex 38 38
color 0x807aff 0x4463d5
// smoke
effect EF_MGTURRETTRAIL
notunderwater
-trailspacing 5
+trailspacing 10
type smoke
color 0xd0d0a0 0xffffff
tex 0 8
// bubbles
effect EF_MGTURRETTRAIL
underwater
-trailspacing 16
+trailspacing 32
type bubble
tex 62 62
color 0x404040 0x808080
// used nowhere in code
effect fire_big
//notunderwater
-count 52
+count 26
type smoke
tex 48 55
size 11 31
// smoke
effect fire_big
type alphastatic
-count 22
+count 11
tex 0 8
size 22 33
sizeincrease 11
// used nowhere in code
effect red_flare
type alphastatic
-count 21
+count 10.5
tex 0 8
size 1 11
sizeincrease 11
// used nowhere in code
effect blue_flare
type alphastatic
-count 21
+count 10.5
tex 0 8
size 1 11
sizeincrease 11
// used in qcsrc/server/ctf.qc: pointparticles(particleeffectnum("smoke_ring"), 0.5 * (self.absmin + self.absmax), '0 0 0', 1);
effect smoke_ring
type smoke
-count 90
+count 45
tex 0 8
size 1 11
sizeincrease 21
// used nowhere in code
effect smoke_large
type alphastatic
-count 50
+count 25
tex 0 8
size 11 21
sizeincrease 21
//sparks
// used nowhere in code
effect sparks
-count 30
+count 15
type spark
tex 40 40
color 0xFFFDD9 0xFFFDD9
//sparks
// used nowhere in code
effect electricity_sparks
-count 70
+count 35
type spark
tex 40 40
color 0x807aff 0x4463d5
// used nowhere in code
effect steam
type smoke
-count 2
+count 1
tex 0 8
size 1 3
sizeincrease 7
// smoke emiter
// used nowhere in code
effect smoking
-count 20
+count 10
type alphastatic
tex 0 8
color 0x292929 0x000000
//golden dust (create it once per second to cover large area in small yellow particles)
// used nowhere in code
effect goldendust
-count 50
+count 25
type snow
tex 38 38
color 0xff9600 0xffefb8
// used nowhere in code
effect healing_fx
-count 50
+count 25
type spark
tex 40 40
color 0xff0000 0xff0000
// used nowhere in code
effect armorrepair_fx
-count 50
+count 25
type spark
tex 40 40
color 0x00ff00 0x00ff00
// used nowhere in code
effect ammoregen_fx
-count 50
+count 25
type spark
tex 40 40
color 0x0000ff 0x0000ff
// red-yellow flame like fx
// used nowhere in code
effect rage
-count 5
+count 2.5
type smoke
tex 35 36
color 0xff0000 0xff7800
// pieces of glass or ice falling on the floor
// used nowhere in code
effect iceorglass
-count 30
+count 15
type alphastatic
tex 44 44
color 0xffffff 0xb2d3e6
// cover small area in poison gas, spawn it once per second
// used nowhere in code
effect poisonfield
-count 30
+count 15
type smoke
tex 0 8
color 0x00ff00 0x7db843
// cover small area in icy mist, spawn it once per second
// used nowhere in code
effect icefield
-count 20
+count 10
type smoke
tex 0 8
color 0x008aff 0x75e7ff
velocityjitter 5 5 30
airfriction 1
effect icefield
-count 10
+count 5
type smoke
tex 48 55
size 1 1
// flames that go up
// used nowhere in code
effect firefield
-count 200
+count 100
type smoke
tex 48 55
color 0x8f0d00 0xff5a00
airfriction 1
//flames that stay on the ground
effect firefield
-count 100
+count 50
type smoke
tex 48 55
color 0x8f0d00 0xff5a00
originjitter 180 180 0
// smoke
effect firefield
-count 40
+count 20
type alphastatic
tex 0 8
size 1 1
//fast fire
// used nowhere in code
effect flamethrower
-count 6
+count 3
type smoke
tex 48 55
color 0x8f0d00 0xff5a00
airfriction 1.2
//slowfire
effect flamethrower
-count 5
+count 2.5
type smoke
tex 48 55
color 0x8f0d00 0xff5a00
airfriction 1.2
// very slow and small fire
effect flamethrower
-count 3
+count 1.5
type smoke
tex 48 55
color 0x8f0d00 0xff5a00
airfriction 0.3
//decreasing fire
effect flamethrower
-count 4
+count 2
type smoke
tex 48 55
color 0x8f0d00 0xff5a00
airfriction 0.3
//smoke
effect flamethrower
-count 1
+count 0.5
type alphastatic
tex 0 8
size 5 15
// used in qcsrc/client/projectile.qc: trailparticles(self, particleeffectnum("TR_WIZSPIKE"), from, to)
// used in qcsrc/client/projectile.qc: trailparticles(self, particleeffectnum("TR_WIZSPIKE"), from, to)
effect TR_WIZSPIKE
-trailspacing 2
+trailspacing 4
type static
color 0x404040 0x404040
size 3 3
velocitymultiplier -0.1
// bright sparks
effect TR_WIZSPIKE
-trailspacing 6
-count 3
+trailspacing 12
+count 1.5
type snow
tex 42 42
color 0x404040 0x404040
// used in qcsrc/client/projectile.qc: trailparticles(self, particleeffectnum("TR_VORESPIKE"), from, to)
// used in qcsrc/client/projectile.qc: trailparticles(self, particleeffectnum("TR_VORESPIKE"), from, to)
effect TR_VORESPIKE
-trailspacing 2
+trailspacing 4
type static
color 0x804000 0x804000
size 3 3
velocitymultiplier -0.1
// bright sparks
effect TR_VORESPIKE
-trailspacing 6
-count 3
+trailspacing 12
+count 1.5
type snow
tex 42 42
color 0xff8000 0xff8000
// fire effect which make bright dot inside
effect flac_explode
notunderwater
-count 6
+count 3
type smoke
tex 48 55
color 0xffe955 0xff5a00
// fire effect which expands then slows
effect flac_explode
notunderwater
-count 12
+count 6
type static
tex 48 55
color 0x8f0d00 0xff5a00
type alphastatic
notunderwater
tex 0 8
-count 10
+count 5
size 10 20
sizeincrease 20
alpha 500 600 556
// underwater bubbles
effect flac_explode
underwater
-count 16
+count 8
type bubble
tex 62 62
color 0x404040 0x808080
// bouncing sparks
effect flac_explode
notunderwater
-count 8
+count 4
type spark
color 0x903010 0xFFD030
size 2 2
// used in qcsrc/server/w_common.qc: zcurveparticles_from_tracetoss(particleeffectnum("tr_bullet"), self.origin, trace_endpos, self.velocity)
// used in qcsrc/client/projectile.qc: trailparticles(self, particleeffectnum("tr_bullet"), from, to)
effect tr_bullet
-trailspacing 128
+trailspacing 256
type spark
color 0x800000 0xFF8020
alpha 256 256 2560
// smoke emitter for small pipes
// used nowhere in code
effect smoking_smallemitter
-count 20
+count 10
type alphastatic
tex 0 8
color 0x292929 0x000000
// used in qcsrc/client/projectile.qc: trailparticles(self, particleeffectnum("TR_CRYLINKPLASMA"), from, to)
// used in qcsrc/client/projectile.qc: trailparticles(self, particleeffectnum("TR_CRYLINKPLASMA"), from, to)
effect TR_CRYLINKPLASMA
-trailspacing 64
+trailspacing 128
type static
color 0x5522aa 0x6622ff
size 2 2
velocitymultiplier -0.01
// crylink main trail
effect TR_CRYLINKPLASMA
-trailspacing 8
+trailspacing 16
type static
color 0x5522aa 0x6622ff
size 3 3
velocitymultiplier 0.01
effect cherryblossom
-count 3
+count 1.5
type static
color 0xb123ff 0xb183ff
size 1.5 2
//lighttime 0
effect alien_blood
-count 0.333
+count 0.167
type blood
tex 24 32
size 3 8
originjitter 11 11 11
effect robot_blood
-count 0.333
+count 0.167
type blood
tex 24 32
size 3 8
effect alien_TR_BLOOD
-trailspacing 16
+trailspacing 32
type blood
color 0xC080B0 0xC080B0
tex 24 32
staintex 16 24
effect robot_TR_BLOOD
-trailspacing 16
+trailspacing 32
type blood
color 0xC0D890 0xC0D890
tex 24 32
staintex 16 24
effect alien_TR_SLIGHTBLOOD
-trailspacing 32
+trailspacing 64
type blood
color 0xC080B0 0xC080B0
tex 24 32
staintex 16 24
effect robot_TR_SLIGHTBLOOD
-trailspacing 32
+trailspacing 64
type blood
color 0xC0D890 0xC0D890
tex 24 32
alpha 128 64 64
// cloud of particles which expand rapidly and then slow to form a ball
effect item_pickup
-count 64
+count 32
type spark
tex 41 41
color 0x63F2EA 0xB0C5C4
// used in qsrc/server/ctf.qc: pointparticles(particleeffectnum("red_ground_quake"), self.origin, '0 0 0', 1);
effect red_ground_quake
type smoke
-count 180
+count 90
tex 0 8
size 20 50
sizeincrease 100
notunderwater
effect red_ground_quake
type smoke
-count 80
+count 40
tex 0 8
size 10 30
sizeincrease 60
notunderwater
effect red_ground_quake
//notunderwater
-count 32
+count 16
type smoke
tex 48 55
size 4 20
// smoke
effect red_ground_quake
type alphastatic
-count 22
+count 11
tex 0 8
size 22 33
sizeincrease 11
// used in qsrc/server/ctf.qc: pointparticles(particleeffectnum("blue_ground_quake"), self.origin, '0 0 0', 1);
effect blue_ground_quake
type smoke
-count 180
+count 90
tex 0 8
size 20 50
sizeincrease 100
notunderwater
effect blue_ground_quake
type smoke
-count 80
+count 40
tex 0 8
size 10 30
sizeincrease 60
notunderwater
effect blue_ground_quake
//notunderwater
-count 32
+count 16
type smoke
tex 48 55
size 4 20
// smoke
effect blue_ground_quake
type alphastatic
-count 22
+count 11
tex 0 8
size 22 33
sizeincrease 11
// used in qcsrc/client/gibs.qc: pointparticles(particleeffectnum("damage_hit"), org, vel, amount * 16)
effect morphed_damage_hit
tex 43 43
-count 1
+count 0.5
type spark
color 0xffffff 0x9271fb
size 14 24
effect morphed_damage_hit
tex 0 8
-count 1
+count 0.5
type smoke
color 0xffffff 0x9271fb
size 24 24
// used in qcsrc/client/gibs.qc: pointparticles(particleeffectnum("damage_dissolve"), org, vel, amount)
effect morphed_damage_dissolve
tex 43 43
-count 20
+count 10
type smoke
color 0xffffff 0x9271fb
size 40 40
effect morphed_damage_dissolve
tex 43 43
-count 5
+count 2.5
type smoke
color 0x7bdbff 0xbed2ff
size 40 40
effect morphed_damage_dissolve
tex 65 65
-count 10
+count 5
type smoke
color 0xffffff 0x9271fb
size 44 44
effect morphed_damage_dissolve
tex 46 46
-count 30
+count 15
type smoke
color 0xffffff 0x9271fb
size 32 32
alpha 128 128 256
// experimental
effect TE_TEI_G3RED
-trailspacing 4
+trailspacing 8
type static
color 0x200000 0x400000
size 0.3 0.3
alpha 128 128 256
// experimental
effect TE_TEI_G3RED_HIT
-trailspacing 10
+trailspacing 20
type static
color 0xFFFFFF 0xFF0011
size 2 2
type smoke
// rings
effect TE_TEI_G3RED_HIT
-trailspacing 20
+trailspacing 40
type static
color 0xFF0000 0xFF0011
size 10 10
alpha 128 128 256
// experimental
effect TE_TEI_G3BLUE
-trailspacing 4
+trailspacing 8
type static
color 0x000020 0x000040
size 0.3 0.3
alpha 128 128 256
// experimental
effect TE_TEI_G3BLUE_HIT
-trailspacing 10
+trailspacing 20
type static
color 0xFFFFFF 0x100FF
size 2 2
type smoke
// rings
effect TE_TEI_G3BLUE_HIT
-trailspacing 20
+trailspacing 40
type static
color 0x0000FF 0x1100FF
size 10 10
size 4 4
alpha 128 128 256
effect TE_TEI_G3YELLOW
-trailspacing 4
+trailspacing 8
type static
color 0x202000 0x404000
size 0.3 0.3
size 8 8
alpha 128 128 256
effect TE_TEI_G3YELLOW_HIT
-trailspacing 10
+trailspacing 20
type static
color 0xFFFFFF 0xffff10
size 2 2
type smoke
// rings
effect TE_TEI_G3YELLOW_HIT
-trailspacing 20
+trailspacing 40
type static
color 0xffff00 0xffff11
size 10 10
alpha 128 128 256
// experimental
effect TE_TEI_G3PINK
-trailspacing 4
+trailspacing 8
type static
color 0x200020 0x400040
size 0.3 0.3
alpha 128 128 256
// experimental
effect TE_TEI_G3PINK_HIT
-trailspacing 10
+trailspacing 20
type static
color 0xFFFFFF 0xFF10FF
size 2 2
type smoke
// rings
effect TE_TEI_G3PINK_HIT
-trailspacing 20
+trailspacing 40
type static
color 0xFF00FF 0xFF11FF
size 10 10
// core decal
effect particlegibs_damage_hit
type blood
-count 1
+count 0.5
tex 0 8
size 5 10
color 0xA8FFFF 0xA8FFFFF
// front blood
effect particlegibs_damage_hit
type blood
-count 0.2
+count 0.1
tex 24 32
size 10 20
color 0xA8FFFF 0xA8FFFFF
// back blood
effect particlegibs_damage_hit
type blood
-count 0.2
+count 0.1
tex 24 32
size 5 15
color 0xA8FFFF 0xA8FFFFF
// small core blood no decals
effect particlegibs_damage_dissolve
type blood
-count 64
+count 32
tex 0 8
size 15 20
color 0x00ffff 0x82ffff
// core decal
effect particlegibs_damage_dissolve
type blood
-count 24
+count 12
tex 0 8
size 20 40
color 0xA8FFFF 0xA8FFFFF
// front blood
effect particlegibs_damage_dissolve
type blood
-count 64
+count 32
tex 24 32
size 10 20
color 0xA8FFFF 0xA8FFFFF
// back blood
effect particlegibs_damage_dissolve
type blood
-count 64
+count 32
tex 24 32
size 5 15
color 0xA8FFFF 0xA8FFFFF
// small bits
effect particlegibs_damage_dissolve
type blood
-count 150
+count 75
tex 24 32
size 1 1
color 0xA8FFFF 0xA8FFFFF
// fire effect which expands then slows
effect onslaught_generator_gib_explode
notunderwater
-count 34
+count 17
type static
tex 48 55
color 0x8f0d00 0xff5a00
type alphastatic
notunderwater
tex 0 8
-count 12
+count 6
size 1 10
sizeincrease 90
gravity -0.3
// underwater bubbles
effect onslaught_generator_gib_explode
underwater
-count 32
+count 16
type bubble
tex 62 62
color 0x404040 0x808080
// fire effect which expands then slows
effect onslaught_generator_gib_flame
notunderwater
-count 30
+count 15
type static
tex 48 55
color 0x8f0d00 0xff5a00
type alphastatic
notunderwater
tex 0 8
-count 2
+count 1
size 10 20
sizeincrease 30
gravity -0.8
// underwater bubbles
effect onslaught_generator_gib_flame
underwater
-count 32
+count 16
type bubble
tex 62 62
color 0x404040 0x808080
// used nowhere in code
effect firemine
-trailspacing 1
-count 1
+trailspacing 2
+count 0.5
type smoke
tex 48 55
color 0x8f0d00 0xff5a00
airfriction 1.2
//slowfire
effect firemine
-trailspacing 1
-count 1
+trailspacing 2
+count 0.5
type smoke
tex 48 55
color 0x8f0d00 0xff5a00
airfriction 1.2
// very slow and small fire
effect firemine
-trailspacing 2
-count 1
+trailspacing 4
+count 0.5
type smoke
tex 48 55
color 0x8f0d00 0xff5a00
airfriction 0.3
//decreasing fire
effect firemine
-trailspacing 2
-count 1
+trailspacing 4
+count 0.5
type smoke
tex 48 55
color 0x8f0d00 0xff5a00
airfriction 0.3
//smoke
effect firemine
-trailspacing 4
-count 1
+trailspacing 8
+count 0.5
type alphastatic
tex 0 8
size 1 4
airfriction 1
//fastfire
effect firemine
-trailspacing 0.5
-count 1
+trailspacing 1
+count 0.5
type smoke
tex 48 55
color 0x8f0d00 0xff5a00
airfriction 1.2
// light only
effect firemine
-trailspacing 8
+trailspacing 16
lightradius 50
lightradiusfade 50000
lightcolor 2.7 2.7 0.6
// used nowhere in code
effect fireball
-trailspacing 1
-count 1
+trailspacing 2
+count 0.5
type smoke
tex 48 55
color 0x8f0d00 0xff5a00
airfriction 1.2
//slowfire
effect fireball
-trailspacing 1
-count 1
+trailspacing 2
+count 0.5
type smoke
tex 48 55
color 0x8f0d00 0xff5a00
airfriction 1.2
// very slow and small fire
effect fireball
-trailspacing 2
-count 1
+trailspacing 4
+count 0.5
type smoke
tex 48 55
color 0x8f0d00 0xff5a00
airfriction 0.3
//decreasing fire
effect fireball
-trailspacing 2
-count 1
+trailspacing 4
+count 0.5
type smoke
tex 48 55
color 0x8f0d00 0xff5a00
airfriction 0.3
//smoke
effect fireball
-trailspacing 4
-count 1
+trailspacing 8
+count 0.5
type alphastatic
tex 0 8
size 5 15
airfriction 1
//fastfire
effect fireball
-trailspacing 0.5
-count 1
+trailspacing 1
+count 0.5
type smoke
tex 48 55
color 0x8f0d00 0xff5a00
airfriction 1.2
// light only
effect fireball
-trailspacing 8
+trailspacing 16
lightradius 300
lightradiusfade 3000
lightcolor 2.7 2.7 0.6
// fireball
effect fireball_laser
-count 20
+count 10
type spark
color 0x800000 0xFF8020
alpha 192 256 2560
// fire effect
effect fireball_explode
notunderwater
-count 256
+count 128
type static
tex 48 55
color 0x902010 0xFFD080
// underwater bubbles
effect fireball_explode
underwater
-count 64
+count 32
type bubble
tex 62 62
color 0x404040 0x808080
// bouncing sparks
effect fireball_explode
notunderwater
-count 128
+count 64
type spark
color 0x903010 0xFFD030
size 2 2
velocityjitter 384 384 384
effect fireball_muzzleflash
-count 4
+count 2
type smoke
color 0x202020 0x404040
tex 0 8
lightradiusfade 2000
lightcolor 2 1.5 0.2
effect fireball_muzzleflash
-count 30
+count 15
type spark
tex 40 40
color 0xFFFDD9 0xFFFDD9
airfriction 12
effect fireball_preattack_muzzleflash
-count 4
+count 2
type smoke
color 0x202020 0x404040
tex 0 8
lightradiusfade 2000
lightcolor 2 1.5 0.2
effect fireball_preattack_muzzleflash
-count 30
+count 15
type spark
tex 40 40
color 0xFFFDD9 0xFFFDD9
airfriction 12
effect fireball_bfgdamage
-count 4
+count 2
type smoke
color 0x202020 0x404040
tex 0 8
lightradiusfade 2000
lightcolor 2 1.5 0.2
effect fireball_bfgdamage
-count 30
+count 15
type spark
tex 40 40
color 0xFFFDD9 0xFFFDD9
// used nowhere in code
effect EF_FLAME
//notunderwater
-count 200
+count 100
type smoke
tex 48 55
size 5 21
// smoke
effect EF_FLAME
type alphastatic
-count 100
+count 50
tex 0 8
size 11 15
sizeincrease 6
velocityjitter 11 11 50
bounce 2
effect EF_FLAME
-count 1
+count 0.5
lightradius 200
lightradiusfade 10000
lightcolor 0.9 0.9 0.2
// used in qcsrc/server/w_common.qc: zcurveparticles_from_tracetoss(particleeffectnum("tr_bullet"), self.origin, trace_endpos, self.velocity)
// used in qcsrc/client/projectile.qc: trailparticles(self, particleeffectnum("tr_bullet"), from, to)
effect tr_rifle
-trailspacing 128
+trailspacing 256
type spark
color 0x800000 0xFF8020
alpha 256 256 2560
effect tr_rifle
notunderwater
tex 0 8
-trailspacing 8
+trailspacing 16
type static
color 0x202020 0x404040
size 2 2
type smoke
effect tr_rifle
underwater
-trailspacing 32
+trailspacing 64
type bubble
tex 62 62
color 0x404040 0x808080
// underwater bubbles
effect rocket_guide
underwater
-count 4
+count 2
type bubble
tex 62 62
color 0x404040 0x808080
// bouncing sparks
effect rocket_guide
notunderwater
-count 16
+count 8
type spark
color 0x903010 0xFFD030
size 0.3 0.7
// used in qcsrc/server/w_laser.qc
effect laser_gauntlet
tex 43 43
-count 3
+count 1.5
type spark
color 0xff00ff 0xff0000
size 4 8
//fast fire
// used nowhere in code, meant for maps
effect torchflame
-count 6
+count 3
type smoke
tex 48 55
color 0x8f0d00 0xff5a00
airfriction 1.2
//slowfire
effect torchflame
-count 5
+count 2.5
type smoke
tex 48 55
color 0x8f0d00 0xff5a00
airfriction 1.2
// very slow and small fire
effect torchflame
-count 3
+count 1.5
type smoke
tex 48 55
color 0x8f0d00 0xff5a00
airfriction 0.3
//decreasing fire
effect torchflame
-count 4
+count 2
type smoke
tex 48 55
color 0x8f0d00 0xff5a00
airfriction 0.3
//smoke
effect torchflame
-count 1
+count 0.5
type alphastatic
tex 0 8
size 5 15
//happy death fx for cl_gentle
effect happy_damage_dissolve
tex 69 69
-count 30
+count 15
type alphastatic
color 0x00FFFF 0xFF00FF
size 32 32
velocityjitter 312 312 312
effect happy_damage_dissolve
tex 69 69
-count 30
+count 15
type alphastatic
color 0xFF00FF 0xFFFF00
size 32 32
velocityjitter 312 312 312
effect happy_damage_dissolve
tex 69 69
-count 30
+count 15
type alphastatic
color 0xFFFF00 0x00FFFF
size 32 32
//happy damage fx for cl_gentle
effect happy_damage_hit
tex 69 69
-count 0.2
+count 0.1
type alphastatic
color 0x00FFFF 0xFF00FF
size 26 26
velocityjitter 156 156 156
effect happy_damage_hit
tex 69 69
-count 0.2
+count 0.1
type alphastatic
color 0xFF00FF 0xFFFF00
size 26 26
velocityjitter 156 156 156
effect happy_damage_hit
tex 69 69
-count 0.2
+count 0.1
type alphastatic
color 0xFFFF00 0x00FFFF
size 26 26
cl_decals 1
cl_decals_time 4
-cl_particles_quality 0.75
+cl_particles_quality 1
gl_flashblend 0
gl_picmip 1
gl_texture_anisotropy 16
cl_decals 1
cl_decals_time 2
-cl_particles_quality 0.2
+cl_particles_quality 0.4
gl_flashblend 1
gl_picmip 2
gl_texture_anisotropy 1
cl_decals 1
cl_decals_time 2
-cl_particles_quality 0.5
+cl_particles_quality 1
gl_flashblend 0
gl_picmip 1
gl_texture_anisotropy 1
cl_decals 1
cl_decals_time 2
-cl_particles_quality 0.5
+cl_particles_quality 1
gl_flashblend 0
gl_picmip 1
gl_texture_anisotropy 1
cl_decals 0
cl_decals_time 2
-cl_particles_quality 0.2
+cl_particles_quality 0.4
gl_flashblend 1
gl_picmip 1337
gl_texture_anisotropy 1
--- /dev/null
+seta hud_skin "old"
+seta hud_bg "0"
+seta hud_bg_color "0 0.6 0.9"
+seta hud_bg_alpha "0.8"
+seta hud_bg_border "10"
+seta hud_bg_padding "0"
+seta hud_fg_alpha "1"
+
+seta hud_dock "dock"
+seta hud_dock_color "0 0.6 0.9"
+seta hud_dock_alpha "0.800000"
+
+seta hud_progressbar_alpha 0.500000
+seta hud_progressbar_strength_color "0 0 0.6"
+seta hud_progressbar_shield_color "0.6 0 0.6"
+seta hud_progressbar_health_color "0.6 0 0"
+seta hud_progressbar_armor_color "0 0.6 0"
+seta hud_progressbar_fuel_color "0.6 0.6 0"
+seta hud_progressbar_nexball_color "0.7 0.1 0"
+
+seta hud_weaponicons 1
+seta hud_weaponicons_pos "-0.635417 -0.133333"
+seta hud_weaponicons_size "0.354167 0.066667"
+seta hud_weaponicons_bg ""
+seta hud_weaponicons_bg_color ""
+seta hud_weaponicons_bg_alpha ""
+seta hud_weaponicons_bg_border ""
+seta hud_weaponicons_bg_padding ""
+seta hud_weaponicons_accuracy_height 0
+seta hud_weaponicons_accuracy_yellow 40
+
+seta hud_inventory 1
+seta hud_inventory_pos "0.171875 -0.091667"
+seta hud_inventory_size "0.177083 0.091667"
+seta hud_inventory_bg ""
+seta hud_inventory_bg_color ""
+seta hud_inventory_bg_alpha ""
+seta hud_inventory_bg_border ""
+seta hud_inventory_bg_padding ""
+seta hud_inventory_onlycurrent 0
+
+seta hud_powerups 1
+seta hud_powerups_pos "-0.307292 -0.091667"
+seta hud_powerups_size "0.093750 0.083333"
+seta hud_powerups_bg ""
+seta hud_powerups_bg_color ""
+seta hud_powerups_bg_alpha ""
+seta hud_powerups_bg_border ""
+seta hud_powerups_bg_padding ""
+seta hud_powerups_flip 1
+seta hud_powerups_mirror 0
+
+seta hud_healtharmor 1
+seta hud_healtharmor_pos "-0.625000 -0.066667"
+seta hud_healtharmor_size "0.287496 0.066667"
+seta hud_healtharmor_bg ""
+seta hud_healtharmor_bg_color ""
+seta hud_healtharmor_bg_alpha ""
+seta hud_healtharmor_bg_border ""
+seta hud_healtharmor_bg_padding ""
+seta hud_healtharmor_flip 1
+seta hud_healtharmor_mirror 0
+
+seta hud_notify 0
+seta hud_notify_pos "0.1 0"
+seta hud_notify_size "0.1 0.1"
+seta hud_notify_bg ""
+seta hud_notify_bg_color ""
+seta hud_notify_bg_alpha ""
+seta hud_notify_bg_border ""
+seta hud_notify_bg_padding ""
+
+seta hud_timer 1
+seta hud_timer_pos "-0.151042 0"
+seta hud_timer_size "0.151042 0.058333"
+seta hud_timer_bg "border"
+seta hud_timer_bg_color ""
+seta hud_timer_bg_alpha ""
+seta hud_timer_bg_border ""
+seta hud_timer_bg_padding ""
+
+seta hud_radar 1
+seta hud_radar_pos "0 0"
+seta hud_radar_size "0.182292 0.225000"
+seta hud_radar_bg ""
+seta hud_radar_bg_color ""
+seta hud_radar_bg_alpha ""
+seta hud_radar_bg_border ""
+seta hud_radar_bg_padding ""
+
+seta hud_score 1
+seta hud_score_pos "-0.203125 -0.091667"
+seta hud_score_size "0.203125 0.083333"
+seta hud_score_bg ""
+seta hud_score_bg_color ""
+seta hud_score_bg_alpha ""
+seta hud_score_bg_border ""
+seta hud_score_bg_padding ""
+
+seta hud_racetimer 1
+seta hud_racetimer_pos "-0.614583 0"
+seta hud_racetimer_size "0.229167 0.091667"
+seta hud_racetimer_bg ""
+seta hud_racetimer_bg_color ""
+seta hud_racetimer_bg_alpha ""
+seta hud_racetimer_bg_border ""
+seta hud_racetimer_bg_padding ""
+
+seta hud_vote 1
+seta hud_vote_pos "-0.312500 -0.300000"
+seta hud_vote_size "0.312500 0.133333"
+seta hud_vote_bg ""
+seta hud_vote_bg_color ""
+seta hud_vote_bg_alpha ""
+seta hud_vote_bg_border ""
+seta hud_vote_bg_padding ""
+seta hud_vote_alreadyvoted_alpha 0.750000
+
+seta hud_modicons 1
+seta hud_modicons_pos "0 -0.091667"
+seta hud_modicons_size "0.119792 0.091667"
+seta hud_modicons_bg ""
+seta hud_modicons_bg_color ""
+seta hud_modicons_bg_alpha ""
+seta hud_modicons_bg_border ""
+seta hud_modicons_bg_padding ""
+
+seta hud_pressedkeys 1
+seta hud_pressedkeys_pos "0.437500 -0.266667"
+seta hud_pressedkeys_size "0.125000 0.116667"
+seta hud_pressedkeys_bg ""
+seta hud_pressedkeys_bg_color ""
+seta hud_pressedkeys_bg_alpha ""
+seta hud_pressedkeys_bg_border ""
+seta hud_pressedkeys_bg_padding ""
+
--- /dev/null
+seta hud_skin "wickedhud"
+seta hud_bg "border"
+seta hud_bg_color "0.875 0.375 0"
+seta hud_bg_alpha "1"
+seta hud_bg_border "8"
+seta hud_bg_padding "2"
+seta hud_fg_alpha "1"
+
+seta hud_dock "dock"
+seta hud_dock_color "0 0.1875 0.4375"
+seta hud_dock_alpha "1"
+
+seta hud_progressbar_alpha 0.500000
+seta hud_progressbar_strength_color "0 0 0.6"
+seta hud_progressbar_shield_color "0.6 0 0.6"
+seta hud_progressbar_health_color "0.6 0 0"
+seta hud_progressbar_armor_color "0 0.6 0"
+seta hud_progressbar_fuel_color "0.6 0.6 0"
+seta hud_progressbar_nexball_color "0.7 0.1 0"
+
+seta hud_weaponicons 1
+seta hud_weaponicons_pos "-0.105000 0.109375"
+seta hud_weaponicons_size "0.080000 0.728125"
+seta hud_weaponicons_bg "border_weaponicons"
+seta hud_weaponicons_bg_color ""
+seta hud_weaponicons_bg_alpha ""
+seta hud_weaponicons_bg_border ""
+seta hud_weaponicons_bg_padding ""
+seta hud_weaponicons_accuracy_height 3
+seta hud_weaponicons_accuracy_yellow 40
+
+seta hud_inventory 1
+seta hud_inventory_pos "-0.290000 -0.100000"
+seta hud_inventory_size "0.277500 0.084375"
+seta hud_inventory_bg "border_inventory"
+seta hud_inventory_bg_color ""
+seta hud_inventory_bg_alpha ""
+seta hud_inventory_bg_border ""
+seta hud_inventory_bg_padding ""
+seta hud_inventory_onlycurrent 0
+
+seta hud_powerups 1
+seta hud_powerups_pos "0.370000 0.087500"
+seta hud_powerups_size "0.255000 0.056250"
+seta hud_powerups_bg "border_powerups"
+seta hud_powerups_bg_color ""
+seta hud_powerups_bg_alpha ""
+seta hud_powerups_bg_border ""
+seta hud_powerups_bg_padding ""
+seta hud_powerups_flip 1
+seta hud_powerups_mirror 0
+
+seta hud_healtharmor 1
+seta hud_healtharmor_pos "0.325000 -0.150000"
+seta hud_healtharmor_size "0.350000 0.090625"
+seta hud_healtharmor_bg "border_healtharmor"
+seta hud_healtharmor_bg_color ""
+seta hud_healtharmor_bg_alpha ""
+seta hud_healtharmor_bg_border ""
+seta hud_healtharmor_bg_padding ""
+seta hud_healtharmor_flip 1
+seta hud_healtharmor_mirror 0
+
+seta hud_notify 0
+seta hud_notify_pos "0.080000 0"
+seta hud_notify_size "0.121092 0.122466"
+seta hud_notify_bg "border"
+seta hud_notify_bg_color ""
+seta hud_notify_bg_alpha ""
+seta hud_notify_bg_border ""
+seta hud_notify_bg_padding ""
+
+seta hud_timer 1
+seta hud_timer_pos "-0.180000 0.018750"
+seta hud_timer_size "0.157500 0.046875"
+seta hud_timer_bg "border_timer"
+seta hud_timer_bg_color ""
+seta hud_timer_bg_alpha ""
+seta hud_timer_bg_border ""
+seta hud_timer_bg_padding ""
+
+seta hud_radar 1
+seta hud_radar_pos "0.025000 0.081250"
+seta hud_radar_size "0.202500 0.256250"
+seta hud_radar_bg "border_radar"
+seta hud_radar_bg_color ""
+seta hud_radar_bg_alpha ""
+seta hud_radar_bg_border ""
+seta hud_radar_bg_padding ""
+
+seta hud_score 1
+seta hud_score_pos "0.015000 -0.103125"
+seta hud_score_size "0.277500 0.087500"
+seta hud_score_bg "border_score"
+seta hud_score_bg_color ""
+seta hud_score_bg_alpha ""
+seta hud_score_bg_border ""
+seta hud_score_bg_padding ""
+
+seta hud_racetimer 1
+seta hud_racetimer_pos "0.365000 0.250000"
+seta hud_racetimer_size "0.265000 0.081250"
+seta hud_racetimer_bg "0"
+seta hud_racetimer_bg_color ""
+seta hud_racetimer_bg_alpha ""
+seta hud_racetimer_bg_border ""
+seta hud_racetimer_bg_padding ""
+
+seta hud_vote 1
+seta hud_vote_pos "-0.665000 -0.287500"
+seta hud_vote_size "0.340000 0.106250"
+seta hud_vote_bg "0"
+seta hud_vote_bg_color ""
+seta hud_vote_bg_alpha ""
+seta hud_vote_bg_border ""
+seta hud_vote_bg_padding ""
+seta hud_vote_alreadyvoted_alpha 0
+
+seta hud_modicons 1
+seta hud_modicons_pos "-0.275000 -0.259375"
+seta hud_modicons_size "0.150000 0.093750"
+seta hud_modicons_bg "border_modicons"
+seta hud_modicons_bg_color ""
+seta hud_modicons_bg_alpha ""
+seta hud_modicons_bg_border ""
+seta hud_modicons_bg_padding ""
+
+seta hud_pressedkeys 1
+seta hud_pressedkeys_pos "0.430000 -0.440625"
+seta hud_pressedkeys_size "0.140000 0.106250"
+seta hud_pressedkeys_bg "0"
+seta hud_pressedkeys_bg_color ""
+seta hud_pressedkeys_bg_alpha ""
+seta hud_pressedkeys_bg_border ""
+seta hud_pressedkeys_bg_padding ""
+
--- /dev/null
+seta hud_skin wickedhud "skin folder where to look for images"
+seta hud_bg "border" "default background for the panels, file must exist in gfx/hud/[skin name]/, 0 = disable background by default"
+seta hud_bg_color "0.875 0.375 0" "default background color for the panels, accepts \"shirt\" and \"pants\""
+seta hud_bg_color_team 0 "default setting for overriding panel color with team color in team games, 0.5 = less saturated"
+seta hud_bg_alpha 1 "default alpha of the background"
+seta hud_bg_border 6 "default border size for the panels"
+seta hud_bg_padding 2 "default padding of contents from the border"
+seta hud_fg_alpha 1 "alpha of the foreground"
+
+seta hud_dock "dock_small" "enable a fullscreen background for the hud, useful for creating artificial docks, \"\" = disable"
+seta hud_dock_color "0 0.1875 0.4375" "dock color, accepts \"shirt\" and \"pants\""
+seta hud_dock_color_team 0.7 "override dock color with team color in team games"
+seta hud_dock_alpha 1 "alpha of the dock"
+
+seta hud_progressbar_alpha "0.5" "alpha of progressbars"
+seta hud_progressbar_strength_color "0 0 0.6" "R G B vector of the progress bar background color"
+seta hud_progressbar_shield_color "0.6 0 0.6" "R G B vector of the progress bar background color"
+seta hud_progressbar_health_color "0.6 0 0" "R G B vector of the progress bar background color"
+seta hud_progressbar_armor_color "0 0.6 0" "R G B vector of the progress bar background color"
+seta hud_progressbar_fuel_color "0.6 0.6 0" "R G B vector of the progress bar background color"
+seta hud_progressbar_nexball_color "0.7 0.1 0" "R G B vector of the progress bar background color"
+
+seta hud_weaponicons 1 "enable/disable this panel"
+seta hud_weaponicons_pos "-0.075000 0.083333" "position of this panel"
+seta hud_weaponicons_size "0.050000 0.500000" "size of this panel"
+seta hud_weaponicons_number 1 "show number of weapon"
+seta hud_weaponicons_accuracy_yellow 40 "percentage at which the accuracy color is yellow"
+seta hud_weaponicons_bg "border_weaponicons" "if set to something else than \"\" = override default background"
+seta hud_weaponicons_bg_color "" "if set to something else than \"\" = override default panel background color"
+seta hud_weaponicons_bg_color_team "" "override panel color with team color in team based games"
+seta hud_weaponicons_bg_alpha "" "if set to something else than \"\" = override default panel background alpha"
+seta hud_weaponicons_bg_border "" "if set to something else than \"\" = override default size of border around the background"
+seta hud_weaponicons_bg_padding "" "if set to something else than \"\" = override default padding of contents from border"
+
+seta hud_inventory 1 "enable/disable this panel"
+seta hud_inventory_pos "-0.318750 -0.066667" "position of this panel"
+seta hud_inventory_size "0.087500 0.050000" "size of this panel"
+seta hud_inventory_onlycurrent 1 "1 = show only current ammo type"
+seta hud_inventory_bg "border_inventory" "if set to something else than \"\" = override default background"
+seta hud_inventory_bg_color "" "if set to something else than \"\" = override default panel background color"
+seta hud_inventory_bg_color_team "" "override panel color with team color in team based games"
+seta hud_inventory_bg_alpha "" "if set to something else than \"\" = override default panel background alpha"
+seta hud_inventory_bg_border "" "if set to something else than \"\" = override default size of border around the background"
+seta hud_inventory_bg_padding "" if set to something else than \"\" = override default padding of contents from border"
+
+seta hud_powerups 1 "enable/disable this panel"
+seta hud_powerups_pos "0.400000 0.141667" "position of this panel"
+seta hud_powerups_size "0.200000 0.041667" "size of this panel"
+seta hud_powerups_flip 1 "flip strength/shield positions"
+seta hud_powerups_mirror 0 "mirror alignment of panel items"
+seta hud_powerups_bg "border_powerups" "if set to something else than \"\" = override default background"
+seta hud_powerups_bg_color "" "if set to something else than \"\" = override default panel background color"
+seta hud_powerups_bg_color_team "" "override panel color with team color in team based games"
+seta hud_powerups_bg_alpha "" "if set to something else than \"\" = override default panel background alpha"
+seta hud_powerups_bg_border "" "if set to something else than \"\" = override default size of border around the background"
+seta hud_powerups_bg_padding "" "if set to something else than \"\" = override default padding of contents from border"
+
+seta hud_healtharmor 1 "enable/disable this panel, 2 = combined health/armor display"
+seta hud_healtharmor_pos "-0.606250 -0.075000" "position of this panel"
+seta hud_healtharmor_size "0.268750 0.058333" "size of this panel"
+seta hud_healtharmor_flip 0 "flip health/armor positions"
+seta hud_healtharmor_mirror 0 "mirror alignment of panel items"
+seta hud_healtharmor_bg "border_healtharmor" "if set to something else than \"\" = override default background"
+seta hud_healtharmor_bg_color "" "if set to something else than \"\" = override default panel background color"
+seta hud_healtharmor_bg_color_team "" "override panel color with team color in team based games"
+seta hud_healtharmor_bg_alpha "" "if set to something else than \"\" = override default panel background alpha"
+seta hud_healtharmor_bg_border "" "if set to something else than \"\" = override default size of border around the background"
+seta hud_healtharmor_bg_padding "" "if set to something else than \"\" = override default padding of contents from border"
+
+seta hud_notify 1 "enable/disable this panel"
+seta hud_notify_pos "-0.206250 -0.266667" "position of this base of the panel"
+seta hud_notify_size "0.181250 0.183333" "size of this panel with all notifications on"
+seta hud_notify_bg "border_modicons" "if set to something else than \"\" = override default background"
+seta hud_notify_bg_color "" "if set to something else than \"\" = override default panel background color"
+seta hud_notify_bg_color_team "" "override panel color with team color in team based games"
+seta hud_notify_bg_alpha 0 "if set to something else than \"\" = override default panel background alpha"
+seta hud_notify_bg_border "" "if set to something else than \"\" = override default size of border around the background"
+seta hud_notify_bg_padding "" "if set to something else than \"\" = override default padding of contents from border"
+seta hud_notify_flip 0 "order the list top to bottom instead of bottom to top"
+seta hud_notify_print 0 "also con_notify print the messages that are shown on the notify panel"
+seta hud_notify_time 10 "time that a new entry stays until it fades out"
+seta hud_notify_fadetime 3 "fade out time"
+seta hud_notify_info_top 1 "show info messages at top of panel"
+
+seta hud_timer 1 "enable/disable this panel"
+seta hud_timer_pos "-0.125000 0.016667" "position of this base of the panel"
+seta hud_timer_size "0.112500 0.033333" "size of this panel"
+seta hud_timer_increment 0 "show elapsed time instead of remaining time"
+seta hud_timer_bg "border_timer" "if set to something else than \"\" = override default background"
+seta hud_timer_bg_color "" "if set to something else than \"\" = override default panel background color"
+seta hud_timer_bg_color_team "" "override panel color with team color in team based games"
+seta hud_timer_bg_alpha "" "if set to something else than \"\" = override default panel background alpha"
+seta hud_timer_bg_border "" "if set to something else than \"\" = override default size of border around the background"
+seta hud_timer_bg_padding "-1" "if set to something else than \"\" = override default padding of contents from border"
+
+seta hud_radar 2 "enable/disable this panel, 2 = also enable in non-teambased gamemodes"
+seta hud_radar_pos "0.025000 0.091667" "position of this base of the panel"
+seta hud_radar_size "0.175000 0.216667" "size of this panel"
+seta hud_radar_bg "border_radar" "if set to something else than \"\" = override default background"
+seta hud_radar_bg_color "" "if set to something else than \"\" = override default panel background color"
+seta hud_radar_bg_color_team "" "override panel color with team color in team based games"
+seta hud_radar_bg_alpha "" "if set to something else than \"\" = override default panel background alpha"
+seta hud_radar_bg_border "" "if set to something else than \"\" = override default size of border around the background"
+seta hud_radar_bg_padding "-3" "if set to something else than \"\" = override default padding of contents from border"
+seta hud_radar_foreground_alpha 0.8 "alpha of the map"
+seta hud_radar_scale 4096 "distance you can see on the team radar"
+seta hud_radar_rotation 0 "rotation mode: you set what points up. 0 = player, 1 = west, 2 = south, 3 = east, 4 = north"
+seta hud_radar_zoommode 0 "zoom mode: 0 = zoomed by default, 1 = zoomed when +zoom, 2 = always zoomed, 3 = always zoomed out"
+alias hud_radar_rotate "toggle hud_radar_rotation 0 1 2 3 4"
+
+seta hud_score 1 "enable/disable this panel"
+seta hud_score_pos "0.237500 -0.066667" "position of this base of the panel"
+seta hud_score_size "0.137500 0.050000" "size of this panel"
+seta hud_score_bg "border_score" "if set to something else than \"\" = override default background"
+seta hud_score_bg_color "" "if set to something else than \"\" = override default panel background color"
+seta hud_score_bg_color_team "" "override panel color with team color in team based games"
+seta hud_score_bg_alpha "" "if set to something else than \"\" = override default panel background alpha"
+seta hud_score_bg_border "" "if set to something else than \"\" = override default size of border around the background"
+seta hud_score_bg_padding "" "if set to something else than \"\" = override default padding of contents from border"
+
+seta hud_racetimer 1 "enable/disable this panel"
+seta hud_racetimer_pos "0.350000 0.016667" "position of this base of the panel"
+seta hud_racetimer_size "0.300000 0.100000" "size of this panel"
+seta hud_racetimer_bg 0 "if set to something else than \"\" = override default background"
+seta hud_racetimer_bg_color "" "if set to something else than \"\" = override default panel background color"
+seta hud_racetimer_bg_color_team "" "override panel color with team color in team based games"
+seta hud_racetimer_bg_alpha "" "if set to something else than \"\" = override default panel background alpha"
+seta hud_racetimer_bg_border "" "if set to something else than \"\" = override default size of border around the background"
+seta hud_racetimer_bg_padding "" "if set to something else than \"\" = override default padding of contents from border"
+
+seta hud_vote 1 "enable/disable this panel"
+seta hud_vote_pos "0.375000 -0.200000" "position of this base of the panel"
+seta hud_vote_size "0.250000 0.083333" "size of this panel"
+seta hud_vote_alreadyvoted_alpha 0.75 "alpha of the vote dialog after you have voted"
+seta hud_vote_bg "border_modicons" "if set to something else than \"\" = override default background"
+seta hud_vote_bg_color "" "if set to something else than \"\" = override default panel background color"
+seta hud_vote_bg_color_team "" "override panel color with team color in team based games"
+seta hud_vote_bg_alpha "" "if set to something else than \"\" = override default panel background alpha"
+seta hud_vote_bg_border "" "if set to something else than \"\" = override default size of border around the background"
+seta hud_vote_bg_padding "" "if set to something else than \"\" = override default padding of contents from border"
+
+seta hud_modicons 1 "enable/disable this panel"
+seta hud_modicons_pos "-0.356250 -0.200000" "position of this base of the panel"
+seta hud_modicons_size "0.125000 0.083333" "size of this panel"
+seta hud_modicons_bg "border_modicons" "if set to something else than \"\" = override default background"
+seta hud_modicons_bg_color "" "if set to something else than \"\" = override default panel background color"
+seta hud_modicons_bg_color_team "" "override panel color with team color in team based games"
+seta hud_modicons_bg_alpha "" "if set to something else than \"\" = override default panel background alpha"
+seta hud_modicons_bg_border "" "if set to something else than \"\" = override default size of border around the background"
+seta hud_modicons_bg_padding "" "if set to something else than \"\" = override default padding of contents from border"
+
+seta hud_pressedkeys 1 "enable/disable this panel, 1 = show only when spectating other players, 2 = show always"
+seta hud_pressedkeys_pos "0.431250 -0.325000" "position of this base of the panel"
+seta hud_pressedkeys_size "0.131250 0.100000" "size of this panel"
+seta hud_pressedkeys_bg "" "if set to something else than \"\" = override default background"
+seta hud_pressedkeys_bg_color "" "if set to something else than \"\" = override default panel background color"
+seta hud_pressedkeys_bg_color_team "" "override panel color with team color in team based games"
+seta hud_pressedkeys_bg_alpha 0 "if set to something else than \"\" = override default panel background alpha"
+seta hud_pressedkeys_bg_border "" "if set to something else than \"\" = override default size of border around the background"
+seta hud_pressedkeys_bg_padding "" "if set to something else than \"\" = override default padding of contents from border"
+
+seta hud_chat 1 "enable/disable this panel"
+seta hud_chat_pos "0.025000 -0.200000" "position of this base of the panel"
+seta hud_chat_size "0.331250 0.083333" "size of this panel"
+seta hud_chat_bg "" "if set to something else than \"\" = override default background"
+seta hud_chat_bg_color "" "if set to something else than \"\" = override default panel background color"
+seta hud_chat_bg_color_team "" "override panel color with team color in team based games"
+seta hud_chat_bg_alpha 0 "if set to something else than \"\" = override default panel background alpha"
+seta hud_chat_bg_border "" "if set to something else than \"\" = override default size of border around the background"
+seta hud_chat_bg_padding "" "if set to something else than \"\" = override default padding of contents from border"
+
+seta hud_engineinfo 0 "enable/disable this panel
+seta hud_engineinfo_pos "-0.131250 -0.050000"" "position of this base of the panel"
+seta hud_engineinfo_size "0.131250 0.041667" "size of this panel"
+seta hud_engineinfo_bg "" "if set to something else than \"\" = override default background"
+seta hud_engineinfo_bg_color "" "if set to something else than \"\" = override default panel background color"
+seta hud_engineinfo_bg_color_team "" "override panel color with team color in team based games"
+seta hud_engineinfo_bg_alpha 0 "if set to something else than \"\" = override default panel background alpha"
+seta hud_engineinfo_bg_border "" "if set to something else than \"\" = override default size of border around the background"
+seta hud_engineinfo_bg_padding "" "if set to something else than \"\" = override default padding of contents from border"
+seta hud_engineinfo_framecounter_time 1 "time between framerate display updates, smaller values yield less accuracy"
+seta hud_engineinfo_framecounter_decimals 0 "amount of decimals to show"
+seta hud_engineinfo_framecounter_exponentialmovingaverage 1 "use an averaging method for calculating fps instead of counting frametime like engine does"
+seta hud_engineinfo_framecounter_exponentialmovingaverage_new_weight 0.1 "weight of latest data point"
+seta hud_engineinfo_framecounter_exponentialmovingaverage_instantupdate_change_threshold 0.5 "treshold for fps change when to update instantly, to make big fps changes update faster"
"+showscores" "show scores"
"+showaccuracy" "show accuracy"
"screenshot" "screen shot"
-"radar" "toggle full radar"
"" ""
"" "Communicate"
"messagemode" "public chat"
--- /dev/null
+0 36 15.000000 0 // dieone
+36 20 15.000000 0 // dietwo
+56 15 15.000000 1 // draw
+71 20 15.000000 1 // duck
+91 21 30.000000 1 // duckwalk
+112 16 15.000000 0 // duckjump
+128 15 5.000000 1 // duckidle
+143 41 5.000000 1 // idle
+184 21 25.000000 0 // jump
+205 15 15.000000 0 // painone
+220 17 15.000000 0 // paintwo
+237 3 15.000000 1 // shoot
+240 21 15.000000 1 // taunt
+261 21 35.000000 1 // run
+282 21 35.000000 1 // runbackwards
+303 21 35.000000 1 // strafeleft
+324 21 35.000000 1 // straferight
+345 2 15.000000 0 // deadone
+347 2 15.000000 0 // deadtwo
+349 21 35.000000 1 // forwardright
+370 21 35.000000 1 // forwardleft
+391 21 35.000000 1 // backright
+412 21 30.000000 1 // backleft
--- /dev/null
+name Erebus
+species human
+sex Male
+weight 105
+age 26
+
+Heavyweight Xonotic Solider
--- /dev/null
+0 36 15.000000 0 // dieone
+36 20 15.000000 0 // dietwo
+56 15 15.000000 1 // draw
+71 20 15.000000 1 // duck
+91 21 30.000000 1 // duckwalk
+112 16 15.000000 0 // duckjump
+128 15 5.000000 1 // duckidle
+143 41 5.000000 1 // idle
+184 21 25.000000 0 // jump
+205 15 15.000000 0 // painone
+220 17 15.000000 0 // paintwo
+237 3 15.000000 1 // shoot
+240 21 15.000000 1 // taunt
+261 21 35.000000 1 // run
+282 21 35.000000 1 // runbackwards
+303 21 35.000000 1 // strafeleft
+324 21 35.000000 1 // straferight
+345 2 15.000000 0 // deadone
+347 2 15.000000 0 // deadtwo
+349 21 35.000000 1 // forwardright
+370 21 35.000000 1 // forwardleft
+391 21 35.000000 1 // backright
+412 21 30.000000 1 // backleft
--- /dev/null
+name Gak
+species alien
+sex Male
+weight 85
+age 16
+
+Lightweight Xonotic Solider
--- /dev/null
+0 36 15.000000 0 // dieone
+36 20 15.000000 0 // dietwo
+56 15 15.000000 1 // draw
+71 20 15.000000 1 // duck
+91 21 30.000000 1 // duckwalk
+112 16 15.000000 0 // duckjump
+128 15 5.000000 1 // duckidle
+143 41 5.000000 1 // idle
+184 21 25.000000 0 // jump
+205 15 15.000000 0 // painone
+220 17 15.000000 0 // paintwo
+237 3 15.000000 1 // shoot
+240 21 15.000000 1 // taunt
+261 21 35.000000 1 // run
+282 21 35.000000 1 // runbackwards
+303 21 35.000000 1 // strafeleft
+324 21 35.000000 1 // straferight
+345 2 15.000000 0 // deadone
+347 2 15.000000 0 // deadtwo
+349 21 35.000000 1 // forwardright
+370 21 35.000000 1 // forwardleft
+391 21 35.000000 1 // backright
+412 21 30.000000 1 // backleft
--- /dev/null
+name Gak Armored
+species alien
+sex Male
+weight 90
+age 20
+
+Heavyweight Xonotic Solider
--- /dev/null
+0 36 15.000000 0 // dieone
+36 20 15.000000 0 // dietwo
+56 15 15.000000 1 // draw
+71 20 15.000000 1 // duck
+91 21 30.000000 1 // duckwalk
+112 16 15.000000 0 // duckjump
+128 15 5.000000 1 // duckidle
+143 41 5.000000 1 // idle
+184 21 25.000000 0 // jump
+205 15 15.000000 0 // painone
+220 17 15.000000 0 // paintwo
+237 3 15.000000 1 // shoot
+240 21 15.000000 1 // taunt
+261 21 35.000000 1 // run
+282 21 35.000000 1 // runbackwards
+303 21 35.000000 1 // strafeleft
+324 21 35.000000 1 // straferight
+345 2 15.000000 0 // deadone
+347 2 15.000000 0 // deadtwo
+349 21 35.000000 1 // forwardright
+370 21 35.000000 1 // forwardleft
+391 21 35.000000 1 // backright
+412 21 30.000000 1 // backleft
--- /dev/null
+name Gak Masked
+species alien
+sex Male
+weight 87
+age 18
+
+Mediumweight Xonotic Solider
--- /dev/null
+0 36 15.000000 0 // dieone
+36 20 15.000000 0 // dietwo
+56 15 15.000000 1 // draw
+71 20 15.000000 1 // duck
+91 21 30.000000 1 // duckwalk
+112 16 15.000000 0 // duckjump
+128 15 5.000000 1 // duckidle
+143 41 5.000000 1 // idle
+184 21 25.000000 0 // jump
+205 15 15.000000 0 // painone
+220 17 15.000000 0 // paintwo
+237 3 15.000000 1 // shoot
+240 21 15.000000 1 // taunt
+261 21 35.000000 1 // run
+282 21 35.000000 1 // runbackwards
+303 21 35.000000 1 // strafeleft
+324 21 35.000000 1 // straferight
+345 2 15.000000 0 // deadone
+347 2 15.000000 0 // deadtwo
+349 21 35.000000 1 // forwardright
+370 21 35.000000 1 // forwardleft
+391 21 35.000000 1 // backright
+412 21 30.000000 1 // backleft
--- /dev/null
+name Ignis
+species human
+sex Male
+weight 88
+age 31
+
+Heavyweight Xonotic Solider
--- /dev/null
+0 36 15.000000 0 // dieone
+36 20 15.000000 0 // dietwo
+56 15 15.000000 1 // draw
+71 20 15.000000 1 // duck
+91 21 30.000000 1 // duckwalk
+112 16 15.000000 0 // duckjump
+128 15 5.000000 1 // duckidle
+143 41 5.000000 1 // idle
+184 21 25.000000 0 // jump
+205 15 15.000000 0 // painone
+220 17 15.000000 0 // paintwo
+237 3 15.000000 1 // shoot
+240 21 15.000000 1 // taunt
+261 21 35.000000 1 // run
+282 21 35.000000 1 // runbackwards
+303 21 35.000000 1 // strafeleft
+324 21 35.000000 1 // straferight
+345 2 15.000000 0 // deadone
+347 2 15.000000 0 // deadtwo
+349 21 35.000000 1 // forwardright
+370 21 35.000000 1 // forwardleft
+391 21 35.000000 1 // backright
+412 21 30.000000 1 // backleft
--- /dev/null
+name Ignis - HalfMasked
+species human
+sex Male
+weight 90
+age 31
+
+Heavyweight Xonotic Solider
--- /dev/null
+0 36 15.000000 0 // dieone
+36 20 15.000000 0 // dietwo
+56 15 15.000000 1 // draw
+71 20 15.000000 1 // duck
+91 21 30.000000 1 // duckwalk
+112 16 15.000000 0 // duckjump
+128 15 5.000000 1 // duckidle
+143 41 5.000000 1 // idle
+184 21 25.000000 0 // jump
+205 15 15.000000 0 // painone
+220 17 15.000000 0 // paintwo
+237 3 15.000000 1 // shoot
+240 21 15.000000 1 // taunt
+261 21 35.000000 1 // run
+282 21 35.000000 1 // runbackwards
+303 21 35.000000 1 // strafeleft
+324 21 35.000000 1 // straferight
+345 2 15.000000 0 // deadone
+347 2 15.000000 0 // deadtwo
+349 21 35.000000 1 // forwardright
+370 21 35.000000 1 // forwardleft
+391 21 35.000000 1 // backright
+412 21 30.000000 1 // backleft
--- /dev/null
+name Ignis - Masked
+species human
+sex Male
+weight 92
+age 31
+
+Heavyweight Xonotic Solider
+++ /dev/null
-lurk,lurk
\ No newline at end of file
+++ /dev/null
-//TAG: reptilian\r
-//affirmative sound/player/carni-lycan/player/affirmative 0\r
-attack sound/player/reptilian/coms/attack 0\r
-//attacking sound/player/carni-lycan/player/attacking 0\r
-attackinfive sound/player/reptilian/coms/attackinfive 0\r
-coverme sound/player/reptilian/coms/coverme 0\r
-defend sound/player/reptilian/coms/defend 0\r
-//defending sound/player/carni-lycan/player/defending 0\r
-//droppedflag sound/player/carni-lycan/player/droppedflag 0\r
-//flagcarriertakingdamage sound/player/carni-lycan/player/flagcarriertakingdamage 0\r
-freelance sound/player/reptilian/coms/freelance 2\r
-//getflag sound/player/carni-lycan/player/getflag 0\r
-incoming sound/player/reptilian/coms/incoming 0\r
-meet sound/player/reptilian/coms/meet 0\r
-needhelp sound/player/reptilian/coms/needhelp 2\r
-//negative sound/player/carni-lycan/player/negative 0\r
-//onmyway sound/player/carni-lycan/player/onmyway 0\r
-//roaming sound/player/carni-lycan/player/roaming 0\r
-//seenenemy sound/player/carni-lycan/player/seenenemy 0\r
-seenflag sound/player/reptilian/coms/seenflag 0\r
-taunt sound/player/reptilian/coms/taunt 3\r
-teamshoot sound/player/reptilian/coms/teamshoot 3\r
-death sound/player/reptilian/player/death 3\r
-drown sound/player/reptilian/player/drown 0\r
-//fall sound/player/carni-lycan/player/fall 0\r
-falling sound/player/reptilian/player/falling 0\r
-gasp sound/player/reptilian/player/gasp 0\r
-jump sound/player/reptilian/player/jump 0\r
-pain25 sound/player/reptilian/player/pain25 0\r
-pain50 sound/player/reptilian/player/pain50 0\r
-pain75 sound/player/reptilian/player/pain75 0\r
-pain100 sound/player/reptilian/player/pain100 0\r
+++ /dev/null
-name Lurk
-species alien
-weight 84
-age 47
-
-Reptilian Combatant
+++ /dev/null
-lurk,reptile
\ No newline at end of file
+++ /dev/null
-//TAG: reptilian\r
-//affirmative sound/player/carni-lycan/player/affirmative 0\r
-attack sound/player/reptilian/coms/attack 0\r
-//attacking sound/player/carni-lycan/player/attacking 0\r
-attackinfive sound/player/reptilian/coms/attackinfive 0\r
-coverme sound/player/reptilian/coms/coverme 0\r
-defend sound/player/reptilian/coms/defend 0\r
-//defending sound/player/carni-lycan/player/defending 0\r
-//droppedflag sound/player/carni-lycan/player/droppedflag 0\r
-//flagcarriertakingdamage sound/player/carni-lycan/player/flagcarriertakingdamage 0\r
-freelance sound/player/reptilian/coms/freelance 2\r
-//getflag sound/player/carni-lycan/player/getflag 0\r
-incoming sound/player/reptilian/coms/incoming 0\r
-meet sound/player/reptilian/coms/meet 0\r
-needhelp sound/player/reptilian/coms/needhelp 2\r
-//negative sound/player/carni-lycan/player/negative 0\r
-//onmyway sound/player/carni-lycan/player/onmyway 0\r
-//roaming sound/player/carni-lycan/player/roaming 0\r
-//seenenemy sound/player/carni-lycan/player/seenenemy 0\r
-seenflag sound/player/reptilian/coms/seenflag 0\r
-taunt sound/player/reptilian/coms/taunt 3\r
-teamshoot sound/player/reptilian/coms/teamshoot 3\r
-death sound/player/reptilian/player/death 3\r
-drown sound/player/reptilian/player/drown 0\r
-//fall sound/player/carni-lycan/player/fall 0\r
-falling sound/player/reptilian/player/falling 0\r
-gasp sound/player/reptilian/player/gasp 0\r
-jump sound/player/reptilian/player/jump 0\r
-pain25 sound/player/reptilian/player/pain25 0\r
-pain50 sound/player/reptilian/player/pain50 0\r
-pain75 sound/player/reptilian/player/pain75 0\r
-pain100 sound/player/reptilian/player/pain100 0\r
+++ /dev/null
-name Reptile
-species alien
-weight 80
-age 32
-
-Reptilian Combatant
+++ /dev/null
-lurk,lurk
\ No newline at end of file
+++ /dev/null
-lurk,reptile
\ No newline at end of file
+++ /dev/null
-lurk,lurk
\ No newline at end of file
+++ /dev/null
-lurk,reptile
\ No newline at end of file
+++ /dev/null
-marine,marine
\ No newline at end of file
+++ /dev/null
-//TAG: marine\r
-//affirmative sound/player/carni-lycan/player/affirmative 0\r
-attack sound/player/marine/coms/attack 0\r
-//attacking sound/player/carni-lycan/player/attacking 0\r
-attackinfive sound/player/marine/coms/attackinfive 0\r
-coverme sound/player/marine/coms/coverme 0\r
-defend sound/player/marine/coms/defend 0\r
-//defending sound/player/carni-lycan/player/defending 0\r
-//droppedflag sound/player/carni-lycan/player/droppedflag 0\r
-//flagcarriertakingdamage sound/player/carni-lycan/player/flagcarriertakingdamage 0\r
-freelance sound/player/marine/coms/freelance 2\r
-//getflag sound/player/carni-lycan/player/getflag 0\r
-incoming sound/player/marine/coms/incoming 0\r
-meet sound/player/marine/coms/meet 0\r
-needhelp sound/player/marine/coms/needhelp 2\r
-//negative sound/player/carni-lycan/player/negative 0\r
-//onmyway sound/player/carni-lycan/player/onmyway 0\r
-//roaming sound/player/carni-lycan/player/roaming 0\r
-//seenenemy sound/player/carni-lycan/player/seenenemy 0\r
-seenflag sound/player/marine/coms/seenflag 0\r
-taunt sound/player/marine/coms/taunt 3\r
-teamshoot sound/player/marine/coms/teamshoot 4\r
-death sound/player/marine/player/death 3\r
-drown sound/player/marine/player/drown 0\r
-//fall sound/player/carni-lycan/player/fall 0\r
-falling sound/player/marine/player/fall 1\r
-gasp sound/player/marine/player/gasp 0\r
-jump sound/player/marine/player/jump 0\r
-pain25 sound/player/marine/player/pain25 0\r
-pain50 sound/player/marine/player/pain50 0\r
-pain75 sound/player/marine/player/pain75 0\r
-pain100 sound/player/marine/player/pain100 0\r
+++ /dev/null
-name Marine
-species human
-sex Male
-weight 93
-age 35
-
-Service Man
+++ /dev/null
-marine,marine
\ No newline at end of file
+++ /dev/null
-marine,marine
\ No newline at end of file
+++ /dev/null
-nexus,nexus
\ No newline at end of file
+++ /dev/null
-//TAG: soldier\r
-//affirmative sound/player/carni-lycan/player/affirmative 0\r
-attack sound/player/soldier/coms/attack 0\r
-//attacking sound/player/carni-lycan/player/attacking 0\r
-attackinfive sound/player/soldier/coms/attackinfive 0\r
-coverme sound/player/soldier/coms/coverme 0\r
-defend sound/player/soldier/coms/defend 0\r
-//defending sound/player/carni-lycan/player/defending 0\r
-//droppedflag sound/player/carni-lycan/player/droppedflag 0\r
-//flagcarriertakingdamage sound/player/carni-lycan/player/flagcarriertakingdamage 0\r
-freelance sound/player/soldier/coms/freelance 2\r
-//getflag sound/player/carni-lycan/player/getflag 0\r
-//incoming sound/player/soldier/coms/incoming 0\r
-meet sound/player/soldier/coms/meet 0\r
-needhelp sound/player/soldier/coms/needhelp 2\r
-//negative sound/player/carni-lycan/player/negative 0\r
-//onmyway sound/player/carni-lycan/player/onmyway 0\r
-//roaming sound/player/carni-lycan/player/roaming 0\r
-//seenenemy sound/player/carni-lycan/player/seenenemy 0\r
-seenflag sound/player/soldier/coms/seenflag 0\r
-taunt sound/player/soldier/coms/taunt 3\r
-teamshoot sound/player/soldier/coms/teamshoot 3\r
-death sound/player/soldier/player/death 3\r
-drown sound/player/soldier/player/drown 0\r
-//fall sound/player/carni-lycan/player/fall 0\r
-falling sound/player/soldier/player/falling 0\r
-gasp sound/player/soldier/player/gasp 0\r
-jump sound/player/soldier/player/jump 0\r
-pain25 sound/player/soldier/player/pain25 0\r
-pain50 sound/player/soldier/player/pain50 0\r
-pain75 sound/player/soldier/player/pain75 0\r
-pain100 sound/player/soldier/player/pain100 0\r
+++ /dev/null
-name Nexus
-species human
-weight 282
-age 313
-
-Nexuiz's Soldier
+++ /dev/null
-nexus,mulder
+++ /dev/null
-//TAG: soldier\r
-//affirmative sound/player/carni-lycan/player/affirmative 0\r
-attack sound/player/soldier/coms/attack 0\r
-//attacking sound/player/carni-lycan/player/attacking 0\r
-attackinfive sound/player/soldier/coms/attackinfive 0\r
-coverme sound/player/soldier/coms/coverme 0\r
-defend sound/player/soldier/coms/defend 0\r
-//defending sound/player/carni-lycan/player/defending 0\r
-//droppedflag sound/player/carni-lycan/player/droppedflag 0\r
-//flagcarriertakingdamage sound/player/carni-lycan/player/flagcarriertakingdamage 0\r
-freelance sound/player/soldier/coms/freelance 2\r
-//getflag sound/player/carni-lycan/player/getflag 0\r
-//incoming sound/player/soldier/coms/incoming 0\r
-meet sound/player/soldier/coms/meet 0\r
-needhelp sound/player/soldier/coms/needhelp 2\r
-//negative sound/player/carni-lycan/player/negative 0\r
-//onmyway sound/player/carni-lycan/player/onmyway 0\r
-//roaming sound/player/carni-lycan/player/roaming 0\r
-//seenenemy sound/player/carni-lycan/player/seenenemy 0\r
-seenflag sound/player/soldier/coms/seenflag 0\r
-taunt sound/player/soldier/coms/taunt 3\r
-teamshoot sound/player/soldier/coms/teamshoot 3\r
-death sound/player/soldier/player/death 3\r
-drown sound/player/soldier/player/drown 0\r
-//fall sound/player/carni-lycan/player/fall 0\r
-falling sound/player/soldier/player/falling 0\r
-gasp sound/player/soldier/player/gasp 0\r
-jump sound/player/soldier/player/jump 0\r
-pain25 sound/player/soldier/player/pain25 0\r
-pain50 sound/player/soldier/player/pain50 0\r
-pain75 sound/player/soldier/player/pain75 0\r
-pain100 sound/player/soldier/player/pain100 0\r
+++ /dev/null
-name Mulder
-species robot_solid
-weight 282
-age 313
-
-Nexuiz's Soldier
+++ /dev/null
-nexus,nexus
+++ /dev/null
-nexus,fbgreen
+++ /dev/null
-nexus,fbred
+++ /dev/null
-nexus,fborange
+++ /dev/null
-nexus,fbcolored
+++ /dev/null
-//TAG: soldier\r
-//affirmative sound/player/carni-lycan/player/affirmative 0\r
-attack sound/player/soldier/coms/attack 0\r
-//attacking sound/player/carni-lycan/player/attacking 0\r
-attackinfive sound/player/soldier/coms/attackinfive 0\r
-coverme sound/player/soldier/coms/coverme 0\r
-defend sound/player/soldier/coms/defend 0\r
-//defending sound/player/carni-lycan/player/defending 0\r
-//droppedflag sound/player/carni-lycan/player/droppedflag 0\r
-//flagcarriertakingdamage sound/player/carni-lycan/player/flagcarriertakingdamage 0\r
-freelance sound/player/soldier/coms/freelance 2\r
-//getflag sound/player/carni-lycan/player/getflag 0\r
-//incoming sound/player/soldier/coms/incoming 0\r
-meet sound/player/soldier/coms/meet 0\r
-needhelp sound/player/soldier/coms/needhelp 2\r
-//negative sound/player/carni-lycan/player/negative 0\r
-//onmyway sound/player/carni-lycan/player/onmyway 0\r
-//roaming sound/player/carni-lycan/player/roaming 0\r
-//seenenemy sound/player/carni-lycan/player/seenenemy 0\r
-seenflag sound/player/soldier/coms/seenflag 0\r
-taunt sound/player/soldier/coms/taunt 3\r
-teamshoot sound/player/soldier/coms/teamshoot 3\r
-death sound/player/soldier/player/death 3\r
-drown sound/player/soldier/player/drown 0\r
-//fall sound/player/carni-lycan/player/fall 0\r
-falling sound/player/soldier/player/falling 0\r
-gasp sound/player/soldier/player/gasp 0\r
-jump sound/player/soldier/player/jump 0\r
-pain25 sound/player/soldier/player/pain25 0\r
-pain50 sound/player/soldier/player/pain50 0\r
-pain75 sound/player/soldier/player/pain75 0\r
-pain100 sound/player/soldier/player/pain100 0\r
+++ /dev/null
-nexus,nexus
\ No newline at end of file
+++ /dev/null
-nexus,mulder
+++ /dev/null
-nexus,xolar
+++ /dev/null
-nexus,fbgreen
+++ /dev/null
-nexus,fbred
+++ /dev/null
-nexus,fborange
+++ /dev/null
-nexus,fbcolored
+++ /dev/null
-nexus,nexus
\ No newline at end of file
+++ /dev/null
-nexus,mulder
+++ /dev/null
-nexus,xolar
+++ /dev/null
-nexus,fbgreen
+++ /dev/null
-nexus,fbred
+++ /dev/null
-nexus,fborange
+++ /dev/null
-nexus,fbcolored
--- /dev/null
+0 36 15.000000 0 // dieone
+36 20 15.000000 0 // dietwo
+56 15 15.000000 1 // draw
+71 20 15.000000 1 // duck
+91 21 30.000000 1 // duckwalk
+112 16 15.000000 0 // duckjump
+128 15 5.000000 1 // duckidle
+143 41 5.000000 1 // idle
+184 21 25.000000 0 // jump
+205 15 15.000000 0 // painone
+220 17 15.000000 0 // paintwo
+237 3 15.000000 1 // shoot
+240 21 15.000000 1 // taunt
+261 21 35.000000 1 // run
+282 21 35.000000 1 // runbackwards
+303 21 35.000000 1 // strafeleft
+324 21 35.000000 1 // straferight
+345 2 15.000000 0 // deadone
+347 2 15.000000 0 // deadtwo
+349 21 35.000000 1 // forwardright
+370 21 35.000000 1 // forwardleft
+391 21 35.000000 1 // backright
+412 21 30.000000 1 // backleft
--- /dev/null
+name Nyx
+species human
+sex Female
+weight 100
+age 24
+
+Heavyweight Xonotic Soldier
--- /dev/null
+0 36 20.000000 0 // dieone
+36 27 20.000000 0 // dietwo
+63 15 15.000000 1 // draw
+78 20 15.000000 1 // duck
+98 11 15.000000 1 // duckwalk
+109 16 15.000000 0 // duckjump
+125 15 5.000000 1 // duckidle
+140 16 5.000000 1 // idle
+156 16 15.000000 0 // jump
+172 15 15.000000 0 // painone
+187 17 15.000000 0 // paintwo
+204 5 15.000000 1 // shoot
+209 21 15.000000 1 // taunt
+230 21 40.000000 1 // run
+251 21 40.000000 1 // runbackwards
+272 21 40.000000 1 // strafeleft
+293 21 40.000000 1 // straferight
+314 2 15.000000 0 // deadone
+316 2 15.000000 0 // deadtwo
+318 21 40.000000 1 // forwardright
+339 21 40.000000 1 // forwardleft
+360 21 40.000000 1 // backright
+381 21 40.000000 1 // backleft
--- /dev/null
+//TAG: pyria-skadi
+//affirmative sound/player/carni-lycan/player/affirmative 0
+attack sound/player/pyria-skadi/coms/attack 2
+//attacking sound/player/carni-lycan/player/attacking 0
+attackinfive sound/player/pyria-skadi/coms/attackinfive 0
+//coverme sound/player/pyria-skadi/coms/coverme 0
+//defend sound/player/pyria-skadi/coms/defend 0
+//defending sound/player/carni-lycan/player/defending 0
+//droppedflag sound/player/carni-lycan/player/droppedflag 0
+//flagcarriertakingdamage sound/player/carni-lycan/player/flagcarriertakingdamage 0
+freelance sound/player/pyria-skadi/coms/freelance 2
+//getflag sound/player/carni-lycan/player/getflag 0
+//incoming sound/player/pyria-skadi/coms/incoming 0
+meet sound/player/pyria-skadi/coms/meet 0
+needhelp sound/player/pyria-skadi/coms/needhelp 2
+//negative sound/player/carni-lycan/player/negative 0
+//onmyway sound/player/carni-lycan/player/onmyway 0
+//roaming sound/player/carni-lycan/player/roaming 0
+//seenenemy sound/player/carni-lycan/player/seenenemy 0
+seenflag sound/player/pyria-skadi/coms/seenflag 0
+taunt sound/player/pyria-skadi/coms/taunt 5
+teamshoot sound/player/pyria-skadi/coms/teamshoot 4
+death sound/player/pyria-skadi/player/death 3
+drown sound/player/pyria-skadi/player/drown 0
+//fall sound/player/carni-lycan/player/fall 0
+falling sound/player/pyria-skadi/player/falling 0
+gasp sound/player/pyria-skadi/player/gasp 0
+jump sound/player/pyria-skadi/player/jump 0
+pain25 sound/player/pyria-skadi/player/pain25 0
+pain50 sound/player/pyria-skadi/player/pain50 0
+pain75 sound/player/pyria-skadi/player/pain75 0
+pain100 sound/player/pyria-skadi/player/pain100 0
--- /dev/null
+name Pyria
+species human
+sex Female
+weight 57
+age 53
+
+Necro Warrior
+++ /dev/null
-0 36 15.000000 0 // dieone
-36 20 15.000000 0 // dietwo
-56 15 15.000000 1 // draw
-71 10 15.000000 1 // duck
-81 11 15.000000 1 // duckwalk
-92 16 15.000000 0 // duckjump
-108 15 5.000000 1 // duckidle
-123 16 5.000000 1 // idle
-139 16 15.000000 0 // jump
-155 15 15.000000 0 // painone
-170 17 15.000000 0 // paintwo
-187 3 15.000000 1 // shoot
-190 35 15.000000 1 // taunt
-225 12 20.000000 1 // run
-237 12 20.000000 1 // runbackwards
-249 12 20.000000 1 // strafeleft
-261 12 20.000000 1 // straferight
-273 2 15.000000 0 // deadone
-275 2 15.000000 0 // deadtwo
-277 12 20.000000 1 // forwardright
-289 12 20.000000 1 // forwardleft
-301 12 20.000000 1 // backright
-313 12 20.000000 1 // backleft
--- /dev/null
+0 36 15.000000 0 // dieone
+36 20 15.000000 0 // dietwo
+56 15 15.000000 1 // draw
+71 20 15.000000 1 // duck
+91 21 30.000000 1 // duckwalk
+112 16 15.000000 0 // duckjump
+128 15 5.000000 1 // duckidle
+143 41 5.000000 1 // idle
+184 21 25.000000 0 // jump
+205 15 15.000000 0 // painone
+220 17 15.000000 0 // paintwo
+237 3 15.000000 1 // shoot
+240 21 15.000000 1 // taunt
+261 21 35.000000 1 // run
+282 21 35.000000 1 // runbackwards
+303 21 35.000000 1 // strafeleft
+324 21 35.000000 1 // straferight
+345 2 15.000000 0 // deadone
+347 2 15.000000 0 // deadtwo
+349 21 35.000000 1 // forwardright
+370 21 35.000000 1 // forwardleft
+391 21 35.000000 1 // backright
+412 21 30.000000 1 // backleft
--- /dev/null
+name Seraphina
+species human
+sex Female
+weight 89
+age 31
+
+Heavyweight Xonotic Solider
--- /dev/null
+0 36 15.000000 0 // dieone
+36 20 15.000000 0 // dietwo
+56 15 15.000000 1 // draw
+71 20 15.000000 1 // duck
+91 21 30.000000 1 // duckwalk
+112 16 15.000000 0 // duckjump
+128 15 5.000000 1 // duckidle
+143 41 5.000000 1 // idle
+184 21 25.000000 0 // jump
+205 15 15.000000 0 // painone
+220 17 15.000000 0 // paintwo
+237 3 15.000000 1 // shoot
+240 21 15.000000 1 // taunt
+261 21 35.000000 1 // run
+282 21 35.000000 1 // runbackwards
+303 21 35.000000 1 // strafeleft
+324 21 35.000000 1 // straferight
+345 2 15.000000 0 // deadone
+347 2 15.000000 0 // deadtwo
+349 21 35.000000 1 // forwardright
+370 21 35.000000 1 // forwardleft
+391 21 35.000000 1 // backright
+412 21 30.000000 1 // backleft
--- /dev/null
+name Seraphina - Masked
+species human
+sex Female
+weight 90
+age 31
+
+Heavyweight Xonotic Solider
-0 36 15.000000 0 // dieone
-36 20 15.000000 0 // dietwo
-56 15 15.000000 1 // draw
-71 10 15.000000 1 // duck
-81 11 15.000000 1 // duckwalk
-92 16 15.000000 0 // duckjump
-108 15 5.000000 1 // duckidle
-123 16 5.000000 1 // idle
-139 16 15.000000 0 // jump
-155 15 15.000000 0 // painone
-170 17 15.000000 0 // paintwo
-187 3 15.000000 1 // shoot
-190 35 15.000000 1 // taunt
-225 12 20.000000 1 // run
-237 12 20.000000 1 // runbackwards
-249 12 20.000000 1 // strafeleft
-261 12 20.000000 1 // straferight
-273 2 15.000000 0 // deadone
-275 2 15.000000 0 // deadtwo
-277 12 20.000000 1 // forwardright
-289 12 20.000000 1 // forwardleft
-301 12 20.000000 1 // backright
-313 12 20.000000 1 // backleft
+0 36 20.000000 0 // dieone
+36 27 20.000000 0 // dietwo
+63 15 15.000000 1 // draw
+78 20 15.000000 1 // duck
+98 11 15.000000 1 // duckwalk
+109 16 15.000000 0 // duckjump
+125 15 5.000000 1 // duckidle
+140 16 5.000000 1 // idle
+156 16 15.000000 0 // jump
+172 15 15.000000 0 // painone
+187 17 15.000000 0 // paintwo
+204 5 15.000000 1 // shoot
+209 21 15.000000 1 // taunt
+230 21 40.000000 1 // run
+251 21 40.000000 1 // runbackwards
+272 21 40.000000 1 // strafeleft
+293 21 40.000000 1 // straferight
+314 2 15.000000 0 // deadone
+316 2 15.000000 0 // deadtwo
+318 21 40.000000 1 // forwardright
+339 21 40.000000 1 // forwardleft
+360 21 40.000000 1 // backright
+381 21 40.000000 1 // backleft
age 25
Lightweight Xonotic Solider
-
-Sex: Female
-Weight: 61 kg
-Age: 25
+++ /dev/null
-/*
-Generated framegroups file for xolar
-Used by DarkPlaces to simulate frame groups in DPM models.
-*/
-
-1 41 15 0 // xolar die1
-42 47 30 0 // xolar die2
-89 11 30 1 // xolar draw
-100 11 30 1 // xolar duck
-111 81 60 1 // xolar duckwalk
-192 41 60 0 // xolar duckjump
-233 21 10 1 // xolar duckidle
-254 301 10 1 // xolar idle
-555 41 60 0 // xolar jump
-596 6 15 0 // xolar pain1
-602 6 15 0 // xolar pain2
-608 8 30 1 // xolar shoot
-616 31 30 1 // xolar taunt
-647 41 60 1 // xolar run
-688 41 60 1 // xolar runbackwards
-729 41 60 1 // xolar strafeleft
-770 41 60 1 // xolar straferight
-811 3 30 0 // xolar dead1
-814 3 30 0 // xolar dead2
-817 41 60 1 // xolar forwardright
-858 41 60 1 // xolar forwardleft
-899 41 60 1 // xolar backright
-940 41 60 1 // xolar backleft
+++ /dev/null
-//TAG: soldier\r
-//affirmative sound/player/carni-lycan/player/affirmative 0\r
-attack sound/player/soldier/coms/attack 0\r
-//attacking sound/player/carni-lycan/player/attacking 0\r
-attackinfive sound/player/soldier/coms/attackinfive 0\r
-coverme sound/player/soldier/coms/coverme 0\r
-defend sound/player/soldier/coms/defend 0\r
-//defending sound/player/carni-lycan/player/defending 0\r
-//droppedflag sound/player/carni-lycan/player/droppedflag 0\r
-//flagcarriertakingdamage sound/player/carni-lycan/player/flagcarriertakingdamage 0\r
-freelance sound/player/soldier/coms/freelance 2\r
-//getflag sound/player/carni-lycan/player/getflag 0\r
-//incoming sound/player/soldier/coms/incoming 0\r
-meet sound/player/soldier/coms/meet 0\r
-needhelp sound/player/soldier/coms/needhelp 2\r
-//negative sound/player/carni-lycan/player/negative 0\r
-//onmyway sound/player/carni-lycan/player/onmyway 0\r
-//roaming sound/player/carni-lycan/player/roaming 0\r
-//seenenemy sound/player/carni-lycan/player/seenenemy 0\r
-seenflag sound/player/soldier/coms/seenflag 0\r
-taunt sound/player/soldier/coms/taunt 3\r
-teamshoot sound/player/soldier/coms/teamshoot 3\r
-death sound/player/soldier/player/death 3\r
-drown sound/player/soldier/player/drown 0\r
-//fall sound/player/carni-lycan/player/fall 0\r
-falling sound/player/soldier/player/falling 0\r
-gasp sound/player/soldier/player/gasp 0\r
-jump sound/player/soldier/player/jump 0\r
-pain25 sound/player/soldier/player/pain25 0\r
-pain50 sound/player/soldier/player/pain50 0\r
-pain75 sound/player/soldier/player/pain75 0\r
-pain100 sound/player/soldier/player/pain100 0\r
+++ /dev/null
-name Xolar
-species robot_solid
-weight 582
-age 439
-
-Heavy Nexuiz's Soldier
+++ /dev/null
-/*
-Generated framegroups file for xolar_lod1
-Used by DarkPlaces to simulate frame groups in DPM models.
-*/
-
-1 41 15 0 // xolar_lod1 die1
-42 47 30 0 // xolar_lod1 die2
-89 11 30 1 // xolar_lod1 draw
-100 11 30 1 // xolar_lod1 duck
-111 81 60 1 // xolar_lod1 duckwalk
-192 41 60 0 // xolar_lod1 duckjump
-233 21 10 1 // xolar_lod1 duckidle
-254 301 10 1 // xolar_lod1 idle
-555 41 60 0 // xolar_lod1 jump
-596 6 15 0 // xolar_lod1 pain1
-602 6 15 0 // xolar_lod1 pain2
-608 8 30 1 // xolar_lod1 shoot
-616 31 30 1 // xolar_lod1 taunt
-647 41 60 1 // xolar_lod1 run
-688 41 60 1 // xolar_lod1 runbackwards
-729 41 60 1 // xolar_lod1 strafeleft
-770 41 60 1 // xolar_lod1 straferight
-811 3 30 0 // xolar_lod1 dead1
-814 3 30 0 // xolar_lod1 dead2
-817 41 60 1 // xolar_lod1 forwardright
-858 41 60 1 // xolar_lod1 forwardleft
-899 41 60 1 // xolar_lod1 backright
-940 41 60 1 // xolar_lod1 backleft
+++ /dev/null
-/*
-Generated animinfo file for xolar_lod2
-Useful for game code to simulate frame groups in DPM models.
-*/
-
-
-// end of animinfo definitions for xolar_lod2
-
-
+++ /dev/null
-/*
-Generated framegroups file for xolar_lod2
-Used by DarkPlaces to simulate frame groups in DPM models.
-*/
-
-1 41 15 0 // xolar_lod2 die1
-42 47 30 0 // xolar_lod2 die2
-89 11 30 1 // xolar_lod2 draw
-100 11 30 1 // xolar_lod2 duck
-111 81 60 1 // xolar_lod2 duckwalk
-192 41 60 0 // xolar_lod2 duckjump
-233 21 10 1 // xolar_lod2 duckidle
-254 301 10 1 // xolar_lod2 idle
-555 41 60 0 // xolar_lod2 jump
-596 6 15 0 // xolar_lod2 pain1
-602 6 15 0 // xolar_lod2 pain2
-608 8 30 1 // xolar_lod2 shoot
-616 31 30 1 // xolar_lod2 taunt
-647 41 60 1 // xolar_lod2 run
-688 41 60 1 // xolar_lod2 runbackwards
-729 41 60 1 // xolar_lod2 strafeleft
-770 41 60 1 // xolar_lod2 straferight
-811 3 30 0 // xolar_lod2 dead1
-814 3 30 0 // xolar_lod2 dead2
-817 41 60 1 // xolar_lod2 forwardright
-858 41 60 1 // xolar_lod2 forwardleft
-899 41 60 1 // xolar_lod2 backright
-940 41 60 1 // xolar_lod2 backleft
+++ /dev/null
-1 8 20 0 // fire
-9 5 20 0 // fire2
-15 200 20 1 // idle
-215 39 20 0 // reload
--- /dev/null
+1 8 20 0 // fire
+9 5 20 0 // fire2
+15 200 20 1 // idle
+215 39 20 0 // reload
+++ /dev/null
-1 8 20 0 // fire
-9 5 20 0 // fire2
-15 200 20 1 // idle
-215 40 20 0 // reload
--- /dev/null
+1 8 20 0 // fire
+9 5 20 0 // fire2
+15 200 20 1 // idle
+215 40 20 0 // reload
+++ /dev/null
-1 8 20 0 // fire
-9 5 20 0 // fire2
-15 200 20 1 // idle
-215 40 20 0 // reload
--- /dev/null
+1 8 20 0 // fire
+9 5 20 0 // fire2
+15 200 20 1 // idle
+215 40 20 0 // reload
+++ /dev/null
-1 8 20 0 // fire
-9 5 20 0 // fire2
-15 200 20 1 // idle
-215 40 20 0 // reload
--- /dev/null
+1 8 20 0 // fire
+9 5 20 0 // fire2
+15 200 20 1 // idle
+215 40 20 0 // reload
+++ /dev/null
-1 8 20 0 // fire
-9 5 20 0 // fire2
-15 200 20 1 // idle
-215 40 20 0 // reload
--- /dev/null
+1 8 20 0 // fire
+9 5 20 0 // fire2
+15 200 20 1 // idle
+215 40 20 0 // reload
+++ /dev/null
-1 8 20 0 // fire
-9 5 20 0 // fire2
-15 200 20 1 // idle
-215 40 20 0 // reload
--- /dev/null
+1 8 20 0 // fire
+9 5 20 0 // fire2
+15 200 20 1 // idle
+215 40 20 0 // reload
+++ /dev/null
-1 8 20 0 // fire
-9 5 20 0 // fire2
-15 200 20 1 // idle
-215 40 20 0 // reload
--- /dev/null
+1 8 20 0 // fire
+9 5 20 0 // fire2
+15 200 20 1 // idle
+215 40 20 0 // reload
+++ /dev/null
-1 8 20 0 // fire
-9 5 20 0 // fire2
-15 200 20 1 // idle
-215 40 20 0 // reload
--- /dev/null
+1 8 20 0 // fire
+9 5 20 0 // fire2
+15 200 20 1 // idle
+215 40 20 0 // reload
+++ /dev/null
-1 8 20 0 // fire
-9 5 20 0 // fire2
-15 200 20 1 // idle
-215 40 20 0 // reload
--- /dev/null
+1 8 20 0 // fire
+9 5 20 0 // fire2
+15 200 20 1 // idle
+215 40 20 0 // reload
+++ /dev/null
-1 8 20 0 // fire
-9 5 20 0 // fire2
-15 200 20 1 // idle
-215 40 20 0 // reload
--- /dev/null
+1 8 20 0 // fire
+9 5 20 0 // fire2
+15 200 20 1 // idle
+215 40 20 0 // reload
+++ /dev/null
-1 8 20 0 // fire
-9 5 20 0 // fire2
-15 200 20 1 // idle
-215 40 20 0 // reload
--- /dev/null
+1 8 20 0 // fire
+9 5 20 0 // fire2
+15 200 20 1 // idle
+215 40 20 0 // reload
+++ /dev/null
-1 8 20 0 // fire
-9 5 20 0 // fire2
-15 200 20 1 // idle
-215 40 20 0 // reload
--- /dev/null
+1 8 20 0 // fire
+9 5 20 0 // fire2
+15 200 20 1 // idle
+215 40 20 0 // reload
+++ /dev/null
-1 8 20 0 // fire
-9 5 20 0 // fire2
-15 200 20 1 // idle
-215 40 20 0 // reload
--- /dev/null
+1 8 20 0 // fire
+9 5 20 0 // fire2
+15 200 20 1 // idle
+215 40 20 0 // reload
+++ /dev/null
-1 8 20 0 // fire
-9 5 20 0 // fire2
-15 200 20 1 // idle
-215 40 20 0 // reload
--- /dev/null
+1 8 20 0 // fire
+9 5 20 0 // fire2
+15 200 20 1 // idle
+215 40 20 0 // reload
+++ /dev/null
-1 8 20 0 // fire
-9 5 20 0 // fire2
-15 200 20 1 // idle
-215 40 20 0 // reload
--- /dev/null
+1 8 20 0 // fire
+9 5 20 0 // fire2
+15 200 20 1 // idle
+215 40 20 0 // reload
+++ /dev/null
-1 8 20 0 // fire
-9 5 20 0 // fire2
-15 200 20 1 // idle
-215 40 20 0 // reload
--- /dev/null
+1 8 20 0 // fire
+9 5 20 0 // fire2
+15 200 20 1 // idle
+215 40 20 0 // reload
+++ /dev/null
-1 8 20 0 // fire
-9 5 20 0 // fire2
-15 200 20 1 // idle
-215 40 20 0 // reload
--- /dev/null
+1 8 20 0 // fire
+9 5 20 0 // fire2
+15 200 20 1 // idle
+215 40 20 0 // reload
sv_airstopaccelerate 0
sv_airstrafeaccelerate 0
sv_maxairstrafespeed 0
+sv_airstrafeaccel_qw 0
sv_aircontrol 0
sv_aircontrol_power 2
+sv_airspeedlimit_nonqw 0
sv_warsowbunny_turnaccel 0
sv_warsowbunny_accel 0.1593
sv_warsowbunny_topspeed 925
sv_airstopaccelerate 0
sv_airstrafeaccelerate 0
sv_maxairstrafespeed 0
+sv_airstrafeaccel_qw 0
sv_aircontrol 0
sv_aircontrol_power 2
+sv_airspeedlimit_nonqw 0
sv_warsowbunny_turnaccel 0
sv_warsowbunny_accel 0.1593
sv_warsowbunny_topspeed 925
sv_airstopaccelerate 0
sv_airstrafeaccelerate 0
sv_maxairstrafespeed 0
+sv_airstrafeaccel_qw 0
sv_aircontrol 0
sv_aircontrol_power 2
+sv_airspeedlimit_nonqw 0
sv_warsowbunny_turnaccel 0
sv_warsowbunny_accel 0.1593
sv_warsowbunny_topspeed 925
sv_airstopaccelerate 0
sv_airstrafeaccelerate 0
sv_maxairstrafespeed 0
+sv_airstrafeaccel_qw 0
sv_aircontrol 0
sv_aircontrol_power 2
+sv_airspeedlimit_nonqw 0
sv_warsowbunny_turnaccel 0
sv_warsowbunny_accel 0.1593
sv_warsowbunny_topspeed 925
sv_airstopaccelerate 0
sv_airstrafeaccelerate 0
sv_maxairstrafespeed 0
+sv_airstrafeaccel_qw 0
sv_aircontrol 0
sv_aircontrol_power 2
+sv_airspeedlimit_nonqw 0
sv_warsowbunny_turnaccel 0
sv_warsowbunny_accel 0.1593
sv_warsowbunny_topspeed 925
sv_airstopaccelerate 0
sv_airstrafeaccelerate 0
sv_maxairstrafespeed 0
+sv_airstrafeaccel_qw 0
sv_aircontrol 0
sv_aircontrol_power 2
+sv_airspeedlimit_nonqw 0
sv_warsowbunny_turnaccel 0
sv_warsowbunny_accel 0.1593
sv_warsowbunny_topspeed 925
sv_airstopaccelerate 0
sv_airstrafeaccelerate 0
sv_maxairstrafespeed 0
+sv_airstrafeaccel_qw 0
sv_aircontrol 0
sv_aircontrol_power 2
+sv_airspeedlimit_nonqw 0
sv_warsowbunny_turnaccel 0
sv_warsowbunny_accel 0.1593
sv_warsowbunny_topspeed 925
sv_airstopaccelerate 0
sv_airstrafeaccelerate 0
sv_maxairstrafespeed 0
+sv_airstrafeaccel_qw 0
sv_aircontrol 0
sv_aircontrol_power 2
+sv_airspeedlimit_nonqw 0
sv_warsowbunny_turnaccel 0
sv_warsowbunny_accel 0.1593
sv_warsowbunny_topspeed 925
sv_airstopaccelerate 2.5
sv_airstrafeaccelerate 70
sv_maxairstrafespeed 30
+sv_airstrafeaccel_qw 0
sv_aircontrol 150
sv_aircontrol_power 2
+sv_airspeedlimit_nonqw 0
sv_warsowbunny_turnaccel 0
sv_warsowbunny_accel 0.1593
sv_warsowbunny_topspeed 925
sv_airstopaccelerate 0
sv_airstrafeaccelerate 0
sv_maxairstrafespeed 0
+sv_airstrafeaccel_qw 0
sv_aircontrol 0
sv_aircontrol_power 2
+sv_airspeedlimit_nonqw 0
sv_warsowbunny_turnaccel 0
sv_warsowbunny_accel 0.1593
sv_warsowbunny_topspeed 925
sv_airstopaccelerate 0
sv_airstrafeaccelerate 0
sv_maxairstrafespeed 0
+sv_airstrafeaccel_qw 0
sv_aircontrol 0
sv_aircontrol_power 2
+sv_airspeedlimit_nonqw 0
sv_warsowbunny_turnaccel 0
sv_warsowbunny_accel 0.1593
sv_warsowbunny_topspeed 925
sv_airstopaccelerate 0
sv_airstrafeaccelerate 0
sv_maxairstrafespeed 0
+sv_airstrafeaccel_qw 0
sv_aircontrol 0
sv_aircontrol_power 2
+sv_airspeedlimit_nonqw 0
sv_warsowbunny_turnaccel 0
sv_warsowbunny_accel 0.1593
sv_warsowbunny_topspeed 925
// 2.0-2.4.2 physics minus QW-bunnyhopping-bug, faster onground accel, CPMA air control
sv_gravity 800
sv_maxspeed 400
-sv_maxairspeed 220
+sv_maxairspeed 400
sv_stopspeed 100
-sv_accelerate 12
-sv_airaccelerate 8
+sv_accelerate 15
+sv_airaccelerate 2
sv_friction 7
edgefriction 1
sv_stepheight 34
sv_jumpvelocity 300
sv_wateraccelerate -1
sv_waterfriction -1
-sv_airaccel_sideways_friction -0.125
-sv_airaccel_qw -0.95
-sv_airstopaccelerate 0
-sv_airstrafeaccelerate 0
-sv_maxairstrafespeed 0
-sv_aircontrol 100
-sv_aircontrol_power 3
+sv_airaccel_sideways_friction -0.2
+sv_airaccel_qw -0.9475
+sv_airstopaccelerate 2.5
+sv_airstrafeaccelerate 24
+sv_maxairstrafespeed 100
+sv_airstrafeaccel_qw -0.9825
+sv_aircontrol 125
+sv_aircontrol_power 2.5
+sv_airspeedlimit_nonqw 0
sv_warsowbunny_turnaccel 0
sv_warsowbunny_accel 0.1593
sv_warsowbunny_topspeed 925
sv_doublejump 0
sv_jumpspeedcap_min ""
sv_jumpspeedcap_max ""
-sv_jumpspeedcap_max_disable_on_ramps 0
+sv_jumpspeedcap_max_disable_on_ramps 1
sv_airstopaccelerate 0
sv_airstrafeaccelerate 0
sv_maxairstrafespeed 0
+sv_airstrafeaccel_qw 0
sv_aircontrol 0
sv_aircontrol_power 2
+sv_airspeedlimit_nonqw 0
sv_warsowbunny_turnaccel 0
sv_warsowbunny_accel 0.1593
sv_warsowbunny_topspeed 925
sv_airstopaccelerate 0
sv_airstrafeaccelerate 0
sv_maxairstrafespeed 0
+sv_airstrafeaccel_qw 0
sv_aircontrol 0
sv_aircontrol_power 2
+sv_airspeedlimit_nonqw 0
sv_warsowbunny_turnaccel 0
sv_warsowbunny_accel 0.1593
sv_warsowbunny_topspeed 925
sv_airstopaccelerate 0
sv_airstrafeaccelerate 0
sv_maxairstrafespeed 0
+sv_airstrafeaccel_qw 0
sv_aircontrol 0
sv_aircontrol_power 2
+sv_airspeedlimit_nonqw 0
sv_warsowbunny_turnaccel 0
sv_warsowbunny_accel 0.1593
sv_warsowbunny_topspeed 925
sv_airstopaccelerate 0
sv_airstrafeaccelerate 0
sv_maxairstrafespeed 0
+sv_airstrafeaccel_qw 0
sv_aircontrol 0
sv_aircontrol_power 2
+sv_airspeedlimit_nonqw 0
sv_warsowbunny_turnaccel 0
sv_warsowbunny_accel 0.1593
sv_warsowbunny_topspeed 925
sv_airstopaccelerate 0
sv_airstrafeaccelerate 0
sv_maxairstrafespeed 0
+sv_airstrafeaccel_qw 0
sv_aircontrol 0
sv_aircontrol_power 2
+sv_airspeedlimit_nonqw 0
sv_warsowbunny_turnaccel 0
sv_warsowbunny_accel 0.1593
sv_warsowbunny_topspeed 925
sv_airstopaccelerate 0
sv_airstrafeaccelerate 0
sv_maxairstrafespeed 0
+sv_airstrafeaccel_qw 0
sv_aircontrol 0
sv_aircontrol_power 2
+sv_airspeedlimit_nonqw 0
sv_warsowbunny_turnaccel 0
sv_warsowbunny_accel 0.1593
sv_warsowbunny_topspeed 925
-sv_gravity 880
+// Mix of 2.3 physics and NANL physics, goal of going for faster movement
+sv_gravity 800
sv_maxspeed 420
sv_maxairspeed 235
sv_stopspeed 200
sv_accelerate 6
sv_airaccelerate 6
sv_friction 4
-edgefriction 0
+edgefriction 1
sv_stepheight 34
-sv_jumpvelocity 330
+sv_jumpvelocity 300
sv_wateraccelerate -1
sv_waterfriction -1
sv_airaccel_sideways_friction 0.3
sv_airstopaccelerate 0
sv_airstrafeaccelerate 0
sv_maxairstrafespeed 0
+sv_airstrafeaccel_qw 0
sv_aircontrol 0
sv_aircontrol_power 2
+sv_airspeedlimit_nonqw 0
sv_warsowbunny_turnaccel 0
sv_warsowbunny_accel 0.1593
sv_warsowbunny_topspeed 925
sv_airstopaccelerate 2.5
sv_airstrafeaccelerate 70
sv_maxairstrafespeed 30
+sv_airstrafeaccel_qw 0
sv_aircontrol 0
sv_aircontrol_power 2
+sv_airspeedlimit_nonqw 0
sv_warsowbunny_turnaccel 9 // activates warsow movement mode
sv_warsowbunny_accel 0.1593
sv_warsowbunny_topspeed 925
sv_airstopaccelerate 2.5
sv_airstrafeaccelerate 70
sv_maxairstrafespeed 30
+sv_airstrafeaccel_qw 0
sv_aircontrol 150
sv_aircontrol_power 2
+sv_airspeedlimit_nonqw 0
sv_warsowbunny_turnaccel 0
sv_warsowbunny_accel 0.1593
sv_warsowbunny_topspeed 925
sv_airstopaccelerate 2
sv_airstrafeaccelerate 70
sv_maxairstrafespeed 30
+sv_airstrafeaccel_qw 0
sv_aircontrol 0
sv_aircontrol_power 2
+sv_airspeedlimit_nonqw 0
sv_warsowbunny_turnaccel 6 // activates warsow movement mode
sv_warsowbunny_accel 0.1585
sv_warsowbunny_topspeed 900
sv_airstopaccelerate 2.5
sv_airstrafeaccelerate 70
sv_maxairstrafespeed 30
+sv_airstrafeaccel_qw 1
sv_aircontrol 150
sv_aircontrol_power 2
+sv_airspeedlimit_nonqw 0
sv_warsowbunny_turnaccel 0
sv_warsowbunny_accel 0.1593
sv_warsowbunny_topspeed 925
// Additional OPTIONAL Fields and Globals
float intermission;
-float sb_showscores;
-float sb_showaccuracy;
-float hud_currentammo;
+float scoreboard_showscores;
+float scoreboard_showaccuracy;
.string message;
.float renderflags;
// float coop;
float race_othercheckpointdelta;
float race_othercheckpointlapsdelta;
string race_othercheckpointenemy;
-float sb_showscores_force;
+float scoreboard_showscores_force;
float race_status;
string race_status_name;
float race_myrank;
// only for Porto
float angles_held_status;
vector angles_held;
+
+// weapons
+.float silent;
+
+float w_deathtype, w_issilent, w_random;
+string w_deathtypestring;
+vector w_org, w_backoff;
+
check_unacceptable_compiler_bugs();
+#ifdef WATERMARK
+ print("^4CSQC Build information: ", WATERMARK(), "\n");
+#endif
+
float i;
CSQC_CheckEngine();
// localcmd("alias order \"cmd order $*\""); enable if ctf-command thingy is used
//registercmd("ctf_menu");
registercmd("ons_map");
+ registercmd("hud_configure");
+ registercmd("hud_save");
//registercmd("menu_action");
registercmd("+button3");
registercmd("-button3");
registercmd("+button4");
registercmd("-button4");
+ registercmd("+showscores");registercmd("-showscores");
registercmd("+showaccuracy");registercmd("-showaccuracy");
#ifndef CAMERATEST
}
#endif
registercvar("hud_usecsqc", "1");
- registercvar("hud_columns", "default", CVAR_SAVE);
+ registercvar("scoreboard_columns", "default", CVAR_SAVE);
gametype = 0;
GetTeam(COLOR_SPECTATOR, true); // add specs first
- cvar_clientsettemp("_supports_weaponpriority", "1");
-
RegisterWeapons();
WaypointSprite_Load();
void PostInit(void)
{
print(strcat("PostInit\n maxclients = ", ftos(maxclients), "\n"));
- localcmd(strcat("\nhud_columns_set ", cvar_string("hud_columns"), ";\n"));
+ localcmd(strcat("\nscoreboard_columns_set ", cvar_string("scoreboard_columns"), ";\n"));
entity playerchecker;
playerchecker = spawn();
local string strCmd;
strCmd = argv(0);
- if(strCmd == "+button4") { // zoom
+ if(strCmd == "hud_configure") { // config hud
+ cvar_set("_hud_configure", ftos(!cvar("_hud_configure")));
+ return true;
+ } else if(strCmd == "hud_save") { // save hud config
+ if(argv(1) == "" || argv(2)) {
+ print("Usage:\n");
+ print("hud_save configname (saves to hud_skinname_configname.cfg)\n");
+ }
+ else
+ HUD_Panel_ExportCfg(argv(1));
+ return true;
+ } else if(strCmd == "+button4") { // zoom
// return false, because the message shall be sent to the server anyway (for demos/speccing)
if(ignore_plus_zoom)
{
button_attack2 = 0;
return false;
} else if(strCmd == "+showscores") {
- sb_showscores = true;
+ scoreboard_showscores = true;
return true;
} else if(strCmd == "-showscores") {
- sb_showscores = false;
+ scoreboard_showscores = false;
return true;
} else if(strCmd == "+showaccuracy") {
- sb_showaccuracy = true;
+ scoreboard_showaccuracy = true;
return true;
} else if(strCmd == "-showaccuracy") {
- sb_showaccuracy = false;
+ scoreboard_showaccuracy = false;
return true;
}
{
print("Usage: cl_cmd COMMAND..., where possible commands are:\n");
print(" settemp cvar value\n");
- print(" radar\n");
- print(" hud_columns_set ...\n");
- print(" hud_columns_help\n");
+ print(" scoreboard_columns_set ...\n");
+ print(" scoreboard_columns_help\n");
GameCommand_Generic("help");
return;
}
else if(cmd == "settemp") {
cvar_clientsettemp(argv(1), argv(2));
}
- else if(cmd == "radar") {
- ons_showmap = !ons_showmap;
- }
- else if(cmd == "hud_columns_set") {
+ else if(cmd == "scoreboard_columns_set") {
Cmd_HUD_SetFields(argc);
}
- else if(cmd == "hud_columns_help") {
+ else if(cmd == "scoreboard_columns_help") {
Cmd_HUD_Help(argc);
}
#ifdef BLURTEST
}
else if(cmd == "sendcvar") {
// W_FixWeaponOrder will trash argv, so save what we need.
- string cvar;
- cvar = strzone(argv(1));
- s = cvar_string(cvar);
- if(cvar == "cl_weaponpriority")
+ string thiscvar;
+ thiscvar = strzone(argv(1));
+ s = cvar_string(thiscvar);
+ if(thiscvar == "cl_weaponpriority")
s = W_FixWeaponOrder(W_NumberWeaponOrder(s), 1);
- else if(substring(cvar, 0, 17) == "cl_weaponpriority" && strlen(cvar) == 18)
+ else if(substring(thiscvar, 0, 17) == "cl_weaponpriority" && strlen(thiscvar) == 18)
s = W_FixWeaponOrder(W_NumberWeaponOrder(s), 0);
- localcmd("cmd sentcvar ", cvar, " \"", s, "\"\n");
- strunzone(cvar);
+ localcmd("cmd sentcvar ", thiscvar, " \"", s, "\"\n");
+ strunzone(thiscvar);
}
else if(cmd == "spawn") {
s = argv(1);
// bInputType = 0 is key pressed, 1 is key released, 2 is mouse input.
// In the case of keyboard input, nPrimary is the ascii code, and nSecondary is 0.
// In the case of mouse input, nPrimary is xdelta, nSecondary is ydelta.
-float hudconf_active;
float CSQC_InputEvent(float bInputType, float nPrimary, float nSecondary)
{
local float bSkipKey;
bSkipKey = false;
- if(hudconf_active)
- if (HUD_Panel_InputEvent(bInputType, nPrimary, nSecondary))
- return true;
+ if (HUD_Panel_InputEvent(bInputType, nPrimary, nSecondary))
+ return true;
if (MapVote_InputEvent(bInputType, nPrimary, nSecondary))
return true;
f = ReadByte();
- sb_showscores_force = (f & 1);
+ scoreboard_showscores_force = (f & 1);
if(f & 2)
{
precache_pic("gfx/ons-cp-blue.tga");
precache_pic("gfx/ons-frame.tga");
precache_pic("gfx/ons-frame-team.tga");
- } else if(gametype == GAME_KEYHUNT) {
- precache_pic("gfx/sb_key_carrying");
- precache_pic("gfx/sb_key_carrying_outline");
}
if not(isdemo())
vote_active = 0;
}
+void Net_Notify() {
+ float type;
+ type = ReadByte();
+
+ if(type == CSQC_KILLNOTIFY)
+ {
+ HUD_KillNotify(ReadString(), ReadString(), ReadString(), ReadShort(), ReadByte());
+ }
+ else if(type == CSQC_CENTERPRINT)
+ {
+ HUD_Centerprint(ReadString(), ReadString(), ReadShort(), ReadByte());
+ }
+}
+
// CSQC_Parse_TempEntity : Handles all temporary entity network data in the CSQC layer.
// You must ALWAYS first acquire the temporary ID, which is sent as a byte.
// Return value should be 1 if CSQC handled the temporary entity, otherwise return 0 to have the engine process the event.
announce_snd = strzone(ReadString());
bHandled = true;
break;
+ case TE_CSQC_NOTIFY:
+ Net_Notify();
+ bHandled = true;
+ break;
default:
// No special logic for this temporary entity; return 0 so the engine can handle it
bHandled = false;
void CSQC_common_hud(void);
-void CSQC_kh_hud(void);
-void CSQC_ctf_hud(void);
void PostInit(void);
void CSQC_Demo_Camera();
float HUD_WouldDrawScoreboard ();
input_angles = warpzone_fixview_cl_viewangles;
view_angles = warpzone_fixview_angles;
- if(cvar("cl_lockview"))
+ if(cvar("cl_lockview") || hud_configure)
{
pmove_org = freeze_pmove_org;
input_angles = view_angles = freeze_input_angles;
view_set = 1;
}
- hudconf_active = cvar("_hud_configure");
- if(hudconf_active)
- R_SetView(VF_ANGLES, self.angles); // TODO: this should freeze the view as it is, not change it to '0 0 0' or whatever it currently does...
-
vid_width = w;
vid_height = h;
}
}
- hud_alpha_fg = cvar_or("hud_fg_alpha", 1) * (1 - cvar("_menu_alpha"));
- hud_currentammo = cvar("hud_showcurrentammo");
- hud_hudselector = cvar("hud_hudselector");
hud_accuracy_hud = cvar_or("hud_accuracy_hud", 1);
ColorTranslateMode = cvar("cl_stripcolorcodes");
activeweapon = getstati(STAT_SWITCHWEAPON);
CSQC_common_hud();
// crosshair goes VERY LAST
- if(!scoreboard_active && !ons_showmap && !camera_active && !hudconf_active) {
+ if(!scoreboard_active && !camera_active) {
// TrueAim check
float shottype;
float bullets, ring_scale;
bullets = 0;
#define CROSSHAIR_DRAW_RING(i,j,sz,wcross_name,wcross_alpha) \
- drawpic(wcross_origin - ('0.5 0 0' * (sz * wcross_size_x * ring_scale + i * wcross_blur) + '0 0.5 0' * (sz * wcross_size_y * ring_scale + j * wcross_blur)), strcat("gfx/hud/rifle_ring_", ftos(bullets)), sz * wcross_size * ring_scale, wcross_color, wcross_alpha, DRAWFLAG_NORMAL)
+ drawpic(wcross_origin - ('0.5 0 0' * (sz * wcross_size_x * ring_scale + i * wcross_blur) + '0 0.5 0' * (sz * wcross_size_y * ring_scale + j * wcross_blur)), strcat("gfx/hud/", cvar_string("hud_skin"), "/rifle_ring_", ftos(bullets)), sz * wcross_size * ring_scale, wcross_color, wcross_alpha, DRAWFLAG_NORMAL)
#define CROSSHAIR_DO_BLUR(M,sz,wcross_name,wcross_alpha) \
do \
cvar_set("vid_conheight", h0);
}
- if(hudconf_active)
+ if(hud_configure)
HUD_Panel_Mouse();
// be safe against triggerbots until everyone has the fixed engine
// this call is meant to overwrite the trace globals by something
}
*/
- if (sb_showscores)
+ if (scoreboard_showscores)
{
HUD_DrawScoreboard();
HUD_DrawCenterPrint();
#define raptor_g2 "gfx/vehicles/raptor_bombs.tga"
#define raptor_s "gfx/vehicles/shiled.tga"
-#define spider_a1 "gfx/hud/sb_rocket.tga"
-#define spider_a2 "gfx/sb_bullets.tga"
-
void CSQC_RAPTOR_HUD()
{
float rockets, reload, heat, hp, shield, energy;
drawpic(hudloc, raptor_g2, picsize, '1 1 1' * reload + '1 0 0' * (1 - reload), 1, DRAWFLAG_NORMAL);
- if (sb_showscores)
+ if (scoreboard_showscores)
{
HUD_DrawScoreboard();
HUD_DrawCenterPrint();
- if (sb_showscores)
+ if (scoreboard_showscores)
{
HUD_DrawScoreboard();
HUD_DrawCenterPrint();
// hud first
HUD_Main();
- // is this needed?
- //HUD_UpdatePlayerTeams();
-
- if (intermission == 2) // map voting screen
+ // scoreboard/accuracy
+ if (intermission == 2 && !scoreboard_showaccuracy && !scoreboard_showscores) // map voting screen
{
- if(sb_showaccuracy && spectatee_status != -1) {
- HUD_DrawAccuracyStats();
- }
- else if(sb_showscores) {
- HUD_DrawScoreboard();
- }
- else
- HUD_FinaleOverlay();
-
+ HUD_FinaleOverlay();
HUD_Reset();
}
- else if (sb_showscores || sb_showaccuracy || sb_showscores_force || getstati(STAT_HEALTH) <= 0 || intermission == 1)
- {
- if(sb_showaccuracy && spectatee_status != -1)
- HUD_DrawAccuracyStats();
- else
- HUD_DrawScoreboard();
+ else if(scoreboard_showaccuracy && spectatee_status != -1)
+ HUD_DrawAccuracyStats();
+ else
+ HUD_DrawScoreboard();
+ if (scoreboard_showscores || scoreboard_showaccuracy || scoreboard_showscores_force || getstati(STAT_HEALTH) <= 0 || intermission == 1)
HUD_Reset();
- }
+
break;
case HUD_SPIDERBOT:
string(string info, string key, string value, ...) infoadd = #226;
string(string in) uri_escape = #510;
+float stringtokeynum(string keyname) = #341;
string keynumtostring(float keynum) = #520;
string findkeysforcommand(string command) = #521;
#define PARTICLES_USECOLOR 2
vector particles_colormin, particles_colormax;
void(float effectindex, entity own, vector org_from, vector org_to, vector dir_from, vector dir_to, float countmultiplier, float flags) boxparticles = #502;
+string(string format, ...) sprintf = #627;
-.float silent;
-
void Ent_DamageInfo(float isNew)
{
- float hittype, dmg, rad, edge, thisdmg, forcemul;
- float issilent;
- vector force, org, thisforce;
+ float dmg, rad, edge, thisdmg, forcemul;
+ vector force, thisforce;
entity oldself;
oldself = self;
- hittype = ReadShort();
-
- issilent = (hittype & 0x8000);
- hittype = (hittype & 0x7FFF);
+ w_deathtype = ReadShort();
+ w_issilent = (w_deathtype & 0x8000);
+ w_deathtype = (w_deathtype & 0x7FFF);
- org_x = ReadCoord();
- org_y = ReadCoord();
- org_z = ReadCoord();
+ w_org_x = ReadCoord();
+ w_org_y = ReadCoord();
+ w_org_z = ReadCoord();
dmg = ReadByte();
rad = ReadByte();
else
forcemul = 1;
- for(self = findradius(org, rad); self; self = self.chain)
+ for(self = findradius(w_org, rad); self; self = self.chain)
{
if(rad)
{
- thisdmg = vlen(self.origin - org) / rad;
+ thisdmg = vlen(self.origin - w_org) / rad;
if(thisdmg >= 1)
continue;
if(dmg)
{
thisdmg = dmg + (edge - dmg) * thisdmg;
- thisforce = forcemul * vlen(force) * (thisdmg / dmg) * normalize(self.origin - org);
+ thisforce = forcemul * vlen(force) * (thisdmg / dmg) * normalize(self.origin - w_org);
}
else
{
thisdmg = 0;
- thisforce = forcemul * vlen(force) * normalize(self.origin - org);
+ thisforce = forcemul * vlen(force) * normalize(self.origin - w_org);
}
}
else
//print("pushed ", ftos(num_for_edict(self)), " loose\n");
}
- if(issilent)
+ if(w_issilent)
self.silent = 1;
if(self.event_damage)
- self.event_damage(thisdmg, hittype, org, thisforce);
+ self.event_damage(thisdmg, w_deathtype, w_org, thisforce);
}
self = oldself;
- // TODO spawn particle effects and sounds based on hittype
+ // TODO spawn particle effects and sounds based on w_deathtype
- if(!DEATH_ISSPECIAL(hittype))
+ if(!DEATH_ISSPECIAL(w_deathtype))
{
- float hitwep, secondary, bounce, headshot;
- vector org2, backoff;
- float r;
+ float hitwep;
- hitwep = DEATH_WEAPONOFWEAPONDEATH(hittype);
- secondary = hittype & HITTYPE_SECONDARY;
- bounce = hittype & HITTYPE_BOUNCE;
- headshot = hittype & HITTYPE_HEADSHOT;
- r = prandom();
+ hitwep = DEATH_WEAPONOFWEAPONDEATH(w_deathtype);
+ w_random = prandom();
- traceline(org - normalize(force) * 16, org + normalize(force) * 16, MOVE_NOMONSTERS, world);
+ traceline(w_org - normalize(force) * 16, w_org + normalize(force) * 16, MOVE_NOMONSTERS, world);
if(trace_fraction < 1 && hitwep != WEP_NEX && hitwep != WEP_MINSTANEX)
- backoff = trace_plane_normal;
+ w_backoff = trace_plane_normal;
else
- backoff = -1 * normalize(force);
-
- setorigin(self, org + backoff * 2); // for sound() calls
+ w_backoff = -1 * normalize(force);
+ setorigin(self, w_org + w_backoff * 2); // for sound() calls
- switch(hitwep)
- {
- case WEP_LASER:
- org2 = org + backoff * 6;
- pointparticles(particleeffectnum("laser_impact"), org2, backoff * 1000, 1);
- if(!issilent)
- sound(self, CHAN_PROJECTILE, "weapons/laserimpact.wav", VOL_BASE, ATTN_NORM);
- break;
- case WEP_SHOTGUN:
- org2 = org + backoff * 2;
- pointparticles(particleeffectnum("shotgun_impact"), org2, backoff * 1000, 1);
- if(!issilent)
- {
- if(r < 0.05)
- sound(self, CHAN_PROJECTILE, "weapons/ric1.wav", VOL_BASE, ATTN_NORM);
- else if(r < 0.1)
- sound(self, CHAN_PROJECTILE, "weapons/ric2.wav", VOL_BASE, ATTN_NORM);
- else if(r < 0.2)
- sound(self, CHAN_PROJECTILE, "weapons/ric3.wav", VOL_BASE, ATTN_NORM);
- }
- break;
- case WEP_UZI:
- org2 = org + backoff * 2;
- pointparticles(particleeffectnum("machinegun_impact"), org2, backoff * 1000, 1);
- if(!issilent)
- if(r < 0.05)
- sound(self, CHAN_PROJECTILE, "weapons/ric1.wav", VOL_BASE, ATTN_NORM);
- else if(r < 0.1)
- sound(self, CHAN_PROJECTILE, "weapons/ric2.wav", VOL_BASE, ATTN_NORM);
- else if(r < 0.2)
- sound(self, CHAN_PROJECTILE, "weapons/ric3.wav", VOL_BASE, ATTN_NORM);
- break;
- case WEP_GRENADE_LAUNCHER:
- org2 = org + backoff * 12;
- pointparticles(particleeffectnum("grenade_explode"), org2, '0 0 0', 1);
- if(!issilent)
- sound(self, CHAN_PROJECTILE, "weapons/grenade_impact.wav", VOL_BASE, ATTN_NORM);
- break;
- case WEP_ELECTRO:
- org2 = org + backoff * 6;
- if(secondary)
- {
- pointparticles(particleeffectnum("electro_ballexplode"), org2, '0 0 0', 1);
- if(!issilent)
- sound(self, CHAN_PROJECTILE, "weapons/electro_impact.wav", VOL_BASE, ATTN_NORM);
- }
- else
- {
- if(bounce)
- {
- // this is sent as "primary bounce" to distinguish it from secondary bounced balls
- pointparticles(particleeffectnum("electro_combo"), org2, '0 0 0', 1);
- if(!issilent)
- sound(self, CHAN_PROJECTILE, "weapons/electro_impact_combo.wav", VOL_BASE, ATTN_NORM);
- }
- else
- {
- pointparticles(particleeffectnum("electro_impact"), org2, '0 0 0', 1);
- if(!issilent)
- sound(self, CHAN_PROJECTILE, "weapons/electro_impact.wav", VOL_BASE, ATTN_NORM);
- }
- }
- break;
- case WEP_CRYLINK:
- org2 = org + backoff * 2;
- if(secondary)
- {
- pointparticles(particleeffectnum("crylink_impact"), org2, '0 0 0', 1);
- if(!issilent)
- sound(self, CHAN_PROJECTILE, "weapons/crylink_impact2.wav", VOL_BASE, ATTN_NORM);
- }
- else
- {
- pointparticles(particleeffectnum("crylink_impactbig"), org2, '0 0 0', 1);
- if(!issilent)
- sound(self, CHAN_PROJECTILE, "weapons/crylink_impact.wav", VOL_BASE, ATTN_NORM);
- }
- break;
- case WEP_NEX:
- org2 = org + backoff * 6;
- pointparticles(particleeffectnum("nex_impact"), org2, '0 0 0', 1);
- if(!issilent)
- sound(self, CHAN_PROJECTILE, "weapons/neximpact.wav", VOL_BASE, ATTN_NORM);
- break;
- case WEP_HAGAR:
- org2 = org + backoff * 6;
- pointparticles(particleeffectnum("hagar_explode"), org2, '0 0 0', 1);
- if(!issilent)
- {
- if (r<0.15)
- sound(self, CHAN_PROJECTILE, "weapons/hagexp1.wav", VOL_BASE, ATTN_NORM);
- else if (r<0.7)
- sound(self, CHAN_PROJECTILE, "weapons/hagexp2.wav", VOL_BASE, ATTN_NORM);
- else
- sound(self, CHAN_PROJECTILE, "weapons/hagexp3.wav", VOL_BASE, ATTN_NORM);
- }
- break;
- case WEP_ROCKET_LAUNCHER:
- org2 = org + backoff * 12;
- pointparticles(particleeffectnum("rocket_explode"), org2, '0 0 0', 1);
- if(!issilent)
- sound(self, CHAN_PROJECTILE, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
- break;
- case WEP_PORTO:
- print("Since when does Porto send DamageInfo?\n");
- break;
- case WEP_MINSTANEX:
- org2 = org + backoff * 6;
- pointparticles(particleeffectnum("nex_impact"), org2, '0 0 0', 1);
- if(!issilent)
- sound(self, CHAN_PROJECTILE, "weapons/neximpact.wav", VOL_BASE, ATTN_NORM);
- break;
- case WEP_HOOK:
- org2 = org + backoff * 2;
- pointparticles(particleeffectnum("hookbomb_explode"), org2, '0 0 0', 1);
- if(!issilent)
- sound(self, CHAN_PROJECTILE, "weapons/hookbomb_impact.wav", VOL_BASE, ATTN_NORM);
- break;
- case WEP_SEEKER:
- org2 = org + backoff * 6;
- if(secondary)
- {
- pointparticles(particleeffectnum("flac_explode"), org2, '0 0 0', 1);
- if(!issilent)
- {
- if (r<0.15)
- sound(self, CHAN_PROJECTILE, "weapons/flacexp1.wav", 1, ATTN_NORM);
- else if (r<0.7)
- sound(self, CHAN_PROJECTILE, "weapons/flacexp2.wav", 1, ATTN_NORM);
- else
- sound(self, CHAN_PROJECTILE, "weapons/flacexp3.wav", 1, ATTN_NORM);
- }
- }
- else
- {
- if(bounce)
- {
- pointparticles(particleeffectnum("hagar_explode"), org2, '0 0 0', 1);
- if(!issilent)
- {
- if (r<0.15)
- sound(self, CHAN_PROJECTILE, "weapons/tagexp1.wav", 1, ATTN_NORM);
- else if (r<0.7)
- sound(self, CHAN_PROJECTILE, "weapons/tagexp2.wav", 1, ATTN_NORM);
- else
- sound(self, CHAN_PROJECTILE, "weapons/tagexp3.wav", 1, ATTN_NORM);
- }
- }
- else if(headshot)
- {
- if(!issilent)
- sound(self, CHAN_PROJECTILE, "weapons/tag_impact.wav", 1, ATTN_NORM);
- }
- else
- {
- pointparticles(particleeffectnum("hagar_explode"), org2, '0 0 0', 1);
- if(!issilent)
- {
- if (r<0.15)
- sound(self, CHAN_PROJECTILE, "weapons/seekerexp1.wav", 1, ATTN_NORM);
- else if (r<0.7)
- sound(self, CHAN_PROJECTILE, "weapons/seekerexp2.wav", 1, ATTN_NORM);
- else
- sound(self, CHAN_PROJECTILE, "weapons/seekerexp3.wav", 1, ATTN_NORM);
- }
- }
- }
- break;
- case WEP_HLAC:
- org2 = org + backoff * 6;
- pointparticles(particleeffectnum("laser_impact"), org2, backoff * 1000, 1);
- if(!issilent)
- sound(self, CHAN_PROJECTILE, "weapons/laserimpact.wav", VOL_BASE, ATTN_NORM);
- break;
- case WEP_CAMPINGRIFLE:
- org2 = org + backoff * 2;
- pointparticles(particleeffectnum("machinegun_impact"), org2, backoff * 1000, 1);
- if(!issilent)
- {
- if(r < 0.2)
- sound(self, CHAN_PROJECTILE, "weapons/ric1.wav", VOL_BASE, ATTN_NORM);
- else if(r < 0.4)
- sound(self, CHAN_PROJECTILE, "weapons/ric2.wav", VOL_BASE, ATTN_NORM);
- else if(r < 0.5)
- sound(self, CHAN_PROJECTILE, "weapons/ric3.wav", VOL_BASE, ATTN_NORM);
- }
- break;
- case WEP_TUBA:
- break;
- case WEP_FIREBALL:
- if(secondary)
- {
- // firemine goes out silently
- }
- else
- {
- org2 = org + backoff * 16;
- pointparticles(particleeffectnum("fireball_explode"), org2, '0 0 0', 1);
- if(!issilent)
- sound(self, CHAN_PROJECTILE, "weapons/fireball_impact2.wav", VOL_BASE, ATTN_NORM * 0.25); // long range boom
- }
- break;
- default:
- dprint("Unhandled damage of weapon ", ftos(hitwep), "\n");
- break;
- }
+ (get_weaponinfo(hitwep)).weapon_func(WR_IMPACTEFFECT);
}
}
void DamageInfo_Precache()
{
- precache_sound("weapons/crylink_impact2.wav");
- precache_sound("weapons/crylink_impact.wav");
- precache_sound("weapons/electro_impact.wav");
- precache_sound("weapons/electro_impact_combo.wav");
- precache_sound("weapons/flacexp1.wav");
- precache_sound("weapons/flacexp2.wav");
- precache_sound("weapons/flacexp3.wav");
- precache_sound("weapons/grenade_impact.wav");
- precache_sound("weapons/hagexp1.wav");
- precache_sound("weapons/hagexp2.wav");
- precache_sound("weapons/hagexp3.wav");
- precache_sound("weapons/flacexp1.wav");
- precache_sound("weapons/flacexp2.wav");
- precache_sound("weapons/flacexp3.wav");
- precache_sound("weapons/hookbomb_impact.wav");
- precache_sound("weapons/laserimpact.wav");
- precache_sound("weapons/neximpact.wav");
- precache_sound("weapons/ric1.wav");
- precache_sound("weapons/ric2.wav");
- precache_sound("weapons/ric3.wav");
- precache_sound("weapons/rocket_impact.wav");
- precache_sound("weapons/fireball_impact.wav");
- precache_sound("weapons/fireball_impact2.wav");
- precache_sound("weapons/seekerexp1.wav");
- precache_sound("weapons/seekerexp2.wav");
- precache_sound("weapons/seekerexp3.wav");
- precache_sound("weapons/tagexp1.wav");
- precache_sound("weapons/tagexp2.wav");
- precache_sound("weapons/tagexp3.wav");
- precache_sound("weapons/tag_impact.wav");
+ float i;
+ for(i = WEP_FIRST; i <= WEP_LAST; ++i)
+ (get_weaponinfo(i)).weapon_func(WR_PRECACHE);
}
}
}
+// draw HUD element with image from gfx/hud/hud_skin/foo.tga if it exists, otherwise gfx/hud/default/foo.tga
+void drawpic_skin(vector pos, string pic, vector sz, vector color, float alpha, float drawflag) {
+ drawpic(pos, strcat("gfx/hud/", cvar_string("hud_skin"), "/", pic), sz, color, alpha, drawflag);
+}
+
+void drawpic_skin_expanding(vector pos, string pic, vector sz, vector rgb, float alpha, float flag, float fadelerp) {
+ drawpic_expanding(pos, strcat("gfx/hud/", cvar_string("hud_skin"), "/", pic), sz, rgb, alpha, flag, fadelerp);
+}
+
+void drawpic_skin_expanding_two(vector pos, string pic, vector sz, vector rgb, float alpha, float flag, float fadelerp) {
+ drawpic_expanding_two(pos, strcat("gfx/hud/", cvar_string("hud_skin"), "/", pic), sz, rgb, alpha, flag, fadelerp);
+}
+
// return HUD background color
vector HUD_GetBgColor()
{
vector HUD_AccuracyColor(float accuracy)
{
vector rgb;
- float yellow_accuracy = cvar("hud_accuracy_yellow"); // value at which this function returns yellow
+ float yellow_accuracy = cvar("hud_weaponicons_accuracy_yellow"); // value at which this function returns yellow
if(accuracy >= 100) {
rgb_x = 0;
rgb_y = 1;
hl_pos_y = pos_y - lettersize/20;
hl_pos_z = 0;
- drawpic(hl_pos, strcat("gfx/hud/sb_highlight_", l_length), hl_size, '1 1 1', alpha, dflags);
+ drawpic_skin(hl_pos, strcat("num_leading_", l_length), hl_size, '1 1 1', alpha, dflags);
}
if (stroke == 1)
if(minus)
{
if (stroke == 1)
- drawpic(pos, "gfx/hud/num_minus_stroke", vsize, rgb, alpha, dflags);
- drawpic(pos, "gfx/hud/num_minus", vsize, num_color, alpha, dflags);
+ drawpic_skin(pos, "num_minus_stroke", vsize, rgb, alpha, dflags);
+ drawpic_skin(pos, "num_minus", vsize, num_color, alpha, dflags);
pos_x += lettersize;
} else if(plus)
{
if (stroke == 1)
- drawpic(pos, "gfx/hud/num_plus_stroke", vsize, rgb, alpha, dflags);
- drawpic(pos, "gfx/hud/num_plus", vsize, num_color, alpha, dflags);
+ drawpic_skin(pos, "num_plus_stroke", vsize, rgb, alpha, dflags);
+ drawpic_skin(pos, "num_plus", vsize, num_color, alpha, dflags);
pos_x += lettersize;
}
{
tmp = substring(str, i, 1);
if (stroke == 1)
- drawpic(pos, strcat("gfx/hud/num_", tmp, "_stroke"), vsize, rgb, alpha, dflags);
- drawpic(pos, strcat("gfx/hud/num_", tmp), vsize, num_color, alpha, dflags);
+ drawpic_skin(pos, strcat("num_", tmp, "_stroke"), vsize, rgb, alpha, dflags);
+ drawpic_skin(pos, strcat("num_", tmp), vsize, num_color, alpha, dflags);
pos_x += lettersize;
}
}
-// color the number differently based on how big it is (used in the health/armor panel)
-void HUD_DrawXNum_Colored (vector pos, float x, float digits, float lettersize, float alpha)
+vector HUD_Get_Num_Color (float x, float maxvalue)
{
vector color;
- if(x > 200) {
+ if(x > maxvalue) {
color_x = 0;
color_y = 1;
color_z = 0;
}
- else if(x > 150) {
+ else if(x > maxvalue * 0.75) {
color_x = 0.4 - (x-150)*0.02 * 0.4; //red value between 0.4 -> 0
color_y = 0.9 + (x-150)*0.02 * 0.1; // green value between 0.9 -> 1
color_z = 0;
}
- else if(x > 100) {
+ else if(x > maxvalue * 0.5) {
color_x = 1 - (x-100)*0.02 * 0.6; //red value between 1 -> 0.4
color_y = 1 - (x-100)*0.02 * 0.1; // green value between 1 -> 0.9
color_z = 1 - (x-100)*0.02; // blue value between 1 -> 0
}
- else if(x > 50) {
+ else if(x > maxvalue * 0.25) {
color_x = 1;
color_y = 1;
color_z = 0.2 + (x-50)*0.02 * 0.8; // blue value between 0.2 -> 1
}
- else if(x > 20) {
+ else if(x > maxvalue * 0.1) {
color_x = 1;
color_y = (x-20)*90/27/100; // green value between 0 -> 1
color_z = (x-20)*90/27/100 * 0.2; // blue value between 0 -> 0.2
color_y = 0;
color_z = 0;
}
+ return color;
+}
+// color the number differently based on how big it is (used in the health/armor panel)
+void HUD_DrawXNum_Colored (vector pos, float x, float digits, float lettersize, float alpha)
+{
+ vector color;
+ color = HUD_Get_Num_Color (x, 200);
HUD_DrawXNum(pos, x, digits, 0, lettersize, color, 0, 0, alpha, DRAWFLAG_NORMAL);
}
==================
*/
-string HUD_Panel_GetName(float id)
+// Save the config
+void HUD_Panel_ExportCfg(string cfgname)
{
- switch(id) {
- case 0: return "weaponicons"; break;
- case 1: return "inventory"; break;
- case 2: return "powerups"; break;
- case 3: return "healtharmor"; break;
- case 4: return "notify"; break;
- case 5: return "timer"; break;
- case 6: return "radar"; break;
- case 7: return "score"; break;
- case 8: return "racetimer"; break;
- case 9: return "vote"; break;
- case 10: return "pressedkeys"; break;
- default: return "";
+ float fh;
+ fh = fopen(strcat("hud_", cvar_string("hud_skin"), "_", cfgname, ".cfg"), FILE_WRITE);
+ if(fh >= 0)
+ {
+ fputs(fh, strcat("seta hud_skin \"", cvar_string("hud_skin"), "\"", "\n"));
+ fputs(fh, strcat("seta hud_bg \"", cvar_string("hud_bg"), "\"", "\n"));
+ fputs(fh, strcat("seta hud_bg_color \"", cvar_string("hud_bg_color"), "\"", "\n"));
+ fputs(fh, strcat("seta hud_bg_color_team \"", cvar_string("hud_bg_color_team"), "\"", "\n"));
+ fputs(fh, strcat("seta hud_bg_alpha \"", cvar_string("hud_bg_alpha"), "\"", "\n"));
+ fputs(fh, strcat("seta hud_bg_border \"", cvar_string("hud_bg_border"), "\"", "\n"));
+ fputs(fh, strcat("seta hud_bg_padding \"", cvar_string("hud_bg_padding"), "\"", "\n"));
+ fputs(fh, strcat("seta hud_fg_alpha) \"", cvar_string("hud_fg_alpha"), "\"", "\n"));
+ fputs(fh, "\n");
+
+ fputs(fh, strcat("seta hud_dock \"", cvar_string("hud_dock"), "\"", "\n"));
+ fputs(fh, strcat("seta hud_dock_color \"", cvar_string("hud_dock_color"), "\"", "\n"));
+ fputs(fh, strcat("seta hud_dock_color_team \"", cvar_string("hud_dock_color_team"), "\"", "\n"));
+ fputs(fh, strcat("seta hud_dock_alpha \"", ftos(cvar("hud_dock_alpha")), "\"", "\n"));
+ fputs(fh, "\n");
+
+ fputs(fh, strcat("seta hud_progressbar_alpha ", ftos(cvar("hud_progressbar_alpha")), "\n"));
+ fputs(fh, strcat("seta hud_progressbar_strength_color \"", cvar_string("hud_progressbar_strength_color"), "\"", "\n"));
+ fputs(fh, strcat("seta hud_progressbar_shield_color \"", cvar_string("hud_progressbar_shield_color"), "\"", "\n"));
+ fputs(fh, strcat("seta hud_progressbar_health_color \"", cvar_string("hud_progressbar_health_color"), "\"", "\n"));
+ fputs(fh, strcat("seta hud_progressbar_armor_color \"", cvar_string("hud_progressbar_armor_color"), "\"", "\n"));
+ fputs(fh, strcat("seta hud_progressbar_fuel_color \"", cvar_string("hud_progressbar_fuel_color"), "\"", "\n"));
+ fputs(fh, strcat("seta hud_progressbar_nexball_color \"", cvar_string("hud_progressbar_nexball_color"), "\"", "\n"));
+ fputs(fh, "\n");
+
+ // common cvars for all panels
+ float i;
+ for (i = 0; i < HUD_PANEL_NUM; ++i)
+ {
+ fputs(fh, strcat("seta hud_", HUD_Panel_GetName(i), " ", ftos(cvar(strcat("hud_", HUD_Panel_GetName(i)))), "\n"));
+ fputs(fh, strcat("seta hud_", HUD_Panel_GetName(i), "_pos \"", cvar_string(strcat("hud_", HUD_Panel_GetName(i), "_pos")), "\"", "\n"));
+ fputs(fh, strcat("seta hud_", HUD_Panel_GetName(i), "_size \"", cvar_string(strcat("hud_", HUD_Panel_GetName(i), "_size")), "\"", "\n"));
+ fputs(fh, strcat("seta hud_", HUD_Panel_GetName(i), "_bg \"", cvar_string(strcat("hud_", HUD_Panel_GetName(i), "_bg")), "\"", "\n"));
+ fputs(fh, strcat("seta hud_", HUD_Panel_GetName(i), "_bg_color \"", cvar_string(strcat("hud_", HUD_Panel_GetName(i), "_bg_color")), "\"", "\n"));
+ fputs(fh, strcat("seta hud_", HUD_Panel_GetName(i), "_bg_color_team \"", cvar_string(strcat("hud_", HUD_Panel_GetName(i), "_bg_color_team")), "\"", "\n"));
+ fputs(fh, strcat("seta hud_", HUD_Panel_GetName(i), "_bg_alpha \"", cvar_string(strcat("hud_", HUD_Panel_GetName(i), "_bg_alpha")), "\"", "\n"));
+ fputs(fh, strcat("seta hud_", HUD_Panel_GetName(i), "_bg_border \"", cvar_string(strcat("hud_", HUD_Panel_GetName(i), "_bg_border")), "\"", "\n"));
+ fputs(fh, strcat("seta hud_", HUD_Panel_GetName(i), "_bg_padding \"", cvar_string(strcat("hud_", HUD_Panel_GetName(i), "_bg_padding")), "\"", "\n"));
+ switch(i) {
+ case 0:
+ fputs(fh, strcat("seta hud_", HUD_Panel_GetName(i), "_accuracy_yellow ", ftos(cvar(strcat("hud_", HUD_Panel_GetName(i), "_accuracy_yellow"))), "\n"));
+ break;
+ case 1:
+ fputs(fh, strcat("seta hud_", HUD_Panel_GetName(i), "_onlycurrent ", ftos(cvar(strcat("hud_", HUD_Panel_GetName(i), "_onlycurrent"))), "\n"));
+ break;
+ case 2:
+ fputs(fh, strcat("seta hud_", HUD_Panel_GetName(i), "_flip ", ftos(cvar(strcat("hud_", HUD_Panel_GetName(i), "_flip"))), "\n"));
+ fputs(fh, strcat("seta hud_", HUD_Panel_GetName(i), "_mirror ", ftos(cvar(strcat("hud_", HUD_Panel_GetName(i), "_mirror"))), "\n"));
+ break;
+ case 3:
+ fputs(fh, strcat("seta hud_", HUD_Panel_GetName(i), "_flip ", ftos(cvar(strcat("hud_", HUD_Panel_GetName(i), "_flip"))), "\n"));
+ fputs(fh, strcat("seta hud_", HUD_Panel_GetName(i), "_mirror ", ftos(cvar(strcat("hud_", HUD_Panel_GetName(i), "_mirror"))), "\n"));
+ break;
+ case 4:
+ fputs(fh, strcat("seta hud_", HUD_Panel_GetName(i), "_flip ", ftos(cvar(strcat("hud_", HUD_Panel_GetName(i), "_flip"))), "\n"));
+ fputs(fh, strcat("seta hud_", HUD_Panel_GetName(i), "_info_top ", ftos(cvar(strcat("hud_", HUD_Panel_GetName(i), "_info_top"))), "\n"));
+ break;
+ case 6:
+ fputs(fh, strcat("seta hud_", HUD_Panel_GetName(i), "_foreground_alpha ", ftos(cvar(strcat("hud_", HUD_Panel_GetName(i), "_foreground_alpha"))), "\n"));
+ case 9:
+ fputs(fh, strcat("seta hud_", HUD_Panel_GetName(i), "_alreadyvoted_alpha ", ftos(cvar(strcat("hud_", HUD_Panel_GetName(i), "_alreadyvoted_alpha"))), "\n"));
+ break;
+ }
+ fputs(fh, "\n");
+ }
+
+ print("^2Successfully exported to hud_", cvar_string("hud_skin"), "_", cfgname, ".cfg! (Note: It's saved in data/data/)\n");
}
+ fclose(fh);
}
-vector HUD_Panel_CheckLimitSize(float id, vector mySize)
+vector HUD_Panel_GetMinSize(float id)
{
+ vector mySize;
+ // note: please only set mySize_y on aspect ratio forced panels
switch(id) {
case 0:
- mySize_x = max(mySize_y * (1/10), mySize_x); // at least 1/10 * height
- mySize_y = max(mySize_x * (1/26), mySize_y); // at least 1/26 * width
+ mySize_x = 1/10; // at least 1/10 * height
+ mySize_y = 1/26; // at least 1/26 * width
break;
case 1:
- mySize_x = max(mySize_y * 0.7, mySize_x); // at least 0.7 * height
- break;
- case 2:
- mySize_x = max(mySize_y * 1.5, mySize_x); // at least 2 * height
+ if(cvar("hud_inventory_onlycurrent"))
+ mySize_y = 2/5; // 2/5 width
+ else
+ mySize_x = 0.7; // at least 0.7 * height
break;
case 3:
- mySize_x = max(mySize_y * 2, mySize_x); // at least 2 * height
+ if(cvar("hud_healtharmor") == 2)
+ {
+ mySize_x = 4.35; // 4.35 * height, trial and error...
+ mySize_y = 0.01; // "unlimited" ;)
+ }
+ break;
+ case 4:
+ mySize_x = 1.1; // 4/5 * height, trial and error...
+ mySize_y = 1/3; // 1/3 * width, trial and error...
break;
case 5:
- mySize_x = max(mySize_y * 2, mySize_x); // at least 2 * height
+ mySize_y = 1/4.1; // 1/4.1 * width, trial and error...
break;
case 7:
- mySize_y = (1/4) * mySize_x; // 1/4 * width
+ mySize_y = 1/4; // 1/4 * width
break;
case 8:
- mySize_y = (1/4) * mySize_x; // 1/4 * width
+ mySize_y = 1/4; // 1/4 * width
break;
case 9:
- mySize_y = (1/4) * mySize_x; // 1/4 * width
+ mySize_y = 1/4; // 1/4 * width
break;
case 10:
- mySize_y = 0.5898 * mySize_x; // 0.5898 * width, reason: bg has weird dimensions...
+ mySize_y = 1/2; // 1/2 * width
+ break;
+ case 11:
+ mySize_y = 0.5898; // 0.5898 * width, reason: bg has weird dimensions...
+ break;
+ case 13:
+ mySize_y = 0.25; // 0.25 * width, trial and error...
break;
}
+ if(!mySize_x && mySize_y)
+ mySize_x = 1/mySize_y;
return mySize;
}
mySize = eX * mySize_x * vid_conwidth + eY * mySize_y * vid_conheight;
+ if(disable_menu_alphacheck == 2 && id == highlightedPanel)
+ {
+ vector menu_enable_maxsize, menu_enable_size;
+ menu_enable_maxsize = '0 0 0'; // shut up FTEQCC
+ menu_enable_maxsize_x = 0.3 * vid_conwidth;
+ menu_enable_maxsize_y = 0.18 * vid_conheight;
+ if(mySize_x > mySize_y)
+ {
+ if(mySize_y > menu_enable_maxsize_y)
+ {
+ menu_enable_size_y = menu_enable_maxsize_y;
+ menu_enable_size_x = mySize_x * (menu_enable_maxsize_y/mySize_y);
+ mySize = (1 - cvar("_menu_alpha")) * mySize + (cvar("_menu_alpha")) * menu_enable_size;
+ }
+ }
+ else
+ {
+ if(mySize_x > menu_enable_maxsize_x)
+ {
+ menu_enable_size_x = menu_enable_maxsize_x;
+ menu_enable_size_y = mySize_y * (menu_enable_maxsize_x/mySize_x);
+ mySize = (1 - cvar("_menu_alpha")) * mySize + (cvar("_menu_alpha")) * menu_enable_size;
+ }
+ }
+ }
return mySize;
}
pos_x = vid_conwidth + pos_x;
if (pos_y < 0)
pos_y = vid_conheight + pos_y;
+
+ if(disable_menu_alphacheck == 2 && id == highlightedPanel)
+ {
+ vector mySize, menu_enable_panelpos;
+ mySize = HUD_Panel_GetSize(id);
+ if(mySize_x > mySize_y)
+ menu_enable_panelpos = eX * 0.5 * vid_conwidth - eX * 0.5 * mySize_x + eY * 0.82 * vid_conheight;
+ else
+ menu_enable_panelpos = eY * 0.5 * vid_conheight - eY * 0.5 * mySize_y + eX * 0.7 * vid_conwidth;
+ pos = (1 - cvar("_menu_alpha")) * pos + (cvar("_menu_alpha")) * menu_enable_panelpos;
+ }
return pos;
}
float HUD_Panel_GetBorder(float id)
{
- float border;
- border = cvar(strcat("hud_", HUD_Panel_GetName(id), "_bg_border"));
- if(!border)
- border = cvar("hud_bg_border");
- return border;
+ string border;
+ border = cvar_string(strcat("hud_", HUD_Panel_GetName(id), "_bg_border"));
+ if(border == "")
+ border = cvar_string("hud_bg_border");
+ return stof(border);
+}
+
+vector HUD_Panel_GetColor(float id)
+{
+ float f;
+ vector color_vec;
+ string color;
+
+ // fetch per-panel color
+ if(teamplay && cvar_string(strcat("hud_", HUD_Panel_GetName(id), "_bg_color_team")) != "") {
+ f = stof(getplayerkey(self.sv_entnum, "colors"));
+ color = vtos(colormapPaletteColor(mod(f, 16), 1) * cvar(strcat("hud_", HUD_Panel_GetName(id), "_bg_color_team")));
+ }
+ else
+ color = cvar_string(strcat("hud_", HUD_Panel_GetName(id), "_bg_color"));
+ color_vec = stov(color);
+
+ if(color == "") { // fetch default color
+ color = cvar_string("hud_bg_color");
+ color_vec = stov(color);
+ if(teamplay && cvar(strcat("hud_bg_color_team"))) {
+ f = stof(getplayerkey(self.sv_entnum, "colors"));
+ color_vec = colormapPaletteColor(mod(f, 16), 1) * cvar("hud_bg_color_team");
+ }
+ else if(color == "shirt") {
+ f = stof(getplayerkey(self.sv_entnum, "colors"));
+ color_vec = colormapPaletteColor(floor(f / 16), 0);
+ }
+ else if(color == "pants") {
+ f = stof(getplayerkey(self.sv_entnum, "colors"));
+ color_vec = colormapPaletteColor(mod(f, 16), 1);
+ }
+ }
+ else if(color == "shirt") {
+ f = stof(getplayerkey(self.sv_entnum, "colors"));
+ color_vec = colormapPaletteColor(floor(f / 16), 0);
+ }
+ else if(color == "pants") {
+ f = stof(getplayerkey(self.sv_entnum, "colors"));
+ color_vec = colormapPaletteColor(mod(f, 16), 1);
+ }
+ return color_vec;
+}
+
+vector HUD_Panel_Dock_GetColor(void)
+{
+ float f;
+ vector color_vec;
+ string color;
+ color = cvar_string("hud_dock_color");
+ color_vec = stov(color);
+ if(teamplay && cvar(strcat("hud_dock_color_team"))) {
+ f = stof(getplayerkey(self.sv_entnum, "colors"));
+ color_vec = colormapPaletteColor(mod(f, 16), 1) * cvar("hud_dock_color_team");
+ }
+ else if(color == "shirt") {
+ f = stof(getplayerkey(self.sv_entnum, "colors"));
+ color_vec = colormapPaletteColor(floor(f / 16), 0);
+ }
+ else if(color == "pants") {
+ f = stof(getplayerkey(self.sv_entnum, "colors"));
+ color_vec = colormapPaletteColor(mod(f, 16), 1);
+ }
+ return color_vec;
+}
+
+float HUD_Panel_GetBgAlpha(float id)
+{
+ string alpha;
+ alpha = cvar_string(strcat("hud_", HUD_Panel_GetName(id), "_bg_alpha"));
+ if(alpha == "")
+ alpha = cvar_string("hud_bg_alpha");
+
+ if(hud_configure && disable_menu_alphacheck == 2 && highlightedPanel == id) // do not set a minalpha cap when showing the config dialog for this panel
+ alpha = ftos((1 - cvar("_menu_alpha")) * max(cvar("hud_configure_bg_minalpha"), stof(alpha)) + (cvar("_menu_alpha")) * stof(alpha));
+ else if(hud_configure)
+ alpha = ftos(max(cvar("hud_configure_bg_minalpha"), stof(alpha)));
+
+ if(hud_configure && !cvar(strcat("hud_", HUD_Panel_GetName(id)))) // ALWAYS show disabled panels at 0.25 alpha when in config mode
+ return 0.25;
+
+ if(disable_menu_alphacheck == 2 && highlightedPanel == id) // don't fade this panel when showing the panel-specific menu dialog
+ return stof(alpha);
+ else
+ return stof(alpha) * menu_fade_alpha;
+}
+
+float HUD_Panel_GetFgAlpha(float id)
+{
+ float alpha;
+ alpha = hud_fg_alpha;
+
+ if(hud_configure && !cvar(strcat("hud_", HUD_Panel_GetName(id)))) // ALWAYS show disabled panels at 0.25 alpha when in config mode
+ return 0.25;
+
+ if(disable_menu_alphacheck == 2 && highlightedPanel == id) // don't fade this panel when showing the panel-specific menu dialog
+ return alpha;
+ else
+ return alpha * menu_fade_alpha;
+}
+
+float HUD_Panel_GetPadding(float id)
+{
+ string padding;
+ padding = cvar_string(strcat("hud_", HUD_Panel_GetName(id), "_bg_padding"));
+ if(padding == "")
+ padding = cvar_string("hud_bg_padding");
+
+ vector mySize;
+ mySize = HUD_Panel_GetSize(id);
+ float smallestsize;
+ smallestsize = min(mySize_x, mySize_y);
+ return min(smallestsize/2 - 5, stof(padding));
}
// draw the background/borders
-void HUD_Panel_DrawBg(float id, vector pos, vector mySize)
+void HUD_Panel_DrawBg(float id, vector pos, vector mySize, float alpha)
{
- if(!cvar("_hud_configure") && cvar_string(strcat("hud_", HUD_Panel_GetName(id), "_bg")) == "0")
+ if(!hud_configure && cvar_string(strcat("hud_", HUD_Panel_GetName(id), "_bg")) == "0")
return;
string bg;
if(bg == "")
bg = cvar_string("hud_bg");
+ if(bg == "0" && hud_configure) {
+ bg = "border"; // we probably want to see a background in config mode at all times...
+ }
+
if(bg != "0")
{
float border;
- border = HUD_Panel_GetBorder(id);
+ border = max(0.0000001, HUD_Panel_GetBorder(id)); // draw_BorderPicture does not like border = 0
vector color;
- if(cvar_string(strcat("hud_", HUD_Panel_GetName(id), "_bg_color")) != "")
- color = stov(cvar_string(strcat("hud_", HUD_Panel_GetName(id), "_bg_color")));
+ color = HUD_Panel_GetColor(id);
+
+ if(alpha)
+ alpha = HUD_Panel_GetBgAlpha(id) * alpha; // allow panels to fade in/out by passing an alpha value
else
- color = stov(cvar_string("hud_bg_color"));
+ alpha = HUD_Panel_GetBgAlpha(id);
- float alpha;
- alpha = cvar(strcat("hud_", HUD_Panel_GetName(id), "_bg_alpha"));
- if(!alpha)
- alpha = cvar("hud_bg_alpha");
- if(cvar("_hud_configure"))
- alpha = max(cvar("hud_configure_bg_minalpha"), alpha);
+ draw_BorderPicture(pos - '1 1 0' * border, strcat("gfx/hud/", cvar_string("hud_skin"), "/", bg), mySize + '1 1 0' * 2 * border, color, alpha, '1 1 0' * (border/BORDER_MULTIPLIER));
+ }
+}
- draw_BorderPicture(pos - '1 1 0' * border, strcat("gfx/hud/", bg), mySize + '1 1 0' * 2 * border, color, alpha, '1 1 0' * (border/BORDER_MULTIPLIER));
+void HUD_Panel_DrawProgressBar(vector pos, float vertical, vector mySize, vector color, float alpha, float drawflag)
+{
+//float drawsubpic(vector position, vector size, string pic, vector srcPosition, vector srcSize, vector rgb, float alpha, float flag) = #328;
+ string pic;
+ pic = strcat("gfx/hud/", cvar_string("hud_skin"), "/");
+ if(vertical) {
+ drawsubpic(pos, eY * min(mySize_y * 0.5, mySize_x) + eX * mySize_x, strcat(pic, "statusbar_vertical"), '0 0 0', '1 0.25 0', color, alpha, drawflag);
+ if(mySize_y/mySize_x > 2)
+ drawsubpic(pos + eY * mySize_x, eY * (mySize_y - 2 * mySize_x) + eX * mySize_x, strcat(pic, "statusbar_vertical"), '0 0.25 0', '1 0.5 0', color, alpha, drawflag);
+ drawsubpic(pos + eY * mySize_y - eY * min(mySize_y * 0.5, mySize_x), eY * min(mySize_y * 0.5, mySize_x) + eX * mySize_x, strcat(pic, "statusbar_vertical"), '0 0.75 0', '1 0.25 0', color, alpha, drawflag);
+ } else {
+ drawsubpic(pos, eX * min(mySize_x * 0.5, mySize_y) + eY * mySize_y, strcat(pic, "statusbar"), '0 0 0', '0.25 1 0', color, alpha, drawflag);
+ if(mySize_x/mySize_y > 2)
+ drawsubpic(pos + eX * mySize_y, eX * (mySize_x - 2 * mySize_y) + eY * mySize_y, strcat(pic, "statusbar"), '0.25 0 0', '0.5 1 0', color, alpha, drawflag);
+ drawsubpic(pos + eX * mySize_x - eX * min(mySize_x * 0.5, mySize_y), eX * min(mySize_x * 0.5, mySize_y) + eY * mySize_y, strcat(pic, "statusbar"), '0.75 0 0', '0.25 1 0', color, alpha, drawflag);
}
}
return stov(cvar_string(strcat("hud_progressbar_", item, "_color")));
}
-float resizeCorner; // 1 = topleft, 2 = topright, 3 = bottomleft, 4 = bottomright
-// check if resize will result in panel being moved into another panel. If so, return snapped vector, otherwise return the given vector
-vector HUD_Panel_CheckResize(float id, vector myPos, vector mySize)
+// check if move will result in panel being moved into another panel. If so, return snapped vector, otherwise return the given vector
+vector HUD_Panel_CheckMove(float id, vector myPos, vector mySize)
{
float i;
vector myTarget;
- myTarget = mySize;
+ myTarget = myPos;
vector targPos;
vector targSize;
vector myCenter;
vector targCenter;
+ myCenter = '0 0 0'; // shut up fteqcc, there IS a reference
+ targCenter = '0 0 0'; // shut up fteqcc, there IS a reference
- for (i = 0; i < panel_cnt; ++i) {
+ for (i = 0; i < HUD_PANEL_NUM; ++i) {
if(i == id || !HUD_Panel_CheckActive(i))
continue;
- targPos = HUD_Panel_GetPos(i);
- targSize = HUD_Panel_GetSize(i);
-
targPos = HUD_Panel_GetPos(i) - '1 1 0' * HUD_Panel_GetBorder(id);
targSize = HUD_Panel_GetSize(i) + '2 2 0' * HUD_Panel_GetBorder(id);
targCenter_x = targPos_x + 0.5 * targSize_x;
targCenter_y = targPos_y + 0.5 * targSize_y;
- float k, y;
- if(myCenter_x < targCenter_x && myCenter_y < targCenter_y && resizeCorner != 1) // top left (of target panel)
+ if(myCenter_x < targCenter_x && myCenter_y < targCenter_y) // top left (of the target panel)
{
if(myPos_x + mySize_x - targPos_x < myPos_y + mySize_y - targPos_y) // push it to the side
- myTarget_x = targPos_x - myPos_x;
+ myTarget_x = targPos_x - mySize_x;
else // push it upwards
- myTarget_y = targPos_y - myPos_y;
+ myTarget_y = targPos_y - mySize_y;
}
- else if(myCenter_x > targCenter_x && myCenter_y < targCenter_y && resizeCorner != 2) // top right
+ else if(myCenter_x > targCenter_x && myCenter_y < targCenter_y) // top right
{
if(targPos_x + targSize_x - myPos_x < myPos_y + mySize_y - targPos_y) // push it to the side
myTarget_x = targPos_x + targSize_x;
else // push it upwards
- myTarget_y = targPos_y - myPos_y;
+ myTarget_y = targPos_y - mySize_y;
}
else if(myCenter_x < targCenter_x && myCenter_y > targCenter_y) // bottom left
{
if(myPos_x + mySize_x - targPos_x < targPos_y + targSize_y - myPos_y) // push it to the side
- myTarget_x = targPos_x - myPos_x;
+ myTarget_x = targPos_x - mySize_x;
else // push it downwards
myTarget_y = targPos_y + targSize_y;
}
return myTarget;
}
-// TODO: checkResize
-float HUD_Panel_SetSize(float id, vector mySize)
+void HUD_Panel_SetPos(float id, vector pos)
{
- float didntresize;
-
- vector oldSize;
- oldSize = stov(cvar_string(strcat("hud_", HUD_Panel_GetName(id), "_size")));
+ vector oldPos;
+ oldPos = HUD_Panel_GetPos(id);
- vector myPos;
- myPos = HUD_Panel_GetPos(id);
+ vector mySize;
+ mySize = HUD_Panel_GetSize(id);
- // check for collisions
if(cvar("hud_configure_checkcollisions"))
- mySize = HUD_Panel_CheckResize(id, HUD_Panel_GetPos(id), mySize);
-
- mySize_x = bound(0.025 * vid_conwidth, mySize_x, vid_conwidth - myPos_x);
- mySize_y = bound(0.025 * vid_conheight, mySize_y, vid_conheight - myPos_y);
+ pos = HUD_Panel_CheckMove(id, pos, mySize);
- // cap against panel's own limits
- mySize = HUD_Panel_CheckLimitSize(id, mySize);
+ pos_x = bound(0, pos_x, vid_conwidth - mySize_x);
+ pos_y = bound(0, pos_y, vid_conheight - mySize_y);
- //mySize_x = bound(0.025 * vid_conwidth, mySize_x, vid_conwidth);
- //mySize_y = bound(0.025 * vid_conheight, mySize_y, vid_conheight);
+ if(cvar("hud_configure_grid"))
+ {
+ pos_x = floor(pos_x/cvar("hud_configure_grid_x") + 0.5) * cvar("hud_configure_grid_x");
+ pos_y = floor(pos_y/cvar("hud_configure_grid_y") + 0.5) * cvar("hud_configure_grid_y");
+ }
- // TODO: is this needed?
- // this is to check if (and how) SetPos should be called
- if(mySize_x == oldSize_x && mySize_y == oldSize_y)
- didntresize = 3; // didnt resize either
- else if(mySize_x == oldSize_x && mySize_y != oldSize_y)
- didntresize = 2; // resized Y
- else if(mySize_y == oldSize_y && mySize_x != oldSize_x)
- didntresize = 1; // resized X
+ if (pos_x + 0.5 * mySize_x > 0.5 * vid_conwidth)
+ pos_x = pos_x - vid_conwidth;
+ if (pos_y + 0.5 * mySize_y > 0.5 * vid_conheight)
+ pos_y = pos_y - vid_conheight;
string s;
- s = strcat(ftos(mySize_x/vid_conwidth), " ", ftos(mySize_y/vid_conheight));
- cvar_set(strcat("hud_", HUD_Panel_GetName(id), "_size"), s);
- return didntresize;
+ s = strcat(ftos(pos_x/vid_conwidth), " ", ftos(pos_y/vid_conheight));
+
+ cvar_set(strcat("hud_", HUD_Panel_GetName(id), "_pos"), s);
}
-// check if move will result in panel being moved into another panel. If so, return snapped vector, otherwise return the given vector
-vector HUD_Panel_CheckMove(float id, vector myPos, vector mySize)
+float HUD_Panel_CheckValidity_of_ResizeSuggestion(float id, vector mySize)
{
- float i;
+ vector oldSize;
+ oldSize = mySize;
- vector myTarget;
- myTarget = myPos;
+ // copy pasta from SetPosSize:
+ // minimum panel size cap
+ mySize_x = max(0.025 * vid_conwidth, mySize_x);
+ mySize_y = max(0.025 * vid_conheight, mySize_y);
+
+ if(id == 12) // some panels have their own restrictions, like the chat panel (which actually only moves the engine chat print around). Looks bad if it's too small.
+ {
+ mySize_x = max(17 * cvar("con_chatsize"), mySize_x);
+ mySize_y = max(2 * cvar("con_chatsize") + 2 * HUD_Panel_GetPadding(id), mySize_y);
+ }
+
+ // cap against panel's own limits
+ vector minSize;
+ minSize = HUD_Panel_GetMinSize(id); // mySize_x at least minSize_x * mySize_y, and vice versa
+
+ mySize_x = max(minSize_x * mySize_y, mySize_x);
+ mySize_y = max(minSize_y * mySize_x, mySize_y);
+
+ if(mySize == oldSize)
+ return 1;
+ else
+ return 0;
+}
+
+// check if resize will result in panel being moved into another panel. If so, return snapped vector, otherwise return the given vector
+vector HUD_Panel_CheckResize(float id, vector myPos, vector mySize, vector resizeorigin)
+{
+ float i;
vector targPos;
vector targSize;
vector myCenter;
vector targCenter;
+ myCenter = '0 0 0'; // shut up fteqcc, there IS a reference
+ targCenter = '0 0 0'; // shut up fteqcc, there IS a reference
- for (i = 0; i < panel_cnt; ++i) {
+ for (i = 0; i < HUD_PANEL_NUM; ++i) {
if(i == id || !HUD_Panel_CheckActive(i))
continue;
continue;
// OK, there IS a collision.
+ //
+
+ // Now check some special cases
+ // If the resizeorigin is too close to the target panel on either axis, we do not want to perform any collision avoidance on that axis
+ float Check_X, Check_Y;
+ Check_X = Check_Y = 1;
+ // check upper/left edges of targ panel
+ if(fabs(targPos_x - resizeorigin_x) < 0.025 * vid_conwidth)
+ Check_X = 0;
+ if(fabs(targPos_y - resizeorigin_y) < 0.025 * vid_conheight)
+ Check_Y = 0;
+ // check lower/right edges of targ panel
+ if(fabs(resizeorigin_x - (targPos_x + targSize_x)) < 0.025 * vid_conwidth)
+ Check_X = 0;
+ if(fabs(resizeorigin_y - (targPos_y + targSize_y)) < 0.025 * vid_conheight)
+ Check_Y = 0;
myCenter_x = myPos_x + 0.5 * mySize_x;
myCenter_y = myPos_y + 0.5 * mySize_y;
targCenter_x = targPos_x + 0.5 * targSize_x;
targCenter_y = targPos_y + 0.5 * targSize_y;
- float k, y;
- if(myCenter_x < targCenter_x && myCenter_y < targCenter_y) // top left (of the target panel)
+ if(myCenter_x < targCenter_x && myCenter_y < targCenter_y) // top left (of target panel)
{
- if(myPos_x + mySize_x - targPos_x < myPos_y + mySize_y - targPos_y) // push it to the side
- myTarget_x = targPos_x - mySize_x;
- else // push it upwards
- myTarget_y = targPos_y - mySize_y;
+ //if(!HUD_Panel_CheckValidity_of_ResizeSuggestion(id, eX * (targPos_x - myPos_x) + eY * (targPos_y - resizeorigin_y)))
+ // continue;
+
+ if(myPos_x + mySize_x - targPos_x < myPos_y + mySize_y - targPos_y && Check_X) // push it to the side
+ mySize_x = targPos_x - myPos_x;
+ else if(Check_Y) // push it upwards
+ mySize_y = targPos_y - resizeorigin_y;
}
else if(myCenter_x > targCenter_x && myCenter_y < targCenter_y) // top right
{
- if(targPos_x + targSize_x - myPos_x < myPos_y + mySize_y - targPos_y) // push it to the side
- myTarget_x = targPos_x + targSize_x;
- else // push it upwards
- myTarget_y = targPos_y - mySize_y;
+ //if(!HUD_Panel_CheckValidity_of_ResizeSuggestion(id, eX * (resizeorigin_x - (targPos_x + targSize_x)) + eY * (targPos_y - resizeorigin_y)))
+ // continue;
+
+ if(targPos_x + targSize_x - myPos_x < myPos_y + mySize_y - targPos_y && Check_X) // push it to the side
+ mySize_x = resizeorigin_x - (targPos_x + targSize_x);
+ else if(Check_Y) // push it upwards
+ mySize_y = targPos_y - resizeorigin_y;
}
else if(myCenter_x < targCenter_x && myCenter_y > targCenter_y) // bottom left
{
- if(myPos_x + mySize_x - targPos_x < targPos_y + targSize_y - myPos_y) // push it to the side
- myTarget_x = targPos_x - mySize_x;
- else // push it downwards
- myTarget_y = targPos_y + targSize_y;
+ //if(!HUD_Panel_CheckValidity_of_ResizeSuggestion(id, eX * (targPos_x - resizeorigin_x) + eY * (resizeorigin_y - (targPos_y + targSize_y))))
+ // continue;
+
+ if(myPos_x + mySize_x - targPos_x < targPos_y + targSize_y - myPos_y && Check_X) // push it to the side
+ mySize_x = targPos_x - resizeorigin_x;
+ else if(Check_Y) // push it upwards
+ mySize_y = resizeorigin_y - (targPos_y + targSize_y);
}
else if(myCenter_x > targCenter_x && myCenter_y > targCenter_y) // bottom right
{
- if(targPos_x + targSize_x - myPos_x < targPos_y + targSize_y - myPos_y) // push it to the side
- myTarget_x = targPos_x + targSize_x;
- else // push it downwards
- myTarget_y = targPos_y + targSize_y;
+ //if(!HUD_Panel_CheckValidity_of_ResizeSuggestion(id, eX * (resizeorigin_x - (targPos_x + targSize_x)) + eY * (resizeorigin_y - (targPos_y + targSize_y))))
+ // continue;
+
+ if(targPos_x + targSize_x - myPos_x < targPos_y + targSize_y - myPos_y && Check_X) // push it to the side
+ mySize_x = resizeorigin_x - (targPos_x + targSize_x);
+ else if(Check_Y) // push it upwards
+ mySize_y = resizeorigin_y - (targPos_y + targSize_y);
}
}
- return myTarget;
+ return mySize;
}
-void HUD_Panel_SetPos(float id, vector pos, float didntresize)
+void HUD_Panel_SetPosSize(float id, vector resizeorigin)
{
- vector oldPos;
- oldPos = HUD_Panel_GetPos(id);
- if(didntresize == 2)
- pos_x = oldPos_x;
- else if(didntresize == 1)
- pos_y = oldPos_y;
- else if(didntresize == 3)
- return;
+ vector mySize, myPos;
+
+ if(resizeCorner == 1) {
+ mySize_x = resizeorigin_x - (mousepos_x - panel_click_distance_x);
+ mySize_y = resizeorigin_y - (mousepos_y - panel_click_distance_y);
+ } else if(resizeCorner == 2) {
+ mySize_x = mousepos_x + panel_click_distance_x - resizeorigin_x;
+ mySize_y = panel_click_distance_y + resizeorigin_y - mousepos_y;
+ } else if(resizeCorner == 3) {
+ mySize_x = resizeorigin_x + panel_click_distance_x - mousepos_x;
+ mySize_y = mousepos_y + panel_click_distance_y - resizeorigin_y;
+ } else { // resizeCorner == 4
+ mySize_x = mousepos_x - (resizeorigin_x - panel_click_distance_x);
+ mySize_y = mousepos_y - (resizeorigin_y - panel_click_distance_y);
+ }
- vector mySize;
- mySize = HUD_Panel_GetSize(id);
+ // minimum panel size cap
+ mySize_x = max(0.025 * vid_conwidth, mySize_x);
+ mySize_y = max(0.025 * vid_conheight, mySize_y);
+
+ if(id == 12) // some panels have their own restrictions, like the chat panel (which actually only moves the engine chat print around). Looks bad if it's too small.
+ {
+ mySize_x = max(17 * cvar("con_chatsize"), mySize_x);
+ mySize_y = max(2 * cvar("con_chatsize") + 2 * HUD_Panel_GetPadding(id), mySize_y);
+ }
+
+ // cap against panel's own limits
+ vector minSize;
+ minSize = HUD_Panel_GetMinSize(id); // mySize_x at least minSize_x * mySize_y, and vice versa
+
+ mySize_x = max(minSize_x * mySize_y, mySize_x);
+ mySize_y = max(minSize_y * mySize_x, mySize_y);
+
+ // collision testing|
+ // -----------------+
+
+ // we need to know pos at this stage, but it might still change later if we hit a screen edge/other panel (?)
+ if(resizeCorner == 1) {
+ myPos_x = resizeorigin_x - mySize_x;
+ myPos_y = resizeorigin_y - mySize_y;
+ } else if(resizeCorner == 2) {
+ myPos_x = resizeorigin_x;
+ myPos_y = resizeorigin_y - mySize_y;
+ } else if(resizeCorner == 3) {
+ myPos_x = resizeorigin_x - mySize_x;
+ myPos_y = resizeorigin_y;
+ } else { // resizeCorner == 4
+ myPos_x = resizeorigin_x;
+ myPos_y = resizeorigin_y;
+ }
+
+ // left/top screen edges
+ mySize_x = min(myPos_x + mySize_x, mySize_x);
+ mySize_y = min(myPos_y + mySize_y, mySize_y);
+
+ // bottom/right screen edges
+ mySize_x = min(vid_conwidth - myPos_x, mySize_x);
+ mySize_y = min(vid_conheight - myPos_y, mySize_y);
if(cvar("hud_configure_checkcollisions"))
- pos = HUD_Panel_CheckMove(id, pos, mySize);
+ mySize = HUD_Panel_CheckResize(id, myPos, mySize, resizeorigin);
- pos_x = bound(0, pos_x, vid_conwidth - mySize_x);
- pos_y = bound(0, pos_y, vid_conheight - mySize_y);
+ if(cvar("hud_configure_grid"))
+ {
+ mySize_x = floor(mySize_x/cvar("hud_configure_grid_x") + 0.5) * cvar("hud_configure_grid_x");
+ mySize_y = floor(mySize_y/cvar("hud_configure_grid_y") + 0.5) * cvar("hud_configure_grid_y");
+ }
- if (pos_x + 0.5 * mySize_x > 0.5 * vid_conwidth)
- pos_x = pos_x - vid_conwidth;
- if (pos_y + 0.5 * mySize_y > 0.5 * vid_conheight)
- pos_y = pos_y - vid_conheight;
+ // do another pos check, as size might have changed by now
+ if(resizeCorner == 1) {
+ myPos_x = resizeorigin_x - mySize_x;
+ myPos_y = resizeorigin_y - mySize_y;
+ } else if(resizeCorner == 2) {
+ myPos_x = resizeorigin_x;
+ myPos_y = resizeorigin_y - mySize_y;
+ } else if(resizeCorner == 3) {
+ myPos_x = resizeorigin_x - mySize_x;
+ myPos_y = resizeorigin_y;
+ } else { // resizeCorner == 4
+ myPos_x = resizeorigin_x;
+ myPos_y = resizeorigin_y;
+ }
string s;
- s = strcat(ftos(pos_x/vid_conwidth), " ", ftos(pos_y/vid_conheight));
+ s = strcat(ftos(mySize_x/vid_conwidth), " ", ftos(mySize_y/vid_conheight));
+ cvar_set(strcat("hud_", HUD_Panel_GetName(id), "_size"), s);
+ s = strcat(ftos(myPos_x/vid_conwidth), " ", ftos(myPos_y/vid_conheight));
cvar_set(strcat("hud_", HUD_Panel_GetName(id), "_pos"), s);
}
float mouseClicked;
float prevMouseClicked; // previous state
+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 HUD_Panel_InputEvent(float bInputType, float nPrimary, float nSecondary)
{
- prevMouseClicked = mouseClicked;
+ if(!hud_configure)
+ return false;
+
+ // allow console bind to work
+ string con_keys;
+ float keys;
+ con_keys = findkeysforcommand("toggleconsole");
+ keys = tokenize(con_keys);
+
+ float hit_con_bind, i;
+ for (i = 0; i < keys; ++i)
+ {
+ if(nPrimary == stof(argv(i)))
+ hit_con_bind = 1;
+ }
+
if(nPrimary == K_MOUSE1)
{
if(bInputType == 0) { // key pressed
mouseClicked = 1;
return true;
}
- if(bInputType == 1) {// key released
+ else if(bInputType == 1) {// key released
mouseClicked = 0;
return true;
}
}
- return false;
+ else if(nPrimary == K_ESCAPE)
+ {
+ disable_menu_alphacheck = 1;
+ menu_enabled = 1;
+ menu_enabled_time = time;
+ localcmd("menu_showhudexit\n");
+ }
+
+ else if(hit_con_bind)
+ return false;
+
+ return true; // Suppress ALL other input
}
-vector mousepos, mouseprevpos;
-vector panel_click_distance; // mouse cursor distance from the top left corner of the panel (saved only upon a click)
-vector panel_click_pos; // panel pos (saved only upon a click)
-vector panel_click_size; // panel size (saved only upon a click)
-float highlightedPanel;
-float highlightedAction; // 0 = nothing, 1 = move, 2 = resize
void HUD_Panel_Mouse()
{
- if(mouseClicked == 0) {
+ // 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 (cvar("_menu_alpha") == 0 && time - menu_enabled_time > 0.5)
+ menu_enabled = 0;
+
+ /*
+ print("Disable menu_alphacheck: ", ftos(disable_menu_alphacheck), "\n");
+ print("Highlighted: ", ftos(highlightedPanel), "\n");
+ print("Menu alpha: ", cvar_string("_menu_alpha"), "\n");
+ */
+
+ if(mouseClicked == 0 && disable_menu_alphacheck != 2) { // don't reset these variables in disable_menu_alphacheck mode 2!
highlightedPanel = -1;
highlightedAction = 0;
}
mousepos_x = bound(0, mousepos_x, vid_conwidth);
mousepos_y = bound(0, mousepos_y, vid_conheight);
- drawpic(mousepos, "gfx/menu/default/cursor.tga", '32 32 0', '1 1 1', 1, hud_alpha_fg);
+ drawpic(mousepos, strcat("gfx/menu/", cvar_string("menu_skin"), "/cursor.tga"), '32 32 0', '1 1 1', 1, DRAWFLAG_NORMAL);
if(mouseClicked)
{
vector panelPos;
vector panelSize;
- for(i = 0; i <= panel_cnt; ++i)
+ for(i = 0; i < HUD_PANEL_NUM; ++i)
{
panelPos = HUD_Panel_GetPos(i);
panelSize = HUD_Panel_GetSize(i);
{
if(prevMouseClicked == 0)
{
- panel_click_distance = mousepos - panelPos;
- panel_click_pos = panelPos;
- panel_click_size = panelSize;
+ if(highlightedAction == 1)
+ panel_click_distance = mousepos - panelPos;
+ else if(highlightedAction == 2)
+ {
+ if(resizeCorner == 1) {
+ panel_click_distance = mousepos - panelPos;
+ panel_click_resizeorigin = panelPos + panelSize;
+ } else if(resizeCorner == 2) {
+ panel_click_distance_x = panelSize_x - mousepos_x + panelPos_x;
+ panel_click_distance_y = mousepos_y - panelPos_y;
+ panel_click_resizeorigin = panelPos + eY * panelSize_y;
+ } else if(resizeCorner == 3) {
+ panel_click_distance_x = mousepos_x - panelPos_x;
+ panel_click_distance_y = panelSize_y - mousepos_y + panelPos_y;
+ panel_click_resizeorigin = panelPos + eX * panelSize_x;
+ } else if(resizeCorner == 4) {
+ panel_click_distance = panelSize - mousepos + panelPos;
+ panel_click_resizeorigin = panelPos;
+ }
+ }
}
if(highlightedAction == 1)
- HUD_Panel_SetPos(i, mousepos - panel_click_distance, 0);
+ HUD_Panel_SetPos(i, mousepos - panel_click_distance);
else if(highlightedAction == 2)
- {
- float didntresize; // panel too big/too small, dont resize (also has to affect moving)
- if(resizeCorner == 1) {
- didntresize = HUD_Panel_SetSize(i, panelSize + mouseprevpos - mousepos);
- HUD_Panel_SetPos(i, mousepos - panel_click_distance, didntresize);
- }
- if(resizeCorner == 2) {
- didntresize = HUD_Panel_SetSize(i, eY * panel_click_size_y + eX * (mousepos_x - panelPos_x - (panel_click_distance_x - panel_click_size_x))
- + eY * (panel_click_distance_y + (panel_click_pos_y - mousepos_y)));
- HUD_Panel_SetPos(i, eX * panelPos_x + eY * (mousepos_y - panel_click_distance_y), didntresize);
- }
- if(resizeCorner == 3) {
- didntresize = HUD_Panel_SetSize(i, panelSize + eX * (mouseprevpos_x - mousepos_x) + eY * (mousepos_y - mouseprevpos_y));
- HUD_Panel_SetPos(i, eX * (mousepos_x - panel_click_distance_x) + eY * panelPos_y, didntresize);
- }
- if(resizeCorner == 4) {
- HUD_Panel_SetSize(i, mousepos - panelPos - (panel_click_distance - panel_click_size));
- }
- }
+ HUD_Panel_SetPosSize(i, panel_click_resizeorigin);
}
}
+
+ // doubleclick check
+ 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_time = time;
+ localcmd("menu_showhudoptions ", ftos(highlightedPanel), "\n");
+ return;
+ }
+ if(prevMouseClicked == 0)
+ {
+ prevMouseClickedTime = time;
+ prevMouseClickedPos = mousepos;
+ }
}
- mouseprevpos = mousepos;
prevMouseClicked = mouseClicked;
}
-/*void HUD_DrawDockEdge(float id, vector p1, vector p2, float target)
-{
- vector pos;
- vector size;
-
- pos =
-*/ // maybe one day, since this will be quite complicated
-
// Weapon icons (#0)
//
-
float weaponspace[10];
void HUD_WeaponIcons_Clear()
{
weaponorder[j] = h;
}
+string weaponorder_cmp_str;
float weaponorder_cmp(float i, float j, entity pass)
{
- float d, ii, ij;
- d = mod(weaponorder[i].impulse + 9, 10) - mod(weaponorder[j].impulse + 9, 10);
- if(d)
- return d;
- d = weaponorder[i].weapon - weaponorder[j].weapon;
- return d;
+ float ai, aj;
+ ai = strstrofs(weaponorder_cmp_str, sprintf(" %d ", weaponorder[i].weapon), 0);
+ aj = strstrofs(weaponorder_cmp_str, sprintf(" %d ", weaponorder[j].weapon), 0);
+ return aj - ai; // the string is in REVERSE order (higher prio at the right is what we want, but higher prio first is the string)
}
-void HUD_WeaponIcons()
+void HUD_WeaponIcons(void)
{
- float alpha, height, accuracybar_height, stat_weapons; // "constants"
- vector pos, mySize, mysize, mypos, accuracy_color;
- float i, id, fade, weapon_stats, weapon_hit, weapon_damage, weapon_cnt; // variables
+ float id = HUD_PANEL_WEAPONICONS;
+ float alpha, stat_weapons; // "constants"
+ vector pos, mySize, accuracy_color;
+ float i, weapid, fade, weapon_stats, weapon_hit, weapon_damage, weapon_cnt; // variables
- pos = HUD_Panel_GetPos(0);
- mySize = HUD_Panel_GetSize(0);
- accuracybar_height = cvar_or("hud_weaponicons_accuracybar_height", 3);
+ pos = HUD_Panel_GetPos(id);
+ mySize = HUD_Panel_GetSize(id);
stat_weapons = getstati(STAT_WEAPONS);
for(i = WEP_FIRST; i <= WEP_LAST; ++i)
{
self = get_weaponinfo(i);
- if(self.weapons && (self.impulse >= 0) && (stat_weapons & self.weapons) || cvar("_hud_configure"))
+ if(self.weapons && (self.impulse >= 0) && (stat_weapons & self.weapons) || hud_configure)
{
weaponorder[weapon_cnt] = self;
++weapon_cnt;
}
}
+
+ // TODO make this configurable
+ weaponorder_cmp_str = strcat(" ", weaponorder_byimpulse, " ");
heapsort(weapon_cnt, weaponorder_swap, weaponorder_cmp, world);
- HUD_Panel_DrawBg(0, pos, mySize);
+ HUD_Panel_DrawBg(id, pos, mySize, 0);
+ float padding;
+ padding = HUD_Panel_GetPadding(id);
+ if(padding)
+ {
+ pos += '1 1 0' * padding;
+ mySize -= '2 2 0' * padding;
+ }
// hits
weapon_stats = getstati(STAT_DAMAGE_HITS);
for(i = 0; i < weapon_cnt; ++i)
{
self = weaponorder[i];
- if((self.weapons && (self.impulse >= 0) && (stat_weapons & self.weapons)) || cvar("_hud_configure"))
+ if((self.weapons && (self.impulse >= 0) && (stat_weapons & self.weapons)) || hud_configure)
{
- id = self.impulse;
+ weapid = self.impulse;
alpha = (self.weapon == activeweapon) ? 1 : 0.6;
weapon_hit = weapon_hits[self.weapon-WEP_FIRST];
weapon_damage = weapon_fired[self.weapon-WEP_FIRST];
+ // draw background behind currently selected weapon
if(self.weapon == activeweapon)
- drawpic(pos + eX * column * mySize_x*(1/columns) + eY * row * mySize_y*(1/rows), "gfx/hud/sb_ammobg", eX * mySize_x*(1/columns) + eY * mySize_y*(1/rows), '1 1 1', fade * hud_alpha_fg, DRAWFLAG_NORMAL);
- drawpic(pos + eX * column * mySize_x*(1/columns) + eY * row * mySize_y*(1/rows), strcat("gfx/hud/inv_weapon", self.netname), eX * mySize_x*(1/columns) + eY * mySize_y*(1/rows), '1 1 1', fade * hud_alpha_fg, DRAWFLAG_NORMAL);
-
- if(cvar_or("hud_weaponicons_number", 1))
- drawstring(pos + eX * column * mySize_x*(1/columns) + eY * row * mySize_y*(1/rows), ftos(id), '1 1 0' * 0.5 * mySize_y*(1/rows), '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
+ drawpic_skin(pos + eX * column * mySize_x*(1/columns) + eY * row * mySize_y*(1/rows), "weapon_current_bg", eX * mySize_x*(1/columns) + eY * mySize_y*(1/rows), '1 1 1', fade * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
// draw the weapon accuracy on the HUD
if(hud_accuracy_hud && !(gametype == GAME_RACE || gametype == GAME_CTS))
accuracy_color = HUD_AccuracyColor(weapon_stats);
if(weapon_damage)
- drawpic(pos + eX * column * mySize_x*(1/columns) + eY * row * mySize_y*(1/rows) - '2 0 0' + eY * (mySize_y/rows - accuracybar_height), "gfx/hud/sb_accuracy_bar.tga", eX * mySize_x*(1/columns) + eY * accuracybar_height, accuracy_color, hud_alpha_fg, DRAWFLAG_NORMAL);
+ drawpic_skin(pos + eX * column * mySize_x*(1/columns) + eY * row * mySize_y*(1/rows), "weapon_accuracy", eX * mySize_x*(1/columns) + eY * mySize_y*(1/rows), accuracy_color, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
}
+
+ // draw the weapon icon
+ drawpic_skin(pos + eX * column * mySize_x*(1/columns) + eY * row * mySize_y*(1/rows), strcat("weapon", self.netname), eX * mySize_x*(1/columns) + eY * mySize_y*(1/rows), '1 1 1', fade * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+
+ if(cvar_or("hud_weaponicons_number", 1))
+ drawstring(pos + eX * column * mySize_x*(1/columns) + eY * row * mySize_y*(1/rows), ftos(weapid), '1 1 0' * 0.5 * mySize_y*(1/rows), '1 1 1', HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
}
++row;
// Inventory (#1)
//
-
float GetAmmoStat(float i)
{
switch(i)
{
switch(i)
{
- case 0: return "gfx/hud/sb_shells";
- case 1: return "gfx/hud/sb_bullets";
- case 2: return "gfx/hud/sb_rocket";
- case 3: return "gfx/hud/sb_cells";
- case 4: return "gfx/hud/sb_fuel";
+ case 0: return "ammo_shells";
+ case 1: return "ammo_bullets";
+ case 2: return "ammo_rockets";
+ case 3: return "ammo_cells";
+ case 4: return "ammo_fuel";
default: return "";
}
}
-void HUD_Inventory()
+void HUD_Inventory(void)
{
+ float id = HUD_PANEL_INVENTORY;
float i;
float stat_items;
vector pos, mySize, mysize, mypos;
- pos = HUD_Panel_GetPos(1);
- mySize = HUD_Panel_GetSize(1);
+ pos = HUD_Panel_GetPos(id);
+ mySize = HUD_Panel_GetSize(id);
- HUD_Panel_DrawBg(1, pos, mySize);
+ HUD_Panel_DrawBg(id, pos, mySize, 0);
+ float padding;
+ padding = HUD_Panel_GetPadding(id);
+ if(padding)
+ {
+ pos += '1 1 0' * padding;
+ mySize -= '2 2 0' * padding;
+ }
// ammo
stat_items = getstati(STAT_ITEMS);
for (i = 0; i < 4; ++i) {
float a;
a = getstati(GetAmmoStat(i)); // how much ammo do we have of type i?
- if(cvar("_hud_configure"))
+ if(hud_configure)
a = 100;
if(cvar("hud_inventory_onlycurrent")) {
- if (stat_items & GetAmmoItemCode(i)) {
- drawpic(pos, "gfx/hud/sb_ammobg", mySize, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
- drawpic(pos + eY * 0.05 * mySize_y, GetAmmoPicture(i), '1 1 0' * 0.8 * mySize_y, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
+ if(hud_configure)
+ i = 2;
+ if (stat_items & GetAmmoItemCode(i) || hud_configure) {
+ drawpic_skin(pos, GetAmmoPicture(i), '1 1 0' * mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
if(a < 10)
- HUD_DrawXNum(pos + eX * 0.8 * mySize_y + eY * 0.25 * mySize_y, a, strlen(ftos(a)), 0, 0.5 * mySize_y, '0.7 0 0', 0, 0, hud_alpha_fg, DRAWFLAG_NORMAL);
+ HUD_DrawXNum(pos + eX * mySize_y + eY * 0.25 * mySize_y, a, strlen(ftos(a)), 0, 0.5 * mySize_y, '0.7 0 0', 0, 0, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
else
- HUD_DrawXNum(pos + eX * 0.8 * mySize_y + eY * 0.25 * mySize_y, a, strlen(ftos(a)), 0, 0.5 * mySize_y, '1 1 1', 0, 0, hud_alpha_fg, DRAWFLAG_NORMAL);
+ HUD_DrawXNum(pos + eX * mySize_y + eY * 0.25 * mySize_y, a, strlen(ftos(a)), 0, 0.5 * mySize_y, '1 1 1', 0, 0, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
}
+ if(hud_configure)
+ break;
} else {
if (a > 0) {
if(mySize_x/mySize_y >= 10) { // arrange horizontally
}
if (stat_items & GetAmmoItemCode(i))
- drawpic(mypos, "gfx/hud/sb_ammobg", mysize, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
- drawpic(mypos + eY * 0.05 * mysize_y, GetAmmoPicture(i), '1 1 0' * 0.8 * mysize_y, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
+ drawpic_skin(mypos, "ammo_current_bg", mysize, '1 1 1', HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ drawpic_skin(mypos + eY * 0.05 * mysize_y, GetAmmoPicture(i), '1 1 0' * 0.8 * mysize_y, '1 1 1', HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
if (a < 10) {
if(stat_items & GetAmmoItemCode(i))
- HUD_DrawXNum(mypos + eX * 0.8 * mysize_y + eY * 0.25 * mysize_y, a, strlen(ftos(a)), 0, 0.5 * mysize_y, '0.7 0 0', 0, 0, hud_alpha_fg, DRAWFLAG_NORMAL);
+ HUD_DrawXNum(mypos + eX * 0.8 * mysize_y + eY * 0.25 * mysize_y, a, strlen(ftos(a)), 0, 0.5 * mysize_y, '0.7 0 0', 0, 0, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
else
- HUD_DrawXNum(mypos + eX * 0.8 * mysize_y + eY * 0.25 * mysize_y, a, strlen(ftos(a)), 0, 0.5 * mysize_y, '0.7 0 0', 0, 0, hud_alpha_fg * 0.7, DRAWFLAG_NORMAL);
+ HUD_DrawXNum(mypos + eX * 0.8 * mysize_y + eY * 0.25 * mysize_y, a, strlen(ftos(a)), 0, 0.5 * mysize_y, '0.7 0 0', 0, 0, HUD_Panel_GetFgAlpha(id) * 0.7, DRAWFLAG_NORMAL);
} else {
if(stat_items & GetAmmoItemCode(i))
- HUD_DrawXNum(mypos + eX * 0.8 * mysize_y + eY * 0.25 * mysize_y, a, strlen(ftos(a)), 0, 0.5 * mysize_y, '1 1 1', 0, 0, hud_alpha_fg, DRAWFLAG_NORMAL);
+ HUD_DrawXNum(mypos + eX * 0.8 * mysize_y + eY * 0.25 * mysize_y, a, strlen(ftos(a)), 0, 0.5 * mysize_y, '1 1 1', 0, 0, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
else
- HUD_DrawXNum(mypos + eX * 0.8 * mysize_y + eY * 0.25 * mysize_y, a, strlen(ftos(a)), 0, 0.5 * mysize_y, '0.7 0.7 0.7', 0, 0, hud_alpha_fg * 0.7, DRAWFLAG_NORMAL);
+ HUD_DrawXNum(mypos + eX * 0.8 * mysize_y + eY * 0.25 * mysize_y, a, strlen(ftos(a)), 0, 0.5 * mysize_y, '0.7 0.7 0.7', 0, 0, HUD_Panel_GetFgAlpha(id) * 0.7, DRAWFLAG_NORMAL);
}
}
}
// Powerups (#2)
-float shield_maxtime;
-float strength_maxtime;
-void HUD_Powerups() {
+//
+void HUD_Powerups(void) {
+ float id = HUD_PANEL_POWERUPS;
float stat_items;
stat_items = getstati(STAT_ITEMS);
- if(!cvar("_hud_configure"))
+ if(!hud_configure)
{
if not(stat_items & IT_STRENGTH)
if not(stat_items & IT_INVINCIBLE)
}
vector pos, mySize;
- pos = HUD_Panel_GetPos(2);
- mySize = HUD_Panel_GetSize(2);
+ pos = HUD_Panel_GetPos(id);
+ mySize = HUD_Panel_GetSize(id);
- HUD_Panel_DrawBg(2, pos, mySize);
+ HUD_Panel_DrawBg(id, pos, mySize, 0);
+ float padding;
+ padding = HUD_Panel_GetPadding(id);
+ if(padding)
+ {
+ pos += '1 1 0' * padding;
+ mySize -= '2 2 0' * padding;
+ }
float strength_time, shield_time;
- strength_time = bound(0, ceil(getstatf(STAT_STRENGTH_FINISHED) - time), 99);
- shield_time = bound(0, ceil(getstatf(STAT_INVINCIBLE_FINISHED) - time), 99);
+ strength_time = bound(0, getstatf(STAT_STRENGTH_FINISHED) - time, 99);
+ shield_time = bound(0, getstatf(STAT_INVINCIBLE_FINISHED) - time, 99);
- if(cvar("_hud_configure"))
+ if(hud_configure)
{
strength_time = 15;
shield_time = 27;
}
+ float len;
+
+ vector barpos, barsize;
+ vector picpos;
+ vector numpos;
+
string leftname, rightname;
float leftcnt, rightcnt;
+ float leftexact, rightexact;
float leftalpha, rightalpha;
- if (cvar(strcat("hud_", HUD_Panel_GetName(2), "_flip"))) {
+ if (cvar(strcat("hud_", HUD_Panel_GetName(id), "_flip"))) {
leftname = "strength";
- leftcnt = strength_time;
+ leftcnt = ceil(strength_time);
+ leftexact = strength_time;
rightname = "shield";
- rightcnt = shield_time;
+ rightcnt = ceil(shield_time);
+ rightexact = shield_time;
} else {
leftname = "shield";
- leftcnt = shield_time;
+ leftcnt = ceil(shield_time);
+ leftexact = shield_time;
rightname = "strength";
- rightcnt = strength_time;
+ rightcnt = ceil(strength_time);
+ rightexact = strength_time;
}
- leftalpha = bound(0, leftcnt, 1);
- rightalpha = bound(0, rightcnt, 1);
+ leftalpha = bound(0, leftexact, 1);
+ rightalpha = bound(0, rightexact, 1);
- float len;
- if (mySize_x/mySize_y > 5)
+ if (mySize_x/mySize_y > 4)
{
if(leftcnt)
{
len = strlen(ftos(leftcnt));
- drawpic(pos, "gfx/hud/statusbar", eX * 0.5 * mySize_x * min(1, leftcnt/30) + eY * mySize_y, HUD_Panel_GetProgressBarColor(leftname), cvar("hud_progressbar_alpha"), DRAWFLAG_NORMAL);
- drawpic(pos, strcat("gfx/hud/sb_", leftname), '1 1 0' * mySize_y, '1 1 1', leftalpha * hud_alpha_fg, DRAWFLAG_NORMAL);
- HUD_DrawXNum(pos + eX * mySize_y + eY * 0.25 * mySize_y, leftcnt, len, 0, 0.5 * mySize_y, '1 1 1', 0, 0, hud_alpha_fg, DRAWFLAG_NORMAL);
- }
+ if(cvar(strcat("hud_", HUD_Panel_GetName(id), "_mirror"))) {
+ barpos = pos + eX * 0.5 * mySize_x - eX * 0.5 * mySize_x * min(1, leftcnt/30);
+ barsize = eX * 0.5 * mySize_x * min(1, leftcnt/30) + eY * mySize_y;
+ picpos = pos + eX * 0.5 * mySize_x - eX * mySize_y;
+ numpos = picpos - eX * 2 * 0.5 * mySize_y + eX * (2-len) * 0.5 * mySize_y + eY * 0.25 * mySize_y;
+ } else {
+ barpos = pos;
+ barsize = eX * 0.5 * mySize_x * min(1, leftcnt/30) + eY * mySize_y;
+ picpos = pos;
+ numpos = picpos + eX * mySize_y - eX * (2-len) * 0.5 * mySize_y + eY * 0.25 * mySize_y;
+ }
+
+ HUD_Panel_DrawProgressBar(barpos, 0, barsize, HUD_Panel_GetProgressBarColor(leftname), cvar("hud_progressbar_alpha") * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ if(leftcnt <= 5)
+ drawpic_skin_expanding_two(picpos, leftname, '1 1 0' * mySize_y, '1 1 1', leftalpha * HUD_Panel_GetFgAlpha(id), DRAWFLAG_ADDITIVE, bound(0, (leftcnt - leftexact) / 0.5, 1));
+ else
+ drawpic_skin(picpos, leftname, '1 1 0' * mySize_y, '1 1 1', leftalpha * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ HUD_DrawXNum(numpos, leftcnt, 2, 0, 0.5 * mySize_y, '1 1 1', 0, 0, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ }
if(rightcnt)
{
- drawpic(pos + eX * mySize_x - eX * 0.5 * mySize_x * min(1, rightcnt/30), "gfx/hud/statusbar", eX * 0.5 * mySize_x * min(1, rightcnt/30) + eY * mySize_y, HUD_Panel_GetProgressBarColor(rightname), cvar("hud_progressbar_alpha"), DRAWFLAG_NORMAL);
- drawpic(pos + eX * mySize_x - eX * mySize_y, strcat("gfx/hud/sb_", rightname), '1 1 0' * mySize_y, '1 1 1', rightalpha * hud_alpha_fg, DRAWFLAG_NORMAL);
- HUD_DrawXNum(pos + eX * mySize_x - eX * 2.5 * mySize_y + eY * 0.25 * mySize_y, rightcnt, 3, 0, 0.5 * mySize_y, '1 1 1', 0, 0, hud_alpha_fg, DRAWFLAG_NORMAL);
+ len = strlen(ftos(rightcnt));
+
+ if(cvar(strcat("hud_", HUD_Panel_GetName(id), "_mirror"))) {
+ barpos = pos + eX * 0.5 * mySize_x;
+ barsize = eX * 0.5 * mySize_x * min(1, rightcnt/30) + eY * mySize_y;
+ picpos = pos + eX * 0.5 * mySize_x;
+ numpos = picpos + eX * mySize_y - eX * (2-len) * 0.5 * mySize_y + eY * 0.25 * mySize_y;
+ } else {
+ barpos = pos + eX * mySize_x - eX * 0.5 * mySize_x * min(1, rightcnt/30);
+ barsize = eX * 0.5 * mySize_x * min(1, rightcnt/30) + eY * mySize_y;
+ picpos = pos + eX * mySize_x - eX * mySize_y;
+ numpos = picpos - eX * mySize_y + eY * 0.25 * mySize_y;
+ }
+
+ HUD_Panel_DrawProgressBar(barpos, 0, barsize, HUD_Panel_GetProgressBarColor(rightname), cvar("hud_progressbar_alpha") * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ if(rightcnt <= 5)
+ drawpic_skin_expanding_two(picpos, rightname, '1 1 0' * mySize_y, '1 1 1', rightalpha * HUD_Panel_GetFgAlpha(id), DRAWFLAG_ADDITIVE, bound(0, (rightcnt - rightexact) / 0.5, 1));
+ else
+ drawpic_skin(picpos, rightname, '1 1 0' * mySize_y, '1 1 1', rightalpha * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ HUD_DrawXNum(numpos, rightcnt, 2, 0, 0.5 * mySize_y, '1 1 1', 0, 0, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
}
}
- else if (mySize_x/mySize_y > 3.2)
+ else if (mySize_x/mySize_y > 1.5)
{
if(leftcnt)
{
len = strlen(ftos(leftcnt));
- drawpic(pos + eY * mySize_y - eY * mySize_y * min(1, leftcnt/30), "gfx/hud/statusbar", eX * 0.5 * mySize_x + eY * mySize_y * min(1, leftcnt/30), HUD_Panel_GetProgressBarColor(leftname), cvar("hud_progressbar_alpha"), DRAWFLAG_NORMAL);
- drawpic(pos + eX * 0.4 * mySize_y, strcat("gfx/hud/sb_", leftname), '0.7 0.7 0' * mySize_y, '1 1 1', leftalpha * hud_alpha_fg, DRAWFLAG_NORMAL);
- HUD_DrawXNum(pos + eX * ((3-len)/2) * 0.5 * mySize_y + eY * 0.55 * mySize_y, leftcnt, len, 0, 0.5 * mySize_y, '1 1 1', 0, 0, hud_alpha_fg, DRAWFLAG_NORMAL);
+ if(cvar(strcat("hud_", HUD_Panel_GetName(id), "_mirror"))) {
+ barpos = pos + eX * mySize_x - eX * mySize_x * min(1, leftcnt/30);
+ barsize = eX * mySize_x * min(1, leftcnt/30) + eY * 0.5 * mySize_y;
+ picpos = pos + eX * mySize_x - eX * 0.5 * mySize_y;
+ numpos = picpos - eX * len * 0.5 * mySize_y;
+ } else {
+ barpos = pos;
+ barsize = eX * mySize_x * min(1, leftcnt/30) + eY * 0.5 * mySize_y;
+ picpos = pos;
+ numpos = picpos + eX * 0.5 * mySize_y;
+ }
+
+ HUD_Panel_DrawProgressBar(barpos, 0, barsize, HUD_Panel_GetProgressBarColor(leftname), cvar("hud_progressbar_alpha") * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ if(leftcnt <= 5)
+ drawpic_skin_expanding_two(picpos, leftname, '0.5 0.5 0' * mySize_y, '1 1 1', leftalpha * HUD_Panel_GetFgAlpha(id), DRAWFLAG_ADDITIVE, bound(0, (leftcnt - leftexact) / 0.5, 1));
+ else
+ drawpic_skin(picpos, leftname, '0.5 0.5 0' * mySize_y, '1 1 1', leftalpha * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ HUD_DrawXNum(numpos, leftcnt, len, 0, 0.5 * mySize_y, '1 1 1', 0, 0, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
}
if(rightcnt)
{
len = strlen(ftos(rightcnt));
-
- drawpic(pos + eX * 0.5 * mySize_x + eY * mySize_y - eY * mySize_y * min(1, rightcnt/30), "gfx/hud/statusbar", eX * 0.5 * mySize_x + eY * mySize_y * min(1, rightcnt/30), HUD_Panel_GetProgressBarColor(rightname), cvar("hud_progressbar_alpha"), DRAWFLAG_NORMAL);
- drawpic(pos + eX * mySize_x - eX * 1.1 * mySize_y, strcat("gfx/hud/sb_", rightname), '0.7 0.7 0' * mySize_y, '1 1 1', rightalpha * hud_alpha_fg, DRAWFLAG_NORMAL);
- HUD_DrawXNum(pos + eX * mySize_x - eX * len * 0.5 * mySize_y - eX * ((3-len)/2) * 0.5 * mySize_y + eY * 0.55 * mySize_y, rightcnt, len, 0, 0.5 * mySize_y, '1 1 1', 0, 0, hud_alpha_fg, DRAWFLAG_NORMAL);
+
+ if(cvar(strcat("hud_", HUD_Panel_GetName(id), "_mirror"))) {
+ barpos = pos + eX * mySize_x - eX * mySize_x * min(1, rightcnt/30) + eY * 0.5 * mySize_y;
+ barsize = eX * mySize_x * min(1, rightcnt/30) + eY * 0.5 * mySize_y;
+ picpos = pos + eX * mySize_x - eX * 0.5 * mySize_y + eY * 0.5 * mySize_y;
+ numpos = picpos - eX * len * 0.5 * mySize_y;
+ } else {
+ barpos = pos + eY * 0.5 * mySize_y;
+ barsize = eX * mySize_x * min(1, rightcnt/30) + eY * 0.5 * mySize_y;
+ picpos = pos + eY * 0.5 * mySize_y;
+ numpos = picpos + eX * 0.5 * mySize_y;
+ }
+
+ HUD_Panel_DrawProgressBar(barpos, 0, barsize, HUD_Panel_GetProgressBarColor(rightname), cvar("hud_progressbar_alpha") * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ if(rightcnt <= 5)
+ drawpic_skin_expanding_two(picpos, rightname, '0.5 0.5 0' * mySize_y, '1 1 1', rightalpha * HUD_Panel_GetFgAlpha(id), DRAWFLAG_ADDITIVE, bound(0, (rightcnt - rightexact) / 0.5, 1));
+ else
+ drawpic_skin(picpos, rightname, '0.5 0.5 0' * mySize_y, '1 1 1', rightalpha * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ HUD_DrawXNum(numpos, rightcnt, len, 0, 0.5 * mySize_y, '1 1 1', 0, 0, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
}
}
else
{
len = strlen(ftos(leftcnt));
- drawpic(pos, "gfx/hud/statusbar", eX * mySize_x * min(1, leftcnt/30) + eY * 0.5 * mySize_y, HUD_Panel_GetProgressBarColor(leftname), cvar("hud_progressbar_alpha"), DRAWFLAG_NORMAL);
- drawpic(pos, strcat("gfx/hud/sb_", leftname), '0.5 0.5 0' * mySize_y, '1 1 1', leftalpha * hud_alpha_fg, DRAWFLAG_NORMAL);
- HUD_DrawXNum(pos + eX * 0.5 * mySize_y, leftcnt, len, 0, 0.5 * mySize_y, '1 1 1', 0, 0, hud_alpha_fg, DRAWFLAG_NORMAL);
+ if(cvar(strcat("hud_", HUD_Panel_GetName(id), "_mirror"))) {
+ barpos = pos;
+ barsize = eX * 0.5 * mySize_x + eY * mySize_y * min(1, leftcnt/30);
+ picpos = pos + eX * 0.05 * mySize_x;
+ numpos = pos + eX * ((2-len)/2) * 0.25 * mySize_x + eY * 0.4 * mySize_x;
+ } else {
+ barpos = pos + eY * mySize_y - eY * mySize_y * min(1, leftcnt/30);
+ barsize = eX * 0.5 * mySize_x + eY * mySize_y * min(1, leftcnt/30);
+ picpos = pos + eX * 0.05 * mySize_x + eY * mySize_y - eY * 0.65 * mySize_x;
+ numpos = pos + eX * ((2-len)/2) * 0.25 * mySize_x + eY * mySize_y - eY * 0.25 * mySize_x;
+ }
+
+ HUD_Panel_DrawProgressBar(barpos, 1, barsize, HUD_Panel_GetProgressBarColor(leftname), cvar("hud_progressbar_alpha") * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ if(leftcnt <= 5)
+ drawpic_skin_expanding_two(picpos, leftname, '0.4 0.4 0' * mySize_x, '1 1 1', leftalpha * HUD_Panel_GetFgAlpha(id), DRAWFLAG_ADDITIVE, bound(0, (leftcnt - leftexact) / 0.5, 1));
+ else
+ drawpic_skin(picpos, leftname, '0.4 0.4 0' * mySize_x, '1 1 1', leftalpha * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ HUD_DrawXNum(numpos, leftcnt, len, 0, 0.25 * mySize_x, '1 1 1', 0, 0, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
}
if(rightcnt)
{
len = strlen(ftos(rightcnt));
- drawpic(pos + eY * 0.5 * mySize_y, "gfx/hud/statusbar", eX * mySize_x * min(1, rightcnt/30) + eY * 0.5 * mySize_y, HUD_Panel_GetProgressBarColor(rightname), cvar("hud_progressbar_alpha"), DRAWFLAG_NORMAL);
- drawpic(pos + eY * 0.5 * mySize_y, strcat("gfx/hud/sb_", rightname), '0.5 0.5 0' * mySize_y, '1 1 1', rightalpha * hud_alpha_fg, DRAWFLAG_NORMAL);
- HUD_DrawXNum(pos + eX * 0.5 * mySize_y + eY * 0.5 * mySize_y, rightcnt, len, 0, 0.5 * mySize_y, '1 1 1', 0, 0, hud_alpha_fg, DRAWFLAG_NORMAL);
- }
- }
-
- /* TODO: add expand!
- //strength
- if (strength_time) {
- dt = strength_time - time;
- if(dt > 0)
- {
- if(dt < 5)
- {
- drawpic_expanding_two(pos, "gfx/hud/sb_str", '1 1 0' * mySize_y, '1 1 1', hud_alpha_fg, DRAWFLAG_ADDITIVE,
- bound(0, (ceil(dt) - dt) / 0.5, 1));
- }
- else
- {
- drawpic(pos, "gfx/hud/sb_str", '1 1 0' * mySize_y, '1 1 1', hud_alpha_fg, DRAWFLAG_ADDITIVE);
+ if(cvar(strcat("hud_", HUD_Panel_GetName(id), "_mirror"))) {
+ barpos = pos + eX * 0.5 * mySize_x;
+ barsize = eX * 0.5 * mySize_x + eY * mySize_y * min(1, rightcnt/30);
+ picpos = pos + eX * 0.05 * mySize_x + eX * 0.5 * mySize_x;
+ numpos = pos + eX * ((2-len)/2) * 0.25 * mySize_x + eY * 0.4 * mySize_x + eX * 0.5 * mySize_x;
+ } else {
+ barpos = pos + eY * mySize_y - eY * mySize_y * min(1, rightcnt/30) + eX * 0.5 * mySize_x;
+ barsize = eX * 0.5 * mySize_x + eY * mySize_y * min(1, rightcnt/30);
+ picpos = pos + eX * 0.05 * mySize_x + eY * mySize_y - eY * 0.65 * mySize_x + eX * 0.5 * mySize_x;
+ numpos = pos + eX * ((2-len)/2) * 0.25 * mySize_x + eY * mySize_y - eY * 0.25 * mySize_x + eX * 0.5 * mySize_x;
}
- HUD_DrawXNum(pos - '40 -2 0', ceil(dt), 2, 0, countdown_fontsize, '1 1 1', 0, 0, hud_alpha_fg, DRAWFLAG_NORMAL);
- }
- else if(dt > -1)
- {
- drawpic_expanding(pos, "gfx/hud/sb_str", '1 1 0' * mySize_y, '1 1 1', hud_alpha_fg, DRAWFLAG_ADDITIVE,
- bound(0, -dt / 0.5, 1));
- }
- }
- //invincibility
- if (invincibility_time) {
- dt = invincibility_time - time;
- if(dt > 0)
- {
- if(dt < 5)
- {
- drawpic_expanding_two(pos - '0 -22 0', "gfx/hud/sb_invinc", '1 1 0' * mySize_y, '1 1 1', hud_alpha_fg, DRAWFLAG_ADDITIVE,
- bound(0, (ceil(dt) - dt) / 0.5, 1));
- }
+ HUD_Panel_DrawProgressBar(barpos, 1, barsize, HUD_Panel_GetProgressBarColor(rightname), cvar("hud_progressbar_alpha") * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ if(rightcnt <= 5)
+ drawpic_skin_expanding_two(picpos, rightname, '0.4 0.4 0' * mySize_x, '1 1 1', rightalpha * HUD_Panel_GetFgAlpha(id), DRAWFLAG_ADDITIVE, bound(0, (rightcnt - rightexact) / 0.5, 1));
else
- {
- drawpic(pos - '0 -22 0', "gfx/hud/sb_invinc", '1 1 0' * mySize_y, '1 1 1', hud_alpha_fg, DRAWFLAG_ADDITIVE);
- }
- HUD_DrawXNum(pos - '40 -24 0', ceil(dt), 2, 0, countdown_fontsize, '1 1 1', 0, 0, hud_alpha_fg, DRAWFLAG_NORMAL);
- }
- else if(dt > -1)
- {
- drawpic_expanding(pos - '0 -22 0', "gfx/hud/sb_invinc", '1 1 0' * mySize_y, '1 1 1', hud_alpha_fg, DRAWFLAG_ADDITIVE,
- bound(0, -dt / 0.5, 1));
+ drawpic_skin(picpos, rightname, '0.4 0.4 0' * mySize_x, '1 1 1', rightalpha * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ HUD_DrawXNum(numpos, rightcnt, len, 0, 0.25 * mySize_x, '1 1 1', 0, 0, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
}
}
- */
}
// Health/armor (#3)
//
void HUD_HealthArmor(void)
{
+ float id = HUD_PANEL_HEALTHARMOR;
vector pos, mySize;
- pos = HUD_Panel_GetPos(3);
- mySize = HUD_Panel_GetSize(3);
+ pos = HUD_Panel_GetPos(id);
+ mySize = HUD_Panel_GetSize(id);
- HUD_Panel_DrawBg(3, pos, mySize);
+ HUD_Panel_DrawBg(id, pos, mySize, 0);
+ float padding;
+ padding = HUD_Panel_GetPadding(id);
+ if(padding)
+ {
+ pos += '1 1 0' * padding;
+ mySize -= '2 2 0' * padding;
+ }
- float armor, health, x;
+ float armor, health;
armor = getstati(STAT_ARMOR);
health = getstati(STAT_HEALTH);
- if(cvar("_hud_configure"))
+
+ float fuel;
+ fuel = getstati(GetAmmoStat(4)); // how much fuel do we have?
+
+ if(hud_configure)
{
armor = 150;
health = 100;
+ fuel = 70;
}
if(health <= 0)
return;
float len;
+ vector barpos, barsize;
+ vector picpos;
+ vector numpos;
- // TODO!
- if(hud_hudselector == 2) // combined health and armor display
+ if(cvar("hud_healtharmor") == 2) // combined health and armor display
{
vector v;
v = healtharmor_maxdamage(health, armor, armorblockpercent);
- vector num_pos;
- num_pos = - '96 28 0';
-
+ float x;
x = floor(v_x + 1);
- if(v_z) // fully armored
+ if(cvar(strcat("hud_", HUD_Panel_GetName(id), "_mirror"))) {
+ barpos = pos + eX * mySize_x - eX * mySize_x * min(1, x/400);
+ barsize = eX * mySize_x * min(1, x/400) + eY * mySize_y;
+ picpos = pos;
+ numpos = picpos + eX * 1.5 * mySize_y;
+ } else {
+ barpos = pos;
+ barsize = eX * mySize_x * min(1, x/400) + eY * mySize_y;
+ picpos = pos + eX * 3 * mySize_y;
+ numpos = pos;
+ }
+
+ if(v_z) // NOT fully armored
{
- // here, armorideal > armor
- drawpic(num_pos + '78 -4.5 0', "gfx/hud/sb_health", '32 32 0', '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
- drawpic(num_pos + '108 -4.5 0', "gfx/hud/sb_armor", '20 20 0', '1 1 1', hud_alpha_fg * armor / v_y, DRAWFLAG_NORMAL);
+ HUD_Panel_DrawProgressBar(barpos, 0, barsize, HUD_Panel_GetProgressBarColor("health"), cvar("hud_progressbar_alpha") * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ drawpic_skin(picpos, "health", '1 1 0' * mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ if(armor)
+ drawpic_skin(picpos + eX * mySize_y, "armor", '0.5 0.5 0' * mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(id) * armor / health, DRAWFLAG_NORMAL);
}
else
{
- drawpic(num_pos + '108 -4.5 0', "gfx/hud/sb_health", '20 20 0', '1 1 1', hud_alpha_fg * v_y / armor, DRAWFLAG_NORMAL);
- drawpic(num_pos + '78 -4.5 0', "gfx/hud/sb_armor", '32 32 0', '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
+ HUD_Panel_DrawProgressBar(barpos, 0, barsize, HUD_Panel_GetProgressBarColor("armor"), cvar("hud_progressbar_alpha") * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ drawpic_skin(picpos + eX * mySize_y, "health", '0.5 0.5 0' * mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(id) * health / armor, DRAWFLAG_NORMAL);
+ if(armor)
+ drawpic_skin(picpos, "armor", '1 1 0' * mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ }
+ HUD_DrawXNum_Colored(numpos, x, 3, mySize_y, HUD_Panel_GetFgAlpha(id)); // draw the combined health and armor
+
+ // fuel
+ if(cvar(strcat("hud_", HUD_Panel_GetName(id), "_mirror"))) {
+ barpos = pos + eX * mySize_x - eX * mySize_x * min(1, fuel/100);
+ barsize = eX * mySize_x * min(1, fuel/100) + eY * 0.2 * mySize_y;
+ } else {
+ barpos = pos;
+ barsize = eX * mySize_x * min(1, fuel/100) + eY * 0.2 * mySize_y;
}
- HUD_DrawXNum_Colored(num_pos, x, 3, 24, hud_alpha_fg); // draw the combined health and armor
+ if(fuel)
+ HUD_Panel_DrawProgressBar(barpos, 0, barsize, HUD_Panel_GetProgressBarColor("fuel"), HUD_Panel_GetFgAlpha(id) * 0.8, DRAWFLAG_NORMAL);
}
else
float leftcnt, rightcnt;
float leftactive, rightactive;
float leftalpha, rightalpha;
- // TODO!
- if (cvar(strcat("hud_", HUD_Panel_GetName(3), "_flip"))) { // old style layout with armor left/top of health
+ if (cvar(strcat("hud_", HUD_Panel_GetName(id), "_flip"))) { // old style layout with armor left/top of health
leftname = "armor";
leftcnt = armor;
if(leftcnt)
rightalpha = min((armor+10)/55, 1);
}
- float fuel;
- fuel = getstati(GetAmmoStat(4)); // how much fuel do we have?
-
if (mySize_x/mySize_y > 5)
{
if(leftactive)
{
len = strlen(ftos(leftcnt));
- drawpic(pos, "gfx/hud/statusbar", eX * 0.5 * mySize_x * min(1, leftcnt/200) + eY * mySize_y, HUD_Panel_GetProgressBarColor(leftname), cvar("hud_progressbar_alpha"), DRAWFLAG_NORMAL);
- drawpic(pos, strcat("gfx/hud/sb_", leftname), '1 1 0' * mySize_y, '1 1 1', leftalpha * hud_alpha_fg, DRAWFLAG_NORMAL);
- HUD_DrawXNum_Colored(pos + eX * mySize_y + eY * 0.25 * mySize_y, leftcnt, len, 0.5 * mySize_y, hud_alpha_fg);
+ if(cvar(strcat("hud_", HUD_Panel_GetName(id), "_mirror"))) {
+ barpos = pos + eX * 0.5 * mySize_x - eX * 0.5 * mySize_x * min(1, leftcnt/200);
+ barsize = eX * 0.5 * mySize_x * min(1, leftcnt/200) + eY * mySize_y;
+ picpos = pos + eX * 0.5 * mySize_x - eX * mySize_y;
+ numpos = picpos - eX * 3 * 0.5 * mySize_y + eX * (3-len) * 0.5 * mySize_y + eY * 0.25 * mySize_y;
+ } else {
+ barpos = pos;
+ barsize = eX * 0.5 * mySize_x * min(1, leftcnt/200) + eY * mySize_y;
+ picpos = pos;
+ numpos = picpos + eX * mySize_y + eY * 0.25 * mySize_y;
+ }
+
+ HUD_Panel_DrawProgressBar(barpos, 0, barsize, HUD_Panel_GetProgressBarColor(leftname), cvar("hud_progressbar_alpha") * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ drawpic_skin(picpos, leftname, '1 1 0' * mySize_y, '1 1 1', leftalpha * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ HUD_DrawXNum_Colored(numpos, leftcnt, len, 0.5 * mySize_y, HUD_Panel_GetFgAlpha(id));
}
if(rightactive)
{
- drawpic(pos + eX * mySize_x - eX * 0.5 * mySize_x * min(1, rightcnt/200), "gfx/hud/statusbar", eX * 0.5 * mySize_x * min(1, rightcnt/200) + eY * mySize_y, HUD_Panel_GetProgressBarColor(rightname), cvar("hud_progressbar_alpha"), DRAWFLAG_NORMAL);
- drawpic(pos + eX * mySize_x - eX * mySize_y, strcat("gfx/hud/sb_", rightname), '1 1 0' * mySize_y, '1 1 1', rightalpha * hud_alpha_fg, DRAWFLAG_NORMAL);
- HUD_DrawXNum_Colored(pos + eX * mySize_x - eX * 2.5 * mySize_y + eY * 0.25 * mySize_y, rightcnt, 3, 0.5 * mySize_y, hud_alpha_fg);
+ len = strlen(ftos(rightcnt));
+
+ if(cvar(strcat("hud_", HUD_Panel_GetName(id), "_mirror"))) {
+ barpos = pos + eX * 0.5 * mySize_x;
+ barsize = eX * 0.5 * mySize_x * min(1, rightcnt/200) + eY * mySize_y;
+ picpos = pos + eX * 0.5 * mySize_x;
+ numpos = picpos + eX * mySize_y - eX * (3-len) * 0.5 * mySize_y + eY * 0.25 * mySize_y;
+ } else {
+ barpos = pos + eX * mySize_x - eX * 0.5 * mySize_x * min(1, rightcnt/200);
+ barsize = eX * 0.5 * mySize_x * min(1, rightcnt/200) + eY * mySize_y;
+ picpos = pos + eX * mySize_x - eX * mySize_y;
+ numpos = picpos - eX * 1.5 * mySize_y + eY * 0.25 * mySize_y;
+ }
+
+ HUD_Panel_DrawProgressBar(barpos, 0, barsize, HUD_Panel_GetProgressBarColor(rightname), cvar("hud_progressbar_alpha") * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ drawpic_skin(picpos, rightname, '1 1 0' * mySize_y, '1 1 1', rightalpha * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ HUD_DrawXNum_Colored(numpos, rightcnt, 3, 0.5 * mySize_y, HUD_Panel_GetFgAlpha(id));
}
+ if(cvar(strcat("hud_", HUD_Panel_GetName(id), "_mirror"))) {
+ barpos = pos + eX * mySize_x - eX * mySize_x * min(1, fuel/100);
+ barsize = eX * mySize_x * min(1, fuel/100) + eY * 0.2 * mySize_y;
+ } else {
+ barpos = pos;
+ barsize = eX * mySize_x * min(1, fuel/100) + eY * 0.2 * mySize_y;
+ }
if(fuel)
- drawpic(pos, "gfx/hud/statusbar", eX * mySize_x * min(1, fuel/100) + eY * 0.2 * mySize_y, HUD_Panel_GetProgressBarColor("fuel"), hud_alpha_fg * 0.8, DRAWFLAG_NORMAL);
+ HUD_Panel_DrawProgressBar(barpos, 0, barsize, HUD_Panel_GetProgressBarColor("fuel"), HUD_Panel_GetFgAlpha(id) * 0.8, DRAWFLAG_NORMAL);
}
- else if (mySize_x/mySize_y > 3.2)
+ else if (mySize_x/mySize_y > 2)
{
if(leftactive)
{
len = strlen(ftos(leftcnt));
- drawpic(pos + eY * mySize_y - eY * mySize_y * min(1, leftcnt/200), "gfx/hud/statusbar", eX * 0.5 * mySize_x + eY * mySize_y * min(1, leftcnt/200), HUD_Panel_GetProgressBarColor(leftname), cvar("hud_progressbar_alpha"), DRAWFLAG_NORMAL);
- drawpic(pos + eX * 0.4 * mySize_y, strcat("gfx/hud/sb_", leftname), '0.7 0.7 0' * mySize_y, '1 1 1', leftalpha * hud_alpha_fg, DRAWFLAG_NORMAL);
- HUD_DrawXNum_Colored(pos + eX * ((3-len)/2) * 0.5 * mySize_y + eY * 0.55 * mySize_y, leftcnt, len, 0.5 * mySize_y, hud_alpha_fg);
+ if(cvar(strcat("hud_", HUD_Panel_GetName(id), "_mirror"))) {
+ barpos = pos + eX * mySize_x - eX * mySize_x * min(1, leftcnt/200);
+ barsize = eX * mySize_x * min(1, leftcnt/200) + eY * 0.5 * mySize_y;
+ picpos = pos + eX * mySize_x - eX * 0.5 * mySize_y;
+ numpos = picpos - eX * len * 0.5 * mySize_y;
+ } else {
+ barpos = pos;
+ barsize = eX * mySize_x * min(1, leftcnt/200) + eY * 0.5 * mySize_y;
+ picpos = pos;
+ numpos = picpos + eX * 0.5 * mySize_y;
+ }
+
+ HUD_Panel_DrawProgressBar(barpos, 0, barsize, HUD_Panel_GetProgressBarColor(leftname), cvar("hud_progressbar_alpha") * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ drawpic_skin(picpos, leftname, '0.5 0.5 0' * mySize_y, '1 1 1', leftalpha * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ HUD_DrawXNum_Colored(numpos, leftcnt, len, 0.5 * mySize_y, HUD_Panel_GetFgAlpha(id));
}
if(rightactive)
{
len = strlen(ftos(rightcnt));
-
- drawpic(pos + eX * 0.5 * mySize_x + eY * mySize_y - eY * mySize_y * min(1, rightcnt/200), "gfx/hud/statusbar", eX * 0.5 * mySize_x + eY * mySize_y * min(1, rightcnt/200), HUD_Panel_GetProgressBarColor(rightname), cvar("hud_progressbar_alpha"), DRAWFLAG_NORMAL);
- drawpic(pos + eX * mySize_x - eX * 1.1 * mySize_y, strcat("gfx/hud/sb_", rightname), '0.7 0.7 0' * mySize_y, '1 1 1', rightalpha * hud_alpha_fg, DRAWFLAG_NORMAL);
- HUD_DrawXNum_Colored(pos + eX * mySize_x - eX * len * 0.5 * mySize_y - eX * ((3-len)/2) * 0.5 * mySize_y + eY * 0.55 * mySize_y, rightcnt, len, 0.5 * mySize_y, hud_alpha_fg);
+
+ if(cvar(strcat("hud_", HUD_Panel_GetName(id), "_mirror"))) {
+ barpos = pos + eX * mySize_x - eX * mySize_x * min(1, rightcnt/200) + eY * 0.5 * mySize_y;
+ barsize = eX * mySize_x * min(1, rightcnt/200) + eY * 0.5 * mySize_y;
+ picpos = pos + eX * mySize_x - eX * 0.5 * mySize_y + eY * 0.5 * mySize_y;
+ numpos = picpos - eX * len * 0.5 * mySize_y;
+ } else {
+ barpos = pos + eY * 0.5 * mySize_y;
+ barsize = eX * mySize_x * min(1, rightcnt/200) + eY * 0.5 * mySize_y;
+ picpos = pos + eY * 0.5 * mySize_y;
+ numpos = picpos + eX * 0.5 * mySize_y;
+ }
+
+ HUD_Panel_DrawProgressBar(barpos, 0, barsize, HUD_Panel_GetProgressBarColor(rightname), cvar("hud_progressbar_alpha") * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ drawpic_skin(picpos, rightname, '0.5 0.5 0' * mySize_y, '1 1 1', rightalpha * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ HUD_DrawXNum_Colored(numpos, rightcnt, len, 0.5 * mySize_y, HUD_Panel_GetFgAlpha(id));
}
+ if(cvar(strcat("hud_", HUD_Panel_GetName(id), "_mirror"))) {
+ barpos = pos + eX * mySize_x - eX * mySize_x * min(1, fuel/100);
+ barsize = eX * mySize_x * min(1, fuel/100) + eY * 0.1 * mySize_y;
+ } else {
+ barpos = pos;
+ barsize = eX * mySize_x * min(1, fuel/100) + eY * 0.1 * mySize_y;
+ }
if(fuel)
- drawpic(pos, "gfx/hud/statusbar", eX * mySize_x * min(1, fuel/100) + eY * 0.15 * mySize_y, HUD_Panel_GetProgressBarColor("fuel"), hud_alpha_fg * 0.8, DRAWFLAG_NORMAL);
+ HUD_Panel_DrawProgressBar(barpos, 0, barsize, HUD_Panel_GetProgressBarColor("fuel"), HUD_Panel_GetFgAlpha(id) * 0.8, DRAWFLAG_NORMAL);
}
else
{
{
len = strlen(ftos(leftcnt));
- drawpic(pos, "gfx/hud/statusbar", eX * mySize_x * min(1, leftcnt/200) + eY * 0.5 * mySize_y, HUD_Panel_GetProgressBarColor(leftname), cvar("hud_progressbar_alpha"), DRAWFLAG_NORMAL);
- drawpic(pos, strcat("gfx/hud/sb_", leftname), '0.5 0.5 0' * mySize_y, '1 1 1', leftalpha * hud_alpha_fg, DRAWFLAG_NORMAL);
- HUD_DrawXNum_Colored(pos + eX * 0.5 * mySize_y, leftcnt, len, 0.5 * mySize_y, hud_alpha_fg);
+ if(cvar(strcat("hud_", HUD_Panel_GetName(id), "_mirror"))) {
+ barpos = pos;
+ barsize = eX * 0.5 * mySize_x + eY * mySize_y * min(1, leftcnt/200);
+ picpos = pos + eX * 0.05 * mySize_x;
+ numpos = pos + eX * ((3-len)/2) * 0.25 * mySize_x + eY * 0.4 * mySize_x;
+ } else {
+ barpos = pos + eY * mySize_y - eY * mySize_y * min(1, leftcnt/200);
+ barsize = eX * 0.5 * mySize_x + eY * mySize_y * min(1, leftcnt/200);
+ picpos = pos + eX * 0.05 * mySize_x + eY * mySize_y - eY * 0.566 * mySize_x;
+ numpos = pos + eX * ((3-len)/2) * 0.25 * mySize_x + eY * mySize_y - eY * 0.166 * mySize_x;
+ }
+
+ HUD_Panel_DrawProgressBar(barpos, 1, barsize, HUD_Panel_GetProgressBarColor(leftname), cvar("hud_progressbar_alpha") * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ drawpic_skin(picpos, leftname, '0.4 0.4 0' * mySize_x, '1 1 1', leftalpha * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ HUD_DrawXNum_Colored(numpos, leftcnt, len, 0.166 * mySize_x, HUD_Panel_GetFgAlpha(id));
}
if(rightactive)
{
len = strlen(ftos(rightcnt));
- drawpic(pos + eY * 0.5 * mySize_y, "gfx/hud/statusbar", eX * mySize_x * min(1, rightcnt/200) + eY * 0.5 * mySize_y, HUD_Panel_GetProgressBarColor(rightname), cvar("hud_progressbar_alpha"), DRAWFLAG_NORMAL);
- drawpic(pos + eY * 0.5 * mySize_y, strcat("gfx/hud/sb_", rightname), '0.5 0.5 0' * mySize_y, '1 1 1', rightalpha * hud_alpha_fg, DRAWFLAG_NORMAL);
- HUD_DrawXNum_Colored(pos + eX * 0.5 * mySize_y + eY * 0.5 * mySize_y, rightcnt, len, 0.5 * mySize_y, hud_alpha_fg);
+ if(cvar(strcat("hud_", HUD_Panel_GetName(id), "_mirror"))) {
+ barpos = pos + eX * 0.5 * mySize_x;
+ barsize = eX * 0.5 * mySize_x + eY * mySize_y * min(1, rightcnt/200);
+ picpos = pos + eX * 0.05 * mySize_x + eX * 0.5 * mySize_x;
+ numpos = pos + eX * ((3-len)/2) * 0.25 * mySize_x + eY * 0.4 * mySize_x + eX * 0.5 * mySize_x;
+ } else {
+ barpos = pos + eY * mySize_y - eY * mySize_y * min(1, rightcnt/200) + eX * 0.5 * mySize_x;
+ barsize = eX * 0.5 * mySize_x + eY * mySize_y * min(1, rightcnt/200);
+ picpos = pos + eX * 0.05 * mySize_x + eY * mySize_y - eY * 0.566 * mySize_x + eX * 0.5 * mySize_x;
+ numpos = pos + eX * ((3-len)/2) * 0.25 * mySize_x + eY * mySize_y - eY * 0.166 * mySize_x + eX * 0.5 * mySize_x;
+ }
+
+ HUD_Panel_DrawProgressBar(barpos, 1, barsize, HUD_Panel_GetProgressBarColor(rightname), cvar("hud_progressbar_alpha") * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ drawpic_skin(picpos, rightname, '0.4 0.4 0' * mySize_x, '1 1 1', rightalpha * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ HUD_DrawXNum_Colored(numpos, rightcnt, len, 0.166 * mySize_x, HUD_Panel_GetFgAlpha(id));
+ }
+
+ if(cvar(strcat("hud_", HUD_Panel_GetName(id), "_mirror"))) {
+ barpos = pos;
+ barsize = eX * 0.05 * mySize_x + eY * mySize_y * min(1, fuel/100);
+ } else {
+ barpos = pos + eY * mySize_y - eY * mySize_y * min(1, fuel/100);
+ barsize = eX * 0.05 * mySize_x + eY * mySize_y * min(1, fuel/100);
+ }
+ if(fuel)
+ HUD_Panel_DrawProgressBar(barpos, 1, barsize, HUD_Panel_GetProgressBarColor("fuel"), HUD_Panel_GetFgAlpha(id) * 0.8, DRAWFLAG_NORMAL);
+ }
+ }
+}
+
+// ___TODO___ !!!
+// Notification area (#4)
+//
+
+string Weapon_SuicideMessage(float deathtype)
+{
+ w_deathtype = deathtype;
+ get_weaponinfo(DEATH_WEAPONOF(deathtype)).weapon_func(WR_SUICIDEMESSAGE);
+ return w_deathtypestring;
+}
+
+string Weapon_KillMessage(float deathtype)
+{
+ w_deathtype = deathtype;
+ get_weaponinfo(DEATH_WEAPONOF(deathtype)).weapon_func(WR_KILLMESSAGE);
+ return w_deathtypestring;
+}
+
+float killnotify_times[10];
+float killnotify_deathtype[10];
+float killnotify_actiontype[10]; // 0 = "Y [used by] X", 1 = "X [did action to] Y"
+string killnotify_attackers[10];
+string killnotify_victims[10];
+void HUD_KillNotify_Push(string attacker, string victim, float actiontype, float wpn)
+{
+ float i;
+ for (i = 9; i > 0; --i) {
+ killnotify_times[i] = killnotify_times[i-1];
+ killnotify_deathtype[i] = killnotify_deathtype[i-1];
+ killnotify_actiontype[i] = killnotify_actiontype[i-1];
+ if(killnotify_attackers[i])
+ strunzone(killnotify_attackers[i]);
+ killnotify_attackers[i] = strzone(killnotify_attackers[i-1]);
+ if(killnotify_victims[i])
+ strunzone(killnotify_victims[i]);
+ killnotify_victims[i] = strzone(killnotify_victims[i-1]);
+ }
+ killnotify_times[0] = time;
+ killnotify_deathtype[0] = wpn;
+ killnotify_actiontype[0] = actiontype;
+ if(killnotify_attackers[0])
+ strunzone(killnotify_attackers[0]);
+ killnotify_attackers[0] = strzone(attacker);
+ if(killnotify_victims[0])
+ strunzone(killnotify_victims[0]);
+ killnotify_victims[0] = strzone(victim);
+}
+
+void HUD_KillNotify(string s1, string s2, string s3, float type, float msg)
+{
+ float w;
+ float alsoprint;
+ alsoprint = (cvar("hud_notify_print") || !HUD_Panel_CheckActive(4)); // print message to console if: notify panel disabled, or cvar to do so enabled
+
+ if(msg == MSG_SUICIDE) {
+ // TODO: cl_gentle
+ w = DEATH_WEAPONOF(type);
+ if(WEP_VALID(w)) {
+ HUD_KillNotify_Push(s1, "", 0, DEATH_GENERIC);
+ if (alsoprint)
+ print("^1", s1, "^1 ", Weapon_SuicideMessage(type), "\n");
+ } else if (type == DEATH_KILL) {
+ HUD_KillNotify_Push(s1, "", 0, DEATH_KILL);
+ if (alsoprint)
+ print ("^1",s1, "^1 couldn't take it anymore\n");
+ } else if (type == DEATH_ROT) {
+ HUD_KillNotify_Push(s1, "", 0, DEATH_GENERIC);
+ if (alsoprint)
+ print ("^1",s1, "^1 died\n");
+ } else if (type == DEATH_NOAMMO) {
+ HUD_KillNotify_Push(s1, "", 0, DEATH_NOAMMO);
+ if (alsoprint)
+ print ("^7",s1, "^7 committed suicide. What's the point of living without ammo?\n");
+ } else if (type == DEATH_CAMP) {
+ HUD_KillNotify_Push(s1, "", 0, DEATH_CAMP);
+ if (alsoprint)
+ print ("^1",s1, "^1 thought they found a nice camping ground\n");
+ } else if (type == DEATH_MIRRORDAMAGE) {
+ HUD_KillNotify_Push(s1, "", 0, DEATH_MIRRORDAMAGE);
+ if (alsoprint)
+ print ("^1",s1, "^1 didn't become friends with the Lord of Teamplay\n");
+ } else if (type == DEATH_CHEAT) {
+ HUD_KillNotify_Push(s1, "", 0, DEATH_GENERIC);
+ if (alsoprint)
+ print ("^1",s1, "^1 unfairly eliminated themself\n");
+ } else if (type == DEATH_FIRE) {
+ HUD_KillNotify_Push(s1, "", 0, DEATH_GENERIC);
+ if (alsoprint)
+ print ("^1",s1, "^1 burned to death\n");
+ } else if (type != DEATH_TEAMCHANGE && type != DEATH_QUIET) {
+ HUD_KillNotify_Push(s1, "", 0, DEATH_GENERIC);
+ if (alsoprint)
+ print ("^1",s1, "^1 couldn't resist the urge to self-destruct\n");
+ }
+
+ if (stof(s2) > 2) // killcount > 2
+ print ("^1",s1,"^1 ended it all after a ",s2," kill spree\n");
+ } else if(msg == MSG_KILL) {
+ w = DEATH_WEAPONOF(type);
+ if(WEP_VALID(w)) {
+ HUD_KillNotify_Push(s2, s1, 1, w);
+ if (alsoprint)
+ print("^1", s1, "^1 ", Weapon_KillMessage(type), "\n");
+ }
+ else if(type == KILL_TEAM || type == KILL_TEAM_SPREE) {
+ HUD_KillNotify_Push(s1, s2, 1, DEATH_MIRRORDAMAGE);
+ if(alsoprint)
+ {
+ if(cvar("cl_gentle")) {
+ print ("^1", s1, "^1 took action against a team mate\n");
+ } else {
+ print ("^1", s1, "^1 mows down a team mate\n");
+ }
+ }
+ if (stof(s2) > 2 && type == KILL_TEAM_SPREE) {
+ if(cvar("cl_gentle"))
+ print ("^1",s1,"^1 ended a ",s2," scoring spree by going against a team mate\n");
+ else
+ print ("^1",s1,"^1 ended a ",s2," kill spree by killing a team mate\n");
+ }
+ else if (stof(s2) > 2) {
+ if(cvar("cl_gentle"))
+ print ("^1",s1,"'s ^1",s2," scoring spree was ended by a team mate!\n");
+ else
+ print ("^1",s1,"'s ^1",s2," kill spree was ended by a team mate!\n");
+ }
+ }
+ else if(type == KILL_FIRST_BLOOD)
+ print("^1",s1, "^1 drew first blood", "\n");
+ // TODO: icon!
+ else if (type == DEATH_TELEFRAG)
+ print ("^1",s1, "^1 was telefragged by ", s2, "\n");
+ else if (type == DEATH_DROWN) {
+ HUD_KillNotify_Push(s2, s1, 1, DEATH_DROWN);
+ if(alsoprint)
+ print ("^1",s1, "^1 was drowned by ", s2, "\n");
+ }
+ else if (type == DEATH_SLIME) {
+ HUD_KillNotify_Push(s2, s1, 1, DEATH_SLIME);
+ if(alsoprint)
+ print ("^1",s1, "^1 was slimed by ", s2, "\n");
+ }
+ else if (type == DEATH_LAVA) {
+ HUD_KillNotify_Push(s2, s1, 1, DEATH_LAVA);
+ if(alsoprint)
+ print ("^1",s1, "^1 was cooked by ", s2, "\n");
+ }
+ else if (type == DEATH_FALL) {
+ HUD_KillNotify_Push(s2, s1, 1, DEATH_FALL);
+ if(alsoprint)
+ print ("^1",s1, "^1 was grounded by ", s2, "\n");
+ }
+ else if (type == DEATH_SHOOTING_STAR) {
+ HUD_KillNotify_Push(s2, s1, 1, DEATH_SHOOTING_STAR);
+ if(alsoprint)
+ print ("^1",s1, "^1 was shot into space by ", s2, "\n");
+ }
+ else if (type == DEATH_SWAMP) {
+ HUD_KillNotify_Push(s2, s1, 1, DEATH_GENERIC);
+ if(alsoprint)
+ print ("^1",s1, "^1 was conserved by ", s2, "\n");
+ }
+ else if (type == DEATH_HURTTRIGGER)
+ {
+ HUD_KillNotify_Push(s2, s1, 1, DEATH_HURTTRIGGER);
+ if(alsoprint)
+ print("^1",s1, "^1 was thrown into a world of hurt by ", s2, "\n");
+ } else if(type == DEATH_SBCRUSH) {
+ HUD_KillNotify_Push(s2, s1, 1, DEATH_GENERIC);
+ if(alsoprint)
+ print ("^1",s1, "^1 was crushed by ^1", s2, "\n");
+ } else if(type == DEATH_SBMINIGUN) {
+ HUD_KillNotify_Push(s2, s1, 1, DEATH_GENERIC);
+ if(alsoprint)
+ print ("^1",s1, "^1 got shredded by ^1", s2, "\n");
+ } else if(type == DEATH_SBROCKET) {
+ HUD_KillNotify_Push(s2, s1, 1, DEATH_GENERIC);
+ if(alsoprint)
+ print ("^1",s1, "^1 was blased to bits by ^1", s2, "\n");
+ } else if(type == DEATH_SBBLOWUP) {
+ HUD_KillNotify_Push(s2, s1, 1, DEATH_GENERIC);
+ if(alsoprint)
+ print ("^1",s1, "^1 got caught in the destruction of ^1", s2, "'s vehicle\n");
+ } else if(type == DEATH_WAKIGUN) {
+ HUD_KillNotify_Push(s2, s1, 1, DEATH_GENERIC);
+ if(alsoprint)
+ print ("^1",s1, "^1 was bolted down by ^1", s2, "\n");
+ } else if(type == DEATH_WAKIROCKET) {
+ HUD_KillNotify_Push(s2, s1, 1, DEATH_GENERIC);
+ if(alsoprint)
+ print ("^1",s1, "^1 could find no shelter from ^1", s2, "'s rockets\n");
+ } else if(type == DEATH_WAKIBLOWUP) {
+ HUD_KillNotify_Push(s2, s1, 1, DEATH_GENERIC);
+ if(alsoprint)
+ print ("^1",s1, "^1 dies when ^1", s2, "'s wakizashi dies.\n");
+ } else if(type == DEATH_TURRET) {
+ HUD_KillNotify_Push(s2, s1, 1, DEATH_GENERIC);
+ if(alsoprint)
+ print ("^1",s1, "^1 was pushed into the line of fire by ^1", s2, "\n");
+ } else if(type == DEATH_TOUCHEXPLODE) {
+ HUD_KillNotify_Push(s2, s1, 1, DEATH_GENERIC);
+ if(alsoprint)
+ print ("^1",s1, "^1 was pushed into an accident by ^1", s2, "\n");
+ } else if(type == DEATH_CHEAT) {
+ HUD_KillNotify_Push(s2, s1, 1, DEATH_GENERIC);
+ if(alsoprint)
+ print ("^1",s1, "^1 was unfairly eliminated by ^1", s2, "\n");
+ } else if (type == DEATH_FIRE) {
+ HUD_KillNotify_Push(s2, s1, 1, DEATH_GENERIC);
+ if(alsoprint)
+ print ("^1",s1, "^1 was burnt to death by ^1", s2, "\n");
+ } else if (type == DEATH_CUSTOM) {
+ HUD_KillNotify_Push(s2, s1, 1, DEATH_CUSTOM);
+ if(alsoprint)
+ print ("^1",s1, "^1 ", s2, "\n");
+ } else {
+ HUD_KillNotify_Push(s2, s1, 1, DEATH_GENERIC);
+ if(alsoprint)
+ print ("^1",s1, "^1 was fragged by ", s2, "\n");
+ }
+ } else if(msg == MSG_SPREE) {
+ if(type == KILL_END_SPREE) {
+ if(cvar("cl_gentle"))
+ print ("^1",s1,"'s ^1", s2, " scoring spree was ended by ", s3, "\n");
+ else
+ print ("^1",s1,"'s ^1", s2, " kill spree was ended by ", s3, "\n");
+ } else if(type == KILL_SPREE) {
+ if(cvar("cl_gentle"))
+ print ("^1",s1,"^1 made ",s2," scores in a row\n");
+ else
+ print ("^1",s1,"^1 has ",s2," frags in a row\n");
+ } else if(type == KILL_SPREE_3) {
+ if(cvar("cl_gentle"))
+ print (s1,"^7 made a ^1TRIPLE SCORE\n");
+ else
+ print (s1,"^7 made a ^1TRIPLE FRAG\n");
+ } else if(type == KILL_SPREE_5) {
+ if(cvar("cl_gentle"))
+ print (s1,"^7 unleashes ^1SCORING RAGE\n");
+ else
+ print (s1,"^7 unleashes ^1RAGE\n");
+ } else if(type == KILL_SPREE_10) {
+ if(cvar("cl_gentle"))
+ print (s1,"^7 made ^1TEN SCORES IN A ROW!\n");
+ else
+ print (s1,"^7 starts the ^1MASSACRE!\n");
+ } else if(type == KILL_SPREE_15) {
+ if(cvar("cl_gentle"))
+ print (s1,"^7 made ^1FIFTEEN SCORES IN A ROW!\n");
+ else
+ print (s1,"^7 executes ^1MAYHEM!\n");
+ } else if(type == KILL_SPREE_20) {
+ if(cvar("cl_gentle"))
+ print (s1,"^7 made ^1TWENTY SCORES IN A ROW!\n");
+ else
+ print (s1,"^7 is a ^1BERSERKER!\n");
+ } else if(type == KILL_SPREE_25) {
+ if(cvar("cl_gentle"))
+ print (s1,"^7 made ^1TWENTY FIFE SCORES IN A ROW!\n");
+ else
+ print (s1,"^7 inflicts ^1CARNAGE!\n");
+ } else if(type == KILL_SPREE_30) {
+ if(cvar("cl_gentle"))
+ print (s1,"^7 made ^1THIRTY SCORES IN A ROW!\n");
+ else
+ print (s1,"^7 unleashes ^1ARMAGEDDON!\n");
+ }
+ } else if(msg == MSG_KILL_ACTION) { // wtf is this? isnt it basically the same as MSG_SUICIDE?
+ if (type == DEATH_DROWN) {
+ HUD_KillNotify_Push(s1, "", 0, DEATH_DROWN);
+ if(alsoprint)
+ {
+ if(cvar("cl_gentle"))
+ print ("^1",s1, "^1 was in the water for too long\n");
+ else
+ print ("^1",s1, "^1 drowned\n");
+ }
+ } else if (type == DEATH_SLIME) {
+ HUD_KillNotify_Push(s1, "", 0, DEATH_SLIME);
+ if(alsoprint)
+ print ("^1",s1, "^1 was slimed\n");
+ } else if (type == DEATH_LAVA) {
+ HUD_KillNotify_Push(s1, "", 0, DEATH_LAVA);
+ if(alsoprint)
+ {
+ if(cvar("cl_gentle"))
+ print ("^1",s1, "^1 found a hot place\n");
+ else
+ print ("^1",s1, "^1 turned into hot slag\n");
+ }
+ } else if (type == DEATH_FALL) {
+ HUD_KillNotify_Push(s1, "", 0, DEATH_GENERIC);
+ if(alsoprint)
+ {
+ if(cvar("cl_gentle"))
+ print ("^1",s1, "^1 tested gravity (and it worked)\n");
+ else
+ print ("^1",s1, "^1 hit the ground with a crunch\n");
+ }
+ } else if (type == DEATH_SHOOTING_STAR) {
+ HUD_KillNotify_Push(s1, "", 0, DEATH_SHOOTING_STAR);
+ if(alsoprint)
+ print ("^1",s1, "^1 became a shooting star\n");
+ } else if (type == DEATH_SWAMP) {
+ HUD_KillNotify_Push(s1, "", 0, DEATH_GENERIC);
+ if(alsoprint)
+ {
+ if(cvar("cl_gentle"))
+ print ("^1",s1, "^1 discovered a swamp\n");
+ else
+ print ("^1",s1, "^1 is now conserved for centuries to come\n");
+ }
+ } else if(type == DEATH_TURRET) {
+ HUD_KillNotify_Push(s1, "", 0, DEATH_GENERIC);
+ if(alsoprint)
+ print ("^1",s1, "^1 was mowed down by a turret \n");
+ } else if (type == DEATH_CUSTOM) {
+ HUD_KillNotify_Push(s1, "", 0, DEATH_CUSTOM);
+ if(alsoprint)
+ print ("^1",s1, "^1 ", s2, "\n");
+ } else if (type == DEATH_HURTTRIGGER) {
+ HUD_KillNotify_Push(s1, "", 0, DEATH_HURTTRIGGER);
+ if(alsoprint)
+ print ("^1",s1, "^1 was in the wrong place\n");
+ } else if(type == DEATH_TOUCHEXPLODE) {
+ HUD_KillNotify_Push(s1, "", 0, DEATH_GENERIC);
+ if(alsoprint)
+ print ("^1",s1, "^1 died in an accident\n");
+ } else if(type == DEATH_CHEAT) {
+ HUD_KillNotify_Push(s1, "", 0, DEATH_GENERIC);
+ if(alsoprint)
+ print ("^1",s1, "^1 was unfairly eliminated\n");
+ } else if(type == DEATH_FIRE) {
+ HUD_KillNotify_Push(s1, "", 0, DEATH_GENERIC);
+ if(alsoprint)
+ {
+ if(cvar("cl_gentle"))
+ print ("^1",s1, "^1 felt a little hot\n");
+ else
+ print ("^1",s1, "^1 burnt to death\n");
+ }
+ } else {
+ HUD_KillNotify_Push(s1, "", 0, DEATH_GENERIC);
+ if(alsoprint)
+ {
+ if(cvar("cl_gentle"))
+ print ("^1",s1, "^1 needs a restart\n");
+ else
+ print ("^1",s1, "^1 died\n");
+ }
+ }
+ } else if(msg == MSG_KILL_ACTION_SPREE) {
+ if(cvar("cl_gentle"))
+ print ("^1",s1,"^1 needs a restart after a ",s2," scoring spree\n");
+ else
+ print ("^1",s1,"^1 died with a ",s2," kill spree\n");
+ } else if(msg == MSG_INFO) {
+ if(type == INFO_GOTFLAG) { // here, s2 is the flag name
+ HUD_KillNotify_Push(s1, s2, 0, INFO_GOTFLAG);
+ print(s1, "^7 got the ", s2, "\n");
+ } else if(type == INFO_LOSTFLAG) {
+ HUD_KillNotify_Push(s1, s2, 0, INFO_LOSTFLAG);
+ print(s1, "^7 lost the ", s2, "\n");
+ } else if(type == INFO_PICKUPFLAG) {
+ HUD_KillNotify_Push(s1, s2, 0, INFO_GOTFLAG);
+ print(s1, "^7 picked up the ", s2, "\n");
+ } else if(type == INFO_RETURNFLAG) {
+ HUD_KillNotify_Push(s1, s2, 0, INFO_RETURNFLAG);
+ print(s1, "^7 returned the ", s2, "\n");
+ }
+ }
+}
+
+#define DAMAGE_CENTERPRINT_SPACER NEWLINES
+
+void HUD_Centerprint(string s1, string s2, float type, float msg)
+{
+ if(msg == MSG_SUICIDE) {
+ if (type == DEATH_TEAMCHANGE) {
+ centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "You are now on: ", s1));
+ } else if (type == DEATH_AUTOTEAMCHANGE) {
+ centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "You have been moved into a different team to improve team balance\nYou are now on: ", s1));
+ } else if (type == DEATH_CAMP) {
+ if(cvar("cl_gentle"))
+ centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1Reconsider your tactics, camper!"));
+ else
+ centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1Die camper!"));
+ } else if (type == DEATH_NOAMMO) {
+ if(cvar("cl_gentle"))
+ centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1You are reinserted into the game for running out of ammo..."));
+ else
+ centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1You were killed for running out of ammo..."));
+ } else if (type == DEATH_ROT) {
+ if(cvar("cl_gentle"))
+ centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1You need to preserve your health"));
+ else
+ centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1You grew too old without taking your medicine"));
+ } else if (type == DEATH_MIRRORDAMAGE) {
+ if(cvar("cl_gentle"))
+ centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1Don't go against team mates!"));
+ else
+ centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1Don't shoot your team mates!"));
+ } else if (type == DEATH_QUIET) {
+ // do nothing
+ } else if (type == DEATH_KILL) {
+ if(cvar("cl_gentle"))
+ centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1You need to be more careful!"));
+ else
+ centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1You killed your own dumb self!"));
+ }
+ } else if(msg == MSG_KILL) {
+ if (type == KILL_TEAM) {
+ if(cvar("cl_gentle")) {
+ centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1Moron! You went against a team mate!"));
+ } else {
+ centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1Moron! You fragged ", s1, ", a team mate!"));
+ }
+ } else if (type == KILL_FIRST_BLOOD) {
+ if(cvar("cl_gentle")) {
+ centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1First score"));
+ } else {
+ centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1First blood"));
+ }
+ } else if (type == KILL_FIRST_VICTIM) {
+ if(cvar("cl_gentle")) {
+ centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1First casualty"));
+ } else {
+ centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1First victim"));
+ }
+ } else if (type == KILL_TYPEFRAG) { // s2 contains "advanced kill messages" such as ping, handicap...
+ if(cvar("cl_gentle")) {
+ centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1You scored against ^7", s1, "^7 who was typing!", s2));
+ } else {
+ centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1You typefragged ^7", s1, s2));
+ }
+ } else if (type == KILL_TYPEFRAGGED) {
+ if(cvar("cl_gentle")) {
+ centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1You were scored against by ^7", s1, "^7 while you were typing!", s2));
+ } else {
+ centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1You were typefragged by ^7", s1, s2));
+ }
+ } else if (type == KILL_FRAG) {
+ if(cvar("cl_gentle")) {
+ centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^4You scored against ^7", s1, s2));
+ } else {
+ centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^4You fragged ^7", s1, s2));
+ }
+ } else if (type == KILL_FRAGGED) {
+ if(cvar("cl_gentle")) {
+ centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^4You were scored against by ^7", s1, s2));
+ } else {
+ centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^4You were fragged by ^7", s1, s2));
+ }
+ }
+ } else if(msg == MSG_KILL_ACTION) {
+ // TODO: invent more centerprints here?
+ centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1Watch your step!", s1));
+ }
+}
+
+void HUD_Notify (void)
+{
+ float id = HUD_PANEL_NOTIFY;
+ vector pos, mySize;
+ pos = HUD_Panel_GetPos(id);
+ mySize = HUD_Panel_GetSize(id);
+
+ HUD_Panel_DrawBg(id, pos, mySize, 0);
+ float padding;
+ padding = HUD_Panel_GetPadding(id);
+ if(padding)
+ {
+ pos += '1 1 0' * padding;
+ mySize -= '2 2 0' * padding;
+ }
+
+ float entries, height;
+ entries = bound(1, floor(14 * mySize_y/mySize_x), 12);
+ height = mySize_y/entries;
+ entries -= 2; // top/bottom two lines reserved for info messaged, such as spec instructions
+
+ vector fontsize;
+ fontsize = '0.5 0.5 0' * height;
+
+ float a;
+ float when;
+ when = cvar("hud_notify_time");
+ float fadetime;
+ fadetime = cvar("hud_notify_fadetime");
+
+ string s;
+
+ vector pos_attacker, pos_victim;
+ vector weap_pos;
+ float width_attacker, width_victim;
+ string attacker, victim;
+
+ float i, j;
+ for(j = 0; j < entries; ++j)
+ {
+ if(cvar("hud_notify_flip"))
+ i = j;
+ else // rather nasty hack for ordering items from the bottom up
+ i = entries - j - 1;
+ if(cvar("hud_notify_info_top"))
+ i += 2; // top/bottom two lines reserved for info messaged, such as spec instructions
+
+ if(fadetime)
+ {
+ if(killnotify_times[j] + when > time)
+ a = 1;
+ else
+ a = bound(0, (killnotify_times[j] + when + fadetime - time) / fadetime, 1);
+ }
+ else
+ {
+ if(killnotify_times[j] + when > time)
+ a = 1;
+ else
+ a = 0;
+ }
+
+ // TODO: maybe print in team colors?
+ // TODO: maybe this could be cleaned up somehow...
+ // TODO: less copypaste code below
+ //
+ // Y [used by] X
+ if(killnotify_actiontype[j] == 0 && !hud_configure)
+ {
+ attacker = textShortenToWidth(killnotify_attackers[j], mySize_x - 2 * height, fontsize, stringwidth_colors);
+
+ width_attacker = stringwidth(attacker, TRUE, fontsize);
+ pos_attacker = pos + eX * 0.5 * (mySize_x - width_attacker + 2 * height) + eY * 0.5 * fontsize_y + eY * i * height;
+
+ weap_pos = pos + eX * 0.5 * (mySize_x - width_attacker) - eX * height + eY * i * height;
+ if(killnotify_deathtype[j] == DEATH_GENERIC)
+ {
+ drawpic_skin(weap_pos, "notify_death", '2 1 0' * height, '1 1 1', HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos_attacker, attacker, fontsize, HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ }
+ else if(killnotify_deathtype[j] == DEATH_NOAMMO)
+ {
+ drawpic_skin(weap_pos, "notify_outofammo", '2 1 0' * height, '1 1 1', HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos_attacker, attacker, fontsize, HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ }
+ else if(killnotify_deathtype[j] == DEATH_KILL)
+ {
+ drawpic_skin(weap_pos, "notify_selfkill", '2 1 0' * height, '1 1 1', HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos_attacker, attacker, fontsize, HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ }
+ else if(killnotify_deathtype[j] == DEATH_CAMP)
+ {
+ drawpic_skin(weap_pos, "notify_camping", '2 1 0' * height, '1 1 1', HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos_attacker, attacker, fontsize, HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ }
+ else if(killnotify_deathtype[j] == DEATH_MIRRORDAMAGE)
+ {
+ drawpic_skin(weap_pos, "notify_teamkill", '2 1 0' * height, '1 1 1', HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos_attacker, attacker, fontsize, HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ }
+ else if(killnotify_deathtype[j] == DEATH_DROWN)
+ {
+ drawpic_skin(weap_pos, "notify_water", '2 1 0' * height, '1 1 1', HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos_attacker, attacker, fontsize, HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ }
+ else if(killnotify_deathtype[j] == DEATH_SLIME)
+ {
+ drawpic_skin(weap_pos, "notify_slime", '2 1 0' * height, '1 1 1', HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos_attacker, attacker, fontsize, HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ }
+ else if(killnotify_deathtype[j] == DEATH_LAVA)
+ {
+ drawpic_skin(weap_pos, "notify_lava", '2 1 0' * height, '1 1 1', HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos_attacker, attacker, fontsize, HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ }
+ else if(killnotify_deathtype[j] == DEATH_FALL)
+ {
+ drawpic_skin(weap_pos, "notify_fall", '2 1 0' * height, '1 1 1', HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos_attacker, attacker, fontsize, HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ }
+ else if(killnotify_deathtype[j] == DEATH_SHOOTING_STAR)
+ {
+ drawpic_skin(weap_pos, "notify_shootingstar", '2 1 0' * height, '1 1 1', HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos_attacker, attacker, fontsize, HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ }
+ else if(killnotify_deathtype[j] == DEATH_HURTTRIGGER || killnotify_deathtype[j] == DEATH_CUSTOM)
+ {
+ drawpic_skin(weap_pos, "notify_void", '2 1 0' * height, '1 1 1', HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos_attacker, attacker, fontsize, HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ }
+ else if(killnotify_deathtype[j] == INFO_GOTFLAG)
+ {
+ if(killnotify_victims[j] == "^1RED^7 flag")
+ s = "red";
+ else
+ s = "blue";
+ drawpic_skin(weap_pos, strcat("flag_", s, "_carrying"), '1 1 0' * height, '1 1 1', HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos_attacker, attacker, fontsize, HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ }
+ else if(killnotify_deathtype[j] == INFO_RETURNFLAG)
+ {
+ if(killnotify_victims[j] == "^1RED^7 flag")
+ s = "red";
+ else
+ s = "blue";
+ drawpic_skin(weap_pos, strcat("flag_", s, "_taken"), '1 1 0' * height, '1 1 1', HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos_attacker, attacker, fontsize, HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ }
+ else if(killnotify_deathtype[j] == INFO_LOSTFLAG)
+ {
+ if(killnotify_victims[j] == "^1RED^7 flag")
+ s = "red";
+ else
+ s = "blue";
+ drawpic_skin(weap_pos, strcat("flag_", s, "_lost"), '1 1 0' * height, '1 1 1', HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos_attacker, attacker, fontsize, HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ }
+ }
+ // X [did action to] Y
+ else
+ {
+ if(hud_configure)
+ {
+ attacker = textShortenToWidth("Player1", 0.5 * mySize_x - height, fontsize, stringwidth_colors);
+ victim = textShortenToWidth("Player2", 0.5 * mySize_x - height, fontsize, stringwidth_colors);
+ a = bound(0, (when - j) / 4, 1);
+ }
+ else
+ {
+ attacker = textShortenToWidth(killnotify_attackers[j], 0.5 * mySize_x - height, fontsize, stringwidth_colors);
+ victim = textShortenToWidth(killnotify_victims[j], 0.5 * mySize_x - height, fontsize, stringwidth_colors);
+ }
+ width_attacker = stringwidth(attacker, TRUE, fontsize);
+ width_victim = stringwidth(victim, TRUE, fontsize);
+ pos_attacker = pos + eX * 0.5 * ((0.5 * mySize_x - height) - width_attacker) + eY * 0.5 * fontsize_y + eY * i * height;
+ pos_victim = pos + eX * 0.5 * ((0.5 * mySize_x - height) - width_victim) + eY * 0.5 * fontsize_y + eX * 0.5 * mySize_x + eX * height + eY * i * height;
+ weap_pos = pos + eX * 0.5 * mySize_x - eX * height + eY * i * height;
+
+ if(hud_configure) // example actions for config mode
+ {
+ drawpic_skin(weap_pos, strcat("weapon", "electro"), '2 1 0' * height, '1 1 1', HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos_attacker, attacker, fontsize, HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos_victim, victim, fontsize, HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ }
+ else if(WEP_VALID(killnotify_deathtype[j]))
+ {
+ self = get_weaponinfo(killnotify_deathtype[j]);
+ drawpic_skin(weap_pos, strcat("weapon", self.netname), '2 1 0' * height, '1 1 1', HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos_attacker, attacker, fontsize, HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos_victim, victim, fontsize, HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ }
+ else if(killnotify_deathtype[j] == DEATH_MIRRORDAMAGE)
+ {
+ drawpic_skin(weap_pos, "notify_teamkill", '2 1 0' * height, '1 1 1', HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos_attacker, attacker, fontsize, HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos_victim, victim, fontsize, HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ }
+ else if(killnotify_deathtype[j] == DEATH_DROWN)
+ {
+ drawpic_skin(weap_pos, "notify_water", '2 1 0' * height, '1 1 1', HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos_attacker, attacker, fontsize, HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos_victim, victim, fontsize, HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ }
+ else if(killnotify_deathtype[j] == DEATH_SLIME)
+ {
+ drawpic_skin(weap_pos, "notify_slime", '2 1 0' * height, '1 1 1', HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos_attacker, attacker, fontsize, HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos_victim, victim, fontsize, HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ }
+ else if(killnotify_deathtype[j] == DEATH_LAVA)
+ {
+ drawpic_skin(weap_pos, "notify_lava", '2 1 0' * height, '1 1 1', HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos_attacker, attacker, fontsize, HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos_victim, victim, fontsize, HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ }
+ else if(killnotify_deathtype[j] == DEATH_FALL)
+ {
+ drawpic_skin(weap_pos, "notify_fall", '2 1 0' * height, '1 1 1', HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos_attacker, attacker, fontsize, HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos_victim, victim, fontsize, HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ }
+ else if(killnotify_deathtype[j] == DEATH_SHOOTING_STAR)
+ {
+ drawpic_skin(weap_pos, "notify_shootingstar", '2 1 0' * height, '1 1 1', HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos_attacker, attacker, fontsize, HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos_victim, victim, fontsize, HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ }
+ else if(killnotify_deathtype[j] == DEATH_HURTTRIGGER || killnotify_deathtype[j] == DEATH_CUSTOM) // DEATH_CUSTOM is also void, right?
+ {
+ drawpic_skin(weap_pos, "notify_void", '2 1 0' * height, '1 1 1', HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos_attacker, attacker, fontsize, HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos_victim, victim, fontsize, HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ }
+ }
+
+ }
+
+ // Info messages
+ //
+ entity tm;
+ vector o;
+ o = pos;
+ if(cvar("hud_notify_info_top"))
+ o = pos + eY;
+ else
+ o = pos + eY * mySize_y - eY * 2 * height;
+
+ if(spectatee_status && !intermission)
+ {
+ //drawfont = hud_bigfont;
+ if(spectatee_status == -1)
+ s = "^1Observing";
+ else
+ s = GetPlayerName(spectatee_status - 1);
+
+ //s = textShortenToWidth(s, mySize_y, 0.5 * height, stringwidth_colors);
+ //drawcolorcodedstring(pos + eY * 0.25 * height, s, 0.5 * height, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ //drawfont = hud_font;
+
+ // spectator text in the upper right corner
+ if(spectatee_status == -1)
+ s = strcat("^1Press ^3", getcommandkey("primary fire", "+attack"), "^1 to spectate");
+ else
+ s = strcat("^1Press ^3", getcommandkey("primary fire", "+attack"), "^1 for another player");
+ drawcolorcodedstring(o, s, fontsize, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ o += eY * fontsize_y;
+
+ if(spectatee_status == -1)
+ s = strcat("^1Use ^3", getcommandkey("next weapon", "weapnext"), "^1 or ^3", getcommandkey("previous weapon", "weapprev"), "^1 to change the speed");
+ else
+ s = strcat("^1Press ^3", getcommandkey("secondary fire", "+attack2"), "^1 to observe");
+ drawcolorcodedstring(o, s, fontsize, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ o += eY * fontsize_y;
+
+ s = strcat("^1Press ^3", getcommandkey("server info", "+show_info"), "^1 for gamemode info");
+ drawcolorcodedstring(o, s, fontsize, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ o += eY * fontsize_y;
+
+ if(gametype == GAME_ARENA)
+ s = "^1Wait for your turn to join";
+ else if(gametype == GAME_LMS)
+ {
+ entity sk;
+ sk = playerslots[player_localentnum - 1];
+ if(sk.(scores[ps_primary]) >= 666)
+ s = "^1Match has already begun";
+ else if(sk.(scores[ps_primary]) > 0)
+ s = "^1You have no more lives left";
+ else
+ s = strcat("^1Press ^3", getcommandkey("jump", "+jump"), "^1 to join");
+ }
+ else
+ s = strcat("^1Press ^3", getcommandkey("jump", "+jump"), "^1 to join");
+ drawcolorcodedstring(o, s, fontsize, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ o += eY * fontsize_y;
+
+ //show restart countdown:
+ if (time < getstatf(STAT_GAMESTARTTIME)) {
+ float countdown;
+ //we need to ceil, otherwise the countdown would be off by .5 when using round()
+ countdown = ceil(getstatf(STAT_GAMESTARTTIME) - time);
+ s = strcat("^1Game starts in ^3", ftos(countdown), "^1 seconds");
+ drawcolorcodedstring(o, s, fontsize, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ o += eY * fontsize_y;
+ }
+ }
+ if(warmup_stage && !intermission)
+ {
+ s = "^2Currently in ^1warmup^2 stage!";
+ drawcolorcodedstring(o, s, fontsize, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ o += eY * fontsize_y;
+ }
+
+ string blinkcolor;
+ if(mod(time, 1) >= 0.5)
+ blinkcolor = "^1";
+ else
+ blinkcolor = "^3";
+
+ if(ready_waiting && !intermission && !spectatee_status)
+ {
+ if(ready_waiting_for_me)
+ {
+ if(warmup_stage)
+ s = strcat(blinkcolor, "Press ^3", getcommandkey("ready", "ready"), blinkcolor, " to end warmup");
+ else
+ s = strcat(blinkcolor, "Press ^3", getcommandkey("ready", "ready"), blinkcolor, " once you are ready");
+ }
+ else
+ {
+ if(warmup_stage)
+ s = strcat("^2Waiting for others to ready up to end warmup...");
+ else
+ s = strcat("^2Waiting for others to ready up...");
+ }
+ drawcolorcodedstring(o, s, fontsize, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ o += eY * fontsize_y;
+ }
+ else if(warmup_stage && !intermission && !spectatee_status)
+ {
+ s = strcat("^2Press ^3", getcommandkey("ready", "ready"), "^2 to end warmup");
+ drawcolorcodedstring(o, s, fontsize, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ o += eY * fontsize_y;
+ }
+
+ if(teamplay && !intermission && !spectatee_status && gametype != GAME_CA && teamnagger)
+ {
+ float ts_min, ts_max;
+ tm = teams.sort_next;
+ if (tm)
+ {
+ for(; tm.sort_next; tm = tm.sort_next)
+ {
+ if(!tm.team_size || tm.team == COLOR_SPECTATOR)
+ continue;
+ if(!ts_min) ts_min = tm.team_size;
+ else ts_min = min(ts_min, tm.team_size);
+ if(!ts_max) ts_max = tm.team_size;
+ else ts_max = max(ts_max, tm.team_size);
+ }
+ if ((ts_max - ts_min) > 1)
+ {
+ s = strcat(blinkcolor, "Teamnumbers are unbalanced!");
+ tm = GetTeam(myteam, false);
+ if (tm)
+ if (tm.team != COLOR_SPECTATOR)
+ if (tm.team_size == ts_max)
+ s = strcat(s, " Press ^3", getcommandkey("team menu", "menu_showteamselect"), blinkcolor, " to adjust");
+
+ drawcolorcodedstring(o, s, fontsize, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ o += eY * fontsize_y;
+ }
+ }
+ }
+ if(hud_configure)
+ {
+ s = "^7Press ^3ESC ^7to show HUD options.";
+ drawcolorcodedstring(o, s, fontsize, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ o += eY * fontsize_y;
+ s = "^3Doubleclick a panel for panel-specific options.";
+ drawcolorcodedstring(o, s, fontsize, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ o += eY * fontsize_y;
+ }
+}
+
+// Timer (#5)
+//
+void HUD_Timer(void)
+{
+ float id = HUD_PANEL_TIMER;
+ vector pos, mySize;
+ pos = HUD_Panel_GetPos(id);
+ mySize = HUD_Panel_GetSize(id);
+
+ HUD_Panel_DrawBg(id, pos, mySize, 0);
+ float padding;
+ padding = HUD_Panel_GetPadding(id);
+ if(padding)
+ {
+ pos += '1 1 0' * padding;
+ mySize -= '2 2 0' * padding;
+ }
+
+ float timelimit, elapsedTime, minutes, seconds, timeleft, minutesLeft, secondsLeft;
+
+ timelimit = getstatf(STAT_TIMELIMIT);
+
+ timeleft = max(0, timelimit * 60 + getstatf(STAT_GAMESTARTTIME) - time);
+ timeleft = ceil(timeleft);
+ minutesLeft = floor(timeleft / 60);
+ secondsLeft = timeleft - minutesLeft*60;
+
+ vector timer_color;
+ if(minutesLeft >= 5 || warmup_stage || timelimit == 0) //don't use red or yellow in warmup or when there is no timelimit
+ timer_color = '1 1 1'; //white
+ else if(minutesLeft >= 1)
+ timer_color = '1 1 0'; //yellow
+ else
+ timer_color = '1 0 0'; //red
+
+ if (cvar("hud_timer_increment") || timelimit == 0 || warmup_stage) {
+ if (time < getstatf(STAT_GAMESTARTTIME)) {
+ //while restart is still active, show 00:00
+ minutes = seconds = 0;
+ } else {
+ elapsedTime = floor(time - getstatf(STAT_GAMESTARTTIME)); //127
+ minutes = floor(elapsedTime / 60);
+ seconds = elapsedTime - minutes*60;
+ }
+ } else {
+ minutes = minutesLeft;
+ seconds = secondsLeft;
+ }
+
+ if(minutes > 999)
+ seconds = 99;
+ minutes = min(minutes, 999);
+ if(minutesLeft >= 1 || cvar("hud_timer_increment") || timelimit == 0 || warmup_stage) {
+ HUD_DrawXNum(pos + eX * mySize_x - eX * 5.1 * mySize_y, minutes, 3, 0, mySize_y, timer_color, 0, 0, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ drawpic_skin(pos + eX * mySize_x - eX * 2.57 * mySize_y, "num_colon", '1 1 0' * mySize_y, timer_color, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ }
+ HUD_DrawXNum(pos + eX * mySize_x - eX * 2 * mySize_y, seconds, -2, 0, mySize_y, timer_color, 0, 0, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+}
+
+// Radar (#6)
+//
+void HUD_Radar(void)
+{
+ float id = HUD_PANEL_RADAR;
+ vector pos, mySize;
+ pos = HUD_Panel_GetPos(id);
+ mySize = HUD_Panel_GetSize(id);
+
+ HUD_Panel_DrawBg(id, pos, mySize, 0);
+ float padding;
+ padding = HUD_Panel_GetPadding(id);
+ if(padding)
+ {
+ pos += '1 1 0' * padding;
+ mySize -= '2 2 0' * padding;
+ }
+
+ local float color1, color2; // color already declared as a global in hud.qc
+ local vector rgb;
+ local entity tm;
+ float scale2d, normalsize, bigsize;
+ float f;
+
+ teamradar_origin2d = pos + 0.5 * mySize;
+ teamradar_size2d = mySize;
+
+ if(minimapname == "")
+ return;
+
+ teamradar_loadcvars();
+
+ switch(hud_radar_zoommode)
+ {
+ default:
+ case 0:
+ f = current_zoomfraction;
+ break;
+ case 1:
+ f = 1 - current_zoomfraction;
+ break;
+ case 2:
+ f = 0;
+ break;
+ case 3:
+ f = 1;
+ break;
+ }
+
+ switch(hud_radar_rotation)
+ {
+ case 0:
+ teamradar_angle = view_angles_y - 90;
+ break;
+ default:
+ teamradar_angle = 90 * hud_radar_rotation;
+ break;
+ }
+
+ scale2d = vlen_maxnorm2d(mi_picmax - mi_picmin);
+ teamradar_size2d = mySize;
+
+ teamradar_extraclip_mins = teamradar_extraclip_maxs = '0 0 0'; // we always center
+
+ // pixels per world qu to match the teamradar_size2d_x range in the longest dimension
+ if(hud_radar_rotation == 0)
+ {
+ // max-min distance must fit the radar in any rotation
+ bigsize = vlen_minnorm2d(teamradar_size2d) * scale2d / (1.05 * vlen2d(mi_max - mi_min));
+ }
+ else
+ {
+ vector c0, c1, c2, c3, span;
+ c0 = rotate(mi_min, teamradar_angle * DEG2RAD);
+ c1 = rotate(mi_max, teamradar_angle * DEG2RAD);
+ c2 = rotate('1 0 0' * mi_min_x + '0 1 0' * mi_max_y, teamradar_angle * DEG2RAD);
+ c3 = rotate('1 0 0' * mi_max_x + '0 1 0' * mi_min_y, teamradar_angle * DEG2RAD);
+ span = '0 0 0';
+ span_x = max4(c0_x, c1_x, c2_x, c3_x) - min4(c0_x, c1_x, c2_x, c3_x);
+ span_y = max4(c0_y, c1_y, c2_y, c3_y) - min4(c0_y, c1_y, c2_y, c3_y);
+
+ // max-min distance must fit the radar in x=x, y=y
+ bigsize = min(
+ teamradar_size2d_x * scale2d / (1.05 * span_x),
+ teamradar_size2d_y * scale2d / (1.05 * span_y)
+ );
+ }
+
+ normalsize = vlen_maxnorm2d(teamradar_size2d) * scale2d / hud_radar_scale;
+ if(bigsize > normalsize)
+ normalsize = bigsize;
+
+ teamradar_size =
+ f * bigsize
+ + (1 - f) * normalsize;
+ teamradar_origin3d_in_texcoord = teamradar_3dcoord_to_texcoord(
+ f * (mi_min + mi_max) * 0.5
+ + (1 - f) * view_origin);
+
+ color1 = GetPlayerColor(player_localentnum-1);
+ rgb = GetTeamRGB(color1);
+
+ drawsetcliparea(
+ pos_x,
+ pos_y,
+ mySize_x,
+ mySize_y
+ );
+
+ draw_teamradar_background(hud_radar_background_alpha, hud_radar_foreground_alpha);
+
+ for(tm = world; (tm = find(tm, classname, "radarlink")); )
+ draw_teamradar_link(tm.origin, tm.velocity, tm.team);
+ for(tm = world; (tm = findflags(tm, teamradar_icon, 0xFFFFFF)); )
+ draw_teamradar_icon(tm.origin, tm.teamradar_icon, tm, tm.teamradar_color, HUD_Panel_GetFgAlpha(id));
+ for(tm = world; (tm = find(tm, classname, "entcs_receiver")); )
+ {
+ color2 = GetPlayerColor(tm.sv_entnum);
+ //if(color == COLOR_SPECTATOR || color == color2)
+ draw_teamradar_player(tm.origin, tm.angles, GetTeamRGB(color2));
+ }
+ draw_teamradar_player(view_origin, view_angles, '1 1 1');
+
+ drawresetcliparea();
+};
+
+// Score (#7)
+//
+void HUD_Score(void)
+{
+ float id = HUD_PANEL_SCORE;
+ vector pos, mySize;
+ pos = HUD_Panel_GetPos(id);
+ mySize = HUD_Panel_GetSize(id);
+
+ HUD_Panel_DrawBg(id, pos, mySize, 0);
+ float padding;
+ padding = HUD_Panel_GetPadding(id);
+ if(padding)
+ {
+ pos += '1 1 0' * padding;
+ mySize -= '2 2 0' * padding;
+ }
+
+ float score, distribution, leader;
+ float score_len, distr_len;
+ vector distribution_color;
+ entity tm, pl, me;
+ me = (spectatee_status > 0) ? playerslots[spectatee_status - 1] : playerslots[player_localentnum - 1];
+
+ // TODO... this (race part) still uses constant coordinates :/
+ if((scores_flags[ps_primary] & SFL_TIME) && !teamplay) { // race/cts record display on HUD
+ /*pl = players.sort_next;
+ if(pl == me)
+ pl = pl.sort_next;
+ if(scores_flags[ps_primary] & SFL_ZERO_IS_WORST)
+ if(pl.scores[ps_primary] == 0)
+ pl = world;
+
+ score = me.(scores[ps_primary]);
+
+ float racemin, racesec, racemsec;
+ float distsec, distmsec, minusplus;
+
+ racemin = floor(score/(60 * TIME_FACTOR));
+ racesec = floor((score - racemin*(60 * TIME_FACTOR))/TIME_FACTOR);
+ racemsec = score - racemin*60*TIME_FACTOR - racesec*TIME_FACTOR;
+
+ if (pl && ((!(scores_flags[ps_primary] & SFL_ZERO_IS_WORST)) || score)) {
+ // distribution display
+ distribution = me.(scores[ps_primary]) - pl.(scores[ps_primary]);
+
+ if (distribution < TIME_FACTOR && distribution > -TIME_FACTOR)
+ distmsec = fabs(distribution);
+ else {
+ distsec = floor(fabs(distribution)/TIME_FACTOR);
+ distmsec = fabs(distribution) - distsec*TIME_FACTOR;
+ if (distribution < 0)
+ distsec = -distsec;
+ }
+
+ if (distribution <= 0) {
+ distribution_color = eY;
+ minusplus = 1; // minusplus 1: always prefix with minus sign
+ }
+ else {
+ distribution_color = eX;
+ minusplus = 2; // minusplus 1: always prefix with plus sign
}
-
- if(fuel)
- drawpic(pos, "gfx/hud/statusbar", eX * mySize_x * min(1, fuel/100) + eY * 0.1 * mySize_y, HUD_Panel_GetProgressBarColor("fuel"), hud_alpha_fg * 0.8, DRAWFLAG_NORMAL);
+ HUD_DrawXNum(bottomright - '0 48 0' - '16 0 0' * TIME_DECIMALS, distmsec, -TIME_DECIMALS, 0, 16, distribution_color, 0, 0, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ HUD_DrawXNum(bottomright - '68 48 0' - '16 0 0' * TIME_DECIMALS, distsec, 4, minusplus, 16, distribution_color, 0, 0, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ drawpic_skin(bottomright - '10 48 0' - '16 0 0' * TIME_DECIMALS, "num_dot", '16 16 0', distribution_color, HUD_Panel_GetFgAlpha(id), DRAWFLAG_ADDITIVE);
}
- }
-}
-
-// Score (#7)
-//
-void HUD_Score()
-{
- vector pos, mySize;
- pos = HUD_Panel_GetPos(7);
- mySize = HUD_Panel_GetSize(7);
-
- HUD_Panel_DrawBg(7, pos, mySize);
+ // race record display
+ if (distribution <= 0 || distribution == score) // draw the highlight background behind the timer if we have the lead
+ drawpic_skin(bottomright - '0 32 0' - '32 0 0' * (4 + TIME_DECIMALS), "num_leading_4", '0 28 0' + '32 0 0' * (4 + TIME_DECIMALS), '1 1 1', HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
- float score, distribution, leader;
- float score_len, distr_len;
- vector score_pos, secondary_score_pos, distribution_color;
- entity tm, pl, me;
- me = (spectatee_status > 0) ? playerslots[spectatee_status - 1] : playerslots[player_localentnum - 1];
+ HUD_DrawXNum(bottomright - '0 32 0' - TIME_DECIMALS * '30 0 0', racemsec, -TIME_DECIMALS, 0, 30, '1 1 1', 0, 0, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ HUD_DrawXNum(bottomright - '0 32 0' - TIME_DECIMALS * '30 0 0' - '66 0 0', racesec, -2, 0, 30, '1 1 1', 0, 0, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ drawpic_skin(bottomright - '0 32 0' - TIME_DECIMALS * '30 0 0' - '18 0 0', "num_dot", '30 30 0', '1 1 1', HUD_Panel_GetFgAlpha(id), DRAWFLAG_ADDITIVE);
- if (!teamplay) { // non-teamgames
+ HUD_DrawXNum(bottomright - '0 32 0' - TIME_DECIMALS * '30 0 0' - '132 0 0', racemin, -2, 0, 30, '1 1 1', 0, 0, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ drawpic_skin(bottomright - '0 32 0' - TIME_DECIMALS * '30 0 0' - '84 0 0', "num_colon", '30 30 0', '1 1 1', HUD_Panel_GetFgAlpha(id), DRAWFLAG_ADDITIVE);
+ */
+ } else if (!teamplay) { // non-teamgames
// me vector := [team/connected frags id]
pl = players.sort_next;
if(pl == me)
pl = pl.sort_next;
- if(cvar("_hud_configure"))
+ if(hud_configure)
distribution = 42;
else if(pl)
distribution = me.(scores[ps_primary]) - pl.(scores[ps_primary]);
distribution = 0;
score = me.(scores[ps_primary]);
- if(cvar("_hud_configure"))
+ if(hud_configure)
score = 123;
if(distribution >= 5) {
score_len = strlen(ftos(score));
distr_len = strlen(ftos(distribution));
- HUD_DrawXNum(pos + eX * mySize_x - eX * 3 * 0.33 * mySize_y, distribution, 3, 3, 0.33 * mySize_y, distribution_color, 0, 0, hud_alpha_fg, DRAWFLAG_NORMAL);
+ HUD_DrawXNum(pos + eX * mySize_x - eX * 3 * 0.33 * mySize_y, distribution, 3, 3, 0.33 * mySize_y, distribution_color, 0, 0, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
if (leader)
- drawpic(pos + eX * mySize_x - eX * score_len * mySize_y - eX * 3 * 0.33 * mySize_y, strcat("gfx/hud/sb_highlight_", ftos(score_len)), eX * score_len * mySize_y + eY * mySize_y, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
- HUD_DrawXNum(pos + eX * mySize_x - eX * 3 * mySize_y - eX * 3 * 0.33 * mySize_y, score, 3, 0, mySize_y, distribution_color, 0, 0, hud_alpha_fg, DRAWFLAG_NORMAL);
+ drawpic_skin(pos + eX * mySize_x - eX * score_len * mySize_y - eX * 3 * 0.33 * mySize_y, strcat("num_leading_", ftos(score_len)), eX * score_len * mySize_y + eY * mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ HUD_DrawXNum(pos + eX * mySize_x - eX * 3 * mySize_y - eX * 3 * 0.33 * mySize_y, score, 3, 0, mySize_y, distribution_color, 0, 0, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
} else { // teamgames
float max_fragcount;
max_fragcount = -99;
float teamnum;
for(tm = teams.sort_next; tm; tm = tm.sort_next) {
- if(tm.team == COLOR_SPECTATOR || (!tm.team_size && !cvar("_hud_configure"))) // no players? don't display
+ if(tm.team == COLOR_SPECTATOR || (!tm.team_size && !hud_configure)) // no players? don't display
continue;
score = tm.(teamscores[ts_primary]);
- if(cvar("_hud_configure"))
+ if(hud_configure)
score = 123;
leader = 0;
if (max_fragcount == score)
leader = 1;
if (leader)
- drawpic(pos + eX * mySize_x - eX * score_len * mySize_y - eX * 3 * 0.33 * mySize_y, strcat("gfx/hud/sb_highlight_", ftos(score_len)), eX * score_len * mySize_y + eY * mySize_y, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
- HUD_DrawXNum(pos + eX * mySize_x - eX * 3 * mySize_y - eX * 3 * 0.33 * mySize_y, score, 3, 0, mySize_y, GetTeamRGB(tm.team) * 0.8, 0, 0, hud_alpha_fg, DRAWFLAG_NORMAL);
+ drawpic_skin(pos + eX * mySize_x - eX * score_len * mySize_y - eX * 3 * 0.33 * mySize_y, strcat("num_leading_", ftos(score_len)), eX * score_len * mySize_y + eY * mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ HUD_DrawXNum(pos + eX * mySize_x - eX * 3 * mySize_y - eX * 3 * 0.33 * mySize_y, score, 3, 0, mySize_y, GetTeamRGB(tm.team) * 0.8, 0, 0, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
} else {
if (max_fragcount == score)
leader = 1;
if (leader)
- drawpic(pos + eX * mySize_x - eX * 0.33 * score_len * mySize_y + eY * 0.33 * mySize_y * teamnum, strcat("gfx/hud/sb_highlight_", ftos(score_len)), eX * 0.33 * score_len * mySize_y + eY * 0.33 * mySize_y, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
- HUD_DrawXNum(pos + eX * mySize_x - eX * 3 * 0.33 * mySize_y + eY * 0.33 * mySize_y * teamnum, score, 3, 0, 0.33 * mySize_y, GetTeamRGB(tm.team) * 0.8, 0, 0, hud_alpha_fg, DRAWFLAG_NORMAL);
+ drawpic_skin(pos + eX * mySize_x - eX * 0.33 * score_len * mySize_y + eY * 0.33 * mySize_y * teamnum, strcat("num_leading_", ftos(score_len)), eX * 0.33 * score_len * mySize_y + eY * 0.33 * mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ HUD_DrawXNum(pos + eX * mySize_x - eX * 3 * 0.33 * mySize_y + eY * 0.33 * mySize_y * teamnum, score, 3, 0, 0.33 * mySize_y, GetTeamRGB(tm.team) * 0.8, 0, 0, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
teamnum += 1;
}
}
// Race timer (#8)
//
void HUD_RaceTimer (void) {
+ float id = HUD_PANEL_RACETIMER;
vector pos, mySize;
- pos = HUD_Panel_GetPos(8);
- mySize = HUD_Panel_GetSize(8);
+ pos = HUD_Panel_GetPos(id);
+ mySize = HUD_Panel_GetSize(id);
- HUD_Panel_DrawBg(8, pos, mySize);
+ HUD_Panel_DrawBg(id, pos, mySize, 0);
+ float padding;
+ padding = HUD_Panel_GetPadding(id);
+ if(padding)
+ {
+ pos += '1 1 0' * padding;
+ mySize -= '2 2 0' * padding;
+ }
drawfont = hud_bigfont;
float a, t;
string s, forcetime;
- if(cvar("_hud_configure"))
+ if(hud_configure)
{
s = "0:13:37";
- drawstring(pos + eX * 0.5 * mySize_x - '0.5 0 0' * stringwidth(s, FALSE, '0.75 0.75 0' * mySize_y), s, '0.75 0.75 0' * mySize_y, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
+ drawstring(pos + eX * 0.5 * mySize_x - '0.5 0 0' * stringwidth(s, FALSE, '0.60 0.60 0' * mySize_y), s, '0.60 0.60 0' * mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
s = "^1Intermediate 1 (+15.42)";
- drawcolorcodedstring(pos + eX * 0.5 * mySize_x - '0.5 0 0' * stringwidth(s, TRUE, '1 1 0' * 0.25 * mySize_y) + eY * 0.75 * mySize_y, s, '1 1 0' * 0.25 * mySize_y, hud_alpha_fg, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos + eX * 0.5 * mySize_x - '0.5 0 0' * stringwidth(s, TRUE, '1 1 0' * 0.20 * mySize_y) + eY * 0.60 * mySize_y, s, '1 1 0' * 0.20 * mySize_y, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ s = strcat("^1PENALTY: ", ftos_decimals(20 * 0.1, 1), " (missing a checkpoint)");
+ drawcolorcodedstring(pos + eX * 0.5 * mySize_x - '0.5 0 0' * stringwidth(s, TRUE, '1 1 0' * 0.20 * mySize_y) + eY * 0.80 * mySize_y, s, '1 1 0' * 0.20 * mySize_y, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
}
else if(race_checkpointtime)
{
if(s != "" && a > 0)
{
dummyfunction(0, 0, 0, 0, 0, 0, 0, 0); // work around DP bug (set OFS_PARAM5 to 0)
- //drawcolorcodedstring(m - '0 16 0' - '8 0 0' * stringwidth(s, TRUE), s, '16 16 0', hud_alpha_fg * a, DRAWFLAG_NORMAL);
- drawcolorcodedstring(pos + eX * 0.5 * mySize_x - '0.5 0 0' * stringwidth(s, TRUE, '1 1 0' * 0.25 * mySize_y) + eY * 0.75 * mySize_y, s, '1 1 0' * 0.25 * mySize_y, hud_alpha_fg * a, DRAWFLAG_NORMAL);
+ //drawcolorcodedstring(m - '0 16 0' - '8 0 0' * stringwidth(s, TRUE), s, '16 16 0', HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos + eX * 0.5 * mySize_x - '0.5 0 0' * stringwidth(s, TRUE, '1 1 0' * 0.2 * mySize_y) + eY * 0.6 * mySize_y, s, '1 1 0' * 0.2 * mySize_y, HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
}
if(race_penaltytime)
{
s = strcat("^1PENALTY: ", ftos_decimals(race_penaltytime * 0.1, 1), " (", race_penaltyreason, ")");
dummyfunction(0, 0, 0, 0, 0, 0, 0, 0); // work around DP bug (set OFS_PARAM5 to 0)
- //drawcolorcodedstring(m - '0 32 0' - '8 0 0' * stringwidth(s, TRUE), s, '16 16 0', hud_alpha_fg * a, DRAWFLAG_NORMAL);
- drawcolorcodedstring(pos - '0 32 0' - '0.5 0 0' * stringwidth(s, TRUE, '16 16 0'), s, '16 16 0', hud_alpha_fg * a, DRAWFLAG_NORMAL);
+ //drawcolorcodedstring(m - '0 32 0' - '8 0 0' * stringwidth(s, TRUE), s, '16 16 0', HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos + eX * 0.5 * mySize_x - '0.5 0 0' * stringwidth(s, TRUE, '1 1 0' * 0.2 * mySize_y) + eY * 0.8 * mySize_y, s, '1 1 0' * 0.2 * mySize_y, HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
}
}
if(forcetime != "")
{
a = bound(0, (time - race_checkpointtime) / 0.5, 1);
- //drawstring_expanding(m - '16 0 0' * stringwidth(forcetime, FALSE), forcetime, '32 32 0', '1 1 1', hud_alpha_fg, 0, a);
- drawstring_expanding(pos + eX * 0.5 * mySize_x - '0.5 0 0' * stringwidth(forcetime, FALSE, '1 1 0' * 0.75 * mySize_y), forcetime, '1 1 0' * 0.75 * mySize_y, '1 1 1', hud_alpha_fg, 0, a);
+ //drawstring_expanding(m - '16 0 0' * stringwidth(forcetime, FALSE), forcetime, '32 32 0', '1 1 1', HUD_Panel_GetFgAlpha(id), 0, a);
+ drawstring_expanding(pos + eX * 0.5 * mySize_x - '0.5 0 0' * stringwidth(forcetime, FALSE, '1 1 0' * 0.6 * mySize_y), forcetime, '1 1 0' * 0.6 * mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(id), 0, a);
}
else
a = 1;
if(race_laptime && race_checkpoint != 255)
{
s = TIME_ENCODED_TOSTRING(TIME_ENCODE(time + TIME_DECODE(race_penaltyaccumulator) - race_laptime));
- //drawstring(m - '16 0 0' * stringwidth(s, FALSE), s, '32 32 0', '1 1 1', hud_alpha_fg * a, DRAWFLAG_NORMAL);
- drawstring(pos + eX * 0.5 * mySize_x - '0.5 0 0' * stringwidth(s, FALSE, '0.75 0.75 0' * mySize_y), s, '0.75 0.75 0' * mySize_y, '1 1 1', hud_alpha_fg * a, DRAWFLAG_NORMAL);
+ //drawstring(m - '16 0 0' * stringwidth(s, FALSE), s, '32 32 0', '1 1 1', HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ drawstring(pos + eX * 0.5 * mySize_x - '0.5 0 0' * stringwidth(s, FALSE, '0.6 0.6 0' * mySize_y), s, '0.6 0.6 0' * mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
}
}
else
a = bound(0, 2 - (time - race_mycheckpointtime), 1);
s = MakeRaceString(race_mycheckpoint, TIME_DECODE(race_mycheckpointdelta), -!race_mycheckpointenemy, race_mycheckpointlapsdelta, race_mycheckpointenemy);
dummyfunction(0, 0, 0, 0, 0, 0, 0, 0); // work around DP bug (set OFS_PARAM5 to 0)
- //drawcolorcodedstring(m - '0 16 0' - '8 0 0' * stringwidth(s, TRUE), s, '16 16 0', hud_alpha_fg * a, DRAWFLAG_NORMAL);
- drawcolorcodedstring(pos - '0 16 0' - '0.5 0 0' * stringwidth(s, TRUE, '16 16 0'), s, '16 16 0', hud_alpha_fg * a, DRAWFLAG_NORMAL);
+ //drawcolorcodedstring(m - '0 16 0' - '8 0 0' * stringwidth(s, TRUE), s, '16 16 0', HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos + eX * 0.5 * mySize_x - '0.5 0 0' * stringwidth(s, TRUE, '1 1 0' * 0.2 * mySize_y) + eY * 0.6 * mySize_y, s, '1 1 0' * 0.2 * mySize_y, HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
}
if(race_othercheckpointtime && race_othercheckpointenemy != "")
{
a = bound(0, 2 - (time - race_othercheckpointtime), 1);
s = MakeRaceString(race_othercheckpoint, -TIME_DECODE(race_othercheckpointdelta), -!race_othercheckpointenemy, race_othercheckpointlapsdelta, race_othercheckpointenemy);
dummyfunction(0, 0, 0, 0, 0, 0, 0, 0); // work around DP bug (set OFS_PARAM5 to 0)
- //drawcolorcodedstring(m - '0 0 0' - '8 0 0' * stringwidth(s, TRUE), s, '16 16 0', hud_alpha_fg * a, DRAWFLAG_NORMAL);
- drawcolorcodedstring(pos - '0 0 0' - '0.5 0 0' * stringwidth(s, TRUE, '16 16 0'), s, '16 16 0', hud_alpha_fg * a, DRAWFLAG_NORMAL);
+ //drawcolorcodedstring(m - '0 0 0' - '8 0 0' * stringwidth(s, TRUE), s, '16 16 0', HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos + eX * 0.5 * mySize_x - '0.5 0 0' * stringwidth(s, TRUE, '1 1 0' * 0.2 * mySize_y) + eY * 0.6 * mySize_y, s, '1 1 0' * 0.2 * mySize_y, HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
}
if(race_penaltytime && !race_penaltyaccumulator)
else
s = strcat("^2PENALTY: 0.0 (", race_penaltyreason, ")");
dummyfunction(0, 0, 0, 0, 0, 0, 0, 0); // work around DP bug (set OFS_PARAM5 to 0)
- //drawcolorcodedstring(m - '0 32 0' - '8 0 0' * stringwidth(s, TRUE), s, '16 16 0', hud_alpha_fg * a, DRAWFLAG_NORMAL);
- drawcolorcodedstring(pos - '0 32 0' - '0.5 0 0' * stringwidth(s, TRUE, '16 16 0'), s, '16 16 0', hud_alpha_fg * a, DRAWFLAG_NORMAL);
+ //drawcolorcodedstring(m - '0 32 0' - '8 0 0' * stringwidth(s, TRUE), s, '16 16 0', HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos + eX * 0.5 * mySize_x - '0.5 0 0' * stringwidth(s, TRUE, '1 1 0' * 0.2 * mySize_y) + eY * 0.6 * mySize_y, s, '1 1 0' * 0.2 * mySize_y, HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
}
}
}
drawfont = hud_font;
}
-// Notification area (#4)
-void HUD_Notify (void)
-{
- vector pos, mySize;
- pos = HUD_Panel_GetPos(4);
- mySize = HUD_Panel_GetSize(4);
-
- HUD_Panel_DrawBg(4, pos, mySize);
-
- string s;
- entity tm;
- if(spectatee_status && !intermission)
- {
- drawfont = hud_bigfont;
- if(spectatee_status == -1)
- s = "^1Observing";
- else
- s = GetPlayerName(spectatee_status - 1);
- // spectated player name between HUD and chat area, aligned to the left
- pos_x = 0;
- pos_y = - 50 - hud_fontsize_spec_y;
- s = textShortenToWidth(s, vid_conwidth/2.5, hud_fontsize_spec, stringwidth_colors);
- drawcolorcodedstring(pos, s, hud_fontsize_spec, hud_alpha_fg, DRAWFLAG_NORMAL);
- drawfont = hud_font;
-
- // spectator text in the upper right corner
- if(spectatee_status == -1)
- s = strcat("^1Press ^3", getcommandkey("primary fire", "+attack"), "^1 to spectate");
- else
- s = strcat("^1Press ^3", getcommandkey("primary fire", "+attack"), "^1 for another player");
-
- if(spectatee_status == -1)
- s = strcat("^1Use ^3", getcommandkey("next weapon", "weapnext"), "^1 or ^3", getcommandkey("previous weapon", "weapprev"), "^1 to change the speed");
- else
- s = strcat("^1Press ^3", getcommandkey("secondary fire", "+attack2"), "^1 to observe");
-
- s = strcat("^1Press ^3", getcommandkey("server info", "+show_info"), "^1 for gamemode info");
-
- if(gametype == GAME_ARENA)
- s = "^1Wait for your turn to join";
- else if(gametype == GAME_LMS)
- {
- entity sk;
- sk = playerslots[player_localentnum - 1];
- if(sk.(scores[ps_primary]) >= 666)
- s = "^1Match has already begun";
- else if(sk.(scores[ps_primary]) > 0)
- s = "^1You have no more lives left";
- else
- s = strcat("^1Press ^3", getcommandkey("jump", "+jump"), "^1 to join");
- }
- else
- s = strcat("^1Press ^3", getcommandkey("jump", "+jump"), "^1 to join");
-
- //show restart countdown:
- if (time < getstatf(STAT_GAMESTARTTIME)) {
- float countdown;
- //we need to ceil, otherwise the countdown would be off by .5 when using round()
- countdown = ceil(getstatf(STAT_GAMESTARTTIME) - time);
- s = strcat("^1Game starts in ^3", ftos(countdown), "^1 seconds");
- }
- }
- if(warmup_stage && !intermission)
- {
- s = "^2Currently in ^1warmup^2 stage!";
- }
-
- // move more important stuff more to the middle so its more visible
-
- string blinkcolor;
- if(mod(time, 1) >= 0.5)
- blinkcolor = "^1";
- else
- blinkcolor = "^3";
-
- if(ready_waiting && !intermission && !spectatee_status)
- {
- if(ready_waiting_for_me)
- {
- if(warmup_stage)
- s = strcat(blinkcolor, "Press ^3", getcommandkey("ready", "ready"), blinkcolor, " to end warmup");
- else
- s = strcat(blinkcolor, "Press ^3", getcommandkey("ready", "ready"), blinkcolor, " once you are ready");
- }
- else
- {
- if(warmup_stage)
- s = strcat("^2Waiting for others to ready up to end warmup...");
- else
- s = strcat("^2Waiting for others to ready up...");
- }
- }
- else if(warmup_stage && !intermission && !spectatee_status)
- {
- s = strcat("^2Press ^3", getcommandkey("ready", "ready"), "^2 to end warmup");
- }
-
- if(teamplay && !intermission && !spectatee_status && gametype != GAME_CA && teamnagger)
- {
- float ts_min, ts_max;
- tm = teams.sort_next;
- if (tm)
- {
- for(; tm.sort_next; tm = tm.sort_next)
- {
- if(!tm.team_size || tm.team == COLOR_SPECTATOR)
- continue;
- if(!ts_min) ts_min = tm.team_size;
- else ts_min = min(ts_min, tm.team_size);
- if(!ts_max) ts_max = tm.team_size;
- else ts_max = max(ts_max, tm.team_size);
- }
- if ((ts_max - ts_min) > 1)
- {
- s = strcat(blinkcolor, "Teamnumbers are unbalanced!");
- tm = GetTeam(myteam, false);
- if (tm)
- if (tm.team != COLOR_SPECTATOR)
- if (tm.team_size == ts_max)
- s = strcat(s, " Press ^3", getcommandkey("team menu", "menu_showteamselect"), blinkcolor, " to adjust");
-
- }
- }
- }
-}
-
// Vote window (#9)
+//
float vote_yescount;
float vote_nocount;
float vote_needed;
void HUD_VoteWindow(void)
{
+ float id = HUD_PANEL_VOTE;
vector pos, mySize;
- pos = HUD_Panel_GetPos(9);
- mySize = HUD_Panel_GetSize(9);
+ pos = HUD_Panel_GetPos(id);
+ mySize = HUD_Panel_GetSize(id);
string s;
float a;
if(vote_active != vote_prev) {
vote_change = time;
- vote_prev = bound(0, vote_active, 1);
+ vote_prev = vote_active;
}
- if(vote_active)
+ if(vote_active || hud_configure)
vote_alpha = bound(0, (time - vote_change) * 2, 1);
else
vote_alpha = bound(0, 1 - (time - vote_change) * 2, 1);
- if(cvar("_hud_configure"))
+ if(hud_configure)
{
- vote_alpha = 1;
vote_yescount = 3;
vote_nocount = 2;
vote_needed = 4;
}
- HUD_Panel_DrawBg(9, pos, mySize);
+ if(!vote_alpha)
+ return;
- if(vote_alpha) {
- a = vote_alpha * bound(cvar_or("hud_vote_alreadyvoted_alpha", 0.75), 1 - vote_highlighted, 1);
+ a = vote_alpha * bound(cvar_or("hud_vote_alreadyvoted_alpha", 0.75), 1 - vote_highlighted, 1);
- drawpic(pos, "gfx/hud/voteprogress_back", mySize, HUD_GetBgColor(), a * hud_alpha_bg, DRAWFLAG_NORMAL);
+ HUD_Panel_DrawBg(id, pos, mySize, a);
+ float padding;
+ padding = HUD_Panel_GetPadding(id);
+ if(padding)
+ {
+ pos += '1 1 0' * padding;
+ mySize -= '2 2 0' * padding;
+ }
- s = "A vote has been called for: ";
- drawstring(pos + '0.5 0 0' * mySize_x + '0 0.1 0' * mySize_y - eX * stringwidth(s, FALSE, '1 1 0' * 0.5 * mySize_y*(1/5)), s, '1 1 0' * mySize_y*(1/5), '1 1 1', a * hud_alpha_fg, DRAWFLAG_NORMAL);
- s = textShortenToWidth(vote_called_vote, mySize_x * 0.96, '10 0 0', stringwidth_colors);
- if(cvar("_hud_configure"))
- s = "Configure the HUD";
- drawcolorcodedstring(pos + '0.52 0 0' * mySize_x + '0 0.3 0' * mySize_y - eX * stringwidth(s, FALSE, '1 1 0' * 0.5 * mySize_y*(1/6)), s, '1 1 0' * mySize_y*(1/6), a * hud_alpha_fg, DRAWFLAG_NORMAL);
+ drawpic_skin(pos, "voteprogress_back", mySize, '1 1 1', a * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
- // print the yes/no counts
- s = strcat("Yes: ", ftos(vote_yescount));
- drawstring(pos + '0 0.6 0' * mySize_y + '0.02 0 0' * mySize_x, s, '1 1 0' * mySize_y*(1/6) , eY, a * hud_alpha_fg, DRAWFLAG_NORMAL);
- s = strcat("No: ", ftos(vote_nocount));
- drawstring(pos + '0 0.6 0' * mySize_y + '0.98 0 0' * mySize_x - eX * stringwidth(s, FALSE, '1 1 0' * mySize_y*(1/6)), s, '1 1 0' * mySize_y*(1/6), eX, a * hud_alpha_fg, DRAWFLAG_NORMAL);
+ s = "A vote has been called for: ";
+ drawstring(pos + '0.5 0 0' * mySize_x + '0 0.1 0' * mySize_y - eX * stringwidth(s, FALSE, '1 1 0' * 0.5 * mySize_y*(1/5)), s, '1 1 0' * mySize_y*(1/5), '1 1 1', a * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ s = textShortenToWidth(vote_called_vote, mySize_x * 0.96, '1 1 0' * mySize_y*(1/5), stringwidth_colors); // TODO: broken?
+ if(hud_configure)
+ s = "Configure the HUD";
+ drawcolorcodedstring(pos + '0.52 0 0' * mySize_x + '0 0.3 0' * mySize_y - eX * stringwidth(s, FALSE, '1 1 0' * 0.5 * mySize_y*(1/6)), s, '1 1 0' * mySize_y*(1/6), a * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
- // draw the progress bars
- drawsetcliparea(pos_x, pos_y, mySize_x * 0.5 * (vote_yescount/vote_needed), mySize_y);
- drawpic(pos, "gfx/hud/voteprogress_prog", mySize, eY, a * hud_alpha_fg, DRAWFLAG_NORMAL);
+ // print the yes/no counts
+ s = strcat("Yes: ", ftos(vote_yescount));
+ drawstring(pos + '0 0.6 0' * mySize_y + '0.02 0 0' * mySize_x, s, '1 1 0' * mySize_y*(1/6) , eY, a * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ s = strcat("No: ", ftos(vote_nocount));
+ drawstring(pos + '0 0.6 0' * mySize_y + '0.98 0 0' * mySize_x - eX * stringwidth(s, FALSE, '1 1 0' * mySize_y*(1/6)), s, '1 1 0' * mySize_y*(1/6), eX, a * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
- drawsetcliparea(pos_x + mySize_x - mySize_x * 0.5 * (vote_nocount/vote_needed), pos_y, mySize_x * 0.5, mySize_y);
- drawpic(pos, "gfx/hud/voteprogress_prog", mySize, eX, a * hud_alpha_fg, DRAWFLAG_NORMAL);
+ // draw the progress bars
+ drawsetcliparea(pos_x, pos_y, mySize_x * 0.5 * (vote_yescount/vote_needed), mySize_y);
+ drawpic_skin(pos, "voteprogress_prog", mySize, eY, a * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
- // draw the highlights
- if(vote_highlighted == 1) {
- drawsetcliparea(pos_x, pos_y, mySize_x * 0.5, mySize_y);
- drawpic(pos, "gfx/hud/voteprogress_voted", mySize, eY, a * hud_alpha_fg, DRAWFLAG_NORMAL);
- }
- else if(vote_highlighted == 2) {
- drawsetcliparea(pos_x + 0.5 * mySize_x, pos_y, mySize_x * 0.5, mySize_y);
- drawpic(pos, "gfx/hud/voteprogress_voted", mySize, eX, a * hud_alpha_fg, DRAWFLAG_NORMAL);
- }
+ drawsetcliparea(pos_x + mySize_x - mySize_x * 0.5 * (vote_nocount/vote_needed), pos_y, mySize_x * 0.5, mySize_y);
+ drawpic_skin(pos, "voteprogress_prog", mySize, eX, a * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
- drawresetcliparea();
- }
- else if(!vote_active) {
- vote_highlighted = 0;
+ // draw the highlights
+ if(vote_highlighted == 1) {
+ drawsetcliparea(pos_x, pos_y, mySize_x * 0.5, mySize_y);
+ drawpic_skin(pos, "voteprogress_voted", mySize, eY, a * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
}
-}
-
-// Awards system
-float race_status_time;
-float race_status_prev;
-string race_status_name_prev;
-void HUD_DrawRaceStatus(vector pos)
-{
- if (race_status != race_status_prev || race_status_name != race_status_name_prev) {
- race_status_time = time + 5;
- race_status_prev = race_status;
- if (race_status_name_prev)
- strunzone(race_status_name_prev);
- race_status_name_prev = strzone(race_status_name);
+ else if(vote_highlighted == 2) {
+ drawsetcliparea(pos_x + 0.5 * mySize_x, pos_y, mySize_x * 0.5, mySize_y);
+ drawpic_skin(pos, "voteprogress_voted", mySize, eX, a * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
}
- float a;
- a = bound(0, race_status_time - time, 1);
-
- string s;
- s = textShortenToWidth(race_status_name, 120, '10 10 0', stringwidth_colors);
-
- float rank;
- if(race_status > 0)
- rank = race_CheckName(race_status_name);
- string rankname;
- rankname = race_PlaceName(rank);
-
- if(race_status == 0)
- drawpic(pos, "gfx/hud/race/newfail", '80 80 0', '1 1 1', hud_alpha_fg * a, DRAWFLAG_NORMAL);
- else if(race_status == 1) {
- drawpic(pos, "gfx/hud/race/newtime", '80 80 0', '1 1 1', hud_alpha_fg * a, DRAWFLAG_NORMAL);
- drawcolorcodedstring(pos + '40 80 0' - eX * stringwidth(s, TRUE, '5 0 0'), s, '10 10 0', hud_alpha_fg * a, DRAWFLAG_NORMAL);
- drawstring(pos + '40 20 0' - eX * stringwidth(rankname, TRUE, '7 0 0'), rankname, '14 14 0', '1 1 1', hud_alpha_fg * a, DRAWFLAG_NORMAL);
- } else if(race_status == 2) {
- if(race_status_name == GetPlayerName(player_localentnum -1) || !race_myrank || race_myrank < rank)
- drawpic(pos, "gfx/hud/race/newrankgreen", '80 80 0', '1 1 1', hud_alpha_fg * a, DRAWFLAG_NORMAL);
- else
- drawpic(pos, "gfx/hud/race/newrankyellow", '80 80 0', '1 1 1', hud_alpha_fg * a, DRAWFLAG_NORMAL);
- drawcolorcodedstring(pos + '40 80 0' - eX * stringwidth(s, TRUE, '5 0 0'), s, '10 10 0', hud_alpha_fg * a, DRAWFLAG_NORMAL);
- drawstring(pos + '40 20 0' - eX * stringwidth(rankname, TRUE, '7 0 0'), rankname, '14 14 0', '1 1 1', hud_alpha_fg * a, DRAWFLAG_NORMAL);
- } else if(race_status == 3) {
- drawpic(pos, "gfx/hud/race/newrecordserver", '80 80 0', '1 1 1', hud_alpha_fg * a, DRAWFLAG_NORMAL);
- drawcolorcodedstring(pos + '40 80 0' - eX * stringwidth(s, TRUE, '5 0 0'), s, '10 10 0', hud_alpha_fg * a, DRAWFLAG_NORMAL);
- drawstring(pos + '40 20 0' - eX * stringwidth(rankname, TRUE, '7 0 0'), rankname, '14 14 0', '1 1 1', hud_alpha_fg * a, DRAWFLAG_NORMAL);
- }
+ drawresetcliparea();
- if (race_status_time - time <= 0) {
- race_status_prev = -1;
- race_status = -1;
- if(race_status_name)
- strunzone(race_status_name);
- race_status_name = string_null;
- if(race_status_name_prev)
- strunzone(race_status_name_prev);
- race_status_name_prev = string_null;
+ if(!vote_active) {
+ vote_highlighted = 0;
}
}
+// Mod icons panel (#10)
+//
+
+float mod_active; // is there any active mod icon?
+
// CTF HUD modicon section
float redflag_prevframe, blueflag_prevframe; // status during previous frame
float redflag_prevstatus, blueflag_prevstatus; // last remembered status
float redflag_statuschange_time, blueflag_statuschange_time; // time when the status changed
-void CSQC_ctf_hudreset(void)
+void HUD_Mod_CTF_Reset(void)
{
redflag_prevstatus = blueflag_prevstatus = redflag_prevframe = blueflag_prevframe = redflag_statuschange_time = blueflag_statuschange_time = 0;
}
-void CSQC_ctf_hud(void)
+void HUD_Mod_CTF(vector pos, vector mySize)
{
- vector bottomleft, redflag_pos, blueflag_pos, sz;
+ vector redflag_pos, blueflag_pos;
float f; // every function should have that
- bottomleft_y = vid_conheight;
- bottomleft_z = 0;
float redflag, blueflag; // current status
float redflag_statuschange_elapsedtime, blueflag_statuschange_elapsedtime; // time since the status changed
stat_items = getstati(STAT_ITEMS);
redflag = (stat_items/IT_RED_FLAG_TAKEN) & 3;
blueflag = (stat_items/IT_BLUE_FLAG_TAKEN) & 3;
+
+ if(redflag || blueflag)
+ mod_active = 1;
+ else
+ mod_active = 0;
+
+ if(hud_configure)
+ {
+ redflag = 1;
+ blueflag = 2;
+ }
// when status CHANGES, set old status into prevstatus and current status into status
if (redflag != redflag_prevframe)
float red_alpha, red_alpha_prevstatus;
red_alpha = red_alpha_prevstatus = 1;
switch(redflag) {
- case 1: red_icon = "gfx/hud/sb_flag_red_taken"; break;
- case 2: red_icon = "gfx/hud/sb_flag_red_lost"; break;
- case 3: red_icon = "gfx/hud/sb_flag_red_carrying"; red_alpha = BLINK_BASE + BLINK_FACTOR * cos(time * BLINK_FREQ); break;
+ case 1: red_icon = "flag_red_taken"; break;
+ case 2: red_icon = "flag_red_lost"; break;
+ case 3: red_icon = "flag_red_carrying"; red_alpha = BLINK_BASE + BLINK_FACTOR * cos(time * BLINK_FREQ); break;
default:
if((stat_items & IT_CTF_SHIELDED) && (myteam == COLOR_TEAM2))
- red_icon = "gfx/hud/sb_flag_red_shielded";
+ red_icon = "flag_red_shielded";
else
red_icon = string_null;
break;
}
switch(redflag_prevstatus) {
- case 1: red_icon_prevstatus = "gfx/hud/sb_flag_red_taken"; break;
- case 2: red_icon_prevstatus = "gfx/hud/sb_flag_red_lost"; break;
- case 3: red_icon_prevstatus = "gfx/hud/sb_flag_red_carrying"; red_alpha_prevstatus = BLINK_BASE + BLINK_FACTOR * cos(time * BLINK_FREQ); break;
+ case 1: red_icon_prevstatus = "flag_red_taken"; break;
+ case 2: red_icon_prevstatus = "flag_red_lost"; break;
+ case 3: red_icon_prevstatus = "flag_red_carrying"; red_alpha_prevstatus = BLINK_BASE + BLINK_FACTOR * cos(time * BLINK_FREQ); break;
default:
if(redflag == 3)
- red_icon_prevstatus = "gfx/hud/sb_flag_red_carrying"; // make it more visible
+ red_icon_prevstatus = "flag_red_carrying"; // make it more visible
else if((stat_items & IT_CTF_SHIELDED) && (myteam == COLOR_TEAM2))
- red_icon_prevstatus = "gfx/hud/sb_flag_red_shielded";
+ red_icon_prevstatus = "flag_red_shielded";
else
red_icon_prevstatus = string_null;
break;
float blue_alpha, blue_alpha_prevstatus;
blue_alpha = blue_alpha_prevstatus = 1;
switch(blueflag) {
- case 1: blue_icon = "gfx/hud/sb_flag_blue_taken"; break;
- case 2: blue_icon = "gfx/hud/sb_flag_blue_lost"; break;
- case 3: blue_icon = "gfx/hud/sb_flag_blue_carrying"; blue_alpha = BLINK_BASE + BLINK_FACTOR * cos(time * BLINK_FREQ); break;
+ case 1: blue_icon = "flag_blue_taken"; break;
+ case 2: blue_icon = "flag_blue_lost"; break;
+ case 3: blue_icon = "flag_blue_carrying"; blue_alpha = BLINK_BASE + BLINK_FACTOR * cos(time * BLINK_FREQ); break;
default:
if((stat_items & IT_CTF_SHIELDED) && (myteam == COLOR_TEAM1))
- blue_icon = "gfx/hud/sb_flag_blue_shielded";
+ blue_icon = "flag_blue_shielded";
else
blue_icon = string_null;
break;
}
switch(blueflag_prevstatus) {
- case 1: blue_icon_prevstatus = "gfx/hud/sb_flag_blue_taken"; break;
- case 2: blue_icon_prevstatus = "gfx/hud/sb_flag_blue_lost"; break;
- case 3: blue_icon_prevstatus = "gfx/hud/sb_flag_blue_carrying"; blue_alpha_prevstatus = BLINK_BASE + BLINK_FACTOR * cos(time * BLINK_FREQ); break;
- default:
- if(blueflag == 3)
- blue_icon_prevstatus = "gfx/hud/sb_flag_blue_carrying"; // make it more visible
- else if((stat_items & IT_CTF_SHIELDED) && (myteam == COLOR_TEAM1))
- blue_icon_prevstatus = "gfx/hud/sb_flag_blue_shielded";
- else
- blue_icon_prevstatus = string_null;
- break;
- }
-
- if (myteam == COLOR_TEAM1) { // always draw own flag on left
- redflag_pos = bottomleft - '-4 50 0';
- blueflag_pos = bottomleft - '-62 50 0';
- } else {
- blueflag_pos = bottomleft - '-4 50 0';
- redflag_pos = bottomleft - '-62 50 0';
- }
-
- sz = '52 52 0';
-
- f = bound(0, redflag_statuschange_elapsedtime*2, 1);
- if(red_icon_prevstatus && f < 1)
- drawpic_expanding(redflag_pos, red_icon_prevstatus, sz, '1 1 1', hud_alpha_fg * red_alpha_prevstatus, DRAWFLAG_NORMAL, f);
- if(red_icon)
- drawpic(redflag_pos, red_icon, sz, '1 1 1', hud_alpha_fg * red_alpha * f, DRAWFLAG_NORMAL);
-
- f = bound(0, blueflag_statuschange_elapsedtime*2, 1);
- if(blue_icon_prevstatus && f < 1)
- drawpic_expanding(blueflag_pos, blue_icon_prevstatus, sz, '1 1 1', hud_alpha_fg * blue_alpha_prevstatus, DRAWFLAG_NORMAL, f);
- if(blue_icon)
- drawpic(blueflag_pos, blue_icon, sz, '1 1 1', hud_alpha_fg * blue_alpha * f, DRAWFLAG_NORMAL);
-}
-
-/*void HUD_Mod_Race (void) {
- if((scores_flags[ps_primary] & SFL_TIME) && !teamplay) { // race/cts record display on HUD
- pl = players.sort_next;
- if(pl == me)
- pl = pl.sort_next;
- if(scores_flags[ps_primary] & SFL_ZERO_IS_WORST)
- if(pl.scores[ps_primary] == 0)
- pl = world;
-
- score = me.(scores[ps_primary]);
-
- float racemin, racesec, racemsec;
- float distsec, distmsec, minusplus;
-
- racemin = floor(score/(60 * TIME_FACTOR));
- racesec = floor((score - racemin*(60 * TIME_FACTOR))/TIME_FACTOR);
- racemsec = score - racemin*60*TIME_FACTOR - racesec*TIME_FACTOR;
-
- if (pl && ((!(scores_flags[ps_primary] & SFL_ZERO_IS_WORST)) || score)) {
- // distribution display
- distribution = me.(scores[ps_primary]) - pl.(scores[ps_primary]);
-
- if (distribution < TIME_FACTOR && distribution > -TIME_FACTOR)
- distmsec = fabs(distribution);
- else {
- distsec = floor(fabs(distribution)/TIME_FACTOR);
- distmsec = fabs(distribution) - distsec*TIME_FACTOR;
- if (distribution < 0)
- distsec = -distsec;
- }
-
- if (distribution <= 0) {
- distribution_color = eY;
- minusplus = 1; // minusplus 1: always prefix with minus sign
- }
- else {
- distribution_color = eX;
- minusplus = 2; // minusplus 1: always prefix with plus sign
- }
- HUD_DrawXNum(bottomright - '0 48 0' - '16 0 0' * TIME_DECIMALS, distmsec, -TIME_DECIMALS, 0, 16, distribution_color, 0, 0, hud_alpha_fg, DRAWFLAG_NORMAL);
- HUD_DrawXNum(bottomright - '68 48 0' - '16 0 0' * TIME_DECIMALS, distsec, 4, minusplus, 16, distribution_color, 0, 0, hud_alpha_fg, DRAWFLAG_NORMAL);
- drawpic(bottomright - '10 48 0' - '16 0 0' * TIME_DECIMALS, "gfx/hud/num_dot", '16 16 0', distribution_color, hud_alpha_fg, DRAWFLAG_ADDITIVE);
- }
- // race record display
- if (distribution <= 0 || distribution == score) // draw the highlight background behind the timer if we have the lead
- drawpic(bottomright - '0 32 0' - '32 0 0' * (4 + TIME_DECIMALS), "gfx/hud/sb_highlight_4", '0 28 0' + '32 0 0' * (4 + TIME_DECIMALS), '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
-
- HUD_DrawXNum(bottomright - '0 32 0' - TIME_DECIMALS * '30 0 0', racemsec, -TIME_DECIMALS, 0, 30, '1 1 1', 0, 0, hud_alpha_fg, DRAWFLAG_NORMAL);
- HUD_DrawXNum(bottomright - '0 32 0' - TIME_DECIMALS * '30 0 0' - '66 0 0', racesec, -2, 0, 30, '1 1 1', 0, 0, hud_alpha_fg, DRAWFLAG_NORMAL);
- drawpic(bottomright - '0 32 0' - TIME_DECIMALS * '30 0 0' - '18 0 0', "gfx/hud/num_dot", '30 30 0', '1 1 1', hud_alpha_fg, DRAWFLAG_ADDITIVE);
+ case 1: blue_icon_prevstatus = "flag_blue_taken"; break;
+ case 2: blue_icon_prevstatus = "flag_blue_lost"; break;
+ case 3: blue_icon_prevstatus = "flag_blue_carrying"; blue_alpha_prevstatus = BLINK_BASE + BLINK_FACTOR * cos(time * BLINK_FREQ); break;
+ default:
+ if(blueflag == 3)
+ blue_icon_prevstatus = "flag_blue_carrying"; // make it more visible
+ else if((stat_items & IT_CTF_SHIELDED) && (myteam == COLOR_TEAM1))
+ blue_icon_prevstatus = "flag_blue_shielded";
+ else
+ blue_icon_prevstatus = string_null;
+ break;
+ }
- HUD_DrawXNum(bottomright - '0 32 0' - TIME_DECIMALS * '30 0 0' - '132 0 0', racemin, -2, 0, 30, '1 1 1', 0, 0, hud_alpha_fg, DRAWFLAG_NORMAL);
- drawpic(bottomright - '0 32 0' - TIME_DECIMALS * '30 0 0' - '84 0 0', "gfx/hud/num_colon", '30 30 0', '1 1 1', hud_alpha_fg, DRAWFLAG_ADDITIVE);
+ if (myteam == COLOR_TEAM1) { // always draw own flag on left
+ redflag_pos = pos;
+ blueflag_pos = pos + eX * mySize_y;
+ } else {
+ blueflag_pos = pos;
+ redflag_pos = pos + eX * mySize_y;
}
-}*/
+
+ f = bound(0, redflag_statuschange_elapsedtime*2, 1);
+ if(red_icon_prevstatus && f < 1)
+ drawpic_skin_expanding(redflag_pos, red_icon_prevstatus, '1 1 0' * mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(HUD_PANEL_MODICONS) * red_alpha_prevstatus, DRAWFLAG_NORMAL, f);
+ if(red_icon)
+ drawpic_skin(redflag_pos, red_icon, '1 1 0' * mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(HUD_PANEL_MODICONS) * red_alpha * f, DRAWFLAG_NORMAL);
+
+ f = bound(0, blueflag_statuschange_elapsedtime*2, 1);
+ if(blue_icon_prevstatus && f < 1)
+ drawpic_skin_expanding(blueflag_pos, blue_icon_prevstatus, '1 1 0' * mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(HUD_PANEL_MODICONS) * blue_alpha_prevstatus, DRAWFLAG_NORMAL, f);
+ if(blue_icon)
+ drawpic_skin(blueflag_pos, blue_icon, '1 1 0' * mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(HUD_PANEL_MODICONS) * blue_alpha * f, DRAWFLAG_NORMAL);
+}
// Keyhunt HUD modicon section
float kh_runheretime;
-void CSQC_kh_hudreset(void)
+void HUD_Mod_KH_Reset(void)
{
kh_runheretime = 0;
}
-void CSQC_kh_hud(void)
+void HUD_Mod_KH(vector pos, vector mySize)
{
+ mod_active = 1; // keyhunt should never hide the mod icons panel
float kh_keys;
float keyteam;
float a, aa;
vector p, pa, kh_size, kh_asize;
- p_x = 6;
- p_y = vid_conheight - 34 - 3;
- p_z = 0;
+ p_x = pos_x;
+ p_y = pos_y + 0.25 * mySize_y;
kh_keys = getstati(STAT_KH_KEYS);
- kh_size = '19 34 0';
- kh_asize = '19 10 0';
- pa = p + '0 -10 0';
+ kh_size_x = mySize_x * 0.25;
+ kh_size_y = 0.75 * mySize_y;
+
+ pa = p - eY * 0.25 * mySize_y;
+
+ kh_asize_x = mySize_x * 0.25;
+ kh_asize_y = mySize_y * 0.25;
float i, key;
if(keyteam == myteam || keyteam == -1 || keyteam == 30)
keycount += 1;
}
+
// this yields 8 exactly if "RUN HERE" shows
if(keycount == 8)
aa = 0.5;
break;
}
- a = a * hud_alpha_fg;
- aa = aa * hud_alpha_fg;
+ a = a * HUD_Panel_GetFgAlpha(HUD_PANEL_MODICONS);
+ aa = aa * HUD_Panel_GetFgAlpha(HUD_PANEL_MODICONS);
if(a > 0)
{
switch(keyteam)
{
case COLOR_TEAM1:
- drawpic (pa, "gfx/hud/sb_kh_redarrow", kh_asize, '1 1 1', aa, DRAWFLAG_NORMAL); // show 30% alpha key
+ drawpic_skin(pa, "kh_redarrow", kh_asize, '1 1 1', aa, DRAWFLAG_NORMAL); // show 30% alpha key
break;
case COLOR_TEAM2:
- drawpic (pa, "gfx/hud/sb_kh_bluearrow", kh_asize, '1 1 1', aa, DRAWFLAG_NORMAL); // show 30% alpha key
+ drawpic_skin(pa, "kh_bluearrow", kh_asize, '1 1 1', aa, DRAWFLAG_NORMAL); // show 30% alpha key
break;
case COLOR_TEAM3:
- drawpic (pa, "gfx/hud/sb_kh_yellowarrow", kh_asize, '1 1 1', aa, DRAWFLAG_NORMAL); // show 30% alpha key
+ drawpic_skin(pa, "kh_yellowarrow", kh_asize, '1 1 1', aa, DRAWFLAG_NORMAL); // show 30% alpha key
break;
case COLOR_TEAM4:
- drawpic (pa, "gfx/hud/sb_kh_pinkarrow", kh_asize, '1 1 1', aa, DRAWFLAG_NORMAL); // show 30% alpha key
+ drawpic_skin(pa, "kh_pinkarrow", kh_asize, '1 1 1', aa, DRAWFLAG_NORMAL); // show 30% alpha key
break;
default:
break;
switch(i) // YAY! switch(i) inside a for loop for i. DailyWTF, here we come!
{
case 0:
- drawpic (p, "gfx/hud/sb_kh_red", kh_size, '1 1 1', a, DRAWFLAG_NORMAL); // show 30% alpha key
+ drawpic_skin(p, "kh_red", kh_size, '1 1 1', a, DRAWFLAG_NORMAL); // show 30% alpha key
break;
case 1:
- drawpic (p, "gfx/hud/sb_kh_blue", kh_size, '1 1 1', a, DRAWFLAG_NORMAL); // show 30% alpha key
+ drawpic_skin(p, "kh_blue", kh_size, '1 1 1', a, DRAWFLAG_NORMAL); // show 30% alpha key
break;
case 2:
- drawpic (p, "gfx/hud/sb_kh_yellow", kh_size, '1 1 1', a, DRAWFLAG_NORMAL); // show 30% alpha key
+ drawpic_skin(p, "kh_yellow", kh_size, '1 1 1', a, DRAWFLAG_NORMAL); // show 30% alpha key
break;
case 3:
- drawpic (p, "gfx/hud/sb_kh_pink", kh_size, '1 1 1', a, DRAWFLAG_NORMAL); // show 30% alpha key
+ drawpic_skin(p, "kh_pink", kh_size, '1 1 1', a, DRAWFLAG_NORMAL); // show 30% alpha key
break;
}
}
- p_x += 24;
- pa_x += 24;
+ p_x += 0.25 * mySize_x;
+ pa_x += 0.25 * mySize_x;
}
}
-// Nexball HUD modicon section
-#define NBPB_SIZE '96 38 0'
-#define NBPB_BT 2 //thickness
-#define NBPB_BRGB '1 1 1'
-#define NBPB_BALPH 1 //alpha
-#define NBPB_BFLAG DRAWFLAG_NORMAL
-#define NBPB_IALPH 0.4
-#define NBPB_IFLAG DRAWFLAG_NORMAL
-#define NBPB_IRGB '0.7 0.1 0'
-
-void CSQC_nb_hud(void)
+// Nexball HUD mod icon
+void HUD_Mod_NexBall(vector pos, vector mySize)
{
float stat_items, nb_pb_starttime, dt, p;
- vector pos;
stat_items = getstati(STAT_ITEMS);
nb_pb_starttime = getstatf(STAT_NB_METERSTART);
- pos_x = 4;
- pos_y = vid_conheight - 42;
- pos_z = 0;
+ if (stat_items & IT_KEY1)
+ mod_active = 1;
+ else
+ mod_active = 0;
//Manage the progress bar if any
if (nb_pb_starttime > 0)
{
- vector s;
dt = mod(time - nb_pb_starttime, nb_pb_period);
// one period of positive triangle
p = 2 * dt / nb_pb_period;
if (p > 1)
p = 2 - p;
- s = NBPB_SIZE;
//Draw the filling
- drawfill(pos, p * s_x * eX + s_y * eY, NBPB_IRGB, NBPB_IALPH, NBPB_IFLAG);
-
- //Draw the box
- s = NBPB_SIZE;
- drawline(NBPB_BT, pos , pos + eX * s_x, NBPB_BRGB, NBPB_BALPH, NBPB_BFLAG);
- drawline(NBPB_BT, pos , pos + eY * s_y, NBPB_BRGB, NBPB_BALPH, NBPB_BFLAG);
- drawline(NBPB_BT, pos + s, pos + eX * s_x, NBPB_BRGB, NBPB_BALPH, NBPB_BFLAG);
- drawline(NBPB_BT, pos + s, pos + eY * s_y, NBPB_BRGB, NBPB_BALPH, NBPB_BFLAG);
+ HUD_Panel_DrawProgressBar(pos, 0, eX * p * mySize_x + eY * mySize_y, HUD_Panel_GetProgressBarColor("nexball"), cvar("hud_progressbar_alpha") * HUD_Panel_GetFgAlpha(HUD_PANEL_MODICONS), DRAWFLAG_NORMAL);
}
- pos_x += 12; //horizontal margin to the picture
- pos_y += 2; //vertical margin to the picture
+ pos_x += 0.5 * mySize_x - 0.5 * mySize_y; //horizontal margin to the picture
if (stat_items & IT_KEY1)
- drawpic(pos, "gfx/hud/sb_nexball_carrying", '80 34 0', '1 1 1', 1, DRAWFLAG_NORMAL);
+ drawpic_skin(pos, "nexball_carrying", '1 1 0' * mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(HUD_PANEL_MODICONS), DRAWFLAG_NORMAL);
}
-// Race/CTS HUD modicon section
+// Race/CTS HUD mod icons
float crecordtime_prev; // last remembered crecordtime
float crecordtime_change_time; // time when crecordtime last changed
float srecordtime_prev; // last remembered srecordtime
float srecordtime_change_time; // time when srecordtime last changed
-void CSQC_race_hud(void)
+
+float race_status_time;
+float race_status_prev;
+string race_status_name_prev;
+void HUD_Mod_Race(vector pos, vector mySize)
{
+ mod_active = 1; // race should never hide the mod icons panel
entity me;
me = playerslots[player_localentnum - 1];
float t, score;
return; // no records in the actual race
drawfont = hud_bigfont;
- vector pos;
- pos_x = 2;
- pos_y = vid_conheight - 48;
// clientside personal record
string rr;
f = time - crecordtime_change_time;
if (f > 1) {
- drawstring(pos, "Personal best ", '10 10 0', '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
- drawstring(pos + '0 10 0', TIME_ENCODED_TOSTRING(t),'14 14 0', '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
+ drawstring(pos, "Personal best ", '1 1 0' * 0.15 * mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(HUD_PANEL_MODICONS), DRAWFLAG_NORMAL);
+ drawstring(pos + eY * 0.2 * mySize_y, TIME_ENCODED_TOSTRING(t), '1 1 0' * 0.2 * mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(HUD_PANEL_MODICONS), DRAWFLAG_NORMAL);
} else {
- drawstring(pos, "Personal best ", '10 10 0', '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
- drawstring(pos + '0 10 0', TIME_ENCODED_TOSTRING(t),'14 14 0', '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
- drawstring_expanding(pos, "Personal best ", '10 10 0', '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL, f);
- drawstring_expanding(pos + '0 10 0', TIME_ENCODED_TOSTRING(t),'14 14 0', '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL, f);
+ drawstring(pos, "Personal best ", '1 1 0' * 0.15 * mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(HUD_PANEL_MODICONS), DRAWFLAG_NORMAL);
+ drawstring(pos + eY * 0.2 * mySize_y, TIME_ENCODED_TOSTRING(t), '1 1 0' * 0.2 * mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(HUD_PANEL_MODICONS), DRAWFLAG_NORMAL);
+ drawstring_expanding(pos, "Personal best ", '1 1 0' * 0.15 * mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(HUD_PANEL_MODICONS), DRAWFLAG_NORMAL, f);
+ drawstring_expanding(pos + eY * 0.2 * mySize_y, TIME_ENCODED_TOSTRING(t), '1 1 0' * 0.2 * mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(HUD_PANEL_MODICONS), DRAWFLAG_NORMAL, f);
}
// server record
- pos_y += 26;
t = race_server_record;
if(t != srecordtime_prev) {
srecordtime_prev = t;
f = time - srecordtime_change_time;
if (f > 1) {
- drawstring(pos, "Server best ", '10 10 0', '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
- drawstring(pos + '0 10 0', TIME_ENCODED_TOSTRING(t),'14 14 0', '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
+ drawstring(pos + eY * 0.5 * mySize_y, "Server best ", '1 1 0' * 0.15 * mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(HUD_PANEL_MODICONS), DRAWFLAG_NORMAL);
+ drawstring(pos + eY * 0.5 * mySize_y + eY * 0.2 * mySize_y, TIME_ENCODED_TOSTRING(t),'1 1 0' * 0.2 * mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(HUD_PANEL_MODICONS), DRAWFLAG_NORMAL);
} else {
- drawstring(pos, "Server best ", '10 10 0', '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
- drawstring(pos + '0 10 0', TIME_ENCODED_TOSTRING(t),'14 14 0', '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
- drawstring_expanding(pos, "Server best ", '10 10 0', '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL, f);
- drawstring_expanding(pos + '0 10 0', TIME_ENCODED_TOSTRING(t),'14 14 0', '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL, f);
+ drawstring(pos + eY * 0.5 * mySize_y, "Server best ", '1 1 0' * 0.15 * mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(HUD_PANEL_MODICONS), DRAWFLAG_NORMAL);
+ drawstring(pos + eY * 0.5 * mySize_y + eY * 0.2 * mySize_y, TIME_ENCODED_TOSTRING(t),'1 1 0' * 0.2 * mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(HUD_PANEL_MODICONS), DRAWFLAG_NORMAL);
+ drawstring_expanding(pos + eY * 0.5 * mySize_y, "Server best ", '1 1 0' * 0.15 * mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(HUD_PANEL_MODICONS), DRAWFLAG_NORMAL, f);
+ drawstring_expanding(pos + eY * 0.5 * mySize_y + eY * 0.2 * mySize_y, TIME_ENCODED_TOSTRING(t),'1 1 0' * 0.2 * mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(HUD_PANEL_MODICONS), DRAWFLAG_NORMAL, f);
}
- drawfont = hud_font;
-}
-
-// Timer (#5)
-//
-void HUD_Timer()
-{
- vector pos, mySize;
- pos = HUD_Panel_GetPos(5);
- mySize = HUD_Panel_GetSize(5);
- HUD_Panel_DrawBg(5, pos, mySize);
-
- float timelimit, elapsedTime, minutes, seconds, timeleft, minutesLeft, secondsLeft;
+ if (race_status != race_status_prev || race_status_name != race_status_name_prev) {
+ race_status_time = time + 5;
+ race_status_prev = race_status;
+ if (race_status_name_prev)
+ strunzone(race_status_name_prev);
+ race_status_name_prev = strzone(race_status_name);
+ }
- timelimit = getstatf(STAT_TIMELIMIT);
+ pos_x += mySize_x/2;
+ // race "awards"
+ float a;
+ a = bound(0, race_status_time - time, 1);
- HUD_DrawRaceStatus(pos + '0 30 0');
+ string s;
+ s = textShortenToWidth(race_status_name, mySize_y, '1 1 0' * 0.1 * mySize_y, stringwidth_colors);
- timeleft = max(0, timelimit * 60 + getstatf(STAT_GAMESTARTTIME) - time);
- timeleft = ceil(timeleft);
- minutesLeft = floor(timeleft / 60);
- secondsLeft = timeleft - minutesLeft*60;
+ float rank;
+ if(race_status > 0)
+ rank = race_CheckName(race_status_name);
+ string rankname;
+ rankname = race_PlaceName(rank);
- vector timer_color;
- if(minutesLeft >= 5 || warmup_stage || timelimit == 0) //don't use red or yellow in warmup or when there is no timelimit
- timer_color = '1 1 1'; //white
- else if(minutesLeft >= 1)
- timer_color = '1 1 0'; //yellow
- else
- timer_color = '1 0 0'; //red
+ vector namepos;
+ namepos = pos + '0.5 0.9 0' * mySize_y - eX * stringwidth(s, TRUE, '1 1 0' * 0.1 * mySize_y);
+ vector rankpos;
+ rankpos = pos + '0.5 0.25 0' * mySize_y - eX * stringwidth(rankname, TRUE, '1 1 0' * 0.15 * mySize_y);
- if (cvar("hud_timer_increment") || timelimit == 0 || warmup_stage) {
- if (time < getstatf(STAT_GAMESTARTTIME)) {
- //while restart is still active, show 00:00
- minutes = seconds = 0;
- } else {
- elapsedTime = floor(time - getstatf(STAT_GAMESTARTTIME)); //127
- minutes = floor(elapsedTime / 60);
- seconds = elapsedTime - minutes*60;
- }
- } else {
- minutes = minutesLeft;
- seconds = secondsLeft;
+ if(race_status == 0)
+ drawpic_skin(pos, "race_newfail", '1 1 0' * mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(HUD_PANEL_MODICONS) * a, DRAWFLAG_NORMAL);
+ else if(race_status == 1) {
+ drawpic_skin(pos, "race_newtime", '1 1 0' * 0.9 * mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(HUD_PANEL_MODICONS) * a, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(namepos, s, '1 1 0' * 0.1 * mySize_y, HUD_Panel_GetFgAlpha(HUD_PANEL_MODICONS) * a, DRAWFLAG_NORMAL);
+ drawstring(rankpos, rankname, '1 1 0' * 0.15 * mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(HUD_PANEL_MODICONS) * a, DRAWFLAG_NORMAL);
+ } else if(race_status == 2) {
+ if(race_status_name == GetPlayerName(player_localentnum -1) || !race_myrank || race_myrank < rank)
+ drawpic_skin(pos, "race_newrankgreen", '1 1 0' * 0.9 * mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(HUD_PANEL_MODICONS) * a, DRAWFLAG_NORMAL);
+ else
+ drawpic_skin(pos, "race_newrankyellow", '1 1 0' * 0.9 * mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(HUD_PANEL_MODICONS) * a, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(namepos, s, '1 1 0' * 0.1 * mySize_y, HUD_Panel_GetFgAlpha(HUD_PANEL_MODICONS) * a, DRAWFLAG_NORMAL);
+ drawstring(rankpos, rankname, '1 1 0' * 0.15 * mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(HUD_PANEL_MODICONS) * a, DRAWFLAG_NORMAL);
+ } else if(race_status == 3) {
+ drawpic_skin(pos, "race_newrecordserver", '1 1 0' * 0.9 * mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(HUD_PANEL_MODICONS) * a, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(namepos, s, '1 1 0' * 0.1 * mySize_y, HUD_Panel_GetFgAlpha(HUD_PANEL_MODICONS) * a, DRAWFLAG_NORMAL);
+ drawstring(rankpos, rankname, '1 1 0' * 0.15 * mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(HUD_PANEL_MODICONS) * a, DRAWFLAG_NORMAL);
}
- if(mySize_x/mySize_y > 5.1)
- {
- if(minutes > 999)
- seconds = 99;
- minutes = min(minutes, 999);
- if(minutesLeft >= 1 || cvar("hud_timer_increment") || timelimit == 0 || warmup_stage) {
- if(minutes < 100)
- drawpic(pos + eX * mySize_x - eX * 5.1 * mySize_y, "gfx/hud/sb_timer", '1 1 0' * mySize_y, timer_color, hud_alpha_fg, DRAWFLAG_NORMAL);
- HUD_DrawXNum(pos + eX * mySize_x - eX * 5.1 * mySize_y, minutes, 3, 0, mySize_y, timer_color, 0, 0, hud_alpha_fg, DRAWFLAG_NORMAL);
- drawpic(pos + eX * mySize_x - eX * 2.57 * mySize_y, "gfx/hud/num_colon", '1 1 0' * mySize_y, timer_color, hud_alpha_fg, DRAWFLAG_NORMAL);
- }
- HUD_DrawXNum(pos + eX * mySize_x - eX * 2 * mySize_y, seconds, -2, 0, mySize_y, timer_color, 0, 0, hud_alpha_fg, DRAWFLAG_NORMAL);
- }
- else
- {
- if(minutes > 99)
- seconds = 99;
- minutes = min(minutes, 99);
- if(minutesLeft >= 1 || cvar("hud_timer_increment") || timelimit == 0 || warmup_stage) {
- if(minutes < 100)
- drawpic(pos + eX * 0.5 * mySize_x - eX * 0.5 * 0.5 * mySize_y, "gfx/hud/sb_timer", '0.5 0.5 0' * mySize_y, timer_color, hud_alpha_fg, DRAWFLAG_NORMAL);
- HUD_DrawXNum(pos + eX * 0.5 * mySize_x - eX * mySize_y + eY * 0.5 * mySize_y, minutes, -2, 0, 0.5 * mySize_y, timer_color, 0, 0, hud_alpha_fg, DRAWFLAG_NORMAL);
- drawpic(pos + eX * 0.5 * mySize_x - eX * 0.5 * 0.5 * mySize_y + eY * 0.5 * mySize_y, "gfx/hud/num_colon", '0.5 0.5 0' * mySize_y, timer_color, hud_alpha_fg, DRAWFLAG_NORMAL);
- }
- HUD_DrawXNum(pos + eX * 0.51 * mySize_x + eY * 0.5 * mySize_y, seconds, -2, 0, 0.5 * mySize_y, timer_color, 0, 0, hud_alpha_fg, DRAWFLAG_NORMAL);
+ if (race_status_time - time <= 0) {
+ race_status_prev = -1;
+ race_status = -1;
+ if(race_status_name)
+ strunzone(race_status_name);
+ race_status_name = string_null;
+ if(race_status_name_prev)
+ strunzone(race_status_name_prev);
+ race_status_name_prev = string_null;
}
+ drawfont = hud_font;
}
-// Radar (#6)
-//
+float mod_prev; // previous state of mod_active to check for a change
+float mod_alpha;
+float mod_change; // "time" when mod_active changed
-void HUD_Radar(void)
+void HUD_ModIcons(void)
{
- vector pos, mySize;
- pos = HUD_Panel_GetPos(6);
- mySize = HUD_Panel_GetSize(6);
-
- HUD_Panel_DrawBg(6, pos, mySize);
-
- local float color1, color2; // color already declared as a global in hud.qc
- local vector rgb;
- local entity tm;
- float scale2d, normalsize, bigsize;
- float f;
-
- teamradar_origin2d = pos + 0.5 * mySize; // TODO: stupid compat, should be removed
- teamradar_size2d = mySize;
-
- if(minimapname == "" && !ons_showmap)
+ if (gametype != GAME_KEYHUNT && gametype != GAME_CTF && gametype != GAME_NEXBALL && gametype != GAME_CTS && gametype != GAME_RACE && !hud_configure)
return;
- teamradar_loadcvars();
+ float id = HUD_PANEL_MODICONS;
+ vector pos, mySize;
+ pos = HUD_Panel_GetPos(id);
+ mySize = HUD_Panel_GetSize(id);
- switch(cl_teamradar_zoommode)
- {
- default:
- case 0:
- f = current_zoomfraction;
- break;
- case 1:
- f = 1 - current_zoomfraction;
- break;
- case 2:
- f = 0;
- break;
- case 3:
- f = 1;
- break;
+ if(mod_active != mod_prev) {
+ mod_change = time;
+ mod_prev = mod_active;
}
- switch(cl_teamradar_rotation)
+ if(mod_active || hud_configure)
+ mod_alpha = bound(0, (time - mod_change) * 2, 1);
+ else
+ mod_alpha = bound(0, 1 - (time - mod_change) * 2, 1);
+
+ if(mod_alpha)
+ HUD_Panel_DrawBg(id, pos, mySize, mod_alpha);
+
+ float padding;
+ padding = HUD_Panel_GetPadding(id);
+ if(padding)
{
- case 0:
- teamradar_angle = view_angles_y - 90;
- break;
- default:
- teamradar_angle = 90 * cl_teamradar_rotation;
- break;
+ pos += '1 1 0' * padding;
+ mySize -= '2 2 0' * padding;
}
- scale2d = vlen_maxnorm2d(mi_picmax - mi_picmin);
- teamradar_size2d = mySize;
+ // these MUST be ran in order to update mod_active
+ if(gametype == GAME_KEYHUNT)
+ HUD_Mod_KH(pos, mySize);
+ else if(gametype == GAME_CTF || hud_configure)
+ HUD_Mod_CTF(pos, mySize); // forcealpha only needed for ctf icons, as only they are shown in config mode
+ else if(gametype == GAME_NEXBALL)
+ HUD_Mod_NexBall(pos, mySize);
+ else if(gametype == GAME_CTS || gametype == GAME_RACE)
+ HUD_Mod_Race(pos, mySize);
+}
- teamradar_extraclip_mins = teamradar_extraclip_maxs = '0 0 0'; // we always center
+// Draw pressed keys (#11)
+//
+void HUD_DrawPressedKeys(void)
+{
+ float id = HUD_PANEL_PRESSEDKEYS;
+ vector pos, mySize;
+ pos = HUD_Panel_GetPos(id);
+ mySize = HUD_Panel_GetSize(id);
- // pixels per world qu to match the teamradar_size2d_x range in the longest dimension
- if(cl_teamradar_rotation == 0)
+ HUD_Panel_DrawBg(id, pos, mySize, 0);
+ float padding;
+ padding = HUD_Panel_GetPadding(id);
+ if(padding)
{
- // max-min distance must fit the radar in any rotation
- bigsize = vlen_minnorm2d(teamradar_size2d) * scale2d / (1.05 * vlen2d(mi_max - mi_min));
+ pos += '1 1 0' * padding;
+ mySize -= '2 2 0' * padding;
}
- else
- {
- vector c0, c1, c2, c3, span;
- c0 = rotate(mi_min, teamradar_angle * DEG2RAD);
- c1 = rotate(mi_max, teamradar_angle * DEG2RAD);
- c2 = rotate('1 0 0' * mi_min_x + '0 1 0' * mi_max_y, teamradar_angle * DEG2RAD);
- c3 = rotate('1 0 0' * mi_max_x + '0 1 0' * mi_min_y, teamradar_angle * DEG2RAD);
- span = '0 0 0';
- span_x = max4(c0_x, c1_x, c2_x, c3_x) - min4(c0_x, c1_x, c2_x, c3_x);
- span_y = max4(c0_y, c1_y, c2_y, c3_y) - min4(c0_y, c1_y, c2_y, c3_y);
- // max-min distance must fit the radar in x=x, y=y
- bigsize = min(
- teamradar_size2d_x * scale2d / (1.05 * span_x),
- teamradar_size2d_y * scale2d / (1.05 * span_y)
- );
- }
+ float pressedkeys;
- normalsize = vlen_maxnorm2d(teamradar_size2d) * scale2d / cl_teamradar_scale;
- if(bigsize > normalsize)
- normalsize = bigsize;
+ pressedkeys = getstatf(STAT_PRESSED_KEYS);
+ drawpic_skin(pos, "key_bg.tga", mySize, '1 1 1', 0.1 * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ drawpic_skin(pos + eX * mySize_x - eX * 0.22 * mySize_x + eY * 0.195 * mySize_y, ((pressedkeys & KEY_CROUCH) ? "key_crouch_inv.tga" : "key_crouch.tga"), '1 1 0' * (1/3) * mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ drawpic_skin(pos + eX * 0.5 * mySize_x - eX * 0.23 * mySize_y + eY * 0.040 * mySize_y, ((pressedkeys & KEY_FORWARD) ? "key_forward_inv.tga" : "key_forward.tga"), '1 1 0' * 0.46 * mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ drawpic_skin(pos + eX * 0.023 * mySize_x + eY * 0.195 * mySize_y, ((pressedkeys & KEY_JUMP) ? "key_jump_inv.tga" : "key_jump.tga"), '1 1 0' * (1/3) * mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ drawpic_skin(pos + eX * 0.1 * mySize_x + eY * 0.486 * mySize_y, ((pressedkeys & KEY_LEFT) ? "key_left_inv.tga" : "key_left.tga"), '1 1 0' * 0.46 * mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ drawpic_skin(pos + eX * 0.5 * mySize_x - eX * 0.23 * mySize_y + eY * 0.486 * mySize_y, ((pressedkeys & KEY_BACKWARD) ? "key_backward_inv.tga" : "key_backward.tga"), '1 1 0' * 0.46 * mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ drawpic_skin(pos + eX * mySize_x - eX * 0.372 * mySize_x + eY * 0.486 * mySize_y, ((pressedkeys & KEY_RIGHT) ? "key_right_inv.tga" : "key_right.tga"), '1 1 0' * 0.46 * mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+}
- teamradar_size =
- f * bigsize
- + (1 - f) * normalsize;
- teamradar_origin3d_in_texcoord = teamradar_3dcoord_to_texcoord(
- f * (mi_min + mi_max) * 0.5
- + (1 - f) * view_origin);
+// Handle chat as a panel (#12)
+//
+void HUD_Chat(void)
+{
+ float id = HUD_PANEL_CHAT;
+ vector pos, mySize;
+ pos = HUD_Panel_GetPos(id);
+ mySize = HUD_Panel_GetSize(id);
- color1 = GetPlayerColor(player_localentnum-1);
- rgb = GetTeamRGB(color1);
+ HUD_Panel_DrawBg(id, pos, mySize, 0);
+ float padding;
+ padding = HUD_Panel_GetPadding(id);
+ if(padding)
+ {
+ pos += '1 1 0' * padding;
+ mySize -= '2 2 0' * padding;
+ }
- drawsetcliparea(
- pos_x,
- pos_y,
- mySize_x,
- mySize_y
- );
+ cvar_set("con_chatrect", "1");
- draw_teamradar_background(cl_teamradar_background_alpha, cl_teamradar_foreground_alpha);
+ cvar_set("con_chatrect_x", ftos(pos_x/vid_conwidth));
+ cvar_set("con_chatrect_y", ftos(pos_y/vid_conheight));
- if(ons_showmap)
- {
- drawresetcliparea();
+ cvar_set("con_chatwidth", ftos(mySize_x/vid_conwidth));
+ cvar_set("con_chat", ftos(floor(mySize_y/cvar("con_chatsize") - 0.5)));
- vector frame_origin, frame_size;
- frame_origin = frame_size = '0 0 0';
+ if(hud_configure)
+ {
+ float chatsize;
+ chatsize = cvar("con_chatsize");
+ cvar_set("con_chatrect_x", "9001"); // over 9000, we'll fake it instead for more control over alpha and such
+ float i, a;
+ for(i = 0; i < cvar("con_chat"); ++i)
+ {
+ if(i == cvar("con_chat") - 1)
+ a = HUD_Panel_GetFgAlpha(id);
+ else
+ a = HUD_Panel_GetFgAlpha(id) * floor(((i + 1) * 7 + cvar("con_chattime"))/45);
+ drawcolorcodedstring(pos + eY * i * chatsize, textShortenToWidth("^3Player^7: This is the chat area.", mySize_x, '1 1 0' * chatsize, stringwidth_colors), '1 1 0' * chatsize, a, DRAWFLAG_NORMAL);
+ }
+ }
+}
- frame_origin_x = pos_x - teamradar_size2d_x * 0.55859375; // matches the picture
- frame_origin_y = pos_y - teamradar_size2d_y * 0.55859375; // matches the picture
- frame_size_x = pos_x * 1.1171875; // matches the picture
- frame_size_y = pos_y * 1.1171875; // matches the picture
- drawpic(frame_origin, "gfx/ons-frame.tga", frame_size, '1 1 1', hud_alpha_fg, 0);
- drawpic(frame_origin, "gfx/ons-frame-team.tga", frame_size, rgb, hud_alpha_fg, 0);
+// Engine info panel (#13)
+//
+float prevfps;
+float prevfps_time;
+float framecounter;
+
+float frametimeavg;
+float frametimeavg1; // 1 frame ago
+float frametimeavg2; // 2 frames ago
+void HUD_EngineInfo(void)
+{
+ float id = HUD_PANEL_ENGINEINFO;
+ vector pos, mySize;
+ pos = HUD_Panel_GetPos(id);
+ mySize = HUD_Panel_GetSize(id);
- drawsetcliparea(
- pos_x - teamradar_size2d_x * 0.5,
- pos_y - teamradar_size2d_y * 0.5,
- teamradar_size2d_x,
- teamradar_size2d_y
- );
+ HUD_Panel_DrawBg(id, pos, mySize, 0);
+ float padding;
+ padding = HUD_Panel_GetPadding(id);
+ if(padding)
+ {
+ pos += '1 1 0' * padding;
+ mySize -= '2 2 0' * padding;
}
- for(tm = world; (tm = find(tm, classname, "radarlink")); )
- draw_teamradar_link(tm.origin, tm.velocity, tm.team);
- for(tm = world; (tm = findflags(tm, teamradar_icon, 0xFFFFFF)); )
- draw_teamradar_icon(tm.origin, tm.teamradar_icon, tm, tm.teamradar_color, hud_alpha_fg);
- for(tm = world; (tm = find(tm, classname, "entcs_receiver")); )
+ if(cvar("hud_engineinfo_framecounter_exponentialmovingaverage"))
{
- color2 = GetPlayerColor(tm.sv_entnum);
- //if(color == COLOR_SPECTATOR || color == color2)
- draw_teamradar_player(tm.origin, tm.angles, GetTeamRGB(color2));
+ frametimeavg = (frametimeavg + frametimeavg1 + frametimeavg2 + frametime)/4; // average three frametimes into framecounter for slightly more stable fps readings :P
+ frametimeavg2 = frametimeavg1;
+ frametimeavg1 = frametimeavg;
+
+ float weight;
+ weight = cvar("hud_engineinfo_framecounter_exponentialmovingaverage_new_weight");
+ if(frametime > 0.0001) // filter out insane values which sometimes seem to occur and throw off the average? If you are getting 10,000 fps or more, then you don't need a framerate counter.
+ {
+ if(fabs(prevfps - (1/frametimeavg)) > prevfps * cvar("hud_engineinfo_framecounter_exponentialmovingaverage_instantupdate_change_threshold")) // if there was a big jump in fps, just force prevfps at current (1/frametime) to make big updates instant
+ prevfps = (1/frametime);
+ prevfps = (1 - weight) * prevfps + weight * (1/frametimeavg); // framecounter just used so there's no need for a new variable, think of it as "frametime average"
+ }
+ }
+ else
+ {
+ framecounter += 1;
+ if(time - prevfps_time > cvar("hud_engineinfo_framecounter_time"))
+ {
+ prevfps = framecounter/cvar("hud_engineinfo_framecounter_time");
+ framecounter = 0;
+ prevfps_time = time;
+ }
}
- draw_teamradar_player(view_origin, view_angles, '1 1 1');
-
- drawresetcliparea();
-};
+ vector color;
+ color = HUD_Get_Num_Color (prevfps, 100);
+ drawstring(pos, strcat("FPS: ", ftos_decimals(prevfps, cvar("hud_engineinfo_framecounter_decimals"))), '1 1 0' * 0.5 * mySize_y, color, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+}
/*
==================
Main HUD system
==================
*/
-void HUD_DrawPressedKeys(void)
-{
- vector pos, mySize;
- pos = HUD_Panel_GetPos(10);
- mySize = HUD_Panel_GetSize(10);
-
- HUD_Panel_DrawBg(10, pos, mySize);
-
- float pressedkeys;
-
- pressedkeys = getstatf(STAT_PRESSED_KEYS);
- drawpic(pos, "gfx/hud/keys/key_bg.tga", mySize, '1 1 1', 0.1 * hud_alpha_fg, DRAWFLAG_NORMAL);
- drawpic(pos + eX * mySize_x - eX * 0.22 * mySize_x + eY * 0.195 * mySize_y, ((pressedkeys & KEY_CROUCH) ? "gfx/hud/keys/key_crouch_inv.tga" : "gfx/hud/keys/key_crouch.tga"), '1 1 0' * (1/3) * mySize_y, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
- drawpic(pos + eX * 0.5 * mySize_x - eX * 0.23 * mySize_y + eY * 0.040 * mySize_y, ((pressedkeys & KEY_FORWARD) ? "gfx/hud/keys/key_forward_inv.tga" : "gfx/hud/keys/key_forward.tga"), '1 1 0' * 0.46 * mySize_y, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
- drawpic(pos + eX * 0.023 * mySize_x + eY * 0.195 * mySize_y, ((pressedkeys & KEY_JUMP) ? "gfx/hud/keys/key_jump_inv.tga" : "gfx/hud/keys/key_jump.tga"), '1 1 0' * (1/3) * mySize_y, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
- drawpic(pos + eX * 0.1 * mySize_x + eY * 0.486 * mySize_y, ((pressedkeys & KEY_LEFT) ? "gfx/hud/keys/key_left_inv.tga" : "gfx/hud/keys/key_left.tga"), '1 1 0' * 0.46 * mySize_y, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
- drawpic(pos + eX * 0.5 * mySize_x - eX * 0.23 * mySize_y + eY * 0.486 * mySize_y, ((pressedkeys & KEY_BACKWARD) ? "gfx/hud/keys/key_backward_inv.tga" : "gfx/hud/keys/key_backward.tga"), '1 1 0' * 0.46 * mySize_y, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
- drawpic(pos + eX * mySize_x - eX * 0.372 * mySize_x + eY * 0.486 * mySize_y, ((pressedkeys & KEY_RIGHT) ? "gfx/hud/keys/key_right_inv.tga" : "gfx/hud/keys/key_right.tga"), '1 1 0' * 0.46 * mySize_y, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
-}
-
void HUD_ShowSpeed(void)
{
vector numsize;
pos = (vid_conheight - numsize_y) * cvar("cl_showspeed_position");
drawfont = hud_bigfont;
- drawstringcenter(eX + pos * eY, speed, numsize, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
+ drawstringcenter(eX + pos * eY, speed, numsize, '1 1 1', hud_fg_alpha, DRAWFLAG_NORMAL);
if (cvar("cl_showspeed_z") == 1) {
zspeed = strcat(ftos(fabs(floor( pmove_vel_z * conversion_factor + 0.5 ))), unit);
- drawstringcenter(eX + pos * eY + numsize_y * eY, zspeed, numsize * 0.5, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
+ drawstringcenter(eX + pos * eY + numsize_y * eY, zspeed, numsize * 0.5, '1 1 1', hud_fg_alpha, DRAWFLAG_NORMAL);
}
drawfont = hud_font;
}
if (acceleration > 0)
- drawpic(pos, "gfx/hud/statusbar", acceleration * scale * '40 0 0' + sz * eY, rgb, alpha * hud_alpha_fg, DRAWFLAG_NORMAL);
+ HUD_Panel_DrawProgressBar(pos, 0, acceleration * scale * '40 0 0' + sz * eY, rgb, alpha * hud_fg_alpha, DRAWFLAG_NORMAL);
else if (acceleration < 0)
- drawpic(pos + acceleration * scale * '40 0 0', "gfx/hud/statusbar", -acceleration * scale * '40 0 0' + sz * eY, rgb, alpha * hud_alpha_fg, DRAWFLAG_NORMAL);
+ HUD_Panel_DrawProgressBar(pos + acceleration * scale * '40 0 0', 0, -acceleration * scale * '40 0 0' + sz * eY, rgb, alpha * hud_fg_alpha, DRAWFLAG_NORMAL);
}
void HUD_Reset (void)
{
// reset gametype specific icons
if(gametype == GAME_KEYHUNT)
- CSQC_kh_hudreset();
+ HUD_Mod_KH_Reset();
else if(gametype == GAME_CTF)
- CSQC_ctf_hudreset();
+ HUD_Mod_CTF_Reset();
}
void HUD_Main (void)
{
- hud_alpha_bg = cvar_or("hud_bg_alpha", 0.8) * (1 - cvar("_menu_alpha"));
+ if(disable_menu_alphacheck == 1)
+ menu_fade_alpha = 1;
+ else
+ menu_fade_alpha = (1 - cvar("_menu_alpha"));
+ hud_fg_alpha = cvar("hud_fg_alpha");
+
hud_border_thickness = bound(0, cvar("hud_border_thickness"), 5);
hud_accuracy_border_thickness = bound(0, cvar_or("hud_accuracy_border_thickness", 1), 5);
hud_color_bg_team = cvar("hud_color_bg_team");
hud_fontsize = HUD_GetFontsize("hud_fontsize");
hud_fontsize_spec = HUD_GetFontsize("hud_fontsize_spec");
- if(cvar_string("hud_dock") != "0")
- drawpic('0 0 0', strcat("gfx/hud/", cvar_string("hud_dock")), eX * vid_conwidth + eY * vid_conheight, stov(cvar_string("hud_dock_color")), cvar("hud_dock_alpha"), DRAWFLAG_NORMAL);
+ hud_configure = cvar("_hud_configure");
+
+ // Drawing stuff
+
+ // HUD configure visible grid
+ if(hud_configure && cvar("hud_configure_grid") && cvar("hud_configure_grid_alpha"))
+ {
+ float i;
+ // x-axis
+ for(i = 0; i < vid_conwidth/max(2, cvar("hud_configure_grid_x")); ++i)
+ {
+ drawfill(eX * i * max(2, cvar("hud_configure_grid_x")), eX + eY * vid_conheight, '0.5 0.5 0.5', cvar("hud_configure_grid_alpha"), DRAWFLAG_NORMAL);
+ }
+ // y-axis
+ for(i = 0; i < vid_conheight/max(2, cvar("hud_configure_grid_y")); ++i)
+ {
+ drawfill(eY * i * max(2, cvar("hud_configure_grid_y")), eY + eX * vid_conwidth, '0.5 0.5 0.5', cvar("hud_configure_grid_alpha"), DRAWFLAG_NORMAL);
+ }
+ }
+
+ if(cvar_string("hud_dock") != "")
+ drawpic_skin('0 0 0', cvar_string("hud_dock"), eX * vid_conwidth + eY * vid_conheight, HUD_Panel_Dock_GetColor(), cvar("hud_dock_alpha") * menu_fade_alpha, DRAWFLAG_NORMAL);
- if(HUD_Panel_CheckActive(0))
+ if(HUD_Panel_CheckActive(HUD_PANEL_WEAPONICONS) || hud_configure)
HUD_WeaponIcons();
- if(HUD_Panel_CheckActive(1))
+ if(HUD_Panel_CheckActive(HUD_PANEL_INVENTORY) || hud_configure)
HUD_Inventory();
- if(HUD_Panel_CheckActive(2))
+ if(HUD_Panel_CheckActive(HUD_PANEL_POWERUPS) || hud_configure)
HUD_Powerups();
- if(HUD_Panel_CheckActive(3))
+ if(HUD_Panel_CheckActive(HUD_PANEL_HEALTHARMOR) || hud_configure)
HUD_HealthArmor();
- if(HUD_Panel_CheckActive(4))
+ if(HUD_Panel_CheckActive(HUD_PANEL_NOTIFY) || hud_configure)
HUD_Notify();
- if(HUD_Panel_CheckActive(5))
+ if(HUD_Panel_CheckActive(HUD_PANEL_TIMER) || hud_configure)
HUD_Timer();
// TODO hud'ify
- if(HUD_Panel_CheckActive(6))
- if(ons_showmap || cvar_string("cl_teamradar") != "0" && (cvar("cl_teamradar") == 2 || teamplay))
+ if(HUD_Panel_CheckActive(HUD_PANEL_RADAR) || hud_configure)
+ if(cvar_string("hud_radar") != "0" && (cvar("hud_radar") == 2 || teamplay))
HUD_Radar();
- if(HUD_Panel_CheckActive(7))
+ if(HUD_Panel_CheckActive(HUD_PANEL_SCORE) || hud_configure)
HUD_Score();
- if(HUD_Panel_CheckActive(8))
- if(gametype == GAME_RACE || gametype == GAME_CTS || cvar("_hud_configure"))
+ if(HUD_Panel_CheckActive(HUD_PANEL_RACETIMER) || hud_configure)
+ if(gametype == GAME_RACE || gametype == GAME_CTS || hud_configure)
HUD_RaceTimer();
- if(HUD_Panel_CheckActive(9))
+ if(HUD_Panel_CheckActive(HUD_PANEL_VOTE) || hud_configure)
HUD_VoteWindow();
+ if(HUD_Panel_CheckActive(HUD_PANEL_MODICONS) || hud_configure)
+ HUD_ModIcons();
// TODO hud'ify
- if(HUD_Panel_CheckActive(10))
- if(spectatee_status > 0 || cvar("cl_showpressedkeys") >= 2 || cvar("_hud_configure"))
+ if(HUD_Panel_CheckActive(HUD_PANEL_PRESSEDKEYS) || hud_configure)
+ if(spectatee_status > 0 || cvar("hud_pressedkeys") >= 2 || hud_configure)
HUD_DrawPressedKeys();
+ if(HUD_Panel_CheckActive(HUD_PANEL_CHAT) || hud_configure)
+ HUD_Chat();
+ else
+ cvar_set("con_csqcpositioning", "0");
+ if(HUD_Panel_CheckActive(HUD_PANEL_ENGINEINFO) || hud_configure)
+ HUD_EngineInfo();
// TODO hud_'ify these
if (cvar("cl_showspeed"))
if (cvar("cl_showacceleration"))
HUD_ShowAcceleration();
- // TODO... well make them work in a panel etc
- if(gametype == GAME_KEYHUNT)
- CSQC_kh_hud();
- else if(gametype == GAME_CTF)
- CSQC_ctf_hud();
- else if(gametype == GAME_NEXBALL)
- CSQC_nb_hud();
- else if(gametype == GAME_CTS || gametype == GAME_RACE)
- CSQC_race_hud();
- return;
+ if (hud_configure && spectatee_status) // try to join if we are in hud_configure mode, but still spectating (in order to get rid of motd and such)
+ localcmd("cmd selectteam auto; cmd join\n");
+
+ if (!hud_configure) // hud config mode disabled, enable normal alpha stuff again
+ disable_menu_alphacheck = 0;
}
+++ /dev/null
-/*
-==================
-Misc HUD functions
-==================
-*/
-
-// a border picture is a texture containing nine parts:
-// 1/4 width: left part
-// 1/2 width: middle part (stretched)
-// 1/4 width: right part
-// divided into
-// 1/4 height: top part
-// 1/2 height: middle part (stretched)
-// 1/4 height: bottom part
-void draw_BorderPicture(vector theOrigin, string pic, vector theSize, vector theColor, float theAlpha, vector theBorderSize)
-{
- vector dX, dY;
- vector width, height;
- vector bW, bH;
- //pic = draw_UseSkinFor(pic);
- width = eX * theSize_x;
- height = eY * theSize_y;
- if(theSize_x <= theBorderSize_x * 2)
- {
- // not wide enough... draw just left and right then
- bW = eX * (0.25 * theSize_x / (theBorderSize_x * 2));
- if(theSize_y <= theBorderSize_y * 2)
- {
- // not high enough... draw just corners
- bH = eY * (0.25 * theSize_y / (theBorderSize_y * 2));
- drawsubpic(theOrigin, width * 0.5 + height * 0.5, pic, '0 0 0', bW + bH, theColor, theAlpha, 0);
- drawsubpic(theOrigin + width * 0.5, width * 0.5 + height * 0.5, pic, eX - bW, bW + bH, theColor, theAlpha, 0);
- drawsubpic(theOrigin + height * 0.5, width * 0.5 + height * 0.5, pic, eY - bH, bW + bH, theColor, theAlpha, 0);
- drawsubpic(theOrigin + theSize * 0.5, width * 0.5 + height * 0.5, pic, eX + eY - bW - bH, bW + bH, theColor, theAlpha, 0);
- }
- else
- {
- dY = theBorderSize_x * eY;
- drawsubpic(theOrigin, width * 0.5 + dY, pic, '0 0 0', '0 0.25 0' + bW, theColor, theAlpha, 0);
- drawsubpic(theOrigin + width * 0.5, width * 0.5 + dY, pic, '0 0 0' + eX - bW, '0 0.25 0' + bW, theColor, theAlpha, 0);
- drawsubpic(theOrigin + dY, width * 0.5 + height - 2 * dY, pic, '0 0.25 0', '0 0.5 0' + bW, theColor, theAlpha, 0);
- drawsubpic(theOrigin + width * 0.5 + dY, width * 0.5 + height - 2 * dY, pic, '0 0.25 0' + eX - bW, '0 0.5 0' + bW, theColor, theAlpha, 0);
- drawsubpic(theOrigin + height - dY, width * 0.5 + dY, pic, '0 0.75 0', '0 0.25 0' + bW, theColor, theAlpha, 0);
- drawsubpic(theOrigin + width * 0.5 + height - dY, width * 0.5 + dY, pic, '0 0.75 0' + eX - bW, '0 0.25 0' + bW, theColor, theAlpha, 0);
- }
- }
- else
- {
- if(theSize_y <= theBorderSize_y * 2)
- {
- // not high enough... draw just top and bottom then
- bH = eY * (0.25 * theSize_y / (theBorderSize_y * 2));
- dX = theBorderSize_x * eX;
- drawsubpic(theOrigin, dX + height * 0.5, pic, '0 0 0', '0.25 0 0' + bH, theColor, theAlpha, 0);
- drawsubpic(theOrigin + dX, width - 2 * dX + height * 0.5, pic, '0.25 0 0', '0.5 0 0' + bH, theColor, theAlpha, 0);
- drawsubpic(theOrigin + width - dX, dX + height * 0.5, pic, '0.75 0 0', '0.25 0 0' + bH, theColor, theAlpha, 0);
- drawsubpic(theOrigin + height * 0.5, dX + height * 0.5, pic, '0 0 0' + eY - bH, '0.25 0 0' + bH, theColor, theAlpha, 0);
- drawsubpic(theOrigin + dX + height * 0.5, width - 2 * dX + height * 0.5, pic, '0.25 0 0' + eY - bH, '0.5 0 0' + bH, theColor, theAlpha, 0);
- drawsubpic(theOrigin + width - dX + height * 0.5, dX + height * 0.5, pic, '0.75 0 0' + eY - bH, '0.25 0 0' + bH, theColor, theAlpha, 0);
- }
- else
- {
- dX = theBorderSize_x * eX;
- dY = theBorderSize_x * eY;
- drawsubpic(theOrigin, dX + dY, pic, '0 0 0', '0.25 0.25 0', theColor, theAlpha, 0);
- drawsubpic(theOrigin + dX, width - 2 * dX + dY, pic, '0.25 0 0', '0.5 0.25 0', theColor, theAlpha, 0);
- drawsubpic(theOrigin + width - dX, dX + dY, pic, '0.75 0 0', '0.25 0.25 0', theColor, theAlpha, 0);
- drawsubpic(theOrigin + dY, dX + height - 2 * dY, pic, '0 0.25 0', '0.25 0.5 0', theColor, theAlpha, 0);
- drawsubpic(theOrigin + dY + dX, width - 2 * dX + height - 2 * dY, pic, '0.25 0.25 0', '0.5 0.5 0', theColor, theAlpha, 0);
- drawsubpic(theOrigin + dY + width - dX, dX + height - 2 * dY, pic, '0.75 0.25 0', '0.25 0.5 0', theColor, theAlpha, 0);
- drawsubpic(theOrigin + height - dY, dX + dY, pic, '0 0.75 0', '0.25 0.25 0', theColor, theAlpha, 0);
- drawsubpic(theOrigin + height - dY + dX, width - 2 * dX + dY, pic, '0.25 0.75 0', '0.5 0.25 0', theColor, theAlpha, 0);
- drawsubpic(theOrigin + height - dY + width - dX, dX + dY, pic, '0.75 0.75 0', '0.25 0.25 0', theColor, theAlpha, 0);
- }
- }
-}
-
-// return HUD background color
-vector HUD_GetBgColor()
-{
- vector color;
- if (teamplay)
- GetTeamRGB(myteam) * hud_color_bg_team;
- else {
- // allow custom HUD colors in non-teamgames
- color_x = cvar("hud_color_bg_r");
- color_y = cvar("hud_color_bg_g");
- color_z = cvar("hud_color_bg_b");
- }
- return color;
-}
-
-// return accuracy text color
-vector HUD_AccuracyColor(float accuracy)
-{
- vector rgb;
- float yellow_accuracy = cvar("hud_accuracy_yellow"); // value at which this function returns yellow
- if(accuracy >= 100) {
- rgb_x = 0;
- rgb_y = 1;
- }
- else if(accuracy > yellow_accuracy) {
- rgb_x = 1 - (accuracy-yellow_accuracy)/(100-yellow_accuracy); // red value between 1 -> 0
- rgb_y = 1;
- }
- else {
- rgb_x = 1;
- rgb_y = accuracy/yellow_accuracy; // green value between 0 -> 1
- }
- rgb_z = 0;
- return rgb;
-}
-
-// draw number in the XSCALE font
-void HUD_DrawXNum (vector pos, float num, float digits, float showsign, float lettersize, vector rgb, float highlighted, float stroke, float alpha, float dflags)
-{
- float l, i;
- string str, tmp, l_length;
- float minus, plus;
- vector vsize, num_color;
-
- vsize_x = vsize_y = lettersize;
- vsize_z = 0;
-
- // showsign 1: always prefix with minus sign (useful in race distribution display)
- // showsign 2: always prefix with plus sign (useful in race distribution display)
- // showsign 3: prefix with minus sign if negative, plus sign if positive (useful in score distribution display)
-
- if((showsign == 2 && num >= 0) || (num > 0 && showsign == 3))
- {
- plus = true;
- pos_x -= lettersize;
- } else
- plus = false;
-
- if(num < 0 || (num < 0 && showsign == 3) || (showsign == 1 && num <= 0))
- {
- minus = true;
- num = -num;
- pos_x -= lettersize;
- } else
- minus = false;
-
- if(digits < 0)
- {
- tmp = ftos(num);
- digits = -digits;
- str = strcat(substring("0000000000", 0, digits - strlen(tmp)), tmp);
- } else
- str = ftos(num);
-
- l = strlen(str);
- l_length = ftos(l);
-
- if(l > digits)
- {
- str = substring(str, l-digits, 999);
- l = strlen(str);
- } else if(l < digits)
- pos_x += (digits-l) * lettersize;
-
- if (highlighted == 1) {
- vector hl_size;
- hl_size_x = vsize_x * l + vsize_x * 0.2;
- hl_size_y = vsize_y * 1.1;
- hl_size_z = 0;
- if(minus)
- hl_size_x = hl_size_x + vsize_x;
-
- vector hl_pos;
- hl_pos_x = pos_x - lettersize/10;
- hl_pos_y = pos_y - lettersize/20;
- hl_pos_z = 0;
-
- drawpic(hl_pos, strcat("gfx/hud/sb_highlight_", l_length), hl_size, '1 1 1', alpha, dflags);
- }
-
- if (stroke == 1)
- num_color = '1 1 1';
- else
- num_color = rgb;
-
- if(minus)
- {
- if (stroke == 1)
- drawpic(pos, "gfx/hud/num_minus_stroke", vsize, rgb, alpha, dflags);
- drawpic(pos, "gfx/hud/num_minus", vsize, num_color, alpha, dflags);
- pos_x += lettersize;
- } else if(plus)
- {
- if (stroke == 1)
- drawpic(pos, "gfx/hud/num_plus_stroke", vsize, rgb, alpha, dflags);
- drawpic(pos, "gfx/hud/num_plus", vsize, num_color, alpha, dflags);
- pos_x += lettersize;
- }
-
- for(i = 0; i < l; ++i)
- {
- tmp = substring(str, i, 1);
- if (stroke == 1)
- drawpic(pos, strcat("gfx/hud/num_", tmp, "_stroke"), vsize, rgb, alpha, dflags);
- drawpic(pos, strcat("gfx/hud/num_", tmp), vsize, num_color, alpha, dflags);
- pos_x += lettersize;
- }
-}
-
-// color the number differently based on how big it is (used in the health/armor panel)
-void HUD_DrawXNum_Colored (vector pos, float x, float digits, float lettersize, float alpha)
-{
- vector color;
- if(x > 200) {
- color_x = 0;
- color_y = 1;
- color_z = 0;
- }
- else if(x > 150) {
- color_x = 0.4 - (x-150)*0.02 * 0.4; //red value between 0.4 -> 0
- color_y = 0.9 + (x-150)*0.02 * 0.1; // green value between 0.9 -> 1
- color_z = 0;
- }
- else if(x > 100) {
- color_x = 1 - (x-100)*0.02 * 0.6; //red value between 1 -> 0.4
- color_y = 1 - (x-100)*0.02 * 0.1; // green value between 1 -> 0.9
- color_z = 1 - (x-100)*0.02; // blue value between 1 -> 0
- }
- else if(x > 50) {
- color_x = 1;
- color_y = 1;
- color_z = 0.2 + (x-50)*0.02 * 0.8; // blue value between 0.2 -> 1
- }
- else if(x > 20) {
- color_x = 1;
- color_y = (x-20)*90/27/100; // green value between 0 -> 1
- color_z = (x-20)*90/27/100 * 0.2; // blue value between 0 -> 0.2
- }
- else {
- color_x = 1;
- color_y = 0;
- color_z = 0;
- }
- HUD_DrawXNum(pos, x, digits, 0, lettersize, color, 0, 0, alpha, DRAWFLAG_NORMAL);
-}
-
-float stringwidth_colors(string s, vector theSize)
-{
- return stringwidth(s, TRUE, theSize);
-}
-
-float stringwidth_nocolors(string s, vector theSize)
-{
- return stringwidth(s, FALSE, theSize);
-}
-
-#define CENTERPRINT_MAX_LINES 30
-string centerprint_messages[CENTERPRINT_MAX_LINES];
-float centerprint_width[CENTERPRINT_MAX_LINES];
-vector centerprint_start;
-float centerprint_expire;
-float centerprint_num;
-float centerprint_offset_hint;
-vector centerprint_fontsize;
-
-void centerprint(string strMessage)
-{
- float i, j, n, hcount;
- string s;
-
- centerprint_fontsize = HUD_GetFontsize("scr_centersize");
-
- centerprint_expire = min(centerprint_expire, time); // if any of the returns happens, this message will fade out
-
- if(cvar("scr_centertime") <= 0)
- return;
-
- if(strMessage == "")
- return;
-
- // strip trailing newlines
- j = strlen(strMessage) - 1;
- while(substring(strMessage, j, 1) == "\n" && j >= 0)
- j = j - 1;
- strMessage = substring(strMessage, 0, j + 1);
-
- if(strMessage == "")
- return;
-
- // strip leading newlines and remember them, they are a hint that the message should be lower on the screen
- j = 0;
- while(substring(strMessage, j, 1) == "\n" && j < strlen(strMessage))
- j = j + 1;
- strMessage = substring(strMessage, j, strlen(strMessage) - j);
- centerprint_offset_hint = j;
-
- if(strMessage == "")
- return;
-
- // if we get here, we have a message. Initialize its height.
- centerprint_num = 0;
-
- n = tokenizebyseparator(strMessage, "\n");
- i = hcount = 0;
- for(j = 0; j < n; ++j)
- {
- getWrappedLine_remaining = argv(j);
- while(getWrappedLine_remaining)
- {
- s = getWrappedLine(vid_conwidth * 0.75, centerprint_fontsize, stringwidth_colors);
- if(centerprint_messages[i])
- strunzone(centerprint_messages[i]);
- centerprint_messages[i] = strzone(s);
- centerprint_width[i] = stringwidth(s, TRUE, centerprint_fontsize);
- ++i;
-
- // half height for empty lines looks better
- if(s == "")
- hcount += 0.5;
- else
- hcount += 1;
-
- if(i >= CENTERPRINT_MAX_LINES)
- break;
- }
- }
-
- float h, havail;
- h = centerprint_fontsize_y*hcount;
-
- havail = vid_conheight;
- if(cvar("con_chatpos") < 0)
- havail -= (-cvar("con_chatpos") + cvar("con_chat")) * cvar("con_chatsize"); // avoid overlapping chat
- if(havail > vid_conheight - 70)
- havail = vid_conheight - 70; // avoid overlapping HUD
-
- centerprint_start_x = 0;
-
-#if 0
- float forbiddenmin, forbiddenmax, allowedmin, allowedmax, preferred;
-
- // here, the centerprint would cover the crosshair. REALLY BAD.
- forbiddenmin = vid_conheight * 0.5 - h - 16;
- forbiddenmax = vid_conheight * 0.5 + 16;
-
- allowedmin = scoreboard_bottom;
- allowedmax = havail - h;
- preferred = (havail - h)/2;
-
-
- // possible orderings (total: 4! / 4 = 6)
- // allowedmin allowedmax forbiddenmin forbiddenmax
- // forbiddenmin forbiddenmax allowedmin allowedmax
- if(allowedmax < forbiddenmin || allowedmin > forbiddenmax)
- {
- // forbidden doesn't matter in this case
- centerprint_start_y = bound(allowedmin, preferred, allowedmax);
- }
- // allowedmin forbiddenmin allowedmax forbiddenmax
- else if(allowedmin < forbiddenmin && allowedmax < forbiddenmax)
- {
- centerprint_start_y = bound(allowedmin, preferred, forbiddenmin);
- }
- // allowedmin forbiddenmin forbiddenmax allowedmax
- else if(allowedmin < forbiddenmin)
- {
- // make sure the forbidden zone is not covered
- if(preferred > (forbiddenmin + forbiddenmax) * 0.5)
- centerprint_start_y = bound(allowedmin, preferred, forbiddenmin);
- else
- centerprint_start_y = bound(forbiddenmax, preferred, allowedmin);
- }
- // forbiddenmin allowedmin allowedmax forbiddenmax
- else if(allowedmax < forbiddenmax)
- {
- // it's better to leave the allowed zone (overlap with scoreboard) than
- // to cover the forbidden zone (crosshair)
- if(preferred > (forbiddenmin + forbiddenmax) * 0.5)
- centerprint_start_y = forbiddenmax;
- else
- centerprint_start_y = forbiddenmin;
- }
- // forbiddenmin allowedmin forbiddenmax allowedmax
- else
- {
- centerprint_start_y = bound(forbiddenmax, preferred, allowedmax);
- }
-#else
- centerprint_start_y =
- min(
- max(
- max(scoreboard_bottom, vid_conheight * 0.5 + 16),
- (havail - h)/2
- ),
- havail - h
- );
-#endif
-
- centerprint_num = i;
- centerprint_expire = time + cvar("scr_centertime");
-}
-
-void HUD_DrawCenterPrint (void)
-{
- float i;
- vector pos;
- string ts;
- float a;
-
- //if(time > centerprint_expire)
- // return;
-
- //a = bound(0, 1 - 2 * (time - centerprint_expire), 1);
- a = bound(0, 1 - 4 * (time - centerprint_expire), 1);
- //sz = 1.2 / (a + 0.2);
-
- if(a <= 0)
- return;
-
- pos = centerprint_start;
- for (i=0; i<centerprint_num; i = i + 1)
- {
- pos_x = (vid_conwidth - centerprint_width[i]) * 0.5;
- ts = centerprint_messages[i];
- if (ts != "")
- {
- dummyfunction(0, 0, 0, 0, 0, 0, 0, 0); // work around DP bug (set OFS_PARAM5 to 0)
- drawcolorcodedstring(pos, ts, centerprint_fontsize, a, DRAWFLAG_NORMAL);
- // - '0 0.5 0' * (sz - 1) * centerprint_fontsize_x - '0.5 0 0' * (sz - 1) * centerprint_width[i] * centerprint_fontsize_y, centerprint_fontsize * sz
- pos_y = pos_y + centerprint_fontsize_y;
- }
- else
- // half height for empty lines looks better
- pos_y = pos_y + centerprint_fontsize_y * 0.5;
- }
-}
-
-void drawstringright(vector position, string text, vector scale, vector rgb, float alpha, float flag)
-{
- position_x -= 2 / 3 * strlen(text) * scale_x;
- drawstring(position, text, scale, rgb, alpha, flag);
-}
-
-void drawstringcenter(vector position, string text, vector scale, vector rgb, float alpha, float flag)
-{
- position_x = 0.5 * (vid_conwidth - 0.6025 * strlen(text) * scale_x);
- drawstring(position, text, scale, rgb, alpha, flag);
-}
-
-// return the string of the given race place
-string race_PlaceName(float pos) {
- if(pos == 1)
- return "1st";
- else if(pos == 2)
- return "2nd";
- else if(pos == 3)
- return "3rd";
- else
- return strcat(ftos(pos), "th");
-}
-
-// return the string of the onscreen race timer
-string MakeRaceString(float cp, float mytime, float histime, float lapdelta, string hisname)
-{
- string col;
- string timestr;
- string cpname;
- string lapstr;
- lapstr = "";
-
- if(histime == 0) // goal hit
- {
- if(mytime > 0)
- {
- timestr = strcat("+", ftos_decimals(+mytime, TIME_DECIMALS));
- col = "^1";
- }
- else if(mytime == 0)
- {
- timestr = "+0.0";
- col = "^3";
- }
- else
- {
- timestr = strcat("-", ftos_decimals(-mytime, TIME_DECIMALS));
- col = "^2";
- }
-
- if(lapdelta > 0)
- {
- lapstr = strcat(" (-", ftos(lapdelta), "L)");
- col = "^2";
- }
- else if(lapdelta < 0)
- {
- lapstr = strcat(" (+", ftos(-lapdelta), "L)");
- col = "^1";
- }
- }
- else if(histime > 0) // anticipation
- {
- if(mytime >= histime)
- timestr = strcat("+", ftos_decimals(mytime - histime, TIME_DECIMALS));
- else
- timestr = TIME_ENCODED_TOSTRING(TIME_ENCODE(histime));
- col = "^3";
- }
- else
- col = "^7";
-
- if(cp == 254)
- cpname = "Start line";
- else if(cp == 255)
- cpname = "Finish line";
- else if(cp)
- cpname = strcat("Intermediate ", ftos(cp));
- else
- cpname = "Finish line";
-
- if(histime < 0)
- return strcat(col, cpname);
- else if(hisname == "")
- return strcat(col, cpname, " (", timestr, ")");
- else
- return strcat(col, cpname, " (", timestr, " ", strcat(hisname, col, lapstr), ")");
-}
-
-// Check if the given name already exist in race rankings? In that case, where? (otherwise return 0)
-float race_CheckName(string net_name) {
- float i;
- for (i=RANKINGS_CNT-1;i>=0;--i)
- if(grecordholder[i] == net_name)
- return i+1;
- return 0;
-}
-
-/*
-==================
-HUD panels
-==================
-*/
-
-string HUD_Panel_GetName(float id)
-{
- switch(id) {
- case 0: return "weaponicons"; break;
- case 1: return "inventory"; break;
- case 2: return "powerups"; break;
- case 3: return "healtharmor"; break;
- case 4: return "notify"; break;
- case 5: return "timer"; break;
- case 6: return "radar"; break;
- case 7: return "score"; break;
- case 8: return "racetimer"; break;
- case 9: return "vote"; break;
- case 10: return "pressedkeys"; break;
- default: return "";
- }
-}
-
-vector HUD_Panel_CheckLimitSize(float id, vector mySize)
-{
- switch(id) {
- case 0:
- mySize_x = max(mySize_y * (1/10), mySize_x); // at least 1/10 * height
- mySize_y = max(mySize_x * (1/26), mySize_y); // at least 1/26 * width
- break;
- case 1:
- mySize_x = max(mySize_y * 0.7, mySize_x); // at least 0.7 * height
- break;
- case 3:
- mySize_x = max(mySize_y * 2, mySize_x); // at least 2 * height
- break;
- case 5:
- mySize_x = max(mySize_y * 2, mySize_x); // at least 2 * height
- break;
- case 9:
- mySize_y = (1/4) * mySize_x; // 1/4 * width
- break;
- case 10:
- mySize_y = 0.5898 * mySize_x; // 0.5898 * width, reason: bg has weird dimensions...
- break;
- }
- return mySize;
-}
-
-// return active status of panel
-float HUD_Panel_CheckActive(float id)
-{
- if (cvar_or(strcat("hud_", HUD_Panel_GetName(id)), 1))
- return 1;
- return 0;
-}
-
-// return size of given panel
-vector HUD_Panel_GetSize(float id)
-{
- return stov(cvar_string(strcat("hud_", HUD_Panel_GetName(id), "_size")));
-}
-
-// return pos of given panel
-vector HUD_Panel_GetPos(float id)
-{
- vector pos;
- pos = stov(cvar_string(strcat("hud_", HUD_Panel_GetName(id), "_pos")));
-
- if (pos_x < 0)
- pos_x = vid_conwidth + pos_x;
- if (pos_y < 0)
- pos_y = vid_conheight + pos_y;
- return pos;
-}
-
-float HUD_Panel_GetMarigin(float id)
-{
- return bound(1, MARIGIN_MULTIPLIER * cvar_or(strcat("hud_", HUD_Panel_GetName(id), "_marigin"), 30), 200);
-}
-
-vector HUD_Panel_GetColor(float id)
-{
- if(cvar_string(strcat("hud_", HUD_Panel_GetName(id), "_color")) != "")
- return stov(cvar_string(strcat("hud_", HUD_Panel_GetName(id), "_color")));
- else
- return stov(cvar_string("hud_color"));
-}
-
-float HUD_Panel_GetBgActive(float id)
-{
- if(cvar("_hud_configure"))
- return 1;
-
- return cvar_or(strcat("hud_", HUD_Panel_GetName(id), "_bg"), 1);
-}
-
-vector HUD_Panel_GetProgressBarColor(string item)
-{
- return stov(cvar_string(strcat("hud_progreshud_", item, "_color")));
-}
-
-float resizeCorner; // 1 = topleft, 2 = topright, 3 = bottomleft, 4 = bottomright
-// check if resize will result in panel being moved into another panel. If so, return snapped vector, otherwise return the given vector
-vector HUD_Panel_CheckResize(float id, vector myPos, vector mySize)
-{
- float i;
-
- vector myTarget;
- myTarget = mySize;
-
- vector targPos;
- vector targSize;
- vector myCenter;
- vector targCenter;
-
- for (i = 0; i < panel_cnt; ++i) {
- if(i == id || !HUD_Panel_CheckActive(i))
- continue;
-
- targPos = HUD_Panel_GetPos(i);
- targSize = HUD_Panel_GetSize(i);
-
- targPos = HUD_Panel_GetPos(i) - '1 1 0' * HUD_Panel_GetMarigin(id);
- targSize = HUD_Panel_GetSize(i) + '2 2 0' * HUD_Panel_GetMarigin(id);
-
- if(myPos_y + mySize_y < targPos_y)
- continue;
- if(myPos_y > targPos_y + targSize_y)
- continue;
-
- if(myPos_x + mySize_x < targPos_x)
- continue;
- if(myPos_x > targPos_x + targSize_x)
- continue;
-
- // OK, there IS a collision.
-
- myCenter_x = myPos_x + 0.5 * mySize_x;
- myCenter_y = myPos_y + 0.5 * mySize_y;
-
- targCenter_x = targPos_x + 0.5 * targSize_x;
- targCenter_y = targPos_y + 0.5 * targSize_y;
-
- float k, y;
- if(myCenter_x < targCenter_x && myCenter_y < targCenter_y && resizeCorner != 1) // top left (of target panel)
- {
- if(myPos_x + mySize_x - targPos_x < myPos_y + mySize_y - targPos_y) // push it to the side
- myTarget_x = targPos_x - myPos_x;
- else // push it upwards
- myTarget_y = targPos_y - myPos_y;
- }
- else if(myCenter_x > targCenter_x && myCenter_y < targCenter_y && resizeCorner != 2) // top right
- {
- if(targPos_x + targSize_x - myPos_x < myPos_y + mySize_y - targPos_y) // push it to the side
- myTarget_x = targPos_x + targSize_x;
- else // push it upwards
- myTarget_y = targPos_y - myPos_y;
- }
- else if(myCenter_x < targCenter_x && myCenter_y > targCenter_y) // bottom left
- {
- if(myPos_x + mySize_x - targPos_x < targPos_y + targSize_y - myPos_y) // push it to the side
- myTarget_x = targPos_x - myPos_x;
- else // push it downwards
- myTarget_y = targPos_y + targSize_y;
- }
- else if(myCenter_x > targCenter_x && myCenter_y > targCenter_y) // bottom right
- {
- if(targPos_x + targSize_x - myPos_x < targPos_y + targSize_y - myPos_y) // push it to the side
- myTarget_x = targPos_x + targSize_x;
- else // push it downwards
- myTarget_y = targPos_y + targSize_y;
- }
- }
-
- return myTarget;
-}
-
-// TODO: checkResize
-float HUD_Panel_SetSize(float id, vector mySize)
-{
- float didntresize;
-
- vector oldSize;
- oldSize = stov(cvar_string(strcat("hud_", HUD_Panel_GetName(id), "_size")));
-
- vector myPos;
- myPos = HUD_Panel_GetPos(id);
-
- // check for collisions
- mySize = HUD_Panel_CheckResize(id, HUD_Panel_GetPos(id), mySize);
-
- mySize_x = bound(0.025 * vid_conwidth, mySize_x, vid_conwidth - myPos_x);
- mySize_y = bound(0.025 * vid_conheight, mySize_y, vid_conheight - myPos_y);
-
- // cap against panel's own limits
- mySize = HUD_Panel_CheckLimitSize(id, mySize);
-
- //mySize_x = bound(0.025 * vid_conwidth, mySize_x, vid_conwidth);
- //mySize_y = bound(0.025 * vid_conheight, mySize_y, vid_conheight);
-
- // TODO: is this needed?
- // this is to check if (and how) SetPos should be called
- if(mySize_x == oldSize_x && mySize_y == oldSize_y)
- didntresize = 3; // didnt resize either
- else if(mySize_x == oldSize_x && mySize_y != oldSize_y)
- didntresize = 2; // resized Y
- else if(mySize_y == oldSize_y && mySize_x != oldSize_x)
- didntresize = 1; // resized X
-
- string s;
- s = strcat(ftos(mySize_x), " ", ftos(mySize_y));
- cvar_set(strcat("hud_", HUD_Panel_GetName(id), "_size"), s);
- return didntresize;
-}
-
-// check if move will result in panel being moved into another panel. If so, return snapped vector, otherwise return the given vector
-vector HUD_Panel_CheckMove(float id, vector myPos, vector mySize)
-{
- float i;
-
- vector myTarget;
- myTarget = myPos;
-
- vector targPos;
- vector targSize;
- vector myCenter;
- vector targCenter;
-
- for (i = 0; i < panel_cnt; ++i) {
- if(i == id || !HUD_Panel_CheckActive(i))
- continue;
-
- targPos = HUD_Panel_GetPos(i) - '1 1 0' * HUD_Panel_GetMarigin(id);
- targSize = HUD_Panel_GetSize(i) + '2 2 0' * HUD_Panel_GetMarigin(id);
-
- if(myPos_y + mySize_y < targPos_y)
- continue;
- if(myPos_y > targPos_y + targSize_y)
- continue;
-
- if(myPos_x + mySize_x < targPos_x)
- continue;
- if(myPos_x > targPos_x + targSize_x)
- continue;
-
- // OK, there IS a collision.
-
- myCenter_x = myPos_x + 0.5 * mySize_x;
- myCenter_y = myPos_y + 0.5 * mySize_y;
-
- targCenter_x = targPos_x + 0.5 * targSize_x;
- targCenter_y = targPos_y + 0.5 * targSize_y;
-
- float k, y;
- if(myCenter_x < targCenter_x && myCenter_y < targCenter_y) // top left (of the target panel)
- {
- if(myPos_x + mySize_x - targPos_x < myPos_y + mySize_y - targPos_y) // push it to the side
- myTarget_x = targPos_x - mySize_x;
- else // push it upwards
- myTarget_y = targPos_y - mySize_y;
- }
- else if(myCenter_x > targCenter_x && myCenter_y < targCenter_y) // top right
- {
- if(targPos_x + targSize_x - myPos_x < myPos_y + mySize_y - targPos_y) // push it to the side
- myTarget_x = targPos_x + targSize_x;
- else // push it upwards
- myTarget_y = targPos_y - mySize_y;
- }
- else if(myCenter_x < targCenter_x && myCenter_y > targCenter_y) // bottom left
- {
- if(myPos_x + mySize_x - targPos_x < targPos_y + targSize_y - myPos_y) // push it to the side
- myTarget_x = targPos_x - mySize_x;
- else // push it downwards
- myTarget_y = targPos_y + targSize_y;
- }
- else if(myCenter_x > targCenter_x && myCenter_y > targCenter_y) // bottom right
- {
- if(targPos_x + targSize_x - myPos_x < targPos_y + targSize_y - myPos_y) // push it to the side
- myTarget_x = targPos_x + targSize_x;
- else // push it downwards
- myTarget_y = targPos_y + targSize_y;
- }
- }
-
- return myTarget;
-}
-
-void HUD_Panel_SetPos(float id, vector pos, float didntresize)
-{
- vector oldPos;
- oldPos = HUD_Panel_GetPos(id);
- if(didntresize == 2)
- pos_x = oldPos_x;
- else if(didntresize == 1)
- pos_y = oldPos_y;
- else if(didntresize == 3)
- return;
-
- vector mySize;
- mySize = HUD_Panel_GetSize(id);
-
- pos = HUD_Panel_CheckMove(id, pos, mySize);
-
- pos_x = bound(0, pos_x, vid_conwidth - mySize_x);
- pos_y = bound(0, pos_y, vid_conheight - mySize_y);
-
- if (pos_x + 0.5 * mySize_x > 0.5 * vid_conwidth)
- pos_x = pos_x - vid_conwidth;
- if (pos_y + 0.5 * mySize_y > 0.5 * vid_conheight)
- pos_y = pos_y - vid_conheight;
-
- string s;
- s = strcat(ftos(pos_x), " ", ftos(pos_y));
-
- cvar_set(strcat("hud_", HUD_Panel_GetName(id), "_pos"), s);
-}
-
-float mouseClicked;
-float prevMouseClicked; // previous state
-float HUD_Panel_InputEvent(float bInputType, float nPrimary, float nSecondary)
-{
- prevMouseClicked = mouseClicked;
- if(nPrimary == K_MOUSE1)
- {
- if(bInputType == 0) { // key pressed
- mouseClicked = 1;
- return true;
- }
- if(bInputType == 1) {// key released
- mouseClicked = 0;
- return true;
- }
- }
- return false;
-}
-
-vector mousepos, mouseprevpos;
-vector panel_click_distance; // mouse cursor distance from the top left corner of the panel (saved only upon a click)
-vector panel_click_pos; // panel pos (saved only upon a click)
-vector panel_click_size; // panel size (saved only upon a click)
-float highlightedPanel;
-float highlightedAction; // 0 = nothing, 1 = move, 2 = resize
-void HUD_Panel_Mouse()
-{
- if(mouseClicked == 0) {
- highlightedPanel = -1;
- highlightedAction = 0;
- }
-
- mousepos = mousepos + getmousepos();
-
- mousepos_x = bound(0, mousepos_x, vid_conwidth);
- mousepos_y = bound(0, mousepos_y, vid_conheight);
-
- drawpic(mousepos, "gfx/menu/default/cursor.tga", '32 32 0', '1 1 1', 1, hud_alpha_fg);
-
- if(mouseClicked)
- {
- float i, marigin;
- vector panelPos;
- vector panelSize;
-
- for(i = 0; i <= panel_cnt; i++)
- {
- panelPos = HUD_Panel_GetPos(i);
- panelSize = HUD_Panel_GetSize(i);
- marigin = HUD_Panel_GetMarigin(i);
- if(prevMouseClicked == 0) {
- // move
- if(mousepos_x >= panelPos_x && mousepos_y >= panelPos_y && mousepos_x <= panelPos_x + panelSize_x && mousepos_y <= panelPos_y + panelSize_y)
- {
- highlightedPanel = i;
- highlightedAction = 1;
- }
- // resize from topleft border
- else if(mousepos_x >= panelPos_x - eX * marigin && mousepos_y >= panelPos_y - eX * marigin && mousepos_x <= panelPos_x + 0.5 * panelSize_x && mousepos_y <= panelPos_y + 0.5 * panelSize_y)
- {
- highlightedPanel = i;
- highlightedAction = 2;
- resizeCorner = 1;
- }
- // resize from topright border
- else if(mousepos_x >= panelPos_x + 0.5 * panelSize_x && mousepos_y >= panelPos_y - eX * marigin && mousepos_x <= panelPos_x + panelSize_x + eX * marigin && mousepos_y <= panelPos_y + 0.5 * panelSize_y)
- {
- highlightedPanel = i;
- highlightedAction = 2;
- resizeCorner = 2;
- }
- // resize from bottomleft border
- else if(mousepos_x >= panelPos_x - eX * marigin && mousepos_y >= panelPos_y + 0.5 * panelSize_y && mousepos_x <= panelPos_x + 0.5 * panelSize_x && mousepos_y <= panelPos_y + panelSize_y + eY * marigin)
- {
- highlightedPanel = i;
- highlightedAction = 2;
- resizeCorner = 3;
- }
- // resize from bottomright border
- else if(mousepos_x >= panelPos_x + 0.5 * panelSize_x && mousepos_y >= panelPos_y + 0.5 * panelSize_y && mousepos_x <= panelPos_x + panelSize_x + eX * marigin && mousepos_y <= panelPos_y + panelSize_y + eY * marigin)
- {
- highlightedPanel = i;
- highlightedAction = 2;
- resizeCorner = 4;
- }
- }
-
- if(highlightedPanel == i)
- {
- if(prevMouseClicked == 0)
- {
- panel_click_distance = mousepos - panelPos;
- panel_click_pos = panelPos;
- panel_click_size = panelSize;
- }
-
- if(highlightedAction == 1)
- HUD_Panel_SetPos(i, mousepos - panel_click_distance, 0);
- else if(highlightedAction == 2)
- {
- float didntresize; // panel too big/too small, dont resize (also has to affect moving)
- if(resizeCorner == 1) {
- didntresize = HUD_Panel_SetSize(i, panelSize + mouseprevpos - mousepos);
- HUD_Panel_SetPos(i, mousepos - panel_click_distance, didntresize);
- }
- if(resizeCorner == 2) {
- didntresize = HUD_Panel_SetSize(i, eY * panel_click_size_y + eX * (mousepos_x - panelPos_x - (panel_click_distance_x - panel_click_size_x))
- + eY * (panel_click_distance_y + (panel_click_pos_y - mousepos_y)));
- HUD_Panel_SetPos(i, eX * panelPos_x + eY * (mousepos_y - panel_click_distance_y), didntresize);
- }
- if(resizeCorner == 3) {
- didntresize = HUD_Panel_SetSize(i, panelSize + eX * (mouseprevpos_x - mousepos_x) + eY * (mousepos_y - mouseprevpos_y));
- HUD_Panel_SetPos(i, eX * (mousepos_x - panel_click_distance_x) + eY * panelPos_y, didntresize);
- }
- if(resizeCorner == 4) {
- HUD_Panel_SetSize(i, mousepos - panelPos - (panel_click_distance - panel_click_size));
- }
- }
- }
- }
- }
- mouseprevpos = mousepos;
- prevMouseClicked = mouseClicked;
-}
-
-/*void HUD_DrawDockEdge(float id, vector p1, vector p2, float target)
-{
- vector pos;
- vector size;
-
- pos =
-*/ // maybe one day, since this will be quite complicated
-
-// Weapon icons (#0)
-//
-
-float weaponspace[10];
-void HUD_WeaponIcons_Clear()
-{
- float idx;
- for(idx = 0; idx < 10; ++idx)
- weaponspace[idx] = 0;
-}
-
-void HUD_WeaponIcons()
-{
- float alpha, height, marigin, accuracybar_height, stat_weapons; // "constants"
- vector pos, mySize, mysize, mypos, color, accuracy_color;
- float i, id, fade, weapon_stats, weapon_hit, weapon_damage, weapon_cnt; // variables
-
- marigin = HUD_Panel_GetMarigin(0);
- pos = HUD_Panel_GetPos(0);
- mySize = HUD_Panel_GetSize(0);
- color = HUD_Panel_GetColor(0);
- accuracybar_height = cvar_or("hud_weaponicons_accuracybar_height", 3);
-
- stat_weapons = getstati(STAT_WEAPONS);
- for(i = WEP_FIRST; i <= WEP_LAST; ++i)
- {
- self = get_weaponinfo(i);
- if(self.weapons && self.impulse >= 0 && stat_weapons & self.weapons)
- ++weapon_cnt;
- }
-
- if(HUD_Panel_GetBgActive(0) && weapon_cnt)
- draw_BorderPicture(pos - '1 1 0' * marigin, "gfx/hud/border", mySize + '1 1 0' * 2 * marigin, color, hud_alpha_bg, '1 1 0' * (marigin/MARIGIN_MULTIPLIER));
-
- // hits
- weapon_stats = getstati(STAT_DAMAGE_HITS);
- weapon_number = weapon_stats & 63;
- weapon_hits[weapon_number-WEP_FIRST] = floor(weapon_stats / 64);
- // fired
- weapon_stats = getstati(STAT_DAMAGE_FIRED);
- weapon_number = weapon_stats & 63;
- weapon_fired[weapon_number-WEP_FIRST] = floor(weapon_stats / 64);
-
- if(cvar_or("hud_weaponicons_fade", 1))
- {
- fade = 3.2 - 2 * (time - weapontime);
- fade = bound(0.7, fade, 1);
- }
- else
- fade = 1;
-
- HUD_WeaponIcons_Clear();
-
- float rows, columns;
- //TODO: yuck. there must be a better way :)
- //rows = ceil(4 * mySize_y/mySize_x);
- if(mySize_y/mySize_x < 0.08)
- rows = 1;
- else if(mySize_y/mySize_x < 0.25)
- rows = 2;
- else if(mySize_y/mySize_x < 0.5)
- rows = 3;
- else if(mySize_y/mySize_x < 0.7)
- rows = 4;
- else if(mySize_y/mySize_x < 0.9)
- rows = 5;
- else if(mySize_y/mySize_x < 1.25)
- rows = 6;
- else if(mySize_y/mySize_x < 1.7)
- rows = 7;
- else if(mySize_y/mySize_x < 2.5)
- rows = 8;
- else if(mySize_y/mySize_x < 4)
- rows = 12;
- else if(mySize_y/mySize_x < 6)
- rows = 14;
- else
- rows = 16;
-
- columns = ceil(16/rows);
- float row, column;
- for(i = WEP_FIRST; i <= WEP_LAST; ++i)
- {
- self = get_weaponinfo(i);
- if((self.weapons && self.impulse >= 0 && stat_weapons & self.weapons) || cvar("_hud_configure"))
- {
- id = self.impulse;
-
- alpha = (id == activeweapon) ? 1 : 0.6;
-
- weapon_hit = weapon_hits[self.weapon-WEP_FIRST];
- weapon_damage = weapon_fired[self.weapon-WEP_FIRST];
- if(id == 0) // porto and hook should be last
- id = 9;
- else
- id = --id;
-
- if(id+1 == activeweapon)
- drawpic(pos + eX * column * mySize_x*(1/columns) + eY * row * mySize_y*(1/rows), "gfx/hud/sb_ammobg", eX * mySize_x*(1/columns) + eY * mySize_y*(1/rows), color, fade * hud_alpha_fg, DRAWFLAG_NORMAL);
- drawpic(pos + eX * column * mySize_x*(1/columns) + eY * row * mySize_y*(1/rows), strcat("gfx/hud/inv_weapon", self.netname), eX * mySize_x*(1/columns) + eY * mySize_y*(1/rows), '1 1 1', fade * hud_alpha_fg, DRAWFLAG_NORMAL);
-
- if(cvar_or("hud_weaponicons_number", 1))
- drawstring(pos + eX * column * mySize_x*(1/columns) + eY * row * mySize_y*(1/rows), ftos(id+1), '1 1 0' * 0.5 * mySize_y*(1/rows), '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
-
- // draw the weapon accuracy on the HUD
- if(hud_accuracy_hud && !(gametype == GAME_RACE || gametype == GAME_CTS))
- {
- if(weapon_damage)
- weapon_stats = floor(100 * weapon_hit / weapon_damage);
-
- accuracy_color = HUD_AccuracyColor(weapon_stats);
- if(weapon_damage)
- drawpic(pos + eX * column * mySize_x*(1/columns) + eY * row * mySize_y*(1/rows) - '2 0 0' + eY * (mySize_y/rows - accuracybar_height), "gfx/hud/sb_accuracy_bar.tga", eX * mySize_x*(1/columns) + eY * accuracybar_height, accuracy_color, hud_alpha_fg, DRAWFLAG_NORMAL);
- }
- }
-
- ++row;
- if(row >= rows)
- {
- row = 0;
- ++column;
- }
- }
-
-}
-
-// Inventory (#1)
-//
-
-float GetAmmoStat(float i)
-{
- switch(i)
- {
- case 0: return STAT_SHELLS;
- case 1: return STAT_NAILS;
- case 2: return STAT_ROCKETS;
- case 3: return STAT_CELLS;
- case 4: return STAT_FUEL;
- default: return -1;
- }
-}
-
-float GetAmmoItemCode(float i)
-{
- switch(i)
- {
- case 0: return IT_SHELLS;
- case 1: return IT_NAILS;
- case 2: return IT_ROCKETS;
- case 3: return IT_CELLS;
- case 4: return IT_FUEL;
- default: return -1;
- }
-}
-
-string GetAmmoPicture(float i)
-{
- switch(i)
- {
- case 0: return "gfx/hud/sb_shells";
- case 1: return "gfx/hud/sb_bullets";
- case 2: return "gfx/hud/sb_rocket";
- case 3: return "gfx/hud/sb_cells";
- case 4: return "gfx/hud/sb_fuel";
- default: return "";
- }
-}
-
-void HUD_Inventory()
-{
- float i;
- float stat_items;
- float marigin;
-
- vector pos, mySize, mysize, mypos, color;
- marigin = HUD_Panel_GetMarigin(1);
- pos = HUD_Panel_GetPos(1);
- mySize = HUD_Panel_GetSize(1);
- color = HUD_Panel_GetColor(1);
-
- if(HUD_Panel_GetBgActive(1))
- draw_BorderPicture(pos - '1 1 0' * marigin, "gfx/hud/border", mySize + '1 1 0' * 2 * marigin, color, hud_alpha_bg, '1 1 0' * (marigin/MARIGIN_MULTIPLIER));
-
- // ammo
- stat_items = getstati(STAT_ITEMS);
- for (i = 0; i < 4; ++i) {
- float a;
- a = getstati(GetAmmoStat(i)); // how much ammo do we have of type i?
- if(cvar("_hud_configure"))
- a = 100;
-
- if(cvar("hud_ammo_onlycurrent")) {
- if (stat_items & GetAmmoItemCode(i)) {
- drawpic(pos - '1 1 0' * marigin, "gfx/hud/sb_ammobg", mysize + '1 1 0' * marigin, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
- drawpic(pos + eX * mysize_x * 1.7, GetAmmoPicture(i), '24 24 0', '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
- if(a < 10)
- HUD_DrawXNum(pos + '5 5 0', a, 3, 0, 24, '0.7 0 0', 0, 0, hud_alpha_fg, DRAWFLAG_NORMAL);
- else
- HUD_DrawXNum(pos + '5 5 0', a, 3, 0, 24, '1 1 1', 0, 0, hud_alpha_fg, DRAWFLAG_NORMAL);
- }
- } else {
- if (a > 0) {
- if(mySize_x/mySize_y >= 10) { // arrange horizontally
- switch (i) {
- case 0: mypos_x = pos_x; mypos_y = pos_y; break; // shells
- case 1: mypos_x = pos_x + 0.25 * mySize_x; mypos_y = pos_y; break; // bullets
- case 2: mypos_x = pos_x + 0.5 * mySize_x; mypos_y = pos_y; break; // rockets
- case 3: mypos_x = pos_x + 0.75 * mySize_x; mypos_y = pos_y; break; // cells
- }
- mysize_x = 0.25 * mySize_x;
- mysize_y = mySize_y;
- } else if(mySize_x/mySize_y >= 2.5) { // arrange in a 2x2 grid
- switch (i) {
- case 0: mypos_x = pos_x + 0.5 * mySize_x; mypos_y = pos_y + 0.5 * mySize_y; break; // shells
- case 1: mypos_x = pos_x + 0.5 * mySize_x; mypos_y = pos_y; break; // bullets
- case 2: mypos_x = pos_x; mypos_y = pos_y + 0.5 * mySize_y; break; // rockets
- case 3: mypos_x = pos_x; mypos_y = pos_y; break; // cells
- }
- mysize_x = 0.5 * mySize_x;
- mysize_y = 0.5 * mySize_y;
- } else { // arrange vertically
- switch (i) {
- case 0: mypos_x = pos_x; mypos_y = pos_y; break; // shells
- case 1: mypos_x = pos_x; mypos_y = pos_y + 0.25 * mySize_y; break; // bullets
- case 2: mypos_x = pos_x; mypos_y = pos_y + 0.5 * mySize_y; break; // rockets
- case 3: mypos_x = pos_x; mypos_y = pos_y + 0.75 * mySize_y; break; // cells
- }
- mysize_x = mySize_x;
- mysize_y = 0.25 * mySize_y;
- }
-
- if (stat_items & GetAmmoItemCode(i))
- drawpic(mypos, "gfx/hud/sb_ammobg", mysize, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
- drawpic(mypos + eY * 0.05 * mysize_y, GetAmmoPicture(i), '1 1 0' * 0.8 * mysize_y, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
- if (a < 10) {
- if(stat_items & GetAmmoItemCode(i))
- HUD_DrawXNum(mypos + eX * 0.8 * mysize_y + eY * 0.25 * mysize_y, a, strlen(ftos(a)), 0, 0.5 * mysize_y, '0.7 0 0', 0, 0, hud_alpha_fg, DRAWFLAG_NORMAL);
- else
- HUD_DrawXNum(mypos + eX * 0.8 * mysize_y + eY * 0.25 * mysize_y, a, strlen(ftos(a)), 0, 0.5 * mysize_y, '0.7 0 0', 0, 0, hud_alpha_fg * 0.7, DRAWFLAG_NORMAL);
- } else {
- if(stat_items & GetAmmoItemCode(i))
- HUD_DrawXNum(mypos + eX * 0.8 * mysize_y + eY * 0.25 * mysize_y, a, strlen(ftos(a)), 0, 0.5 * mysize_y, '1 1 1', 0, 0, hud_alpha_fg, DRAWFLAG_NORMAL);
- else
- HUD_DrawXNum(mypos + eX * 0.8 * mysize_y + eY * 0.25 * mysize_y, a, strlen(ftos(a)), 0, 0.5 * mysize_y, '0.7 0.7 0.7', 0, 0, hud_alpha_fg * 0.7, DRAWFLAG_NORMAL);
- }
- }
- }
- }
-
- // fuel ammo
- a = getstati(GetAmmoStat(4)); // how much fuel do we have?
-
- if (a > 0) { // if we have fuel, draw the amount
- if(pos_x + 0.5 * mySize_x > 0.5 * vid_conwidth)
- mypos_x += pos_x + mySize_x - 0; // TODO!
-
- drawpic(mypos - '0 2 0' + '52 0 0', GetAmmoPicture(4), '20 20 0', '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
- if (a > 10)
- HUD_DrawXNum(mypos, a, 3, 0, 16, '1 1 1', 0, 0, hud_alpha_fg, DRAWFLAG_NORMAL);
- else
- HUD_DrawXNum(mypos, a, 3, 0, 16, '0.7 0 0', 0, 0, hud_alpha_fg, DRAWFLAG_NORMAL);
- }
-}
-
-
-// Powerups (#2)
-// TODO!
-void HUD_Powerups() {
- float stat_items, dt;
- float marigin;
-
- vector pos, mySize, color;
- marigin = HUD_Panel_GetMarigin(2);
- pos = HUD_Panel_GetPos(2);
- mySize = HUD_Panel_GetSize(2);
- color = HUD_Panel_GetColor(2);
-
- if(HUD_Panel_GetBgActive(2))
- draw_BorderPicture(pos - '1 1 0' * marigin, "gfx/hud/border", mySize + '1 1 0' * 2 * marigin, color, hud_alpha_bg, '1 1 0' * (marigin/MARIGIN_MULTIPLIER));
-
- stat_items = getstati(STAT_ITEMS);
- /*
- if not(stat_items & IT_STRENGTH)
- if not(stat_items & IT_INVINCIBLE)
- return;
- */
-
- if (getstati(STAT_HEALTH) <= 0)
- return;
-
- float strength_time, invincibility_time, countdown_fontsize;
-
- //strength
- strength_time = getstatf(STAT_STRENGTH_FINISHED);
- invincibility_time = getstatf(STAT_INVINCIBLE_FINISHED);
-
- if (strength_time) {
- dt = strength_time - time;
- if(dt > 0)
- {
- if(dt < 5)
- {
- drawpic_expanding_two(pos, "gfx/hud/sb_str", '1 1 0' * mySize_y, '1 1 1', hud_alpha_fg, DRAWFLAG_ADDITIVE,
- bound(0, (ceil(dt) - dt) / 0.5, 1));
- }
- else
- {
- drawpic(pos, "gfx/hud/sb_str", '1 1 0' * mySize_y, '1 1 1', hud_alpha_fg, DRAWFLAG_ADDITIVE);
- }
- HUD_DrawXNum(pos - '40 -2 0', ceil(dt), 2, 0, countdown_fontsize, '1 1 1', 0, 0, hud_alpha_fg, DRAWFLAG_NORMAL);
- }
- else if(dt > -1)
- {
- drawpic_expanding(pos, "gfx/hud/sb_str", '1 1 0' * mySize_y, '1 1 1', hud_alpha_fg, DRAWFLAG_ADDITIVE,
- bound(0, -dt / 0.5, 1));
- }
- }
-
- //invincibility
- if (invincibility_time) {
- dt = invincibility_time - time;
- if(dt > 0)
- {
- if(dt < 5)
- {
- drawpic_expanding_two(pos - '0 -22 0', "gfx/hud/sb_invinc", '1 1 0' * mySize_y, '1 1 1', hud_alpha_fg, DRAWFLAG_ADDITIVE,
- bound(0, (ceil(dt) - dt) / 0.5, 1));
- }
- else
- {
- drawpic(pos - '0 -22 0', "gfx/hud/sb_invinc", '1 1 0' * mySize_y, '1 1 1', hud_alpha_fg, DRAWFLAG_ADDITIVE);
- }
- HUD_DrawXNum(pos - '40 -24 0', ceil(dt), 2, 0, countdown_fontsize, '1 1 1', 0, 0, hud_alpha_fg, DRAWFLAG_NORMAL);
- }
- else if(dt > -1)
- {
- drawpic_expanding(pos - '0 -22 0', "gfx/hud/sb_invinc", '1 1 0' * mySize_y, '1 1 1', hud_alpha_fg, DRAWFLAG_ADDITIVE,
- bound(0, -dt / 0.5, 1));
- }
- }
-}
-
-// Health/armor (#3)
-//
-void HUD_HealthArmor(void)
-{
- float marigin;
-
- vector pos, mySize, color;
- marigin = HUD_Panel_GetMarigin(3);
- pos = HUD_Panel_GetPos(3);
- mySize = HUD_Panel_GetSize(3);
- color = HUD_Panel_GetColor(3);
-
- if(HUD_Panel_GetBgActive(3))
- draw_BorderPicture(pos - '1 1 0' * marigin, "gfx/hud/border", mySize + '1 1 0' * 2 * marigin, color, hud_alpha_bg, '1 1 0' * (marigin/MARIGIN_MULTIPLIER));
-
- float armor, health, x;
- armor = getstati(STAT_ARMOR);
- health = getstati(STAT_HEALTH);
- if(cvar("_hud_configure"))
- {
- armor = 150;
- health = 100;
- }
-
- if(health <= 0)
- return;
-
- float numbers;
-
- // TODO!
- if(hud_hudselector == 2) // combined health and armor display
- {
- vector v;
- v = healtharmor_maxdamage(health, armor, armorblockpercent);
-
- vector num_pos;
- num_pos = - '96 28 0';
-
- x = floor(v_x + 1);
-
- if(v_z) // fully armored
- {
- // here, armorideal > armor
- drawpic(num_pos + '78 -4.5 0', "gfx/hud/sb_health", '32 32 0', '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
- drawpic(num_pos + '108 -4.5 0', "gfx/hud/sb_armor", '20 20 0', '1 1 1', hud_alpha_fg * armor / v_y, DRAWFLAG_NORMAL);
- }
- else
- {
- drawpic(num_pos + '108 -4.5 0', "gfx/hud/sb_health", '20 20 0', '1 1 1', hud_alpha_fg * v_y / armor, DRAWFLAG_NORMAL);
- drawpic(num_pos + '78 -4.5 0', "gfx/hud/sb_armor", '32 32 0', '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
- }
- HUD_DrawXNum_Colored(num_pos, x, 3, 24, hud_alpha_fg); // draw the combined health and armor
- }
-
- else
- {
- vector health_pos, armor_pos;
-
- // TODO!
- if (hud_hudselector == 0) { // old style layout with armor left of health
- armor_pos = pos;
- health_pos = pos + eX * 0.5 * mySize_x;
- } else {
- health_pos = pos;
- armor_pos = pos + eX * 0.5 * mySize_x;
- }
-
-
- if (mySize_x/mySize_y > 5)
- {
- // armor
- x = armor;
- numbers = strlen(ftos(x));
-
- if (x > 0)
- {
- drawpic(pos, "gfx/hud/statuhud", eX * 0.5 * mySize_x * min(1, x/200) + eY * mySize_y, HUD_Panel_GetProgressBarColor("armor"), cvar("hud_progreshud_alpha"), DRAWFLAG_NORMAL);
- if (x > 45)
- drawpic(pos, "gfx/hud/sb_armor", '1 1 0' * mySize_y, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
- else
- drawpic(pos, "gfx/hud/sb_armor", '1 1 0' * mySize_y, '1 1 1', (x+10)/55 * hud_alpha_fg, DRAWFLAG_NORMAL);
- HUD_DrawXNum_Colored(pos + eX * mySize_y + eY * 0.25 * mySize_y, x, numbers, 0.5 * mySize_y, hud_alpha_fg);
- }
-
- // health
- x = health;
- drawpic(pos + eX * mySize_x - eX * 0.5 * mySize_x * min(1, x/200), "gfx/hud/statuhud", eX * 0.5 * mySize_x * min(1, x/200) + eY * mySize_y, HUD_Panel_GetProgressBarColor("health"), cvar("hud_progreshud_alpha"), DRAWFLAG_NORMAL);
- drawpic(pos + eX * mySize_x - eX * mySize_y, "gfx/hud/sb_health", '1 1 0' * mySize_y, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
- HUD_DrawXNum_Colored(pos + eX * mySize_x - eX * 2.5 * mySize_y + eY * 0.25 * mySize_y, x, 3, 0.5 * mySize_y, hud_alpha_fg);
- }
- else if (mySize_x/mySize_y > 3.2)
- {
- // armor
- x = armor;
- numbers = strlen(ftos(x));
-
- if (x > 0)
- {
- drawpic(pos + eY * mySize_y - eY * mySize_y * min(1, x/200), "gfx/hud/statuhud", eX * 0.5 * mySize_x + eY * mySize_y * min(1, x/200), HUD_Panel_GetProgressBarColor("armor"), cvar("hud_progreshud_alpha"), DRAWFLAG_NORMAL);
- if (x > 45)
- drawpic(pos + eX * 0.4 * mySize_y, "gfx/hud/sb_armor", '0.7 0.7 0' * mySize_y, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
- else
- drawpic(pos + eX * 0.4 * mySize_y, "gfx/hud/sb_armor", '0.7 0.7 0' * mySize_y, '1 1 1', (x+10)/55 * hud_alpha_fg, DRAWFLAG_NORMAL);
- HUD_DrawXNum_Colored(pos + eY * 0.55 * mySize_y, x, numbers, 0.5 * mySize_y, hud_alpha_fg);
- }
-
- // health
- x = health;
- numbers = strlen(ftos(x));
-
- drawpic(pos + eX * 0.5 * mySize_x + eY * mySize_y - eY * mySize_y * min(1, x/200), "gfx/hud/statuhud", eX * 0.5 * mySize_x + eY * mySize_y * min(1, x/200), HUD_Panel_GetProgressBarColor("health"), cvar("hud_progreshud_alpha"), DRAWFLAG_NORMAL);
- drawpic(pos + eX * mySize_x - eX * 1.1 * mySize_y, "gfx/hud/sb_health", '0.7 0.7 0' * mySize_y, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
- HUD_DrawXNum_Colored(pos + eX * mySize_x - eX * numbers * 0.5 * mySize_y + eY * 0.55 * mySize_y, x, numbers, 0.5 * mySize_y, hud_alpha_fg);
- }
- else
- {
- // armor
- x = armor;
- numbers = strlen(ftos(x));
-
- if (x > 0)
- {
- drawpic(pos, "gfx/hud/statuhud", eX * mySize_x * min(1, x/200) + eY * 0.5 * mySize_y, HUD_Panel_GetProgressBarColor("armor"), cvar("hud_progreshud_alpha"), DRAWFLAG_NORMAL);
- if (x > 45)
- drawpic(pos, "gfx/hud/sb_armor", '0.5 0.5 0' * mySize_y, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
- else
- drawpic(pos, "gfx/hud/sb_armor", '0.5 0.5 0' * mySize_y, '1 1 1', (x+10)/55 * hud_alpha_fg, DRAWFLAG_NORMAL);
- HUD_DrawXNum_Colored(pos + eX * 0.5 * mySize_y, x, numbers, 0.5 * mySize_y, hud_alpha_fg);
- }
-
- // health
- x = health;
- numbers = strlen(ftos(x));
-
- drawpic(pos + eY * 0.5 * mySize_y, "gfx/hud/statuhud", eX * mySize_x * min(1, x/200) + eY * 0.5 * mySize_y, HUD_Panel_GetProgressBarColor("health"), cvar("hud_progreshud_alpha"), DRAWFLAG_NORMAL);
- drawpic(pos + eY * 0.5 * mySize_y, "gfx/hud/sb_health", '0.5 0.5 0' * mySize_y, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
- HUD_DrawXNum_Colored(pos + eX * 0.5 * mySize_y + eY * 0.5 * mySize_y, x, numbers, 0.5 * mySize_y, hud_alpha_fg);
- }
- }
-}
-
-// Score (#7)
-//
-void HUD_Score()
-{
- float marigin;
-
- vector pos, mySize, color;
- marigin = HUD_Panel_GetMarigin(7);
- pos = HUD_Panel_GetPos(7);
- mySize = HUD_Panel_GetSize(7);
- color = HUD_Panel_GetColor(7);
-
- if(HUD_Panel_GetBgActive(7))
- draw_BorderPicture(pos - '1 1 0' * marigin, "gfx/hud/border", mySize + '1 1 0' * 2 * marigin, color, hud_alpha_bg, '1 1 0' * (marigin/MARIGIN_MULTIPLIER));
-
- float score, distribution, leader;
- vector score_pos, secondary_score_pos, distribution_color;
- entity tm, pl, me;
- me = (spectatee_status > 0) ? playerslots[spectatee_status - 1] : playerslots[player_localentnum - 1];
-
- if (!teamplay) { // non-teamgames
- // me vector := [team/connected frags id]
- pl = players.sort_next;
- if(pl == me)
- pl = pl.sort_next;
-
- if(pl)
- distribution = me.(scores[ps_primary]) - pl.(scores[ps_primary]);
- else
- distribution = 0;
-
- score = me.(scores[ps_primary]);
-
- if(distribution >= 5) {
- distribution_color = eY;
- leader = 1;
- } else if(distribution >= 0) {
- distribution_color = '1 1 1';
- leader = 1;
- } else if(distribution >= -5)
- distribution_color = '1 1 0';
- else
- distribution_color = eX;
-
- HUD_DrawXNum(pos + eX * mySize_x - eX * 6 * 0.3 * mySize_y, distribution, 6, 3, 0.3 * mySize_y, distribution_color, 0, 0, hud_alpha_fg, DRAWFLAG_NORMAL);
- HUD_DrawXNum(pos + eX * mySize_x - eX * 6 * 0.75 * mySize_y + eY * 0.35 * mySize_y, score, 6, 0, 0.75 * mySize_y, distribution_color, leader, 0, hud_alpha_fg, DRAWFLAG_NORMAL);
- } else { // teamgames
- float max_fragcount;
- max_fragcount = -999;
-
- for(tm = teams.sort_next; tm; tm = tm.sort_next) {
- if(tm.team == COLOR_SPECTATOR || !tm.team_size) // no players? don't display
- continue;
- score = tm.(teamscores[ts_primary]);
- leader = 0;
-
- if (score > max_fragcount)
- max_fragcount = score;
-
- if(tm.team == myteam) {
- if (max_fragcount == score)
- leader = 1;
- HUD_DrawXNum(score_pos, score, 4, 0, 34, GetTeamRGB(tm.team) * 0.8, leader, 1, hud_alpha_fg, DRAWFLAG_NORMAL);
- } else {
- if (max_fragcount == score)
- leader = 1;
- HUD_DrawXNum(secondary_score_pos, score, 6, 0, 16, GetTeamRGB(tm.team) * 0.8, leader, 1, hud_alpha_fg, DRAWFLAG_NORMAL);
- secondary_score_pos = secondary_score_pos + '0 16 0';
- }
- }
- }
-}
-
-// Race timer (#8)
-//
-void HUD_RaceTimer (void) {
- float marigin;
-
- vector pos, mySize, color;
- marigin = HUD_Panel_GetMarigin(8);
- pos = HUD_Panel_GetPos(8);
- mySize = HUD_Panel_GetSize(8);
- color = HUD_Panel_GetColor(8);
-
- if(HUD_Panel_GetBgActive(8))
- draw_BorderPicture(pos - '1 1 0' * marigin, "gfx/hud/border", mySize + '1 1 0' * 2 * marigin, color, hud_alpha_bg, '1 1 0' * (marigin/MARIGIN_MULTIPLIER));
-
- drawfont = hud_bigfont;
- float a, t;
- string s, forcetime;
-
- if(race_checkpointtime)
- {
- a = bound(0, 2 - (time - race_checkpointtime), 1);
- s = "";
- forcetime = "";
- if(a > 0) // just hit a checkpoint?
- {
- if(race_checkpoint != 254)
- {
- if(race_time && race_previousbesttime)
- s = MakeRaceString(race_checkpoint, TIME_DECODE(race_time) - TIME_DECODE(race_previousbesttime), 0, 0, race_previousbestname);
- else
- s = MakeRaceString(race_checkpoint, 0, -1, 0, race_previousbestname);
- if(race_time)
- forcetime = TIME_ENCODED_TOSTRING(race_time);
- }
- }
- else
- {
- if(race_laptime && race_nextbesttime && race_nextcheckpoint != 254)
- {
- a = bound(0, 2 - ((race_laptime + TIME_DECODE(race_nextbesttime)) - (time + TIME_DECODE(race_penaltyaccumulator))), 1);
- if(a > 0) // next one?
- {
- s = MakeRaceString(race_nextcheckpoint, (time + TIME_DECODE(race_penaltyaccumulator)) - race_laptime, TIME_DECODE(race_nextbesttime), 0, race_nextbestname);
- }
- }
- }
-
- if(s != "" && a > 0)
- {
- dummyfunction(0, 0, 0, 0, 0, 0, 0, 0); // work around DP bug (set OFS_PARAM5 to 0)
- //drawcolorcodedstring(m - '0 16 0' - '8 0 0' * stringwidth(s, TRUE), s, '16 16 0', hud_alpha_fg * a, DRAWFLAG_NORMAL);
- drawcolorcodedstring(pos + eX * 0.5 * mySize_x - '0.5 0 0' * stringwidth(s, TRUE, '1 1 0' * 0.25 * mySize_y) + eY * 0.75 * mySize_y, s, '1 1 0' * 0.25 * mySize_y, hud_alpha_fg * a, DRAWFLAG_NORMAL);
- }
-
- if(race_penaltytime)
- {
- a = bound(0, 2 - (time - race_penaltyeventtime), 1);
- if(a > 0)
- {
- s = strcat("^1PENALTY: ", ftos_decimals(race_penaltytime * 0.1, 1), " (", race_penaltyreason, ")");
- dummyfunction(0, 0, 0, 0, 0, 0, 0, 0); // work around DP bug (set OFS_PARAM5 to 0)
- //drawcolorcodedstring(m - '0 32 0' - '8 0 0' * stringwidth(s, TRUE), s, '16 16 0', hud_alpha_fg * a, DRAWFLAG_NORMAL);
- drawcolorcodedstring(pos - '0 32 0' - '0.5 0 0' * stringwidth(s, TRUE, '16 16 0'), s, '16 16 0', hud_alpha_fg * a, DRAWFLAG_NORMAL);
- }
- }
-
- if(forcetime != "")
- {
- a = bound(0, (time - race_checkpointtime) / 0.5, 1);
- //drawstring_expanding(m - '16 0 0' * stringwidth(forcetime, FALSE), forcetime, '32 32 0', '1 1 1', hud_alpha_fg, 0, a);
- drawstring_expanding(pos + eX * 0.5 * mySize_x - '0.5 0 0' * stringwidth(forcetime, FALSE, '1 1 0' * 0.75 * mySize_y), forcetime, '1 1 0' * 0.75 * mySize_y, '1 1 1', hud_alpha_fg, 0, a);
- }
- else
- a = 1;
-
- if(race_laptime && race_checkpoint != 255)
- {
- s = TIME_ENCODED_TOSTRING(TIME_ENCODE(time + TIME_DECODE(race_penaltyaccumulator) - race_laptime));
- //drawstring(m - '16 0 0' * stringwidth(s, FALSE), s, '32 32 0', '1 1 1', hud_alpha_fg * a, DRAWFLAG_NORMAL);
- drawstring(pos + eX * 0.5 * mySize_x - '0.5 0 0' * stringwidth(s, FALSE, '0.75 0.75 0' * mySize_y), s, '0.75 0.75 0' * mySize_y, '1 1 1', hud_alpha_fg * a, DRAWFLAG_NORMAL);
- }
- }
- else
- {
- if(race_mycheckpointtime)
- {
- a = bound(0, 2 - (time - race_mycheckpointtime), 1);
- s = MakeRaceString(race_mycheckpoint, TIME_DECODE(race_mycheckpointdelta), -!race_mycheckpointenemy, race_mycheckpointlapsdelta, race_mycheckpointenemy);
- dummyfunction(0, 0, 0, 0, 0, 0, 0, 0); // work around DP bug (set OFS_PARAM5 to 0)
- //drawcolorcodedstring(m - '0 16 0' - '8 0 0' * stringwidth(s, TRUE), s, '16 16 0', hud_alpha_fg * a, DRAWFLAG_NORMAL);
- drawcolorcodedstring(pos - '0 16 0' - '0.5 0 0' * stringwidth(s, TRUE, '16 16 0'), s, '16 16 0', hud_alpha_fg * a, DRAWFLAG_NORMAL);
- }
- if(race_othercheckpointtime && race_othercheckpointenemy != "")
- {
- a = bound(0, 2 - (time - race_othercheckpointtime), 1);
- s = MakeRaceString(race_othercheckpoint, -TIME_DECODE(race_othercheckpointdelta), -!race_othercheckpointenemy, race_othercheckpointlapsdelta, race_othercheckpointenemy);
- dummyfunction(0, 0, 0, 0, 0, 0, 0, 0); // work around DP bug (set OFS_PARAM5 to 0)
- //drawcolorcodedstring(m - '0 0 0' - '8 0 0' * stringwidth(s, TRUE), s, '16 16 0', hud_alpha_fg * a, DRAWFLAG_NORMAL);
- drawcolorcodedstring(pos - '0 0 0' - '0.5 0 0' * stringwidth(s, TRUE, '16 16 0'), s, '16 16 0', hud_alpha_fg * a, DRAWFLAG_NORMAL);
- }
-
- if(race_penaltytime && !race_penaltyaccumulator)
- {
- t = race_penaltytime * 0.1 + race_penaltyeventtime;
- a = bound(0, (1 + t - time), 1);
- if(a > 0)
- {
- if(time < t)
- s = strcat("^1PENALTY: ", ftos_decimals(t - time, 1), " (", race_penaltyreason, ")");
- else
- s = strcat("^2PENALTY: 0.0 (", race_penaltyreason, ")");
- dummyfunction(0, 0, 0, 0, 0, 0, 0, 0); // work around DP bug (set OFS_PARAM5 to 0)
- //drawcolorcodedstring(m - '0 32 0' - '8 0 0' * stringwidth(s, TRUE), s, '16 16 0', hud_alpha_fg * a, DRAWFLAG_NORMAL);
- drawcolorcodedstring(pos - '0 32 0' - '0.5 0 0' * stringwidth(s, TRUE, '16 16 0'), s, '16 16 0', hud_alpha_fg * a, DRAWFLAG_NORMAL);
- }
- }
- }
-
- drawfont = hud_font;
-}
-
-// Notification area (#4)
-void HUD_Notify (void)
-{
- float marigin;
-
- vector pos, mySize, color;
- marigin = HUD_Panel_GetMarigin(4);
- pos = HUD_Panel_GetPos(4);
- mySize = HUD_Panel_GetSize(4);
- color = HUD_Panel_GetColor(4);
-
- if(HUD_Panel_GetBgActive(4))
- draw_BorderPicture(pos - '1 1 0' * marigin, "gfx/hud/border", mySize + '1 1 0' * 2 * marigin, color, hud_alpha_bg, '1 1 0' * (marigin/MARIGIN_MULTIPLIER));
-
- string s;
- entity tm;
- if(spectatee_status && !intermission)
- {
- drawfont = hud_bigfont;
- if(spectatee_status == -1)
- s = "^1Observing";
- else
- s = GetPlayerName(spectatee_status - 1);
- // spectated player name between HUD and chat area, aligned to the left
- pos_x = 0;
- pos_y = - 50 - hud_fontsize_spec_y;
- s = textShortenToWidth(s, vid_conwidth/2.5, hud_fontsize_spec, stringwidth_colors);
- drawcolorcodedstring(pos, s, hud_fontsize_spec, hud_alpha_fg, DRAWFLAG_NORMAL);
- drawfont = hud_font;
-
- // spectator text in the upper right corner
- if(spectatee_status == -1)
- s = strcat("^1Press ^3", getcommandkey("primary fire", "+attack"), "^1 to spectate");
- else
- s = strcat("^1Press ^3", getcommandkey("primary fire", "+attack"), "^1 for another player");
-
- if(spectatee_status == -1)
- s = strcat("^1Use ^3", getcommandkey("next weapon", "weapnext"), "^1 or ^3", getcommandkey("previous weapon", "weapprev"), "^1 to change the speed");
- else
- s = strcat("^1Press ^3", getcommandkey("secondary fire", "+attack2"), "^1 to observe");
-
- s = strcat("^1Press ^3", getcommandkey("server info", "+show_info"), "^1 for gamemode info");
-
- if(gametype == GAME_ARENA)
- s = "^1Wait for your turn to join";
- else if(gametype == GAME_LMS)
- {
- entity sk;
- sk = playerslots[player_localentnum - 1];
- if(sk.(scores[ps_primary]) >= 666)
- s = "^1Match has already begun";
- else if(sk.(scores[ps_primary]) > 0)
- s = "^1You have no more lives left";
- else
- s = strcat("^1Press ^3", getcommandkey("jump", "+jump"), "^1 to join");
- }
- else
- s = strcat("^1Press ^3", getcommandkey("jump", "+jump"), "^1 to join");
-
- //show restart countdown:
- if (time < getstatf(STAT_GAMESTARTTIME)) {
- float countdown;
- //we need to ceil, otherwise the countdown would be off by .5 when using round()
- countdown = ceil(getstatf(STAT_GAMESTARTTIME) - time);
- s = strcat("^1Game starts in ^3", ftos(countdown), "^1 seconds");
- }
- }
- if(warmup_stage && !intermission)
- {
- s = "^2Currently in ^1warmup^2 stage!";
- }
-
- // move more important stuff more to the middle so its more visible
-
- string blinkcolor;
- if(mod(time, 1) >= 0.5)
- blinkcolor = "^1";
- else
- blinkcolor = "^3";
-
- if(ready_waiting && !intermission && !spectatee_status)
- {
- if(ready_waiting_for_me)
- {
- if(warmup_stage)
- s = strcat(blinkcolor, "Press ^3", getcommandkey("ready", "ready"), blinkcolor, " to end warmup");
- else
- s = strcat(blinkcolor, "Press ^3", getcommandkey("ready", "ready"), blinkcolor, " once you are ready");
- }
- else
- {
- if(warmup_stage)
- s = strcat("^2Waiting for others to ready up to end warmup...");
- else
- s = strcat("^2Waiting for others to ready up...");
- }
- }
- else if(warmup_stage && !intermission && !spectatee_status)
- {
- s = strcat("^2Press ^3", getcommandkey("ready", "ready"), "^2 to end warmup");
- }
-
- if(teamplay && !intermission && !spectatee_status && gametype != GAME_CA && teamnagger)
- {
- float ts_min, ts_max;
- tm = teams.sort_next;
- if (tm)
- {
- for(; tm.sort_next; tm = tm.sort_next)
- {
- if(!tm.team_size || tm.team == COLOR_SPECTATOR)
- continue;
- if(!ts_min) ts_min = tm.team_size;
- else ts_min = min(ts_min, tm.team_size);
- if(!ts_max) ts_max = tm.team_size;
- else ts_max = max(ts_max, tm.team_size);
- }
- if ((ts_max - ts_min) > 1)
- {
- s = strcat(blinkcolor, "Teamnumbers are unbalanced!");
- tm = GetTeam(myteam, false);
- if (tm)
- if (tm.team != COLOR_SPECTATOR)
- if (tm.team_size == ts_max)
- s = strcat(s, " Press ^3", getcommandkey("team menu", "menu_showteamselect"), blinkcolor, " to adjust");
-
- }
- }
- }
-}
-
-// Vote window (#9)
-float vote_yescount;
-float vote_nocount;
-float vote_needed;
-float vote_highlighted; // currently selected vote
-
-float vote_active; // is there an active vote?
-float vote_prev; // previous state of vote_active to check for a change
-float vote_alpha;
-float vote_change; // "time" when vote_active changed
-
-void HUD_VoteWindow(void)
-{
- float marigin;
-
- vector pos, mySize, color;
- marigin = HUD_Panel_GetMarigin(9);
- pos = HUD_Panel_GetPos(9);
- mySize = HUD_Panel_GetSize(9);
- color = HUD_Panel_GetColor(9);
-
- string s;
- float a;
- if(vote_active != vote_prev) {
- vote_change = time;
- vote_prev = bound(0, vote_active, 1);
- }
-
- if(vote_active)
- vote_alpha = bound(0, (time - vote_change) * 2, 1);
- else
- vote_alpha = bound(0, 1 - (time - vote_change) * 2, 1);
-
- if(HUD_Panel_GetBgActive(9))
- draw_BorderPicture(pos - '1 1 0' * marigin, "gfx/hud/border", mySize + '1 1 0' * 2 * marigin, color, hud_alpha_bg * vote_alpha, '1 1 0' * (marigin/MARIGIN_MULTIPLIER));
-
- if(vote_alpha) {
- a = vote_alpha * bound(cvar_or("hud_vote_alreadyvoted_alpha", 0.75), 1 - vote_highlighted, 1);
-
- drawpic(pos, "gfx/hud/voteprogress_back", mySize, HUD_GetBgColor(), a * hud_alpha_bg, DRAWFLAG_NORMAL);
-
- s = "A vote has been called for: ";
- drawstring(pos + '0.5 0 0' * mySize_x + '0 0.1 0' * mySize_y - eX * stringwidth(s, FALSE, '1 1 0' * 0.5 * mySize_y*(1/5)), s, '1 1 0' * mySize_y*(1/5), '1 1 1', a * hud_alpha_fg, DRAWFLAG_NORMAL);
- s = textShortenToWidth(vote_called_vote, mySize_x * 0.96, '10 0 0', stringwidth_colors);
- drawcolorcodedstring(pos + '0.52 0 0' * mySize_x + '0 0.3 0' * mySize_y - eX * stringwidth(s, FALSE, '1 1 0' * 0.5 * mySize_y*(1/6)), s, '1 1 0' * mySize_y*(1/6), a * hud_alpha_fg, DRAWFLAG_NORMAL);
-
- // print the yes/no counts
- s = strcat("Yes: ", ftos(vote_yescount));
- drawstring(pos + '0 0.6 0' * mySize_y + '0.02 0 0' * mySize_x, s, '1 1 0' * mySize_y*(1/6) , eY, a * hud_alpha_fg, DRAWFLAG_NORMAL);
- s = strcat("No: ", ftos(vote_nocount));
- drawstring(pos + '0 0.6 0' * mySize_y + '0.98 0 0' * mySize_x - eX * stringwidth(s, FALSE, '1 1 0' * mySize_y*(1/6)), s, '1 1 0' * mySize_y*(1/6), eX, a * hud_alpha_fg, DRAWFLAG_NORMAL);
-
- // draw the progress bars
- drawsetcliparea(pos_x, pos_y, mySize_x * 0.5 * (vote_yescount/vote_needed), mySize_y);
- drawpic(pos, "gfx/hud/voteprogress_prog", mySize, eY, a * hud_alpha_fg, DRAWFLAG_NORMAL);
-
- drawsetcliparea(pos_x + mySize_x - mySize_x * 0.5 * (vote_nocount/vote_needed), pos_y, mySize_x * 0.5, mySize_y);
- drawpic(pos, "gfx/hud/voteprogress_prog", mySize, eX, a * hud_alpha_fg, DRAWFLAG_NORMAL);
-
- // draw the highlights
- if(vote_highlighted == 1) {
- drawsetcliparea(pos_x, pos_y, mySize_x * 0.5, mySize_y);
- drawpic(pos, "gfx/hud/voteprogress_voted", mySize, eY, a * hud_alpha_fg, DRAWFLAG_NORMAL);
- }
- else if(vote_highlighted == 2) {
- drawsetcliparea(pos_x + 0.5 * mySize_x, pos_y, mySize_x * 0.5, mySize_y);
- drawpic(pos, "gfx/hud/voteprogress_voted", mySize, eX, a * hud_alpha_fg, DRAWFLAG_NORMAL);
- }
-
- drawresetcliparea();
- }
- else if(!vote_active) {
- vote_highlighted = 0;
- }
-}
-
-// Awards system
-float race_status_time;
-float race_status_prev;
-string race_status_name_prev;
-void HUD_DrawRaceStatus(vector pos)
-{
- if (race_status != race_status_prev || race_status_name != race_status_name_prev) {
- race_status_time = time + 5;
- race_status_prev = race_status;
- if (race_status_name_prev)
- strunzone(race_status_name_prev);
- race_status_name_prev = strzone(race_status_name);
- }
-
- float a;
- a = bound(0, race_status_time - time, 1);
-
- string s;
- s = textShortenToWidth(race_status_name, 120, '10 10 0', stringwidth_colors);
-
- float rank;
- if(race_status > 0)
- rank = race_CheckName(race_status_name);
- string rankname;
- rankname = race_PlaceName(rank);
-
- if(race_status == 0)
- drawpic(pos, "gfx/hud/race/newfail", '80 80 0', '1 1 1', hud_alpha_fg * a, DRAWFLAG_NORMAL);
- else if(race_status == 1) {
- drawpic(pos, "gfx/hud/race/newtime", '80 80 0', '1 1 1', hud_alpha_fg * a, DRAWFLAG_NORMAL);
- drawcolorcodedstring(pos + '40 80 0' - eX * stringwidth(s, TRUE, '5 0 0'), s, '10 10 0', hud_alpha_fg * a, DRAWFLAG_NORMAL);
- drawstring(pos + '40 20 0' - eX * stringwidth(rankname, TRUE, '7 0 0'), rankname, '14 14 0', '1 1 1', hud_alpha_fg * a, DRAWFLAG_NORMAL);
- } else if(race_status == 2) {
- if(race_status_name == GetPlayerName(player_localentnum -1) || !race_myrank || race_myrank < rank)
- drawpic(pos, "gfx/hud/race/newrankgreen", '80 80 0', '1 1 1', hud_alpha_fg * a, DRAWFLAG_NORMAL);
- else
- drawpic(pos, "gfx/hud/race/newrankyellow", '80 80 0', '1 1 1', hud_alpha_fg * a, DRAWFLAG_NORMAL);
- drawcolorcodedstring(pos + '40 80 0' - eX * stringwidth(s, TRUE, '5 0 0'), s, '10 10 0', hud_alpha_fg * a, DRAWFLAG_NORMAL);
- drawstring(pos + '40 20 0' - eX * stringwidth(rankname, TRUE, '7 0 0'), rankname, '14 14 0', '1 1 1', hud_alpha_fg * a, DRAWFLAG_NORMAL);
- } else if(race_status == 3) {
- drawpic(pos, "gfx/hud/race/newrecordserver", '80 80 0', '1 1 1', hud_alpha_fg * a, DRAWFLAG_NORMAL);
- drawcolorcodedstring(pos + '40 80 0' - eX * stringwidth(s, TRUE, '5 0 0'), s, '10 10 0', hud_alpha_fg * a, DRAWFLAG_NORMAL);
- drawstring(pos + '40 20 0' - eX * stringwidth(rankname, TRUE, '7 0 0'), rankname, '14 14 0', '1 1 1', hud_alpha_fg * a, DRAWFLAG_NORMAL);
- }
-
- if (race_status_time - time <= 0) {
- race_status_prev = -1;
- race_status = -1;
- if(race_status_name)
- strunzone(race_status_name);
- race_status_name = string_null;
- if(race_status_name_prev)
- strunzone(race_status_name_prev);
- race_status_name_prev = string_null;
- }
-}
-
-// CTF HUD modicon section
-float redflag_prevframe, blueflag_prevframe; // status during previous frame
-float redflag_prevstatus, blueflag_prevstatus; // last remembered status
-float redflag_statuschange_time, blueflag_statuschange_time; // time when the status changed
-
-void CSQC_ctf_hudreset(void)
-{
- redflag_prevstatus = blueflag_prevstatus = redflag_prevframe = blueflag_prevframe = redflag_statuschange_time = blueflag_statuschange_time = 0;
-}
-
-void CSQC_ctf_hud(void)
-{
- vector bottomleft, redflag_pos, blueflag_pos, sz;
- float f; // every function should have that
- bottomleft_y = vid_conheight;
- bottomleft_z = 0;
-
- float redflag, blueflag; // current status
- float redflag_statuschange_elapsedtime, blueflag_statuschange_elapsedtime; // time since the status changed
- float stat_items;
-
- stat_items = getstati(STAT_ITEMS);
- redflag = (stat_items/IT_RED_FLAG_TAKEN) & 3;
- blueflag = (stat_items/IT_BLUE_FLAG_TAKEN) & 3;
-
- // when status CHANGES, set old status into prevstatus and current status into status
- if (redflag != redflag_prevframe)
- {
- redflag_statuschange_time = time;
- redflag_prevstatus = redflag_prevframe;
- redflag_prevframe = redflag;
- }
-
- if (blueflag != blueflag_prevframe)
- {
- blueflag_statuschange_time = time;
- blueflag_prevstatus = blueflag_prevframe;
- blueflag_prevframe = blueflag;
- }
-
- redflag_statuschange_elapsedtime = time - redflag_statuschange_time;
- blueflag_statuschange_elapsedtime = time - blueflag_statuschange_time;
-
- float BLINK_FACTOR = 0.15;
- float BLINK_BASE = 0.85;
- // note:
- // RMS = sqrt(BLINK_BASE^2 + 0.5 * BLINK_FACTOR^2)
- // thus
- // BLINK_BASE = sqrt(RMS^2 - 0.5 * BLINK_FACTOR^2)
- // ensure RMS == 1
- float BLINK_FREQ = 5; // circle frequency, = 2*pi*frequency in hertz
-
- string red_icon, red_icon_prevstatus;
- float red_alpha, red_alpha_prevstatus;
- red_alpha = red_alpha_prevstatus = 1;
- switch(redflag) {
- case 1: red_icon = "gfx/hud/sb_flag_red_taken"; break;
- case 2: red_icon = "gfx/hud/sb_flag_red_lost"; break;
- case 3: red_icon = "gfx/hud/sb_flag_red_carrying"; red_alpha = BLINK_BASE + BLINK_FACTOR * cos(time * BLINK_FREQ); break;
- default:
- if((stat_items & IT_CTF_SHIELDED) && (myteam == COLOR_TEAM2))
- red_icon = "gfx/hud/sb_flag_red_shielded";
- else
- red_icon = string_null;
- break;
- }
- switch(redflag_prevstatus) {
- case 1: red_icon_prevstatus = "gfx/hud/sb_flag_red_taken"; break;
- case 2: red_icon_prevstatus = "gfx/hud/sb_flag_red_lost"; break;
- case 3: red_icon_prevstatus = "gfx/hud/sb_flag_red_carrying"; red_alpha_prevstatus = BLINK_BASE + BLINK_FACTOR * cos(time * BLINK_FREQ); break;
- default:
- if(redflag == 3)
- red_icon_prevstatus = "gfx/hud/sb_flag_red_carrying"; // make it more visible
- else if((stat_items & IT_CTF_SHIELDED) && (myteam == COLOR_TEAM2))
- red_icon_prevstatus = "gfx/hud/sb_flag_red_shielded";
- else
- red_icon_prevstatus = string_null;
- break;
- }
-
- string blue_icon, blue_icon_prevstatus;
- float blue_alpha, blue_alpha_prevstatus;
- blue_alpha = blue_alpha_prevstatus = 1;
- switch(blueflag) {
- case 1: blue_icon = "gfx/hud/sb_flag_blue_taken"; break;
- case 2: blue_icon = "gfx/hud/sb_flag_blue_lost"; break;
- case 3: blue_icon = "gfx/hud/sb_flag_blue_carrying"; blue_alpha = BLINK_BASE + BLINK_FACTOR * cos(time * BLINK_FREQ); break;
- default:
- if((stat_items & IT_CTF_SHIELDED) && (myteam == COLOR_TEAM1))
- blue_icon = "gfx/hud/sb_flag_blue_shielded";
- else
- blue_icon = string_null;
- break;
- }
- switch(blueflag_prevstatus) {
- case 1: blue_icon_prevstatus = "gfx/hud/sb_flag_blue_taken"; break;
- case 2: blue_icon_prevstatus = "gfx/hud/sb_flag_blue_lost"; break;
- case 3: blue_icon_prevstatus = "gfx/hud/sb_flag_blue_carrying"; blue_alpha_prevstatus = BLINK_BASE + BLINK_FACTOR * cos(time * BLINK_FREQ); break;
- default:
- if(blueflag == 3)
- blue_icon_prevstatus = "gfx/hud/sb_flag_blue_carrying"; // make it more visible
- else if((stat_items & IT_CTF_SHIELDED) && (myteam == COLOR_TEAM1))
- blue_icon_prevstatus = "gfx/hud/sb_flag_blue_shielded";
- else
- blue_icon_prevstatus = string_null;
- break;
- }
-
- if (myteam == COLOR_TEAM1) { // always draw own flag on left
- redflag_pos = bottomleft - '-4 50 0';
- blueflag_pos = bottomleft - '-62 50 0';
- } else {
- blueflag_pos = bottomleft - '-4 50 0';
- redflag_pos = bottomleft - '-62 50 0';
- }
-
- sz = '52 52 0';
-
- f = bound(0, redflag_statuschange_elapsedtime*2, 1);
- if(red_icon_prevstatus && f < 1)
- drawpic_expanding(redflag_pos, red_icon_prevstatus, sz, '1 1 1', hud_alpha_fg * red_alpha_prevstatus, DRAWFLAG_NORMAL, f);
- if(red_icon)
- drawpic(redflag_pos, red_icon, sz, '1 1 1', hud_alpha_fg * red_alpha * f, DRAWFLAG_NORMAL);
-
- f = bound(0, blueflag_statuschange_elapsedtime*2, 1);
- if(blue_icon_prevstatus && f < 1)
- drawpic_expanding(blueflag_pos, blue_icon_prevstatus, sz, '1 1 1', hud_alpha_fg * blue_alpha_prevstatus, DRAWFLAG_NORMAL, f);
- if(blue_icon)
- drawpic(blueflag_pos, blue_icon, sz, '1 1 1', hud_alpha_fg * blue_alpha * f, DRAWFLAG_NORMAL);
-}
-
-/*void HUD_Mod_Race (void) {
- if((scores_flags[ps_primary] & SFL_TIME) && !teamplay) { // race/cts record display on HUD
- pl = players.sort_next;
- if(pl == me)
- pl = pl.sort_next;
- if(scores_flags[ps_primary] & SFL_ZERO_IS_WORST)
- if(pl.scores[ps_primary] == 0)
- pl = world;
-
- score = me.(scores[ps_primary]);
-
- float racemin, racesec, racemsec;
- float distsec, distmsec, minusplus;
-
- racemin = floor(score/(60 * TIME_FACTOR));
- racesec = floor((score - racemin*(60 * TIME_FACTOR))/TIME_FACTOR);
- racemsec = score - racemin*60*TIME_FACTOR - racesec*TIME_FACTOR;
-
- if (pl && ((!(scores_flags[ps_primary] & SFL_ZERO_IS_WORST)) || score)) {
- // distribution display
- distribution = me.(scores[ps_primary]) - pl.(scores[ps_primary]);
-
- if (distribution < TIME_FACTOR && distribution > -TIME_FACTOR)
- distmsec = fabs(distribution);
- else {
- distsec = floor(fabs(distribution)/TIME_FACTOR);
- distmsec = fabs(distribution) - distsec*TIME_FACTOR;
- if (distribution < 0)
- distsec = -distsec;
- }
-
- if (distribution <= 0) {
- distribution_color = eY;
- minusplus = 1; // minusplus 1: always prefix with minus sign
- }
- else {
- distribution_color = eX;
- minusplus = 2; // minusplus 1: always prefix with plus sign
- }
- HUD_DrawXNum(bottomright - '0 48 0' - '16 0 0' * TIME_DECIMALS, distmsec, -TIME_DECIMALS, 0, 16, distribution_color, 0, 0, hud_alpha_fg, DRAWFLAG_NORMAL);
- HUD_DrawXNum(bottomright - '68 48 0' - '16 0 0' * TIME_DECIMALS, distsec, 4, minusplus, 16, distribution_color, 0, 0, hud_alpha_fg, DRAWFLAG_NORMAL);
- drawpic(bottomright - '10 48 0' - '16 0 0' * TIME_DECIMALS, "gfx/hud/num_dot", '16 16 0', distribution_color, hud_alpha_fg, DRAWFLAG_ADDITIVE);
- }
- // race record display
- if (distribution <= 0 || distribution == score) // draw the highlight background behind the timer if we have the lead
- drawpic(bottomright - '0 32 0' - '32 0 0' * (4 + TIME_DECIMALS), "gfx/hud/sb_highlight_4", '0 28 0' + '32 0 0' * (4 + TIME_DECIMALS), '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
-
- HUD_DrawXNum(bottomright - '0 32 0' - TIME_DECIMALS * '30 0 0', racemsec, -TIME_DECIMALS, 0, 30, '1 1 1', 0, 0, hud_alpha_fg, DRAWFLAG_NORMAL);
- HUD_DrawXNum(bottomright - '0 32 0' - TIME_DECIMALS * '30 0 0' - '66 0 0', racesec, -2, 0, 30, '1 1 1', 0, 0, hud_alpha_fg, DRAWFLAG_NORMAL);
- drawpic(bottomright - '0 32 0' - TIME_DECIMALS * '30 0 0' - '18 0 0', "gfx/hud/num_dot", '30 30 0', '1 1 1', hud_alpha_fg, DRAWFLAG_ADDITIVE);
-
- HUD_DrawXNum(bottomright - '0 32 0' - TIME_DECIMALS * '30 0 0' - '132 0 0', racemin, -2, 0, 30, '1 1 1', 0, 0, hud_alpha_fg, DRAWFLAG_NORMAL);
- drawpic(bottomright - '0 32 0' - TIME_DECIMALS * '30 0 0' - '84 0 0', "gfx/hud/num_colon", '30 30 0', '1 1 1', hud_alpha_fg, DRAWFLAG_ADDITIVE);
- }
-}*/
-
-// Keyhunt HUD modicon section
-float kh_runheretime;
-
-void CSQC_kh_hudreset(void)
-{
- kh_runheretime = 0;
-}
-
-void CSQC_kh_hud(void)
-{
- float kh_keys;
- float keyteam;
- float a, aa;
- vector p, pa, kh_size, kh_asize;
-
- p_x = 6;
- p_y = vid_conheight - 34 - 3;
- p_z = 0;
-
- kh_keys = getstati(STAT_KH_KEYS);
-
- kh_size = '19 34 0';
- kh_asize = '19 10 0';
- pa = p + '0 -10 0';
-
- float i, key;
-
- float keycount;
- keycount = 0;
- for(i = 0; i < 4; ++i)
- {
- key = floor(kh_keys / pow(32, i)) & 31;
- keyteam = key - 1;
- if(keyteam == 30 && keycount <= 4)
- keycount += 4;
- if(keyteam == myteam || keyteam == -1 || keyteam == 30)
- keycount += 1;
- }
- // this yields 8 exactly if "RUN HERE" shows
-
- if(keycount == 8)
- {
- if(!kh_runheretime)
- kh_runheretime = time;
- pa_y -= fabs(sin((time - kh_runheretime) * 3.5)) * 6; // make the arrows jump in case of RUN HERE
- }
- else
- kh_runheretime = 0;
-
- for(i = 0; i < 4; ++i)
- {
- key = floor(kh_keys / pow(32, i)) & 31;
- keyteam = key - 1;
- switch(keyteam)
- {
- case 30: // my key
- keyteam = myteam;
- a = 1;
- aa = 1;
- break;
- case -1: // no key
- a = 0;
- aa = 0;
- break;
- default: // owned or dropped
- a = 0.2;
- aa = 0.5;
- break;
- }
- a = a * hud_alpha_fg;
- aa = aa * hud_alpha_fg;
- if(a > 0)
- {
- switch(keyteam)
- {
- case COLOR_TEAM1:
- drawpic (pa, "gfx/hud/sb_kh_redarrow", kh_asize, '1 1 1', aa, DRAWFLAG_NORMAL); // show 30% alpha key
- break;
- case COLOR_TEAM2:
- drawpic (pa, "gfx/hud/sb_kh_bluearrow", kh_asize, '1 1 1', aa, DRAWFLAG_NORMAL); // show 30% alpha key
- break;
- case COLOR_TEAM3:
- drawpic (pa, "gfx/hud/sb_kh_yellowarrow", kh_asize, '1 1 1', aa, DRAWFLAG_NORMAL); // show 30% alpha key
- break;
- case COLOR_TEAM4:
- drawpic (pa, "gfx/hud/sb_kh_pinkarrow", kh_asize, '1 1 1', aa, DRAWFLAG_NORMAL); // show 30% alpha key
- break;
- default:
- break;
- }
- switch(i) // YAY! switch(i) inside a for loop for i. DailyWTF, here we come!
- {
- case 0:
- drawpic (p, "gfx/hud/sb_kh_red", kh_size, '1 1 1', a, DRAWFLAG_NORMAL); // show 30% alpha key
- break;
- case 1:
- drawpic (p, "gfx/hud/sb_kh_blue", kh_size, '1 1 1', a, DRAWFLAG_NORMAL); // show 30% alpha key
- break;
- case 2:
- drawpic (p, "gfx/hud/sb_kh_yellow", kh_size, '1 1 1', a, DRAWFLAG_NORMAL); // show 30% alpha key
- break;
- case 3:
- drawpic (p, "gfx/hud/sb_kh_pink", kh_size, '1 1 1', a, DRAWFLAG_NORMAL); // show 30% alpha key
- break;
- }
- }
- p_x += 24;
- pa_x += 24;
- }
-}
-
-// Nexball HUD modicon section
-#define NBPB_SIZE '96 38 0'
-#define NBPB_BT 2 //thickness
-#define NBPB_BRGB '1 1 1'
-#define NBPB_BALPH 1 //alpha
-#define NBPB_BFLAG DRAWFLAG_NORMAL
-#define NBPB_IALPH 0.4
-#define NBPB_IFLAG DRAWFLAG_NORMAL
-#define NBPB_IRGB '0.7 0.1 0'
-
-void CSQC_nb_hud(void)
-{
- float stat_items, nb_pb_starttime, dt, p;
- vector pos;
-
- stat_items = getstati(STAT_ITEMS);
- nb_pb_starttime = getstatf(STAT_NB_METERSTART);
-
- pos_x = 4;
- pos_y = vid_conheight - 42;
- pos_z = 0;
-
- //Manage the progress bar if any
- if (nb_pb_starttime > 0)
- {
- vector s;
- dt = mod(time - nb_pb_starttime, nb_pb_period);
- // one period of positive triangle
- p = 2 * dt / nb_pb_period;
- if (p > 1)
- p = 2 - p;
-
- s = NBPB_SIZE;
- //Draw the filling
- drawfill(pos, p * s_x * eX + s_y * eY, NBPB_IRGB, NBPB_IALPH, NBPB_IFLAG);
-
- //Draw the box
- s = NBPB_SIZE;
- drawline(NBPB_BT, pos , pos + eX * s_x, NBPB_BRGB, NBPB_BALPH, NBPB_BFLAG);
- drawline(NBPB_BT, pos , pos + eY * s_y, NBPB_BRGB, NBPB_BALPH, NBPB_BFLAG);
- drawline(NBPB_BT, pos + s, pos + eX * s_x, NBPB_BRGB, NBPB_BALPH, NBPB_BFLAG);
- drawline(NBPB_BT, pos + s, pos + eY * s_y, NBPB_BRGB, NBPB_BALPH, NBPB_BFLAG);
- }
-
- pos_x += 12; //horizontal margin to the picture
- pos_y += 2; //vertical margin to the picture
-
- if (stat_items & IT_KEY1)
- drawpic(pos, "gfx/hud/sb_nexball_carrying", '80 34 0', '1 1 1', 1, DRAWFLAG_NORMAL);
-}
-
-// Race/CTS HUD modicon section
-float crecordtime_prev; // last remembered crecordtime
-float crecordtime_change_time; // time when crecordtime last changed
-float srecordtime_prev; // last remembered srecordtime
-float srecordtime_change_time; // time when srecordtime last changed
-void CSQC_race_hud(void)
-{
- entity me;
- me = playerslots[player_localentnum - 1];
- float t, score;
- float f; // yet another function has this
- score = me.(scores[ps_primary]);
-
- if not((scores_flags[ps_primary] & SFL_TIME) && !teamplay) // race/cts record display on HUD
- return; // no records in the actual race
-
- drawfont = hud_bigfont;
- vector pos;
- pos_x = 2;
- pos_y = vid_conheight - 48;
-
- // clientside personal record
- string rr;
- if(gametype == GAME_CTS)
- rr = CTS_RECORD;
- else
- rr = RACE_RECORD;
- t = stof(db_get(ClientProgsDB, strcat(shortmapname, rr, "time")));
-
- if(score && score < t || !t)
- db_put(ClientProgsDB, strcat(shortmapname, rr, "time"), ftos(score));
-
- if(t != crecordtime_prev) {
- crecordtime_prev = t;
- crecordtime_change_time = time;
- }
- f = time - crecordtime_change_time;
-
- if (f > 1) {
- drawstring(pos, "Personal best ", '10 10 0', '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
- drawstring(pos + '0 10 0', TIME_ENCODED_TOSTRING(t),'14 14 0', '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
- } else {
- drawstring(pos, "Personal best ", '10 10 0', '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
- drawstring(pos + '0 10 0', TIME_ENCODED_TOSTRING(t),'14 14 0', '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
- drawstring_expanding(pos, "Personal best ", '10 10 0', '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL, f);
- drawstring_expanding(pos + '0 10 0', TIME_ENCODED_TOSTRING(t),'14 14 0', '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL, f);
- }
-
- // server record
- pos_y += 26;
- t = race_server_record;
- if(t != srecordtime_prev) {
- srecordtime_prev = t;
- srecordtime_change_time = time;
- }
- f = time - srecordtime_change_time;
-
- if (f > 1) {
- drawstring(pos, "Server best ", '10 10 0', '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
- drawstring(pos + '0 10 0', TIME_ENCODED_TOSTRING(t),'14 14 0', '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
- } else {
- drawstring(pos, "Server best ", '10 10 0', '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
- drawstring(pos + '0 10 0', TIME_ENCODED_TOSTRING(t),'14 14 0', '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
- drawstring_expanding(pos, "Server best ", '10 10 0', '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL, f);
- drawstring_expanding(pos + '0 10 0', TIME_ENCODED_TOSTRING(t),'14 14 0', '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL, f);
- }
- drawfont = hud_font;
-}
-
-// Timer (#5)
-//
-void HUD_Timer()
-{
- float marigin;
-
- vector pos, mySize, color;
- marigin = HUD_Panel_GetMarigin(5);
- pos = HUD_Panel_GetPos(5);
- mySize = HUD_Panel_GetSize(5);
- color = HUD_Panel_GetColor(5);
-
- if(HUD_Panel_GetBgActive(5))
- draw_BorderPicture(pos - '1 1 0' * marigin, "gfx/hud/border", mySize + '1 1 0' * 2 * marigin, color, hud_alpha_bg, '1 1 0' * (marigin/MARIGIN_MULTIPLIER));
-
- float timelimit, elapsedTime, minutes, seconds, timeleft, minutesLeft, secondsLeft;
-
- timelimit = getstatf(STAT_TIMELIMIT);
-
- HUD_DrawRaceStatus(pos + '0 30 0');
-
- timeleft = max(0, timelimit * 60 + getstatf(STAT_GAMESTARTTIME) - time);
- timeleft = ceil(timeleft);
- minutesLeft = floor(timeleft / 60);
- secondsLeft = timeleft - minutesLeft*60;
-
- vector timer_color;
- if(minutesLeft >= 5 || warmup_stage || timelimit == 0) //don't use red or yellow in warmup or when there is no timelimit
- timer_color = '1 1 1'; //white
- else if(minutesLeft >= 1)
- timer_color = '1 1 0'; //yellow
- else
- timer_color = '1 0 0'; //red
-
- if (cvar("hud_timer_increment") || timelimit == 0 || warmup_stage) {
- if (time < getstatf(STAT_GAMESTARTTIME)) {
- //while restart is still active, show 00:00
- minutes = seconds = 0;
- } else {
- elapsedTime = floor(time - getstatf(STAT_GAMESTARTTIME)); //127
- minutes = floor(elapsedTime / 60);
- seconds = elapsedTime - minutes*60;
- }
- } else {
- minutes = minutesLeft;
- seconds = secondsLeft;
- }
-
- if(mySize_x/mySize_y > 5.1)
- {
- if(minutes > 999)
- seconds = 99;
- minutes = min(minutes, 999);
- if(minutesLeft >= 1 || cvar("hud_timer_increment") || timelimit == 0 || warmup_stage) {
- if(minutes < 100)
- drawpic(pos + eX * mySize_x - eX * 5.1 * mySize_y, "gfx/hud/sb_timer", '1 1 0' * mySize_y, timer_color, hud_alpha_fg, DRAWFLAG_NORMAL);
- HUD_DrawXNum(pos + eX * mySize_x - eX * 5.1 * mySize_y, minutes, 3, 0, mySize_y, timer_color, 0, 0, hud_alpha_fg, DRAWFLAG_NORMAL);
- drawpic(pos + eX * mySize_x - eX * 2.57 * mySize_y, "gfx/hud/num_colon", '1 1 0' * mySize_y, timer_color, hud_alpha_fg, DRAWFLAG_NORMAL);
- }
- HUD_DrawXNum(pos + eX * mySize_x - eX * 2 * mySize_y, seconds, -2, 0, mySize_y, timer_color, 0, 0, hud_alpha_fg, DRAWFLAG_NORMAL);
- }
- else
- {
- if(minutes > 99)
- seconds = 99;
- minutes = min(minutes, 99);
- if(minutesLeft >= 1 || cvar("hud_timer_increment") || timelimit == 0 || warmup_stage) {
- if(minutes < 100)
- drawpic(pos + eX * 0.5 * mySize_x - eX * 0.5 * 0.5 * mySize_y, "gfx/hud/sb_timer", '0.5 0.5 0' * mySize_y, timer_color, hud_alpha_fg, DRAWFLAG_NORMAL);
- HUD_DrawXNum(pos + eX * 0.5 * mySize_x - eX * mySize_y + eY * 0.5 * mySize_y, minutes, -2, 0, 0.5 * mySize_y, timer_color, 0, 0, hud_alpha_fg, DRAWFLAG_NORMAL);
- drawpic(pos + eX * 0.5 * mySize_x - eX * 0.5 * 0.5 * mySize_y + eY * 0.5 * mySize_y, "gfx/hud/num_colon", '0.5 0.5 0' * mySize_y, timer_color, hud_alpha_fg, DRAWFLAG_NORMAL);
- }
- HUD_DrawXNum(pos + eX * 0.51 * mySize_x + eY * 0.5 * mySize_y, seconds, -2, 0, 0.5 * mySize_y, timer_color, 0, 0, hud_alpha_fg, DRAWFLAG_NORMAL);
- }
-}
-
-// Radar (#6)
-//
-
-void HUD_Radar(void)
-{
- float marigin;
-
- vector pos, mySize, color;
- marigin = HUD_Panel_GetMarigin(6);
- pos = HUD_Panel_GetPos(6);
- mySize = HUD_Panel_GetSize(6);
- color = HUD_Panel_GetColor(6);
-
- if(HUD_Panel_GetBgActive(6))
- draw_BorderPicture(pos - '1 1 0' * marigin, "gfx/hud/border", mySize + '1 1 0' * 2 * marigin, color, hud_alpha_bg, '1 1 0' * (marigin/MARIGIN_MULTIPLIER));
-
- local float color1, color2; // color already declared as a global in hud.qc
- local vector rgb;
- local entity tm;
- float scale2d, normalsize, bigsize;
- float f;
-
- teamradar_origin2d = pos + 0.5 * mySize; // TODO: stupid compat, should be removed
- teamradar_size2d = mySize;
-
- if(minimapname == "" && !ons_showmap)
- return;
-
- teamradar_loadcvars();
-
- switch(cl_teamradar_zoommode)
- {
- default:
- case 0:
- f = current_zoomfraction;
- break;
- case 1:
- f = 1 - current_zoomfraction;
- break;
- case 2:
- f = 0;
- break;
- case 3:
- f = 1;
- break;
- }
-
- switch(cl_teamradar_rotation)
- {
- case 0:
- teamradar_angle = view_angles_y - 90;
- break;
- default:
- teamradar_angle = 90 * cl_teamradar_rotation;
- break;
- }
-
- scale2d = vlen_maxnorm2d(mi_picmax - mi_picmin);
- teamradar_size2d = mySize;
-
- teamradar_extraclip_mins = teamradar_extraclip_maxs = '0 0 0';
- if(pos == eX * vid_conwidth)
- {
- if(cl_teamradar_nohudhack < 2)
- pos_y += 25;
- if(cl_teamradar_nohudhack < 1)
- teamradar_extraclip_mins_y -= 25;
- }
- else if(pos == eY * vid_conheight || pos == eX * vid_conwidth + eY * vid_conheight)
- {
- if(cl_teamradar_nohudhack < 2)
- pos_y -= 50;
- //if(cl_teamradar_nohudhack < 1)
- //teamradar_extraclip_size_y += 50; // don't, the HUD looks nice
- }
-
- // pixels per world qu to match the teamradar_size2d_x range in the longest dimension
- if(cl_teamradar_rotation == 0)
- {
- // max-min distance must fit the radar in any rotation
- bigsize = vlen_minnorm2d(teamradar_size2d) * scale2d / (1.05 * vlen2d(mi_max - mi_min));
- }
- else
- {
- vector c0, c1, c2, c3, span;
- c0 = rotate(mi_min, teamradar_angle * DEG2RAD);
- c1 = rotate(mi_max, teamradar_angle * DEG2RAD);
- c2 = rotate('1 0 0' * mi_min_x + '0 1 0' * mi_max_y, teamradar_angle * DEG2RAD);
- c3 = rotate('1 0 0' * mi_max_x + '0 1 0' * mi_min_y, teamradar_angle * DEG2RAD);
- span = '0 0 0';
- span_x = max4(c0_x, c1_x, c2_x, c3_x) - min4(c0_x, c1_x, c2_x, c3_x);
- span_y = max4(c0_y, c1_y, c2_y, c3_y) - min4(c0_y, c1_y, c2_y, c3_y);
-
- // max-min distance must fit the radar in x=x, y=y
- bigsize = min(
- teamradar_size2d_x * scale2d / (1.05 * span_x),
- teamradar_size2d_y * scale2d / (1.05 * span_y)
- );
- }
-
- normalsize = vlen_maxnorm2d(teamradar_size2d) * scale2d / cl_teamradar_scale;
- if(bigsize > normalsize)
- normalsize = bigsize;
-
- teamradar_size =
- f * bigsize
- + (1 - f) * normalsize;
- teamradar_origin3d_in_texcoord = teamradar_3dcoord_to_texcoord(
- f * (mi_min + mi_max) * 0.5
- + (1 - f) * view_origin);
-
- color1 = GetPlayerColor(player_localentnum-1);
- rgb = GetTeamRGB(color1);
-
- drawsetcliparea(
- pos_x,
- pos_y,
- pos_x + mySize_x,
- pos_y + mySize_y
- );
-
- draw_teamradar_background(cl_teamradar_background_alpha, cl_teamradar_foreground_alpha);
-
- if(ons_showmap)
- {
- drawresetcliparea();
-
- vector frame_origin, frame_size;
- frame_origin = frame_size = '0 0 0';
-
- frame_origin_x = pos_x - teamradar_size2d_x * 0.55859375; // matches the picture
- frame_origin_y = pos_y - teamradar_size2d_y * 0.55859375; // matches the picture
- frame_size_x = pos_x * 1.1171875; // matches the picture
- frame_size_y = pos_y * 1.1171875; // matches the picture
- drawpic(frame_origin, "gfx/ons-frame.tga", frame_size, '1 1 1', hud_alpha_fg, 0);
- drawpic(frame_origin, "gfx/ons-frame-team.tga", frame_size, rgb, hud_alpha_fg, 0);
-
- drawsetcliparea(
- pos_x - teamradar_size2d_x * 0.5,
- pos_y - teamradar_size2d_y * 0.5,
- teamradar_size2d_x,
- teamradar_size2d_y
- );
- }
-
- for(tm = world; (tm = find(tm, classname, "radarlink")); )
- draw_teamradar_link(tm.origin, tm.velocity, tm.team);
- for(tm = world; (tm = findflags(tm, teamradar_icon, 0xFFFFFF)); )
- draw_teamradar_icon(tm.origin, tm.teamradar_icon, tm, tm.teamradar_color, hud_alpha_fg);
- for(tm = world; (tm = find(tm, classname, "entcs_receiver")); )
- {
- color2 = GetPlayerColor(tm.sv_entnum);
- //if(color == COLOR_SPECTATOR || color == color2)
- draw_teamradar_player(tm.origin, tm.angles, GetTeamRGB(color2));
- }
- draw_teamradar_player(view_origin, view_angles, '1 1 1');
-
- drawresetcliparea();
-};
-
-/*
-==================
-Main HUD system
-==================
-*/
-
-void HUD_DrawPressedKeys(void)
-{
- float marigin;
-
- vector pos, mySize, color;
- marigin = HUD_Panel_GetMarigin(10);
- pos = HUD_Panel_GetPos(10);
- mySize = HUD_Panel_GetSize(10);
- color = HUD_Panel_GetColor(10);
-
- if(HUD_Panel_GetBgActive(10))
- draw_BorderPicture(pos - '1 1 0' * marigin, "gfx/hud/border", mySize + '1 1 0' * 2 * marigin, color, hud_alpha_bg, '1 1 0' * (marigin/MARIGIN_MULTIPLIER));
-
- float pressedkeys;
-
- pressedkeys = getstatf(STAT_PRESSED_KEYS);
- drawpic(pos, "gfx/hud/keys/key_bg.tga", mySize, '1 1 1', 0.1 * hud_alpha_fg, DRAWFLAG_NORMAL);
- drawpic(pos + eX * mySize_x - eX * 0.22 * mySize_x + eY * 0.195 * mySize_y, ((pressedkeys & KEY_CROUCH) ? "gfx/hud/keys/key_crouch_inv.tga" : "gfx/hud/keys/key_crouch.tga"), '1 1 0' * (1/3) * mySize_y, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
- drawpic(pos + eX * 0.5 * mySize_x - eX * 0.23 * mySize_y + eY * 0.040 * mySize_y, ((pressedkeys & KEY_FORWARD) ? "gfx/hud/keys/key_forward_inv.tga" : "gfx/hud/keys/key_forward.tga"), '1 1 0' * 0.46 * mySize_y, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
- drawpic(pos + eX * 0.023 * mySize_x + eY * 0.195 * mySize_y, ((pressedkeys & KEY_JUMP) ? "gfx/hud/keys/key_jump_inv.tga" : "gfx/hud/keys/key_jump.tga"), '1 1 0' * (1/3) * mySize_y, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
- drawpic(pos + eX * 0.1 * mySize_x + eY * 0.486 * mySize_y, ((pressedkeys & KEY_LEFT) ? "gfx/hud/keys/key_left_inv.tga" : "gfx/hud/keys/key_left.tga"), '1 1 0' * 0.46 * mySize_y, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
- drawpic(pos + eX * 0.5 * mySize_x - eX * 0.23 * mySize_y + eY * 0.486 * mySize_y, ((pressedkeys & KEY_BACKWARD) ? "gfx/hud/keys/key_backward_inv.tga" : "gfx/hud/keys/key_backward.tga"), '1 1 0' * 0.46 * mySize_y, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
- drawpic(pos + eX * mySize_x - eX * 0.372 * mySize_x + eY * 0.486 * mySize_y, ((pressedkeys & KEY_RIGHT) ? "gfx/hud/keys/key_right_inv.tga" : "gfx/hud/keys/key_right.tga"), '1 1 0' * 0.46 * mySize_y, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
-}
-
-void HUD_ShowSpeed(void)
-{
- vector numsize;
- float pos, conversion_factor;
- string speed, zspeed, unit;
-
- switch(cvar("cl_showspeed_unit"))
- {
- default:
- case 0:
- unit = "";
- conversion_factor = 1.0;
- break;
- case 1:
- unit = " qu/s";
- conversion_factor = 1.0;
- break;
- case 2:
- unit = " m/s";
- conversion_factor = 0.0254;
- break;
- case 3:
- unit = " km/h";
- conversion_factor = 0.0254 * 3.6;
- break;
- case 4:
- unit = " mph";
- conversion_factor = 0.0254 * 3.6 * 0.6213711922;
- break;
- case 5:
- unit = " knots";
- conversion_factor = 0.0254 * 1.943844492; // 1 m/s = 1.943844492 knots, because 1 knot = 1.852 km/h
- break;
- }
-
- speed = strcat(ftos(floor( vlen(pmove_vel - pmove_vel_z * '0 0 1') * conversion_factor + 0.5 )), unit);
-
- numsize_x = numsize_y = cvar("cl_showspeed_size");
- pos = (vid_conheight - numsize_y) * cvar("cl_showspeed_position");
-
- drawfont = hud_bigfont;
- drawstringcenter(eX + pos * eY, speed, numsize, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
-
- if (cvar("cl_showspeed_z") == 1) {
- zspeed = strcat(ftos(fabs(floor( pmove_vel_z * conversion_factor + 0.5 ))), unit);
- drawstringcenter(eX + pos * eY + numsize_y * eY, zspeed, numsize * 0.5, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
- }
-
- drawfont = hud_font;
-}
-
-vector acc_prevspeed;
-float acc_prevtime;
-float acc_avg;
-
-void HUD_ShowAcceleration(void)
-{
- float acceleration, sz, scale, alpha, f;
- vector pos, top, rgb;
- top_x = vid_conwidth/2;
- top_y = 0;
-
- f = time - acc_prevtime;
- if(cvar("cl_showacceleration_z"))
- acceleration = (vlen(pmove_vel) - vlen(acc_prevspeed)) * (1 / f);
- else
- acceleration = (vlen(pmove_vel - '0 0 1' * pmove_vel_z) - vlen(acc_prevspeed - '0 0 1' * acc_prevspeed_z)) * (1 / f);
- acc_prevspeed = pmove_vel;
- acc_prevtime = time;
-
- f = bound(0, f * 10, 1);
- acc_avg = acc_avg * (1 - f) + acceleration * f;
- acceleration = acc_avg / getstatf(STAT_MOVEVARS_MAXSPEED);
-
- pos = top - sz/2 * eY + (cvar("cl_showacceleration_position") * vid_conheight) * eY;
-
- sz = cvar("cl_showacceleration_size");
- scale = cvar("cl_showacceleration_scale");
- alpha = cvar("cl_showacceleration_alpha");
- if (cvar("cl_showacceleration_color_custom"))
- rgb = stov(cvar_string("cl_showacceleration_color"));
- else {
- rgb = '1 1 1';
- if (acceleration < 0) {
- rgb = '1 .5 .5' - '0 .5 .5' * bound(0, -acceleration * 0.2, 1);
- } else if (acceleration > 0) {
- rgb = '.5 1 .5' - '.5 0 .5' * bound(0, +acceleration * 0.2, 1);
- }
- }
-
- if (acceleration > 0)
- drawpic(pos, "gfx/hud/statuhud", acceleration * scale * '40 0 0' + sz * eY, rgb, alpha * hud_alpha_fg, DRAWFLAG_NORMAL);
- else if (acceleration < 0)
- drawpic(pos + acceleration * scale * '40 0 0', "gfx/hud/statuhud", -acceleration * scale * '40 0 0' + sz * eY, rgb, alpha * hud_alpha_fg, DRAWFLAG_NORMAL);
-}
-
-void HUD_Reset (void)
-{
- // reset gametype specific icons
- if(gametype == GAME_KEYHUNT)
- CSQC_kh_hudreset();
- else if(gametype == GAME_CTF)
- CSQC_ctf_hudreset();
-}
-
-void HUD_Main (void)
-{
- hud_alpha_bg = cvar_or("hud_alpha_bg", 0.8) * (1 - cvar("_menu_alpha"));
- hud_border_thickness = bound(0, cvar("hud_border_thickness"), 5);
- hud_accuracy_border_thickness = bound(0, cvar_or("hud_accuracy_border_thickness", 1), 5);
- hud_color_bg_team = cvar("hud_color_bg_team");
-
- hud_fontsize = HUD_GetFontsize("hud_fontsize");
- hud_fontsize_spec = HUD_GetFontsize("hud_fontsize_spec");
-
- if(HUD_Panel_CheckActive(0))
- HUD_WeaponIcons();
- if(HUD_Panel_CheckActive(1))
- HUD_Inventory();
- if(HUD_Panel_CheckActive(2))
- HUD_Powerups();
- if(HUD_Panel_CheckActive(3))
- HUD_HealthArmor();
- if(HUD_Panel_CheckActive(4))
- HUD_Notify();
- if(HUD_Panel_CheckActive(5))
- HUD_Timer();
- if(HUD_Panel_CheckActive(6))
- if(ons_showmap || cvar_string("cl_teamradar") != "0" && (cvar("cl_teamradar") == 2 || teamplay))
- HUD_Radar();
- if(HUD_Panel_CheckActive(7))
- HUD_Score();
- if(HUD_Panel_CheckActive(8))
- if(gametype == GAME_RACE || gametype == GAME_CTS || cvar("_hud_configure"))
- HUD_RaceTimer();
- if(HUD_Panel_CheckActive(9))
- HUD_VoteWindow();
- if(HUD_Panel_CheckActive(10))
- if(spectatee_status > 0 || cvar("cl_showpressedkeys") >= 2 || cvar("_hud_configure"))
- HUD_DrawPressedKeys();
-
- // TODO hud_'ify these
- if (cvar("cl_showspeed"))
- HUD_ShowSpeed();
- if (cvar("cl_showacceleration"))
- HUD_ShowAcceleration();
-
- // TODO... well make them work in a panel etc
- if(gametype == GAME_KEYHUNT)
- CSQC_kh_hud();
- else if(gametype == GAME_CTF)
- CSQC_ctf_hud();
- else if(gametype == GAME_NEXBALL)
- CSQC_nb_hud();
- else if(gametype == GAME_CTS || gametype == GAME_RACE)
- CSQC_race_hud();
- return;
-}
-void CSQC_kh_hudreset();
-void CSQC_kh_hud();
-void CSQC_ctf_hudreset();
-void CSQC_ctf_hud();
-void CSQC_nb_hud();
-void CSQC_race_hud();
+vector mousepos;
+vector panel_click_distance; // mouse cursor distance from the top left corner of the panel (saved only upon a click)
+vector panel_click_resizeorigin; // coordinates for opposite point when resizing
+float resizeCorner; // 1 = topleft, 2 = topright, 3 = bottomleft, 4 = bottomright
+float highlightedPanel;
+float highlightedAction; // 0 = nothing, 1 = move, 2 = resize
+
const float BORDER_MULTIPLIER = 0.25;
float hud_color_bg_team;
float scoreboard_bottom;
float weapontime;
float teamnagger;
-float hud_alpha_fg;
-float hud_alpha_bg;
-float hud_hudselector;
+float hud_fg_alpha;
float hud_accuracy_hud;
float hud_border_thickness;
float hud_accuracy_border_thickness;
+
+float hud_configure;
+
+float disable_menu_alphacheck; // 0 = enable alpha check, 1 = disable for entire hud, 2 = disable for one panel
+float menu_fade_alpha;
vector mi_scale;
// Minimap
string minimapname;
-float ons_showmap;
// --------------------------------------------------------------------------
// General stuff
MapVote_DrawAbstain(pos, isize, xmax - xmin, tmp, i);
}
- drawpic(mv_mousepos, strcat("gfx/menu/", cvar_string("menu_skin"), "/cursor.tga"), '32 32 0', '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
+ drawpic(mv_mousepos, strcat("gfx/menu/", cvar_string("menu_skin"), "/cursor.tga"), '32 32 0', '1 1 1', hud_fg_alpha, DRAWFLAG_NORMAL);
}
void Cmd_MapVote_MapDownload(float argc)
precache_sound ("misc/invshot.wav");
- registercmd("+showscores");
- registercmd("-showscores");
-
mv_active = 1;
mv_mousepos = '0.5 0 0' * vid_conwidth + '0 0.5 0' * vid_conheight;
../common/gamecommand.qc
../common/mapinfo.qc
../common/items.qc
+../server/w_all.qc
../warpzonelib/anglestransform.qc
../warpzonelib/mathlib.qc
if(self.count & 0x80)
{
//self.move_flags &~= FL_ONGROUND;
- Movetype_Physics_MatchServer(autocvar_cl_projectiles_sloppy);
+ if(self.move_movetype == MOVETYPE_NONE || self.move_movetype == MOVETYPE_FLY)
+ Movetype_Physics_NoMatchServer();
+ // the trivial movetypes do not have to match the
+ // server's ticrate as they are ticrate independent
+ // NOTE: this assumption is only true if MOVETYPE_FLY
+ // projectiles detonate on impact. If they continue
+ // moving, we might still be ticrate dependent.
+ else
+ Movetype_Physics_MatchServer(autocvar_cl_projectiles_sloppy);
if(!(self.move_flags & FL_ONGROUND))
self.angles = vectoangles(self.velocity);
}
-float sb_alpha_bg;
-float sb_alpha_fg;
-float sb_highlight;
-float sb_highlight_alpha;
-float sb_highlight_alpha_self;
-float sb_alpha_name;
-float sb_alpha_name_self;
+float scoreboard_alpha_bg;
+float scoreboard_alpha_fg;
+float scoreboard_highlight;
+float scoreboard_highlight_alpha;
+float scoreboard_highlight_alpha_self;
+float scoreboard_alpha_name;
+float scoreboard_alpha_name_self;
void drawstringright(vector, string, vector, vector, float, float);
void drawstringcenter(vector, string, vector, vector, float, float);
pos_y = 16;
pos_z = 0;*/
- //drawpic(pos, "gfx/finale", '0 0 0', '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
+ //drawpic(pos, "gfx/finale", '0 0 0', '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
//drawstring(pos, "END", hud_fontsize, '1 1 1', 1, DRAWFLAG_NORMAL);
MapVote_Draw();
void Cmd_HUD_Help(float argc)
{
- print("You can modify the scoreboard using the ^2hud_columns_set command.\n");
+ print("You can modify the scoreboard using the ^2scoreboard_columns_set command.\n");
print("^3|---------------------------------------------------------------|\n");
print("Usage:\n");
- print("^2hud_columns_set default\n");
- print("^2hud_columns_set ^7filed1 field2 ...\n");
+ print("^2scoreboard_columns_set default\n");
+ print("^2scoreboard_columns_set ^7filed1 field2 ...\n");
print("The following field names are recognized (case insensitive):\n");
print("You can use a ^3|^7 to start the right-aligned fields.\n\n");
print("The special game type names 'teams' and 'noteams' can be used to\n");
print("include/exclude ALL teams/noteams game modes.\n\n");
- print("Example: hud_columns_set name ping pl | +ctf/field3 -dm/field4\n");
+ print("Example: scoreboard_columns_set name ping pl | +ctf/field3 -dm/field4\n");
print("will display name, ping and pl aligned to the left, and the fields\n");
print("right of the vertical bar aligned to the right.\n");
print("'field3' will only be shown in CTF, and 'field4' will be shown in all\n");
// TODO: re enable with gametype dependant cvars?
if(argc < 2) // no arguments provided
- argc = tokenizebyseparator(strcat("x ", cvar_string("hud_columns")), " ");
+ argc = tokenizebyseparator(strcat("x ", cvar_string("scoreboard_columns")), " ");
if(argc < 2)
argc = tokenizebyseparator(strcat("x ", HUD_DefaultColumnLayout()), " ");
case SP_NAME:
if(ready_waiting && pl.ready)
{
- hud_field_icon0 = "gfx/sb_player_ready";
+ hud_field_icon0 = "gfx/scoreboard/player_ready";
}
else if(!teamplay)
{
f = stof(getplayerkey(pl.sv_entnum, "colors"));
{
- hud_field_icon0 = "gfx/sb_playercolor_base";
- hud_field_icon1 = "gfx/sb_playercolor_shirt";
+ hud_field_icon0 = "gfx/scoreboard/playercolor_base";
+ hud_field_icon1 = "gfx/scoreboard/playercolor_shirt";
hud_field_icon1_rgb = colormapPaletteColor(floor(f / 16), 0);
- hud_field_icon2 = "gfx/sb_playercolor_pants";
+ hud_field_icon2 = "gfx/scoreboard/playercolor_pants";
hud_field_icon2_rgb = colormapPaletteColor(mod(f, 16), 1);
}
}
is_spec = (GetPlayerColor(pl.sv_entnum) == COLOR_SPECTATOR);
if((rgb == '1 1 1') && (!is_spec)) {
- rgb_x = cvar("hud_color_bg_r") + 0.5;
- rgb_y = cvar("hud_color_bg_g") + 0.5;
- rgb_z = cvar("hud_color_bg_b") + 0.5; }
+ rgb_x = cvar("scoreboard_color_bg_r") + 0.5;
+ rgb_y = cvar("scoreboard_color_bg_g") + 0.5;
+ rgb_z = cvar("scoreboard_color_bg_b") + 0.5; }
// Layout:
tmp_x = sbwidth;
// alternated rows highlighting
if(is_self)
- drawfill(pos - '1 1 0', tmp + '2 0 0', rgb, sb_highlight_alpha_self, DRAWFLAG_NORMAL);
- else if((sb_highlight) && (!mod(pl_number,2)))
- drawfill(pos - '1 1 0', tmp + '2 0 0', rgb, sb_highlight_alpha, DRAWFLAG_NORMAL);
+ drawfill(pos - '1 1 0', tmp + '2 0 0', rgb, scoreboard_highlight_alpha_self, DRAWFLAG_NORMAL);
+ else if((scoreboard_highlight) && (!mod(pl_number,2)))
+ drawfill(pos - '1 1 0', tmp + '2 0 0', rgb, scoreboard_highlight_alpha, DRAWFLAG_NORMAL);
tmp_y = 0;
if(field == SP_NAME) {
tmp_x = hud_size[i] - hud_fontsize_x*hud_fixscoreboardcolumnwidth_iconlen - hud_fixscoreboardcolumnwidth_marginlen + hud_fontsize_x;
if (is_self)
- drawcolorcodedstring(pos - tmp, str, hud_fontsize, sb_alpha_name_self, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos - tmp, str, hud_fontsize, scoreboard_alpha_name_self, DRAWFLAG_NORMAL);
else
- drawcolorcodedstring(pos - tmp, str, hud_fontsize, sb_alpha_name, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos - tmp, str, hud_fontsize, scoreboard_alpha_name, DRAWFLAG_NORMAL);
} else {
tmp_x = hud_fixscoreboardcolumnwidth_len + hud_fontsize_x;
if (is_self)
- drawstring(pos - tmp, str, hud_fontsize, hud_field_rgb, sb_alpha_name_self, DRAWFLAG_NORMAL);
+ drawstring(pos - tmp, str, hud_fontsize, hud_field_rgb, scoreboard_alpha_name_self, DRAWFLAG_NORMAL);
else
- drawstring(pos - tmp, str, hud_fontsize, hud_field_rgb, sb_alpha_name, DRAWFLAG_NORMAL);
+ drawstring(pos - tmp, str, hud_fontsize, hud_field_rgb, scoreboard_alpha_name, DRAWFLAG_NORMAL);
}
tmp_x = hud_size[i] + hud_fontsize_x;
if(hud_field_icon0 != "")
if (is_self)
- drawpic(pos - tmp, hud_field_icon0, '0 1 0' * hud_fontsize_y + '1 0 0' * hud_fontsize_x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon1_rgb, hud_field_icon0_alpha * sb_alpha_name_self, DRAWFLAG_NORMAL);
+ drawpic(pos - tmp, hud_field_icon0, '0 1 0' * hud_fontsize_y + '1 0 0' * hud_fontsize_x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon1_rgb, hud_field_icon0_alpha * scoreboard_alpha_name_self, DRAWFLAG_NORMAL);
else
- drawpic(pos - tmp, hud_field_icon0, '0 1 0' * hud_fontsize_y + '1 0 0' * hud_fontsize_x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon1_rgb, hud_field_icon0_alpha * sb_alpha_name, DRAWFLAG_NORMAL);
+ drawpic(pos - tmp, hud_field_icon0, '0 1 0' * hud_fontsize_y + '1 0 0' * hud_fontsize_x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon1_rgb, hud_field_icon0_alpha * scoreboard_alpha_name, DRAWFLAG_NORMAL);
if(hud_field_icon1 != "")
if (is_self)
- drawpic(pos - tmp, hud_field_icon1, '0 1 0' * hud_fontsize_y + '1 0 0' * hud_fontsize_x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon1_rgb, hud_field_icon1_alpha * sb_alpha_name_self, DRAWFLAG_NORMAL);
+ drawpic(pos - tmp, hud_field_icon1, '0 1 0' * hud_fontsize_y + '1 0 0' * hud_fontsize_x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon1_rgb, hud_field_icon1_alpha * scoreboard_alpha_name_self, DRAWFLAG_NORMAL);
else
- drawpic(pos - tmp, hud_field_icon1, '0 1 0' * hud_fontsize_y + '1 0 0' * hud_fontsize_x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon1_rgb, hud_field_icon1_alpha * sb_alpha_name, DRAWFLAG_NORMAL);
+ drawpic(pos - tmp, hud_field_icon1, '0 1 0' * hud_fontsize_y + '1 0 0' * hud_fontsize_x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon1_rgb, hud_field_icon1_alpha * scoreboard_alpha_name, DRAWFLAG_NORMAL);
if(hud_field_icon2 != "")
if (is_self)
- drawpic(pos - tmp, hud_field_icon2, '0 1 0' * hud_fontsize_y + '1 0 0' * hud_fontsize_x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon2_rgb, hud_field_icon2_alpha * sb_alpha_name_self, DRAWFLAG_NORMAL);
+ drawpic(pos - tmp, hud_field_icon2, '0 1 0' * hud_fontsize_y + '1 0 0' * hud_fontsize_x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon2_rgb, hud_field_icon2_alpha * scoreboard_alpha_name_self, DRAWFLAG_NORMAL);
else
- drawpic(pos - tmp, hud_field_icon2, '0 1 0' * hud_fontsize_y + '1 0 0' * hud_fontsize_x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon2_rgb, hud_field_icon2_alpha * sb_alpha_name, DRAWFLAG_NORMAL);
+ drawpic(pos - tmp, hud_field_icon2, '0 1 0' * hud_fontsize_y + '1 0 0' * hud_fontsize_x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon2_rgb, hud_field_icon2_alpha * scoreboard_alpha_name, DRAWFLAG_NORMAL);
}
if(hud_field[i] == SP_SEPARATOR)
if(field == SP_NAME) {
tmp_x = hud_fixscoreboardcolumnwidth_len; // left or right aligned? let's put it right...
if(is_self)
- drawcolorcodedstring(pos - tmp, str, hud_fontsize, sb_alpha_name_self, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos - tmp, str, hud_fontsize, scoreboard_alpha_name_self, DRAWFLAG_NORMAL);
else
- drawcolorcodedstring(pos - tmp, str, hud_fontsize, sb_alpha_name, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos - tmp, str, hud_fontsize, scoreboard_alpha_name, DRAWFLAG_NORMAL);
} else {
tmp_x = hud_fixscoreboardcolumnwidth_len;
if(is_self)
- drawstring(pos - tmp, str, hud_fontsize, hud_field_rgb, sb_alpha_name_self, DRAWFLAG_NORMAL);
+ drawstring(pos - tmp, str, hud_fontsize, hud_field_rgb, scoreboard_alpha_name_self, DRAWFLAG_NORMAL);
else
- drawstring(pos - tmp, str, hud_fontsize, hud_field_rgb, sb_alpha_name, DRAWFLAG_NORMAL);
+ drawstring(pos - tmp, str, hud_fontsize, hud_field_rgb, scoreboard_alpha_name, DRAWFLAG_NORMAL);
}
tmp_x = hud_size[i];
if(hud_field_icon0 != "")
if (is_self)
- drawpic(pos - tmp, hud_field_icon0, '0 1 0' * hud_fontsize_y + '1 0 0' * hud_fontsize_x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon1_rgb, hud_field_icon0_alpha * sb_alpha_name_self, DRAWFLAG_NORMAL);
+ drawpic(pos - tmp, hud_field_icon0, '0 1 0' * hud_fontsize_y + '1 0 0' * hud_fontsize_x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon1_rgb, hud_field_icon0_alpha * scoreboard_alpha_name_self, DRAWFLAG_NORMAL);
else
- drawpic(pos - tmp, hud_field_icon0, '0 1 0' * hud_fontsize_y + '1 0 0' * hud_fontsize_x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon1_rgb, hud_field_icon0_alpha * sb_alpha_name, DRAWFLAG_NORMAL);
+ drawpic(pos - tmp, hud_field_icon0, '0 1 0' * hud_fontsize_y + '1 0 0' * hud_fontsize_x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon1_rgb, hud_field_icon0_alpha * scoreboard_alpha_name, DRAWFLAG_NORMAL);
if(hud_field_icon1 != "")
if (is_self)
- drawpic(pos - tmp, hud_field_icon1, '0 1 0' * hud_fontsize_y + '1 0 0' * hud_fontsize_x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon1_rgb, hud_field_icon1_alpha * sb_alpha_name_self, DRAWFLAG_NORMAL);
+ drawpic(pos - tmp, hud_field_icon1, '0 1 0' * hud_fontsize_y + '1 0 0' * hud_fontsize_x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon1_rgb, hud_field_icon1_alpha * scoreboard_alpha_name_self, DRAWFLAG_NORMAL);
else
- drawpic(pos - tmp, hud_field_icon1, '0 1 0' * hud_fontsize_y + '1 0 0' * hud_fontsize_x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon1_rgb, hud_field_icon1_alpha * sb_alpha_name, DRAWFLAG_NORMAL);
+ drawpic(pos - tmp, hud_field_icon1, '0 1 0' * hud_fontsize_y + '1 0 0' * hud_fontsize_x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon1_rgb, hud_field_icon1_alpha * scoreboard_alpha_name, DRAWFLAG_NORMAL);
if(hud_field_icon2 != "")
if (is_self)
- drawpic(pos - tmp, hud_field_icon2, '0 1 0' * hud_fontsize_y + '1 0 0' * hud_fontsize_x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon2_rgb, hud_field_icon2_alpha * sb_alpha_name_self, DRAWFLAG_NORMAL);
+ drawpic(pos - tmp, hud_field_icon2, '0 1 0' * hud_fontsize_y + '1 0 0' * hud_fontsize_x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon2_rgb, hud_field_icon2_alpha * scoreboard_alpha_name_self, DRAWFLAG_NORMAL);
else
- drawpic(pos - tmp, hud_field_icon2, '0 1 0' * hud_fontsize_y + '1 0 0' * hud_fontsize_x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon2_rgb, hud_field_icon2_alpha * sb_alpha_name, DRAWFLAG_NORMAL);
+ drawpic(pos - tmp, hud_field_icon2, '0 1 0' * hud_fontsize_y + '1 0 0' * hud_fontsize_x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon2_rgb, hud_field_icon2_alpha * scoreboard_alpha_name, DRAWFLAG_NORMAL);
pos_x -= hud_size[i] + hud_fontsize_x;
}
}
tmp_y = 1.25 * hud_fontsize_y;
// rounded header
- drawpic(pos, "gfx/hud/sb_scoreboard_tableheader", tmp, (rgb * hud_color_bg_team) + '0.5 0.5 0.5', sb_alpha_bg, DRAWFLAG_NORMAL);
+ drawpic(pos, "gfx/scoreboard/scoreboard_tableheader", tmp, (rgb * hud_color_bg_team) + '0.5 0.5 0.5', scoreboard_alpha_bg, DRAWFLAG_NORMAL);
// table border
tmp_y += hud_border_thickness;
tmp_y += body_table_height;
- drawborderlines(hud_border_thickness, pos, tmp, '0 0 0', sb_alpha_bg, DRAWFLAG_NORMAL); // more transparency for the scoreboard
+ drawborderlines(hud_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;
- drawfill(pos, tmp, '0 0 0', sb_alpha_bg, DRAWFLAG_NORMAL);
+ drawfill(pos, tmp, '0 0 0', scoreboard_alpha_bg, DRAWFLAG_NORMAL);
pos_y += hud_border_thickness;
// table background
tmp_y = body_table_height;
- drawpic_tiled(pos, "gfx/hud/sb_scoreboard_bg", bg_size, tmp, rgb * hud_color_bg_team, sb_alpha_bg, DRAWFLAG_NORMAL);
+ drawpic_tiled(pos, "gfx/scoreboard/scoreboard_bg", bg_size, tmp, rgb * hud_color_bg_team, scoreboard_alpha_bg, DRAWFLAG_NORMAL);
// anyway, apply some color
//drawfill(pos, tmp + '2 0 0', rgb, 0.1, DRAWFLAG_NORMAL);
pos += '1 1 0';
- if (sb_highlight)
+ if (scoreboard_highlight)
{
column_dim_y = 1.25 * hud_fontsize_y; // header
column_dim_y += hud_border_thickness;
if(hud_field[i] == SP_SEPARATOR)
break;
column_dim_x = hud_size[i] + hud_fontsize_x;
- if (sb_highlight)
+ if (scoreboard_highlight)
{
if (mod(i,2))
- drawfill(pos - '0 1 0' - hud_fontsize_x / 2 * '1 0 0', column_dim, '0 0 0', sb_alpha_bg * 0.2, DRAWFLAG_NORMAL);
+ drawfill(pos - '0 1 0' - hud_fontsize_x / 2 * '1 0 0', column_dim, '0 0 0', scoreboard_alpha_bg * 0.2, DRAWFLAG_NORMAL);
}
- drawstring(pos, hud_title[i], hud_fontsize, rgb * 1.5, sb_alpha_fg, DRAWFLAG_NORMAL);
+ drawstring(pos, hud_title[i], hud_fontsize, rgb * 1.5, scoreboard_alpha_fg, DRAWFLAG_NORMAL);
pos_x += column_dim_x;
}
if(hud_field[i] == SP_SEPARATOR)
pos_x -= hud_size[i];
- if (sb_highlight)
+ if (scoreboard_highlight)
{
if (!mod(i,2))
{
column_dim_x = hud_size[i] + hud_fontsize_x / 2 + 1;
else
column_dim_x = hud_size[i] + hud_fontsize_x;
- drawfill(pos - '0 1 0' - hud_fontsize_x / 2 * '1 0 0', column_dim, '0 0 0', sb_alpha_bg * 0.2, DRAWFLAG_NORMAL);
+ drawfill(pos - '0 1 0' - hud_fontsize_x / 2 * '1 0 0', column_dim, '0 0 0', scoreboard_alpha_bg * 0.2, DRAWFLAG_NORMAL);
}
}
tmp_x = stringwidth(hud_title[i], FALSE, hud_fontsize);
tmp_x = (hud_size[i] - tmp_x) * hud_fontsize_x;
- drawstring(pos + tmp, hud_title[i], hud_fontsize, rgb * 1.5, sb_alpha_fg, DRAWFLAG_NORMAL);
+ drawstring(pos + tmp, hud_title[i], hud_fontsize, rgb * 1.5, scoreboard_alpha_fg, DRAWFLAG_NORMAL);
pos_x -= hud_fontsize_x;
}
}
}
float HUD_WouldDrawScoreboard() {
- if (sb_showscores)
+ if (scoreboard_showscores)
return 1;
else if (intermission == 1)
return 1;
return 1;
else if (getstati(STAT_HEALTH) <= 0 && cvar("cl_deathscoreboard"))
return 1;
- else if(sb_showscores_force)
+ else if(scoreboard_showscores_force)
return 1;
return 0;
}
float fontsize = 40 * 1/3;
float weapon_cnt = 12;
float rows;
- if(cvar("hud_accuracy_doublerows"))
+ if(cvar("scoreboard_accuracy_doublerows"))
rows = 2;
else
rows = 1;
return pos;
}
- drawstring(pos, strcat("Accuracy stats (average ", ftos(average_accuracy), "%)"), hud_fontsize, '1 1 1', sb_alpha_fg, DRAWFLAG_NORMAL);
+ drawstring(pos, strcat("Accuracy stats (average ", ftos(average_accuracy), "%)"), hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
pos_y += 18;
vector tmp;
tmp_x = sbwidth;
tmp_y = height * rows;
- drawpic_tiled(pos, "gfx/hud/sb_scoreboard_bg", bg_size, tmp, rgb * hud_color_bg_team, sb_alpha_bg, DRAWFLAG_NORMAL);
- drawborderlines(hud_accuracy_border_thickness, pos, tmp, '0 0 0', sb_alpha_bg * 0.75, DRAWFLAG_NORMAL);
+ drawpic_tiled(pos, "gfx/scoreboard/scoreboard_bg", bg_size, tmp, rgb * hud_color_bg_team, scoreboard_alpha_bg, DRAWFLAG_NORMAL);
+ drawborderlines(hud_accuracy_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', sb_alpha_bg * 0.2, DRAWFLAG_NORMAL);
+ 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);
}
// 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', sb_highlight_alpha, DRAWFLAG_NORMAL);
+ 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);
}
drawfont = hud_bigfont;
float weapon_alpha;
if(weapon_damage)
- weapon_alpha = sb_alpha_fg;
+ weapon_alpha = scoreboard_alpha_fg;
else
- weapon_alpha = 0.2 * sb_alpha_fg;
+ weapon_alpha = 0.2 * scoreboard_alpha_fg;
// weapon icon
- drawpic(pos, strcat("gfx/hud/inv_weapon", self.netname), '1 0 0' * sbwidth * (1/weapon_cnt) + '0 1 0' * height * (2/3), '1 1 1', weapon_alpha, DRAWFLAG_NORMAL);
+ drawpic(pos, strcat("gfx/hud/", cvar_string("hud_skin"), "/weapon", self.netname), '1 0 0' * sbwidth * (1/weapon_cnt) + '0 1 0' * height * (2/3), '1 1 1', weapon_alpha, DRAWFLAG_NORMAL);
// the accuracy
if(weapon_damage) {
weapons_with_stats += 1;
padding = ((sbwidth/weapon_cnt) - stringwidth(s, FALSE, '1 0 0' * fontsize)) / 2; // center the accuracy value
rgb = HUD_AccuracyColor(weapon_stats);
- drawstring(pos + '1 0 0' * padding + '0 1 0' * height * (2/3), s, '1 1 0' * fontsize, rgb, sb_alpha_fg, DRAWFLAG_NORMAL);
+ drawstring(pos + '1 0 0' * padding + '0 1 0' * height * (2/3), s, '1 1 0' * fontsize, rgb, scoreboard_alpha_fg, DRAWFLAG_NORMAL);
}
pos_x += sbwidth/weapon_cnt * rows;
if(rows == 2 && i == 6) {
float is_spec;
is_spec = (GetPlayerColor(pl.sv_entnum) == COLOR_SPECTATOR);
vector hl_rgb;
- hl_rgb_x = cvar("hud_color_bg_r") + 0.5;
- hl_rgb_y = cvar("hud_color_bg_g") + 0.5;
- hl_rgb_z = cvar("hud_color_bg_b") + 0.5;
+ hl_rgb_x = cvar("scoreboard_color_bg_r") + 0.5;
+ hl_rgb_y = cvar("scoreboard_color_bg_g") + 0.5;
+ hl_rgb_z = cvar("scoreboard_color_bg_b") + 0.5;
pos_y += hud_fontsize_y;
- drawstring(pos, strcat("Rankings"), hud_fontsize, '1 1 1', sb_alpha_fg, DRAWFLAG_NORMAL);
+ drawstring(pos, strcat("Rankings"), hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
pos_y += hud_fontsize_y;
vector tmp;
tmp_x = sbwidth;
tmp_y = hud_fontsize_y * RANKINGS_RECEIVED_CNT;
- drawpic_tiled(pos, "gfx/hud/sb_scoreboard_bg", bg_size, tmp, rgb * hud_color_bg_team, sb_alpha_bg, DRAWFLAG_NORMAL);
- drawborderlines(hud_border_thickness, pos, tmp, '0 0 0', sb_alpha_bg * 0.75, DRAWFLAG_NORMAL);
+ drawpic_tiled(pos, "gfx/scoreboard/scoreboard_bg", bg_size, tmp, rgb * hud_color_bg_team, scoreboard_alpha_bg, DRAWFLAG_NORMAL);
+ drawborderlines(hud_border_thickness, pos, tmp, '0 0 0', scoreboard_alpha_bg * 0.75, DRAWFLAG_NORMAL);
// row highlighting
for(i = 0; i<RANKINGS_RECEIVED_CNT; ++i)
n = grecordholder[i];
p = race_PlaceName(i+1);
if(grecordholder[i] == GetPlayerName(player_localentnum - 1))
- drawfill(pos, '1 0 0' * sbwidth + '0 1 0' * hud_fontsize_y, hl_rgb, sb_highlight_alpha_self, DRAWFLAG_NORMAL);
- else if(!mod(i, 2) && sb_highlight)
- drawfill(pos, '1 0 0' * sbwidth + '0 1 0' * hud_fontsize_y, hl_rgb, sb_highlight_alpha, DRAWFLAG_NORMAL);
- drawstring(pos, p, hud_fontsize, '1 1 1', sb_alpha_fg, DRAWFLAG_NORMAL);
- drawstring(pos + '3 0 0' * hud_fontsize_x, TIME_ENCODED_TOSTRING(t), hud_fontsize, '1 1 1', sb_alpha_fg, DRAWFLAG_NORMAL);
- drawcolorcodedstring(pos + '8 0 0' * hud_fontsize_x, n, hud_fontsize, sb_alpha_fg, DRAWFLAG_NORMAL);
+ drawfill(pos, '1 0 0' * sbwidth + '0 1 0' * hud_fontsize_y, hl_rgb, scoreboard_highlight_alpha_self, DRAWFLAG_NORMAL);
+ else if(!mod(i, 2) && scoreboard_highlight)
+ drawfill(pos, '1 0 0' * sbwidth + '0 1 0' * hud_fontsize_y, hl_rgb, scoreboard_highlight_alpha, DRAWFLAG_NORMAL);
+ drawstring(pos, p, hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
+ drawstring(pos + '3 0 0' * hud_fontsize_x, TIME_ENCODED_TOSTRING(t), hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos + '8 0 0' * hud_fontsize_x, n, hud_fontsize, scoreboard_alpha_fg, DRAWFLAG_NORMAL);
pos += '0 1 0' * hud_fontsize_y;
}
return pos;
}
-float sb_fade_alpha;
+float scoreboard_fade_alpha;
float hud_woulddrawscoreboard_prev;
float hud_woulddrawscoreboard_change; // "time" at which HUD_WouldDrawScoreboard() changed
void HUD_DrawScoreboard()
{
+ HUD_UpdatePlayerTeams();
+
float hud_woulddrawscoreboard;
hud_woulddrawscoreboard = HUD_WouldDrawScoreboard();
if(hud_woulddrawscoreboard != hud_woulddrawscoreboard_prev) {
hud_woulddrawscoreboard_prev = hud_woulddrawscoreboard;
}
- float scoreboard_fadeinspeed = cvar_or("sb_fadeinspeed", 10);
- float scoreboard_fadeoutspeed = cvar_or("sb_fadeoutspeed", 5);
+ float scoreboard_fadeinspeed = cvar_or("scoreboard_fadeinspeed", 10);
+ float scoreboard_fadeoutspeed = cvar_or("scoreboard_fadeoutspeed", 5);
if(hud_woulddrawscoreboard) {
if (scoreboard_fadeinspeed)
- sb_fade_alpha = bound (0, (time - hud_woulddrawscoreboard_change) * scoreboard_fadeinspeed, 1);
+ scoreboard_fade_alpha = bound (0, (time - hud_woulddrawscoreboard_change) * scoreboard_fadeinspeed, 1);
else
- sb_fade_alpha = 1;
+ scoreboard_fade_alpha = 1;
}
else
if (scoreboard_fadeoutspeed)
- sb_fade_alpha = bound (0, (1/scoreboard_fadeoutspeed - (time - hud_woulddrawscoreboard_change)) * scoreboard_fadeoutspeed, 1);
+ scoreboard_fade_alpha = bound (0, (1/scoreboard_fadeoutspeed - (time - hud_woulddrawscoreboard_change)) * scoreboard_fadeoutspeed, 1);
else
- sb_fade_alpha = 0;
+ scoreboard_fade_alpha = 0;
- if not(sb_fade_alpha)
+ if not(scoreboard_fade_alpha)
return;
- sb_alpha_bg = cvar("sb_alpha_bg") * sb_fade_alpha;
- sb_alpha_fg = cvar_or("sb_alpha_fg", 1.0) * sb_fade_alpha;
- sb_highlight = cvar("sb_highlight");
- sb_highlight_alpha = cvar_or("sb_highlight_alpha", 0.10) * sb_alpha_fg;
- sb_highlight_alpha_self = cvar_or("sb_highlight_alpha_self", 0.25) * sb_alpha_fg;
- sb_alpha_name = cvar_or("sb_alpha_name", 0.9) * sb_alpha_fg;
- sb_alpha_name_self = cvar_or("sb_alpha_name_self", 1) * sb_alpha_fg;
+ 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");
+ scoreboard_highlight_alpha = cvar_or("scoreboard_highlight_alpha", 0.10) * scoreboard_alpha_fg;
+ scoreboard_highlight_alpha_self = cvar_or("scoreboard_highlight_alpha_self", 0.25) * scoreboard_alpha_fg;
+ scoreboard_alpha_name = cvar_or("scoreboard_alpha_name", 0.9) * scoreboard_alpha_fg;
+ scoreboard_alpha_name_self = cvar_or("scoreboard_alpha_name_self", 1) * scoreboard_alpha_fg;
vector rgb, pos, tmp;
entity pl, tm;
// Heading
drawfont = hud_bigfont;
- drawstringcenter('0 1 0' * ymin, "Scoreboard", '24 24 0', '1 1 1', sb_alpha_fg, DRAWFLAG_NORMAL);
+ drawstringcenter('0 1 0' * ymin, "Scoreboard", '24 24 0', '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
pos_y += 24 + 4;
pos_y += hud_fontsize_y;
// Draw the scoreboard
vector bg_size;
- bg_size = drawgetimagesize("gfx/hud/sb_scoreboard_bg");
+ bg_size = drawgetimagesize("gfx/hud/scoreboard_scoreboard_bg");
if(teamplay)
{
continue;
rgb = GetTeamRGB(tm.team);
- HUD_DrawXNum(pos - '9.5 0 0' * hud_fontsize_y + '0 1 0' * hud_fontsize_y, tm.(teamscores[ts_primary]), 6, 0, hud_fontsize_y * 1.5, rgb, 0, 1, sb_alpha_fg, DRAWFLAG_NORMAL);
+ HUD_DrawXNum(pos - '9.5 0 0' * hud_fontsize_y + '0 1 0' * hud_fontsize_y, tm.(teamscores[ts_primary]), 6, 0, hud_fontsize_y * 1.5, rgb, 0, 1, scoreboard_alpha_fg, DRAWFLAG_NORMAL);
if(ts_primary != ts_secondary)
- HUD_DrawXNum(pos - '7.5 0 0' * hud_fontsize_y + '0 2.5 0' * hud_fontsize_y, tm.(teamscores[ts_secondary]), 6, 0, hud_fontsize_y * 1, rgb, 0, 1, sb_alpha_fg, DRAWFLAG_NORMAL);
+ HUD_DrawXNum(pos - '7.5 0 0' * hud_fontsize_y + '0 2.5 0' * hud_fontsize_y, tm.(teamscores[ts_secondary]), 6, 0, hud_fontsize_y * 1, rgb, 0, 1, scoreboard_alpha_fg, DRAWFLAG_NORMAL);
pos = HUD_Scoreboard_MakeTable(pos, tm, rgb, bg_size);
}
}
else
{
- rgb_x = cvar("hud_color_bg_r");
- rgb_y = cvar("hud_color_bg_g");
- rgb_z = cvar("hud_color_bg_b");
+ rgb_x = cvar("scoreboard_color_bg_r");
+ rgb_y = cvar("scoreboard_color_bg_g");
+ rgb_z = cvar("scoreboard_color_bg_b");
for(tm = teams.sort_next; tm; tm = tm.sort_next)
{
if(gametype == GAME_CTS || gametype == GAME_RACE) {
if(race_speedaward) {
- drawcolorcodedstring(pos, strcat("Speed award: ", ftos(race_speedaward), " (", race_speedaward_holder, ")"), hud_fontsize, sb_alpha_fg, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos, strcat("Speed award: ", ftos(race_speedaward), " (", race_speedaward_holder, ")"), hud_fontsize, scoreboard_alpha_fg, DRAWFLAG_NORMAL);
pos_y += 1.25 * hud_fontsize_y;
}
if(race_speedaward_alltimebest) {
- drawcolorcodedstring(pos, strcat("All-time fastest: ", ftos(race_speedaward_alltimebest), " (", race_speedaward_alltimebest_holder, ")"), hud_fontsize, sb_alpha_fg, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos, strcat("All-time fastest: ", ftos(race_speedaward_alltimebest), " (", race_speedaward_alltimebest_holder, ")"), hud_fontsize, scoreboard_alpha_fg, DRAWFLAG_NORMAL);
pos_y += 1.25 * hud_fontsize_y;
}
pos = HUD_DrawScoreboardRankings(pos, pl, rgb, bg_size);
}
- else if(cvar("hud_accuracy") && spectatee_status != -1) {
+ else if(cvar("scoreboard_accuracy") && spectatee_status != -1) {
if(teamplay)
pos = HUD_DrawScoreboardAccuracyStats(pos, GetTeamRGB(myteam), bg_size);
else
}
if(specs)
- drawstring(tmp, "Spectators", hud_fontsize, '1 1 1', sb_alpha_fg, DRAWFLAG_NORMAL);
+ drawstring(tmp, "Spectators", hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
// Print info string
string str;
pos_y += 1.2 * hud_fontsize_y;
- drawcolorcodedstring(pos + '0.5 0 0' * (sbwidth - stringwidth(str, TRUE, hud_fontsize)), str, hud_fontsize, sb_alpha_fg, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos + '0.5 0 0' * (sbwidth - stringwidth(str, TRUE, hud_fontsize)), str, hud_fontsize, scoreboard_alpha_fg, DRAWFLAG_NORMAL);
scoreboard_bottom = pos_y + 2 * hud_fontsize_y;
}
void HUD_DrawAccuracyStats_Description_Hitscan(vector position)
{
- drawstring(position + '0 3 0' * hud_fontsize_y, "Shots fired:", hud_fontsize, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
- drawstring(position + '0 5 0' * hud_fontsize_y, "Shots hit:", hud_fontsize, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
- drawstring(position + '0 7 0' * hud_fontsize_y, "Accuracy:", hud_fontsize, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
- drawstring(position + '0 9 0' * hud_fontsize_y, "Shots missed:", hud_fontsize, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
+ drawstring(position + '0 3 0' * hud_fontsize_y, "Shots fired:", hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
+ drawstring(position + '0 5 0' * hud_fontsize_y, "Shots hit:", hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
+ drawstring(position + '0 7 0' * hud_fontsize_y, "Accuracy:", hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
+ drawstring(position + '0 9 0' * hud_fontsize_y, "Shots missed:", hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
}
void HUD_DrawAccuracyStats_Description_Splash(vector position)
{
- drawstring(position + '0 3 0' * hud_fontsize_y, "Maximum damage:", hud_fontsize, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
- drawstring(position + '0 5 0' * hud_fontsize_y, "Actual damage:", hud_fontsize, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
- drawstring(position + '0 7 0' * hud_fontsize_y, "Accuracy:", hud_fontsize, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
- drawstring(position + '0 9 0' * hud_fontsize_y, "Damage wasted:", hud_fontsize, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
+ drawstring(position + '0 3 0' * hud_fontsize_y, "Maximum damage:", hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
+ drawstring(position + '0 5 0' * hud_fontsize_y, "Actual damage:", hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
+ drawstring(position + '0 7 0' * hud_fontsize_y, "Accuracy:", hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
+ drawstring(position + '0 9 0' * hud_fontsize_y, "Damage wasted:", hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
}
void HUD_DrawAccuracyStats()
pos_x = 0;
pos_y = SCOREBOARD_OFFSET;
pos_z = 0;
- drawstringcenter(pos, "Weapon Accuracy", 2 * hud_fontsize, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
+ drawstringcenter(pos, "Weapon Accuracy", 2 * hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
left_border = col_margin + 11 * hud_fontsize_x;
{
pos_y += 40;
if(mod(time, 1) >= 0.4)
- drawstringcenter(pos, "Stats are not tracked during warmup stage", hud_fontsize, '1 1 0', hud_alpha_fg, DRAWFLAG_NORMAL);
+ drawstringcenter(pos, "Stats are not tracked during warmup stage", hud_fontsize, '1 1 0', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
return;
}
{
pos_y += 40;
if(mod(time, 1) >= 0.4)
- drawstringcenter(pos, "Stats are not tracked in Race/CTS", hud_fontsize, '1 1 0', hud_alpha_fg, DRAWFLAG_NORMAL);
+ drawstringcenter(pos, "Stats are not tracked in Race/CTS", hud_fontsize, '1 1 0', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
return;
}
pos_y = top_border_splash + row * (fill_size_y + row_margin);
// background
- drawpic(pos, "gfx/hud/sb_accuracy", fill_size , fill_colour, hud_alpha_bg, DRAWFLAG_NORMAL);
- drawborderlines(hud_border_thickness, pos, fill_size, border_colour, hud_alpha_bg, DRAWFLAG_NORMAL);
+ 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);
// the weapon
- drawpic(pos, strcat("gfx/hud/inv_weapon", self.netname), '1 0.5 0' * fill_size_x , '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
+ drawpic(pos, strcat("gfx/weapons/weapon", self.netname), '1 0.5 0' * fill_size_x , '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
// the amount of shots fired or max damage
- drawstringright(pos + '4.5 0 0' * hud_fontsize_x + '0 3 0' * hud_fontsize_y, ftos(weapon_damage), hud_fontsize, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
+ drawstringright(pos + '4.5 0 0' * hud_fontsize_x + '0 3 0' * hud_fontsize_y, ftos(weapon_damage), hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
// the amount of hits or actual damage
- drawstringright(pos + '4.5 0 0' * hud_fontsize_x + '0 5 0' * hud_fontsize_y, ftos(weapon_hit), hud_fontsize, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
+ drawstringright(pos + '4.5 0 0' * hud_fontsize_x + '0 5 0' * hud_fontsize_y, ftos(weapon_hit), hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
// the accuracy
- drawstringright(pos + '4.5 0 0' * hud_fontsize_x + '0 7 0' * hud_fontsize_y, strcat(ftos(weapon_stats),"%"), hud_fontsize, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
+ drawstringright(pos + '4.5 0 0' * hud_fontsize_x + '0 7 0' * hud_fontsize_y, strcat(ftos(weapon_stats),"%"), hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
// the amount of shots missed or damage wasted
- drawstringright(pos + '4.5 0 0' * hud_fontsize_x + '0 9 0' * hud_fontsize_y, ftos(max(0, weapon_damage - weapon_hit)), hud_fontsize, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
+ drawstringright(pos + '4.5 0 0' * hud_fontsize_x + '0 9 0' * hud_fontsize_y, ftos(max(0, weapon_damage - weapon_hit)), hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
++count_splash;
} else if (self.spawnflags & WEP_TYPE_HITSCAN) {
pos_y = top_border_hitscan + row * (fill_size_y + row_margin);
// background
- drawpic(pos, "gfx/hud/sb_accuracy", fill_size , fill_colour, hud_alpha_bg, DRAWFLAG_NORMAL);
- drawborderlines(hud_border_thickness, pos, fill_size, border_colour, hud_alpha_bg, DRAWFLAG_NORMAL);
+ 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);
// the weapon
- drawpic(pos, strcat("gfx/hud/inv_weapon", self.netname), '1 0.5 0' * fill_size_x , '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
+ drawpic(pos, strcat("gfx/weapons/weapon", self.netname), '1 0.5 0' * fill_size_x , '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
// the amount of shots fired or max damage
- drawstringright(pos + '4.5 0 0' * hud_fontsize_x + '0 3 0' * hud_fontsize_y, ftos(weapon_damage), hud_fontsize, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
+ drawstringright(pos + '4.5 0 0' * hud_fontsize_x + '0 3 0' * hud_fontsize_y, ftos(weapon_damage), hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
// the amount of hits or actual damage
- drawstringright(pos + '4.5 0 0' * hud_fontsize_x + '0 5 0' * hud_fontsize_y, ftos(weapon_hit), hud_fontsize, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
+ drawstringright(pos + '4.5 0 0' * hud_fontsize_x + '0 5 0' * hud_fontsize_y, ftos(weapon_hit), hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
// the accuracy
- drawstringright(pos + '4.5 0 0' * hud_fontsize_x + '0 7 0' * hud_fontsize_y, strcat(ftos(weapon_stats),"%"), hud_fontsize, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
+ drawstringright(pos + '4.5 0 0' * hud_fontsize_x + '0 7 0' * hud_fontsize_y, strcat(ftos(weapon_stats),"%"), hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
// the amount of shots missed or damage wasted
- drawstringright(pos + '4.5 0 0' * hud_fontsize_x + '0 9 0' * hud_fontsize_y, ftos(max(0, weapon_damage - weapon_hit)), hud_fontsize, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
+ drawstringright(pos + '4.5 0 0' * hud_fontsize_x + '0 9 0' * hud_fontsize_y, ftos(max(0, weapon_damage - weapon_hit)), hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
++count_hitscan;
}
vector teamradar_size2d; // 2D size
vector teamradar_extraclip_mins, teamradar_extraclip_maxs; // for non-centered radar display
float teamradar_size; // 2D scale factor
-float cl_teamradar_scale; // window size = ...qu
-float cl_teamradar_nohudhack;
+float hud_radar_scale; // window size = ...qu
+float hud_radar_nohudhack;
float v_flipped;
float vlen2d(vector v)
{
float fga;
vector fgc;
- if(bg > 0)
- {
- R_BeginPolygon("", 0);
- R_PolygonVertex('1 0 0' * (teamradar_origin2d_x - teamradar_size2d_x * 0.5 + teamradar_extraclip_mins_x) + '0 1 0' * (teamradar_origin2d_y - teamradar_size2d_y * 0.5 + teamradar_extraclip_mins_y), '0 0 0', '0 0 0', bg);
- R_PolygonVertex('1 0 0' * (teamradar_origin2d_x + teamradar_size2d_x * 0.5 + teamradar_extraclip_maxs_x) + '0 1 0' * (teamradar_origin2d_y - teamradar_size2d_y * 0.5 + teamradar_extraclip_mins_y), '0 0 0', '0 0 0', bg);
- R_PolygonVertex('1 0 0' * (teamradar_origin2d_x + teamradar_size2d_x * 0.5 + teamradar_extraclip_maxs_x) + '0 1 0' * (teamradar_origin2d_y + teamradar_size2d_y * 0.5 + teamradar_extraclip_maxs_y), '0 0 0', '0 0 0', bg);
- R_PolygonVertex('1 0 0' * (teamradar_origin2d_x - teamradar_size2d_x * 0.5 + teamradar_extraclip_mins_x) + '0 1 0' * (teamradar_origin2d_y + teamradar_size2d_y * 0.5 + teamradar_extraclip_maxs_y), '0 0 0', '0 0 0', bg);
- R_EndPolygon();
- }
if(fg > 0 && minimapname != "")
{
rgb2 = '1 1 1';
R_BeginPolygon("", 0);
- R_PolygonVertex(coord+v_forward*3, '0 0 0', rgb2, hud_alpha_fg);
- R_PolygonVertex(coord+v_right*4-v_forward*2.5, '0 1 0', rgb2, hud_alpha_fg);
- R_PolygonVertex(coord-v_forward*2, '1 0 0', rgb2, hud_alpha_fg);
- R_PolygonVertex(coord-v_right*4-v_forward*2.5, '1 1 0', rgb2, hud_alpha_fg);
+ R_PolygonVertex(coord+v_forward*3, '0 0 0', rgb2, hud_fg_alpha);
+ R_PolygonVertex(coord+v_right*4-v_forward*2.5, '0 1 0', rgb2, hud_fg_alpha);
+ R_PolygonVertex(coord-v_forward*2, '1 0 0', rgb2, hud_fg_alpha);
+ R_PolygonVertex(coord-v_right*4-v_forward*2.5, '1 1 0', rgb2, hud_fg_alpha);
R_EndPolygon();
R_BeginPolygon("", 0);
- R_PolygonVertex(coord+v_forward*2, '0 0 0', rgb, hud_alpha_fg);
- R_PolygonVertex(coord+v_right*3-v_forward*2, '0 1 0', rgb, hud_alpha_fg);
- R_PolygonVertex(coord-v_forward, '1 0 0', rgb, hud_alpha_fg);
- R_PolygonVertex(coord-v_right*3-v_forward*2, '1 1 0', rgb, hud_alpha_fg);
+ R_PolygonVertex(coord+v_forward*2, '0 0 0', rgb, hud_fg_alpha);
+ R_PolygonVertex(coord+v_right*3-v_forward*2, '0 1 0', rgb, hud_fg_alpha);
+ R_PolygonVertex(coord-v_forward, '1 0 0', rgb, hud_fg_alpha);
+ R_PolygonVertex(coord-v_right*3-v_forward*2, '1 1 0', rgb, hud_fg_alpha);
R_EndPolygon();
};
c1 = colormapPaletteColor((colors & 0xF0) / 0x10, FALSE);
R_BeginPolygon("", 0);
- R_PolygonVertex(start - norm, '0 0 0', c0, hud_alpha_fg);
- R_PolygonVertex(start + norm, '0 1 0', c0, hud_alpha_fg);
- R_PolygonVertex(end + norm, '1 1 0', c1, hud_alpha_fg);
- R_PolygonVertex(end - norm, '1 0 0', c1, hud_alpha_fg);
+ R_PolygonVertex(start - norm, '0 0 0', c0, hud_fg_alpha);
+ R_PolygonVertex(start + norm, '0 1 0', c0, hud_fg_alpha);
+ R_PolygonVertex(end + norm, '1 1 0', c1, hud_fg_alpha);
+ R_PolygonVertex(end - norm, '1 0 0', c1, hud_fg_alpha);
R_EndPolygon();
}
-float cl_teamradar_scale;
-float cl_teamradar_background_alpha;
-float cl_teamradar_foreground_alpha;
-float cl_teamradar_rotation;
-vector cl_teamradar_size;
-vector cl_teamradar_position;
-float cl_teamradar_zoommode;
+float hud_radar_scale;
+float hud_radar_background_alpha;
+float hud_radar_foreground_alpha;
+float hud_radar_rotation;
+vector hud_radar_size;
+vector hud_radar_position;
+float hud_radar_zoommode;
void teamradar_loadcvars()
{
v_flipped = cvar("v_flipped");
- if(ons_showmap)
- {
- cl_teamradar_scale = 42; // dummy, not used (see zoommode)
- cl_teamradar_background_alpha = 1 * (1 - cvar("_menu_alpha"));
- cl_teamradar_foreground_alpha = 1 * (1 - cvar("_menu_alpha"));
- cl_teamradar_rotation = cvar("cl_teamradar_rotation");
- if(!cl_teamradar_rotation)
- cl_teamradar_rotation = 4;
- cl_teamradar_zoommode = 3;
- cl_teamradar_nohudhack = 0;
- }
- else
- {
- cl_teamradar_scale = cvar("cl_teamradar_scale");
- cl_teamradar_background_alpha = cvar("cl_teamradar_background_alpha") * hud_alpha_fg;
- cl_teamradar_foreground_alpha = cvar("cl_teamradar_foreground_alpha") * hud_alpha_fg;
- cl_teamradar_rotation = cvar("cl_teamradar_rotation");
- cl_teamradar_zoommode = cvar("cl_teamradar_zoommode");
-
- // others default to 0
- // match this to defaultXonotic.cfg!
- if(!cl_teamradar_scale) cl_teamradar_scale = 4096;
- if(!cl_teamradar_background_alpha) cl_teamradar_background_alpha = 0.4 * hud_alpha_fg;
- if(!cl_teamradar_foreground_alpha) cl_teamradar_foreground_alpha = 0.8 * hud_alpha_fg;
- if(!cl_teamradar_size_x) cl_teamradar_size_x = 128;
- if(!cl_teamradar_size_y) cl_teamradar_size_y = cl_teamradar_size_x;
-
- cl_teamradar_size_z = 0;
- cl_teamradar_nohudhack = cl_teamradar_position_z;
- cl_teamradar_position_z = 0;
- }
+ hud_radar_scale = cvar("hud_radar_scale");
+ hud_radar_background_alpha = cvar("hud_radar_background_alpha") * hud_fg_alpha;
+ hud_radar_foreground_alpha = cvar("hud_radar_foreground_alpha") * hud_fg_alpha;
+ hud_radar_rotation = cvar("hud_radar_rotation");
+ hud_radar_zoommode = cvar("hud_radar_zoommode");
+
+ // others default to 0
+ // match this to defaultXonotic.cfg!
+ if(!hud_radar_scale) hud_radar_scale = 4096;
+ if(!hud_radar_background_alpha) hud_radar_background_alpha = 0.4 * hud_fg_alpha;
+ if(!hud_radar_foreground_alpha) hud_radar_foreground_alpha = 0.8 * hud_fg_alpha;
+ if(!hud_radar_size_x) hud_radar_size_x = 128;
+ if(!hud_radar_size_y) hud_radar_size_y = hud_radar_size_x;
+
+ hud_radar_size_z = 0;
+ hud_radar_nohudhack = hud_radar_position_z;
+ hud_radar_position_z = 0;
}
// radar links
-void HUD_Radar();
-
#define MAX_TEAMRADAR_TIMES 32
// to make entities have dots on the team radar
dist = vlen(self.origin - view_origin);
float a;
- a = self.alpha * hud_alpha_fg;
+ a = self.alpha * hud_fg_alpha;
if(self.maxdistance > waypointsprite_normdistance)
a *= pow(bound(0, (self.maxdistance - dist) / (self.maxdistance - waypointsprite_normdistance), 1), waypointsprite_distancealphaexponent);
const float TE_CSQC_VOTERESET = 109;
const float TE_CSQC_ANNOUNCE = 110;
const float TE_CSQC_TARGET_MUSIC = 111;
+const float TE_CSQC_NOTIFY = 112;
const float RACE_NET_CHECKPOINT_HIT_QUALIFYING = 0; // byte checkpoint, short time, short recordtime, string recordholder
const float RACE_NET_CHECKPOINT_CLEAR = 1;
const float RACE_NET_SERVER_STATUS = 12;
const float RANKINGS_CNT = 15;
+const float CSQC_KILLNOTIFY = 0;
+const float CSQC_CENTERPRINT = 1;
+
const float ENT_CLIENT = 0;
const float ENT_CLIENT_DEAD = 1;
const float ENT_CLIENT_ENTCS = 2;
const float STAT_SHOTORG = 46; // compressShotOrigin
const float STAT_LEADLIMIT = 47;
const float STAT_BULLETS_LOADED = 48;
+
+// see DP source, quakedef.h
+const float STAT_MOVEVARS_AIRSPEEDLIMIT_NONQW = 222;
+const float STAT_MOVEVARS_AIRSTRAFEACCEL_QW = 223;
+const float STAT_MOVEVARS_AIRACCEL_QW = 254;
+
const float CTF_STATE_ATTACK = 1;
const float CTF_STATE_DEFEND = 2;
const float CTF_STATE_COMMANDER = 3;
float DEATH_WAKIROCKET = 10041;
float DEATH_WAKIBLOWUP = 10042;
+float DEATH_GENERIC = 10050;
+
+float DEATH_WEAPON = 10100;
+
float DEATH_CUSTOM = 10300;
float MAX_SHOT_DISTANCE = 32768;
-// panel hud constants
-float panel_cnt = 11; // NOTE: IDs start from 0!
+// CSQC centerprint/notify message types
+float MSG_SUICIDE = 0;
+float MSG_KILL = 1;
+float MSG_SPREE = 2;
+float MSG_KILL_ACTION = 3;
+float MSG_KILL_ACTION_SPREE = 4;
+float MSG_INFO = 5;
+
+float KILL_TEAM = 10301;
+float KILL_TEAM_SPREE = 10302;
+float KILL_FIRST_BLOOD = 10303;
+float KILL_FIRST_VICTIM = 10304;
+float KILL_TYPEFRAG = 10305;
+float KILL_TYPEFRAGGED = 10306;
+float KILL_FRAG = 10307;
+float KILL_FRAGGED = 10308;
+float KILL_SPREE = 10309;
+float KILL_END_SPREE = 10310;
+float KILL_SPREE_3 = 10311;
+float KILL_SPREE_5 = 10312;
+float KILL_SPREE_10 = 10313;
+float KILL_SPREE_15 = 10314;
+float KILL_SPREE_20 = 10315;
+float KILL_SPREE_25 = 10316;
+float KILL_SPREE_30 = 10317;
+
+float INFO_GOTFLAG = 10318;
+float INFO_PICKUPFLAG = 10319;
+float INFO_LOSTFLAG = 10320;
+float INFO_RETURNFLAG = 10321;
+
+// weapon requests
+float WR_SETUP = 1; // (SVQC) setup weapon data
+float WR_THINK = 2; // (SVQC) logic to run every frame
+float WR_CHECKAMMO1 = 3; // (SVQC) checks ammo for weapon
+float WR_CHECKAMMO2 = 4; // (SVQC) checks ammo for weapon
+float WR_AIM = 5; // (SVQC) runs bot aiming code for this weapon
+float WR_PRECACHE = 6; // (CSQC and SVQC) precaches models/sounds used by this weapon
+float WR_SUICIDEMESSAGE = 7; // (CSQC) sets w_deathtypestring or leaves it alone (and may inspect w_deathtype for details)
+float WR_KILLMESSAGE = 8; // (CSQC) sets w_deathtypestring or leaves it alone
+float WR_RELOAD = 9; // (SVQC) does not need to do anything
+float WR_RESETPLAYER = 10; // (SVQC) does not need to do anything
+float WR_IMPACTEFFECT = 11; // (CSQC) impact effect
+
+
+float HUD_PANEL_WEAPONICONS = 0;
+float HUD_PANEL_INVENTORY = 1;
+float HUD_PANEL_POWERUPS = 2;
+float HUD_PANEL_HEALTHARMOR = 3;
+float HUD_PANEL_NOTIFY = 4;
+float HUD_PANEL_TIMER = 5;
+float HUD_PANEL_RADAR = 6;
+float HUD_PANEL_SCORE = 7;
+float HUD_PANEL_RACETIMER = 8;
+float HUD_PANEL_VOTE = 9;
+float HUD_PANEL_MODICONS = 10;
+float HUD_PANEL_PRESSEDKEYS = 11;
+float HUD_PANEL_CHAT = 12;
+float HUD_PANEL_ENGINEINFO = 13;
+float HUD_PANEL_NUM = 14; // always last panel id + 1, please increment when adding a new panel
+
+float HUD_MENU_ENABLE = 0;
dummy_weapon_info.model2 = "";
float i;
- weaponpriority_hudselector_0 = "";
+ weaponorder_byid = "";
for(i = 24; i >= 1; --i)
if(weapon_info[i-1])
- weaponpriority_hudselector_0 = strcat(weaponpriority_hudselector_0, " ", ftos(i));
+ weaponorder_byid = strcat(weaponorder_byid, " ", ftos(i));
float imp;
- weaponpriority_hudselector_1 = "";
+ weaponorder_byimpulse = "";
for(i = 1; i <= 24; ++i)
{
wi = weapon_info[i-1];
if(wi && wi.impulse == 0)
- weaponpriority_hudselector_1 = strcat(weaponpriority_hudselector_1, " ", ftos(i));
+ weaponorder_byimpulse = strcat(weaponorder_byimpulse, " ", ftos(i));
}
for(imp = 9; imp > 0; --imp)
for(i = 1; i <= 24; ++i)
{
wi = weapon_info[i-1];
if(wi && wi.impulse == imp)
- weaponpriority_hudselector_1 = strcat(weaponpriority_hudselector_1, " ", ftos(i));
+ weaponorder_byimpulse = strcat(weaponorder_byimpulse, " ", ftos(i));
}
- weaponpriority_hudselector_0 = strzone(substring(weaponpriority_hudselector_0, 1, strlen(weaponpriority_hudselector_0) - 1));
- weaponpriority_hudselector_1 = strzone(substring(weaponpriority_hudselector_1, 1, strlen(weaponpriority_hudselector_1) - 1));
+ weaponorder_byid = strzone(substring(weaponorder_byid, 1, strlen(weaponorder_byid) - 1));
+ weaponorder_byimpulse = strzone(substring(weaponorder_byimpulse, 1, strlen(weaponorder_byimpulse) - 1));
}
entity get_weaponinfo(float id)
{
float IT_UNLIMITED_AMMO = 3; // IT_UNLIMITED_SUPERWEAPONS | IT_UNLIMITED_WEAPON_AMMO;
// variables:
-string weaponpriority_hudselector_0;
-string weaponpriority_hudselector_1;
+string weaponorder_byid;
+string weaponorder_byimpulse;
// functions:
entity get_weaponinfo(float id);
register_weapon(id,func,ammotype,i,weapontype,pickupbasevalue,modelname,shortname,wname); \
} \
ACCUMULATE_FUNCTION(RegisterWeapons, RegisterWeapons_##id)
-#ifdef SVQC
+#ifdef MENUQC
#define REGISTER_WEAPON(id,func,ammotype,i,weapontype,pickupbasevalue,modelname,shortname,wname) \
- REGISTER_WEAPON_2(WEP_##id,WEPBIT_##id,func,ammotype,i,weapontype,pickupbasevalue,modelname,shortname,wname)
+ REGISTER_WEAPON_2(WEP_##id,WEPBIT_##id,w_null,ammotype,i,weapontype,pickupbasevalue,modelname,shortname,wname)
#else
#define REGISTER_WEAPON(id,func,ammotype,i,weapontype,pickupbasevalue,modelname,shortname,wname) \
- REGISTER_WEAPON_2(WEP_##id,WEPBIT_##id,w_null,ammotype,i,weapontype,pickupbasevalue,modelname,shortname,wname)
+ REGISTER_WEAPON_2(WEP_##id,WEPBIT_##id,func,ammotype,i,weapontype,pickupbasevalue,modelname,shortname,wname)
#endif
#include "../server/w_all.qc"
return 1;
}
+
+// return name of given panel id
+string HUD_Panel_GetName(float id)
+{
+ switch(id) {
+ case HUD_PANEL_WEAPONICONS: return "weaponicons"; break;
+ case HUD_PANEL_INVENTORY: return "inventory"; break;
+ case HUD_PANEL_POWERUPS: return "powerups"; break;
+ case HUD_PANEL_HEALTHARMOR: return "healtharmor"; break;
+ case HUD_PANEL_NOTIFY: return "notify"; break;
+ case HUD_PANEL_TIMER: return "timer"; break;
+ case HUD_PANEL_RADAR: return "radar"; break;
+ case HUD_PANEL_SCORE: return "score"; break;
+ case HUD_PANEL_RACETIMER: return "racetimer"; break;
+ case HUD_PANEL_VOTE: return "vote"; break;
+ case HUD_PANEL_MODICONS: return "modicons"; break;
+ case HUD_PANEL_PRESSEDKEYS: return "pressedkeys"; break;
+ case HUD_PANEL_CHAT: return "chat"; break;
+ case HUD_PANEL_ENGINEINFO: return "engineinfo"; break;
+ default: return "";
+ }
+}
float get_model_parameters_age;
string get_model_parameters_desc;
float get_model_parameters(string mod, float skn); // call with string_null to clear; skin -1 means mod is the filename of the txt file and is to be split
+
+string HUD_Panel_GetName(float id)
#endif
#ifdef IMPLEMENTATION
-void configureAnimationAnimation(entity me, entity obj, void(entity, float) setter, float startTime, float duration, float startValue, float end)
+void configureAnimationAnimation(entity me, entity obj, void(entity, float) objSetter, float animStartTime, float animDuration, float animStartValue, float animEndValue)
{
- me.setObjectSetter(me, obj, setter);
- me.setTimeStartDuration(me, startTime, duration);
- me.setValueStartEnd(me, startValue, end);
+ me.setObjectSetter(me, obj, objSetter);
+ me.setTimeStartDuration(me, animStartTime, animDuration);
+ me.setValueStartEnd(me, animStartValue, animEndValue);
}
void setTimeStartEndAnimation(entity me, float s, float e)
me.setter = s;
}
-void tickAnimation(entity me, float time)
+void tickAnimation(entity me, float tickTime)
{
- if (me.isStopped(me) || me.isFinished(me) || (time < me.startTime))
+ if (me.isStopped(me) || me.isFinished(me) || (tickTime < me.startTime))
return;
- if (time >= (me.startTime + me.duration))
+ if (tickTime >= (me.startTime + me.duration))
me.finishAnim(me);
else
- me.value = me.calcValue(me, (time - me.startTime), me.duration, me.startValue, me.delta);
+ me.value = me.calcValue(me, (tickTime - me.startTime), me.duration, me.startValue, me.delta);
me.setter(me.object, me.value);
}
-float calcValueAnimation(entity me, float time, float duration, float startValue, float delta)
+float calcValueAnimation(entity me, float tickTime, float animDuration, float animStartValue, float animDelta)
{
- return startValue;
+ return animStartValue;
}
float isStoppedAnimation(entity me)
{
me.value = me.delta + me.startValue;
me.finished = TRUE;
+ me.setter(me.object, me.value);
}
-void setterDummy(entity object, float value)
+void setterDummy(entity obj, float objValue)
{
}
CLASS(AnimHost) EXTENDS(Object)
METHOD(AnimHost, addAnim, void(entity, entity))
METHOD(AnimHost, removeAnim, void(entity, entity))
+ METHOD(AnimHost, removeAllAnim, void(entity))
+ METHOD(AnimHost, removeObjAnim, void(entity, entity))
METHOD(AnimHost, stopAllAnim, void(entity))
+ METHOD(AnimHost, stopObjAnim, void(entity, entity))
+ METHOD(AnimHost, resumeAllAnim, void(entity))
+ METHOD(AnimHost, resumeObjAnim, void(entity, entity))
METHOD(AnimHost, finishAllAnim, void(entity))
+ METHOD(AnimHost, finishObjAnim, void(entity, entity))
METHOD(AnimHost, tickAll, void(entity))
ATTRIB(AnimHost, firstChild, entity, NULL)
ATTRIB(AnimHost, lastChild, entity, NULL)
me.lastChild = p;
}
+void removeAllAnimAnimHost(entity me)
+{
+ entity e, tmp;
+ for(e = me.firstChild; e; e = e.nextSibling)
+ {
+ tmp = e;
+ e = tmp.prevSibling;
+ me.removeAnim(me, tmp);
+ }
+}
+
+void removeObjAnimAnimHost(entity me, entity obj)
+{
+ entity e, tmp;
+ for(e = me.firstChild; e; e = e.nextSibling)
+ {
+ if (e.object == obj)
+ {
+ tmp = e;
+ e = tmp.prevSibling;
+ me.removeAnim(me, tmp);
+ }
+ }
+}
+
void stopAllAnimAnimHost(entity me)
{
entity e;
}
}
+void stopObjAnimAnimHost(entity me, entity obj)
+{
+ entity e;
+ for(e = me.firstChild; e; e = e.nextSibling)
+ {
+ if (e.object == obj)
+ {
+ e.stopAnim(e);
+ }
+ }
+}
+
+void resumeAllAnimAnimHost(entity me)
+{
+ entity e;
+ for(e = me.firstChild; e; e = e.nextSibling)
+ {
+ e.resumeAnim(e);
+ }
+}
+
+void resumeObjAnimAnimHost(entity me, entity obj)
+{
+ entity e;
+ for(e = me.firstChild; e; e = e.nextSibling)
+ {
+ if (e.object == obj)
+ {
+ e.resumeAnim(e);
+ }
+ }
+}
+
void finishAllAnimAnimHost(entity me)
{
entity e, tmp;
tmp = e;
e = tmp.prevSibling;
me.removeAnim(me, tmp);
- e.finishAnim(tmp);
+ tmp.finishAnim(tmp);
+ }
+}
+
+void finishObjAnimAnimHost(entity me, entity obj)
+{
+ entity e, tmp;
+ for(e = me.firstChild; e; e = e.nextSibling)
+ {
+ if (e.object == obj)
+ {
+ tmp = e;
+ e = tmp.prevSibling;
+ me.removeAnim(me, tmp);
+ tmp.finishAnim(tmp);
+ }
}
}
#endif
#ifdef IMPLEMENTATION
-entity makeHostedEasing(entity obj, void(entity, float) setter, float(float, float, float, float) func, float duration, float startValue, float end)
+entity makeHostedEasing(entity obj, void(entity, float) objSetter, float(float, float, float, float) func, float animDuration, float animStartValue, float animEnd)
{
entity me;
- me = makeEasing(obj, setter, func, time, duration, startValue, end);
+ me = makeEasing(obj, objSetter, func, time, animDuration, animStartValue, animEnd);
anim.addAnim(anim, me);
return me;
}
-entity makeEasing(entity obj, void(entity, float) setter, float(float, float, float, float) func, float startTime, float duration, float startValue, float end)
+entity makeEasing(entity obj, void(entity, float) objSetter, float(float, float, float, float) func, float animStartTime, float animDuration, float animStartValue, float animEnd)
{
entity me;
me = spawnEasing();
- me.configureAnimation(me, obj, setter, startTime, duration, startValue, end);
+ me.configureAnimation(me, obj, objSetter, animStartTime, animDuration, animStartValue, animEnd);
me.setMath(me, func);
return me;
}
-float calcValueEasing(entity me, float time, float duration, float start, float delta)
+float calcValueEasing(entity me, float tickTime, float animDuration, float animStart, float animDelta)
{
- return me.math(time, duration, start, delta);
+ return me.math(tickTime, animDuration, animStart, animDelta);
}
void setMathEasing(entity me, float(float, float, float, float) func)
me.math = func;
}
-float easingLinear(float time, float duration, float start, float delta)
+float easingLinear(float tickTime, float animDuration, float animStart, float animDelta)
{
- return (delta * (time / duration)) + start;
+ return (animDelta * (tickTime / animDuration)) + animStart;
}
-float easingQuadIn(float time, float duration, float start, float delta)
+float easingQuadIn(float tickTime, float animDuration, float animStart, float animDelta)
{
- float frac = time / duration;
- return (delta * frac * frac) + start;
+ float frac = tickTime / animDuration;
+ return (animDelta * frac * frac) + animStart;
}
-float easingQuadOut(float time, float duration, float start, float delta)
+float easingQuadOut(float tickTime, float animDuration, float animStart, float animDelta)
{
- float frac = time / duration;
- return (-delta * frac * (frac - 2)) + start;
+ float frac = tickTime / animDuration;
+ return (-animDelta * frac * (frac - 2)) + animStart;
}
-float easingQuadInOut(float time, float duration, float start, float delta)
+float easingQuadInOut(float tickTime, float animDuration, float animStart, float animDelta)
{
- if (time < (duration / 2))
+ if (tickTime < (animDuration / 2))
{
- return easingQuadIn(time, (duration / 2), start, (delta / 2));
+ return easingQuadIn(tickTime, (animDuration / 2), animStart, (animDelta / 2));
}
else
{
- return easingQuadOut((time - (duration / 2)), (duration / 2), (start + (delta / 2)), (delta / 2));
+ return easingQuadOut((tickTime - (animDuration / 2)), (animDuration / 2), (animStart + (animDelta / 2)), (animDelta / 2));
}
}
#endif
#ifdef IMPLEMENTATION
-entity makeHostedKeyframe(entity obj, void(entity, float) setter, float duration, float start, float end)
+entity makeHostedKeyframe(entity obj, void(entity, float) objSetter, float animDuration, float animStart, float animEnd)
{
entity me;
- me = makeKeyframe(obj, setter, duration, start, end);
+ me = makeKeyframe(obj, objSetter, animDuration, animStart, animEnd);
anim.addAnim(anim, me);
return me;
}
-entity makeKeyframe(entity obj, void(entity, float) setter, float duration, float start, float end)
+entity makeKeyframe(entity obj, void(entity, float) objSetter, float animDuration, float animStart, float animEnd)
{
entity me;
me = spawnKeyframe();
- me.configureAnimation(me, obj, setter, time, duration, start, end);
+ me.configureAnimation(me, obj, objSetter, time, animDuration, animStart, animEnd);
return me;
}
-entity addEasingKeyframe(entity me, float durationTime, float end, float(float, float, float, float) func)
+entity addEasingKeyframe(entity me, float animDurationTime, float animEnd, float(float, float, float, float) func)
{
entity other;
- other = makeEasing(me.object, me.setter, func, getNewChildStart(me), getNewChildDuration(me, durationTime), getNewChildValue(me), end);
+ other = makeEasing(me.object, me.setter, func, getNewChildStart(me), getNewChildDuration(me, animDurationTime), getNewChildValue(me), animEnd);
me.addAnim(me, other);
return other;
}
me.lastChild = other;
}
-float calcValueKeyframe(entity me, float time, float duration, float startValue, float delta)
+float calcValueKeyframe(entity me, float tickTime, float animDuration, float animStartValue, float animDelta)
{
if (me.currentChild)
if (me.currentChild.isFinished(me.currentChild))
if (me.currentChild)
{
- me.currentChild.tick(me.currentChild, time);
+ me.currentChild.tick(me.currentChild, tickTime);
return me.currentChild.value;
}
- return startValue + delta;
+ return animStartValue + animDelta;
}
#endif
#include "xonotic/credits.c"
#include "xonotic/dialog_multiplayer_playersetup_weapons.c"
#include "xonotic/weaponslist.c"
-#include "xonotic/dialog_multiplayer_playersetup_radar.c"
+#include "xonotic/dialog_multiplayer_playersetup_waypoint.c"
#include "xonotic/dialog_multiplayer_demo.c"
#include "xonotic/demolist.c"
#include "xonotic/colorpicker.c"
#include "xonotic/cvarlist.c"
#include "xonotic/dialog_settings_misc_cvars.c"
+#include "xonotic/dialog_hudsetup_exit.c"
+#include "xonotic/dialog_hudpanel_notification.c"
+#include "xonotic/dialog_hudpanel_inventory.c"
+#include "xonotic/dialog_hudpanel_healtharmor.c"
+#include "xonotic/dialog_hudpanel_powerups.c"
+#include "xonotic/dialog_hudpanel_racetimer.c"
+#include "xonotic/dialog_hudpanel_pressedkeys.c"
+#include "xonotic/dialog_hudpanel_radar.c"
+#include "xonotic/dialog_hudpanel_score.c"
+#include "xonotic/dialog_hudpanel_timer.c"
+#include "xonotic/dialog_hudpanel_vote.c"
+#include "xonotic/dialog_hudpanel_modicons.c"
+#include "xonotic/dialog_hudpanel_chat.c"
+#include "xonotic/dialog_hudpanel_weaponicons.c"
return;
}
+ if(argv(0) == "directpanelhudmenu")
+ {
+ highlightedPanel = stof(argv(1));
+ // switch to a menu item
+ m_goto(strcat("HUD", HUD_Panel_GetName(highlightedPanel)));
+ return;
+ }
+
if(argv(0) == "skinselect")
{
m_goto_skin_selector();
if(hit)
{
// calculate new pos to v
- float delta;
- delta = (pos_y - me.pressOffset) / (1 - (me.controlBottom - me.controlTop)) * (me.nItems * me.itemHeight - 1);
- me.scrollPos = me.previousValue + delta;
+ float d;
+ d = (pos_y - me.pressOffset) / (1 - (me.controlBottom - me.controlTop)) * (me.nItems * me.itemHeight - 1);
+ me.scrollPos = me.previousValue + d;
}
else
me.scrollPos = me.previousValue;
METHOD(Slider, valueToText, string(entity, float))
METHOD(Slider, toString, string(entity))
METHOD(Slider, setValue, void(entity, float))
+ METHOD(Slider, setSliderValue, void(entity, float))
METHOD(Slider, showNotify, void(entity))
ATTRIB(Slider, src, string, string_null)
ATTRIB(Slider, focusable, float, 1)
ATTRIB(Slider, value, float, 0)
+ ATTRIB(Slider, animated, float, 1)
+ ATTRIB(Slider, sliderValue, float, 0)
ATTRIB(Slider, valueMin, float, 0)
ATTRIB(Slider, valueMax, float, 0)
ATTRIB(Slider, valueStep, float, 0)
#ifdef IMPLEMENTATION
void setValueSlider(entity me, float val)
{
+ if (me.animated) {
+ anim.stopObjAnim(anim, me);
+ anim.removeObjAnim(anim, me);
+ makeHostedEasing(me, setSliderValueSlider, easingQuadInOut, 1, me.sliderValue, val);
+ } else {
+ me.setSliderValue(me, val);
+ }
me.value = val;
}
+void setSliderValueSlider(entity me, float val)
+{
+ me.sliderValue = val;
+}
string toStringSlider(entity me)
{
return strcat(ftos(me.value), " (", me.valueToText(me, me.value), ")");
void configureSliderValuesSlider(entity me, float theValueMin, float theValue, float theValueMax, float theValueStep, float theValueKeyStep, float theValuePageStep)
{
me.value = theValue;
+ me.sliderValue = theValue;
me.valueStep = theValueStep;
me.valueMin = theValueMin;
me.valueMax = theValueMax;
float mouseDragSlider(entity me, vector pos)
{
float hit;
- float v;
+ float v, animed;
if(me.disabled)
return 0;
+
+ anim.finishObjAnim(anim, me);
+ animed = me.animated;
+ me.animated = false;
+
if(me.pressed)
{
hit = 1;
else
me.setValue(me, me.previousValue);
}
+
+ me.animated = animed;
+
return 1;
}
float mousePressSlider(entity me, vector pos)
if(me.disabled)
draw_alpha *= me.disabledAlpha;
draw_ButtonPicture('0 0 0', strcat(me.src, "_s"), eX * (1 - me.textSpace) + eY, me.color2, 1);
- if(almost_in_bounds(me.valueMin, me.value, me.valueMax))
+ if(almost_in_bounds(me.valueMin, me.sliderValue, me.valueMax))
{
- controlLeft = (me.value - me.valueMin) / (me.valueMax - me.valueMin) * (1 - me.textSpace - me.controlWidth);
+ controlLeft = (me.sliderValue - me.valueMin) / (me.valueMax - me.valueMin) * (1 - me.textSpace - me.controlWidth);
if(me.disabled)
draw_Picture(eX * controlLeft, strcat(me.src, "_d"), eX * me.controlWidth + eY, me.colorD, 1);
else if(me.pressed)
drawLabel(me);
me.text = string_null; // TEMPSTRING!
}
-#endif
\ No newline at end of file
+#endif
for(i = 0; i < me.nValues; ++i)
if(me.valueToIdentifier(me, i) == id)
{
- me.value = i;
+ setValueSlider( me, i );
return;
}
- me.value = -1;
+ setValueSlider( me, -1 );
}
string getIdentifierTextSlider(entity me)
{
check_unacceptable_compiler_bugs();
+#ifdef WATERMARK
+ print("^4MQC Build information: ", WATERMARK(), "\n");
+#endif
+
// list all game dirs (TEST)
if(cvar("developer"))
{
void(string img, float a, string algn, float force1) drawBackground =
{
+ if(main.mainNexposee.ModalController_state == 0)
+ return;
+
vector v;
float i, l;
string c;
float preMenuInit(); // you have to define this for pre-menu initialization. Return 0 if initialization needs to be retried a frame later, 1 if it succeeded.
void preMenuDraw(); // this is run before the menu is drawn. You may put some stuff there that has to be done every frame.
void postMenuDraw(); // this is run just after the menu is drawn (or not). Useful to draw something over everything else.
+
+float highlightedPanel;
--- /dev/null
+#ifdef INTERFACE
+CLASS(XonoticHUDChatDialog) EXTENDS(XonoticRootDialog)
+ METHOD(XonoticHUDChatDialog, fill, void(entity))
+ ATTRIB(XonoticHUDChatDialog, title, string, "Chat Panel Setup")
+ ATTRIB(XonoticHUDChatDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
+ ATTRIB(XonoticHUDChatDialog, intendedWidth, float, 0.4)
+ ATTRIB(XonoticHUDChatDialog, rows, float, 15)
+ ATTRIB(XonoticHUDChatDialog, columns, float, 4)
+ ATTRIB(XonoticHUDChatDialog, name, string, "HUDchat")
+ENDCLASS(XonoticHUDChatDialog)
+#endif
+
+#ifdef IMPLEMENTATION
+void fillXonoticHUDChatDialog(entity me)
+{
+ entity e;
+ me.TR(me);
+ me.TR(me);
+ me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_chat", "On/Off"));
+ me.TR(me);
+ me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Team Color:"));
+ me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_chat_bg_color_team"));
+ me.TR(me);
+ me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Background Alpha:"));
+ me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_chat_bg_alpha"));
+ me.TR(me);
+ me.TR(me);
+ me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Font size:"));
+ me.TD(me, 1, 2, e = makeXonoticSlider(6, 16, 1, "con_chatsize"));
+ me.TR(me);
+ me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Message lifetime:"));
+ me.TD(me, 1, 2, e = makeXonoticSlider(16, 40, 2, "con_chattime"));
+ me.TR(me);
+ me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "con_chatsound", "Message sound beep"));
+ //me.gotoRC(me, me.rows - 1, 0);
+ //me.TD(me, 1, me.columns, e = makeXonoticCommandButton("Exit Setup", '0 0 0', "_hud_configure 0", 1));
+}
+#endif
--- /dev/null
+#ifdef INTERFACE
+CLASS(XonoticHUDHealthArmorDialog) EXTENDS(XonoticRootDialog)
+ METHOD(XonoticHUDHealthArmorDialog, fill, void(entity))
+ ATTRIB(XonoticHUDHealthArmorDialog, title, string, "Health/Armor Panel Setup")
+ ATTRIB(XonoticHUDHealthArmorDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
+ ATTRIB(XonoticHUDHealthArmorDialog, intendedWidth, float, 0.4)
+ ATTRIB(XonoticHUDHealthArmorDialog, rows, float, 15)
+ ATTRIB(XonoticHUDHealthArmorDialog, columns, float, 4)
+ ATTRIB(XonoticHUDHealthArmorDialog, name, string, "HUDhealtharmor")
+ENDCLASS(XonoticHUDHealthArmorDialog)
+#endif
+
+#ifdef IMPLEMENTATION
+void fillXonoticHUDHealthArmorDialog(entity me)
+{
+ entity e;
+ me.TR(me);
+ me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Status:"));
+ me.TD(me, 1, 2, e = makeXonoticTextSlider("hud_healtharmor"));
+ e.addValue(e, "Disabled", "0");
+ e.addValue(e, "Enabled", "1");
+ e.addValue(e, "Combined h/a", "2");
+ e.configureXonoticTextSliderValues(e);
+ me.TR(me);
+
+ me.TR(me);
+ me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Team Color:"));
+ me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_healtharmor_bg_color_team"));
+ me.TR(me);
+ me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Background Alpha:"));
+ me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_healtharmor_bg_alpha"));
+ me.TR(me);
+ me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_healtharmor_flip", "Flip"));
+ me.TR(me);
+ me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_healtharmor_mirror", "Mirror"));
+ //me.gotoRC(me, me.rows - 1, 0);
+ //me.TD(me, 1, me.columns, e = makeXonoticCommandButton("Exit Setup", '0 0 0', "_hud_configure 0", 1));
+}
+#endif
--- /dev/null
+#ifdef INTERFACE
+CLASS(XonoticHUDInventoryDialog) EXTENDS(XonoticRootDialog)
+ METHOD(XonoticHUDInventoryDialog, fill, void(entity))
+ ATTRIB(XonoticHUDInventoryDialog, title, string, "Inventory Panel Setup")
+ ATTRIB(XonoticHUDInventoryDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
+ ATTRIB(XonoticHUDInventoryDialog, intendedWidth, float, 0.4)
+ ATTRIB(XonoticHUDInventoryDialog, rows, float, 15)
+ ATTRIB(XonoticHUDInventoryDialog, columns, float, 4)
+ ATTRIB(XonoticHUDInventoryDialog, name, string, "HUDinventory")
+ENDCLASS(XonoticHUDInventoryDialog)
+#endif
+
+#ifdef IMPLEMENTATION
+void fillXonoticHUDInventoryDialog(entity me)
+{
+ entity e;
+ me.TR(me);
+ me.TR(me);
+ me.TD(me, 1, 3, e = makeXonoticCheckBox(1, "hud_inventory", "On/Off"));
+ me.TR(me);
+ me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Team Color:"));
+ me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_inventory_bg_color_team"));
+ me.TR(me);
+ me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Background Alpha:"));
+ me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_inventory_bg_alpha"));
+ me.TR(me);
+ me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_inventory_onlycurrent", "Show Current Ammo Only"));
+ me.TR(me);
+ //me.gotoRC(me, me.rows - 1, 0);
+ //me.TD(me, 1, me.columns, e = makeXonoticCommandButton("Exit Setup", '0 0 0', "_hud_configure 0", 1));
+}
+#endif
--- /dev/null
+#ifdef INTERFACE
+CLASS(XonoticHUDModIconsDialog) EXTENDS(XonoticRootDialog)
+ METHOD(XonoticHUDModIconsDialog, fill, void(entity))
+ ATTRIB(XonoticHUDModIconsDialog, title, string, "Mod Icons Panel Setup")
+ ATTRIB(XonoticHUDModIconsDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
+ ATTRIB(XonoticHUDModIconsDialog, intendedWidth, float, 0.4)
+ ATTRIB(XonoticHUDModIconsDialog, rows, float, 15)
+ ATTRIB(XonoticHUDModIconsDialog, columns, float, 4)
+ ATTRIB(XonoticHUDModIconsDialog, name, string, "HUDmodicons")
+ENDCLASS(XonoticHUDModIconsDialog)
+#endif
+
+#ifdef IMPLEMENTATION
+void fillXonoticHUDModIconsDialog(entity me)
+{
+ entity e;
+ me.TR(me);
+ me.TR(me);
+ me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_modicons", "On/Off"));
+ me.TR(me);
+ me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Team Color:"));
+ me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_modicons_bg_color_team"));
+ me.TR(me);
+ me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Background Alpha:"));
+ me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_modicons_bg_alpha"));
+ me.TR(me);
+ //me.gotoRC(me, me.rows - 1, 0);
+ //me.TD(me, 1, me.columns, e = makeXonoticCommandButton("Exit Setup", '0 0 0', "_hud_configure 0", 1));
+}
+#endif
--- /dev/null
+#ifdef INTERFACE
+CLASS(XonoticHUDNotificationDialog) EXTENDS(XonoticRootDialog)
+ METHOD(XonoticHUDNotificationDialog, fill, void(entity))
+ ATTRIB(XonoticHUDNotificationDialog, title, string, "Notification Panel Setup")
+ ATTRIB(XonoticHUDNotificationDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
+ ATTRIB(XonoticHUDNotificationDialog, intendedWidth, float, 0.4)
+ ATTRIB(XonoticHUDNotificationDialog, rows, float, 15)
+ ATTRIB(XonoticHUDNotificationDialog, columns, float, 4)
+ ATTRIB(XonoticHUDNotificationDialog, name, string, "HUDnotify")
+ENDCLASS(XonoticHUDNotificationDialog)
+#endif
+
+#ifdef IMPLEMENTATION
+void fillXonoticHUDNotificationDialog(entity me)
+{
+ entity e;
+ me.TR(me);
+ me.TR(me);
+ me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_notify", "On/Off"));
+ me.TR(me);
+ me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Team Color:"));
+ me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_notify_bg_color_team"));
+ me.TR(me);
+ me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Background Alpha:"));
+ me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_notify_bg_alpha"));
+ me.TR(me);
+ me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_notify_flip", "Flip"));
+ me.TR(me);
+ me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Message lifetime:"));
+ me.TD(me, 1, 2, e = makeXonoticSlider(3, 15, 1, "hud_notify_time"));
+ me.TR(me);
+ me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Message fadetime:"));
+ me.TD(me, 1, 2, e = makeXonoticSlider(1, 5, 1, "hud_notify_fadetime"));
+ me.TR(me);
+ me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_notify_print", "Also print messages to console"));
+ me.TR(me);
+ //me.gotoRC(me, me.rows - 1, 0);
+ //me.TD(me, 1, me.columns, e = makeXonoticCommandButton("Exit Setup", '0 0 0', "_hud_configure 0", 1));
+}
+#endif
--- /dev/null
+#ifdef INTERFACE
+CLASS(XonoticHUDPowerupsDialog) EXTENDS(XonoticRootDialog)
+ METHOD(XonoticHUDPowerupsDialog, fill, void(entity))
+ ATTRIB(XonoticHUDPowerupsDialog, title, string, "Powerups Panel Setup")
+ ATTRIB(XonoticHUDPowerupsDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
+ ATTRIB(XonoticHUDPowerupsDialog, intendedWidth, float, 0.4)
+ ATTRIB(XonoticHUDPowerupsDialog, rows, float, 15)
+ ATTRIB(XonoticHUDPowerupsDialog, columns, float, 4)
+ ATTRIB(XonoticHUDPowerupsDialog, name, string, "HUDpowerups")
+ENDCLASS(XonoticHUDPowerupsDialog)
+#endif
+
+#ifdef IMPLEMENTATION
+void fillXonoticHUDPowerupsDialog(entity me)
+{
+ entity e;
+ me.TR(me);
+ me.TR(me);
+ me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_powerups", "On/Off"));
+ me.TR(me);
+ me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Team Color:"));
+ me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_powerups_bg_color_team"));
+ me.TR(me);
+ me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Background Alpha:"));
+ me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_powerups_bg_alpha"));
+ me.TR(me);
+ me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_powerups_flip", "Flip"));
+ me.TR(me);
+ me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_powerups_mirror", "Mirror"));
+ me.TR(me);
+ //me.gotoRC(me, me.rows - 1, 0);
+ //me.TD(me, 1, me.columns, e = makeXonoticCommandButton("Exit Setup", '0 0 0', "_hud_configure 0", 1));
+}
+#endif
--- /dev/null
+#ifdef INTERFACE
+CLASS(XonoticHUDPressedKeysDialog) EXTENDS(XonoticRootDialog)
+ METHOD(XonoticHUDPressedKeysDialog, fill, void(entity))
+ ATTRIB(XonoticHUDPressedKeysDialog, title, string, "Pressed Keys Panel Setup")
+ ATTRIB(XonoticHUDPressedKeysDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
+ ATTRIB(XonoticHUDPressedKeysDialog, intendedWidth, float, 0.4)
+ ATTRIB(XonoticHUDPressedKeysDialog, rows, float, 15)
+ ATTRIB(XonoticHUDPressedKeysDialog, columns, float, 4)
+ ATTRIB(XonoticHUDPressedKeysDialog, name, string, "HUDpressedkeys")
+ENDCLASS(XonoticHUDPressedKeysDialog)
+#endif
+
+#ifdef IMPLEMENTATION
+void fillXonoticHUDPressedKeysDialog(entity me)
+{
+ entity e;
+ me.TR(me);
+ me.TR(me);
+ me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_pressedkeys", "On/Off"));
+ me.TR(me);
+ me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Team Color:"));
+ me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_pressedkeys_bg_color_team"));
+ me.TR(me);
+ me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Background Alpha:"));
+ me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_pressedkeys_bg_alpha"));
+ me.TR(me);
+ //me.gotoRC(me, me.rows - 1, 0);
+ //me.TD(me, 1, me.columns, e = makeXonoticCommandButton("Exit Setup", '0 0 0', "_hud_configure 0", 1));
+}
+#endif
--- /dev/null
+#ifdef INTERFACE
+CLASS(XonoticHUDRaceTimerDialog) EXTENDS(XonoticRootDialog)
+ METHOD(XonoticHUDRaceTimerDialog, fill, void(entity))
+ ATTRIB(XonoticHUDRaceTimerDialog, title, string, "Race Timer Panel Setup")
+ ATTRIB(XonoticHUDRaceTimerDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
+ ATTRIB(XonoticHUDRaceTimerDialog, intendedWidth, float, 0.4)
+ ATTRIB(XonoticHUDRaceTimerDialog, rows, float, 15)
+ ATTRIB(XonoticHUDRaceTimerDialog, columns, float, 4)
+ ATTRIB(XonoticHUDRaceTimerDialog, name, string, "HUDracetimer")
+ENDCLASS(XonoticHUDRaceTimerDialog)
+#endif
+
+#ifdef IMPLEMENTATION
+void fillXonoticHUDRaceTimerDialog(entity me)
+{
+ entity e;
+ me.TR(me);
+ me.TR(me);
+ me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_racetimer", "On/Off"));
+ me.TR(me);
+ me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Team Color:"));
+ me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_racetimer_bg_color_team"));
+ me.TR(me);
+ me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Background Alpha:"));
+ me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_racetimer_bg_alpha"));
+ me.TR(me);
+ //me.gotoRC(me, me.rows - 1, 0);
+ //me.TD(me, 1, me.columns, e = makeXonoticCommandButton("Exit Setup", '0 0 0', "_hud_configure 0", 1));
+}
+#endif
--- /dev/null
+#ifdef INTERFACE
+CLASS(XonoticHUDRadarDialog) EXTENDS(XonoticRootDialog)
+ METHOD(XonoticHUDRadarDialog, fill, void(entity))
+ ATTRIB(XonoticHUDRadarDialog, title, string, "Radar Panel Setup")
+ ATTRIB(XonoticHUDRadarDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
+ ATTRIB(XonoticHUDRadarDialog, intendedWidth, float, 0.4)
+ ATTRIB(XonoticHUDRadarDialog, rows, float, 15)
+ ATTRIB(XonoticHUDRadarDialog, columns, float, 4)
+ ATTRIB(XonoticHUDRadarDialog, name, string, "HUDradar")
+ENDCLASS(XonoticHUDRadarDialog)
+#endif
+
+#ifdef IMPLEMENTATION
+void fillXonoticHUDRadarDialog(entity me)
+{
+ entity e;
+ me.TR(me);
+ me.TR(me);
+ me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_radar", "On/Off"));
+ me.TR(me);
+ me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Team Color:"));
+ me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_radar_bg_color_team"));
+ me.TR(me);
+ me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Background Alpha:"));
+ me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_radar_bg_alpha"));
+ me.TR(me);
+ me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Foreground Alpha:"));
+ me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_radar_foreground_alpha"));
+ me.TR(me);
+ me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Rotation:"));
+ me.TD(me, 1, 2, e = makeXonoticTextSlider("hud_radar_rotation"));
+ e.addValue(e, "Player", "0");
+ e.addValue(e, "West", "1");
+ e.addValue(e, "South", "2");
+ e.addValue(e, "East", "3");
+ e.addValue(e, "North", "4");
+ e.configureXonoticTextSliderValues(e);
+ me.TR(me);
+ me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Zoom:"));
+ me.TD(me, 1, 2, e = makeXonoticTextSlider("hud_radar_zoommode"));
+ e.addValue(e, "Default", "0");
+ e.addValue(e, "Zoomed", "1");
+ e.addValue(e, "Always Zoomed", "2");
+ e.addValue(e, "Zoomed Out", "3");
+ e.configureXonoticTextSliderValues(e);
+ me.TR(me);
+ //me.gotoRC(me, me.rows - 1, 0);
+ //me.TD(me, 1, me.columns, e = makeXonoticCommandButton("Exit Setup", '0 0 0', "_hud_configure 0", 1));
+}
+#endif
--- /dev/null
+#ifdef INTERFACE
+CLASS(XonoticHUDScoreDialog) EXTENDS(XonoticRootDialog)
+ METHOD(XonoticHUDScoreDialog, fill, void(entity))
+ ATTRIB(XonoticHUDScoreDialog, title, string, "Score Panel Setup")
+ ATTRIB(XonoticHUDScoreDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
+ ATTRIB(XonoticHUDScoreDialog, intendedWidth, float, 0.4)
+ ATTRIB(XonoticHUDScoreDialog, rows, float, 15)
+ ATTRIB(XonoticHUDScoreDialog, columns, float, 4)
+ ATTRIB(XonoticHUDScoreDialog, name, string, "HUDscore")
+ENDCLASS(XonoticHUDScoreDialog)
+#endif
+
+#ifdef IMPLEMENTATION
+void fillXonoticHUDScoreDialog(entity me)
+{
+ entity e;
+ me.TR(me);
+ me.TR(me);
+ me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_score", "On/Off"));
+ me.TR(me);
+ me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Team Color:"));
+ me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_score_bg_color_team"));
+ me.TR(me);
+ me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Background Alpha:"));
+ me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_score_bg_alpha"));
+ me.TR(me);
+ //me.gotoRC(me, me.rows - 1, 0);
+ //me.TD(me, 1, me.columns, e = makeXonoticCommandButton("Exit Setup", '0 0 0', "_hud_configure 0", 1));
+}
+#endif
--- /dev/null
+#ifdef INTERFACE
+CLASS(XonoticHUDTimerDialog) EXTENDS(XonoticRootDialog)
+ METHOD(XonoticHUDTimerDialog, fill, void(entity))
+ ATTRIB(XonoticHUDTimerDialog, title, string, "Timer Panel Setup")
+ ATTRIB(XonoticHUDTimerDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
+ ATTRIB(XonoticHUDTimerDialog, intendedWidth, float, 0.4)
+ ATTRIB(XonoticHUDTimerDialog, rows, float, 15)
+ ATTRIB(XonoticHUDTimerDialog, columns, float, 4)
+ ATTRIB(XonoticHUDTimerDialog, name, string, "HUDtimer")
+ENDCLASS(XonoticHUDTimerDialog)
+#endif
+
+#ifdef IMPLEMENTATION
+void fillXonoticHUDTimerDialog(entity me)
+{
+ entity e;
+ me.TR(me);
+ me.TR(me);
+ me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_timer", "On/Off"));
+ me.TR(me);
+ me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Team Color:"));
+ me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_timer_bg_color_team"));
+ me.TR(me);
+ me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Background Alpha:"));
+ me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_timer_bg_alpha"));
+ me.TR(me);
+ //me.gotoRC(me, me.rows - 1, 0);
+ //me.TD(me, 1, me.columns, e = makeXonoticCommandButton("Exit Setup", '0 0 0', "_hud_configure 0", 1));
+}
+#endif
--- /dev/null
+#ifdef INTERFACE
+CLASS(XonoticHUDVoteDialog) EXTENDS(XonoticRootDialog)
+ METHOD(XonoticHUDVoteDialog, fill, void(entity))
+ ATTRIB(XonoticHUDVoteDialog, title, string, "Vote Panel Setup")
+ ATTRIB(XonoticHUDVoteDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
+ ATTRIB(XonoticHUDVoteDialog, intendedWidth, float, 0.4)
+ ATTRIB(XonoticHUDVoteDialog, rows, float, 15)
+ ATTRIB(XonoticHUDVoteDialog, columns, float, 4)
+ ATTRIB(XonoticHUDVoteDialog, name, string, "HUDvote")
+ENDCLASS(XonoticHUDVoteDialog)
+#endif
+
+#ifdef IMPLEMENTATION
+void fillXonoticHUDVoteDialog(entity me)
+{
+ entity e;
+ me.TR(me);
+ me.TR(me);
+ me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_vote", "On/Off"));
+ me.TR(me);
+ me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Team Color:"));
+ me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_vote_bg_color_team"));
+ me.TR(me);
+ me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Background Alpha:"));
+ me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_vote_bg_alpha"));
+ me.TR(me);
+ //me.gotoRC(me, me.rows - 1, 0);
+ //me.TD(me, 1, me.columns, e = makeXonoticCommandButton("Exit Setup", '0 0 0', "_hud_configure 0", 1));
+}
+#endif
--- /dev/null
+#ifdef INTERFACE
+CLASS(XonoticHUDWeaponIconsDialog) EXTENDS(XonoticRootDialog)
+ METHOD(XonoticHUDWeaponIconsDialog, fill, void(entity))
+ ATTRIB(XonoticHUDWeaponIconsDialog, title, string, "Weapon Icons Panel Setup")
+ ATTRIB(XonoticHUDWeaponIconsDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
+ ATTRIB(XonoticHUDWeaponIconsDialog, intendedWidth, float, 0.4)
+ ATTRIB(XonoticHUDWeaponIconsDialog, rows, float, 15)
+ ATTRIB(XonoticHUDWeaponIconsDialog, columns, float, 4)
+ ATTRIB(XonoticHUDWeaponIconsDialog, name, string, "HUDweaponicons")
+ENDCLASS(XonoticHUDWeaponIconsDialog)
+#endif
+
+#ifdef IMPLEMENTATION
+void fillXonoticHUDWeaponIconsDialog(entity me)
+{
+ entity e;
+ me.TR(me);
+ me.TR(me);
+ me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_weaponicons", "On/Off"));
+ me.TR(me);
+ me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Team Color:"));
+ me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_weaponicons_bg_color_team"));
+ me.TR(me);
+ me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Background Alpha:"));
+ me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_weaponicons_bg_alpha"));
+ me.TR(me);
+ me.TD(me, 1, 3, e = makeXonoticCheckBox(1, "hud_weaponicons_number", "Show Weapon Number"));
+ me.TR(me);
+ //me.gotoRC(me, me.rows - 1, 0);
+ //me.TD(me, 1, me.columns, e = makeXonoticCommandButton("Exit Setup", '0 0 0', "_hud_configure 0", 1));
+}
+#endif
--- /dev/null
+#ifdef INTERFACE
+CLASS(XonoticHUDExitDialog) EXTENDS(XonoticRootDialog)
+ METHOD(XonoticHUDExitDialog, fill, void(entity))
+ ATTRIB(XonoticHUDExitDialog, title, string, "HUD Setup")
+ ATTRIB(XonoticHUDExitDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
+ ATTRIB(XonoticHUDExitDialog, intendedWidth, float, 0.4)
+ ATTRIB(XonoticHUDExitDialog, rows, float, 15)
+ ATTRIB(XonoticHUDExitDialog, columns, float, 4)
+ ATTRIB(XonoticHUDExitDialog, name, string, "HUDExit")
+ENDCLASS(XonoticHUDExitDialog)
+
+#endif
+
+#ifdef IMPLEMENTATION
+void fillXonoticHUDExitDialog(entity me)
+{
+ entity e;
+ me.TR(me);
+ me.TD(me, 1, 4, makeXonoticTextLabel(0, "Panel Defaults:"));
+ me.TR(me);
+ me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_bg", "Panel Background"));
+ me.TR(me);
+ me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Team Color:"));
+ me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_bg_color_team"));
+ me.TR(me);
+ me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Background Alpha:"));
+ me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_bg_alpha"));
+ me.TR(me);
+ me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Foreground Alpha:"));
+ me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_fg_alpha"));
+ me.TR(me);
+ me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Progress Bar Alpha:"));
+ me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_progressbar_alpha"));
+ me.TR(me);
+ me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_configure_checkcollisions", "Collision Check"));
+ me.TR(me);
+
+ me.TR(me);
+ me.TD(me, 1, 4, makeXonoticTextLabel(0, "Dock Settings:"));
+
+ me.TR(me);
+ me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Team Color:"));
+ me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_dock_color_team"));
+ me.TR(me);
+ me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Dock Alpha:"));
+ me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_dock_alpha"));
+ me.TR(me);
+
+ me.TR(me);
+ me.TD(me, 1, 4, makeXonoticTextLabel(0, "Grid Settings:"));
+
+ me.TR(me);
+ me.TD(me, 1, 3, e = makeXonoticCheckBox(1, "hud_configure_grid", "Snap Panel to Grid"));
+ me.gotoRC(me, me.rows - 1, 0);
+ me.TD(me, 1, me.columns, e = makeXonoticCommandButton("Exit Setup", '0 0 0', "_hud_configure 0", 1));
+}
+#endif
ATTRIB(XonoticPlayerSettingsTab, playerNameLabelAlpha, float, 0)
ENDCLASS(XonoticPlayerSettingsTab)
entity makeXonoticPlayerSettingsTab();
+
+void HUDSetup_Join_Click(entity me, entity btn);
#endif
#ifdef IMPLEMENTATION
+
entity makeXonoticPlayerSettingsTab()
{
entity me;
me.TD(me, 1, 2/3, e = makeXonoticRadioButton(1, "crosshair_hittest", "1.25", "Enemies"));
me.TR(me);
me.TDempty(me, 0.4);
- me.TD(me, 1, 2.2, e = makeXonoticButton("Radar, HUD & Waypoints...", '0 0 0'));
+ me.TD(me, 1, 2.2, e = makeXonoticButton("Waypoints Setup", '0 0 0'));
e.onClick = DialogOpenButton_Click;
- e.onClickEntity = main.radarDialog;
+ e.onClickEntity = main.waypointDialog;
+ me.TDempty(me, 0.5);
+ me.TR(me);
+ me.TDempty(me, 0.4);
+ me.TD(me, 1, 2.2, e = makeXonoticButton("HUD Setup", '0 0 0'));
+ e.onClick = HUDSetup_Join_Click;
+ e.onClickEntity = me;
me.TDempty(me, 0.5);
me.TR(me);
#ifdef ALLOW_FORCEMODELS
me.TD(me, 1, 2/3, e = makeXonoticRadioButton(2, "cl_forceplayermodelsfromxonotic", string_null, "Custom"));
me.TD(me, 1, 2/3, e = makeXonoticRadioButton(2, "cl_forceplayermodels", string_null, "All"));
#endif
- me.TR(me);
me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "cl_gentle", "Disable gore effects"));
me.TR(me);
me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Gibs:"));
me.gotoRC(me, me.rows - 1, 0);
me.TD(me, 1, me.columns, makeXonoticCommandButton("Apply immediately", '0 0 0', "color -1 -1;name \"$_cl_name\";cl_cmd sendcvar cl_weaponpriority;sendcvar cl_zoomfactor;sendcvar cl_zoomspeed;sendcvar cl_autoswitch;sendcvar cl_shownames;sendcvar cl_forceplayermodelsfromxonotic;sendcvar cl_forceplayermodels;playermodel $_cl_playermodel;playerskin $_cl_playerskin", COMMANDBUTTON_APPLY));
}
+void HUDSetup_Join_Click(entity me, entity btn)
+{
+ if(! (gamestatus & (GAME_CONNECTED | GAME_ISSERVER)))
+ {
+ localcmd("map hudsetup", "\n");
+ }
+ else
+ localcmd("togglemenu 0\n");
+ localcmd("_hud_configure 1", "\n");
+}
#endif
+++ /dev/null
-#ifdef INTERFACE
-CLASS(XonoticRadarDialog) EXTENDS(XonoticDialog)
- METHOD(XonoticRadarDialog, toString, string(entity))
- METHOD(XonoticRadarDialog, fill, void(entity))
- METHOD(XonoticRadarDialog, showNotify, void(entity))
- ATTRIB(XonoticRadarDialog, title, string, "Radar, HUD & Waypoints")
- ATTRIB(XonoticRadarDialog, color, vector, SKINCOLOR_DIALOG_RADAR)
- ATTRIB(XonoticRadarDialog, intendedWidth, float, 0.7)
- ATTRIB(XonoticRadarDialog, rows, float, 19)
- ATTRIB(XonoticRadarDialog, columns, float, 4)
-ENDCLASS(XonoticRadarDialog)
-#endif
-
-#ifdef IMPLEMENTATION
-void showNotifyXonoticRadarDialog(entity me)
-{
- loadAllCvars(me);
-}
-string toStringXonoticRadarDialog(entity me)
-{
- return "XXX";
-}
-void fillXonoticRadarDialog(entity me)
-{
- entity e, sl;
- me.TR(me);
- me.TD(me, 1, 4, makeXonoticTextLabel(0, "Radar settings:"));
- me.TR(me);
- me.TDempty(me, 0.2);
- me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, "Position:"));
- me.TD(me, 1, 1, e = makeXonoticRadioButton(1, "cl_teamradar_position", "0 0", "Top left"));
- me.TD(me, 1, 1, e = makeXonoticRadioButton(1, "cl_teamradar_position", "0.5 0", "Top middle"));
- me.TD(me, 1, 1, e = makeXonoticRadioButton(1, "cl_teamradar_position", "1 0", "Top right"));
- me.TR(me);
- me.TDempty(me, 1);
- me.TD(me, 1, 1, e = makeXonoticRadioButton(1, "cl_teamradar_position", "0 0.5", "Middle left"));
- me.TDempty(me, 1);
- me.TD(me, 1, 1, e = makeXonoticRadioButton(1, "cl_teamradar_position", "1 0.5", "Middle right"));
- me.TR(me);
- me.TDempty(me, 0.2);
- me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, "Size:"));
- me.TD(me, 1, 3, e = makeXonoticTextSlider("cl_teamradar_size"));
- e.addValue(e, "96x96", "96 96");
- e.addValue(e, "128x96", "128 96");
- e.addValue(e, "128x128", "128 128");
- e.addValue(e, "192x144", "192 144");
- e.addValue(e, "192x192", "192 192");
- e.addValue(e, "256x192", "256 192");
- e.addValue(e, "256x256", "256 256");
- e.configureXonoticTextSliderValues(e);
- me.TR(me);
- me.TDempty(me, 0.2);
- sl = makeXonoticSlider(0.20, 1, 0.01, "cl_teamradar_background_alpha");
- me.TD(me, 1, 0.8, e = makeXonoticSliderCheckBox(-1, 1, sl, "Background:"));
- me.TD(me, 1, 3, sl);
- me.TR(me);
- me.TR(me);
- me.TD(me, 1, 4, makeXonoticTextLabel(0, "HUD settings:"));
- me.TR(me);
- me.TDempty(me, 0.2);
- me.TD(me, 1, 0.8, e = makeXonoticCheckBoxEx(100, 110, "viewsize", "Background:"));
- me.TD(me, 1, 3, e = makeXonoticSlider(0, 1, 0.01, "sbar_alpha_bg"));
- setDependent(e, "viewsize", 0, 100);
- me.TR(me);
- me.TDempty(me, 0.2);
- me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, "Default red:"));
- me.TD(me, 1, 3, e = makeXonoticSlider(0, 1, 0.01, "sbar_color_bg_r"));
- setDependent(e, "viewsize", 0, 100);
- me.TR(me);
- me.TDempty(me, 0.2);
- me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, "Default green:"));
- me.TD(me, 1, 3, e = makeXonoticSlider(0, 1, 0.01, "sbar_color_bg_g"));
- setDependent(e, "viewsize", 0, 100);
- me.TR(me);
- me.TDempty(me, 0.2);
- me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, "Default blue:"));
- me.TD(me, 1, 3, e = makeXonoticSlider(0, 1, 0.01, "sbar_color_bg_b"));
- setDependent(e, "viewsize", 0, 100);
- me.TR(me);
- me.TDempty(me, 0.2);
- me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, "Team color:"));
- me.TD(me, 1, 3, e = makeXonoticSlider(0.1, 1, 0.01, "sbar_color_bg_team"));
- setDependent(e, "viewsize", 0, 100);
- me.TR(me);
- me.TR(me);
- me.TD(me, 1, 4, makeXonoticTextLabel(0, "Waypoint settings:"));
- me.TR(me);
- me.TDempty(me, 0.2);
- me.TD(me, 1, 3.8, e = makeXonoticCheckBox(1, "cl_hidewaypoints", "Show base waypoints"));
- me.TR(me);
- me.TDempty(me, 0.2);
- me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, "Waypoint scale:"));
- me.TD(me, 1, 3, e = makeXonoticSlider(0.5, 1.5, 0.01, "g_waypointsprite_scale"));
- setDependent(e, "cl_hidewaypoints", 0, 0);
- me.TR(me);
- me.TDempty(me, 0.2);
- me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, "Waypoint alpha:"));
- me.TD(me, 1, 3, e = makeXonoticSlider(0.1, 1, 0.01, "g_waypointsprite_alpha"));
- setDependent(e, "cl_hidewaypoints", 0, 0);
- me.TR(me);
- me.TDempty(me, 0.2);
- me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, "Show names:"));
- me.TD(me, 1, 3, e = makeXonoticTextSlider("cl_shownames"));
- e.addValue(e, "Never", "0");
- e.addValue(e, "Teammates", "1");
- e.addValue(e, "All players", "2");
- e.configureXonoticTextSliderValues(e);
- me.gotoRC(me, me.rows - 1, 0);
- me.TD(me, 1, me.columns, e = makeXonoticButton("OK", '0 0 0'));
- e.onClick = Dialog_Close;
- e.onClickEntity = me;
-}
-
-#endif
--- /dev/null
+#ifdef INTERFACE
+CLASS(XonoticWaypointDialog) EXTENDS(XonoticDialog)
+ METHOD(XonoticWaypointDialog, toString, string(entity))
+ METHOD(XonoticWaypointDialog, fill, void(entity))
+ METHOD(XonoticWaypointDialog, showNotify, void(entity))
+ ATTRIB(XonoticWaypointDialog, title, string, "Waypoints")
+ ATTRIB(XonoticWaypointDialog, color, vector, SKINCOLOR_DIALOG_RADAR)
+ ATTRIB(XonoticWaypointDialog, intendedWidth, float, 0.7)
+ ATTRIB(XonoticWaypointDialog, rows, float, 6)
+ ATTRIB(XonoticWaypointDialog, columns, float, 4)
+ENDCLASS(XonoticWaypointDialog)
+#endif
+
+#ifdef IMPLEMENTATION
+void showNotifyXonoticWaypointDialog(entity me)
+{
+ loadAllCvars(me);
+}
+string toStringXonoticWaypointDialog(entity me)
+{
+ return "XXX";
+}
+void fillXonoticWaypointDialog(entity me)
+{
+ entity e, sl;
+
+ me.TR(me);
+ me.TD(me, 1, 4, makeXonoticTextLabel(0, "Waypoint settings:"));
+ me.TR(me);
+ me.TDempty(me, 0.2);
+ me.TD(me, 1, 3.8, e = makeXonoticCheckBox(1, "cl_hidewaypoints", "Show base waypoints"));
+ me.TR(me);
+ me.TDempty(me, 0.2);
+ me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, "Waypoint scale:"));
+ me.TD(me, 1, 3, e = makeXonoticSlider(0.5, 1.5, 0.01, "g_waypointsprite_scale"));
+ setDependent(e, "cl_hidewaypoints", 0, 0);
+ me.TR(me);
+ me.TDempty(me, 0.2);
+ me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, "Waypoint alpha:"));
+ me.TD(me, 1, 3, e = makeXonoticSlider(0.1, 1, 0.01, "g_waypointsprite_alpha"));
+ setDependent(e, "cl_hidewaypoints", 0, 0);
+ me.TR(me);
+ me.TDempty(me, 0.2);
+ me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, "Show names:"));
+ me.TD(me, 1, 3, e = makeXonoticTextSlider("cl_shownames"));
+ e.addValue(e, "Never", "0");
+ e.addValue(e, "Teammates", "1");
+ e.addValue(e, "All players", "2");
+ e.configureXonoticTextSliderValues(e);
+ me.gotoRC(me, me.rows - 1, 0);
+ me.TD(me, 1, me.columns, e = makeXonoticButton("OK", '0 0 0'));
+ e.onClick = Dialog_Close;
+ e.onClickEntity = me;
+}
+
+#endif
me.TR(me);
me.TR(me);
me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Particle quality:"));
- me.TD(me, 1, 2, e = makeXonoticSlider(0.1, 1.0, 0.05, "cl_particles_quality"));
+ me.TD(me, 1, 2, e = makeXonoticSlider(0.2, 1.0, 0.1, "cl_particles_quality"));
me.TR(me);
me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Particle dist.:"));
me.TD(me, 1, 2, e = makeXonoticSlider(500, 2000, 100, "r_drawparticles_drawdistance"));
ATTRIB(MainWindow, mapInfoDialog, entity, NULL)
ATTRIB(MainWindow, userbindEditDialog, entity, NULL)
ATTRIB(MainWindow, winnerDialog, entity, NULL)
- ATTRIB(MainWindow, radarDialog, entity, NULL)
+ ATTRIB(MainWindow, waypointDialog, entity, NULL)
ATTRIB(MainWindow, serverInfoDialog, entity, NULL)
ATTRIB(MainWindow, cvarsDialog, entity, NULL)
ATTRIB(MainWindow, mainNexposee, entity, NULL)
i = spawnXonoticTeamSelectDialog();
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+
+ i = spawnXonoticHUDExitDialog();
+ i.configureDialog(i);
+ me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+
+ i = spawnXonoticHUDNotificationDialog();
+ i.configureDialog(i);
+ me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+
+ i = spawnXonoticHUDInventoryDialog();
+ i.configureDialog(i);
+ me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+
+ i = spawnXonoticHUDHealthArmorDialog();
+ i.configureDialog(i);
+ me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+
+ i = spawnXonoticHUDChatDialog();
+ i.configureDialog(i);
+ me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+
+ i = spawnXonoticHUDModIconsDialog();
+ i.configureDialog(i);
+ me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+
+ i = spawnXonoticHUDPowerupsDialog();
+ i.configureDialog(i);
+ me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+
+ i = spawnXonoticHUDPressedKeysDialog();
+ i.configureDialog(i);
+ me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+
+ i = spawnXonoticHUDRaceTimerDialog();
+ i.configureDialog(i);
+ me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+
+ i = spawnXonoticHUDRadarDialog();
+ i.configureDialog(i);
+ me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+
+ i = spawnXonoticHUDScoreDialog();
+ i.configureDialog(i);
+ me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+
+ i = spawnXonoticHUDTimerDialog();
+ i.configureDialog(i);
+ me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+
+ i = spawnXonoticHUDVoteDialog();
+ i.configureDialog(i);
+ me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+
+ i = spawnXonoticHUDWeaponIconsDialog();
+ i.configureDialog(i);
+ me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
me.advancedDialog = i = spawnXonoticAdvancedDialog();
i.configureDialog(i);
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
- me.radarDialog = i = spawnXonoticRadarDialog();
+ me.waypointDialog = i = spawnXonoticWaypointDialog();
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
{
if(val != me.value)
{
- me.value = val;
+ setValueSlider( me, val );
me.saveCvars(me);
}
}
if not(me.cvarName)
return;
- me.value = cvar(me.cvarName);
+ me.setValue( me, cvar(me.cvarName) );
}
void saveCvarsXonoticSlider(entity me)
{
v = cvar(me.cvarName);
if(v >= 0.98)
- me.value = 0;
+ setValueSlider( me, 0 );
else if(v < 0.0005)
- me.value = -1000000;
+ setValueSlider( me, -1000000 );
else
- me.value = 0.1 * floor(0.5 + 10.0 * log10(cvar(me.cvarName)) * 10);
+ setValueSlider( me, 0.1 * floor(0.5 + 10.0 * log10(cvar(me.cvarName)) * 10) );
}
void saveCvarsXonoticDecibelsSlider(entity me)
{
{
if(val != me.value)
{
- me.value = val;
+ setValueSlider( me, val );
me.saveCvars(me);
}
}
string campaign_name_previous;
float campaign_won_previous;
+#ifdef WATERMARK
+var string autocvar_menu_watermark = WATERMARK();
+#else
+var string autocvar_menu_watermark = "";
+#endif
void postMenuDraw()
{
+ if(autocvar_menu_watermark != "")
+ {
+ vector fs = '48 48 0';
+ draw_CenterText('0.5 0.1 0', autocvar_menu_watermark, globalToBoxSize('32 32 0', draw_scale), '1 1 1', 0.05, 1);
+ }
}
void preMenuDraw()
{
else
return m;
}
+
+string HUD_Panel_GetSettingName(float theSetting)
+{
+ switch(theSetting) {
+ case HUD_MENU_ENABLE: return ""; break;
+ default: return "";
+ }
+}
string getZonedTooltipForIdentifier(string s);
string resolvemod(string m);
+
+string HUD_Panel_GetSettingName(float setting);
float warmup;
float allowed_to_spawn;
float player_cnt;
+float required_ca_players;
.float caplayer;
void PutObserverInServer();
lms_next_place = player_count;
race_ReadyRestart();
-
+
for(self = world; (self = nextent(self)); )
if(clienttype(self) == CLIENTTYPE_NOTACLIENT)
{
allowed_to_spawn = 0;
- if(g_ca && (player_cnt < 2 || inWarmupStage))
+ if(g_ca && (player_cnt < required_ca_players || inWarmupStage))
allowed_to_spawn = 1;
msg = NEWLINES;
}
}
- if(player_cnt < 2 && (redspawned && bluespawned)) {
+ required_ca_players = max(2, fabs(cvar("bot_vs_human") + 1));
+
+ if(player_cnt < required_ca_players && (redspawned && bluespawned)) {
reset_map(TRUE);
}
- else if(player_cnt < 2) {
+ else if(player_cnt < required_ca_players) {
FOR_EACH_CLIENT(self)
if(self.classname == "player")
- centerprint(self, strcat("^1Need at least 2 players to play CA", "^7\n"));
+ centerprint(self, strcat("^1Need at least 1 player in each team to play CA", "^7\n"));
allowed_to_spawn = 1;
return;
else bot_name = "Bot";
if(argv(1) != "") bot_model = argv(1);
- else bot_model = "marine";
+ else bot_model = "";
if(argv(2) != "") bot_skin = argv(2);
else bot_skin = "0";
else
name = bot_name;
+ self.cleanname = strzone(name);
+
+ // number bots with identical names
+ float i;
+ i = 0;
+ FOR_EACH_CLIENT(p)
+ {
+ if(clienttype(p) == CLIENTTYPE_BOT)
+ if(p.cleanname == name)
+ ++i;
+ }
+ if (i)
+ name = strcat(name, "(", ftos(i), ")");
+
// pick the model and skin
if(substring(bot_model, -4, 1) != ".")
- bot_model = strcat(bot_model, ".zym");
+ bot_model = strcat(bot_model, ".iqm");
self.playermodel = self.playermodel_freeme = strzone(strcat("models/player/", bot_model));
self.playerskin = self.playerskin_freeme = strzone(bot_skin);
{
if (clienttype(self) != CLIENTTYPE_BOT)
return;
+ if(self.cleanname)
+ strunzone(self.cleanname);
if(self.netname_freeme)
strunzone(self.netname_freeme);
if(self.playermodel_freeme)
strunzone(self.playermodel_freeme);
if(self.playerskin_freeme)
strunzone(self.playerskin_freeme);
+ self.cleanname = string_null;
self.netname_freeme = string_null;
self.playermodel_freeme = string_null;
self.playerskin_freeme = string_null;
FOR_EACH_REALCLIENT(head)
{
- if(head.classname == "player" || g_lms || g_arena)
+ if(head.classname == "player" || g_lms || g_arena || g_ca)
++activerealplayers;
++realplayers;
}
entity player_list;
.entity nextbot;
.entity nextplayer;
+.string cleanname;
.string netname_freeme;
.string playermodel_freeme;
.string playerskin_freeme;
IS_CHEAT(i, 0, 0);
FOR_EACH_PLAYER(e)
{
- if( e.playermodel == "models/player/jeandarc.zym"
- || e.playermodel == "models/player/pyria.zym"
- || e.playermodel == "models/player/skadi.zym"
- || (e.playermodel == "models/player/specop.zym" && random() < 0.5) // you never know
- || e.playermodel == "models/player/visitant.zym")
+ get_model_parameters(e.playermodel, e.skinindex);
+ if(get_model_parameters_sex == "Female")
{
makevectors(e.angles);
traceline(e.origin, e.origin + v_right * 256, MOVE_NORMAL, e);
Returns a valid one in doubt.
=============
*/
-string FallbackPlayerModel = "models/player/marine.zym";
+string FallbackPlayerModel;
string CheckPlayerModel(string plyermodel) {
+ if(FallbackPlayerModel != cvar_defstring("_cl_playermodel"))
+ {
+ // note: we cannot summon Don Strunzone here, some player may
+ // still have the model string set. In case anyone manages how
+ // to change a cvar default, we'll have a small leak here.
+ FallbackPlayerModel = strzone(cvar_defstring("_cl_playermodel"));
+ }
if(strlen(plyermodel) < 4)
return FallbackPlayerModel;
if( substring(plyermodel,0,14) != "models/player/")
self.nextthink = 0;
self.hook_time = 0;
self.dmg_team = 0;
+ self.ballistics_density = cvar("g_ballistics_density_player");
self.metertime = 0;
DecodeLevelParms();
+#ifdef WATERMARK
+ sprint(self, strcat("^4SVQC Build information: ", WATERMARK(), "\n"));
+#endif
+
self.classname = "player_joining";
self.flags = FL_CLIENT;
float sv_airstopaccelerate;
float sv_airstrafeaccelerate;
float sv_maxairstrafespeed;
+float sv_airstrafeaccel_qw;
float sv_aircontrol;
float sv_aircontrol_power;
float sv_warsowbunny_airforwardaccel;
float sv_warsowbunny_topspeed;
float sv_warsowbunny_turnaccel;
float sv_warsowbunny_backtosideratio;
+float sv_airspeedlimit_nonqw;
.float ladder_time;
.entity ladder_entity;
void PlayerJump (void)
{
float mjumpheight;
+ float doublejump;
+
+ doublejump = FALSE;
+ if (sv_doublejump)
+ {
+ tracebox(self.origin + '0 0 0.01', self.mins, self.maxs, self.origin - '0 0 0.01', MOVE_NORMAL, self);
+ if (trace_fraction < 1 && trace_plane_normal_z > 0.7)
+ doublejump = TRUE;
+ }
mjumpheight = cvar("sv_jumpvelocity");
if (self.waterlevel >= WATERLEVEL_SWIMMING)
return;
}
+ if (!doublejump)
if (!(self.flags & FL_ONGROUND))
return;
mjumpheight = mjumpheight * cvar("g_minstagib_speed_jumpheight");
}
+ // sv_jumpspeedcap_min/sv_jumpspeedcap_max act as baseline
+ // velocity bounds. Final velocity is bound between (jumpheight *
+ // min + jumpheight) and (jumpheight * max + jumpheight);
+
if(cvar_string("sv_jumpspeedcap_min") != "")
- self.velocity_z = max(cvar("sv_jumpvelocity") * cvar("sv_jumpspeedcap_min"), self.velocity_z);
- if(cvar_string("sv_jumpspeedcap_max") != "") {
- if(trace_fraction < 1 && trace_plane_normal_z < 0.98 && cvar("sv_jumpspeedcap_max_disable_on_ramps")) {
- // don't do jump speedcaps on ramps to preserve old xonotic ramjump style
- //print("Trace plane normal z: ", ftos(trace_plane_normal_z), ", disabling speed cap!\n");
+ {
+ float minjumpspeed;
+
+ minjumpspeed = mjumpheight * cvar("sv_jumpspeedcap_min");
+
+ if (self.velocity_z < minjumpspeed)
+ mjumpheight += minjumpspeed - self.velocity_z;
+ }
+
+ if(cvar_string("sv_jumpspeedcap_max") != "")
+ {
+ // don't do jump speedcaps on ramps to preserve old xonotic ramjump style
+ tracebox(self.origin + '0 0 0.01', self.mins, self.maxs, self.origin - '0 0 0.01', MOVE_NORMAL, self);
+
+ if(!(trace_fraction < 1 && trace_plane_normal_z < 0.98 && cvar("sv_jumpspeedcap_max_disable_on_ramps")))
+ {
+ float maxjumpspeed;
+
+ maxjumpspeed = mjumpheight * cvar("sv_jumpspeedcap_max");
+
+ if (self.velocity_z > maxjumpspeed)
+ mjumpheight -= self.velocity_z - maxjumpspeed;
}
- else
- self.velocity_z = min(cvar("sv_jumpvelocity") * cvar("sv_jumpspeedcap_max"), self.velocity_z) + trace_ent.velocity_z;
}
if(!(self.lastflags & FL_ONGROUND))
{
if(mv_x == 0 && mv_y == 0)
return 0; // avoid division by zero
- angle = RAD2DEG * atan2(mv_y, mv_x);
+ angle -= RAD2DEG * atan2(mv_y, mv_x);
angle = remainder(angle, 360) / 45;
if(angle > 1)
return 0;
return 1 - fabs(angle);
}
+float GeomLerp(float a, float lerp, float b)
+{
+ if(a == 0)
+ {
+ if(lerp < 1)
+ return 0;
+ else
+ return b;
+ }
+ if(b == 0)
+ {
+ if(lerp > 0)
+ return 0;
+ else
+ return a;
+ }
+ return a * pow(fabs(b / a), lerp);
+}
+
void CPM_PM_Aircontrol(vector wishdir, float wishspeed)
{
float zspeed, xyspeed, dot, k;
self.velocity_z = zspeed;
}
+float AdjustAirAccelQW(float accelqw, float factor)
+{
+ return copysign(bound(0.000001, 1 - (1 - fabs(accelqw)) * factor, 1), accelqw);
+}
+
// example config for alternate speed clamping:
// sv_airaccel_qw 0.8
// sv_airaccel_sideways_friction 0
// prvm_globalset server speedclamp_mode 1
// (or 2)
-void PM_Accelerate(vector wishdir, float wishspeed, float wishspeed0, float accel, float accelqw, float sidefric)
+void PM_Accelerate(vector wishdir, float wishspeed, float wishspeed0, float accel, float accelqw, float sidefric, float speedlimit)
{
float vel_straight;
float vel_z;
step = accel * frametime * wishspeed0;
vel_xy_current = vlen(vel_xy);
+ if(speedlimit)
+ accelqw = AdjustAirAccelQW(accelqw, (speedlimit - bound(wishspeed, vel_xy_current, speedlimit)) / max(1, speedlimit - wishspeed));
vel_xy_forward = vel_xy_current + bound(0, wishspeed - vel_xy_current, step) * accelqw + step * (1 - accelqw);
vel_xy_backward = vel_xy_current - bound(0, wishspeed + vel_xy_current, step) * accelqw - step * (1 - accelqw);
if(vel_xy_backward < 0)
string GetMapname(void);
float speedaward_lastupdate;
float speedaward_lastsent;
-.float jumppadusetime;
+var float autocvar_g_movement_highspeed = 1;
void SV_PlayerPhysics()
{
local vector wishvel, wishdir, v;
float not_allowed_to_move;
string c;
+ // fix physics stats for g_movement_highspeed
+ self.stat_sv_airaccel_qw = AdjustAirAccelQW(sv_airaccel_qw, autocvar_g_movement_highspeed);
+ if(sv_airstrafeaccel_qw)
+ self.stat_sv_airstrafeaccel_qw = AdjustAirAccelQW(sv_airstrafeaccel_qw, autocvar_g_movement_highspeed);
+ else
+ self.stat_sv_airstrafeaccel_qw = 0;
+ self.stat_sv_airspeedlimit_nonqw = sv_airspeedlimit_nonqw * autocvar_g_movement_highspeed;
+
if(self.PlayerPhysplug)
if(self.PlayerPhysplug())
return;
if(self.classname == "player")
{
- if(sv_doublejump && time - self.jumppadusetime > 2 * sys_frametime)
- {
- tracebox(self.origin + '0 0 0.01', self.mins, self.maxs, self.origin - '0 0 0.01', MOVE_NORMAL, self);
- self.flags &~= FL_ONGROUND;
- if(trace_fraction < 1 && trace_plane_normal_z > 0.7)
- self.flags |= FL_ONGROUND;
- }
-
if (self.BUTTON_JUMP)
PlayerJump ();
else
if (wishspeed > sv_maxspeed*maxspd_mod)
wishspeed = sv_maxspeed*maxspd_mod;
if (time >= self.teleport_time)
- PM_Accelerate(wishdir, wishspeed, wishspeed, sv_accelerate*maxspd_mod, 1, 0);
+ PM_Accelerate(wishdir, wishspeed, wishspeed, sv_accelerate*maxspd_mod, 1, 0, 0);
}
else if (self.waterlevel >= WATERLEVEL_SWIMMING)
{
self.velocity = self.velocity * (1 - frametime * sv_friction);
// water acceleration
- PM_Accelerate(wishdir, wishspeed, wishspeed, sv_accelerate*maxspd_mod, 1, 0);
+ PM_Accelerate(wishdir, wishspeed, wishspeed, sv_accelerate*maxspd_mod, 1, 0, 0);
}
else if (time < self.ladder_time)
{
if (time >= self.teleport_time)
{
// water acceleration
- PM_Accelerate(wishdir, wishspeed, wishspeed, sv_accelerate*maxspd_mod, 1, 0);
+ PM_Accelerate(wishdir, wishspeed, wishspeed, sv_accelerate*maxspd_mod, 1, 0, 0);
}
}
else if ((self.items & IT_JETPACK) && self.BUTTON_HOOK && (!cvar("g_jetpack_fuel") || self.ammo_fuel >= 0.01 || self.items & IT_UNLIMITED_WEAPON_AMMO))
if (self.crouch)
wishspeed = wishspeed * 0.5;
if (time >= self.teleport_time)
- PM_Accelerate(wishdir, wishspeed, wishspeed, sv_accelerate*maxspd_mod, 1, 0);
+ PM_Accelerate(wishdir, wishspeed, wishspeed, sv_accelerate*maxspd_mod, 1, 0, 0);
}
else
{
float accelerating;
float wishspeed2;
float airaccelqw;
+ float strafity;
- airaccelqw = sv_airaccel_qw;
+ airaccelqw = self.stat_sv_airaccel_qw;
accelerating = (self.velocity * wishdir > 0);
wishspeed2 = wishspeed;
if(sv_airstopaccelerate)
if(self.velocity * wishdir < 0)
airaccel = sv_airstopaccelerate*maxspd_mod;
- // this doesn't play well with analog input, but can't r
- // fixed like the AirControl can. So, don't set the maxa
- // cvars when you want to support analog input.
- if(self.movement_x == 0 && self.movement_y != 0)
- {
- if(sv_maxairstrafespeed)
- {
- wishspeed = min(wishspeed, sv_maxairstrafespeed*maxspd_mod);
- if(sv_maxairstrafespeed < sv_maxairspeed)
- airaccelqw = 1;
- }
- if(sv_airstrafeaccelerate)
- {
- airaccel = sv_airstrafeaccelerate*maxspd_mod;
- if(sv_airstrafeaccelerate > sv_airaccelerate)
- airaccelqw = 1;
- }
- }
+ // note that for straight forward jumping:
+ // step = accel * frametime * wishspeed0;
+ // accel = bound(0, wishspeed - vel_xy_current, step) * accelqw + step * (1 - accelqw);
+ // -->
+ // dv/dt = accel * maxspeed (when slow)
+ // dv/dt = accel * maxspeed * (1 - accelqw) (when fast)
+ // log dv/dt = logaccel + logmaxspeed (when slow)
+ // log dv/dt = logaccel + logmaxspeed + log(1 - accelqw) (when fast)
+ strafity = IsMoveInDirection(self.movement, -90) + IsMoveInDirection(self.movement, +90); // if one is nonzero, other is always zero
+ if(sv_maxairstrafespeed)
+ wishspeed = min(wishspeed, GeomLerp(sv_maxairspeed*maxspd_mod, strafity, sv_maxairstrafespeed*maxspd_mod));
+ if(sv_airstrafeaccelerate)
+ airaccel = GeomLerp(airaccel, strafity, sv_airstrafeaccelerate*maxspd_mod);
+ if(self.stat_sv_airstrafeaccel_qw)
+ airaccelqw = copysign(1-GeomLerp(1-fabs(self.stat_sv_airaccel_qw), strafity, 1-fabs(self.stat_sv_airstrafeaccel_qw)), ((strafity > 0.5) ? self.stat_sv_airstrafeaccel_qw : self.stat_sv_airaccel_qw));
// !CPM
if(sv_warsowbunny_turnaccel && accelerating && self.movement_y == 0 && self.movement_x != 0)
PM_AirAccelerate(wishdir, wishspeed);
else
- PM_Accelerate(wishdir, wishspeed, wishspeed0, airaccel, airaccelqw, sv_airaccel_sideways_friction / maxairspd);
+ PM_Accelerate(wishdir, wishspeed, wishspeed0, airaccel, airaccelqw, sv_airaccel_sideways_friction / maxairspd, self.stat_sv_airspeedlimit_nonqw);
if(sv_aircontrol)
CPM_PM_Aircontrol(wishdir, wishspeed2);
self.movetype = oldself.movetype;
self.nextthink = oldself.nextthink;
self.solid = oldself.solid;
+ self.ballistics_density = oldself.ballistics_density;
self.takedamage = oldself.takedamage;
self.think = oldself.think;
self.customizeentityforclient = oldself.customizeentityforclient;
else
Violence_GibSplash_At(hitloc, force, 2, bound(0, damage, 200) / 16, self, attacker);
- if((g_arena && numspawned < 2) || (g_ca && player_cnt < 2) && !inWarmupStage)
+ if((g_arena && numspawned < 2) || (g_ca && player_cnt < required_ca_players) && !inWarmupStage)
return;
if (!g_minstagib)
self.movetype = MOVETYPE_TOSS;
// shootable corpse
self.solid = SOLID_CORPSE;
+ self.ballistics_density = cvar("g_ballistics_density_corpse");
// don't stick to the floor
self.flags &~= FL_ONGROUND;
// dying animation
void W_NextWeapon(float list)
{
if(list == 0)
- W_CycleWeapon(weaponpriority_hudselector_0, -1);
+ W_CycleWeapon(weaponorder_byid, -1);
else if(list == 1)
- W_CycleWeapon(weaponpriority_hudselector_1, -1);
+ W_CycleWeapon(weaponorder_byimpulse, -1);
else if(list == 2)
W_CycleWeapon(self.cvar_cl_weaponpriority, -1);
}
void W_PreviousWeapon(float list)
{
if(list == 0)
- W_CycleWeapon(weaponpriority_hudselector_0, +1);
+ W_CycleWeapon(weaponorder_byid, +1);
else if(list == 1)
- W_CycleWeapon(weaponpriority_hudselector_1, +1);
+ W_CycleWeapon(weaponorder_byimpulse, +1);
else if(list == 2)
W_CycleWeapon(self.cvar_cl_weaponpriority, +1);
}
return;
if(!W_IsWeaponThrowable(w))
return;
+ if(self.weaponentity.state != WS_READY)
+ return;
wb = W_WeaponBit(w);
if(self.weapons & wb != wb)
}
else
{
- setmodel(self, strcat("models/weapons/h_", self.owner.weaponname, ".dpm")); // precision set below
- animfilename = strcat("models/weapons/h_", self.owner.weaponname, ".dpm.animinfo");
+ setmodel(self, strcat("models/weapons/h_", self.owner.weaponname, ".iqm")); // precision set below
+ animfilename = strcat("models/weapons/h_", self.owner.weaponname, ".iqm.animinfo");
animfile = fopen(animfilename, FILE_READ);
// preset some defaults that work great for renamed zym files (which don't need an animinfo)
self.anim_fire1 = '0 1 0.01';
};
// perform weapon to attack (weaponstate and attack_finished check is here)
+void W_SwitchToOtherWeapon(entity pl)
+{
+ // hack to ensure it switches to an OTHER weapon (in case the other fire mode still has ammo, we want that anyway)
+ float w, ww;
+ w = W_WeaponBit(pl.weapon);
+ pl.weapons &~= w;
+ ww = w_getbestweapon(pl);
+ pl.weapons |= w;
+ if(ww)
+ W_SwitchWeapon_Force(pl, ww);
+}
+float weapon_prepareattack_checkammo(float secondary)
+{
+ if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
+ if (!weapon_action(self.weapon, WR_CHECKAMMO1 + secondary))
+ {
+ W_SwitchToOtherWeapon(self);
+ return FALSE;
+ }
+ return TRUE;
+}
.float race_penalty;
-float weapon_prepareattack(float secondary, float attacktime)
+float weapon_prepareattack_check(float secondary, float attacktime)
{
+ if(!weapon_prepareattack_checkammo(secondary))
+ return FALSE;
+
//if sv_ready_restart_after_countdown is set, don't allow the player to shoot
//if all players readied up and the countdown is running
if(time < game_starttime || time < self.race_penalty) {
return FALSE;
}
- if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
- if (!weapon_action(self.weapon, WR_CHECKAMMO1 + secondary))
- {
- // hack to ensure it switches to an OTHER weapon (in case the other fire mode still has ammo, we want that anyway)
- float w, ww;
- w = W_WeaponBit(self.weapon);
- self.weapons &~= w;
- ww = w_getbestweapon(self);
- self.weapons |= w;
- if(ww)
- W_SwitchWeapon_Force(self, ww);
- return FALSE;
- }
-
if (timeoutStatus == 2) //don't allow the player to shoot while game is paused
return FALSE;
if (self.weaponentity.state != WS_READY)
return FALSE;
}
+
+ return TRUE;
+}
+float weapon_prepareattack_do(float secondary, float attacktime)
+{
self.weaponentity.state = WS_INUSE;
self.spawnshieldtime = min(self.spawnshieldtime, time); // kill spawn shield when you fire
self.bulletcounter += 1;
//dprint("attack finished ", ftos(ATTACK_FINISHED(self)), "\n");
return TRUE;
-};
+}
+float weapon_prepareattack(float secondary, float attacktime)
+{
+ if(weapon_prepareattack_check(secondary, attacktime))
+ {
+ weapon_prepareattack_do(secondary, attacktime);
+ return TRUE;
+ }
+ else
+ return FALSE;
+}
void weapon_thinkf(float fr, float t, void() func)
{
dprint("FLAG: drop - owner is not carrying this flag??\n");
return;
}
- bprint(p.netname, "^7 lost the ", e.netname, "\n");
+ //bprint(p.netname, "^7 lost the ", e.netname, "\n");
+ Send_KillNotification (p.netname, e.netname, "", INFO_LOSTFLAG, MSG_INFO);
if(penalty_receiver)
UpdateFrags(penalty_receiver, -ctf_score_value("penalty_suicidedrop"));
other.flagcarried = self;
self.cnt = FLAG_CARRY;
self.angles = '0 0 0';
- bprint(other.netname, "^7 got the ", self.netname, "\n");
+ //bprint(other.netname, "^7 got the ", self.netname, "\n");
+ Send_KillNotification (other.netname, self.netname, "", INFO_GOTFLAG, MSG_INFO);
UpdateFrags(other, ctf_score_value("score_pickup_base"));
self.dropperid = other.playerid;
PlayerScore_Add(other, SP_CTF_PICKUPS, 1);
if (other.team == self.team || (other.team != COLOR_TEAM1 && other.team != COLOR_TEAM2))
{
// return flag
- bprint(other.netname, "^7 returned the ", self.netname, "\n");
+ Send_KillNotification (other.netname, self.netname, "", INFO_RETURNFLAG, MSG_INFO);
+ //bprint(other.netname, "^7 returned the ", self.netname, "\n");
// punish the player who last had it
FOR_EACH_PLAYER(player)
self.owner = other;
other.flagcarried = self;
self.cnt = FLAG_CARRY;
- bprint(other.netname, "^7 picked up the ", self.netname, "\n");
+ Send_KillNotification (other.netname, self.netname, "", INFO_PICKUPFLAG, MSG_INFO);
+ //bprint(other.netname, "^7 picked up the ", self.netname, "\n");
float f;
f = bound(0, (self.pain_finished - time) / cvar("g_ctf_flag_returntime"), 1);
float WS_INUSE = 3; // fire state
float WS_READY = 4; // idle frame
-// weapon requests
-float WR_SETUP = 1; // setup weapon data
-float WR_THINK = 2; // logic to run every frame
-float WR_CHECKAMMO1 = 3; // checks ammo for weapon
-float WR_CHECKAMMO2 = 4; // checks ammo for weapon
-float WR_AIM = 5; // runs bot aiming code for this weapon
-float WR_PRECACHE = 6; // precaches models/sounds used by this weapon
-float WR_SUICIDEMESSAGE = 7; // sets w_deathtypestring or leaves it alone (and may inspect w_deathtype for details)
-float WR_KILLMESSAGE = 8; // sets w_deathtypestring or leaves it alone
-float WR_RELOAD = 9; // does not need to do anything
-float WR_RESETPLAYER = 10; // does not need to do anything
-
void weapon_defaultspawnfunc(float wpn);
string w_deathtypestring;
float game_starttime; //point in time when the countdown is over
.float stat_game_starttime;
+.float stat_sv_airaccel_qw;
+.float stat_sv_airstrafeaccel_qw;
+.float stat_sv_airspeedlimit_nonqw;
+
void W_Porto_Remove (entity p);
.float projectiledeathtype;
.float cvar_cl_weaponimpulsemode;
.float selectweapon; // last selected weapon of the player
+
+.float ballistics_density; // wall piercing factor, larger = bullet can pass through more
// string autocvar__cl_name;
//NOTE: copying a string-typed autocvar to another variable/field, and then
//changing the cvar or returning from progs is UNDEFINED. Writing to autocvar
-//globals is UNDEFINED. Accessing autocvar globals after cvar_set()ing that
+//globals is UNDEFINED. Accessing autocvar globals after cvar_set()ing that
//cvar is IMPLEMENTATION DEFINED (an implementation may either yield the
-//previous, or the current, value). Whether autocvar globals, after restoring
-//a savegame, have the cvar's current value, or the original value at time of
-//saving, is UNDEFINED. Restoring a savegame however must not restore the
-//cvar values themselves.
+//previous, or the current, value). Writing to an autocvar global is NOT
+//ALLOWED.
//In case the cvar does NOT exist, then it is automatically created with the
//value of the autocvar initializer, if given. This is possible with e.g.
//frikqcc and fteqcc the following way:
GameLogEcho(s);
}
+void Send_KillNotification (string s1, string s2, string s3, float msg, float type)
+{
+ WriteByte(MSG_ALL, SVC_TEMPENTITY);
+ WriteByte(MSG_ALL, TE_CSQC_NOTIFY);
+ WriteByte(MSG_ALL, CSQC_KILLNOTIFY);
+ WriteString(MSG_ALL, s1);
+ WriteString(MSG_ALL, s2);
+ WriteString(MSG_ALL, s3);
+ WriteShort(MSG_ALL, msg);
+ WriteByte(MSG_ALL, type);
+}
+
+// TODO: writespectatable?
+// Function is used to send a generic centerprint whose content CSQC gets to decide (gentle version or not in the below cases)
+void Send_CSQC_Centerprint(entity e, string s1, string s2, float msg, float type)
+{
+ if (clienttype(e) == CLIENTTYPE_REAL)
+ {
+ msg_entity = e;
+ WriteByte(MSG_ONE, SVC_TEMPENTITY);
+ WriteByte(MSG_ONE, TE_CSQC_NOTIFY);
+ WriteByte(MSG_ONE, CSQC_CENTERPRINT);
+ WriteString(MSG_ONE, s1);
+ WriteString(MSG_ONE, s2);
+ WriteShort(MSG_ONE, msg);
+ WriteByte(MSG_ONE, type);
+ }
+}
+
void Obituary (entity attacker, entity inflictor, entity targ, float deathtype)
{
- string s, a;
- float p, w;
+ string s, a, msg;
+ float p, w, type;
if (targ.classname == "player" || targ.classname == "corpse")
{
a = attacker.netname;
- if (targ == attacker)
+ if (targ == attacker) // suicides
{
- if (deathtype == DEATH_TEAMCHANGE) {
- centerprint(targ, strcat(DAMAGE_CENTERPRINT_SPACER, "You are now on: ", ColoredTeamName(targ.team)));
- } else if (deathtype == DEATH_AUTOTEAMCHANGE) {
- centerprint(targ, strcat(DAMAGE_CENTERPRINT_SPACER, "You have been moved into a different team to improve team balance\nYou are now on: ", ColoredTeamName(targ.team)));
- return;
- } else if (deathtype == DEATH_CAMP) {
- if(sv_gentle)
- centerprint(targ, strcat(DAMAGE_CENTERPRINT_SPACER, "^1Reconsider your tactics, camper!"));
- else
- centerprint(targ, strcat(DAMAGE_CENTERPRINT_SPACER, "^1Die camper!"));
- } else if (deathtype == DEATH_NOAMMO) {
- if(sv_gentle)
- centerprint(targ, strcat(DAMAGE_CENTERPRINT_SPACER, "^1You are reinserted into the game for running out of ammo..."));
- else
- centerprint(targ, strcat(DAMAGE_CENTERPRINT_SPACER, "^1You were killed for running out of ammo..."));
- } else if (deathtype == DEATH_ROT) {
- if(sv_gentle)
- centerprint(targ, strcat(DAMAGE_CENTERPRINT_SPACER, "^1You need to preserve your health"));
- else
- centerprint(targ, strcat(DAMAGE_CENTERPRINT_SPACER, "^1You grew too old without taking your medicine"));
- } else if (deathtype == DEATH_MIRRORDAMAGE) {
- if(sv_gentle)
- centerprint(targ, strcat(DAMAGE_CENTERPRINT_SPACER, "^1Don't go against team mates!"));
- else
- centerprint(targ, strcat(DAMAGE_CENTERPRINT_SPACER, "^1Don't shoot your team mates!"));
- } else if (deathtype == DEATH_QUIET) {
- // do nothing
- } else {
- if(sv_gentle)
- centerprint(targ, strcat(DAMAGE_CENTERPRINT_SPACER, "^1You need to be more careful!"));
- else
- centerprint(targ, strcat(DAMAGE_CENTERPRINT_SPACER, "^1You killed your own dumb self!"));
- }
- if(sv_gentle) {
- if (deathtype == DEATH_CAMP)
- bprint ("^1",s, "^1 thought they found a nice camping ground\n");
- else if (deathtype == DEATH_MIRRORDAMAGE)
- bprint ("^1",s, "^1 didn't become friends with the Lord of Teamplay\n");
- else
- bprint ("^1",s, "^1 will be reinserted into the game due to their own actions\n");
+ if (deathtype == DEATH_TEAMCHANGE || deathtype == DEATH_AUTOTEAMCHANGE)
+ msg = ColoredTeamName(targ.team); // TODO: check if needed?
+ Send_CSQC_Centerprint(targ, msg, "", deathtype, MSG_SUICIDE);
- if(deathtype != DEATH_TEAMCHANGE && deathtype != DEATH_QUIET)
- {
- LogDeath("suicide", deathtype, targ, targ);
- GiveFrags(attacker, targ, -1);
- }
+ if(deathtype != DEATH_TEAMCHANGE && deathtype != DEATH_QUIET)
+ {
+ LogDeath("suicide", deathtype, targ, targ);
+ GiveFrags(attacker, targ, -1);
+ }
+ // TODO: hmm?
+ /*
if (targ.killcount > 2)
bprint ("^1",s,"^1 faded after a ",ftos(targ.killcount)," point spree\n");
- } else {
- w = DEATH_WEAPONOF(deathtype);
- if(WEP_VALID(w))
- {
- w_deathtypestring = "couldn't resist the urge to self-destruct";
- w_deathtype = deathtype;
- weapon_action(w, WR_SUICIDEMESSAGE);
- bprint("^1", s, "^1 ", w_deathtypestring, "\n");
- }
- else if (deathtype == DEATH_KILL)
- bprint ("^1",s, "^1 couldn't take it anymore\n");
- else if (deathtype == DEATH_ROT)
- bprint ("^1",s, "^1 died\n");
- else if (deathtype == DEATH_NOAMMO)
- bprint ("^7",s, "^7 committed suicide. What's the point of living without ammo?\n");
- else if (deathtype == DEATH_CAMP)
- bprint ("^1",s, "^1 thought they found a nice camping ground\n");
- else if (deathtype == DEATH_MIRRORDAMAGE)
- bprint ("^1",s, "^1 didn't become friends with the Lord of Teamplay\n");
- else if (deathtype == DEATH_CHEAT)
- bprint ("^1",s, "^1 unfairly eliminated themself\n");
- else if (deathtype == DEATH_FIRE)
- bprint ("^1",s, "^1 burned to death\n");
- else if (deathtype != DEATH_TEAMCHANGE && deathtype != DEATH_QUIET)
- bprint ("^1",s, "^1 couldn't resist the urge to self-destruct\n");
-
- if(deathtype != DEATH_TEAMCHANGE && deathtype != DEATH_QUIET)
- {
- LogDeath("suicide", deathtype, targ, targ);
- GiveFrags(attacker, targ, -1);
- }
- if (targ.killcount > 2)
- bprint ("^1",s,"^1 ended it all after a ",ftos(targ.killcount)," kill spree\n");
+ */
+
+ // TODO: wut is this?
+ // givefrags for logging apparently?
+ if(deathtype != DEATH_TEAMCHANGE && deathtype != DEATH_QUIET)
+ {
+ LogDeath("suicide", deathtype, targ, targ);
+ GiveFrags(attacker, targ, -1);
}
+
+ if (targ.killcount > 2)
+ msg = ftos(targ.killcount);
+ Send_KillNotification(s, msg, ftos(w), deathtype, MSG_SUICIDE);
}
else if (attacker.classname == "player" || attacker.classname == "gib")
{
if(teams_matter && attacker.team == targ.team)
{
- if(sv_gentle) {
- centerprint(attacker, strcat(DAMAGE_CENTERPRINT_SPACER, "^1Moron! You went against a team mate!"));
- bprint ("^1", a, "^1 took action against a team mate\n");
- } else {
- centerprint(attacker, strcat(DAMAGE_CENTERPRINT_SPACER, "^1Moron! You fragged ", s, ", a team mate!"));
- bprint ("^1", a, "^1 mows down a team mate\n");
- }
+ type = KILL_TEAM;
+
GiveFrags(attacker, targ, -1);
+
if (targ.killcount > 2) {
- if(sv_gentle)
- bprint ("^1",s,"'s ^1",ftos(targ.killcount)," scoring spree was ended by a team mate!\n");
- else
- bprint ("^1",s,"'s ^1",ftos(targ.killcount)," kill spree was ended by a team mate!\n");
+ msg = ftos(targ.killcount);
+ a = s;
}
if (attacker.killcount > 2) {
- if(sv_gentle)
- bprint ("^1",a,"^1 ended a ",ftos(attacker.killcount)," scoring spree by going against a team mate\n");
- else
- bprint ("^1",a,"^1 ended a ",ftos(attacker.killcount)," kill spree by killing a team mate\n");
+ msg = ftos(attacker.killcount);
+ type = KILL_TEAM_SPREE;
}
+
attacker.killcount = 0;
LogDeath("tk", deathtype, attacker, targ);
+ Send_CSQC_Centerprint(attacker, s, "", type, MSG_KILL);
+ Send_KillNotification(a, msg, "", type, MSG_KILL);
}
else
{
if (!checkrules_firstblood)
{
checkrules_firstblood = TRUE;
- if(sv_gentle)
- {
- bprint("^1",a, "^1 was the first to score", "\n");
- blood_message = "^1First point\n";
- //victim_message = "^1First victim\n"; // or First casualty
- }
- else
- {
- bprint("^1",a, "^1 drew first blood", "\n");
- blood_message = "^1First blood\n";
- victim_message = "^1First victim\n"; // or First casualty
- }
+ Send_KillNotification(a, "", "", KILL_FIRST_BLOOD, MSG_KILL);
+ // TODO: make these print at newline if they dont
+ Send_CSQC_Centerprint(attacker, "", "", KILL_FIRST_BLOOD, MSG_KILL);
+ Send_CSQC_Centerprint(targ, "", "", KILL_FIRST_VICTIM, MSG_KILL);
}
- if(sv_gentle > 0) {
- centerprint(attacker, strcat(DAMAGE_CENTERPRINT_SPACER, blood_message, "^4You scored against ^7", s, GetAdvancedDeathReports(targ)));
- centerprint(targ, strcat(DAMAGE_CENTERPRINT_SPACER, a,"^1 scored against you ^7", GetAdvancedDeathReports(attacker)));
+
+ if((cvar("sv_fragmessage_information_typefrag")) && (targ.BUTTON_CHAT)) {
+ Send_CSQC_Centerprint(attacker, s, GetAdvancedDeathReports(targ), KILL_TYPEFRAG, MSG_KILL);
+ Send_CSQC_Centerprint(targ, a, GetAdvancedDeathReports(attacker), KILL_TYPEFRAGGED, MSG_KILL);
} else {
- if((cvar("sv_fragmessage_information_typefrag")) && (targ.BUTTON_CHAT)) {
- centerprint(attacker, strcat(DAMAGE_CENTERPRINT_SPACER, blood_message, "^1You typefragged ^7", s, GetAdvancedDeathReports(targ)));
- centerprint(targ, strcat(DAMAGE_CENTERPRINT_SPACER, victim_message, "^1You were typefragged by ^7", a, GetAdvancedDeathReports(attacker)));
- } else {
- centerprint(attacker, strcat(DAMAGE_CENTERPRINT_SPACER, blood_message, "^4You fragged ^7", s, GetAdvancedDeathReports(targ)));
- centerprint(targ, strcat(DAMAGE_CENTERPRINT_SPACER, victim_message, "^1You were fragged by ^7", a, GetAdvancedDeathReports(attacker)));
- }
- attacker.taunt_soundtime = time + 1;
+ Send_CSQC_Centerprint(attacker, s, GetAdvancedDeathReports(targ), KILL_FRAG, MSG_KILL);
+ Send_CSQC_Centerprint(targ, a, GetAdvancedDeathReports(attacker), KILL_FRAGGED, MSG_KILL);
}
- if(sv_gentle) {
- bprint ("^1",s, "^1 needs a restart thanks to ", a, "\n");
- } else {
- w = DEATH_WEAPONOF(deathtype);
- if(WEP_VALID(w))
- {
- w_deathtypestring = "was blasted by";
- w_deathtype = deathtype;
- weapon_action(w, WR_KILLMESSAGE);
- p = strstrofs(w_deathtypestring, "#", 0);
- if(p < 0)
- bprint("^1", s, "^1 ", w_deathtypestring, " ", a, "\n");
- else
- bprint("^1", s, "^1 ", substring(w_deathtypestring, 0, p), a, "^1", substring(w_deathtypestring, p+1, strlen(w_deathtypestring) - (p+1)), "\n");
- }
- else if (deathtype == DEATH_TELEFRAG)
- bprint ("^1",s, "^1 was telefragged by ", a, "\n");
- else if (deathtype == DEATH_DROWN)
- bprint ("^1",s, "^1 was drowned by ", a, "\n");
- else if (deathtype == DEATH_SLIME)
- bprint ("^1",s, "^1 was slimed by ", a, "\n");
- else if (deathtype == DEATH_LAVA)
- bprint ("^1",s, "^1 was cooked by ", a, "\n");
- else if (deathtype == DEATH_FALL)
- bprint ("^1",s, "^1 was grounded by ", a, "\n");
- else if (deathtype == DEATH_SHOOTING_STAR)
- bprint ("^1",s, "^1 was shot into space by ", a, "\n");
- else if (deathtype == DEATH_SWAMP)
- bprint ("^1",s, "^1 was conserved by ", a, "\n");
+ attacker.taunt_soundtime = time + 1;
+
+ // TODO: fix this?
+ if (deathtype == DEATH_CUSTOM)
+ msg = strcat(deathmessage, " by ^1", msg);
else if (deathtype == DEATH_HURTTRIGGER && inflictor.message2 != "")
{
- p = strstrofs(inflictor.message2, "#", 0);
- if(p < 0)
- bprint("^1", s, "^1 ", inflictor.message2, " ", a, "\n");
- else
- bprint("^1", s, "^1 ", substring(inflictor.message2, 0, p), a, "^1", substring(inflictor.message2, p+1, strlen(inflictor.message2) - (p+1)), "\n");
+ msg = ftos(strstrofs(inflictor.message2, "#", 0));
}
- else if(deathtype == DEATH_SBCRUSH)
- bprint ("^1",s, "^1 was crushed by ^1", a, "\n");
- else if(deathtype == DEATH_SBMINIGUN)
- bprint ("^1",s, "^1 got shredded by ^1", a, "\n");
- else if(deathtype == DEATH_SBROCKET)
- bprint ("^1",s, "^1 was blased to bits by ^1", a, "\n");
- else if(deathtype == DEATH_SBBLOWUP)
- bprint ("^1",s, "^1 got cought in the destruction of ^1", a, "'s vehicle\n");
-
- else if(deathtype == DEATH_WAKIGUN)
- bprint ("^1",s, "^1 was bolted down by ^1", a, "\n");
- else if(deathtype == DEATH_WAKIROCKET)
- bprint ("^1",s, "^1 could find no shelter from ^1", a, "'s rockets\n");
- else if(deathtype == DEATH_WAKIBLOWUP)
- bprint ("^1",s, "^1 dies when ^1", a, "'s wakizashi dies.\n");
-
- else if(deathtype == DEATH_TURRET)
- bprint ("^1",s, "^1 was pushed into the line of fire by ^1", a, "\n");
- else if(deathtype == DEATH_TOUCHEXPLODE)
- bprint ("^1",s, "^1 was pushed into an accident by ^1", a, "\n");
- else if(deathtype == DEATH_CHEAT)
- bprint ("^1",s, "^1 was unfairly eliminated by ^1", a, "\n");
- else if (deathtype == DEATH_FIRE)
- bprint ("^1",s, "^1 was burnt to death by ^1", a, "\n");
- else if (deathtype == DEATH_CUSTOM)
- bprint ("^1",s, "^1 ", deathmessage, " by ^1", a, "\n");
- else
- bprint ("^1",s, "^1 was fragged by ", a, "\n");
- }
+ Send_KillNotification(s, a, msg, deathtype, MSG_KILL);
if(g_ctf && targ.flagcarried)
{
GiveFrags(attacker, targ, 1);
if (targ.killcount > 2) {
- if(sv_gentle)
- bprint ("^1",s,"'s ^1", ftos(targ.killcount), " scoring spree was ended by ", a, "\n");
- else
- bprint ("^1",s,"'s ^1", ftos(targ.killcount), " kill spree was ended by ", a, "\n");
+ Send_KillNotification(s, ftos(targ.killcount), a, KILL_END_SPREE, MSG_SPREE);
}
attacker.killcount = attacker.killcount + 1;
if (attacker.killcount > 2) {
- if(sv_gentle)
- bprint ("^1",a,"^1 made ",ftos(attacker.killcount)," scores in a row\n");
- else
- bprint ("^1",a,"^1 has ",ftos(attacker.killcount)," frags in a row\n");
+ Send_KillNotification(a, ftos(attacker.killcount), "", KILL_SPREE, MSG_SPREE);
}
LogDeath("frag", deathtype, attacker, targ);
if (attacker.killcount == 3)
{
- if(sv_gentle) {
- bprint (a,"^7 made a ^1TRIPLE SCORE\n");
- } else {
- bprint (a,"^7 made a ^1TRIPLE FRAG\n");
- AnnounceTo(attacker, "03kills");
- }
+ Send_KillNotification(a, "", "", KILL_SPREE_3, MSG_SPREE);
+ AnnounceTo(attacker, "03kills");
}
else if (attacker.killcount == 5)
{
- if(sv_gentle) {
- bprint (a,"^7 unleashes ^1SCORING RAGE\n");
- } else {
- bprint (a,"^7 unleashes ^1RAGE\n");
- AnnounceTo(attacker, "05kills");
- }
+ Send_KillNotification(a, "", "", KILL_SPREE_5, MSG_SPREE);
+ AnnounceTo(attacker, "05kills");
}
else if (attacker.killcount == 10)
{
- if(sv_gentle) {
- bprint (a,"^7 made ^1TEN SCORES IN A ROW!\n");
- } else {
- bprint (a,"^7 starts the ^1MASSACRE!\n");
- AnnounceTo(attacker, "10kills");
- }
+ Send_KillNotification(a, "", "", KILL_SPREE_10, MSG_SPREE);
+ AnnounceTo(attacker, "10kills");
}
else if (attacker.killcount == 15)
{
- if(sv_gentle) {
- bprint (a,"^7 made ^1FIFTEEN SCORES IN A ROW!\n");
- } else {
- bprint (a,"^7 executes ^1MAYHEM!\n");
- AnnounceTo(attacker, "15kills");
- }
+ Send_KillNotification(a, "", "", KILL_SPREE_15, MSG_SPREE);
+ AnnounceTo(attacker, "15kills");
}
else if (attacker.killcount == 20)
{
- if(sv_gentle) {
- bprint (a,"^7 made ^1TWENTY SCORES IN A ROW!\n");
- } else {
- bprint (a,"^7 is a ^1BERSERKER!\n");
- AnnounceTo(attacker, "20kills");
- }
+ Send_KillNotification(a, "", "", KILL_SPREE_20, MSG_SPREE);
+ AnnounceTo(attacker, "20kills");
}
else if (attacker.killcount == 25)
{
- if(sv_gentle) {
- bprint (a,"^7 made ^1TWENTY FIFE SCORES IN A ROW!\n");
- } else {
- bprint (a,"^7 inflicts ^1CARNAGE!\n");
- AnnounceTo(attacker, "25kills");
- }
+ Send_KillNotification(a, "", "", KILL_SPREE_25, MSG_SPREE);
+ AnnounceTo(attacker, "25kills");
}
else if (attacker.killcount == 30)
{
- if(sv_gentle) {
- bprint (a,"^7 made ^1THIRTY SCORES IN A ROW!\n");
- } else {
- bprint (a,"^7 unleashes ^1ARMAGEDDON!\n");
- AnnounceTo(attacker, "30kills");
- }
+ Send_KillNotification(a, "", "", KILL_SPREE_30, MSG_SPREE);
+ AnnounceTo(attacker, "30kills");
}
}
}
else
{
- centerprint(targ, strcat(DAMAGE_CENTERPRINT_SPACER, "^1Watch your step!"));
+ Send_CSQC_Centerprint(targ, "", "", deathtype, MSG_KILL_ACTION);
if (deathtype == DEATH_HURTTRIGGER && inflictor.message != "")
- bprint ("^1",s, "^1 ", inflictor.message, "\n");
- else if (deathtype == DEATH_DROWN)
- if(sv_gentle)
- bprint ("^1",s, "^1 was in the water for too long\n");
- else
- bprint ("^1",s, "^1 drowned\n");
- else if (deathtype == DEATH_SLIME)
- bprint ("^1",s, "^1 was slimed\n");
- else if (deathtype == DEATH_LAVA)
- if(sv_gentle)
- bprint ("^1",s, "^1 found a hot place\n");
- else
- bprint ("^1",s, "^1 turned into hot slag\n");
- else if (deathtype == DEATH_FALL)
- if(sv_gentle)
- bprint ("^1",s, "^1 tested gravity (and it worked)\n");
- else
- bprint ("^1",s, "^1 hit the ground with a crunch\n");
- else if (deathtype == DEATH_SHOOTING_STAR)
- bprint ("^1",s, "^1 became a shooting star\n");
- else if (deathtype == DEATH_SWAMP)
- if(sv_gentle)
- bprint ("^1",s, "^1 discovered a swamp\n");
- else
- bprint ("^1",s, "^1 is now conserved for centuries to come\n");
- else if(deathtype == DEATH_TURRET)
- bprint ("^1",s, "^1 was mowed down by a turret \n");
- else if (deathtype == DEATH_CUSTOM)
- bprint ("^1",s, "^1 ", deathmessage, "\n");
- else if(deathtype == DEATH_TOUCHEXPLODE)
- bprint ("^1",s, "^1 died in an accident\n");
- else if(deathtype == DEATH_CHEAT)
- bprint ("^1",s, "^1 was unfairly eliminated\n");
- else if(deathtype == DEATH_FIRE)
- if(sv_gentle)
- bprint ("^1",s, "^1 felt a little hot\n");
- else
- bprint ("^1",s, "^1 burnt to death\n");
- else
- if(sv_gentle)
- bprint ("^1",s, "^1 needs a restart\n");
- else
- bprint ("^1",s, "^1 died\n");
+ msg = inflictor.message;
+ else if (deathtype == DEATH_CUSTOM)
+ msg = deathmessage;
+
GiveFrags(targ, targ, -1);
if(PlayerScore_Add(targ, SP_SCORE, 0) == -5) {
AnnounceTo(targ, "botlike");
}
+ Send_KillNotification(s, msg, "", deathtype, MSG_KILL_ACTION);
if (targ.killcount > 2)
- if(sv_gentle)
- bprint ("^1",s,"^1 needs a restart after a ",ftos(targ.killcount)," scoring spree\n");
- else
- bprint ("^1",s,"^1 died with a ",ftos(targ.killcount)," kill spree\n");
+ Send_KillNotification(s, ftos(targ.killcount), "", 0, MSG_KILL_ACTION_SPREE);
LogDeath("accident", deathtype, targ, targ);
}
addstat(STAT_LEADLIMIT, AS_FLOAT, stat_leadlimit);
addstat(STAT_BULLETS_LOADED, AS_INT, campingrifle_bulletcounter);
+ // 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);
+ addstat(STAT_MOVEVARS_AIRSTRAFEACCEL_QW, AS_FLOAT, stat_sv_airstrafeaccel_qw);
+
next_pingtime = time + 5;
InitializeEntity(self, cvar_changes_init, INITPRIO_CVARS);
if(argv(1) == "w")
setmodel(e, (nextent(world)).weaponentity.model);
else
+ {
+ precache_model(argv(1));
setmodel(e, argv(1));
+ }
e.frame = stof(argv(2));
- i = gettagindex(e, argv(3));
+ if(substring(argv(3), 0, 1) == "#")
+ i = stof(substring(argv(3), 1, -1));
+ else
+ i = gettagindex(e, argv(3));
if(i)
{
v = gettaginfo(e, i);
- print("model ", e.model, " frame ", ftos(e.frame), " tag ", argv(3));
- print(" index = ", ftos(i));
+ print("model ", e.model, " frame ", ftos(e.frame), " tag ", gettaginfo_name);
+ print(" index ", ftos(i), " parent ", ftos(gettaginfo_parent), "\n");
print(" vector = ", ftos(v_x), " ", ftos(v_y), " ", ftos(v_z), "\n");
+ print(" offset = ", ftos(gettaginfo_offset_x), " ", ftos(gettaginfo_offset_y), " ", ftos(gettaginfo_offset_z), "\n");
+ print(" forward = ", ftos(gettaginfo_forward_x), " ", ftos(gettaginfo_forward_y), " ", ftos(gettaginfo_forward_z), "\n");
+ print(" right = ", ftos(gettaginfo_right_x), " ", ftos(gettaginfo_right_y), " ", ftos(gettaginfo_right_z), "\n");
+ print(" up = ", ftos(gettaginfo_up_x), " ", ftos(gettaginfo_up_y), " ", ftos(gettaginfo_up_z), "\n");
if(argc >= 6)
{
v_y = -v_y;
float g_pickup_fuel_max;
float g_pickup_armorsmall;
float g_pickup_armorsmall_max;
+float g_pickup_armorsmall_anyway;
float g_pickup_armormedium;
float g_pickup_armormedium_max;
+float g_pickup_armormedium_anyway;
float g_pickup_armorbig;
float g_pickup_armorbig_max;
+float g_pickup_armorbig_anyway;
float g_pickup_armorlarge;
float g_pickup_armorlarge_max;
+float g_pickup_armorlarge_anyway;
float g_pickup_healthsmall;
float g_pickup_healthsmall_max;
+float g_pickup_healthsmall_anyway;
float g_pickup_healthmedium;
float g_pickup_healthmedium_max;
+float g_pickup_healthmedium_anyway;
float g_pickup_healthlarge;
float g_pickup_healthlarge_max;
+float g_pickup_healthlarge_anyway;
float g_pickup_healthmega;
float g_pickup_healthmega_max;
+float g_pickup_healthmega_anyway;
+float g_pickup_ammo_anyway;
+float g_pickup_weapons_anyway;
float g_weaponarena;
float g_weaponarena_random;
string g_weaponarena_list;
sv_maxidle = cvar("sv_maxidle");
sv_maxidle_spectatorsareidle = cvar("sv_maxidle_spectatorsareidle");
sv_pogostick = cvar("sv_pogostick");
- sv_doublejump = cvar("sv_doublejump");
g_ctf_reverse = cvar("g_ctf_reverse");
sv_autotaunt = cvar("sv_autotaunt");
sv_taunt = cvar("sv_taunt");
g_pickup_fuel_max = cvar("g_pickup_fuel_max");
g_pickup_armorsmall = cvar("g_pickup_armorsmall");
g_pickup_armorsmall_max = cvar("g_pickup_armorsmall_max");
+ g_pickup_armorsmall_anyway = cvar("g_pickup_armorsmall_anyway");
g_pickup_armormedium = cvar("g_pickup_armormedium");
g_pickup_armormedium_max = cvar("g_pickup_armormedium_max");
+ g_pickup_armormedium_anyway = cvar("g_pickup_armormedium_anyway");
g_pickup_armorbig = cvar("g_pickup_armorbig");
g_pickup_armorbig_max = cvar("g_pickup_armorbig_max");
+ g_pickup_armorbig_anyway = cvar("g_pickup_armorbig_anyway");
g_pickup_armorlarge = cvar("g_pickup_armorlarge");
g_pickup_armorlarge_max = cvar("g_pickup_armorlarge_max");
+ g_pickup_armorlarge_anyway = cvar("g_pickup_armorlarge_anyway");
g_pickup_healthsmall = cvar("g_pickup_healthsmall");
g_pickup_healthsmall_max = cvar("g_pickup_healthsmall_max");
+ g_pickup_healthsmall_anyway = cvar("g_pickup_healthsmall_anyway");
g_pickup_healthmedium = cvar("g_pickup_healthmedium");
g_pickup_healthmedium_max = cvar("g_pickup_healthmedium_max");
+ g_pickup_healthmedium_anyway = cvar("g_pickup_healthmedium_anyway");
g_pickup_healthlarge = cvar("g_pickup_healthlarge");
g_pickup_healthlarge_max = cvar("g_pickup_healthlarge_max");
+ g_pickup_healthlarge_anyway = cvar("g_pickup_healthlarge_anyway");
g_pickup_healthmega = cvar("g_pickup_healthmega");
g_pickup_healthmega_max = cvar("g_pickup_healthmega_max");
+ g_pickup_healthmega_anyway = cvar("g_pickup_healthmega_anyway");
+
+ g_pickup_ammo_anyway = cvar("g_pickup_ammo_anyway");
+ g_pickup_weapons_anyway = cvar("g_pickup_weapons_anyway");
g_pinata = cvar("g_pinata");
precache_all_playermodels("models/player/*.dpm");
precache_all_playermodels("models/player/*.md3");
precache_all_playermodels("models/player/*.psk");
+ precache_all_playermodels("models/player/*.iqm");
}
if (cvar("sv_defaultcharacter"))
activator = a;
}
+void adaptor_think2use_hittype_splash() // for timed projectile detonation
+{
+ if not(self.flags & FL_ONGROUND) // if onground, we ARE touching something, but HITTYPE_SPLASH is to be networked if the damage causing projectile is not touching ANYTHING
+ self.projectiledeathtype |= HITTYPE_SPLASH;
+ adaptor_think2use();
+}
+
// deferred dropping
void DropToFloor_Handler()
{
{
// center
vecs_y = 0;
- vecs_z -= 4;
+ vecs_z -= 2;
}
else
{
{
// center
vecs_y = 0;
- vecs_z -= 4;
+ vecs_z -= 2;
}
else
{
else
{
vecs_y = 0;
- vecs_z -= 4;
+ vecs_z -= 2;
}
}
else if ((s = cvar_string("g_shootfromfixedorigin")) != "")
sv_airstopaccelerate = cvar("sv_airstopaccelerate");
sv_airstrafeaccelerate = cvar("sv_airstrafeaccelerate");
sv_maxairstrafespeed = cvar("sv_maxairstrafespeed");
+ sv_airstrafeaccel_qw = cvar("sv_airstrafeaccel_qw");
sv_aircontrol = cvar("sv_aircontrol");
sv_aircontrol_power = cvar("sv_aircontrol_power");
sv_warsowbunny_airforwardaccel = cvar("sv_warsowbunny_airforwardaccel");
sv_warsowbunny_topspeed = cvar("sv_warsowbunny_topspeed");
sv_warsowbunny_turnaccel = cvar("sv_warsowbunny_turnaccel");
sv_warsowbunny_backtosideratio = cvar("sv_warsowbunny_backtosideratio");
+ sv_airspeedlimit_nonqw = cvar("sv_airspeedlimit_nonqw");
teamplay = cvar ("teamplay");
sys_frametime = cvar("sys_ticrate") * cvar("slowmo");
+ sv_doublejump = cvar("sv_doublejump");
if (timeoutStatus == 1) // just before the timeout (when timeoutStatus will be 2)
orig_slowmo = cvar("slowmo"); // slowmo will be restored after the timeout
}
.float max_armorvalue;
+.float pickup_anyway;
float Item_Customize()
{
}
if (item.ammo_fuel)
- if (player.ammo_fuel < g_pickup_fuel_max)
+ if (player.ammo_fuel < g_pickup_fuel_max)
{
pickedup = TRUE;
player.ammo_fuel = min(player.ammo_fuel + item.ammo_fuel, g_pickup_fuel_max);
if(item.spawnshieldtime)
{
if (item.ammo_shells)
- if (player.ammo_shells < g_pickup_shells_max)
+ if ((player.ammo_shells < g_pickup_shells_max) || item.pickup_anyway)
{
pickedup = TRUE;
player.ammo_shells = min (player.ammo_shells + item.ammo_shells, g_pickup_shells_max);
}
if (item.ammo_nails)
- if (player.ammo_nails < g_pickup_nails_max)
+ if ((player.ammo_nails < g_pickup_nails_max) || item.pickup_anyway)
{
pickedup = TRUE;
player.ammo_nails = min (player.ammo_nails + item.ammo_nails, g_pickup_nails_max);
}
if (item.ammo_rockets)
- if (player.ammo_rockets < g_pickup_rockets_max)
+ if ((player.ammo_rockets < g_pickup_rockets_max) || item.pickup_anyway)
{
pickedup = TRUE;
player.ammo_rockets = min (player.ammo_rockets + item.ammo_rockets, g_pickup_rockets_max);
}
if (item.ammo_cells)
- if (player.ammo_cells < g_pickup_cells_max)
+ if ((player.ammo_cells < g_pickup_cells_max) || item.pickup_anyway)
{
pickedup = TRUE;
player.ammo_cells = min (player.ammo_cells + item.ammo_cells, g_pickup_cells_max);
}
if (item.ammo_fuel)
- if (player.ammo_fuel < g_pickup_fuel_max)
+ if ((player.ammo_fuel < g_pickup_fuel_max) || item.pickup_anyway)
{
pickedup = TRUE;
player.ammo_fuel = min(player.ammo_fuel + item.ammo_fuel, g_pickup_fuel_max);
}
if (item.flags & FL_WEAPON)
- if ((it = item.weapons - (item.weapons & player.weapons)))
+ if ((it = item.weapons - (item.weapons & player.weapons)) || g_pickup_weapons_anyway)
{
pickedup = TRUE;
for(i = WEP_FIRST; i <= WEP_LAST; ++i)
}
if (item.health)
- if (player.health < item.max_health)
+ if ((player.health < item.max_health) || item.pickup_anyway)
{
pickedup = TRUE;
player.health = min(player.health + item.health, item.max_health);
player.pauserothealth_finished = max(player.pauserothealth_finished, time + cvar("g_balance_pause_health_rot"));
}
if (item.armorvalue)
- if (player.armorvalue < item.max_armorvalue)
+ if ((player.armorvalue < item.max_armorvalue) || item.pickup_anyway)
{
pickedup = TRUE;
player.armorvalue = min(player.armorvalue + item.armorvalue, item.max_armorvalue);
void spawnfunc_item_rockets (void) {
if(!self.ammo_rockets)
self.ammo_rockets = g_pickup_rockets;
+ if(!self.pickup_anyway)
+ self.pickup_anyway = g_pickup_ammo_anyway;
StartItem ("models/items/a_rockets.md3", "misc/itempickup.wav", g_pickup_respawntime_ammo, g_pickup_respawntimejitter_ammo, "rockets", IT_ROCKETS, 0, 0, commodity_pickupevalfunc, 3000);
}
if(!self.ammo_nails)
self.ammo_nails = g_pickup_nails;
+ if(!self.pickup_anyway)
+ self.pickup_anyway = g_pickup_ammo_anyway;
StartItem ("models/items/a_bullets.mdl", "misc/itempickup.wav", g_pickup_respawntime_ammo, g_pickup_respawntimejitter_ammo, "bullets", IT_NAILS, 0, 0, commodity_pickupevalfunc, 2000);
}
void spawnfunc_item_cells (void) {
if(!self.ammo_cells)
self.ammo_cells = g_pickup_cells;
+ if(!self.pickup_anyway)
+ self.pickup_anyway = g_pickup_ammo_anyway;
StartItem ("models/items/a_cells.md3", "misc/itempickup.wav", g_pickup_respawntime_ammo, g_pickup_respawntimejitter_ammo, "cells", IT_CELLS, 0, 0, commodity_pickupevalfunc, 2000);
}
if(!self.ammo_shells)
self.ammo_shells = g_pickup_shells;
+ if(!self.pickup_anyway)
+ self.pickup_anyway = g_pickup_ammo_anyway;
StartItem ("models/items/a_shells.md3", "misc/itempickup.wav", g_pickup_respawntime_ammo, g_pickup_respawntimejitter_ammo, "shells", IT_SHELLS, 0, 0, commodity_pickupevalfunc, 500);
}
self.armorvalue = g_pickup_armorsmall;
if(!self.max_armorvalue)
self.max_armorvalue = g_pickup_armorsmall_max;
+ if(!self.pickup_anyway)
+ self.pickup_anyway = g_pickup_armorsmall_anyway;
StartItem ("models/items/g_a1.md3", "misc/armor1.wav", g_pickup_respawntime_short, g_pickup_respawntimejitter_short, "5 Armor", IT_ARMOR_SHARD, 0, 0, commodity_pickupevalfunc, BOT_PICKUP_RATING_LOW);
}
self.armorvalue = g_pickup_armormedium;
if(!self.max_armorvalue)
self.max_armorvalue = g_pickup_armormedium_max;
+ if(!self.pickup_anyway)
+ self.pickup_anyway = g_pickup_armormedium_anyway;
StartItem ("models/items/g_armormedium.md3", "misc/armor10.wav", g_pickup_respawntime_medium, g_pickup_respawntimejitter_medium, "25 Armor", IT_ARMOR, 0, 0, commodity_pickupevalfunc, BOT_PICKUP_RATING_MID);
}
self.armorvalue = g_pickup_armorbig;
if(!self.max_armorvalue)
self.max_armorvalue = g_pickup_armorbig_max;
+ if(!self.pickup_anyway)
+ self.pickup_anyway = g_pickup_armorbig_anyway;
StartItem ("models/items/g_a50.md3", "misc/armor17_5.wav", g_pickup_respawntime_long, g_pickup_respawntimejitter_long, "50 Armor", IT_ARMOR, 0, 0, commodity_pickupevalfunc, 20000);
}
self.armorvalue = g_pickup_armorlarge;
if(!self.max_armorvalue)
self.max_armorvalue = g_pickup_armorlarge_max;
+ if(!self.pickup_anyway)
+ self.pickup_anyway = g_pickup_armorlarge_anyway;
StartItem ("models/items/g_a25.md3", "misc/armor25.wav", g_pickup_respawntime_long, g_pickup_respawntimejitter_long, "100 Armor", IT_ARMOR, 0, 0, commodity_pickupevalfunc, BOT_PICKUP_RATING_HIGH);
}
self.max_health = g_pickup_healthsmall_max;
if(!self.health)
self.health = g_pickup_healthsmall;
+ if(!self.pickup_anyway)
+ self.pickup_anyway = g_pickup_healthsmall_anyway;
StartItem ("models/items/g_h1.md3", "misc/minihealth.wav", g_pickup_respawntime_short, g_pickup_respawntimejitter_short, "5 Health", IT_5HP, 0, 0, commodity_pickupevalfunc, BOT_PICKUP_RATING_LOW);
}
self.max_health = g_pickup_healthmedium_max;
if(!self.health)
self.health = g_pickup_healthmedium;
+ if(!self.pickup_anyway)
+ self.pickup_anyway = g_pickup_healthmedium_anyway;
StartItem ("models/items/g_h25.md3", "misc/mediumhealth.wav", g_pickup_respawntime_short, g_pickup_respawntimejitter_short, "25 Health", IT_25HP, 0, 0, commodity_pickupevalfunc, BOT_PICKUP_RATING_MID);
}
self.max_health = g_pickup_healthlarge_max;
if(!self.health)
self.health = g_pickup_healthlarge;
+ if(!self.pickup_anyway)
+ self.pickup_anyway = g_pickup_healthlarge_anyway;
StartItem ("models/items/g_h50.md3", "misc/mediumhealth.wav", g_pickup_respawntime_medium, g_pickup_respawntimejitter_medium, "50 Health", IT_25HP, 0, 0, commodity_pickupevalfunc, BOT_PICKUP_RATING_MID);
}
self.max_health = g_pickup_healthmega_max;
if(!self.health)
self.health = g_pickup_healthmega;
+ if(!self.pickup_anyway)
+ self.pickup_anyway = g_pickup_healthmega_anyway;
StartItem ("models/items/g_h100.md3", "misc/megahealth.wav", g_pickup_respawntime_long, g_pickup_respawntimejitter_long, "100 Health", IT_HEALTH, 0, 0, commodity_pickupevalfunc, BOT_PICKUP_RATING_HIGH);
}
}
{
if(!self.ammo_fuel)
self.ammo_fuel = g_pickup_fuel;
+ if(!self.pickup_anyway)
+ self.pickup_anyway = g_pickup_ammo_anyway;
StartItem ("models/items/g_fuel.md3", "misc/itempickup.wav", g_pickup_respawntime_ammo, g_pickup_respawntimejitter_ammo, "Fuel", IT_FUEL, 0, 0, commodity_pickupevalfunc, BOT_PICKUP_RATING_LOW);
}
other.flags &~= FL_ONGROUND;
other.velocity = self.movedir;
- other.jumppadusetime = time;
if (other.classname == "player")
{
print_to(e, "^1Your vote is empty. See 'vhelp' for more info.");
} else if(e
&& time < e.vote_next) {
- print_to(e, strcat("^1You have to wait ^2", ftos(e.vote_next - time), "^1 seconds before you can again call a vote."));
+ print_to(e, strcat("^1You have to wait ^2", ftos(ceil(e.vote_next - time)), "^1 seconds before you can again call a vote."));
} else if(VoteCheckNasty(vote)) {
print_to(e, "Syntax error in command. See 'vhelp' for more info.");
} else if(RemapVote(vote, "vcall", e)) {
#ifdef REGISTER_WEAPON
REGISTER_WEAPON(CAMPINGRIFLE, w_campingrifle, IT_NAILS, 3, WEP_FLAG_NORMAL | WEP_TYPE_HITSCAN, BOT_PICKUP_RATING_MID, "campingrifle", "campingrifle", "Rifle");
#else
+#ifdef SVQC
//Camping rifle Primary mode: manually operated bolt*, Secondary: full automatic**
//* Manually operating the bolt means that all the power of the gas is used to propell the bullet. In this mode the bolt is prevented from moving backwards in response to the firing of the bullet.
//** In fully automatic mode some of the gas is used to extract and reload the next cartrige, thus there is less power and range.
w_ready();
}
-void W_CampingRifle_Reload()
+float W_CampingRifle_Reload()
{
float t;
W_CampingRifle_CheckMaxBullets(TRUE);
- if (self.campingrifle_bulletcounter >= cvar("g_balance_campingrifle_magazinecapacity"))
- return;
- if(self.ammo_nails < min(cvar("g_balance_campingrifle_primary_ammo"), cvar("g_balance_campingrifle_secondary_ammo")))
+ if(self.ammo_nails < min(cvar("g_balance_campingrifle_primary_ammo"), cvar("g_balance_campingrifle_secondary_ammo"))) // when we get here, bulletcounter must be 0 or -1
{
+ print("cannot reload... not enough bullets\n");
self.campingrifle_bulletcounter = -1; // reload later
- return;
+ W_SwitchToOtherWeapon(self);
+ return 0;
}
+ if (self.campingrifle_bulletcounter >= cvar("g_balance_campingrifle_magazinecapacity"))
+ return 0;
+
if (self.weaponentity)
{
if (self.weaponentity.wframe == WFRAME_RELOAD)
- return;
+ return 0;
// allow to switch away while reloading, but this will cause a new reload!
self.weaponentity.state = WS_READY;
weapon_thinkf(WFRAME_RELOAD, cvar("g_balance_campingrifle_reloadtime"), W_CampingRifle_ReloadedAndReady);
self.campingrifle_bulletcounter = -1;
+
+ return 1;
}
void W_CampingRifle_CheckReloadAndReady()
{
w_ready();
- if (self.campingrifle_bulletcounter <= 0)
- W_CampingRifle_Reload();
- else
- w_ready();
+ if(self.campingrifle_bulletcounter <= 0)
+ if(W_CampingRifle_Reload())
+ return;
}
void W_CampingRifle_FireBullet(float pSpread, float pDamage, float pHeadshotAddedDamage, float pForce, float pSpeed, float pLifetime, float pAmmo, float deathtype, float pBulletConstant)
weapon_defaultspawnfunc(WEP_CAMPINGRIFLE);
}
+.void(void) campingrifle_bullethail_attackfunc;
+.float campingrifle_bullethail_frame;
+.float campingrifle_bullethail_animtime;
+.float campingrifle_bullethail_refire;
+void W_CampingRifle_BulletHail_Continue()
+{
+ float r, sw, af;
+ W_CampingRifle_CheckReloadAndReady();
+ if(self.campingrifle_bulletcounter < 0)
+ return; // reloading, so we are done
+ sw = self.switchweapon; // make it not detect weapon changes as reason to abort firing
+ af = ATTACK_FINISHED(self);
+ self.switchweapon = self.weapon;
+ ATTACK_FINISHED(self) = time;
+ print(ftos(self.ammo_nails), "\n");
+ r = weapon_prepareattack(self.campingrifle_bullethail_frame == WFRAME_FIRE2, self.campingrifle_bullethail_refire);
+ if(self.switchweapon == self.weapon)
+ self.switchweapon = sw;
+ if(r)
+ {
+ self.campingrifle_bullethail_attackfunc();
+ weapon_thinkf(self.campingrifle_bullethail_frame, self.campingrifle_bullethail_animtime, W_CampingRifle_BulletHail_Continue);
+ print("thinkf set\n");
+ }
+ else
+ {
+ ATTACK_FINISHED(self) = af; // reset attack_finished if we didn't fire, so the last shot enforces the refire time
+ print("out of ammo... ", ftos(self.weaponentity.state), "\n");
+ }
+}
+
+void W_CampingRifle_BulletHail(float mode, void(void) AttackFunc, float fr, float animtime, float refire)
+{
+ // if we get here, we have at least one bullet to fire
+ AttackFunc();
+ if(mode)
+ {
+ // continue hail
+ self.campingrifle_bullethail_attackfunc = AttackFunc;
+ self.campingrifle_bullethail_frame = fr;
+ self.campingrifle_bullethail_animtime = animtime;
+ self.campingrifle_bullethail_refire = refire;
+ weapon_thinkf(fr, animtime, W_CampingRifle_BulletHail_Continue);
+ }
+ else
+ {
+ // just one shot
+ weapon_thinkf(fr, animtime, W_CampingRifle_CheckReloadAndReady);
+ }
+}
+
.float bot_secondary_campingriflemooth;
float w_campingrifle(float req)
{
{
self.campingrifle_accumulator = bound(time - cvar("g_balance_campingrifle_bursttime"), self.campingrifle_accumulator, time);
if (self.BUTTON_ATCK)
+ if (weapon_prepareattack_check(0, cvar("g_balance_campingrifle_primary_refire")))
if (time >= self.campingrifle_accumulator + cvar("g_balance_campingrifle_primary_burstcost"))
- if (weapon_prepareattack(0, cvar("g_balance_campingrifle_primary_refire")))
{
- W_CampingRifle_Attack();
- weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_campingrifle_primary_animtime"), W_CampingRifle_CheckReloadAndReady);
+ weapon_prepareattack_do(0, cvar("g_balance_campingrifle_primary_refire"));
+ W_CampingRifle_BulletHail(cvar("g_balance_campingrifle_primary_bullethail"), W_CampingRifle_Attack, WFRAME_FIRE1, cvar("g_balance_campingrifle_primary_animtime"), cvar("g_balance_campingrifle_primary_refire"));
self.campingrifle_accumulator += cvar("g_balance_campingrifle_primary_burstcost");
}
if (self.BUTTON_ATCK2)
+ if (weapon_prepareattack_check(1, cvar("g_balance_campingrifle_secondary_refire")))
if (time >= self.campingrifle_accumulator + cvar("g_balance_campingrifle_secondary_burstcost"))
- if (weapon_prepareattack(1, cvar("g_balance_campingrifle_secondary_refire")))
{
- W_CampingRifle_Attack2();
- weapon_thinkf(WFRAME_FIRE2, cvar("g_balance_campingrifle_secondary_animtime"), W_CampingRifle_CheckReloadAndReady);
+ weapon_prepareattack_do(1, cvar("g_balance_campingrifle_secondary_refire"));
+ W_CampingRifle_BulletHail(cvar("g_balance_campingrifle_secondary_bullethail"), W_CampingRifle_Attack2, WFRAME_FIRE2, cvar("g_balance_campingrifle_secondary_animtime"), cvar("g_balance_campingrifle_primary_refire"));
self.campingrifle_accumulator += cvar("g_balance_campingrifle_secondary_burstcost");
}
}
{
precache_model ("models/weapons/g_campingrifle.md3");
precache_model ("models/weapons/v_campingrifle.md3");
- precache_model ("models/weapons/h_campingrifle.dpm");
+ precache_model ("models/weapons/h_campingrifle.iqm");
precache_sound ("weapons/campingrifle_reload.wav");
precache_sound ("weapons/campingrifle_fire.wav");
precache_sound ("weapons/campingrifle_fire2.wav");
return self.ammo_nails >= cvar("g_balance_campingrifle_primary_ammo");
else if (req == WR_CHECKAMMO2)
return self.ammo_nails >= cvar("g_balance_campingrifle_secondary_ammo");
+ else if (req == WR_RELOAD)
+ {
+ W_CampingRifle_Reload();
+ }
+ else if (req == WR_RESETPLAYER)
+ {
+ self.campingrifle_accumulator = time - cvar("g_balance_campingrifle_bursttime");
+ self.campingrifle_bulletcounter = cvar("g_balance_campingrifle_magazinecapacity");
+ W_CampingRifle_CheckMaxBullets(FALSE);
+ }
+ return TRUE;
+};
+#endif
+#ifdef CSQC
+float w_campingrifle(float req)
+{
+ if(req == WR_IMPACTEFFECT)
+ {
+ vector org2;
+ org2 = w_org + w_backoff * 2;
+ pointparticles(particleeffectnum("machinegun_impact"), org2, w_backoff * 1000, 1);
+ if(!w_issilent)
+ {
+ if(w_random < 0.2)
+ sound(self, CHAN_PROJECTILE, "weapons/ric1.wav", VOL_BASE, ATTN_NORM);
+ else if(w_random < 0.4)
+ sound(self, CHAN_PROJECTILE, "weapons/ric2.wav", VOL_BASE, ATTN_NORM);
+ else if(w_random < 0.5)
+ sound(self, CHAN_PROJECTILE, "weapons/ric3.wav", VOL_BASE, ATTN_NORM);
+ }
+ }
+ else if(req == WR_PRECACHE)
+ {
+ precache_sound("weapons/ric1.wav");
+ precache_sound("weapons/ric2.wav");
+ precache_sound("weapons/ric3.wav");
+ }
else if (req == WR_SUICIDEMESSAGE)
{
if(w_deathtype & HITTYPE_SECONDARY)
}
}
}
- else if (req == WR_RELOAD)
- {
- W_CampingRifle_Reload();
- }
- else if (req == WR_RESETPLAYER)
- {
- self.campingrifle_accumulator = time - cvar("g_balance_campingrifle_bursttime");
- self.campingrifle_bulletcounter = cvar("g_balance_campingrifle_magazinecapacity");
- W_CampingRifle_CheckMaxBullets(FALSE);
- }
return TRUE;
-};
+}
+#endif
#endif
+
void W_GiveWeapon (entity e, float wep, string name)
{
entity oldself;
void W_BallisticBullet_Touch (void)
{
+ float density;
+
if(self.think == W_BallisticBullet_LeaveSolid_think) // skip this!
return;
PROJECTILE_TOUCH;
W_BallisticBullet_Hit ();
+ density = other.ballistics_density;
+ if(density == 0)
+ density = 1;
+
// go through solid!
- if(!W_BallisticBullet_LeaveSolid(self, self.velocity, self.dmg_radius))
+ if(!W_BallisticBullet_LeaveSolid(self, self.velocity, self.dmg_radius * density))
{
remove(self);
return;
void fireBallisticBullet(vector start, vector dir, float spread, float pSpeed, float lifetime, float damage, float headshotbonus, float force, float dtype, float tracereffects, float gravityfactor, float bulletconstant)
{
- float lag, dt, savetime;
+ float lag, dt, savetime, density;
entity pl, oldself;
entity proj;
W_BallisticBullet_Hit();
}
+ density = other.ballistics_density;
+ if(density == 0)
+ density = 1;
+
// go through solid!
- if(!W_BallisticBullet_LeaveSolid(self, self.velocity, self.dmg_radius))
+ if(!W_BallisticBullet_LeaveSolid(self, self.velocity, self.dmg_radius * density))
break;
W_BallisticBullet_LeaveSolid_think();
#ifdef REGISTER_WEAPON
REGISTER_WEAPON(CRYLINK, w_crylink, IT_CELLS, 6, WEP_FLAG_NORMAL | WEP_TYPE_SPLASH, BOT_PICKUP_RATING_MID, "crylink", "crylink", "Crylink");
#else
+#ifdef SVQC
.float gravity;
.entity realowner;
{
precache_model ("models/weapons/g_crylink.md3");
precache_model ("models/weapons/v_crylink.md3");
- precache_model ("models/weapons/h_crylink.dpm");
+ precache_model ("models/weapons/h_crylink.iqm");
precache_sound ("weapons/crylink_fire.wav");
precache_sound ("weapons/crylink_fire2.wav");
}
return self.ammo_cells >= cvar("g_balance_crylink_primary_ammo");
else if (req == WR_CHECKAMMO2)
return self.ammo_cells >= cvar("g_balance_crylink_secondary_ammo");
+ return TRUE;
+};
+#endif
+#ifdef CSQC
+float w_crylink(float req)
+{
+ if(req == WR_IMPACTEFFECT)
+ {
+ vector org2;
+ org2 = w_org + w_backoff * 2;
+ if(w_deathtype & HITTYPE_SECONDARY)
+ {
+ pointparticles(particleeffectnum("crylink_impact"), org2, '0 0 0', 1);
+ if(!w_issilent)
+ sound(self, CHAN_PROJECTILE, "weapons/crylink_impact2.wav", VOL_BASE, ATTN_NORM);
+ }
+ else
+ {
+ pointparticles(particleeffectnum("crylink_impactbig"), org2, '0 0 0', 1);
+ if(!w_issilent)
+ sound(self, CHAN_PROJECTILE, "weapons/crylink_impact.wav", VOL_BASE, ATTN_NORM);
+ }
+ }
+ else if(req == WR_PRECACHE)
+ {
+ precache_sound("weapons/crylink_impact2.wav");
+ precache_sound("weapons/crylink_impact.wav");
+ }
else if (req == WR_SUICIDEMESSAGE)
{
w_deathtypestring = "succeeded at self-destructing themself with the Crylink";
w_deathtypestring = "took a close look at #'s Crylink"; // unchecked: SECONDARY
}
return TRUE;
-};
+}
+#endif
#endif
#ifdef REGISTER_WEAPON
REGISTER_WEAPON(ELECTRO, w_electro, IT_CELLS, 5, WEP_FLAG_NORMAL | WEP_TYPE_SPLASH, BOT_PICKUP_RATING_MID, "electro", "electro", "Electro");
#else
+#ifdef SVQC
.float electro_count;
.float electro_secondarytime;
void W_Plasma_Explode_Combo (void)
{
-
W_Plasma_TriggerCombo(self.origin, cvar("g_balance_electro_combo_comboradius"), self.owner);
self.event_damage = SUB_Null;
else
{
self.use = W_Plasma_Explode;
- self.think = adaptor_think2use;
+ self.think = adaptor_think2use; // not _hittype_splash, as this runs "immediately"
}
}
}
proj.bot_dodge = TRUE;
proj.bot_dodgerating = cvar("g_balance_electro_primary_damage");
proj.use = W_Plasma_Explode;
- proj.think = adaptor_think2use;
+ proj.think = adaptor_think2use_hittype_splash;
proj.nextthink = time + cvar("g_balance_electro_primary_lifetime");
PROJECTILE_MAKETRIGGER(proj);
proj.projectiledeathtype = WEP_ELECTRO;
proj.classname = "plasma";
proj.owner = self;
proj.use = W_Plasma_Explode;
- proj.think = adaptor_think2use;
+ proj.think = adaptor_think2use_hittype_splash;
proj.bot_dodge = TRUE;
proj.bot_dodgerating = cvar("g_balance_electro_secondary_damage");
proj.nextthink = time + cvar("g_balance_electro_secondary_lifetime");
{
precache_model ("models/weapons/g_electro.md3");
precache_model ("models/weapons/v_electro.md3");
- precache_model ("models/weapons/h_electro.dpm");
+ precache_model ("models/weapons/h_electro.iqm");
precache_sound ("weapons/electro_bounce.wav");
precache_sound ("weapons/electro_fire.wav");
precache_sound ("weapons/electro_fire2.wav");
return self.ammo_cells >= cvar("g_balance_electro_primary_ammo");
else if (req == WR_CHECKAMMO2)
return self.ammo_cells >= cvar("g_balance_electro_secondary_ammo");
+ else if (req == WR_RESETPLAYER)
+ {
+ self.electro_secondarytime = time;
+ }
+ return TRUE;
+};
+#endif
+#ifdef CSQC
+float w_electro(float req)
+{
+ if(req == WR_IMPACTEFFECT)
+ {
+ vector org2;
+ org2 = w_org + w_backoff * 6;
+ if(w_deathtype & HITTYPE_SECONDARY)
+ {
+ pointparticles(particleeffectnum("electro_ballexplode"), org2, '0 0 0', 1);
+ if(!w_issilent)
+ sound(self, CHAN_PROJECTILE, "weapons/electro_impact.wav", VOL_BASE, ATTN_NORM);
+ }
+ else
+ {
+ if(w_deathtype & HITTYPE_BOUNCE)
+ {
+ // this is sent as "primary (w_deathtype & HITTYPE_BOUNCE)" to distinguish it from (w_deathtype & HITTYPE_SECONDARY) bounced balls
+ pointparticles(particleeffectnum("electro_combo"), org2, '0 0 0', 1);
+ if(!w_issilent)
+ sound(self, CHAN_PROJECTILE, "weapons/electro_impact_combo.wav", VOL_BASE, ATTN_NORM);
+ }
+ else
+ {
+ pointparticles(particleeffectnum("electro_impact"), org2, '0 0 0', 1);
+ if(!w_issilent)
+ sound(self, CHAN_PROJECTILE, "weapons/electro_impact.wav", VOL_BASE, ATTN_NORM);
+ }
+ }
+ }
+ else if(req == WR_PRECACHE)
+ {
+ precache_sound("weapons/electro_impact.wav");
+ precache_sound("weapons/electro_impact_combo.wav");
+ }
else if (req == WR_SUICIDEMESSAGE)
{
if(w_deathtype & HITTYPE_SECONDARY)
w_deathtypestring = "was blasted by #'s blue beam";
}
}
- else if (req == WR_RESETPLAYER)
- {
- self.electro_secondarytime = time;
- }
return TRUE;
-};
+}
+#endif
#endif
#ifdef REGISTER_WEAPON
REGISTER_WEAPON(FIREBALL, w_fireball, IT_FUEL, 9, WEP_TYPE_SPLASH, BOT_PICKUP_RATING_MID, "fireball", "fireball", "Fireball");
#else
+#ifdef SVQC
.float bot_primary_fireballmooth; // whatever a mooth is
.vector fireball_impactvec;
.float fireball_primarytime;
if(time > self.pushltime)
{
self.cnt = 1;
+ self.projectiledeathtype |= HITTYPE_SPLASH;
W_Fireball_Explode();
return;
}
{
precache_model ("models/weapons/g_fireball.md3");
precache_model ("models/weapons/v_fireball.md3");
- precache_model ("models/weapons/h_fireball.dpm");
+ precache_model ("models/weapons/h_fireball.iqm");
precache_model ("models/sphere/sphere.md3");
precache_sound ("weapons/fireball_fire.wav");
precache_sound ("weapons/fireball_fire2.wav");
return self.ammo_fuel >= cvar("g_balance_fireball_primary_ammo");
else if (req == WR_CHECKAMMO2)
return self.ammo_fuel >= cvar("g_balance_fireball_secondary_ammo");
+ else if (req == WR_RESETPLAYER)
+ {
+ self.fireball_primarytime = time;
+ }
+ return TRUE;
+};
+#endif
+#ifdef CSQC
+float w_fireball(float req)
+{
+ if(req == WR_IMPACTEFFECT)
+ {
+ vector org2;
+ if(w_deathtype & HITTYPE_SECONDARY)
+ {
+ // firemine goes out silently
+ }
+ else
+ {
+ org2 = w_org + w_backoff * 16;
+ pointparticles(particleeffectnum("fireball_explode"), org2, '0 0 0', 1);
+ if(!w_issilent)
+ sound(self, CHAN_PROJECTILE, "weapons/fireball_impact2.wav", VOL_BASE, ATTN_NORM * 0.25); // long range boom
+ }
+ }
+ else if(req == WR_PRECACHE)
+ {
+ precache_sound("weapons/fireball_impact.wav");
+ precache_sound("weapons/fireball_impact2.wav");
+ }
else if (req == WR_SUICIDEMESSAGE)
{
if(w_deathtype & HITTYPE_SECONDARY)
w_deathtypestring = "tasted #'s fireball";
}
}
- else if (req == WR_RESETPLAYER)
- {
- self.fireball_primarytime = time;
- }
return TRUE;
-};
+}
+#endif
#endif
#ifdef REGISTER_WEAPON
REGISTER_WEAPON(GRENADE_LAUNCHER, w_glauncher, IT_ROCKETS, 4, WEP_FLAG_NORMAL | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH, BOT_PICKUP_RATING_MID, "gl", "grenadelauncher", "Mortar");
#else
+#ifdef SVQC
void W_Grenade_Explode (void)
{
if(other.takedamage == DAMAGE_AIM)
setsize(gren, '0 0 -3', '0 0 -3');
gren.nextthink = time + cvar("g_balance_grenadelauncher_primary_lifetime");
- gren.think = adaptor_think2use;
+ gren.think = adaptor_think2use_hittype_splash;
gren.use = W_Grenade_Explode;
gren.touch = W_Grenade_Touch1;
W_SETUPPROJECTILEVELOCITY_UP(gren, g_balance_grenadelauncher_primary);
setorigin(gren, w_shotorg);
gren.nextthink = time + cvar("g_balance_grenadelauncher_secondary_lifetime");
- gren.think = adaptor_think2use;
+ gren.think = adaptor_think2use_hittype_splash;
gren.use = W_Grenade_Explode2;
gren.touch = W_Grenade_Touch2;
gren.takedamage = DAMAGE_YES;
{
precache_model ("models/weapons/g_gl.md3");
precache_model ("models/weapons/v_gl.md3");
- precache_model ("models/weapons/h_gl.dpm");
+ precache_model ("models/weapons/h_gl.iqm");
precache_sound ("weapons/grenade_bounce1.wav");
precache_sound ("weapons/grenade_bounce2.wav");
precache_sound ("weapons/grenade_bounce3.wav");
return self.ammo_rockets >= cvar("g_balance_grenadelauncher_primary_ammo");
else if (req == WR_CHECKAMMO2)
return self.ammo_rockets >= cvar("g_balance_grenadelauncher_secondary_ammo");
+ return TRUE;
+};
+#endif
+#ifdef CSQC
+float w_glauncher(float req)
+{
+ if(req == WR_IMPACTEFFECT)
+ {
+ vector org2;
+ org2 = w_org + w_backoff * 12;
+ pointparticles(particleeffectnum("grenade_explode"), org2, '0 0 0', 1);
+ if(!w_issilent)
+ sound(self, CHAN_PROJECTILE, "weapons/grenade_impact.wav", VOL_BASE, ATTN_NORM);
+ }
+ else if(req == WR_PRECACHE)
+ {
+ precache_sound("weapons/grenade_impact.wav");
+ }
else if (req == WR_SUICIDEMESSAGE)
{
if(w_deathtype & HITTYPE_SECONDARY)
w_deathtypestring = "ate #'s grenade";
}
return TRUE;
-};
+}
+#endif
#endif
#ifdef REGISTER_WEAPON
REGISTER_WEAPON(HAGAR, w_hagar, IT_ROCKETS, 8, WEP_FLAG_NORMAL | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH, BOT_PICKUP_RATING_MID, "hagar", "hagar", "Hagar");
#else
+#ifdef SVQC
// NO bounce protection, as bounces are limited!
void W_Hagar_Explode (void)
{
missile.bot_dodgerating = cvar("g_balance_hagar_primary_damage");
missile.touch = W_Hagar_Touch;
missile.use = W_Hagar_Explode;
- missile.think = adaptor_think2use;
+ missile.think = adaptor_think2use_hittype_splash;
missile.nextthink = time + cvar("g_balance_hagar_primary_lifetime");
PROJECTILE_MAKETRIGGER(missile);
missile.projectiledeathtype = WEP_HAGAR;
missile.touch = W_Hagar_Touch2;
missile.cnt = 0;
missile.use = W_Hagar_Explode2;
- missile.think = adaptor_think2use;
+ missile.think = adaptor_think2use_hittype_splash;
missile.nextthink = time + cvar("g_balance_hagar_secondary_lifetime_min") + random() * cvar("g_balance_hagar_secondary_lifetime_rand");
PROJECTILE_MAKETRIGGER(missile);
missile.projectiledeathtype = WEP_HAGAR | HITTYPE_SECONDARY;
{
precache_model ("models/weapons/g_hagar.md3");
precache_model ("models/weapons/v_hagar.md3");
- precache_model ("models/weapons/h_hagar.dpm");
+ precache_model ("models/weapons/h_hagar.iqm");
precache_sound ("weapons/hagar_fire.wav");
}
else if (req == WR_SETUP)
return self.ammo_rockets >= cvar("g_balance_hagar_primary_ammo");
else if (req == WR_CHECKAMMO2)
return self.ammo_rockets >= cvar("g_balance_hagar_secondary_ammo");
+ return TRUE;
+};
+#endif
+#ifdef CSQC
+float w_hagar(float req)
+{
+ if(req == WR_IMPACTEFFECT)
+ {
+ vector org2;
+ org2 = w_org + w_backoff * 6;
+ pointparticles(particleeffectnum("hagar_explode"), org2, '0 0 0', 1);
+ if(!w_issilent)
+ {
+ if (w_random<0.15)
+ sound(self, CHAN_PROJECTILE, "weapons/hagexp1.wav", VOL_BASE, ATTN_NORM);
+ else if (w_random<0.7)
+ sound(self, CHAN_PROJECTILE, "weapons/hagexp2.wav", VOL_BASE, ATTN_NORM);
+ else
+ sound(self, CHAN_PROJECTILE, "weapons/hagexp3.wav", VOL_BASE, ATTN_NORM);
+ }
+ }
+ else if(req == WR_PRECACHE)
+ {
+ precache_sound("weapons/hagexp1.wav");
+ precache_sound("weapons/hagexp2.wav");
+ precache_sound("weapons/hagexp3.wav");
+ }
else if (req == WR_SUICIDEMESSAGE)
w_deathtypestring = "played with tiny rockets";
else if (req == WR_KILLMESSAGE)
w_deathtypestring = "was pummeled by";
}
return TRUE;
-};
+}
+#endif
#endif
#ifdef REGISTER_WEAPON
REGISTER_WEAPON(HLAC, w_hlac, IT_CELLS, 6, WEP_FLAG_NORMAL | WEP_TYPE_SPLASH, BOT_PICKUP_RATING_MID, "hlac", "hlac", "Heavy Laser Assault Cannon");
#else
+#ifdef SVQC
.float HLAC_bulletcounter;
void W_HLAC_Touch (void)
{
{
precache_model ("models/weapons/g_hlac.md3");
precache_model ("models/weapons/v_hlac.md3");
- precache_model ("models/weapons/h_hlac.dpm");
+ precache_model ("models/weapons/h_hlac.iqm");
precache_sound ("weapons/lasergun_fire.wav");
}
return self.ammo_cells >= cvar("g_balance_hlac_primary_ammo");
else if (req == WR_CHECKAMMO2)
return self.ammo_cells >= cvar("g_balance_hlac_secondary_ammo");
+ return TRUE;
+};
+#endif
+#ifdef CSQC
+float w_hlac(float req)
+{
+ if(req == WR_IMPACTEFFECT)
+ {
+ vector org2;
+ org2 = w_org + w_backoff * 6;
+ pointparticles(particleeffectnum("laser_impact"), org2, w_backoff * 1000, 1);
+ if(!w_issilent)
+ sound(self, CHAN_PROJECTILE, "weapons/laserimpact.wav", VOL_BASE, ATTN_NORM);
+ }
+ else if(req == WR_PRECACHE)
+ {
+ precache_sound("weapons/laserimpact.wav");
+ }
else if (req == WR_SUICIDEMESSAGE)
w_deathtypestring = "should have used a smaller gun";
else if (req == WR_KILLMESSAGE)
w_deathtypestring = "was cut down by";
return TRUE;
-};
+}
+#endif
#endif
#ifdef REGISTER_WEAPON
REGISTER_WEAPON(HOOK, w_hook, IT_CELLS|IT_FUEL, 0, WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH, 0, "hookgun", "hook", "Grappling Hook");
#else
+#ifdef SVQC
.float dmg;
.float dmg_edge;
.float dmg_radius;
setsize(gren, '0 0 0', '0 0 0');
gren.nextthink = time + cvar("g_balance_hook_secondary_lifetime");
- gren.think = adaptor_think2use;
+ gren.think = adaptor_think2use_hittype_splash;
gren.use = W_Hook_Explode2;
gren.touch = W_Hook_Touch2;
{
precache_model ("models/weapons/g_hookgun.md3");
precache_model ("models/weapons/v_hookgun.md3");
- precache_model ("models/weapons/h_hookgun.dpm");
+ precache_model ("models/weapons/h_hookgun.iqm");
precache_sound ("weapons/hook_impact.wav"); // done by g_hook.qc
precache_sound ("weapons/hook_fire.wav");
precache_sound ("weapons/hookbomb_fire.wav");
{
return self.ammo_cells >= cvar("g_balance_hook_secondary_ammo");
}
- else if (req == WR_SUICIDEMESSAGE)
- w_deathtypestring = "did the impossible";
- else if (req == WR_KILLMESSAGE)
- w_deathtypestring = "has run into #'s gravity bomb";
else if (req == WR_RESETPLAYER)
{
self.hook_refire = time;
return TRUE;
};
#endif
+#ifdef CSQC
+float w_hook(float req)
+{
+ if(req == WR_IMPACTEFFECT)
+ {
+ vector org2;
+ org2 = w_org + w_backoff * 2;
+ pointparticles(particleeffectnum("hookbomb_explode"), org2, '0 0 0', 1);
+ if(!w_issilent)
+ sound(self, CHAN_PROJECTILE, "weapons/hookbomb_impact.wav", VOL_BASE, ATTN_NORM);
+ }
+ else if(req == WR_PRECACHE)
+ {
+ precache_sound("weapons/hookbomb_impact.wav");
+ }
+ else if (req == WR_SUICIDEMESSAGE)
+ w_deathtypestring = "did the impossible";
+ else if (req == WR_KILLMESSAGE)
+ w_deathtypestring = "has run into #'s gravity bomb";
+ return TRUE;
+}
+#endif
+#endif
#ifdef REGISTER_WEAPON
REGISTER_WEAPON(LASER, w_laser, 0, 1, WEP_FLAG_NORMAL | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH, 0, "laser", "laser", "Laser");
#else
+#ifdef SVQC
void(float imp) W_SwitchWeapon;
void W_Laser_Touch (void)
{
precache_model ("models/weapons/g_laser.md3");
precache_model ("models/weapons/v_laser.md3");
- precache_model ("models/weapons/h_laser.dpm");
+ precache_model ("models/weapons/h_laser.iqm");
precache_sound ("weapons/lasergun_fire.wav");
precache_sound ("weapons/gauntlet_fire.wav");
}
return TRUE;
else if (req == WR_CHECKAMMO2)
return TRUE;
+ return TRUE;
+};
+#endif
+#ifdef CSQC
+float w_laser(float req)
+{
+ if(req == WR_IMPACTEFFECT)
+ {
+ vector org2;
+ org2 = w_org + w_backoff * 6;
+ pointparticles(particleeffectnum("laser_impact"), org2, w_backoff * 1000, 1);
+ if(!w_issilent)
+ sound(self, CHAN_PROJECTILE, "weapons/laserimpact.wav", VOL_BASE, ATTN_NORM);
+ }
+ else if(req == WR_PRECACHE)
+ {
+ precache_sound("weapons/laserimpact.wav");
+ }
else if (req == WR_SUICIDEMESSAGE)
w_deathtypestring = "lasered themself to hell";
else if (req == WR_KILLMESSAGE)
w_deathtypestring = "was lasered to death by"; // unchecked: SPLASH
}
return TRUE;
-};
+}
+#endif
#endif
#ifdef REGISTER_WEAPON
REGISTER_WEAPON(MINSTANEX, w_minstanex, IT_CELLS, 7, WEP_FLAG_HIDDEN | WEP_FLAG_CANCLIMB | WEP_TYPE_HITSCAN, BOT_PICKUP_RATING_HIGH, "minstanex", "minstanex", "MinstaNex");
#else
+#ifdef SVQC
.float minstanex_lasthit;
void W_MinstaNex_Attack (void)
precache_model ("models/nexflash.md3");
precache_model ("models/weapons/g_minstanex.md3");
precache_model ("models/weapons/v_minstanex.md3");
- precache_model ("models/weapons/h_minstanex.dpm");
+ precache_model ("models/weapons/h_minstanex.iqm");
precache_sound ("weapons/minstanexfire.wav");
precache_sound ("weapons/nexwhoosh1.wav");
precache_sound ("weapons/nexwhoosh2.wav");
}
else if (req == WR_CHECKAMMO2)
return TRUE;
- else if (req == WR_SUICIDEMESSAGE)
- w_deathtypestring = "did the impossible";
- else if (req == WR_KILLMESSAGE)
- w_deathtypestring = "has been vaporized by";
else if (req == WR_RESETPLAYER)
{
self.minstanex_lasthit = 0;
return TRUE;
};
#endif
+#ifdef CSQC
+float w_minstanex(float req)
+{
+ if(req == WR_IMPACTEFFECT)
+ {
+ vector org2;
+ org2 = w_org + w_backoff * 6;
+ pointparticles(particleeffectnum("nex_impact"), org2, '0 0 0', 1);
+ if(!w_issilent)
+ sound(self, CHAN_PROJECTILE, "weapons/neximpact.wav", VOL_BASE, ATTN_NORM);
+ }
+ else if(req == WR_PRECACHE)
+ {
+ precache_sound("weapons/neximpact.wav");
+ }
+ else if (req == WR_SUICIDEMESSAGE)
+ w_deathtypestring = "did the impossible";
+ else if (req == WR_KILLMESSAGE)
+ w_deathtypestring = "has been vaporized by";
+ return TRUE;
+}
+#endif
+#endif
#ifdef REGISTER_WEAPON
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() {
vector v;
v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos);
precache_model ("models/nexflash.md3");
precache_model ("models/weapons/g_nex.md3");
precache_model ("models/weapons/v_nex.md3");
- precache_model ("models/weapons/h_nex.dpm");
+ precache_model ("models/weapons/h_nex.iqm");
precache_sound ("weapons/nexfire.wav");
precache_sound ("weapons/nexwhoosh1.wav");
precache_sound ("weapons/nexwhoosh2.wav");
return self.ammo_cells >= cvar("g_balance_nex_ammo");
else if (req == WR_CHECKAMMO2)
return FALSE;
+ return TRUE;
+};
+#endif
+#ifdef CSQC
+float w_nex(float req)
+{
+ if(req == WR_IMPACTEFFECT)
+ {
+ vector org2;
+ org2 = w_org + w_backoff * 6;
+ pointparticles(particleeffectnum("nex_impact"), org2, '0 0 0', 1);
+ if(!w_issilent)
+ sound(self, CHAN_PROJECTILE, "weapons/neximpact.wav", VOL_BASE, ATTN_NORM);
+ }
+ else if(req == WR_PRECACHE)
+ {
+ precache_sound("weapons/neximpact.wav");
+ }
else if (req == WR_SUICIDEMESSAGE)
w_deathtypestring = "did the impossible";
else if (req == WR_KILLMESSAGE)
w_deathtypestring = "has been vaporized by";
return TRUE;
-};
+}
+#endif
#endif
#ifdef REGISTER_WEAPON
REGISTER_WEAPON(PORTO, w_porto, 0, 0, WEP_TYPE_OTHER, 0, "porto" , "porto", "Port-O-Launch");
#else
+#ifdef SVQC
.entity porto_current;
.vector porto_v_angle; // holds "held" view angles
.float porto_v_angle_held;
{
precache_model ("models/weapons/g_porto.md3");
precache_model ("models/weapons/v_porto.md3");
- precache_model ("models/weapons/h_porto.dpm");
+ precache_model ("models/weapons/h_porto.iqm");
precache_model ("models/portal.md3");
precache_sound ("porto/bounce.wav");
precache_sound ("porto/create.wav");
}
else if (req == WR_SETUP)
weapon_setup(WEP_PORTO);
- else if (req == WR_SUICIDEMESSAGE)
- w_deathtypestring = "did the impossible";
- else if (req == WR_KILLMESSAGE)
- w_deathtypestring = "felt # doing the impossible to him";
else if (req == WR_RESETPLAYER)
{
self.porto_current = world;
return TRUE;
};
#endif
+#ifdef CSQC
+float w_porto(float req)
+{
+ if(req == WR_IMPACTEFFECT)
+ {
+ print("Since when does Porto send DamageInfo?\n");
+ }
+ else if(req == WR_PRECACHE)
+ {
+ // nothing to do
+ }
+ else if (req == WR_SUICIDEMESSAGE)
+ w_deathtypestring = "did the impossible";
+ else if (req == WR_KILLMESSAGE)
+ w_deathtypestring = "felt # doing the impossible to him";
+ return TRUE;
+}
+#endif
+#endif
#ifdef REGISTER_WEAPON
REGISTER_WEAPON(ROCKET_LAUNCHER, w_rlauncher, IT_ROCKETS, 9, WEP_FLAG_NORMAL | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH, BOT_PICKUP_RATING_HIGH, "rl", "rocketlauncher", "Rocket Launcher");
#else
+#ifdef SVQC
.float rl_release;
.float rl_detonate_later;
precache_model ("models/flash.md3");
precache_model ("models/weapons/g_rl.md3");
precache_model ("models/weapons/v_rl.md3");
- precache_model ("models/weapons/h_rl.dpm");
+ precache_model ("models/weapons/h_rl.iqm");
precache_sound ("weapons/rocket_det.wav");
precache_sound ("weapons/rocket_fire.wav");
precache_sound ("weapons/rocket_mode.wav");
}
else if (req == WR_CHECKAMMO2)
return FALSE;
+ else if (req == WR_RESETPLAYER)
+ {
+ self.rl_release = 0;
+ }
+ return TRUE;
+};
+#endif
+#ifdef CSQC
+float w_rlauncher(float req)
+{
+ if(req == WR_IMPACTEFFECT)
+ {
+ vector org2;
+ org2 = w_org + w_backoff * 12;
+ pointparticles(particleeffectnum("rocket_explode"), org2, '0 0 0', 1);
+ if(!w_issilent)
+ sound(self, CHAN_PROJECTILE, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
+ }
+ else if(req == WR_PRECACHE)
+ {
+ precache_sound("weapons/rocket_impact.wav");
+ }
else if (req == WR_SUICIDEMESSAGE)
w_deathtypestring = "exploded";
else if (req == WR_KILLMESSAGE)
else
w_deathtypestring = "ate #'s rocket";
}
- else if (req == WR_RESETPLAYER)
- {
- self.rl_release = 0;
- }
return TRUE;
-};
+}
+#endif
#endif
#ifdef REGISTER_WEAPON
REGISTER_WEAPON(SEEKER, w_seeker, IT_ROCKETS, 9, WEP_FLAG_NORMAL | WEP_TYPE_SPLASH, BOT_PICKUP_RATING_MID, "seeker", "seeker", "T.A.G. Seeker");
#else
+#ifdef SVQC
//.float speed; = switchweapon
//.float proxytime; = autoswitch
//.float tl; = wait
float dist;
if (time > self.cnt)
+ {
+ self.projectiledeathtype |= HITTYPE_SPLASH;
Seeker_Missile_Explode();
+ }
if (!self.switchweapon)
self.switchweapon = cvar("g_balance_seeker_missile_speed");
missile.bot_dodgerating = cvar("g_balance_seeker_flac_damage");
missile.touch = Seeker_Flac_Explode;
missile.use = Seeker_Flac_Explode;
- missile.think = Seeker_Flac_Explode;
+ missile.think = adaptor_think2use_hittype_splash;
missile.nextthink = time + cvar("g_balance_seeker_flac_lifetime") + cvar("g_balance_seeker_flac_lifetime_rand");
missile.solid = SOLID_BBOX;
missile.scale = 0.4; // BUG: the model is too big
{
precache_model ("models/weapons/g_seeker.md3");
precache_model ("models/weapons/v_seeker.md3");
- precache_model ("models/weapons/h_seeker.dpm");
+ precache_model ("models/weapons/h_seeker.iqm");
precache_sound ("weapons/tag_fire.wav");
precache_sound ("weapons/flac_fire.wav");
precache_sound ("weapons/seeker_fire.wav");
return TRUE;
};
#endif
+#ifdef CSQC
+float w_seeker(float req)
+{
+ if(req == WR_IMPACTEFFECT)
+ {
+ vector org2;
+ org2 = w_org + w_backoff * 6;
+ if(w_deathtype & HITTYPE_SECONDARY)
+ {
+ pointparticles(particleeffectnum("flac_explode"), org2, '0 0 0', 1);
+ if(!w_issilent)
+ {
+ if (w_random<0.15)
+ sound(self, CHAN_PROJECTILE, "weapons/flacexp1.wav", 1, ATTN_NORM);
+ else if (w_random<0.7)
+ sound(self, CHAN_PROJECTILE, "weapons/flacexp2.wav", 1, ATTN_NORM);
+ else
+ sound(self, CHAN_PROJECTILE, "weapons/flacexp3.wav", 1, ATTN_NORM);
+ }
+ }
+ else
+ {
+ if(w_deathtype & HITTYPE_BOUNCE)
+ {
+ pointparticles(particleeffectnum("hagar_explode"), org2, '0 0 0', 1);
+ if(!w_issilent)
+ {
+ if (w_random<0.15)
+ sound(self, CHAN_PROJECTILE, "weapons/tagexp1.wav", 1, ATTN_NORM);
+ else if (w_random<0.7)
+ sound(self, CHAN_PROJECTILE, "weapons/tagexp2.wav", 1, ATTN_NORM);
+ else
+ sound(self, CHAN_PROJECTILE, "weapons/tagexp3.wav", 1, ATTN_NORM);
+ }
+ }
+ else if(w_deathtype & HITTYPE_HEADSHOT)
+ {
+ if(!w_issilent)
+ sound(self, CHAN_PROJECTILE, "weapons/tag_impact.wav", 1, ATTN_NORM);
+ }
+ else
+ {
+ pointparticles(particleeffectnum("hagar_explode"), org2, '0 0 0', 1);
+ if(!w_issilent)
+ {
+ if (w_random<0.15)
+ sound(self, CHAN_PROJECTILE, "weapons/seekerexp1.wav", 1, ATTN_NORM);
+ else if (w_random<0.7)
+ sound(self, CHAN_PROJECTILE, "weapons/seekerexp2.wav", 1, ATTN_NORM);
+ else
+ sound(self, CHAN_PROJECTILE, "weapons/seekerexp3.wav", 1, ATTN_NORM);
+ }
+ }
+ }
+ }
+ else if(req == WR_PRECACHE)
+ {
+ precache_sound("weapons/flacexp1.wav");
+ precache_sound("weapons/flacexp2.wav");
+ precache_sound("weapons/flacexp3.wav");
+ precache_sound("weapons/seekerexp1.wav");
+ precache_sound("weapons/seekerexp2.wav");
+ precache_sound("weapons/seekerexp3.wav");
+ precache_sound("weapons/tagexp1.wav");
+ precache_sound("weapons/tagexp2.wav");
+ precache_sound("weapons/tagexp3.wav");
+ precache_sound("weapons/tag_impact.wav");
+ }
+ return TRUE;
+}
+#endif
+#endif
#ifdef REGISTER_WEAPON
REGISTER_WEAPON(SHOTGUN, w_shotgun, IT_SHELLS, 2, WEP_FLAG_NORMAL | WEP_TYPE_HITSCAN, BOT_PICKUP_RATING_LOW, "shotgun", "shotgun", "Shotgun");
#else
+#ifdef SVQC
void W_Shotgun_Attack (void)
{
float sc;
precache_model ("models/uziflash.md3");
precache_model ("models/weapons/g_shotgun.md3");
precache_model ("models/weapons/v_shotgun.md3");
- precache_model ("models/weapons/h_shotgun.dpm");
+ precache_model ("models/weapons/h_shotgun.iqm");
precache_sound ("misc/itempickup.wav");
precache_sound ("weapons/shotgun_fire.wav");
}
return self.ammo_shells >= cvar("g_balance_shotgun_primary_ammo");
else if (req == WR_CHECKAMMO2)
return self.ammo_shells >= cvar("g_balance_shotgun_secondary_ammo") * 3;
+ return TRUE;
+};
+#endif
+#ifdef CSQC
+float w_shotgun(float req)
+{
+ if(req == WR_IMPACTEFFECT)
+ {
+ vector org2;
+ org2 = w_org + w_backoff * 2;
+ pointparticles(particleeffectnum("shotgun_impact"), org2, w_backoff * 1000, 1);
+ if(!w_issilent)
+ {
+ if(w_random < 0.05)
+ sound(self, CHAN_PROJECTILE, "weapons/ric1.wav", VOL_BASE, ATTN_NORM);
+ else if(w_random < 0.1)
+ sound(self, CHAN_PROJECTILE, "weapons/ric2.wav", VOL_BASE, ATTN_NORM);
+ else if(w_random < 0.2)
+ sound(self, CHAN_PROJECTILE, "weapons/ric3.wav", VOL_BASE, ATTN_NORM);
+ }
+ }
+ else if(req == WR_PRECACHE)
+ {
+ precache_sound("weapons/ric1.wav");
+ precache_sound("weapons/ric2.wav");
+ precache_sound("weapons/ric3.wav");
+ }
else if (req == WR_SUICIDEMESSAGE)
w_deathtypestring = "did the impossible";
else if (req == WR_KILLMESSAGE)
w_deathtypestring = "was gunned by"; // unchecked: SECONDARY
}
return TRUE;
-};
+}
+#endif
#endif
#ifdef REGISTER_WEAPON
REGISTER_WEAPON(TUBA, w_tuba, 0, 1, WEP_FLAG_HIDDEN | WEP_TYPE_SPLASH, BOT_PICKUP_RATING_MID, "tuba", "tuba", "@!#%'n Tuba");
#else
+#ifdef SVQC
//#define TUBA_NOTE(n) strcat("weapons/tuba_note", ftos(n), ".wav")
.float tuba_notecount;
.entity tuba_note;
{
precache_model ("models/weapons/g_tuba.md3");
precache_model ("models/weapons/v_tuba.md3");
- precache_model ("models/weapons/h_tuba.dpm");
+ precache_model ("models/weapons/h_tuba.iqm");
//float i;
//for(i = -18; i <= +27; ++i)
return TRUE; // TODO use fuel?
else if (req == WR_CHECKAMMO2)
return TRUE; // TODO use fuel?
+ return TRUE;
+};
+#endif
+#ifdef CSQC
+float w_tuba(float req)
+{
+ if(req == WR_IMPACTEFFECT)
+ {
+ // nothing to do here; particles of tuba are handled differently
+ }
+ else if(req == WR_PRECACHE)
+ {
+ // nothing to do
+ }
else if (req == WR_SUICIDEMESSAGE)
{
w_deathtypestring = "hurt his own ears with the @!#%'n Tuba";
w_deathtypestring = "died of #'s great playing on the @!#%'n Tuba";
}
return TRUE;
-};
+}
+#endif
#endif
#ifdef REGISTER_WEAPON
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
// leilei's fancy muzzleflash stuff
void W_Uzi_Flash_Go() {
if (self.frame > 10){
precache_model ("models/uziflash.md3");
precache_model ("models/weapons/g_uzi.md3");
precache_model ("models/weapons/v_uzi.md3");
- precache_model ("models/weapons/h_uzi.dpm");
+ precache_model ("models/weapons/h_uzi.iqm");
precache_sound ("weapons/uzi_fire.wav");
}
else if (req == WR_SETUP)
return self.ammo_nails >= cvar("g_balance_uzi_first_ammo");
else if (req == WR_CHECKAMMO2)
return self.ammo_nails >= cvar("g_balance_uzi_first_ammo");
+ return TRUE;
+};
+#endif
+#ifdef CSQC
+float w_uzi(float req)
+{
+ if(req == WR_IMPACTEFFECT)
+ {
+ vector org2;
+ org2 = w_org + w_backoff * 2;
+ pointparticles(particleeffectnum("machinegun_impact"), org2, w_backoff * 1000, 1);
+ if(!w_issilent)
+ if(w_random < 0.05)
+ sound(self, CHAN_PROJECTILE, "weapons/ric1.wav", VOL_BASE, ATTN_NORM);
+ else if(w_random < 0.1)
+ sound(self, CHAN_PROJECTILE, "weapons/ric2.wav", VOL_BASE, ATTN_NORM);
+ else if(w_random < 0.2)
+ sound(self, CHAN_PROJECTILE, "weapons/ric3.wav", VOL_BASE, ATTN_NORM);
+ }
+ else if(req == WR_PRECACHE)
+ {
+ precache_sound("weapons/ric1.wav");
+ precache_sound("weapons/ric2.wav");
+ precache_sound("weapons/ric3.wav");
+ }
else if (req == WR_SUICIDEMESSAGE)
w_deathtypestring = "did the impossible";
else if (req == WR_KILLMESSAGE)
w_deathtypestring = "was riddled full of holes by";
}
return TRUE;
-};
+}
+#endif
#endif
tex = getsurfacetexture(self, i_s);
if not(tex)
break; // this is beyond the last one
- if(tex != "textures/common/warpzone")
+ if(tex == "textures/common/trigger")
continue;
n_t = getsurfacenumtriangles(self, i_s);
for(i_t = 0; i_t < n_t; ++i_t)
--- /dev/null
+// shaders to be used on models
+
+nodraw
+{
+ surfaceparm nodraw
+ surfaceparm nolightmap
+ surfaceparm nonsolid
+ surfaceparm trans
+ surfaceparm nomarks
+}
--- /dev/null
+pyriahair
+{
+
+ surfaceparm trans
+ cull none
+
+ {
+ map textures/pyriahair
+ alphaFunc GE128
+ blendFunc blend
+ rgbGen identity
+ }
+}
+++ /dev/null
-pyrianewhair
-{
-
- surfaceparm trans
- cull none
-
- {
- map textures/pyrianewhair
- alphaFunc GE128
- blendFunc blend
- rgbGen identity
- }
-}
--- /dev/null
+morph/leaves3
+{
+cull none
+ qer_editorimage leaves6.tga
+ qer_trans 0.6
+ surfaceparm trans
+// surfaceparm nolightmap
+ surfaceparm alphashadow
+ deformVertexes autosprite
+ q3map_vertexScale 1
+ deformVertexes wave 128 sin 0 1 0 0.4
+ {
+ map leaves6.tga
+ alphaFunc GT0
+ rgbGen vertex
+ }
+}
+
+grass02
+{
+ distancecull 256 1024 0.4
+ cull none
+ qer_editorimage grass2.tga
+ qer_trans 0.2
+ surfaceparm nolightmap
+ surfaceparm trans
+ q3map_vertexScale 1
+ deformVertexes autosprite
+ deformVertexes wave 128 sin 0 1 0 0.1
+ {
+ map grass2.tga
+ alphaFunc GT0
+ rgbGen vertex
+ }
+}
+
+leaves4
+{
+cull none
+ qer_editorimage leaves7.tga
+ qer_trans 0.6
+ deformVertexes autosprite
+ surfaceparm nolightmap
+ surfaceparm trans
+ q3map_vertexScale 1
+ deformVertexes wave 128 sin 0 1 0 0.5
+ {
+ map leaves7.tga
+ alphaFunc GT0
+ rgbGen vertex
+ }
+}
+
+e8teamcolor
+ {
+ qer_editorimage morphed/e8support02c_shirt.jpg
+ map morphed/e8support02c.tga
+ {
+ map $lightmap
+ rgbGen identity
+ }
+ }
--- /dev/null
+models/turrets/tesla_chrome\r
+{\r
+\r
+ qer_editorimage models/turrets/chrome.tga\r
+\r
+ //dp_reflect 0 0.75 0.75 1 0.5 \r
+ {\r
+ map models/turrets/chrome.tga \r
+ rgbGen vertex\r
+ tcGen environment \r
+ tcMod scale 2 2\r
+ \r
+ }\r
+}\r
+\r
+models/turrets/phaser_beam\r
+{\r
+ surfaceparm trans\r
+ cull none\r
+ nopicmip\r
+\r
+ qer_editorimage models/turrets/phaser_beam\r
+ { \r
+ map models/turrets/phaser_beam\r
+ blendFunc add\r
+ }\r
+\r
+}\r
+\r
+models/turrets/reactor_beams\r
+{\r
+ surfaceparm trans\r
+ cull none\r
+\r
+ qer_editorimage models/turrets/reactor\r
+ { \r
+ map models/turrets/reactor\r
+ blendFunc add\r
+ }\r
+}\r
+\r
+models/turrets/r_fx1\r
+{\r
+ surfaceparm nomarks\r
+ surfaceparm trans\r
+ surfaceparm pointlight\r
+ surfaceparm nolightmap \r
+ nopicmip\r
+ qer_editorimage models/turrets/r_fx1_1\r
+\r
+ {\r
+ animmap 10 models/turrets/r_fx1_3 models/turrets/r_fx1_4 models/turrets/r_fx1_5 models/turrets/r_fx1_4 models/turrets/r_fx1_3 models/turrets/r_fx1_2 models/turrets/r_fx1_1 models/turrets/r_fx1_2 \r
+ }\r
+\r
+}\r
+\r
+\r
-**Team Leaders:
+(THIS FILE IS A HUGE TODO)
+(YES, REALLY, NOTHING HERE IS TRUE)
+(PLEASE FIX THIS FILE)
-Lee Vermeulen
-*Project Founder and Co-Designer
-Forest "LordHavoc" Hale
-*Lead Programmer and Co-Designer
+**Team Leaders:
-Rudolf "div0" Polzer
-*Programmer
**Project maintainers:
**Development Team:
+Rudolf "div0" Polzer
+*Programmer
+
Andreas "Black" Kirsch
*Programmer
Marius "GreEn`mArine" Shekow
*Programmer
+Forest "LordHavoc" Hale
+*DarkPlaces Engine Programmer
+
Braden "meoblast001" Walters
*Music
Jody Gallagher
Juergen "LowDragon" Timm
Lee David Ash
+Lee Vermeulen
Mathieu "Elric" Olivier
Mephisto
MirceaKitsune