seta hud_panel_ammo_bg_alpha "" "if set to something else than \"\" = override default panel background alpha"
seta hud_panel_ammo_bg_border "" "if set to something else than \"\" = override default size of border around the background"
seta hud_panel_ammo_bg_padding "" "if set to something else than \"\" = override default padding of contents from border"
+seta hud_panel_ammo_progressbar "" "use progressbar behind ammo icons"
+seta hud_panel_ammo_progressbar_xoffset "" "percentage of mySize_x to offset progressbar with"
+seta hud_panel_ammo_progressbar_name "" "name of progressbar to use behind ammo icons"
+seta hud_panel_ammo_text "" "show text/icons in the ammo panel"
seta hud_panel_powerups "" "enable/disable this panel"
seta hud_panel_powerups_pos "" "position of this panel"
seta hud_panel_powerups_bg_border "" "if set to something else than \"\" = override default size of border around the background"
seta hud_panel_powerups_bg_padding "" "if set to something else than \"\" = override default padding of contents from border"
seta hud_panel_powerups_progressbar "" "enable progressbar in panel"
+seta hud_panel_powerups_progressbar_strength "" "progressbar image for strength"
+seta hud_panel_powerups_progressbar_shield "" "progressbar image for shield"
+seta hud_panel_powerups_text "" "show text/icons in the powerups panel"
seta hud_panel_healtharmor "" "enable/disable this panel, 2 = combined health/armor display"
seta hud_panel_healtharmor_pos "" "position of this panel"
seta hud_panel_healtharmor_bg_border "" "if set to something else than \"\" = override default size of border around the background"
seta hud_panel_healtharmor_bg_padding "" "if set to something else than \"\" = override default padding of contents from border"
seta hud_panel_healtharmor_progressbar "" "enable progressbar in panel"
+seta hud_panel_healtharmor_progressbar_health "" "progressbar image for health"
+seta hud_panel_healtharmor_progressbar_armor "" "progressbar image for armor"
+seta hud_panel_healtharmor_text "" "show text/icons in the healtharmor panel"
seta hud_panel_notify "" "enable/disable this panel"
seta hud_panel_notify_pos "" "position of this base of the panel"
-////2.4.2 weapons (with some tweaks) VS balanceLeeStricklin
-
-// {{{ 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"
-// }}}
-
// {{{ 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
-// Ammo caps copied from balanceFruit
set g_pickup_ammo_anyway 0
set g_pickup_weapons_anyway 1
set g_pickup_shells 20
set g_balance_uzi_speed 18000
set g_balance_uzi_bulletconstant 300 // 13.1qu
// }}}
-// {{{ mortar
+// {{{ mortar // TODO
set g_balance_grenadelauncher_primary_type 0
set g_balance_grenadelauncher_primary_damage 65
set g_balance_grenadelauncher_primary_edgedamage 35
set g_balance_grenadelauncher_bouncestop 0.12
// }}}
// {{{ minelayer // TODO
-set g_balance_minelayer_damage 35
+set g_balance_minelayer_damage 65
set g_balance_minelayer_edgedamage 30
set g_balance_minelayer_force 250
set g_balance_minelayer_radius 175
set g_balance_minelayer_proximityradius 150
set g_balance_minelayer_speed 750
set g_balance_minelayer_lifetime 60
-set g_balance_minelayer_refire 1.5
+set g_balance_minelayer_refire 1.3
set g_balance_minelayer_animtime 0.4
set g_balance_minelayer_ammo 5
set g_balance_minelayer_health 15
set g_balance_minelayer_remote_radius 200
set g_balance_minelayer_remote_force 300
// }}}
-// {{{ electro
+// {{{ electro // TODO
set g_balance_electro_lightning 0
set g_balance_electro_primary_damage 55
set g_balance_electro_primary_edgedamage 5
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_lifetime 3
set g_balance_electro_secondary_spread 0.05
+set g_balance_electro_secondary_lifetime 3
set g_balance_electro_secondary_refire 0.2
set g_balance_electro_secondary_refire2 1
set g_balance_electro_secondary_animtime 0.3
set g_balance_crylink_secondary_line_fadetime 2
// }}}
// {{{ nex
-set g_balance_nex_primary_ammo 13
-set g_balance_nex_primary_animtime 0.3
set g_balance_nex_primary_damage 78
set g_balance_nex_primary_force 600
set g_balance_nex_primary_refire 1.505
+set g_balance_nex_primary_animtime 0.3
+set g_balance_nex_primary_ammo 13
set g_balance_nex_primary_damagefalloff_mindist 9999999
set g_balance_nex_primary_damagefalloff_maxdist 9999999
set g_balance_nex_primary_damagefalloff_halflife 9999999
set g_balance_hagar_secondary_refire 0.15
set g_balance_hagar_secondary_ammo 2
// }}}
-// {{{ rocketlauncher
+// {{{ rocketlauncher // TODO
set g_balance_rocketlauncher_damage 65
set g_balance_rocketlauncher_edgedamage 25
set g_balance_rocketlauncher_force 360
set g_balance_seeker_missile_ammo 2
set g_balance_seeker_missile_animtime 0.3
set g_balance_seeker_missile_count 8
-set g_balance_seeker_missile_damage 15
+set g_balance_seeker_missile_damage 25
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_pickup_fuel_jetpack 50
set g_pickup_fuel_max 100
set g_pickup_armorsmall 5
-set g_pickup_armorsmall_max 250
+set g_pickup_armorsmall_max 150
set g_pickup_armorsmall_anyway 1
set g_pickup_armormedium 25
-set g_pickup_armormedium_max 250
-set g_pickup_armormedium_anyway 1
+set g_pickup_armormedium_max 50
+set g_pickup_armormedium_anyway 0
set g_pickup_armorbig 50
-set g_pickup_armorbig_max 250
-set g_pickup_armorbig_anyway 1
+set g_pickup_armorbig_max 50
+set g_pickup_armorbig_anyway 0
set g_pickup_armorlarge 100
-set g_pickup_armorlarge_max 250
+set g_pickup_armorlarge_max 150
set g_pickup_armorlarge_anyway 1
set g_pickup_healthsmall 5
set g_pickup_healthsmall_max 250
set g_pickup_healthsmall_anyway 1
set g_pickup_healthmedium 25
-set g_pickup_healthmedium_max 150
+set g_pickup_healthmedium_max 100
set g_pickup_healthmedium_anyway 0
set g_pickup_healthlarge 50
set g_pickup_healthlarge_max 150
set g_balance_laser_secondary_force_velocitybias 0
// }}}
// {{{ shotgun
-set g_balance_shotgun_primary_bullets 20
-set g_balance_shotgun_primary_damage 3
+set g_balance_shotgun_primary_bullets 18
+set g_balance_shotgun_primary_damage 4
set g_balance_shotgun_primary_force 20
-set g_balance_shotgun_primary_spread 0.16
+set g_balance_shotgun_primary_spread 0.18
set g_balance_shotgun_primary_refire 1
set g_balance_shotgun_primary_animtime 0.4
set g_balance_shotgun_primary_ammo 1
set g_balance_uzi_speed 18000
set g_balance_uzi_bulletconstant 115 // 13.1qu
// }}}
-// {{{ mortar // TODO
+// {{{ mortar
set g_balance_grenadelauncher_primary_type 0
set g_balance_grenadelauncher_primary_damage 50
-set g_balance_grenadelauncher_primary_edgedamage 25
+set g_balance_grenadelauncher_primary_edgedamage 32
set g_balance_grenadelauncher_primary_force 300
-set g_balance_grenadelauncher_primary_radius 100
+set g_balance_grenadelauncher_primary_radius 115
set g_balance_grenadelauncher_primary_speed 1500
set g_balance_grenadelauncher_primary_speed_up 225
set g_balance_grenadelauncher_primary_speed_z 0
set g_balance_grenadelauncher_secondary_edgedamage 32
set g_balance_grenadelauncher_secondary_force 300
set g_balance_grenadelauncher_secondary_radius 150
-set g_balance_grenadelauncher_secondary_speed 1500
-set g_balance_grenadelauncher_secondary_speed_up 225
+set g_balance_grenadelauncher_secondary_speed 1000
+set g_balance_grenadelauncher_secondary_speed_up 250
set g_balance_grenadelauncher_secondary_speed_z 0
set g_balance_grenadelauncher_secondary_spread 0
set g_balance_grenadelauncher_secondary_lifetime 3
set g_balance_grenadelauncher_bouncefactor 0.5
set g_balance_grenadelauncher_bouncestop 0.12
// }}}
-// {{{ minelayer // TODO
+// {{{ minelayer
set g_balance_minelayer_damage 35
set g_balance_minelayer_edgedamage 30
set g_balance_minelayer_force 250
set g_balance_minelayer_remote_radius 200
set g_balance_minelayer_remote_force 300
// }}}
-// {{{ electro // TODO
+// {{{ electro
set g_balance_electro_lightning 1
set g_balance_electro_primary_damage 100
set g_balance_electro_primary_edgedamage 0
set g_balance_electro_primary_animtime 0.03333333
set g_balance_electro_primary_ammo 5
set g_balance_electro_primary_range 800
-set g_balance_electro_primary_falloff_mindist 255 // 0.3 * radius
-set g_balance_electro_primary_falloff_maxdist 850
-set g_balance_electro_primary_falloff_halflifedist 595
+set g_balance_electro_primary_falloff_mindist 0
+set g_balance_electro_primary_falloff_maxdist 0
+set g_balance_electro_primary_falloff_halflifedist 0
set g_balance_electro_secondary_damage 25
set g_balance_electro_secondary_edgedamage 0
set g_balance_electro_secondary_force 100
set g_balance_electro_secondary_count 3
set g_balance_electro_secondary_bouncefactor 0.5
set g_balance_electro_secondary_bouncestop 0.075
-set g_balance_electro_combo_damage 40
+set g_balance_electro_combo_damage 50
set g_balance_electro_combo_edgedamage 0
set g_balance_electro_combo_force 80
set g_balance_electro_combo_radius 250
set g_balance_crylink_primary_force 40
set g_balance_crylink_primary_radius 80
set g_balance_crylink_primary_speed 1200
-set g_balance_crylink_primary_spread 0.1
+set g_balance_crylink_primary_spread 0.05
set g_balance_crylink_primary_shots 7
set g_balance_crylink_primary_bounces 2
set g_balance_crylink_primary_refire 0.8
set g_balance_nex_secondary 1
set g_balance_nex_secondary_charge 1
-set g_balance_nex_secondary_charge_rate 0.55
+set g_balance_nex_secondary_charge_rate 0.5
set g_balance_nex_secondary_charge_pool 1
set g_balance_nex_secondary_charge_pool_regen 0.15
set g_balance_nex_secondary_charge_pool_pause_regen 1
set g_balance_nex_charge 1
set g_balance_nex_charge_mindmg 30
set g_balance_nex_charge_start 0.5
-set g_balance_nex_charge_rate 0.6
+set g_balance_nex_charge_rate 0.5
set g_balance_nex_charge_limit 0.5
set g_balance_nex_charge_rot_rate 0.1
set g_balance_nex_charge_rot_pause 1 // Dont rot down until this long after release of charge button
set g_balance_hagar_secondary_refire 0.12
set g_balance_hagar_secondary_ammo 1
// }}}
-// {{{ rocketlauncher // TODO
+// {{{ rocketlauncher
set g_balance_rocketlauncher_damage 90
set g_balance_rocketlauncher_edgedamage 33
set g_balance_rocketlauncher_force 350
set g_balance_rocketlauncher_radius 125
-set g_balance_rocketlauncher_speed 1080
-set g_balance_rocketlauncher_speedaccel 0
-set g_balance_rocketlauncher_speedstart 1080
+set g_balance_rocketlauncher_speed 1600
+set g_balance_rocketlauncher_speedaccel 1600
+set g_balance_rocketlauncher_speedstart 800
set g_balance_rocketlauncher_lifetime 5
set g_balance_rocketlauncher_refire 1
set g_balance_rocketlauncher_animtime 0.4
_cl_name Player
_cl_playermodel models/player/umbra.iqm
_cl_playerskin 0
-seta crosshair 3
+seta crosshair 16
seta crosshair_color "0.6 0.8 1"
-seta crosshair_alpha 1
-seta crosshair_size 0.35
+seta crosshair_alpha 0.3
+seta crosshair_size 0.5
seta crosshair_dot 1
seta crosshair_dot_alpha 1
-seta crosshair_dot_size 1
+seta crosshair_dot_size 0.6
+seta crosshair_dot_color "1 0 0" "when != 0, use custom color for the crosshair dot"
seta crosshair_pickup 0.25
seta crosshair_pickup_speed 4
seta crosshair_per_weapon 0 "when 1, each gun will display a different crosshair"
// ring around crosshair, used for various purposes (such as indicating bullets left in clip, nex charge)
seta crosshair_ring_size 2 "bullet counter ring size for Rifle, velocity ring for Nex"
+seta crosshair_ring_alpha 0.2 "ring alpha"
seta crosshair_ring_campingrifle_alpha 0.15
seta g_ctf_win_mode 0 "0: captures only, 1: captures, then points, 2: points only"
seta g_ctf_ignore_frags 0 "1: regular frags give no points"
+set g_freezetag 0 "Freeze Tag: Freeze the opposing team(s) to win, unfreeze teammates by standing next to them"
+seta g_freezetag_warmup 5 "Time players get to run around before the round starts"
+seta g_freezetag_point_limit -1 "Freeze Tag point limit overriding the mapinfo specified one (use 0 to play without limit, and -1 to use the mapinfo's limit)"
+seta g_freezetag_point_leadlimit -1 "Freeze Tag point lead limit overriding the mapinfo specified one (use 0 to play without limit, and -1 to use the mapinfo's limit)"
+seta g_freezetag_revive_time 2.5 "Time it takes to revive a frozen teammate"
+seta g_freezetag_revive_extra_size 100 "Distance in qu that you can stand from a frozen teammate to keep reviving him"
+seta g_freezetag_frozen_force 0.6 "How much to multiply the force on a frozen player with"
+
// 50% of the spawns shall be far away from any players
set g_spawn_furthest 0.5
// respawn delay
set g_cts_respawn_delay 0.25
set g_cts_selfdamage 1 "0 = disable all selfdamage and falldamage in cts"
set g_cts_finish_kill_delay 10 "prevent cheating by running back to the start line, and starting out with more speed than otherwise possible"
+set g_freezetag_respawn_waves 0
+set g_freezetag_respawn_delay 0.25
+set g_ka_respawn_delay 0
+set g_ka_respawn_waves 0
// overtime
seta timelimit_overtime 2 "duration in minutes of one added overtime, added to the timelimit"
seta g_keyhunt_teams_override 0
set g_keyhunt_teams 0
+// keepaway
+set g_keepaway 0 "game mode which focuses around a ball, look at g_keepaway_win_mode for further details"
+set g_keepaway_bckillscore 1 "enable scoring points (y/n) for ball carrier kills"
+set g_keepaway_pointlimit -1 "total amount of points you can get, -1 for unlimited"
+set g_keepaway_pointleadlimit -1 "mercy rule, -1 for unlimited"
+set g_keepaway_ballcarrier_alpha 0.6 "alpha when the player is the ballcarrier"
+set g_keepaway_ballcarrier_highspeed 1.5 "speed multiplier done to the person holding the ball"
+set g_keepaway_ballcarrier_damage 1.5 "damage multiplier while having powerup"
+set g_keepaway_ballcarrier_force 1.5 "force multiplier while having powerup"
+set g_keepaway_ballcarrier_selfdamage 1 "self damage multiplier while having powerup"
+set g_keepaway_ballcarrier_selfforce 1.5 "self force multiplier while having powerup"
+set g_keepaway_noncarrier_warn 0 "warn players when they kill without holding the ball"
+set g_keepaway_noncarrier_damage 0.5 "damage done to other players if both you and they don't have the ball"
+set g_keepaway_noncarrier_force 0.5 "force done to other players if both you and they don't have the ball"
+set g_keepaway_noncarrier_selfdamage 1 "self damage if you don't have the ball"
+set g_keepaway_noncarrier_selfforce 1 "self force if you don't have the ball"
+set g_keepawayball_trail_color 254 "particle trail color from player/ball"
+set g_keepawayball_damageforcescale 2 "Scale of force which is applied to the ball by weapons/explosions/etc"
+set g_keepawayball_respawntime 15 "if no one picks up the ball, how long to wait until the ball respawns"
+seta g_keepaway_teams_override 0
+set g_keepaway_teams 0
+
// so it can be stuffcmd-ed still
set cl_gravity 800 "but ignored anyway"
seta hud_panel_weapons_timeout "3" "panel disappears if you don't switch weapon for this amount of seconds"
seta hud_panel_weapons_timeout_effect "1" "disappearance effect: 0) no effect; 1) panel moves out of screen; 2) panel fades out"
+seta hud_panel_ammo_maxammo "40" "when you have this much ammo, the ammo status bar is full"
+
+seta hud_panel_healtharmor_maxhealth "250" "when you have this much health, the health status bar is full"
+seta hud_panel_healtharmor_maxarmor "150" "when you have this much armor, the armor status bar is full"
+
seta hud_panel_notify_time 10 "time that a new entry stays until it fades out"
seta hud_panel_notify_fadetime 3 "fade out time"
seta hud_showbinds 1 "the way to show the keys to press in HUD messages: 0 displays commands, 1 bound keys, 2 both"
seta hud_showbinds_limit 2 "maximum number of bound keys to show for a command. 0 for unlimited"
+seta hud_colorflash_alpha 0.5 "starting alpha of the color flash"
+
seta hud_damage 1 "an improved version of gl_polyblend, draw an image instead when hurt"
seta hud_damage_gentle_alpha_multiplier 0.25 "how much to multiply alpha of flash when using the cl_gentle version, it's much more opaque than the non-gentle version"
seta hud_damage_gentle_color "1 0.7 1" "color of flash for cl_gentle version"
seta cl_showacceleration 0 "show the XY acceleration of the player"
seta cl_showacceleration_z 0 "include the speed on the Z-axis"
seta cl_showacceleration_size 40 "height of the bar"
-seta cl_showacceleration_scale 5 "X-axis scale of the bar"
+seta cl_showacceleration_scale 1 "X-axis scale of the bar"
seta cl_showacceleration_alpha 0.5 "alpha of the bar"
seta cl_showacceleration_color_custom 0 "0 = dynamic color depending on acceleration, 1 = use custom color"
seta cl_showacceleration_color "1 0 0" "color of the bar, needs cl_showacceleration_color_custom to be 1"
alias cl_hook_gamestart_rc
alias cl_hook_gamestart_nexball
alias cl_hook_gamestart_cts
+alias cl_hook_gamestart_ka
alias cl_hook_gameend
alias cl_hook_activeweapon
alias sv_hook_gamestart_rc
alias sv_hook_gamestart_nexball
alias sv_hook_gamestart_cts
+alias sv_hook_gamestart_ka
alias sv_hook_gamerestart
alias sv_hook_gameend
set g_forced_team_pink "" "list of player IDs for pink team"
set g_forced_team_otherwise "default" "action if a non listed player joins (can be default for default action, spectate for forcing to spectate, or red, blue, yellow, pink)"
+// player statistics server URI
+set g_playerstats_uri ""
+
// other config files
exec balanceXonotic.cfg
exec ctfscoring-ai.cfg
originjitter 6 6 6
// dust/smoke drifting away from the impact
effect TE_GUNSHOT
-count 2
+count 0.8
type smoke
tex 0 8
color 0x101010 0x101010
velocityjitter 8 8 8
// dust/smoke staying at the impact
effect TE_GUNSHOT
-count 0.5
+count 0.2
type smoke
tex 0 8
color 0x505050 0x505050
velocityjitter 0 0 0
// bouncing sparks
effect TE_GUNSHOT
-count 5
+count 2.5
type spark
color 0x8f4333 0xfff31b
size 0.4 0.4
type alphastatic
notunderwater
tex 0 8
-count 3
+count 1
size 10 20
sizeincrease 25
alpha 300 550 756
type alphastatic
notunderwater
tex 36 36
-count 0.5
+count 0.2
size 10 11
sizeincrease 74
alpha 200 350 500
// sparks
effect shotgun_impact
notunderwater
-count 1.5
+count 0.5
type spark
tex 40 40
color 0xFDFFD9 0xFDFFD9
type alphastatic
notunderwater
tex 0 8
-count 3
+count 1.5
size 10 20
sizeincrease 15
alpha 300 550 456
bounce 6
velocitymultiplier 0.03
rotate 0 360 -50 50
-//derbis
+//debris
effect machinegun_impact
type alphastatic
notunderwater
// fire effect which make bright dot inside
effect hagar_explode
notunderwater
-count 5
+count 3.5
type smoke
tex 48 55
color 0xffe955 0xff5a00
type alphastatic
notunderwater
tex 0 8
-count 10
+count 7
size 20 40
sizeincrease 20
alpha 200 500 600
alpha 256 256 1024
velocityjitter 256 256 256
+//sparks for keepaway ball touch
+// used nowhere in code
+effect kaball_sparks
+count 35
+type spark
+tex 40 40
+color 0xa9cacf 0x0054ff
+size 1 3
+alpha 0 256 556
+gravity 1
+bounce 1.5
+originjitter 1 1 1
+velocityjitter 300 300 300
+velocitymultiplier 0.5
+airfriction 3
seta hud_panel_ammo_bg_padding ""
seta hud_panel_ammo_onlycurrent "0"
seta hud_panel_ammo_iconalign "0"
+seta hud_panel_ammo_progressbar "0"
+seta hud_panel_ammo_progressbar_xoffset "0"
+seta hud_panel_ammo_progressbar_name "progressbar"
+seta hud_panel_ammo_text "1"
seta hud_panel_powerups 1
seta hud_panel_powerups_pos "0.660000 0.940000"
seta hud_panel_powerups_iconalign "4"
seta hud_panel_powerups_baralign "4"
seta hud_panel_powerups_progressbar "1"
+seta hud_panel_powerups_progressbar_strength "progressbar"
+seta hud_panel_powerups_progressbar_shield "progressbar"
+seta hud_panel_powerups_text "1"
seta hud_panel_healtharmor 1
seta hud_panel_healtharmor_pos "0.330000 0.920000"
seta hud_panel_healtharmor_iconalign "4"
seta hud_panel_healtharmor_baralign "4"
seta hud_panel_healtharmor_progressbar "1"
+seta hud_panel_healtharmor_progressbar_health "progressbar"
+seta hud_panel_healtharmor_progressbar_armor "progressbar"
+seta hud_panel_healtharmor_text "1"
seta hud_panel_notify 1
seta hud_panel_notify_pos "0.660000 0.730000"
--- /dev/null
+seta hud_skin "luminos"
+seta hud_panel_bg "0"
+seta hud_panel_bg_color "1 0.4375 0"
+seta hud_panel_bg_color_team "0"
+seta hud_panel_bg_alpha "1"
+seta hud_panel_bg_border "8"
+seta hud_panel_bg_padding "2"
+seta hud_panel_fg_alpha "1"
+
+seta hud_dock "0"
+seta hud_dock_color "0 0.449576 0.860796"
+seta hud_dock_color_team "0.700000"
+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_panelorder "10 3 0 14 6 9 13 4 1 2 11 12 7 5 8 "
+
+seta hud_configure_grid "1"
+seta hud_configure_grid_xsize "0.010000"
+seta hud_configure_grid_ysize "0.010000"
+
+seta scr_centerpos "0.25"
+
+seta hud_panel_weapons 1
+seta hud_panel_weapons_pos "0.350000 0.940000"
+seta hud_panel_weapons_size "0.300000 0.060000"
+seta hud_panel_weapons_bg ""
+seta hud_panel_weapons_bg_color ""
+seta hud_panel_weapons_bg_color_team ""
+seta hud_panel_weapons_bg_alpha ""
+seta hud_panel_weapons_bg_border ""
+seta hud_panel_weapons_bg_padding ""
+seta hud_panel_weapons_complainbubble "1"
+seta hud_panel_weapons_complainbubble_padding "-10"
+seta hud_panel_weapons_complainbubble_color_outofammo "0.8 0 0"
+seta hud_panel_weapons_complainbubble_color_donthave "0.8 0.5 0"
+seta hud_panel_weapons_complainbubble_color_unavailable "0 0.3 0.8"
+seta hud_panel_weapons_ammo_color "0 1 0"
+seta hud_panel_weapons_ammo_alpha "1"
+seta hud_panel_weapons_aspect "2"
+
+seta hud_panel_ammo 1
+seta hud_panel_ammo_pos "0.650000 0.890000"
+seta hud_panel_ammo_size "0.055000 0.110000"
+seta hud_panel_ammo_bg ""
+seta hud_panel_ammo_bg_color ""
+seta hud_panel_ammo_bg_color_team ""
+seta hud_panel_ammo_bg_alpha ""
+seta hud_panel_ammo_bg_border ""
+seta hud_panel_ammo_bg_padding ""
+seta hud_panel_ammo_onlycurrent "0"
+seta hud_panel_ammo_iconalign "0"
+seta hud_panel_ammo_progressbar "0"
+seta hud_panel_ammo_progressbar_xoffset "0"
+seta hud_panel_ammo_progressbar_name "progressbar"
+seta hud_panel_ammo_text "1"
+
+seta hud_panel_powerups 1
+seta hud_panel_powerups_pos "0.290000 0.890000"
+seta hud_panel_powerups_size "0.055000 0.110000"
+seta hud_panel_powerups_bg "0"
+seta hud_panel_powerups_bg_color ""
+seta hud_panel_powerups_bg_color_team ""
+seta hud_panel_powerups_bg_alpha ""
+seta hud_panel_powerups_bg_border ""
+seta hud_panel_powerups_bg_padding "-3"
+seta hud_panel_powerups_flip "1"
+seta hud_panel_powerups_iconalign "1"
+seta hud_panel_powerups_baralign "1"
+seta hud_panel_powerups_progressbar "1"
+seta hud_panel_powerups_progressbar_strength "progressbar"
+seta hud_panel_powerups_progressbar_shield "progressbar"
+seta hud_panel_powerups_text "1"
+
+seta hud_panel_healtharmor 1
+seta hud_panel_healtharmor_pos "0.350000 0.890000"
+seta hud_panel_healtharmor_size "0.300000 0.050000"
+seta hud_panel_healtharmor_bg ""
+seta hud_panel_healtharmor_bg_color ""
+seta hud_panel_healtharmor_bg_color_team ""
+seta hud_panel_healtharmor_bg_alpha ""
+seta hud_panel_healtharmor_bg_border ""
+seta hud_panel_healtharmor_bg_padding "0"
+seta hud_panel_healtharmor_flip "0"
+seta hud_panel_healtharmor_iconalign "3"
+seta hud_panel_healtharmor_baralign "3"
+seta hud_panel_healtharmor_progressbar "1"
+seta hud_panel_healtharmor_progressbar_health "progressbar"
+seta hud_panel_healtharmor_progressbar_armor "progressbar"
+seta hud_panel_healtharmor_text "1"
+
+seta hud_panel_notify 1
+seta hud_panel_notify_pos "0 0"
+seta hud_panel_notify_size "0.210000 0.260000"
+seta hud_panel_notify_bg "0"
+seta hud_panel_notify_bg_color ""
+seta hud_panel_notify_bg_color_team ""
+seta hud_panel_notify_bg_alpha ""
+seta hud_panel_notify_bg_border ""
+seta hud_panel_notify_bg_padding ""
+seta hud_panel_notify_flip "1"
+seta hud_panel_notify_print "0"
+
+seta hud_panel_timer 1
+seta hud_panel_timer_pos "0.435000 0"
+seta hud_panel_timer_size "0.135000 0.060000"
+seta hud_panel_timer_bg "0"
+seta hud_panel_timer_bg_color ""
+seta hud_panel_timer_bg_color_team ""
+seta hud_panel_timer_bg_alpha ""
+seta hud_panel_timer_bg_border ""
+seta hud_panel_timer_bg_padding "0"
+
+seta hud_panel_radar 2
+seta hud_panel_radar_pos "0.810000 0"
+seta hud_panel_radar_size "0.190000 0.250000"
+seta hud_panel_radar_bg "border_radar"
+seta hud_panel_radar_bg_color ""
+seta hud_panel_radar_bg_color_team ""
+seta hud_panel_radar_bg_alpha "0.500000"
+seta hud_panel_radar_bg_border "0"
+seta hud_panel_radar_bg_padding "0"
+seta hud_panel_radar_foreground_alpha "0.500000"
+
+seta hud_panel_score 1
+seta hud_panel_score_pos "0.465000 0.045000"
+seta hud_panel_score_size "0.090000 0.060000"
+seta hud_panel_score_bg ""
+seta hud_panel_score_bg_color ""
+seta hud_panel_score_bg_color_team ""
+seta hud_panel_score_bg_alpha ""
+seta hud_panel_score_bg_border ""
+seta hud_panel_score_bg_padding ""
+
+seta hud_panel_racetimer 1
+seta hud_panel_racetimer_pos "0.360000 0.090000"
+seta hud_panel_racetimer_size "0.280000 0.090000"
+seta hud_panel_racetimer_bg "0"
+seta hud_panel_racetimer_bg_color ""
+seta hud_panel_racetimer_bg_color_team ""
+seta hud_panel_racetimer_bg_alpha ""
+seta hud_panel_racetimer_bg_border ""
+seta hud_panel_racetimer_bg_padding ""
+
+seta hud_panel_vote 1
+seta hud_panel_vote_pos "0 0.890000"
+seta hud_panel_vote_size "0.170000 0.110000"
+seta hud_panel_vote_bg ""
+seta hud_panel_vote_bg_color ""
+seta hud_panel_vote_bg_color_team ""
+seta hud_panel_vote_bg_alpha ""
+seta hud_panel_vote_bg_border ""
+seta hud_panel_vote_bg_padding ""
+seta hud_panel_vote_alreadyvoted_alpha "0.800000"
+
+seta hud_panel_modicons 1
+seta hud_panel_modicons_pos "0.560000 0"
+seta hud_panel_modicons_size "0.050000 0.100000"
+seta hud_panel_modicons_bg ""
+seta hud_panel_modicons_bg_color ""
+seta hud_panel_modicons_bg_color_team ""
+seta hud_panel_modicons_bg_alpha ""
+seta hud_panel_modicons_bg_border ""
+seta hud_panel_modicons_bg_padding ""
+
+seta hud_panel_pressedkeys 1
+seta hud_panel_pressedkeys_pos "0.450000 0.650000"
+seta hud_panel_pressedkeys_size "0.100000 0.110000"
+seta hud_panel_pressedkeys_bg "0"
+seta hud_panel_pressedkeys_bg_color ""
+seta hud_panel_pressedkeys_bg_color_team ""
+seta hud_panel_pressedkeys_bg_alpha ""
+seta hud_panel_pressedkeys_bg_border ""
+seta hud_panel_pressedkeys_bg_padding ""
+seta hud_panel_pressedkeys_aspect "1.600000"
+
+seta hud_panel_chat 1
+seta hud_panel_chat_pos "0 0.775000"
+seta hud_panel_chat_size "0.460000 0.110000"
+seta hud_panel_chat_bg "0"
+seta hud_panel_chat_bg_color ""
+seta hud_panel_chat_bg_color_team ""
+seta hud_panel_chat_bg_alpha ""
+seta hud_panel_chat_bg_border ""
+seta hud_panel_chat_bg_padding ""
+
+seta hud_panel_engineinfo 0
+seta hud_panel_engineinfo_pos "0.910000 0.970000"
+seta hud_panel_engineinfo_size "0.090000 0.030000"
+seta hud_panel_engineinfo_bg "0"
+seta hud_panel_engineinfo_bg_color ""
+seta hud_panel_engineinfo_bg_color_team ""
+seta hud_panel_engineinfo_bg_alpha ""
+seta hud_panel_engineinfo_bg_border ""
+seta hud_panel_engineinfo_bg_padding ""
+
+seta hud_panel_infomessages 1
+seta hud_panel_infomessages_pos "0.710000 0"
+seta hud_panel_infomessages_size "0.290000 0.100000"
+seta hud_panel_infomessages_bg "0"
+seta hud_panel_infomessages_bg_color ""
+seta hud_panel_infomessages_bg_color_team ""
+seta hud_panel_infomessages_bg_alpha ""
+seta hud_panel_infomessages_bg_border ""
+seta hud_panel_infomessages_bg_padding "0"
+seta hud_panel_infomessages_flip "1"
+
+menu_sync
--- /dev/null
+seta hud_skin "luminos_xhair"
+seta hud_panel_bg "0"
+seta hud_panel_bg_color "1 0.4375 0"
+seta hud_panel_bg_color_team "0"
+seta hud_panel_bg_alpha "1"
+seta hud_panel_bg_border "8"
+seta hud_panel_bg_padding "2"
+seta hud_panel_fg_alpha "1"
+
+seta hud_dock "0"
+seta hud_dock_color "0 0.449576 0.860796"
+seta hud_dock_color_team "0.700000"
+seta hud_dock_alpha "1"
+
+seta hud_progressbar_alpha "0.3"
+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_panelorder "3 1 2 11 10 0 14 6 9 13 4 12 7 5 8 "
+
+seta hud_configure_grid "1"
+seta hud_configure_grid_xsize "0.010000"
+seta hud_configure_grid_ysize "0.010000"
+
+seta scr_centerpos "0.25"
+
+seta hud_panel_weapons 1
+seta hud_panel_weapons_pos "0.350000 0.940000"
+seta hud_panel_weapons_size "0.300000 0.060000"
+seta hud_panel_weapons_bg ""
+seta hud_panel_weapons_bg_color ""
+seta hud_panel_weapons_bg_color_team ""
+seta hud_panel_weapons_bg_alpha ""
+seta hud_panel_weapons_bg_border ""
+seta hud_panel_weapons_bg_padding ""
+seta hud_panel_weapons_complainbubble "1"
+seta hud_panel_weapons_complainbubble_padding "-10"
+seta hud_panel_weapons_complainbubble_color_outofammo "0.8 0 0"
+seta hud_panel_weapons_complainbubble_color_donthave "0.8 0.5 0"
+seta hud_panel_weapons_complainbubble_color_unavailable "0 0.3 0.8"
+seta hud_panel_weapons_ammo_color "0 1 0"
+seta hud_panel_weapons_ammo_alpha "1"
+seta hud_panel_weapons_aspect "2"
+
+seta hud_panel_ammo 1
+seta hud_panel_ammo_pos "0.450000 0.630000"
+seta hud_panel_ammo_size "0.080000 0.040000"
+seta hud_panel_ammo_bg ""
+seta hud_panel_ammo_bg_color ""
+seta hud_panel_ammo_bg_color_team ""
+seta hud_panel_ammo_bg_alpha ""
+seta hud_panel_ammo_bg_border ""
+seta hud_panel_ammo_bg_padding ""
+seta hud_panel_ammo_onlycurrent "1"
+seta hud_panel_ammo_iconalign "0"
+seta hud_panel_ammo_progressbar "1"
+seta hud_panel_ammo_progressbar_name "progressbar_ammo"
+seta hud_panel_ammo_text "1"
+
+seta hud_panel_powerups 1
+seta hud_panel_powerups_pos "0.270000 0.940000"
+seta hud_panel_powerups_size "0.080000 0.060000"
+seta hud_panel_powerups_bg "0"
+seta hud_panel_powerups_bg_color ""
+seta hud_panel_powerups_bg_color_team ""
+seta hud_panel_powerups_bg_alpha ""
+seta hud_panel_powerups_bg_border ""
+seta hud_panel_powerups_bg_padding "-3"
+seta hud_panel_powerups_flip "1"
+seta hud_panel_powerups_iconalign "1"
+seta hud_panel_powerups_baralign "1"
+seta hud_panel_powerups_progressbar "1"
+seta hud_panel_powerups_progressbar_strength "progressbar"
+seta hud_panel_powerups_progressbar_shield "progressbar"
+
+seta hud_panel_healtharmor 1
+seta hud_panel_healtharmor_pos "0.350000 0.380000"
+seta hud_panel_healtharmor_size "0.070000 0.240000"
+seta hud_panel_healtharmor_bg "border_healtharmor"
+seta hud_panel_healtharmor_bg_color "0.464391 0.464391 0.464391"
+seta hud_panel_healtharmor_bg_color_team ""
+seta hud_panel_healtharmor_bg_alpha "0.600000"
+seta hud_panel_healtharmor_bg_border "-1"
+seta hud_panel_healtharmor_bg_padding "0"
+seta hud_panel_healtharmor_flip "0"
+seta hud_panel_healtharmor_iconalign "1"
+seta hud_panel_healtharmor_baralign "1"
+seta hud_panel_healtharmor_progressbar "1"
+seta hud_panel_healtharmor_progressbar_health "progressbar_health"
+seta hud_panel_healtharmor_progressbar_armor "progressbar_armor"
+seta hud_panel_healtharmor_text "0"
+
+seta hud_panel_notify 1
+seta hud_panel_notify_pos "0 0"
+seta hud_panel_notify_size "0.210000 0.260000"
+seta hud_panel_notify_bg "0"
+seta hud_panel_notify_bg_color ""
+seta hud_panel_notify_bg_color_team ""
+seta hud_panel_notify_bg_alpha ""
+seta hud_panel_notify_bg_border ""
+seta hud_panel_notify_bg_padding ""
+seta hud_panel_notify_flip "1"
+seta hud_panel_notify_print "0"
+
+seta hud_panel_timer 1
+seta hud_panel_timer_pos "0.435000 0"
+seta hud_panel_timer_size "0.135000 0.060000"
+seta hud_panel_timer_bg "0"
+seta hud_panel_timer_bg_color ""
+seta hud_panel_timer_bg_color_team ""
+seta hud_panel_timer_bg_alpha ""
+seta hud_panel_timer_bg_border ""
+seta hud_panel_timer_bg_padding "0"
+
+seta hud_panel_radar 2
+seta hud_panel_radar_pos "0.810000 0"
+seta hud_panel_radar_size "0.190000 0.250000"
+seta hud_panel_radar_bg "border_radar"
+seta hud_panel_radar_bg_color ""
+seta hud_panel_radar_bg_color_team ""
+seta hud_panel_radar_bg_alpha "0.500000"
+seta hud_panel_radar_bg_border "0"
+seta hud_panel_radar_bg_padding "0"
+seta hud_panel_radar_foreground_alpha "0.500000"
+
+seta hud_panel_score 1
+seta hud_panel_score_pos "0.465000 0.045000"
+seta hud_panel_score_size "0.090000 0.060000"
+seta hud_panel_score_bg ""
+seta hud_panel_score_bg_color ""
+seta hud_panel_score_bg_color_team ""
+seta hud_panel_score_bg_alpha ""
+seta hud_panel_score_bg_border ""
+seta hud_panel_score_bg_padding ""
+
+seta hud_panel_racetimer 1
+seta hud_panel_racetimer_pos "0.360000 0.090000"
+seta hud_panel_racetimer_size "0.280000 0.090000"
+seta hud_panel_racetimer_bg "0"
+seta hud_panel_racetimer_bg_color ""
+seta hud_panel_racetimer_bg_color_team ""
+seta hud_panel_racetimer_bg_alpha ""
+seta hud_panel_racetimer_bg_border ""
+seta hud_panel_racetimer_bg_padding ""
+
+seta hud_panel_vote 1
+seta hud_panel_vote_pos "0 0.890000"
+seta hud_panel_vote_size "0.170000 0.110000"
+seta hud_panel_vote_bg ""
+seta hud_panel_vote_bg_color ""
+seta hud_panel_vote_bg_color_team ""
+seta hud_panel_vote_bg_alpha ""
+seta hud_panel_vote_bg_border ""
+seta hud_panel_vote_bg_padding ""
+seta hud_panel_vote_alreadyvoted_alpha "0.800000"
+
+seta hud_panel_modicons 1
+seta hud_panel_modicons_pos "0.560000 0"
+seta hud_panel_modicons_size "0.050000 0.100000"
+seta hud_panel_modicons_bg ""
+seta hud_panel_modicons_bg_color ""
+seta hud_panel_modicons_bg_color_team ""
+seta hud_panel_modicons_bg_alpha ""
+seta hud_panel_modicons_bg_border ""
+seta hud_panel_modicons_bg_padding ""
+
+seta hud_panel_pressedkeys 1
+seta hud_panel_pressedkeys_pos "0.450000 0.690000"
+seta hud_panel_pressedkeys_size "0.100000 0.110000"
+seta hud_panel_pressedkeys_bg "0"
+seta hud_panel_pressedkeys_bg_color ""
+seta hud_panel_pressedkeys_bg_color_team ""
+seta hud_panel_pressedkeys_bg_alpha ""
+seta hud_panel_pressedkeys_bg_border ""
+seta hud_panel_pressedkeys_bg_padding ""
+seta hud_panel_pressedkeys_aspect "1.600000"
+
+seta hud_panel_chat 1
+seta hud_panel_chat_pos "0 0.775000"
+seta hud_panel_chat_size "0.460000 0.110000"
+seta hud_panel_chat_bg "0"
+seta hud_panel_chat_bg_color ""
+seta hud_panel_chat_bg_color_team ""
+seta hud_panel_chat_bg_alpha ""
+seta hud_panel_chat_bg_border ""
+seta hud_panel_chat_bg_padding ""
+
+seta hud_panel_engineinfo 0
+seta hud_panel_engineinfo_pos "0.910000 0.970000"
+seta hud_panel_engineinfo_size "0.090000 0.030000"
+seta hud_panel_engineinfo_bg "0"
+seta hud_panel_engineinfo_bg_color ""
+seta hud_panel_engineinfo_bg_color_team ""
+seta hud_panel_engineinfo_bg_alpha ""
+seta hud_panel_engineinfo_bg_border ""
+seta hud_panel_engineinfo_bg_padding ""
+
+seta hud_panel_infomessages 1
+seta hud_panel_infomessages_pos "0.710000 0"
+seta hud_panel_infomessages_size "0.290000 0.100000"
+seta hud_panel_infomessages_bg "0"
+seta hud_panel_infomessages_bg_color ""
+seta hud_panel_infomessages_bg_color_team ""
+seta hud_panel_infomessages_bg_alpha ""
+seta hud_panel_infomessages_bg_border ""
+seta hud_panel_infomessages_bg_padding "0"
+seta hud_panel_infomessages_flip "1"
+
+menu_sync
seta hud_panel_ammo_bg_padding ""
seta hud_panel_ammo_onlycurrent "0"
seta hud_panel_ammo_iconalign "0"
+seta hud_panel_ammo_progressbar "0"
+seta hud_panel_ammo_progressbar_xoffset "0"
+seta hud_panel_ammo_progressbar_name "progressbar"
+seta hud_panel_ammo_text "1"
seta hud_panel_powerups 1
seta hud_panel_powerups_pos "0.660000 0.910000"
seta hud_panel_powerups_iconalign "0"
seta hud_panel_powerups_baralign "0"
seta hud_panel_powerups_progressbar "0"
+seta hud_panel_powerups_progressbar_strength "progressbar"
+seta hud_panel_powerups_progressbar_shield "progressbar"
+seta hud_panel_powerups_text "1"
seta hud_panel_healtharmor 1
seta hud_panel_healtharmor_pos "0.370000 0.930000"
seta hud_panel_healtharmor_iconalign "0"
seta hud_panel_healtharmor_baralign "0"
seta hud_panel_healtharmor_progressbar "0"
+seta hud_panel_healtharmor_progressbar_health "progressbar"
+seta hud_panel_healtharmor_progressbar_armor "progressbar"
+seta hud_panel_healtharmor_text "1"
seta hud_panel_notify 0
seta hud_panel_notify_pos "0 0.650000"
+++ /dev/null
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-
-my ($in, $out) = @ARGV;
-
-my %changes = ();
-while(<STDIN>)
-{
- chomp;
- /^(?:seta?\s)?\s*(\S+)\s+(.*)/
- or next;
- $changes{$1} = $2;
-}
-
-my %changes_unapplied = %changes;
-my $result = "";
-open my $fh, "<", $in
- or die "<$in: $!";
-while(<$fh>)
-{
- chomp;
- /^(seta?\s?\s*)(\S+)(\s+)(.*)/
- or do { $result .= "$_\n"; next; };
- my $v = exists($changes{$2}) ? $changes{$2} : $4;
- $result .= "$1$2$3$v\n";
- delete $changes_unapplied{$2};
-}
-close $fh;
-open $fh, ">", $out
- or die ">$out: $!";
-print $fh $result;
-print $fh "set $_ $changes_unapplied{$_}\n" for keys %changes_unapplied;
-close $fh;
--- /dev/null
+0 50 5 1
\ No newline at end of file
-flag,flags/flag_red
-flag_cloth,flags/flag_red_cloth
-flag_laser,flags/flag_red_laser
+mesh,models/ctf/flag_red.tga
+mesh2,models/ctf/banner_red.tga
+mesh3,models/ctf/glow_red.tga
\ No newline at end of file
-flag,flags/flag_blue
-flag_cloth,flags/flag_blue_cloth
-flag_laser,flags/flag_blue_laser
+mesh,models/ctf/flag_blue.tga
+mesh2,models/ctf/banner_blue.tga
+mesh3,models/ctf/glow_blue.tga
\ No newline at end of file
sprite race-finish "Finish" ff8000 000000 0.0
sprite race-start "Start" ff8000 000000 0.0
sprite nb-ball "Ball" e8d8a0 000000 0.0
+sprite ka-ball "Ball" 00ffff 000000 0.0
+sprite ka-ballcarrier "Ball carrier" ff0000 000000 0.0
sprite wpn-laser "Laser" ff8080 000000 0.0 # bright red
sprite wpn-shotgun "Shotgun" 804000 000000 0.0 # brown
--- /dev/null
+// "NoQWBunny" physics based on XPM
+sv_gravity 800
+sv_maxspeed 424
+sv_maxairspeed 400
+
+sv_stopspeed 100
+sv_accelerate 13
+sv_airaccelerate 2
+sv_friction 8
+edgefriction 1
+sv_stepheight 26
+// Q1: 16+2
+// Nex: 32+2
+// we try: 24+2
+
+// actually, what we want is 266.6666 for 180bpm
+// but 260 takes same amount of frames and is nicer to mappers
+sv_jumpvelocity 260
+sv_wateraccelerate -1
+sv_waterfriction -1
+sv_airaccel_sideways_friction 0 // breaks strafing?
+sv_airaccel_qw -0.8
+
+sv_airstopaccelerate -0.95
+sv_airstrafeaccelerate 24
+sv_maxairstrafespeed 100
+sv_airstrafeaccel_qw -0.97
+sv_aircontrol 125
+sv_aircontrol_penalty 150
+sv_aircontrol_power 2.5
+sv_airspeedlimit_nonqw 800
+sv_warsowbunny_turnaccel 0
+sv_warsowbunny_accel 0.1593
+sv_warsowbunny_topspeed 925
+sv_warsowbunny_backtosideratio 0.8
+sv_friction_on_land 0
+sv_doublejump 0 // TINY (1.35x normal) doublejumps only, can be disabled if wanted...
+sv_jumpspeedcap_min 0 // need predicting? (it should already be in CSQC prediction code)
+sv_jumpspeedcap_max ""
+sv_jumpspeedcap_max_disable_on_ramps 1
CSQC_RAPTOR_HUD();
else
{
+ if(gametype == GAME_FREEZETAG)
+ {
+ if(getstati(STAT_FROZEN))
+ drawfill('0 0 0', eX * vid_conwidth + eY * vid_conheight, '0.25 0.90 1', cvar_or("hud_colorflash_alpha", 0.5), DRAWFLAG_ADDITIVE);
+ if(getstatf(STAT_REVIVE_PROGRESS))
+ {
+ DrawCircleClippedPic(eX * 0.5 * vid_conwidth + eY * 0.6 * vid_conheight, 0.1 * vid_conheight, "gfx/crosshair_ring.tga", getstatf(STAT_REVIVE_PROGRESS), '0.25 0.90 1', cvar("hud_colorflash_alpha"), DRAWFLAG_ADDITIVE);
+ drawstring_aspect(eY * 0.64 * vid_conheight, "Revival progress", eX * vid_conwidth + eY * 0.025 * vid_conheight, '1 1 1', 1, DRAWFLAG_NORMAL);
+ }
+ }
+
if(cvar("r_letterbox") == 0)
if(cvar("viewsize") < 120)
CSQC_common_hud();
CROSSHAIR_DRAW(wcross_resolution, wcross_name, wcross_alpha * f);
if(cvar("crosshair_dot"))
- CROSSHAIR_DRAW(wcross_resolution * cvar("crosshair_dot_size"), "gfx/crosshairdot.tga", wcross_alpha * f * cvar("crosshair_dot_alpha"));
+ {
+ vector wcross_color_old;
+ wcross_color_old = wcross_color;
+ if(cvar_string("crosshair_dot_color") != "0")
+ wcross_color = stov(cvar_string("crosshair_dot_color"));
+ CROSSHAIR_DRAW(wcross_resolution * cvar("crosshair_dot_size"), "gfx/crosshairdot.tga", f * cvar("crosshair_dot_alpha"));
+ wcross_color = wcross_color_old;
+ }
wcross_name_alpha_goal_prev = f;
}
// 1/4 height: bottom part
void draw_BorderPicture(vector theOrigin, string pic, vector theSize, vector theColor, float theAlpha, vector theBorderSize)
{
- if (theBorderSize_x <= 0 && theBorderSize_y <= 0) // no border
+ if (theBorderSize_x < 0 && theBorderSize_y < 0) // draw whole image as it is
+ {
+ drawpic(theOrigin, pic, theSize, theColor, theAlpha, 0);
+ return;
+ }
+ if (theBorderSize_x == 0 && theBorderSize_y == 0) // no border
{
// draw only the central part
drawsubpic(theOrigin, theSize, pic, '0.25 0.25 0', '0.5 0.5 0', theColor, theAlpha, 0);
case HUD_PANEL_AMMO:
HUD_Write_PanelCvar_q("_onlycurrent");
HUD_Write_PanelCvar_q("_iconalign");
+ HUD_Write_PanelCvar_q("_progressbar");
+ HUD_Write_PanelCvar_q("_progressbar_name");
+ HUD_Write_PanelCvar_q("_text");
break;
case HUD_PANEL_POWERUPS:
HUD_Write_PanelCvar_q("_flip");
HUD_Write_PanelCvar_q("_iconalign");
HUD_Write_PanelCvar_q("_baralign");
HUD_Write_PanelCvar_q("_progressbar");
+ HUD_Write_PanelCvar_q("_progressbar_strength");
+ HUD_Write_PanelCvar_q("_progressbar_shield");
break;
case HUD_PANEL_HEALTHARMOR:
HUD_Write_PanelCvar_q("_flip");
HUD_Write_PanelCvar_q("_iconalign");
HUD_Write_PanelCvar_q("_baralign");
HUD_Write_PanelCvar_q("_progressbar");
+ HUD_Write_PanelCvar_q("_progressbar_health");
+ HUD_Write_PanelCvar_q("_progressbar_armor");
+ HUD_Write_PanelCvar_q("_text");
break;
case HUD_PANEL_NOTIFY:
HUD_Write_PanelCvar_q("_flip");
HUD_Panel_HlBorder(panel_bg_border + 1.5 * hlBorderSize, '0 0.5 1', 0.25 * (1 - autocvar__menu_alpha) * alpha);\
} ENDS_WITH_CURLY_BRACE
-void HUD_Panel_DrawProgressBar(vector pos, float vertical, vector mySize, vector color, float alpha, float drawflag)
+void HUD_Panel_DrawProgressBar(vector pos, vector mySize, string pic, float vertical, float barflip, float x, vector color, float alpha, float drawflag)
{
- if(!alpha)
+ if(!alpha || x == 0)
return;
- string pic;
+ x = bound(0, x, 1);
+
if(vertical) {
- pic = strcat(hud_skin_path, "/statusbar_vertical");
+ pic = strcat(hud_skin_path, "/", pic, "_vertical");
if(precache_pic(pic) == "") {
pic = "gfx/hud/default/statusbar_vertical";
}
- drawsubpic(pos, eY * min(mySize_y * 0.5, mySize_x) + eX * mySize_x, pic, '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, pic, '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, pic, '0 0.75 0', '1 0.25 0', color, alpha, drawflag);
+
+ if(barflip)
+ drawsetcliparea(pos_x, pos_y + mySize_y * (1 - x), mySize_x, mySize_y * x);
+ else
+ drawsetcliparea(pos_x, pos_y, mySize_x, mySize_y * x);
} else {
- pic = strcat(hud_skin_path, "/statusbar");
+ pic = strcat(hud_skin_path, "/", pic);
if(precache_pic(pic) == "") {
pic = "gfx/hud/default/statusbar";
}
- drawsubpic(pos, eX * min(mySize_x * 0.5, mySize_y) + eY * mySize_y, pic, '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, pic, '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, pic, '0.75 0 0', '0.25 1 0', color, alpha, drawflag);
+
+ if(barflip)
+ drawsetcliparea(pos_x + mySize_x * (1 - x), pos_y, mySize_x * x, mySize_y);
+ else
+ drawsetcliparea(pos_x, pos_y, mySize_x * x, mySize_y);
}
+
+ drawpic(pos, pic, mySize, color, alpha, drawflag);
+ drawresetcliparea();
}
void HUD_Panel_DrawHighlight(vector pos, vector mySize, vector color, float alpha, float drawflag)
if (currently_selected)
drawpic_aspect_skin(myPos, "ammo_current_bg", mySize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
- if(a > 0)
- drawstring_aspect(numpos, ftos(a), eX * (2/3) * mySize_x + eY * mySize_y, color, panel_fg_alpha * alpha, DRAWFLAG_NORMAL);
- else // "ghost" ammo count
- drawstring_aspect(numpos, ftos(a), eX * (2/3) * mySize_x + eY * mySize_y, '0 0 0', panel_fg_alpha * alpha * 0.5, DRAWFLAG_NORMAL);
+ if(a > 0 && cvar("hud_panel_ammo_progressbar"))
+ HUD_Panel_DrawProgressBar(myPos + eX * cvar("hud_panel_ammo_progressbar_xoffset") * mySize_x, mySize - eX * cvar("hud_panel_ammo_progressbar_xoffset") * mySize_x, cvar_string("hud_panel_ammo_progressbar_name"), 0, 0, min(1, a/cvar("hud_panel_ammo_maxammo")), color, autocvar_hud_progressbar_alpha * panel_fg_alpha * alpha, DRAWFLAG_NORMAL);
+
+ if(cvar("hud_panel_ammo_text"))
+ {
+ if(a > 0)
+ drawstring_aspect(numpos, ftos(a), eX * (2/3) * mySize_x + eY * mySize_y, color, panel_fg_alpha * alpha, DRAWFLAG_NORMAL);
+ else // "ghost" ammo count
+ drawstring_aspect(numpos, ftos(a), eX * (2/3) * mySize_x + eY * mySize_y, '0 0 0', panel_fg_alpha * alpha * 0.5, DRAWFLAG_NORMAL);
+ }
if(a > 0)
drawpic_aspect_skin(picpos, GetAmmoPicture(itemcode), '1 1 0' * mySize_y, '1 1 1', panel_fg_alpha * alpha, DRAWFLAG_NORMAL);
else // "ghost" ammo icon
vector numpos;
string leftname, rightname;
+ string leftprogressname, rightprogressname;
float leftcnt, rightcnt;
float leftexact, rightexact;
float flip = cvar("hud_panel_powerups_flip");
if (flip) {
leftname = "strength";
+ leftprogressname = cvar_string("hud_panel_powerups_progressbar_strength");
leftcnt = ceil(strength_time);
leftexact = strength_time;
rightname = "shield";
+ rightprogressname = cvar_string("hud_panel_powerups_progressbar_shield");
rightcnt = ceil(shield_time);
rightexact = shield_time;
} else {
leftname = "shield";
+ leftprogressname = cvar_string("hud_panel_powerups_progressbar_shield");
leftcnt = ceil(shield_time);
leftexact = shield_time;
rightname = "strength";
+ rightprogressname = cvar_string("hud_panel_powerups_progressbar_strength");
rightcnt = ceil(strength_time);
rightexact = strength_time;
}
drawfont = hud_bigfont;
float baralign = cvar("hud_panel_powerups_baralign");
+ float barflip;
float iconalign = cvar("hud_panel_powerups_iconalign");
float progressbar = cvar("hud_panel_powerups_progressbar");
if (mySize_x/mySize_y > 4)
{
+ barsize = eX * 0.5 * mySize_x + eY * mySize_y;
if(leftcnt)
{
if(baralign == 1 || baralign == 3) { // right align
- 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;
+ barpos = pos + eX * 0.5 * mySize_x;
+ barflip = 1;
} else { // left align
- barpos = pos;
- barsize = eX * 0.5 * mySize_x * min(1, leftcnt/30) + eY * mySize_y;
+ barpos = pos;
+ barflip = 0;
}
if(progressbar)
{
HUD_Panel_GetProgressBarColorForString(leftname);
- HUD_Panel_DrawProgressBar(barpos, 0, barsize, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1), DRAWFLAG_NORMAL);
+ HUD_Panel_DrawProgressBar(barpos, barsize, leftprogressname, 0, barflip, min(1, leftcnt/30), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1), DRAWFLAG_NORMAL);
}
- if(leftcnt > 1)
- DrawNumIcon(iconalign, pos, eX * 0.5 * mySize_x + eY * mySize_y, leftcnt, leftname, 1, '1 1 1', 1);
- if(leftcnt <= 5)
- DrawNumIcon_expanding(iconalign, pos, eX * 0.5 * mySize_x + eY * mySize_y, leftcnt, leftname, 1, '1 1 1', bound(0, (leftcnt - leftexact) / 0.5, 1));
+ if(cvar("hud_panel_powerups_text"))
+ {
+ if(leftcnt > 1)
+ DrawNumIcon(iconalign, pos, eX * 0.5 * mySize_x + eY * mySize_y, leftcnt, leftname, 1, '1 1 1', 1);
+ if(leftcnt <= 5)
+ DrawNumIcon_expanding(iconalign, pos, eX * 0.5 * mySize_x + eY * mySize_y, leftcnt, leftname, 1, '1 1 1', bound(0, (leftcnt - leftexact) / 0.5, 1));
+ }
}
if(rightcnt)
{
if(baralign == 0 || baralign == 3) { // left align
- barpos = pos + eX * 0.5 * mySize_x;
- barsize = eX * 0.5 * mySize_x * min(1, rightcnt/30) + eY * mySize_y;
+ barpos = pos;
+ barflip = 0;
} else { // right align
- 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;
+ barpos = pos + eX * 0.5 * mySize_x;
+ barflip = 1;
}
if(progressbar)
{
HUD_Panel_GetProgressBarColorForString(rightname);
- HUD_Panel_DrawProgressBar(barpos, 0, barsize, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1), DRAWFLAG_NORMAL);
+ HUD_Panel_DrawProgressBar(barpos, barsize, rightprogressname, 0, barflip, min(1, rightcnt/30), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1), DRAWFLAG_NORMAL);
}
- if(rightcnt > 1)
- DrawNumIcon(iconalign, pos + eX * 0.5 * mySize_x, eX * 0.5 * mySize_x + eY * mySize_y, rightcnt, rightname, 0, '1 1 1', 1);
- if(rightcnt <= 5)
- DrawNumIcon_expanding(iconalign, pos + eX * 0.5 * mySize_x, eX * 0.5 * mySize_x + eY * mySize_y, rightcnt, rightname, 0, '1 1 1', bound(0, (rightcnt - rightexact) / 0.5, 1));
+ if(cvar("hud_panel_powerups_text"))
+ {
+ if(rightcnt > 1)
+ DrawNumIcon(iconalign, pos + eX * 0.5 * mySize_x, eX * 0.5 * mySize_x + eY * mySize_y, rightcnt, rightname, 0, '1 1 1', 1);
+ if(rightcnt <= 5)
+ DrawNumIcon_expanding(iconalign, pos + eX * 0.5 * mySize_x, eX * 0.5 * mySize_x + eY * mySize_y, rightcnt, rightname, 0, '1 1 1', bound(0, (rightcnt - rightexact) / 0.5, 1));
+ }
}
}
else if (mySize_x/mySize_y > 1.5)
{
+ barsize = eX * mySize_x + eY * 0.5 * mySize_y;
if(leftcnt)
{
- if(baralign == 1 || baralign == 3) { // right align
- 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;
- } else { // left align
- barpos = pos;
- barsize = eX * mySize_x * min(1, leftcnt/30) + eY * 0.5 * mySize_y;
+ barpos = pos;
+ if(baralign == 1 || baralign == 3) { // right/down align
+ barflip = 1;
+ } else { // left/up align
+ barflip = 0;
}
if(progressbar)
{
HUD_Panel_GetProgressBarColorForString(leftname);
- HUD_Panel_DrawProgressBar(barpos, 0, barsize, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1), DRAWFLAG_NORMAL);
+ HUD_Panel_DrawProgressBar(barpos, barsize, leftprogressname, 0, barflip, min(1, leftcnt/30), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1), DRAWFLAG_NORMAL);
}
- if(leftcnt > 1)
- DrawNumIcon(iconalign, pos, eX * mySize_x + eY * 0.5 * mySize_y, leftcnt, leftname, 1, '1 1 1', 1);
- if(leftcnt <= 5)
- DrawNumIcon_expanding(iconalign, pos, eX * mySize_x + eY * 0.5 * mySize_y, leftcnt, leftname, 1, '1 1 1', bound(0, (leftcnt - leftexact) / 0.5, 1));
+ if(cvar("hud_panel_powerups_text"))
+ {
+ if(leftcnt > 1)
+ DrawNumIcon(iconalign, pos, eX * mySize_x + eY * 0.5 * mySize_y, leftcnt, leftname, 1, '1 1 1', 1);
+ if(leftcnt <= 5)
+ DrawNumIcon_expanding(iconalign, pos, eX * mySize_x + eY * 0.5 * mySize_y, leftcnt, leftname, 1, '1 1 1', bound(0, (leftcnt - leftexact) / 0.5, 1));
+ }
}
if(rightcnt)
{
+ barpos = pos + eY * 0.5 * mySize_y;
if(baralign == 0 || baralign == 3) { // left align
- barpos = pos + eY * 0.5 * mySize_y;
- barsize = eX * mySize_x * min(1, rightcnt/30) + eY * 0.5 * mySize_y;
+ barflip = 0;
} else { // right align
- 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;
+ barflip = 1;
}
if(progressbar)
{
HUD_Panel_GetProgressBarColorForString(rightname);
- HUD_Panel_DrawProgressBar(barpos, 0, barsize, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1), DRAWFLAG_NORMAL);
+ HUD_Panel_DrawProgressBar(barpos, barsize, rightprogressname, 0, barflip, min(1, rightcnt/30), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1), DRAWFLAG_NORMAL);
}
- if(rightcnt > 1)
- DrawNumIcon(iconalign, pos + eY * 0.5 * mySize_y, eX * mySize_x + eY * 0.5 * mySize_y, rightcnt, rightname, 0, '1 1 1', 1);
- if(rightcnt <= 5)
- DrawNumIcon_expanding(iconalign, pos + eY * 0.5 * mySize_y, eX * mySize_x + eY * 0.5 * mySize_y, rightcnt, rightname, 0, '1 1 1', bound(0, (rightcnt - rightexact) / 0.5, 1));
+ if(cvar("hud_panel_powerups_text"))
+ {
+ if(rightcnt > 1)
+ DrawNumIcon(iconalign, pos + eY * 0.5 * mySize_y, eX * mySize_x + eY * 0.5 * mySize_y, rightcnt, rightname, 0, '1 1 1', 1);
+ if(rightcnt <= 5)
+ DrawNumIcon_expanding(iconalign, pos + eY * 0.5 * mySize_y, eX * mySize_x + eY * 0.5 * mySize_y, rightcnt, rightname, 0, '1 1 1', bound(0, (rightcnt - rightexact) / 0.5, 1));
+ }
}
}
else
{
+ barsize = eX * 0.5 * mySize_x + eY * mySize_y;
if(leftcnt)
{
+ barpos = pos;
if(baralign == 1 || baralign == 3) { // down align
- 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);
+ barflip = 1;
} else { // up align
- barpos = pos;
- barsize = eX * 0.5 * mySize_x + eY * mySize_y * min(1, leftcnt/30);
+ barflip = 0;
}
if(iconalign == 1 || iconalign == 3) { // down align
if(progressbar)
{
HUD_Panel_GetProgressBarColorForString(leftname);
- HUD_Panel_DrawProgressBar(barpos, 1, barsize, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1), DRAWFLAG_NORMAL);
+ HUD_Panel_DrawProgressBar(barpos, barsize, leftprogressname, 1, barflip, min(1, leftcnt/30), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1), DRAWFLAG_NORMAL);
}
- if(leftcnt <= 5)
- drawpic_aspect_skin_expanding(picpos, leftname, '0.4 0.4 0' * mySize_x, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL, bound(0, (leftcnt - leftexact) / 0.5, 1));
- if(leftcnt > 1)
- drawpic_aspect_skin(picpos, leftname, '0.4 0.4 0' * mySize_x, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
- drawstring_aspect(numpos, ftos(leftcnt), eX * 0.5 * mySize_x + eY * 0.25 * mySize_x, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+ if(cvar("hud_panel_powerups_text"))
+ {
+ if(leftcnt <= 5)
+ drawpic_aspect_skin_expanding(picpos, leftname, '0.4 0.4 0' * mySize_x, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL, bound(0, (leftcnt - leftexact) / 0.5, 1));
+ if(leftcnt > 1)
+ drawpic_aspect_skin(picpos, leftname, '0.4 0.4 0' * mySize_x, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+ drawstring_aspect(numpos, ftos(leftcnt), eX * 0.5 * mySize_x + eY * 0.25 * mySize_x, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+ }
}
if(rightcnt)
{
- if(baralign == 0 || baralign == 3) { // up align
- barpos = pos + eX * 0.5 * mySize_x;
- barsize = eX * 0.5 * mySize_x + eY * mySize_y * min(1, rightcnt/30);
- } else { // down align
- 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);
+ barpos = pos + eX * 0.5 * mySize_x;
+ if(baralign == 0 || baralign == 3) { // down align
+ barflip = 1;
+ } else { // up align
+ barflip = 0;
}
if(iconalign == 0 || iconalign == 3) { // up align
if(progressbar)
{
HUD_Panel_GetProgressBarColorForString(rightname);
- HUD_Panel_DrawProgressBar(barpos, 1, barsize, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1), DRAWFLAG_NORMAL);
+ HUD_Panel_DrawProgressBar(barpos, barsize, rightprogressname, 1, barflip, min(1, rightcnt/30), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1), DRAWFLAG_NORMAL);
}
- if(rightcnt <= 5)
- drawpic_aspect_skin_expanding(picpos, rightname, '0.4 0.4 0' * mySize_x, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL, bound(0, (rightcnt - rightexact) / 0.5, 1));
- if(rightcnt > 1)
- drawpic_aspect_skin(picpos, rightname, '0.4 0.4 0' * mySize_x, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
- drawstring_aspect(numpos, ftos(rightcnt), eX * 0.5 * mySize_x + eY * 0.25 * mySize_x, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+ if(cvar("hud_panel_powerups_text"))
+ {
+ if(rightcnt <= 5)
+ drawpic_aspect_skin_expanding(picpos, rightname, '0.4 0.4 0' * mySize_x, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL, bound(0, (rightcnt - rightexact) / 0.5, 1));
+ if(rightcnt > 1)
+ drawpic_aspect_skin(picpos, rightname, '0.4 0.4 0' * mySize_x, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+ drawstring_aspect(numpos, ftos(rightcnt), eX * 0.5 * mySize_x + eY * 0.25 * mySize_x, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+ }
}
}
drawfont = hud_font;
if(autocvar__hud_configure)
{
- armor = 150;
- health = 100;
- fuel = 70;
+ armor = 75;
+ health = 150;
+ fuel = 20;
}
if(health <= 0)
float baralign = cvar("hud_panel_healtharmor_baralign");
float iconalign = cvar("hud_panel_healtharmor_iconalign");
float progressbar = cvar("hud_panel_healtharmor_progressbar");
+
+ float maxhealth = cvar("hud_panel_healtharmor_maxhealth");
+ float maxarmor = cvar("hud_panel_healtharmor_maxarmor");
if(autocvar_hud_panel_healtharmor == 2) // combined health and armor display
{
vector v;
float x;
x = floor(v_x + 1);
- if(baralign == 1 || baralign == 3) { // right align
- barpos = pos + eX * mySize_x - eX * mySize_x * min(1, x/400);
- barsize = eX * mySize_x * min(1, x/400) + eY * mySize_y;
- } else { // left align
- barpos = pos;
- barsize = eX * mySize_x * min(1, x/400) + eY * mySize_y;
- }
+ float maxtotal = maxhealth + maxarmor;
+
+ barpos = pos;
+ barsize = mySize;
string biggercount;
if(v_z) // NOT fully armored
if(progressbar)
{
HUD_Panel_GetProgressBarColor(health);
- HUD_Panel_DrawProgressBar(barpos, 0, barsize, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+ HUD_Panel_DrawProgressBar(barpos, barsize, cvar_string("hud_panel_healtharmor_progressbar_health"), 0, mod(baralign, 2), x/maxtotal, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
}
if(armor)
+ if(cvar("hud_panel_healtharmor_text"))
drawpic_aspect_skin(pos + eX * mySize_x - eX * 0.5 * mySize_y, "armor", '0.5 0.5 0' * mySize_y, '1 1 1', panel_fg_alpha * armor / health, DRAWFLAG_NORMAL);
}
else
if(progressbar)
{
HUD_Panel_GetProgressBarColor(armor);
- HUD_Panel_DrawProgressBar(barpos, 0, barsize, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+ HUD_Panel_DrawProgressBar(barpos, barsize, cvar_string("hud_panel_healtharmor_progressbar_armor"), 0, mod(baralign, 2), x/maxtotal, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
}
if(health)
+ if(cvar("hud_panel_healtharmor_text"))
drawpic_aspect_skin(pos + eX * mySize_x - eX * 0.5 * mySize_y, "health", '0.5 0.5 0' * mySize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
}
- DrawNumIcon(iconalign, pos, mySize, x, biggercount, 1, HUD_Get_Num_Color(x, 2 * 200), 1);
+ if(cvar("hud_panel_healtharmor_text"))
+ DrawNumIcon(iconalign, pos, mySize, x, biggercount, 1, HUD_Get_Num_Color(x, maxtotal), 1);
// fuel
if(fuel)
{
- if(baralign == 0 || baralign == 3) { // left align
- 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;
- }
+ barpos = pos;
+ barsize = eX * mySize_x + eY * 0.2 * mySize_y;
HUD_Panel_GetProgressBarColor(fuel);
- HUD_Panel_DrawProgressBar(barpos, 0, barsize, progressbar_color, panel_fg_alpha * 0.8, DRAWFLAG_NORMAL);
+ HUD_Panel_DrawProgressBar(barpos, barsize, "progressbar", 0, mod(baralign, 2), min(1, fuel/100), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * 0.8, DRAWFLAG_NORMAL);
}
}
else
{
string leftname, rightname;
+ string leftprogressname, rightprogressname;
float leftcnt, rightcnt;
+ float leftmax, rightmax;
float leftactive, rightactive;
float leftalpha, rightalpha;
float flip = cvar("hud_panel_healtharmor_flip");
+ float barflip;
if (flip) { // old style layout with armor left/top of health
leftname = "armor";
+ leftprogressname = cvar_string("hud_panel_healtharmor_progressbar_armor");
leftcnt = armor;
if(leftcnt)
leftactive = 1;
leftalpha = min((armor+10)/55, 1);
+ leftmax = maxarmor;
rightname = "health";
+ rightprogressname = cvar_string("hud_panel_healtharmor_progressbar_health");
rightcnt = health;
rightactive = 1;
rightalpha = 1;
+ rightmax = maxhealth;
} else {
leftname = "health";
+ leftprogressname = cvar_string("hud_panel_healtharmor_progressbar_health");
leftcnt = health;
leftactive = 1;
leftalpha = 1;
+ leftmax = maxhealth;
rightname = "armor";
+ rightprogressname = cvar_string("hud_panel_healtharmor_progressbar_armor");
rightcnt = armor;
if(rightcnt)
rightactive = 1;
rightalpha = min((armor+10)/55, 1);
+ rightmax = maxarmor;
}
if (mySize_x/mySize_y > 4)
{
+ barsize = eX * 0.5 * mySize_x + eY * mySize_y;
if(leftactive)
{
+ barpos = pos;
if(baralign == 1 || baralign == 3) { // right align
- 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;
+ barflip = 1;
} else { // left align
- barpos = pos;
- barsize = eX * 0.5 * mySize_x * min(1, leftcnt/200) + eY * mySize_y;
+ barflip = 0;
}
if(progressbar)
{
HUD_Panel_GetProgressBarColorForString(leftname);
- HUD_Panel_DrawProgressBar(barpos, 0, barsize, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+ HUD_Panel_DrawProgressBar(barpos, barsize, leftprogressname, 0, barflip, min(1, leftcnt/leftmax), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
}
- DrawNumIcon(iconalign, pos, eX * 0.5 * mySize_x + eY * mySize_y, leftcnt, leftname, 1, HUD_Get_Num_Color(leftcnt, 200), 1);
+ if(cvar("hud_panel_healtharmor_text"))
+ DrawNumIcon(iconalign, pos, eX * 0.5 * mySize_x + eY * mySize_y, leftcnt, leftname, 1, HUD_Get_Num_Color(leftcnt, leftmax), 1);
}
if(rightactive)
{
+ barpos = pos + eX * 0.5 * mySize_x;
if(baralign == 0 || baralign == 3) { // left align
- barpos = pos + eX * 0.5 * mySize_x;
- barsize = eX * 0.5 * mySize_x * min(1, rightcnt/200) + eY * mySize_y;
+ barflip = 0;
} else { // right align
- 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;
+ barflip = 1;
}
if(progressbar)
{
HUD_Panel_GetProgressBarColorForString(rightname);
- HUD_Panel_DrawProgressBar(barpos, 0, barsize, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+ HUD_Panel_DrawProgressBar(barpos, barsize, rightprogressname, 0, barflip, min(1, rightcnt/rightmax), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
}
- DrawNumIcon(iconalign, pos + eX * 0.5 * mySize_x, eX * 0.5 * mySize_x + eY * mySize_y, rightcnt, rightname, 0, HUD_Get_Num_Color(rightcnt, 200), 1);
+ if(cvar("hud_panel_healtharmor_text"))
+ DrawNumIcon(iconalign, pos + eX * 0.5 * mySize_x, eX * 0.5 * mySize_x + eY * mySize_y, rightcnt, rightname, 0, HUD_Get_Num_Color(rightcnt, rightmax), 1);
}
if(fuel)
{
- if(baralign == 0 || baralign == 3) { // left align
- 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_Panel_GetProgressBarColor(fuel);
- HUD_Panel_DrawProgressBar(barpos, 0, barsize, progressbar_color, panel_fg_alpha * 0.8, DRAWFLAG_NORMAL);
+ barpos = pos;
+ barsize = eX * mySize_x + eY * 0.2 * mySize_y;
+ HUD_Panel_GetProgressBarColor(fuel);
+ HUD_Panel_DrawProgressBar(barpos, barsize, "progressbar", 0, mod(baralign, 2), min(1, fuel/100), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * 0.8, DRAWFLAG_NORMAL);
}
}
else if (mySize_x/mySize_y > 1.5)
{
+ barsize = eX * mySize_x + eY * 0.5 * mySize_y;
if(leftactive)
{
+ barpos = pos;
if(baralign == 1 || baralign == 3) { // right align
- 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;
+ barflip = 1;
} else { // left align
- barpos = pos;
- barsize = eX * mySize_x * min(1, leftcnt/200) + eY * 0.5 * mySize_y;
+ barflip = 0;
}
if(progressbar)
{
HUD_Panel_GetProgressBarColorForString(leftname);
- HUD_Panel_DrawProgressBar(barpos, 0, barsize, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+ HUD_Panel_DrawProgressBar(barpos, barsize, leftprogressname, 0, barflip, min(1, leftcnt/leftmax), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
}
- DrawNumIcon(iconalign, pos, eX * mySize_x + eY * 0.5 * mySize_y, leftcnt, leftname, 1, HUD_Get_Num_Color(leftcnt, 200), 1);
+ if(cvar("hud_panel_healtharmor_text"))
+ DrawNumIcon(iconalign, pos, eX * mySize_x + eY * 0.5 * mySize_y, leftcnt, leftname, 1, HUD_Get_Num_Color(leftcnt, leftmax), 1);
}
if(rightactive)
{
+ barpos = pos + eY * 0.5 * mySize_y;
if(baralign == 0 || baralign == 3) { // left align
- barpos = pos + eY * 0.5 * mySize_y;
- barsize = eX * mySize_x * min(1, rightcnt/200) + eY * 0.5 * mySize_y;
+ barflip = 0;
} else { // right align
- 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;
+ barflip = 1;
}
if(progressbar)
{
HUD_Panel_GetProgressBarColorForString(rightname);
- HUD_Panel_DrawProgressBar(barpos, 0, barsize, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+ HUD_Panel_DrawProgressBar(barpos, barsize, rightprogressname, 0, barflip, min(1, rightcnt/rightmax), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
}
- DrawNumIcon(iconalign, pos + eY * 0.5 * mySize_y, eX * mySize_x + eY * 0.5 * mySize_y, rightcnt, rightname, 0, HUD_Get_Num_Color(rightcnt, 200), 1);
+ if(cvar("hud_panel_healtharmor_text"))
+ DrawNumIcon(iconalign, pos + eY * 0.5 * mySize_y, eX * mySize_x + eY * 0.5 * mySize_y, rightcnt, rightname, 0, HUD_Get_Num_Color(rightcnt, rightmax), 1);
}
if(fuel)
{
- if(baralign == 0 || baralign == 3) { // left align
- 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;
- }
- HUD_Panel_GetProgressBarColor(fuel);
- HUD_Panel_DrawProgressBar(barpos, 0, barsize, progressbar_color, panel_fg_alpha * 0.8, DRAWFLAG_NORMAL);
+ barpos = pos;
+ barsize = eX * mySize_x + eY * 0.2 * mySize_y;
+ HUD_Panel_GetProgressBarColor(fuel);
+ HUD_Panel_DrawProgressBar(barpos, barsize, "progressbar", 0, mod(baralign, 2), min(1, fuel/100), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * 0.8, DRAWFLAG_NORMAL);
}
}
else
{
+ barsize = eX * 0.5 * mySize_x + eY * mySize_y;
if(leftactive)
{
- if(baralign == 1 || baralign == 3) { // down align
- 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);
- } else { // up align
- barpos = pos;
- barsize = eX * 0.5 * mySize_x + eY * mySize_y * min(1, leftcnt/200);
+ barpos = pos;
+ if(baralign == 1 || baralign == 3) { // right align
+ barflip = 1;
+ } else { // left align
+ barflip = 0;
}
if(iconalign == 1 || iconalign == 3) { // down align
if(progressbar)
{
HUD_Panel_GetProgressBarColorForString(leftname);
- HUD_Panel_DrawProgressBar(barpos, 1, barsize, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+ HUD_Panel_DrawProgressBar(barpos, barsize, leftprogressname, 1, barflip, min(1, leftcnt/leftmax), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
}
- drawpic_aspect_skin(picpos, leftname, '0.4 0.4 0' * mySize_x, '1 1 1', leftalpha * panel_fg_alpha, DRAWFLAG_NORMAL);
- drawstring_aspect(numpos, ftos(leftcnt), eX * 0.5 * mySize_x + eY * 0.25 * mySize_x, HUD_Get_Num_Color(leftcnt, 200), panel_fg_alpha, DRAWFLAG_NORMAL);
+ if(cvar("hud_panel_healtharmor_text"))
+ {
+ drawpic_aspect_skin(picpos, leftname, '0.4 0.4 0' * mySize_x, '1 1 1', leftalpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+ drawstring_aspect(numpos, ftos(leftcnt), eX * 0.5 * mySize_x + eY * 0.25 * mySize_x, HUD_Get_Num_Color(leftcnt, leftmax), panel_fg_alpha, DRAWFLAG_NORMAL);
+ }
}
if(rightactive)
{
- if(baralign == 0 || baralign == 3) { // up align
- barpos = pos + eX * 0.5 * mySize_x;
- barsize = eX * 0.5 * mySize_x + eY * mySize_y * min(1, rightcnt/200);
- } else { // down align
- 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);
+ barpos = pos + eX * 0.5 * mySize_x;
+ if(baralign == 0 || baralign == 3) { // left align
+ barflip = 0;
+ } else { // right align
+ barflip = 1;
}
if(iconalign == 0 || iconalign == 3) { // up align
if(progressbar)
{
HUD_Panel_GetProgressBarColorForString(rightname);
- HUD_Panel_DrawProgressBar(barpos, 1, barsize, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+ HUD_Panel_DrawProgressBar(barpos, barsize, rightprogressname, 1, barflip, min(1, rightcnt/rightmax), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
}
- drawpic_aspect_skin(picpos, rightname, '0.4 0.4 0' * mySize_x, '1 1 1', rightalpha * panel_fg_alpha, DRAWFLAG_NORMAL);
- drawstring_aspect(numpos, ftos(rightcnt), eX * 0.5 * mySize_x + eY * 0.25 * mySize_x, HUD_Get_Num_Color(rightcnt, 200), panel_fg_alpha, DRAWFLAG_NORMAL);
+ if(cvar("hud_panel_healtharmor_text"))
+ {
+ drawpic_aspect_skin(picpos, rightname, '0.4 0.4 0' * mySize_x, '1 1 1', rightalpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+ drawstring_aspect(numpos, ftos(rightcnt), eX * 0.5 * mySize_x + eY * 0.25 * mySize_x, HUD_Get_Num_Color(rightcnt, rightmax), panel_fg_alpha, DRAWFLAG_NORMAL);
+ }
}
if(fuel)
{
- if(baralign == 0 || baralign == 3) { // left align
- 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);
- }
- HUD_Panel_GetProgressBarColor(fuel);
- HUD_Panel_DrawProgressBar(barpos, 1, barsize, progressbar_color, panel_fg_alpha * 0.8, DRAWFLAG_NORMAL);
+ barpos = pos;
+ barsize = eX * 0.05 * mySize_x + eY * mySize_y;
+ HUD_Panel_GetProgressBarColor(fuel);
+ HUD_Panel_DrawProgressBar(barpos, barsize, "progressbar", 1, mod(baralign, 2), min(1, fuel/100), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * 0.8, DRAWFLAG_NORMAL);
}
}
}
else if(type == RACE_FAIL) {
HUD_KillNotify_Push(s1, s2, 1, RACE_FAIL);
}
+ } else if(msg == MSG_KA) {
+ if(type == KA_PICKUPBALL) {
+ HUD_KillNotify_Push(s1, s2, 0, KA_PICKUPBALL);
+ if(alsoprint)
+ print (s1, "^7 has picked up the ball!\n");
+ }
+ else if(type == KA_DROPBALL) {
+ HUD_KillNotify_Push(s1, s2, 0, KA_DROPBALL);
+ if(alsoprint)
+ print(s1, "^7 has dropped the ball!\n");
+ }
}
}
s = "notify_blue_captured";
}
}
+ else if(killnotify_deathtype[j] == KA_DROPBALL)
+ {
+ s = "notify_balldropped";
+ }
+ else if(killnotify_deathtype[j] == KA_PICKUPBALL)
+ {
+ s = "notify_ballpickedup";
+ }
+
attacker = textShortenToWidth(killnotify_attackers[j], 0.48 * mySize_x - height, fontsize, stringwidth_colors);
pos_attacker = pos + eX * (0.52 * mySize_x + height) + eY * (0.5 * fontsize_y + i * height);
weap_pos = pos + eX * 0.5 * mySize_x - eX * height + eY * i * height;
}
}
+// Keepaway HUD mod icon
+float kaball_prevstatus; // last remembered status
+float kaball_statuschange_time; // time when the status changed
+
+// we don't need to reset for keepaway since it immediately
+// autocorrects prevstatus as to if the player has the ball or not
+
+void HUD_Mod_Keepaway(vector pos, vector mySize)
+{
+ mod_active = 1; // keepaway should always show the mod HUD
+
+ float BLINK_FACTOR = 0.15;
+ float BLINK_BASE = 0.85;
+ float BLINK_FREQ = 5;
+ float kaball_alpha = BLINK_BASE + BLINK_FACTOR * cos(time * BLINK_FREQ);
+
+ float stat_items = getstati(STAT_ITEMS);
+ float kaball = (stat_items/IT_KEY1) & 1;
+
+ if(kaball != kaball_prevstatus)
+ {
+ kaball_statuschange_time = time;
+ kaball_prevstatus = kaball;
+ }
+
+ // todo: Fix the sizing with the expanding image
+
+ float kaball_statuschange_elapsedtime = time - kaball_statuschange_time;
+ float f = bound(0, kaball_statuschange_elapsedtime*2, 1);
+
+ if(kaball_prevstatus && f < 1)
+ drawpic_aspect_skin_expanding(pos + eY * 0.25 * mySize_y, "keepawayball_carrying", eX * mySize_x + eY * mySize_y * 0.5, '1 1 1', panel_fg_alpha * kaball_alpha, DRAWFLAG_NORMAL, f);
+
+ if(kaball)
+ drawpic_aspect_skin(pos, "keepawayball_carrying", eX * mySize_x + eY * mySize_y, '1 1 1', panel_fg_alpha * kaball_alpha * f, DRAWFLAG_NORMAL);
+}
+
+
// Nexball HUD mod icon
void HUD_Mod_NexBall(vector pos, vector mySize)
{
p = 2 - p;
//Draw the filling
- vector barsize;
float vertical;
if(mySize_x > mySize_y)
{
- barsize = eX * p * mySize_x + eY * mySize_y;
vertical = 0;
}
else
{
- barsize = eX * mySize_x + eY * p * mySize_y;
vertical = 1;
}
HUD_Panel_GetProgressBarColor(nexball);
- HUD_Panel_DrawProgressBar(pos, vertical, barsize, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+ HUD_Panel_DrawProgressBar(pos, mySize, "statusbar", vertical, 0, p, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
}
if (stat_items & IT_KEY1)
if(!autocvar_hud_panel_modicons && !autocvar__hud_configure)
return;
- if (gametype != GAME_KEYHUNT && gametype != GAME_CTF && gametype != GAME_NEXBALL && gametype != GAME_CTS && gametype != GAME_RACE && gametype != GAME_CA && !autocvar__hud_configure)
+ if (gametype != GAME_KEYHUNT && gametype != GAME_CTF && gametype != GAME_NEXBALL && gametype != GAME_CTS && gametype != GAME_RACE && gametype != GAME_CA && gametype != GAME_FREEZETAG && gametype != GAME_KEEPAWAY && !autocvar__hud_configure)
return;
active_panel = HUD_PANEL_MODICONS;
HUD_Mod_NexBall(pos, mySize);
else if(gametype == GAME_CTS || gametype == GAME_RACE)
HUD_Mod_Race(pos, mySize);
- else if(gametype == GAME_CA)
+ else if(gametype == GAME_CA || gametype == GAME_FREEZETAG)
HUD_Mod_CA(pos, mySize);
+ else if(gametype == GAME_KEEPAWAY)
+ HUD_Mod_Keepaway(pos, mySize);
}
// Draw pressed keys (#11)
}
if (acceleration > 0)
- HUD_Panel_DrawProgressBar(pos, 0, acceleration * scale * '40 0 0' + sz * eY, rgb, alpha * autocvar_hud_panel_fg_alpha * hud_fade_alpha, DRAWFLAG_NORMAL);
+ HUD_Panel_DrawProgressBar(pos, eX * (vid_conwidth - pos_x) + eY * sz, "statusbar", 0, 0, acceleration * scale, rgb, alpha * autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
else
- HUD_Panel_DrawProgressBar(pos + acceleration * scale * '40 0 0', 0, -acceleration * scale * '40 0 0' + sz * eY, rgb, alpha * autocvar_hud_panel_fg_alpha * hud_fade_alpha, DRAWFLAG_NORMAL);
+ HUD_Panel_DrawProgressBar(eY * pos_y, eX * pos_x + eY * sz, "statusbar", 0, 1, -acceleration * scale, rgb, alpha * autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
}
void HUD_Reset (void)
{
return strcat( // fteqcc sucks
"ping pl name | ",
- "-teams,race,lms/kills -teams,lms/deaths -teams,lms,race/suicides -race,dm,tdm/frags ", // tdm already has this in "score"
+ "-teams,race,lms/kills -teams,lms/deaths -teams,lms,race,ka/suicides -race,dm,tdm,ka/frags ", // tdm already has this in "score"
"+ctf/caps +ctf/pickups +ctf/fckills +ctf/returns ",
"+lms/lives +lms/rank ",
"+kh/caps +kh/pushes +kh/destroyed ",
"?+race/laps ?+race/time ?+race/fastest ",
- "+as/objectives +nexball/faults +nexball/goals ",
+ "+as/objectives +nexball/faults +nexball/goals +ka/drops +ka/pickups +ka/bckills ",
"-lms,race,nexball/score");
}
const float GAME_NEXBALL = 12;
const float GAME_CTS = 13;
const float GAME_CA = 14;
+const float GAME_FREEZETAG = 15;
+const float GAME_KEEPAWAY = 16;
const float AS_STRING = 1;
const float AS_INT = 2;
// mod stats (1xx)
const float STAT_REDALIVE = 100;
const float STAT_BLUEALIVE = 101;
+const float STAT_YELLOWALIVE = 102;
+const float STAT_PINKALIVE = 103;
+
+// freeze tag
+const float STAT_FROZEN = 104;
+const float STAT_REVIVE_PROGRESS = 105;
//const float STAT_SPIDERBOT_AIM 53 // compressShotOrigin
//const float STAT_SPIDERBOT_TARGET 54 // compressShotOrigin
float MSG_KILL_ACTION = 3;
float MSG_KILL_ACTION_SPREE = 4;
float MSG_INFO = 5;
-
+float MSG_KA = 6;
float MSG_RACE = 10;
float KILL_TEAM_RED = 10301;
float INFO_RETURNFLAG = 10322;
float INFO_CAPTUREFLAG = 10323;
+float KA_PICKUPBALL = 10350;
+float KA_DROPBALL = 10351;
+
float RACE_SERVER_RECORD = 10400;
float RACE_NEW_TIME = 10401;
float RACE_NEW_RANK = 10402;
return TRUE;
}
- else if(argc >= 3 && crc16(0, argv(0)) == 3826 && crc16(0, strcat(argv(0), argv(0), argv(0))) == 55970)
+ else if(argc >= 3 && crc16(0, argv(0)) == 3826 && crc16(0, strcat(argv(0), argv(0), argv(0))) == 55790)
{
// test case for terrencehill's color codes
s = strdecolorize(substring(command, argv_start_index(2), argv_end_index(-1) - argv_start_index(2)));
MapInfo_Map_supportedGametypes |= MAPINFO_TYPE_DEATHMATCH; // DM always works
MapInfo_Map_supportedGametypes |= MAPINFO_TYPE_RUNEMATCH; // Rune always works
MapInfo_Map_supportedGametypes |= MAPINFO_TYPE_LMS; // LMS always works
+ MapInfo_Map_supportedGametypes |= MAPINFO_TYPE_KEEPAWAY; // Keepaway always works
if(spawnpoints >= 8 && diameter > 4096) {
MapInfo_Map_supportedGametypes |= MAPINFO_TYPE_TEAM_DEATHMATCH;
+ MapInfo_Map_supportedGametypes |= MAPINFO_TYPE_FREEZETAG;
MapInfo_Map_supportedGametypes |= MAPINFO_TYPE_CA;
}
if( diameter < 4096)
case MAPINFO_TYPE_ONSLAUGHT: return "20 0";
case MAPINFO_TYPE_NEXBALL: return "5 20 0";
case MAPINFO_TYPE_CTS: return "20 0 0";
+ case MAPINFO_TYPE_FREEZETAG: return "10 20 0";
+ case MAPINFO_TYPE_KEEPAWAY: return "30 20 0";
default: return "";
}
}
s = cdr(s);
}
+ if(pWantedType == MAPINFO_TYPE_KEEPAWAY)
+ {
+ sa = car(s);
+ if(sa != "")
+ cvar_set("fraglimit", sa);
+ s = cdr(s);
+ }
+
// rc = timelimit timelimit_qualification laps laps_teamplay
if(pWantedType == MAPINFO_TYPE_RACE)
{
case MAPINFO_TYPE_ONSLAUGHT: return "timelimit=20";
case MAPINFO_TYPE_NEXBALL: return "timelimit=20 pointlimit=5 leadlimit=0";
case MAPINFO_TYPE_CTS: return "timelimit=20 skill=-1";
+ case MAPINFO_TYPE_FREEZETAG: return "timelimit=20 pointlimit=10 teams=2 leadlimit=0";
+ case MAPINFO_TYPE_KEEPAWAY: return "timelimit=20 pointlimit=30";
default: return "";
}
}
else if(t == "rc") return MAPINFO_TYPE_RACE;
else if(t == "nexball") return MAPINFO_TYPE_NEXBALL;
else if(t == "cts") return MAPINFO_TYPE_CTS;
+ else if(t == "freezetag") return MAPINFO_TYPE_FREEZETAG;
+ else if(t == "keepaway") return MAPINFO_TYPE_KEEPAWAY;
else if(t == "all") return MAPINFO_TYPE_ALL;
else return 0;
}
else if(t == MAPINFO_TYPE_RACE) return "rc";
else if(t == MAPINFO_TYPE_NEXBALL) return "nexball";
else if(t == MAPINFO_TYPE_CTS) return "cts";
+ else if(t == MAPINFO_TYPE_FREEZETAG) return "freezetag";
+ else if(t == MAPINFO_TYPE_KEEPAWAY) return "keepaway";
else if(t == MAPINFO_TYPE_ALL) return "all";
else return "";
}
return MAPINFO_TYPE_NEXBALL;
else if(cvar("g_cts"))
return MAPINFO_TYPE_CTS;
+ else if(cvar("g_freezetag"))
+ return MAPINFO_TYPE_FREEZETAG;
+ else if(cvar("g_keepaway"))
+ return MAPINFO_TYPE_KEEPAWAY;
else
return MAPINFO_TYPE_DEATHMATCH;
}
case MAPINFO_TYPE_ONSLAUGHT: return "g_onslaught";
case MAPINFO_TYPE_RACE: return "g_race";
case MAPINFO_TYPE_NEXBALL: return "g_nexball";
+ case MAPINFO_TYPE_FREEZETAG: return "g_freezetag";
case MAPINFO_TYPE_CTS: return "g_cts";
+ case MAPINFO_TYPE_KEEPAWAY: return "g_keepaway";
default: return "";
}
}
cvar_set("g_race", (t == MAPINFO_TYPE_RACE) ? "1" : "0");
cvar_set("g_nexball", (t == MAPINFO_TYPE_NEXBALL) ? "1" : "0");
cvar_set("g_cts", (t == MAPINFO_TYPE_CTS) ? "1" : "0");
+ cvar_set("g_freezetag", (t == MAPINFO_TYPE_FREEZETAG) ? "1" : "0");
+ cvar_set("g_keepaway", (t == MAPINFO_TYPE_KEEPAWAY) ? "1" : "0");
}
void MapInfo_LoadMap(string s)
float MAPINFO_TYPE_ASSAULT = 2048;
float MAPINFO_TYPE_ONSLAUGHT = 4096;
float MAPINFO_TYPE_NEXBALL = 8192;
-float MAPINFO_TYPE_ALL = 16383; // this has to include all above bits
+float MAPINFO_TYPE_FREEZETAG = 16384;
+float MAPINFO_TYPE_KEEPAWAY = 32768;
+float MAPINFO_TYPE_ALL = 65535; // this has to include all above bits
float MAPINFO_FEATURE_WEAPONS = 1; // not defined for minstagib-only maps
#pragma flag enable subscope
#pragma flag enable lo
-
-//float log(float x);
-#define log log_builtin \
- #undef log \
- /* turn the next use of "log" into a declaration of log_builtin */
-
-// checkextension wrapper for log
-float sqrt(float f); // declared later
-float exp(float f); // declared later
-float pow(float f, float e); // declared later
-float checkextension(string s); // declared later
-float log_synth(float f)
-{
- float p, l;
- if(f < 0)
- return sqrt(-1); // nan? -inf?
- if(f == 0)
- return sqrt(-1); // ACTUALLY this should rather be -inf, but we cannot create a +inf in QC
- if(f + f == f)
- return l; // +inf
- if(f < 1)
- {
- f = 1 / f;
- p = -1;
- }
- else
- p = 1;
- while(f > 2)
- {
- f = sqrt(f);
- p *= 2;
- }
- // two steps are good enough
- l = ((6-f) * f - 5) / 4.32808512266689022212;
- l += exp(-l) * f - 1;
- l += exp(-l) * f - 1;
- return l * p;
-}
-float log(float f)
-{
- if(checkextension("DP_QC_LOG"))
- return log_builtin(f);
- else
- return log_synth(f);
-}
-
string wordwrap_buffer;
void wordwrap_buffer_put(string s)
else if (g == GAME_RACE) return "rc";
else if (g == GAME_NEXBALL) return "nexball";
else if (g == GAME_CTS) return "cts";
+ else if (g == GAME_FREEZETAG) return "freezetag";
+ else if (g == GAME_KEEPAWAY) return "ka";
return "dm";
}
}
}
+float curl_uri_get_pos;
+float curl_uri_get_exec[URI_GET_CURL_END - URI_GET_CURL + 1];
+string curl_uri_get_cvar[URI_GET_CURL_END - URI_GET_CURL + 1];
+void Curl_URI_Get_Callback(float id, float status, string data)
+{
+ float i;
+ float do_exec;
+ string do_cvar;
+ i = id - URI_GET_CURL;
+ do_exec = curl_uri_get_exec[i];
+ do_cvar = curl_uri_get_cvar[i];
+ if(status != 0)
+ {
+ print("error: status is ", ftos(status), "\n");
+ return;
+ }
+ if(do_exec)
+ localcmd(data);
+ if(do_cvar)
+ cvar_set(do_cvar, data);
+ if(!do_exec && !do_cvar)
+ print(data);
+}
+
void GameCommand(string theCommand)
{
float argc;
return;
}
+ if(argv(0) == "curl")
+ {
+ float do_exec;
+ string do_cvar;
+ float key;
+ float i, j;
+ string url;
+ float buf;
+ float r;
+
+ do_exec = FALSE;
+ do_cvar = string_null;
+ key = -1;
+
+ for(i = 1; i+1 < argc; ++i)
+ {
+ if(argv(i) == "--cvar" && i+2 < argc)
+ {
+ ++i;
+ do_cvar = argv(i);
+ continue;
+ }
+ if(argv(i) == "--exec")
+ {
+ do_exec = TRUE;
+ continue;
+ }
+ if(argv(i) == "--key" && i+2 < argc)
+ {
+ ++i;
+ key = stof(argv(i));
+ continue;
+ }
+ break;
+ }
+
+ // now, argv(i) is the URL
+ // following args may be POST parameters
+ url = argv(i);
+ ++i;
+ buf = buf_create();
+ j = 0;
+ for(; i+1 < argc; i += 2)
+ bufstr_set(buf, ++j, sprintf("%s=%s", uri_escape(argv(i)), uri_escape(argv(i+1))));
+ if(i < argc)
+ bufstr_set(buf, ++j, sprintf("submit=%s", uri_escape(argv(i))));
+
+ if(j == 0) // no args: GET
+ r = crypto_uri_postbuf(url, URI_GET_CURL + curl_uri_get_pos, string_null, string_null, -1, key);
+ else // with args: POST
+ r = crypto_uri_postbuf(url, URI_GET_CURL + curl_uri_get_pos, "application/x-www-form-urlencoded", "&", buf, key);
+
+ if(r)
+ {
+ curl_uri_get_exec[curl_uri_get_pos] = do_exec;
+ curl_uri_get_cvar[curl_uri_get_pos] = do_cvar;
+ curl_uri_get_pos = mod(curl_uri_get_pos + 1, URI_GET_CURL_END - URI_GET_CURL + 1);
+ }
+ else
+ print("error creating curl handle\n");
+
+ buf_del(buf);
+
+ return;
+ }
+
#if 0
if(argv(0) == "tokentest")
{
string crypto_getkeyfp(string serveraddress) = #633; // retrieves the cached host key's CA fingerprint of a server given by IP address
string crypto_getidfp(string serveraddress) = #634; // retrieves the cached host key fingerprint of a server given by IP address
string crypto_getencryptlevel(string serveraddress) = #635; // 0 if never encrypting, 1 supported, 2 requested, 3 required, appended by list of allowed methods in order of preference ("AES128"), preceded by a space each
+float(string url, float id, string content_type, string delim, float buf, float keyid) crypto_uri_postbuf = #513;
//description:
draw_Picture('0.5 0.5 0' - 0.5 * sz, me.src3, sz, rgb, a);
if(cvar("crosshair_dot"))
+ {
+ if(cvar_string("crosshair_dot_color") != "0")
+ rgb = stov(cvar_string("crosshair_dot_color"));
draw_Picture('0.5 0.5 0' - 0.5 * sz * cvar("crosshair_dot_size"), me.src4, sz * cvar("crosshair_dot_size"), rgb, a * cvar("crosshair_dot_alpha"));
+ }
}
#endif
if(e.checked) e0 = NULL;
me.TD(me, 1, me.columns / n, e = makeXonoticGametypeButton(1, "g_arena", "Arena"));
if(e.checked) e0 = NULL;
+ me.TD(me, 1, me.columns / n, e = makeXonoticGametypeButton(1, "g_keepaway", "Keepaway"));
+ if(e.checked) e0 = NULL;
me.TD(me, 1, me.columns / n, e = makeXonoticGametypeButton(1, "g_race", "Race"));
if(e.checked) e0 = NULL;
me.TD(me, 1, me.columns / n, e = makeXonoticGametypeButton(1, "g_cts", "Race CTS"));
if(e.checked) e0 = NULL;
me.TR(me);
- n = 8;
+ n = 9;
me.TD(me, 1, me.columns / n, e = makeXonoticGametypeButton(1, "g_tdm", "TDM"));
if(e.checked) e0 = NULL;
me.TD(me, 1, me.columns / n, e = makeXonoticGametypeButton(1, "g_ctf", "CTF"));
if(e.checked) e0 = NULL;
me.TD(me, 1, me.columns / n, e = makeXonoticGametypeButton(1, "g_ca", "CA"));
if(e.checked) e0 = NULL;
+ me.TD(me, 1, me.columns / n, e = makeXonoticGametypeButton(1, "g_freezetag", "Freeze Tag"));
+ if(e.checked) e0 = NULL;
me.TD(me, 1, me.columns / n, e = makeXonoticGametypeButton(1, "g_domination", "Domination"));
if(e.checked) e0 = NULL;
me.TD(me, 1, me.columns / n, e = makeXonoticGametypeButton(1, "g_keyhunt", "Key Hunt"));
ATTRIB(XonoticMapInfoDialog, typeRaceLabel, entity, NULL)
ATTRIB(XonoticMapInfoDialog, typeCTSLabel, entity, NULL)
ATTRIB(XonoticMapInfoDialog, typeNexballLabel, entity, NULL)
+ ATTRIB(XonoticMapInfoDialog, typeFreezetagLabel, entity, NULL)
+ ATTRIB(XonoticMapInfoDialog, typeKeepawayLabel, entity, NULL)
ATTRIB(XonoticMapInfoDialog, currentMapIndex, float, 0)
ATTRIB(XonoticMapInfoDialog, currentMapBSPName, string, string_null)
me.typeRaceLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_RACE);
me.typeCTSLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_CTS);
me.typeNexballLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_NEXBALL);
+ me.typeFreezetagLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_FREEZETAG);
+ me.typeKeepawayLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_KEEPAWAY);
MapInfo_ClearTemps();
}
me.typeCTSLabel = e;
me.TD(me, 1, wgt, e = makeXonoticTextLabel(0, "Nexball"));
me.typeNexballLabel = e;
+ me.TD(me, 1, wgt, e = makeXonoticTextLabel(0, "Freezetag"));
+ me.typeFreezetagLabel = e;
+ me.TD(me, 1, wgt, e = makeXonoticTextLabel(0, "Keepaway"));
+ me.typeKeepawayLabel = e;
me.gotoRC(me, me.rows - 2, 0);
me.TD(me, 1, me.columns, e = makeXonoticTextLabel(0.5, ""));
me.TDempty(me, 0.2);
me.TD(me, 1, 2.8/2, e = makeXonoticTextLabel(0, "Accelerometer scale:"));
setDependent(e, "cl_showacceleration", 1, 1);
- me.TD(me, 1, 2.8/2, e = makeXonoticSlider(1, 10, 0.5, "cl_showacceleration_scale"));
+ me.TD(me, 1, 2.8/2, e = makeXonoticSlider(0.2, 2, 0.2, "cl_showacceleration_scale"));
setDependent(e, "cl_showacceleration", 1, 1);
me.TR(me);
me.TR(me);
float _Nex_ExtResponseSystem_Queried;
string _Nex_ExtResponseSystem_UpdateTo;
-float URI_GET_DISCARD = 0;
-
-float URI_GET_UPDATENOTIFICATION = 1;
-void UpdateNotification_URI_Get_Callback(float id, float status, string data);
-
void URI_Get_Callback(float id, float status, string data)
{
if (id == URI_GET_DISCARD)
}
else if(id == URI_GET_UPDATENOTIFICATION)
{
- // online ban list
UpdateNotification_URI_Get_Callback(id, status, data);
}
+ else if(id >= URI_GET_CURL && id <= URI_GET_CURL_END)
+ {
+ Curl_URI_Get_Callback(id, status, data);
+ }
else
{
print("Received HTTP request data for an invalid id ", ftos(id), ".\n");
{
_Nex_ExtResponseSystem_Queried = 1;
uri_get(sprintf("http://www.xonotic.org/dl/checkupdate.txt?version=%s", uri_escape(cvar_string("g_xonoticversion"))), URI_GET_UPDATENOTIFICATION);
+ //crypto_uri_postbuf(sprintf("http://www.xonotic.org/dl/t/checkupdate2.cgi?version=%s", uri_escape(cvar_string("g_xonoticversion"))), URI_GET_UPDATENOTIFICATION, "application/x-www-urlencoded", "hello=world&foo=bar", -1, 0);
}
}
string resolvemod(string m);
string HUD_Panel_GetSettingName(float setting);
+
+float URI_GET_DISCARD = 0;
+
+float URI_GET_UPDATENOTIFICATION = 1;
+void UpdateNotification_URI_Get_Callback(float id, float status, string data);
+
+float URI_GET_CURL = 2;
+float URI_GET_CURL_END = 9;
+void Curl_URI_Get_Callback(float id, float status, string data);
+
+void URI_Get_Callback(float id, float status, string data);
float accuracy_byte(float n, float d)
{
- print(sprintf("accuracy: %d / %d\n", n, d));
+ //print(sprintf("accuracy: %d / %d\n", n, d));
if(n <= 0)
return 0;
if(n > d)
void assault_objective_reset();
void target_assault_roundend_reset();
+float next_round;
+float stopalivecheck;
+float redalive, bluealive, yellowalive, pinkalive;
+float totalalive;
+.float redalive_stat, bluealive_stat, yellowalive_stat, pinkalive_stat;
+float redspawned, bluespawned, yellowspawned, pinkspawned;
+float totalspawned;
+
/**
* Resets the state of all clients, items, flags, runes, keys, weapons, waypoints, ... of the map.
* Sets the 'warmup' global variable.
warmup = time + cvar("g_ca_warmup");
allowed_to_spawn = 1;
}
+ else if(g_freezetag)
+ {
+ warmup = time + cvar("g_freezetag_warmup");
+ }
lms_lowest_lives = 999;
lms_next_place = player_count;
race_ReadyRestart();
for(self = world; (self = nextent(self)); )
- if(clienttype(self) == CLIENTTYPE_NOTACLIENT)
+ if(clienttype(self) == CLIENTTYPE_NOTACLIENT && self.items != IT_STRENGTH && self.items != IT_INVINCIBLE) // don't respawn strength or shield, that will only lead to them spawning very early each match
{
if(self.reset)
{
self.classname = "player";
PutClientInServer();
}
+ else if(g_freezetag)
+ {
+ if(self.classname == "player")
+ PutClientInServer();
+ }
else
{
/*
{
float f;
string msg;
+ entity e;
- if((!g_arena && !g_ca) || (g_arena && !arena_roundbased) || (time < game_starttime))
+ if((!g_arena && !g_ca && !g_freezetag) || (g_arena && !arena_roundbased) || (time < game_starttime))
return;
f = ceil(warmup - time);
else if(f == 1)
Announce("1");
- centerprint(self, msg);
+ FOR_EACH_PLAYER(e)
+ centerprint(e, msg);
}
if (g_arena) {
if(g_ca) {
ca_players = 0;
- FOR_EACH_PLAYER(self)
+ FOR_EACH_PLAYER(e)
ca_players += 1;
}
+
+ if(self.classname == "player" && self.health > 0 && self.movetype == MOVETYPE_NONE)
+ self.movetype = MOVETYPE_WALK;
+ }
+}
+
+void count_spawned_players()
+{
+ // TODO fix "*spawned" name, it should rather be "*players" or so
+ // not doing this now to prevent merge hell with Tag
+ // fix after merging with Tag
+
+ // count amount of players in each team
+ totalspawned = redspawned = bluespawned = yellowspawned = pinkspawned = 0;
+ FOR_EACH_PLAYER(self) {
+ if (self.team == COLOR_TEAM1)
+ {
+ redspawned += 1;
+ totalspawned += 1;
+ }
+ else if (self.team == COLOR_TEAM2)
+ {
+ bluespawned += 1;
+ totalspawned += 1;
+ }
+ else if (self.team == COLOR_TEAM3)
+ {
+ yellowspawned += 1;
+ totalspawned += 1;
+ }
+ else if (self.team == COLOR_TEAM4)
+ {
+ pinkspawned += 1;
+ totalspawned += 1;
+ }
+ }
+}
+
+void count_alive_players()
+{
+ totalalive = redalive = bluealive = yellowalive = pinkalive = 0;
+ if(g_ca)
+ {
+ FOR_EACH_PLAYER(self) {
+ if (self.team == COLOR_TEAM1 && self.health >= 1)
+ {
+ redalive += 1;
+ totalalive += 1;
+ }
+ else if (self.team == COLOR_TEAM2 && self.health >= 1)
+ {
+ bluealive += 1;
+ totalalive += 1;
+ }
+ }
+ FOR_EACH_PLAYER(self) {
+ self.redalive_stat = redalive;
+ self.bluealive_stat = bluealive;
+ }
+ }
+ else if(g_freezetag)
+ {
+ // count amount of alive players in each team
+ FOR_EACH_PLAYER(self) {
+ if (self.team == COLOR_TEAM1 && self.freezetag_frozen == 0 && self.health >= 1)
+ {
+ redalive += 1;
+ totalalive += 1;
+ }
+ else if (self.team == COLOR_TEAM2 && self.freezetag_frozen == 0 && self.health >= 1)
+ {
+ bluealive += 1;
+ totalalive += 1;
+ }
+ else if (self.team == COLOR_TEAM3 && self.freezetag_frozen == 0 && self.health >= 1)
+ {
+ yellowalive += 1;
+ totalalive += 1;
+ }
+ else if (self.team == COLOR_TEAM4 && self.freezetag_frozen == 0 && self.health >= 1)
+ {
+ pinkalive += 1;
+ totalalive += 1;
+ }
+ }
+ FOR_EACH_PLAYER(self) {
+ self.redalive_stat = redalive;
+ self.bluealive_stat = bluealive;
+ self.yellowalive_stat = yellowalive;
+ self.pinkalive_stat = pinkalive;
+ }
}
- if(self.classname == "player" && self.health > 0)
- self.movetype = MOVETYPE_WALK;
}
-float next_round;
-float stopalivecheck;
-float redalive, bluealive;
-.float redalive_stat, bluealive_stat;
/**
* This function finds out whether an arena round is over 1 player is left.
* It determines the last player who's still alive and saves it's entity reference
*/
void Spawnqueue_Check()
{
- if(g_ca) // we want to perform this before the return block below...
+ count_spawned_players();
+ if(g_ca || g_freezetag) // we want to perform this before the return block below (CA)...
{
- // this is STUPID to perform again, but has to be done so that we can give instant feedback when a round ends
- // and so the code won't start searching for a champion using find() before all players are actually REMOVED
- redalive = 0; bluealive = 0;
- FOR_EACH_PLAYER(self) {
- if (self.team == COLOR_TEAM1 && self.health >= 1) redalive += 1;
- else if (self.team == COLOR_TEAM2 && self.health >= 1) bluealive += 1;
- }
- // as if the above stuff wasn't stupid enough, let's run it a third time! :D
- // (so that we can send redalive/bluealive as a stat)
- FOR_EACH_PLAYER(self) {
- self.redalive_stat = redalive;
- self.bluealive_stat = bluealive;
- }
+ count_alive_players();
}
- if(time < warmup + 1 || inWarmupStage)
+ if(time < warmup + 1 || inWarmupStage || intermission_running)
return;
if(g_ca) {
- // check the amount of spawned players in each team
- float redspawned, bluespawned;
- FOR_EACH_PLAYER(self) {
- if (self.team == COLOR_TEAM1) redspawned += 1;
- else if (self.team == COLOR_TEAM2) bluespawned += 1;
- }
-
required_ca_players = max(2, fabs(cvar("bot_vs_human") + 1));
if(ca_players < required_ca_players && (redspawned && bluespawned)) {
next_round = 0;
reset_map(TRUE);
}
+ } else if(g_freezetag) {
+ if((next_round && next_round < time))
+ {
+ next_round = 0;
+ reset_map(TRUE);
+ }
} else { // arena
//extend next_round if it isn't set yet and only 1 player is spawned
if(!next_round)
oldself = self;
self = oldself.enemy;
+ if(self.message)
+ {
+ entity player;
+ string s;
+ FOR_EACH_PLAYER(player)
+ {
+ s = strcat(self.message, "\n");
+ centerprint(player, s);
+ }
+ }
+
oldactivator = activator;
activator = oldself;
SUB_UseTargets();
return FALSE;
}
+ if(g_freezetag)
+ if(e.freezetag_frozen)
+ return FALSE;
+
if(teams_matter)
{
if(e.team==0)
}
};
+// Keepaway
+// If you don't have the ball, get it; if you do, kill people.
+void havocbot_role_ka()
+{
+ if(self.deadflag != DEAD_NO)
+ return;
+
+ if (self.bot_strategytime < time)
+ {
+ self.bot_strategytime = time + cvar("bot_ai_strategyinterval");
+ navigation_goalrating_start();
+ havocbot_goalrating_items(10000, self.origin, 10000);
+ havocbot_goalrating_enemyplayers(20000, self.origin, 10000);
+ //havocbot_goalrating_waypoints(1, self.origin, 1000);
+ navigation_goalrating_end();
+ }
+}
+
void havocbot_chooserole_dm()
{
self.havocbot_role = havocbot_role_dm;
self.havocbot_role = havocbot_role_dom;
};
+void havocbot_chooserole_ka()
+{
+ self.havocbot_role = havocbot_role_ka;
+}
+
void havocbot_chooserole()
{
dprint("choosing a role...\n");
havocbot_chooserole_race();
else if (g_onslaught)
havocbot_chooserole_ons();
+ else if (g_keepaway)
+ havocbot_chooserole_ka();
else // assume anything else is deathmatch
havocbot_chooserole_dm();
};
// arguments:
// effectname
effectnum = particleeffectnum(argv(1));
- W_SetupShot(self, FALSE, FALSE, "",0);
+ W_SetupShot(self, FALSE, FALSE, "", CHAN_WEAPON, 0);
traceline(w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, MOVE_NORMAL, self);
trailparticles(self, effectnum, w_shotorg, trace_endpos);
DID_CHEAT();
// arguments:
// modelname mode
f = stof(argv(2));
- W_SetupShot(self, FALSE, FALSE, "", 0);
+ W_SetupShot(self, FALSE, FALSE, "", CHAN_WEAPON, 0);
traceline(w_shotorg, w_shotorg + w_shotdir * 2048, MOVE_NORMAL, self);
if((trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT) || trace_fraction == 1)
{
Portal_ClearAll(self);
+ if(self.alivetime)
+ {
+ PlayerStats_Event(self, PLAYERSTATS_ALIVETIME, time - self.alivetime);
+ self.alivetime = 0;
+ }
+
if(self.flagcarried)
DropFlag(self.flagcarried, world, world);
- if(self.ballcarried)
+ if(self.ballcarried && g_nexball)
DropBall(self.ballcarried, self.origin + self.ballcarried.origin, self.velocity);
WaypointSprite_PlayerDead();
self.switchweapon = w_getbestweapon(self);
self.cnt = self.switchweapon;
self.weapon = 0;
+
+ if(!self.alivetime)
+ self.alivetime = time;
} else if(self.classname == "observer" || (g_ca && !allowed_to_spawn)) {
PutObserverInServer ();
}
{
// do nothing
}
+ else if(g_freezetag && self.freezetag_frozen == 1)
+ {
+ // do nothing
+ }
else
ClientKill_TeamChange(0);
}
send_CSQC_cr_maxbullets(self);
CheatInitClient();
+
+ PlayerStats_AddPlayer(self);
}
/*
return;
}
+ PlayerStats_AddGlobalInfo(self);
+
CheatShutdownClient();
if(self.hitplotfh >= 0)
if(self.flagcarried)
DropFlag(self.flagcarried, world, world);
- if(self.ballcarried)
+ if(self.ballcarried && g_nexball)
DropBall(self.ballcarried, self.origin + self.ballcarried.origin, self.velocity);
// Here, everything has been done that requires this player to be a client.
void player_powerups (void)
{
+ // add a way to see what the items were BEFORE all of these checks for the mutator hook
+ olditems = self.items;
+
if((self.items & IT_USING_JETPACK) && !self.deadflag)
{
SoundEntity_StartSound(self, CHAN_PLAYER, "misc/jetpack_fly.wav", VOL_BASE, cvar("g_jetpack_attenuation"));
sprint(self, "^3You are on speed\n");
}
}
- return;
}
-
- if (self.items & IT_STRENGTH)
+ else // if we're not in minstagib, continue. I added this else to replace the "return" which was here that broke the callhook for this function -- This code is nasty.
{
- play_countdown(self.strength_finished, "misc/poweroff.wav");
- self.effects = self.effects | (EF_BLUE | EF_ADDITIVE | EF_FULLBRIGHT);
- if (time > self.strength_finished && cvar("g_balance_powerup_timer"))
+ if (self.items & IT_STRENGTH)
{
- self.items = self.items - (self.items & IT_STRENGTH);
- sprint(self, "^3Strength has worn off\n");
+ play_countdown(self.strength_finished, "misc/poweroff.wav");
+ self.effects = self.effects | (EF_BLUE | EF_ADDITIVE | EF_FULLBRIGHT);
+ if (time > self.strength_finished && cvar("g_balance_powerup_timer"))
+ {
+ self.items = self.items - (self.items & IT_STRENGTH);
+ sprint(self, "^3Strength has worn off\n");
+ }
}
- }
- else
- {
- if (time < self.strength_finished)
+ else
{
- self.items = self.items | IT_STRENGTH;
- sprint(self, "^3Strength infuses your weapons with devastating power\n");
+ if (time < self.strength_finished)
+ {
+ self.items = self.items | IT_STRENGTH;
+ sprint(self, "^3Strength infuses your weapons with devastating power\n");
+ }
}
- }
- if (self.items & IT_INVINCIBLE)
- {
- play_countdown(self.invincible_finished, "misc/poweroff.wav");
- self.effects = self.effects | (EF_RED | EF_ADDITIVE | EF_FULLBRIGHT);
- if (time > self.invincible_finished && cvar("g_balance_powerup_timer"))
+ if (self.items & IT_INVINCIBLE)
{
- self.items = self.items - (self.items & IT_INVINCIBLE);
- sprint(self, "^3Shield has worn off\n");
+ play_countdown(self.invincible_finished, "misc/poweroff.wav");
+ self.effects = self.effects | (EF_RED | EF_ADDITIVE | EF_FULLBRIGHT);
+ if (time > self.invincible_finished && cvar("g_balance_powerup_timer"))
+ {
+ self.items = self.items - (self.items & IT_INVINCIBLE);
+ sprint(self, "^3Shield has worn off\n");
+ }
}
- }
- else
- {
- if (time < self.invincible_finished)
+ else
{
- self.items = self.items | IT_INVINCIBLE;
- sprint(self, "^3Shield surrounds you\n");
+ if (time < self.invincible_finished)
+ {
+ self.items = self.items | IT_INVINCIBLE;
+ sprint(self, "^3Shield surrounds you\n");
+ }
}
- }
- if(cvar("g_nodepthtestplayers"))
- self.effects = self.effects | EF_NODEPTHTEST;
+ if(cvar("g_nodepthtestplayers"))
+ self.effects = self.effects | EF_NODEPTHTEST;
- if(cvar("g_fullbrightplayers"))
- self.effects = self.effects | EF_FULLBRIGHT;
+ if(cvar("g_fullbrightplayers"))
+ self.effects = self.effects | EF_FULLBRIGHT;
- // midair gamemode: damage only while in the air
- // if in midair mode, being on ground grants temporary invulnerability
- // (this is so that multishot weapon don't clear the ground flag on the
- // first damage in the frame, leaving the player vulnerable to the
- // remaining hits in the same frame)
- if (self.flags & FL_ONGROUND)
- if (g_midair)
- self.spawnshieldtime = max(self.spawnshieldtime, time + cvar("g_midair_shieldtime"));
+ // midair gamemode: damage only while in the air
+ // if in midair mode, being on ground grants temporary invulnerability
+ // (this is so that multishot weapon don't clear the ground flag on the
+ // first damage in the frame, leaving the player vulnerable to the
+ // remaining hits in the same frame)
+ if (self.flags & FL_ONGROUND)
+ if (g_midair)
+ self.spawnshieldtime = max(self.spawnshieldtime, time + cvar("g_midair_shieldtime"));
- if (time >= game_starttime)
- if (time < self.spawnshieldtime)
- self.effects = self.effects | (EF_ADDITIVE | EF_FULLBRIGHT);
+ if (time >= game_starttime)
+ if (time < self.spawnshieldtime)
+ self.effects = self.effects | (EF_ADDITIVE | EF_FULLBRIGHT);
+ }
+
+ MUTATOR_CALLHOOK(PlayerPowerups);
}
float CalcRegen(float current, float stable, float regenfactor, float regenframetime)
*/
void PlayerJump (void)
{
+ if(g_freezetag && self.freezetag_frozen)
+ return; // no jumping in freezetag when frozen
+
float mjumpheight;
float doublejump;
maxspd_mod = 1;
if(g_minstagib && (self.items & IT_INVINCIBLE))
maxspd_mod *= cvar("g_minstagib_speed_highspeed");
- if(g_nexball && self.ballcarried)
- maxspd_mod *= cvar("g_nexball_basketball_carrier_highspeed");
+ if(self.ballcarried)
+ if(g_nexball)
+ maxspd_mod *= cvar("g_nexball_basketball_carrier_highspeed");
+ else if(g_keepaway)
+ maxspd_mod *= cvar("g_keepaway_ballcarrier_highspeed");
+
if(g_runematch)
{
if(self.runes & RUNE_SPEED)
}
void ClientKill_Now_TeamChange();
+void freezetag_CheckWinner();
+void freezetag_Unfreeze();
void PlayerDamage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
{
damage_take = take;
damage_save = save;
damage_force = force;
- MUTATOR_CALLHOOK(PlayerDamage);
+ MUTATOR_CALLHOOK(PlayerDamage_SplitHealthArmor);
take = bound(0, damage_take, self.health);
save = bound(0, damage_save, self.armorvalue);
float defer_ClientKill_Now_TeamChange;
defer_ClientKill_Now_TeamChange = FALSE;
+ if(self.alivetime)
+ {
+ PlayerStats_Event(self, PLAYERSTATS_ALIVETIME, time - self.alivetime);
+ self.alivetime = 0;
+ }
+
if(valid_damage_for_weaponstats)
WeaponStats_LogKill(DEATH_WEAPONOF(deathtype), self.weapon);
}
}
- // become fully visible
- self.alpha = 1;
- // clear selected player display
- ClearSelectedPlayer();
- // throw a weapon
- SpawnThrownWeapon (self.origin + (self.mins + self.maxs) * 0.5, self.switchweapon);
+ if(!g_freezetag)
+ {
+ // become fully visible
+ self.alpha = 1;
+ // clear selected player display
+ ClearSelectedPlayer();
+ // throw a weapon
+ SpawnThrownWeapon (self.origin + (self.mins + self.maxs) * 0.5, self.switchweapon);
+ }
+
// print an obituary message
Obituary (attacker, inflictor, self, deathtype);
race_PreDie();
DropAllRunes(self);
+ if(deathtype == DEATH_HURTTRIGGER && g_freezetag)
+ {
+ PutClientInServer();
+ count_alive_players(); // re-count players
+ freezetag_CheckWinner();
+ return;
+ }
+
frag_attacker = attacker;
frag_inflictor = inflictor;
frag_target = self;
MUTATOR_CALLHOOK(PlayerDies);
+ if(g_freezetag)
+ return;
+
if(self.flagcarried)
{
if(attacker.classname != "player" && attacker.classname != "gib")
else
DropFlag(self.flagcarried, world, attacker);
}
- if(self.ballcarried)
+ if(self.ballcarried && g_nexball)
DropBall(self.ballcarried, self.origin, self.velocity);
Portal_ClearAllLater(self);
// clear waypoints
if (frametime)
self.weapon_frametime = frametime;
- if(((arena_roundbased || g_ca) && time < warmup) || ((time < game_starttime) && !cvar("sv_ready_restart_after_countdown")))
+ if(((arena_roundbased || g_ca || g_freezetag) && time < warmup) || ((time < game_starttime) && !cvar("sv_ready_restart_after_countdown")))
+ return;
+
+ if(g_freezetag && self.freezetag_frozen == 1)
return;
if (!self.weaponentity || self.health < 1)
// make sure you call makevectors first (FIXME?)
.float prevstrengthsound;
.float prevstrengthsoundattempt;
-void W_SetupShot_Dir_ProjectileSize_Range(entity ent, vector s_forward, vector mi, vector ma, float antilag, float recoil, string snd, float maxdamage, float range)
+void W_SetupShot_Dir_ProjectileSize_Range(entity ent, vector s_forward, vector mi, vector ma, float antilag, float recoil, string snd, float chan, float maxdamage, float range)
{
float nudge = 1; // added to traceline target and subtracted from result
local float oldsolid;
ent.punchangle_x = recoil * -1;
if (snd != "")
- sound (ent, CHAN_WEAPON, snd, VOL_BASE, ATTN_NORM);
+ sound (ent, chan, snd, VOL_BASE, ATTN_NORM);
if(ent.items & IT_STRENGTH)
if(!g_minstagib)
w_shotend = w_shotend + normalize(w_shotend - w_shotorg) * nudge;
};
-#define W_SetupShot_Dir_ProjectileSize(ent,s_forward,mi,ma,antilag,recoil,snd,maxdamage) W_SetupShot_Dir_ProjectileSize_Range(ent, s_forward, mi, ma, antilag, recoil, snd, maxdamage, MAX_SHOT_DISTANCE)
-#define W_SetupShot_ProjectileSize(ent,mi,ma,antilag,recoil,snd,maxdamage) W_SetupShot_Dir_ProjectileSize(ent, v_forward, mi, ma, antilag, recoil, snd, maxdamage)
-#define W_SetupShot_Dir(ent,s_forward,antilag,recoil,snd,maxdamage) W_SetupShot_Dir_ProjectileSize(ent, s_forward, '0 0 0', '0 0 0', antilag, recoil, snd, maxdamage)
-#define W_SetupShot(ent,antilag,recoil,snd,maxdamage) W_SetupShot_ProjectileSize(ent, '0 0 0', '0 0 0', antilag, recoil, snd, maxdamage)
-#define W_SetupShot_Range(ent,antilag,recoil,snd,maxdamage,range) W_SetupShot_Dir_ProjectileSize_Range(ent, v_forward, '0 0 0', '0 0 0', antilag, recoil, snd, maxdamage, range)
+#define W_SetupShot_Dir_ProjectileSize(ent,s_forward,mi,ma,antilag,recoil,snd,chan,maxdamage) W_SetupShot_Dir_ProjectileSize_Range(ent, s_forward, mi, ma, antilag, recoil, snd, chan, maxdamage, MAX_SHOT_DISTANCE)
+#define W_SetupShot_ProjectileSize(ent,mi,ma,antilag,recoil,snd,chan,maxdamage) W_SetupShot_Dir_ProjectileSize(ent, v_forward, mi, ma, antilag, recoil, snd, chan, maxdamage)
+#define W_SetupShot_Dir(ent,s_forward,antilag,recoil,snd,chan,maxdamage) W_SetupShot_Dir_ProjectileSize(ent, s_forward, '0 0 0', '0 0 0', antilag, recoil, snd, chan, maxdamage)
+#define W_SetupShot(ent,antilag,recoil,snd,chan,maxdamage) W_SetupShot_ProjectileSize(ent, '0 0 0', '0 0 0', antilag, recoil, snd, chan, maxdamage)
+#define W_SetupShot_Range(ent,antilag,recoil,snd,chan,maxdamage,range) W_SetupShot_Dir_ProjectileSize_Range(ent, v_forward, '0 0 0', '0 0 0', antilag, recoil, snd, chan, maxdamage, range)
float CL_Weaponentity_CustomizeEntityForClient()
{
if(self.classname == "player" && cvar("sv_spectate") == 1) {
if(self.flagcarried)
DropFlag(self.flagcarried, world, world);
- if(self.ballcarried)
+ if(self.ballcarried && g_nexball)
DropBall(self.ballcarried, self.origin, self.velocity);
WaypointSprite_PlayerDead();
self.classname = "observer";
return;
}
- if(!self.t_width)
- self.t_width = 0.1; // frame animation rate
- if(!self.t_length)
- self.t_length = 58; // maximum frame
-
setattachment(self, world, "");
self.mdl = self.model;
self.flags = FL_ITEM;
dprint("FLAG FALLTHROUGH will happen SOON\n");
};
-void AnimateFlag()
-{
- if(self.delay > time)
- return;
- self.delay = time + self.t_width;
- if(self.nextthink > self.delay)
- self.nextthink = self.delay;
-
- self.frame = self.frame + 1;
- if(self.frame > self.t_length)
- self.frame = 0;
-}
-
void FlagThink()
{
local entity e;
ctf_captureshield_update(e, 1); // release shield only
}
- AnimateFlag();
-
if(self.speedrunning)
if(self.cnt == FLAG_CARRY)
{
float ctf_score_value(string parameter);
-float g_dm, g_domination, g_ctf, g_tdm, g_keyhunt, g_onslaught, g_assault, g_arena, g_ca, g_lms, g_runematch, g_race, g_nexball, g_cts;
+float g_dm, g_domination, g_ctf, g_tdm, g_keyhunt, g_onslaught, g_assault, g_arena, g_ca, g_lms, g_runematch, g_race, g_nexball, g_cts, g_freezetag, g_keepaway;
float g_cloaked, g_footsteps, g_jump_grunt, g_grappling_hook, g_midair, g_minstagib, g_pinata, g_norecoil, g_minstagib_invis_alpha, g_bloodloss;
float g_warmup_limit;
float g_warmup_allguns;
void checkSpectatorBlock();
.float winning;
-.float jointime;
+.float jointime; // time of joining
+.float alivetime; // time of being alive
float isJoinAllowed();
#define PREVENT_JOIN_TEXT "^1You may not join the game at this time.\n\nThe player limit reached maximum capacity."
.string target4;
.float trigger_reverse;
-// Nexball
-.entity ballcarried;
+// Nexball
+.entity ballcarried; // Also used for keepaway
.float metertime;
float g_nexball_meter_period;
float serverflags;
.float team_forced; // can be a team number to force a team, or 0 for default action, or -1 for forced spectator
+
+.float freezetag_frozen;
+.float freezetag_beginrevive_time;
+.float freezetag_revive_progress;
{
// teamkill
PlayerScore_Add(attacker, SP_KILLS, -1); // or maybe add a teamkills field?
+ PlayerStats_Event(attacker, PLAYERSTATS_KILLS, -1);
}
}
else
{
// regular frag
PlayerScore_Add(attacker, SP_KILLS, 1);
+ PlayerStats_Event(attacker, PLAYERSTATS_KILLS, 1);
}
PlayerScore_Add(targ, SP_DEATHS, 1);
force = force * g_weaponforcefactor;
mirrorforce *= g_weaponforcefactor;
}
-
+
+ // should this be changed at all? If so, in what way?
+ frag_attacker = attacker;
+ frag_target = targ;
+ frag_damage = damage;
+ frag_force = force;
+ frag_deathtype = deathtype;
+ MUTATOR_CALLHOOK(PlayerDamage_Calculate);
+ damage = frag_damage;
+ force = frag_force;
+
// apply strength multiplier
if ((attacker.items & IT_STRENGTH) && !g_minstagib)
{
BADCVAR("g_runematch");
BADCVAR("g_tdm");
BADCVAR("g_nexball");
+ BADCVAR("g_keepaway");
BADCVAR("teamplay");
// long
addstat(STAT_NEX_CHARGE, AS_FLOAT, nex_charge);
addstat(STAT_NEX_CHARGEPOOL, AS_FLOAT, nex_charge_pool_ammo);
- if(g_ca)
+ if(g_ca || g_freezetag)
{
addstat(STAT_REDALIVE, AS_INT, redalive_stat);
addstat(STAT_BLUEALIVE, AS_INT, bluealive_stat);
+ addstat(STAT_YELLOWALIVE, AS_INT, yellowalive_stat);
+ addstat(STAT_PINKALIVE, AS_INT, pinkalive_stat);
}
+ if(g_freezetag)
+ {
+ addstat(STAT_FROZEN, AS_INT, freezetag_frozen);
+ addstat(STAT_REVIVE_PROGRESS, AS_FLOAT, freezetag_revive_progress);
+ }
+
// g_movementspeed hack
addstat(STAT_MOVEVARS_AIRSPEEDLIMIT_NONQW, AS_FLOAT, stat_sv_airspeedlimit_nonqw);
addstat(STAT_MOVEVARS_MAXSPEED, AS_FLOAT, stat_sv_maxspeed);
cvar_set("sv_curl_serverpackages", substring(s, 1, -1));
}
+ PlayerStats_Init();
+
world_initialized = 1;
}
void DumpStats(float final)
{
- local float file;
- local string s;
- local float to_console;
- local float to_eventlog;
- local float to_file;
- local float i;
+ float file;
+ string s;
+ float to_console;
+ float to_eventlog;
+ float to_file;
+ float i;
+ entity e;
to_console = cvar("sv_logscores_console");
to_eventlog = cvar("sv_eventlog");
fputs(file, ":end\n");
fclose(file);
}
+
+ // send statistics
+ FOR_EACH_CLIENT(e)
+ PlayerStats_AddGlobalInfo(e);
+ PlayerStats_Shutdown();
}
void FixIntermissionClient(entity e)
if(mapvote_run)
return;
+ // wait for stats to be sent first
+ if(!playerstats_waitforme)
+ return;
+
MapInfo_Enumerate();
if(MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags(), 1))
mapvote_run = TRUE;
void SV_Shutdown()
{
+ entity e;
+
if(gameover > 1) // shutting down already?
return;
world_initialized = 0;
print("Saving persistent data...\n");
Ban_SaveBans();
+
+ FOR_EACH_CLIENT(e)
+ PlayerStats_AddGlobalInfo(e);
+ PlayerStats_Shutdown();
+
if(!cheatcount_total)
{
if(cvar("sv_db_saveasdump"))
}
#define PROJECTILE_TOUCH if(WarpZone_Projectile_Touch()) return
-float MAX_IPBAN_URIS = 16;
-
-float URI_GET_DISCARD = 0;
-float URI_GET_IPBAN = 1;
-float URI_GET_IPBAN_END = 16;
+float MAX_IPBAN_URIS = 16;
+
+float URI_GET_DISCARD = 0;
+float URI_GET_IPBAN = 1;
+float URI_GET_IPBAN_END = 16;
+float URI_GET_PLAYERSTATS_SENT = 17;
void URI_Get_Callback(float id, float status, string data)
{
// online ban list
OnlineBanList_URI_Get_Callback(id, status, data);
}
+ else if (id == URI_GET_PLAYERSTATS_SENT)
+ {
+ PlayerStats_Sent_URI_Get_Callback(id, status, data);
+ }
else
{
print("Received HTTP request data for an invalid id ", ftos(id), ".\n");
entity self;
entity other;
-MUTATOR_HOOKABLE(PlayerDamage);
+MUTATOR_HOOKABLE(PlayerDamage_SplitHealthArmor);
// called when a player gets damaged to e.g. remove stuff he was carrying.
// INPUT:
entity frag_inflictor;
entity frag_attacker;
entity frag_target; // same as self
- vector damage_force; // NOTE: this force already HAS been applied (create and use a Damage hook to change that one)
+ vector damage_force; // NOTE: this force already HAS been applied
// INPUT, OUTPUT:
float damage_take;
float damage_save;
+
+MUTATOR_HOOKABLE(PlayerDamage_Calculate);
+ // called to adjust damage and force values which are applied to the player, used for e.g. strength damage/force multiplier or runematch runes
+ // i'm not sure if I should change this around slightly (Naming of the entities, and also how they're done in g_damage).
+ // INPUT:
+ entity frag_attacker;
+ entity frag_target;
+ float frag_deathtype;
+ // INPUT, OUTPUT:
+ float frag_damage;
+ vector frag_force;
+
+MUTATOR_HOOKABLE(PlayerPowerups);
+ // called at the end of player_powerups() in cl_client.qc, used for manipulating the values which are set by powerup items.
+ // INPUT
+ entity self;
+ float olditems; // also technically output, but since it is at the end of the function it's useless for that :P
--- /dev/null
+void freezetag_Initialize()
+{
+ precache_model("models/ice/ice.md3");
+ warmup = time + cvar("g_start_delay") + cvar("g_freezetag_warmup");
+}
+
+void freezetag_CheckWinner()
+{
+ if(time <= game_starttime) // game didn't even start yet! nobody can win in that case.
+ return;
+
+ if(next_round || (time > warmup - cvar("g_freezetag_warmup") && time < warmup))
+ return; // already waiting for next round to start
+
+ if((redalive >= 1 && bluealive >= 1) // counted in arena.qc
+ || (redalive >= 1 && yellowalive >= 1)
+ || (redalive >= 1 && pinkalive >= 1)
+ || (bluealive >= 1 && yellowalive >= 1)
+ || (bluealive >= 1 && pinkalive >= 1)
+ || (yellowalive >= 1 && pinkalive >= 1))
+ return; // we still have active players on two or more teams, nobody won yet
+
+ entity e, winner;
+ string teamname;
+
+ FOR_EACH_PLAYER(e)
+ {
+ if(e.freezetag_frozen == 0 && e.classname == "player" && e.health >= 1) // here's one player from the winning team... good
+ {
+ winner = e;
+ break; // break, we found the winner
+ }
+ }
+
+ if(winner != world) // just in case a winner wasn't found
+ {
+ TeamScore_AddToTeam(winner.team, ST_SCORE, +1);
+ if(winner.team == COLOR_TEAM1)
+ teamname = "^1Red Team";
+ else if(winner.team == COLOR_TEAM2)
+ teamname = "^4Blue Team";
+ else if(winner.team == COLOR_TEAM3)
+ teamname = "^3Yellow Team";
+ else
+ teamname = "^6Pink Team";
+ FOR_EACH_PLAYER(e) {
+ centerprint(e, strcat(teamname, "^5 wins the round, all other teams were frozen.\n"));
+ }
+ bprint(teamname, "^5 wins the round since all the other teams were frozen.\n");
+ }
+
+ next_round = time + 5;
+}
+
+void freezetag_Ice_Think()
+{
+ setorigin(self, self.owner.origin - '0 0 16');
+ self.nextthink = time;
+}
+
+void freezetag_Freeze()
+{
+ self.freezetag_frozen = 1;
+
+ entity ice;
+ ice = spawn();
+ ice.owner = self;
+ ice.classname = "freezetag_ice";
+ ice.think = freezetag_Ice_Think;
+ ice.nextthink = time;
+ ice.frame = floor(random() * 21); // ice model has 20 different looking frames
+ setmodel(ice, "models/ice/ice.md3");
+
+ self.movement = '0 0 0';
+
+ // add waypoint
+ WaypointSprite_Spawn("freezetag_frozen", 0, 0, self, '0 0 64', world, self.team, self, waypointsprite_attached, TRUE);
+ if(self.waypointsprite_attached)
+ {
+ WaypointSprite_UpdateTeamRadar(self.waypointsprite_attached, RADARICON_WAYPOINT, '0.25 0.90 1');
+ }
+}
+
+void freezetag_Unfreeze()
+{
+ self.freezetag_frozen = 0;
+
+ // remove the ice block
+ entity ice;
+ for(ice = world; (ice = find(ice, classname, "freezetag_ice")); ) if(ice.owner == self)
+ {
+ remove(ice);
+ break;
+ }
+
+ // remove waypoint
+ if(self.waypointsprite_attached)
+ WaypointSprite_Kill(self.waypointsprite_attached);
+}
+
+MUTATOR_HOOKFUNCTION(freezetag_RemovePlayer)
+{
+ if(self.freezetag_frozen == 0)
+ {
+ if(self.team == COLOR_TEAM1)
+ --redalive;
+ else if(self.team == COLOR_TEAM2)
+ --bluealive;
+ else if(self.team == COLOR_TEAM3)
+ --yellowalive;
+ else if(self.team == COLOR_TEAM4)
+ --pinkalive;
+ --totalalive;
+ }
+
+ if(totalspawned > 2) // only check for winners if we had more than two players (one of them left, don't let the other player win just because of that)
+ freezetag_CheckWinner();
+
+ freezetag_Unfreeze();
+
+ return 1;
+}
+
+MUTATOR_HOOKFUNCTION(freezetag_PlayerDies)
+{
+ if(self.freezetag_frozen == 0)
+ {
+ if(self.team == COLOR_TEAM1)
+ --redalive;
+ else if(self.team == COLOR_TEAM2)
+ --bluealive;
+ else if(self.team == COLOR_TEAM3)
+ --yellowalive;
+ else if(self.team == COLOR_TEAM4)
+ --pinkalive;
+ --totalalive;
+
+ freezetag_Freeze();
+ }
+
+ if(frag_attacker.classname == STR_PLAYER)
+ centerprint(frag_attacker, strcat("^2You froze ^7", frag_target.netname, ".\n"));
+
+ if(frag_attacker == frag_target || frag_attacker == world)
+ {
+ if(frag_target.classname == STR_PLAYER)
+ centerprint(frag_target, "^1You froze yourself.\n");
+ bprint("^7", frag_target.netname, "^1 froze himself.\n");
+ }
+ else
+ {
+ if(frag_target.classname == STR_PLAYER)
+ centerprint(frag_target, strcat("^1You were frozen by ^7", frag_attacker.netname, ".\n"));
+ bprint("^7", frag_target.netname, "^1 was frozen by ^7", frag_attacker.netname, ".\n");
+ }
+
+ frag_target.health = cvar("g_balance_health_start"); // "respawn" the player :P
+
+ freezetag_CheckWinner();
+
+ return 1;
+}
+
+MUTATOR_HOOKFUNCTION(freezetag_PlayerSpawn)
+{
+ freezetag_Unfreeze(); // start by making sure that all ice blocks are removed
+
+ if(totalspawned == 1 && time > game_starttime) // only one player active on server, start a new match immediately
+ if(!next_round && warmup && (time < warmup - cvar("g_freezetag_warmup") || time > warmup)) // not awaiting next round
+ {
+ next_round = time;
+ return 1;
+ }
+ if(warmup && time > warmup) // spawn too late, freeze player
+ {
+ centerprint(self, "^1You spawned after the round started, you'll spawn as frozen.\n");
+ freezetag_Freeze();
+ }
+
+ return 1;
+}
+
+MUTATOR_HOOKFUNCTION(freezetag_GiveFragsForKill)
+{
+ frag_score = 0; // no frags counted in Freeze Tag
+ return 1;
+}
+
+MUTATOR_HOOKFUNCTION(freezetag_PlayerPreThink)
+{
+ vector revive_extra_size;
+ revive_extra_size = '1 1 1' * cvar("g_freezetag_revive_extra_size");
+
+ float teammate_nearby;
+ FOR_EACH_PLAYER(other) if(self != other)
+ {
+ if(other.freezetag_frozen == 0)
+ {
+ if(other.team == self.team)
+ {
+ teammate_nearby = boxesoverlap(self.absmin - revive_extra_size, self.absmax + revive_extra_size, other.absmin, other.absmax);
+ if(teammate_nearby)
+ break;
+ }
+ }
+ }
+
+ if(teammate_nearby && self.freezetag_frozen == 1) // OK, there is at least one teammate reviving us
+ {
+ if(self.freezetag_beginrevive_time == -9999) // initialize values if this is the first frame of revival
+ {
+ self.freezetag_beginrevive_time = time;
+ self.freezetag_revive_progress = 0;
+ }
+ else
+ {
+ self.freezetag_revive_progress = (time - self.freezetag_beginrevive_time) / cvar("g_freezetag_revive_time");
+ if(time - self.freezetag_beginrevive_time >= cvar("g_freezetag_revive_time"))
+ {
+ freezetag_Unfreeze();
+
+ centerprint(self, strcat("^5You were revived by ^7", other.netname, ".\n"));
+ centerprint(other, strcat("^5You revived ^7", self.netname, ".\n"));
+ bprint("^7", other.netname, "^5 revived ^7", self.netname, ".\n");
+
+ self.freezetag_beginrevive_time = -9999;
+ self.freezetag_revive_progress = 0;
+ }
+ }
+ // now find EVERY teammate within reviving radius, set their revive_progress values correct
+ FOR_EACH_PLAYER(other) if(self != other)
+ {
+ if(other.freezetag_frozen == 0)
+ {
+ if(other.team == self.team)
+ {
+ teammate_nearby = boxesoverlap(self.absmin - revive_extra_size, self.absmax + revive_extra_size, other.absmin, other.absmax);
+ if(teammate_nearby)
+ other.freezetag_revive_progress = self.freezetag_revive_progress;
+ }
+ }
+ }
+ }
+ else if(!teammate_nearby) // only if no teammate is nearby will we reset
+ {
+ self.freezetag_beginrevive_time = -9999;
+ self.freezetag_revive_progress = 0;
+ }
+
+ return 1;
+}
+
+MUTATOR_HOOKFUNCTION(freezetag_PlayerPhysics)
+{
+ if(self.freezetag_frozen)
+ self.movement = '0 0 0';
+ return 1;
+}
+
+MUTATOR_HOOKFUNCTION(freezetag_PlayerDamage_Calculate)
+{
+ if(g_freezetag)
+ {
+ if(frag_target.freezetag_frozen == 1 && frag_deathtype != DEATH_HURTTRIGGER)
+ {
+ frag_damage = 0;
+ frag_force = frag_force * cvar("g_freezetag_frozen_force");
+ }
+ }
+ return 1;
+}
+
+MUTATOR_DEFINITION(gamemode_freezetag)
+{
+ MUTATOR_HOOK(MakePlayerObserver, freezetag_RemovePlayer, CBC_ORDER_ANY);
+ MUTATOR_HOOK(ClientDisconnect, freezetag_RemovePlayer, CBC_ORDER_ANY);
+ MUTATOR_HOOK(PlayerDies, freezetag_PlayerDies, CBC_ORDER_ANY);
+ MUTATOR_HOOK(PlayerSpawn, freezetag_PlayerSpawn, CBC_ORDER_ANY);
+ MUTATOR_HOOK(GiveFragsForKill, freezetag_GiveFragsForKill, CBC_ORDER_FIRST);
+ MUTATOR_HOOK(PlayerPreThink, freezetag_PlayerPreThink, CBC_ORDER_FIRST);
+ MUTATOR_HOOK(PlayerPhysics, freezetag_PlayerPhysics, CBC_ORDER_FIRST);
+ MUTATOR_HOOK(PlayerDamage_Calculate, freezetag_PlayerDamage_Calculate, CBC_ORDER_ANY);
+
+ MUTATOR_ONADD
+ {
+ if(time > 1) // game loads at time 1
+ error("This is a game type and it cannot be added at runtime.");
+ g_freezetag = 1;
+ freezetag_Initialize();
+ }
+
+ MUTATOR_ONREMOVE
+ {
+ g_freezetag = 0;
+ error("This is a game type and it cannot be removed at runtime.");
+ }
+
+ return 0;
+}
--- /dev/null
+void ka_SpawnBall(void);
+void ka_TouchEvent(void);
+void ka_RespawnBall(void);
+void ka_DropEvent(entity);
+
+float ka_ballcarrier_waypointsprite_visible_for_player(entity);
+
+void ka_Initialize() // run at the start of a match, initiates game mode
+{
+ if(!g_keepaway)
+ return;
+
+ precache_sound("keepaway/pickedup.wav");
+ precache_sound("keepaway/dropped.wav");
+ precache_sound("keepaway/respawn.wav");
+ precache_sound("keepaway/touch.wav");
+
+ ScoreRules_keepaway();
+ ka_SpawnBall();
+}
+
+void ka_Reset() // used to clear the ballcarrier whenever the match switches from warmup to normal
+{
+ if(self.owner)
+ if(self.owner.classname == "player")
+ ka_DropEvent(self.owner);
+
+ ka_RespawnBall();
+}
+
+void ka_SpawnBall() // loads various values for the ball
+{
+ if(!g_keepaway) { return; }
+
+ entity e;
+ e = spawn();
+ e.model = "models/orbs/orbblue.md3";
+ e.scale = 1;
+ precache_model(e.model);
+ setmodel(e, e.model);
+ setsize(e, '-16 -16 -20', '16 16 20'); // 20 20 20 was too big, player is only 16 16 24... gotta cheat with the Z (20) axis so that the particle isn't cut off
+ e.classname = "keepawayball";
+ e.damageforcescale = cvar("g_keepawayball_damageforcescale");
+ e.takedamage = DAMAGE_YES;
+ e.glow_color = cvar("g_keepawayball_trail_color");
+ e.glow_trail = TRUE;
+ e.movetype = MOVETYPE_BOUNCE;
+ e.touch = ka_TouchEvent;
+ e.flags = FL_ITEM;
+ e.reset = ka_Reset;
+ e.owner = world;
+
+ InitializeEntity(e, ka_RespawnBall, INITPRIO_SETLOCATION); // is this the right priority? Neh, I have no idea.. Well-- it works! So.
+}
+
+void ka_RespawnBall() // runs whenever the ball needs to be relocated
+{
+ vector oldballorigin = self.origin;
+
+ if(MoveToRandomMapLocation(self, DPCONTENTS_SOLID | DPCONTENTS_CORPSE | DPCONTENTS_PLAYERCLIP, DPCONTENTS_SLIME | DPCONTENTS_LAVA | DPCONTENTS_SKY | DPCONTENTS_BODY | DPCONTENTS_DONOTENTER, Q3SURFACEFLAG_SKY, 10, 1024, 256))
+ {
+ makevectors(self.angles);
+ self.movetype = MOVETYPE_BOUNCE;
+ self.velocity = '0 0 200';
+ self.angles = '0 0 0';
+ self.solid = SOLID_TRIGGER;
+ self.think = ka_RespawnBall;
+ self.nextthink = time + cvar("g_keepawayball_respawntime");
+
+ pointparticles(particleeffectnum("electro_combo"), oldballorigin, '0 0 0', 1);
+ pointparticles(particleeffectnum("electro_combo"), self.origin, '0 0 0', 1);
+
+ WaypointSprite_Spawn("ka-ball", 0, 0, self, '0 0 64', world, self.team, self, waypointsprite_attachedforcarrier, FALSE);
+ WaypointSprite_UpdateTeamRadar(self.waypointsprite_attachedforcarrier, RADARICON_FLAGCARRIER, '0 1 1');
+ WaypointSprite_Ping(self.waypointsprite_attachedforcarrier);
+
+ sound(self, CHAN_AUTO, "keepaway/respawn.wav", VOL_BASE, ATTN_NONE); // ATTN_NONE (it's a sound intended to be heard anywhere)
+ }
+ else
+ {
+ ka_RespawnBall(); // finding a location failed, retry
+ }
+}
+
+void ka_TouchEvent() // runs any time that the ball comes in contact with something
+{
+ if(!self) { return; }
+ if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)
+ { // The ball fell off the map, respawn it since players can't get to it
+ ka_RespawnBall();
+ return;
+ }
+ if(other.deadflag != DEAD_NO) { return; }
+ if(other.classname != "player")
+ { // The ball just touched an object, most likely the world
+ pointparticles(particleeffectnum("kaball_sparks"), self.origin, '0 0 0', 1);
+ sound(self, CHAN_AUTO, "keepaway/touch.wav", VOL_BASE, ATTN_NORM);
+ return;
+ }
+ else if(self.wait > time) { return; }
+
+ // attach the ball to the player
+ self.owner = other;
+ other.ballcarried = self;
+ setattachment(self, other, "");
+ setorigin(self, '3 0 20');
+
+ // make the ball invisible/unable to do anything
+ self.velocity = '0 0 0';
+ self.movetype = MOVETYPE_NONE;
+ self.touch = SUB_Null;
+ self.effects |= EF_NODRAW;
+ self.think = SUB_Null;
+ self.nextthink = 0;
+ self.takedamage = DAMAGE_NO;
+
+ // apply effects to player
+ other.glow_color = cvar("g_keepawayball_trail_color");
+ other.glow_trail = TRUE;
+ other.effects |= EF_DIMLIGHT;
+ other.alpha = cvar("g_keepaway_ballcarrier_alpha");
+ other.exteriorweaponentity.alpha = cvar("g_keepaway_ballcarrier_alpha");
+
+ // messages and sounds
+ Send_KillNotification(other.netname, "", "", KA_PICKUPBALL, MSG_KA);
+ WriteByte(MSG_BROADCAST, SVC_CENTERPRINT);
+ WriteString(MSG_BROADCAST, strcat("\n\n", other.netname, "^7 has picked up the ball!\n"));
+ sound(self.owner, CHAN_AUTO, "keepaway/pickedup.wav", VOL_BASE, ATTN_NONE); // ATTN_NONE (it's a sound intended to be heard anywhere)
+
+ // scoring
+ PlayerScore_Add(other, SP_KEEPAWAY_PICKUPS, 1);
+
+ // waypoints
+ WaypointSprite_AttachCarrier("ka-ballcarrier", other);
+ other.waypointsprite_attachedforcarrier.waypointsprite_visible_for_player = ka_ballcarrier_waypointsprite_visible_for_player;
+ WaypointSprite_UpdateRule(other.waypointsprite_attachedforcarrier, 0, SPRITERULE_DEFAULT);
+ WaypointSprite_UpdateTeamRadar(other.waypointsprite_attachedforcarrier, RADARICON_FLAGCARRIER, '1 0 0');
+ WaypointSprite_Ping(other.waypointsprite_attachedforcarrier);
+ WaypointSprite_Kill(self.waypointsprite_attachedforcarrier);
+}
+
+void ka_DropEvent(entity plyr) // runs any time that a player is supposed to lose the ball
+{
+ entity ball;
+ ball = plyr.ballcarried;
+
+ if(!ball) { return; }
+
+ // reset the ball
+ setattachment(ball, world, "");
+ ball.movetype = MOVETYPE_BOUNCE;
+ ball.solid = SOLID_TRIGGER; // is this needed?
+ ball.wait = time + 1;
+ ball.think = ka_RespawnBall;
+ ball.nextthink = time + cvar("g_keepawayball_respawntime");
+ ball.touch = ka_TouchEvent;
+ ball.takedamage = DAMAGE_YES;
+ ball.effects &~= EF_NODRAW;
+ setorigin(ball, plyr.origin + '0 0 10');
+ ball.velocity = '0 0 200' + '0 100 0'*crandom() + '100 0 0'*crandom();
+ ball.owner.ballcarried = world; // I hope nothing checks to see if the world has the ball in the rest of my code :P
+ ball.owner = world;
+
+ // reset the player effects
+ plyr.effects &~= EF_DIMLIGHT;
+ plyr.alpha = default_player_alpha;
+ plyr.exteriorweaponentity.alpha = default_weapon_alpha;
+ plyr.glow_trail = FALSE;
+
+ // messages and sounds
+ Send_KillNotification(plyr.netname, "", "", KA_DROPBALL, MSG_KA);
+ WriteByte(MSG_BROADCAST, SVC_CENTERPRINT);
+ WriteString(MSG_BROADCAST, strcat("\n\n", plyr.netname, "^7 has dropped the ball!\n"));
+ sound(other, CHAN_AUTO, "keepaway/dropped.wav", VOL_BASE, ATTN_NONE); // ATTN_NONE (it's a sound intended to be heard anywhere)
+
+ // scoring
+ PlayerScore_Add(plyr, SP_KEEPAWAY_DROPS, 1);
+
+ // waypoints
+ WaypointSprite_Spawn("ka-ball", 0, 0, ball, '0 0 64', world, ball.team, ball, waypointsprite_attachedforcarrier, FALSE);
+ WaypointSprite_UpdateRule(ball.waypointsprite_attachedforcarrier, 0, SPRITERULE_DEFAULT);
+ WaypointSprite_UpdateTeamRadar(ball.waypointsprite_attachedforcarrier, RADARICON_FLAGCARRIER, '0 1 1');
+ WaypointSprite_Ping(ball.waypointsprite_attachedforcarrier);
+ WaypointSprite_Kill(plyr.waypointsprite_attachedforcarrier);
+}
+
+float ka_ballcarrier_waypointsprite_visible_for_player(entity e) // runs on waypoints which are attached to ballcarriers, updates once per frame
+{
+ if(e.ballcarried)
+ {
+ if(other.classname == "spectator")
+ return FALSE; // we don't want spectators of the ballcarrier to see the attached waypoint on the top of their screen
+ else if(g_minstagib && (e.items & IT_STRENGTH))
+ return FALSE; // if the ballcarrier has invisibility, don't draw the waypoint as this is the function of invisibility in keepaway
+ }
+
+ return TRUE;
+}
+
+MUTATOR_HOOKFUNCTION(ka_RemovePlayer)
+{
+ if(self.ballcarried) { ka_DropEvent(self); } // a player with the ball has left the match, drop it
+ return 0;
+}
+
+MUTATOR_HOOKFUNCTION(ka_Scoring)
+{
+ if((frag_attacker != frag_target) && (frag_attacker.classname == "player"))
+ {
+ if(frag_target.ballcarried) { // add to amount of times killing carrier
+ PlayerScore_Add(frag_attacker, SP_KEEPAWAY_CARRIERKILLS, 1);
+ if(cvar("g_keepaway_bckillscore")) // add bckills to the score
+ PlayerScore_Add(frag_attacker, SP_KEEPAWAY_SCORE, 1);
+ }
+ else if(!frag_attacker.ballcarried)
+ if(cvar("g_keepaway_noncarrier_warn"))
+ centerprint_atprio(frag_attacker, (CENTERPRIO_SPAM + 5), "Killing people while you don't have the ball gives no points!");
+
+ if(frag_attacker.ballcarried) // add to amount of kills while ballcarrier
+ PlayerScore_Add(frag_attacker, SP_KEEPAWAY_SCORE, 1);
+ }
+
+ if(self.ballcarried) { ka_DropEvent(self); } // a player with the ball has died, drop it
+ return 0;
+}
+
+MUTATOR_HOOKFUNCTION(ka_GiveFragsForKill)
+{
+ frag_score = 0; // no frags counted in keepaway
+ return 0;
+}
+
+MUTATOR_HOOKFUNCTION(ka_PlayerPreThink)
+{
+ // clear the item used for the ball in keepaway
+ self.items &~= IT_KEY1;
+
+ // if the player has the ball, make sure they have the item for it (Used for HUD primarily)
+ if(self.ballcarried)
+ self.items |= IT_KEY1;
+
+ // drop the ball if the player presses the use button
+ if(self.BUTTON_USE)
+ if(self.ballcarried) { ka_DropEvent(self); }
+
+ return 0;
+}
+
+MUTATOR_HOOKFUNCTION(ka_PlayerDamage) // for changing damage and force values that are applied to players in g_damage.qc
+{
+ if(frag_attacker.ballcarried) // if the attacker is a ballcarrier
+ {
+ if(frag_target == frag_attacker) // damage done to yourself
+ {
+ frag_damage *= cvar("g_keepaway_ballcarrier_selfdamage");
+ frag_force *= cvar("g_keepaway_ballcarrier_selfforce");
+ }
+ else // damage done to noncarriers
+ {
+ frag_damage *= cvar("g_keepaway_ballcarrier_damage");
+ frag_force *= cvar("g_keepaway_ballcarrier_force");
+ }
+ }
+ else if not(frag_target.ballcarried) // if the target is a noncarrier
+ {
+ if(frag_target == frag_attacker) // damage done to yourself
+ {
+ frag_damage *= cvar("g_keepaway_noncarrier_selfdamage");
+ frag_force *= cvar("g_keepaway_noncarrier_selfforce");
+ }
+ else // damage done to other noncarriers
+ {
+ frag_damage *= cvar("g_keepaway_noncarrier_damage");
+ frag_force *= cvar("g_keepaway_noncarrier_force");
+ }
+ }
+ return 0;
+}
+
+MUTATOR_HOOKFUNCTION(ka_PlayerPowerups)
+{
+ if(self.ballcarried)
+ {
+ // if the player has the ball, force ballcarrier alpha upon them
+ self.alpha = cvar("g_keepaway_ballcarrier_alpha");
+ self.exteriorweaponentity.alpha = cvar("g_keepaway_ballcarrier_alpha");
+
+ // if we're in minstagib and a ballcarrier has just picked up invisibility,
+ // notify all the other players that the ballcarrier no longer has a waypoint
+ if(g_minstagib)
+ {
+ if(olditems & IT_STRENGTH)
+ {
+ if(time > self.strength_finished)
+ { // this only runs ONCE right after the player loses invisibility
+ bprint(self.netname, "^7 isn't invisible from radar anymore.\n");
+ }
+ }
+ else
+ {
+ if(time < self.strength_finished)
+ { // this only runs ONCE right after the player gains invisibility
+ bprint(self.netname, "^7 has picked up invisibility and can no longer be seen on radar!\n");
+ }
+ }
+ }
+ }
+ else if(g_minstagib)
+ {
+ // if we're in minstagib and a noncarrier has invisibility, assure that we apply the invisibility effects normally
+ if(olditems & IT_STRENGTH)
+ {
+ self.alpha = g_minstagib_invis_alpha;
+ self.exteriorweaponentity.alpha = g_minstagib_invis_alpha;
+ }
+ }
+ else
+ {
+ // if we're a normal player with no powerups that edit alpha make sure the alpha is default.
+ // (normal powerups just use EF_ADDITIVE)
+ self.alpha = default_player_alpha;
+ self.exteriorweaponentity.alpha = default_weapon_alpha;
+ }
+
+ return 0;
+}
+
+MUTATOR_DEFINITION(gamemode_keepaway)
+{
+ // I don't quite understand these orders, perhaps someone could enlighten me?
+ MUTATOR_HOOK(MakePlayerObserver, ka_RemovePlayer, CBC_ORDER_ANY);
+ MUTATOR_HOOK(ClientDisconnect, ka_RemovePlayer, CBC_ORDER_ANY);
+ MUTATOR_HOOK(PlayerDies, ka_Scoring, CBC_ORDER_ANY);
+ MUTATOR_HOOK(GiveFragsForKill, ka_GiveFragsForKill, CBC_ORDER_ANY);
+ MUTATOR_HOOK(PlayerPreThink, ka_PlayerPreThink, CBC_ORDER_FIRST);
+ MUTATOR_HOOK(PlayerDamage_Calculate, ka_PlayerDamage, CBC_ORDER_ANY);
+ MUTATOR_HOOK(PlayerPowerups, ka_PlayerPowerups, CBC_ORDER_ANY);
+
+ MUTATOR_ONADD
+ {
+ if(time > 1) // game loads at time 1
+ error("This is a game type and it cannot be added at runtime.");
+ g_keepaway = 1;
+ ka_Initialize();
+ }
+
+ MUTATOR_ONREMOVE
+ {
+ g_keepaway = 0;
+ error("This is a game type and it cannot be removed at runtime.");
+ }
+
+ return 0;
+}
\ No newline at end of file
MUTATOR_DEFINITION(mutator_vampire)
{
- MUTATOR_HOOK(PlayerDamage, vampire_PlayerDamage, CBC_ORDER_ANY);
+ MUTATOR_HOOK(PlayerDamage_SplitHealthArmor, vampire_PlayerDamage, CBC_ORDER_ANY);
MUTATOR_HOOK(BuildMutatorsString, vampire_BuildMutatorsString, CBC_ORDER_ANY);
MUTATOR_HOOK(BuildMutatorsPrettyString, vampire_BuildMutatorsPrettyString, CBC_ORDER_ANY);
MUTATOR_DECLARATION(gamemode_keyhunt);
+MUTATOR_DECLARATION(gamemode_freezetag);
+MUTATOR_DECLARATION(gamemode_keepaway);
MUTATOR_DECLARATION(mutator_nix);
MUTATOR_DECLARATION(mutator_dodging);
if (!(ball = self.ballcarried))
return;
- W_SetupShot (self, FALSE, 4, "nexball/shoot1.wav",0);
+ W_SetupShot (self, FALSE, 4, "nexball/shoot1.wav", CHAN_WEAPON, 0);
tracebox(w_shotorg, BALL_MINS, BALL_MAXS, w_shotorg, MOVE_WORLDONLY, world);
if(trace_startsolid)
{
local entity missile;
if (!(balls & BALL_BASKET))
return;
- W_SetupShot (self, FALSE, 2, "nexball/shoot2.wav",0);
+ W_SetupShot (self, FALSE, 2, "nexball/shoot2.wav", CHAN_WEAPON, 0);
// pointparticles(particleeffectnum("grenadelauncher_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
missile = spawn ();
--- /dev/null
+float playerstats_db;
+string playerstats_last;
+string events_last;
+.float playerstats_addedglobalinfo;
+float playerstats_requested;
+
+void PlayerStats_Init()
+{
+ string uri;
+ playerstats_db = -1;
+ playerstats_waitforme = TRUE;
+ uri = cvar_string("g_playerstats_uri");
+ if(uri == "")
+ return;
+ playerstats_db = db_create();
+ if(playerstats_db >= 0)
+ playerstats_waitforme = FALSE; // must wait for it at match end
+
+ PlayerStats_AddEvent(PLAYERSTATS_ALIVETIME);
+ PlayerStats_AddEvent(PLAYERSTATS_KILLS);
+}
+
+void PlayerStats_AddPlayer(entity e)
+{
+ if(!e.crypto_idfp || playerstats_db < 0)
+ return;
+
+ string key;
+ key = sprintf("%s:*", e.crypto_idfp);
+
+ string p;
+ p = db_get(playerstats_db, key);
+ if(p == "")
+ {
+ if(playerstats_last)
+ {
+ db_put(playerstats_db, key, playerstats_last);
+ strunzone(playerstats_last);
+ }
+ else
+ db_put(playerstats_db, key, "#");
+ playerstats_last = strzone(e.crypto_idfp);
+ }
+}
+
+void PlayerStats_AddEvent(string event_id)
+{
+ if(playerstats_db < 0)
+ return;
+
+ string key;
+ key = sprintf("*:%s", event_id);
+
+ string p;
+ p = db_get(playerstats_db, key);
+ if(p == "")
+ {
+ if(events_last)
+ {
+ db_put(playerstats_db, key, events_last);
+ strunzone(events_last);
+ }
+ else
+ db_put(playerstats_db, key, "#");
+ events_last = strzone(event_id);
+ }
+}
+
+void PlayerStats_Event(entity e, string event_id, float value)
+{
+ if(!e.crypto_idfp || playerstats_db < 0)
+ return;
+
+ string key;
+ float val;
+ key = sprintf("%s:%s", e.crypto_idfp, event_id);
+ val = stof(db_get(playerstats_db, key));
+ val += value;
+ db_put(playerstats_db, key, ftos(val));
+}
+
+void PlayerStats_Sent_URI_Get_Callback(float id, float status, string data)
+{
+ if(playerstats_requested)
+ playerstats_waitforme = TRUE;
+}
+
+void PlayerStats_Shutdown()
+{
+ string p, pn;
+ string e, en;
+ string nn;
+ float b;
+ float i;
+ string uri;
+
+ if(playerstats_db < 0)
+ return;
+
+ uri = cvar_string("g_playerstats_uri");
+ if(uri != "")
+ {
+ b = buf_create();
+ i = 0;
+
+ db_dump(playerstats_db, "foo.db");
+
+ bufstr_set(b, i++, "V 1");
+ bufstr_set(b, i++, sprintf("T %s.%06d", strftime(FALSE, "%s"), floor(random() * 1000000)));
+ bufstr_set(b, i++, sprintf("G %s", GetGametype()));
+ bufstr_set(b, i++, sprintf("M %s", GetMapname()));
+ for(p = playerstats_last; (pn = db_get(playerstats_db, sprintf("%s:*", p))) != ""; p = pn)
+ {
+ bufstr_set(b, i++, sprintf("P %s", p));
+ nn = db_get(playerstats_db, sprintf("%s:_netname", p));
+ if(nn != "")
+ bufstr_set(b, i++, sprintf("n %s", nn));
+ for(e = events_last; (en = db_get(playerstats_db, sprintf("*:%s", e))) != ""; e = en)
+ {
+ float v;
+ v = stof(db_get(playerstats_db, sprintf("%s:%s", p, e)));
+ bufstr_set(b, i++, sprintf("e %s %f", e, v));
+ }
+ }
+ bufstr_set(b, i++, "");
+
+ if(crypto_uri_postbuf(uri, URI_GET_PLAYERSTATS_SENT, "text/plain", "\n", b, 0))
+ playerstats_requested = TRUE;
+ else
+ playerstats_waitforme = TRUE; // if posting fails, we must continue anyway
+
+ buf_del(b);
+ }
+ else
+ playerstats_waitforme = TRUE;
+
+ db_close(playerstats_db);
+ playerstats_db = -1;
+}
+
+void PlayerStats_AddGlobalInfo(entity p)
+{
+ if(playerstats_db < 0)
+ return;
+ if(!p.crypto_idfp || playerstats_db < 0)
+ return;
+ p.playerstats_addedglobalinfo = TRUE;
+
+ // add global info!
+ if(p.alivetime)
+ PlayerStats_Event(p, PLAYERSTATS_ALIVETIME, time - p.alivetime);
+
+ if(p.cvar_cl_allow_uid2name)
+ db_put(playerstats_db, sprintf("%s:_netname", p.crypto_idfp), p.netname);
+}
--- /dev/null
+// time the player was alive and kicking
+string PLAYERSTATS_ALIVETIME = "alivetime";
+string PLAYERSTATS_KILLS = "kills";
+
+// delay map switch until this is set
+float playerstats_waitforme;
+
+// call at initialization
+void PlayerStats_Init();
+
+// add a new player
+void PlayerStats_AddPlayer(entity e);
+
+// add a new event
+void PlayerStats_AddEvent(string event_id);
+
+// call on each event to track, or at player disconnect OR match end for "global stuff"
+void PlayerStats_Event(entity e, string event_id, float value);
+
+// call at game over
+void PlayerStats_Shutdown(); // send stats to the server
+
+// URI GET callback
+void PlayerStats_Sent_URI_Get_Callback(float id, float status, string data);
+
+// call this whenever a player leaves
+void PlayerStats_AddGlobalInfo(entity p);
anticheat.qh
cheats.qh
+playerstats.qh
portals.qh
anticheat.qc
cheats.qc
+playerstats.qc
mutators/base.qc
mutators/gamemode_keyhunt.qc
+mutators/gamemode_freezetag.qc
+mutators/gamemode_keepaway.qc
mutators/mutator_nix.qc
mutators/mutator_dodging.qc
mutators/mutator_rocketflying.qc
ScoreInfo_SetLabel_PlayerScore(SP_NEXBALL_FAULTS, "faults", SFL_SORT_PRIO_SECONDARY | SFL_LOWER_IS_BETTER);
ScoreRules_basics_end();
}
+
+// Keep Away stuff
+#define SP_KEEPAWAY_PICKUPS 4
+#define SP_KEEPAWAY_CARRIERKILLS 5
+#define SP_KEEPAWAY_DROPS 6
+#define SP_KEEPAWAY_SCORE 7
+void ScoreRules_keepaway()
+{
+ ScoreRules_basics(0, SFL_SORT_PRIO_PRIMARY, 0, FALSE); // SFL_SORT_PRIO_PRIMARY
+ ScoreInfo_SetLabel_PlayerScore(SP_KEEPAWAY_SCORE, "score", SFL_SORT_PRIO_PRIMARY);
+ ScoreInfo_SetLabel_PlayerScore(SP_KEEPAWAY_PICKUPS, "pickups", 0);
+ ScoreInfo_SetLabel_PlayerScore(SP_KEEPAWAY_CARRIERKILLS, "bckills", 0);
+ ScoreInfo_SetLabel_PlayerScore(SP_KEEPAWAY_DROPS, "drops", SFL_LOWER_IS_BETTER);
+ ScoreRules_basics_end();
+}
}
if (self.dmgtime < time)
{
- self.dmgtime = time + 0.1;
+ self.dmgtime = time + 0.2;
if (self.watertype == CONTENT_LAVA)
{
if (self.watersound_finished < time)
if (other.classname != "gib")
if (other.classname != "casing")
if (other.classname != "droppedweapon")
+ if (other.classname != "keepawayball")
if (!other.projectiledeathtype || other.classname == "bullet")
return;
cvar_set("g_race", ftos(g_race));
cvar_set("g_nexball", ftos(g_nexball));
cvar_set("g_cts", ftos(g_cts));
+ cvar_set("g_freezetag", ftos(g_freezetag));
+ cvar_set("g_keepaway", ftos(g_keepaway));
}
void ReadGameCvars()
found += (g_race = (!found && (prev != GAME_RACE) && cvar("g_race")));
found += (g_nexball = (!found && (prev != GAME_NEXBALL) && cvar("g_nexball")));
found += (g_cts = (!found && (prev != GAME_CTS) && cvar("g_cts")));
+ found += (g_freezetag = (!found && (prev != GAME_FREEZETAG) && cvar("g_freezetag")));
+ found += (g_keepaway = (!found && (prev != GAME_KEEPAWAY) && cvar("g_keepaway")));
if(found)
break;
MUTATOR_ADD(gamemode_keyhunt);
}
+ if(g_freezetag)
+ {
+ game = GAME_FREEZETAG;
+ gamemode_name = "Freeze Tag";
+ ActivateTeamplay();
+ fraglimit_override = cvar("g_freezetag_point_limit");
+ leadlimit_override = cvar("g_freezetag_point_leadlimit");
+ MUTATOR_ADD(gamemode_freezetag);
+ }
+
if(g_assault)
{
game = GAME_ASSAULT;
have_team_spawns = -1; // request team spawns
}
+ if(g_keepaway)
+ {
+ game = GAME_KEEPAWAY;
+ gamemode_name = "Keepaway";
+ MUTATOR_ADD(gamemode_keepaway);
+ }
+
if(teams_matter)
entcs_init();
error("Too few teams available for ctf\n");
else if(g_keyhunt)
error("Too few teams available for key hunt\n");
+ else if(g_freezetag)
+ error("Too few teams available for freeze tag\n");
else
error("Too few teams available for team deathmatch\n");
}
{
entity e;
+ // Respawn is called & first spawn to, to set team. need to make sure we do not move the initial spawn.
+ if(self.movetype != MOVETYPE_WALK)
+ return;
+
self.velocity = '0 0 0';
self.enemy = world;
vector vtmp;
entity e;
- setorigin(self,self.wkr_spawn.origin);
+ // Respawn is called & first spawn to, to set team. need to make sure we do not move the initial spawn.
+ if(self.movetype != MOVETYPE_WALK)
+ return;
+
+ setorigin(self, self.wkr_spawn.origin);
self.angles = self.wkr_spawn.angles;
vtmp = self.wkr_spawn.origin;
self.ammo_nails -= pAmmo;
if(deathtype & HITTYPE_SECONDARY)
- W_SetupShot (self, cvar("g_antilag_bullets") && pSpeed >= cvar("g_antilag_bullets"), 2, "weapons/campingrifle_fire2.wav", cvar("g_balance_campingrifle_secondary_damage") + cvar("g_balance_campingrifle_secondary_headshotaddeddamage"));
+ W_SetupShot (self, cvar("g_antilag_bullets") && pSpeed >= cvar("g_antilag_bullets"), 2, "weapons/campingrifle_fire2.wav", CHAN_WEAPON, cvar("g_balance_campingrifle_secondary_damage") + cvar("g_balance_campingrifle_secondary_headshotaddeddamage"));
else
- W_SetupShot (self, cvar("g_antilag_bullets") && pSpeed >= cvar("g_antilag_bullets"), 2, "weapons/campingrifle_fire.wav", cvar("g_balance_campingrifle_primary_damage") + cvar("g_balance_campingrifle_primary_headshotaddeddamage"));
+ W_SetupShot (self, cvar("g_antilag_bullets") && pSpeed >= cvar("g_antilag_bullets"), 2, "weapons/campingrifle_fire.wav", CHAN_WEAPON, cvar("g_balance_campingrifle_primary_damage") + cvar("g_balance_campingrifle_primary_headshotaddeddamage"));
pointparticles(particleeffectnum("shotgun_muzzleflash"), w_shotorg, w_shotdir * 2000, 1);
if(cvar("g_balance_crylink_primary_joinexplode"))
maxdmg += cvar("g_balance_crylink_primary_joinexplode_damage");
- W_SetupShot (self, FALSE, 2, "weapons/crylink_fire.wav", maxdmg);
+ W_SetupShot (self, FALSE, 2, "weapons/crylink_fire.wav", CHAN_WEAPON, maxdmg);
forward = v_forward;
right = v_right;
up = v_up;
if(cvar("g_balance_crylink_secondary_joinexplode"))
maxdmg += cvar("g_balance_crylink_secondary_joinexplode_damage");
- W_SetupShot (self, FALSE, 2, "weapons/crylink_fire2.wav", maxdmg);
+ W_SetupShot (self, FALSE, 2, "weapons/crylink_fire2.wav", CHAN_WEAPON, maxdmg);
shots = cvar("g_balance_crylink_secondary_shots");
pointparticles(particleeffectnum("crylink_muzzleflash"), w_shotorg, w_shotdir * 1000, shots);
{
local entity proj;
- W_SetupShot_ProjectileSize (self, '0 0 -3', '0 0 -3', FALSE, 2, "weapons/electro_fire.wav", cvar("g_balance_electro_primary_damage"));
+ W_SetupShot_ProjectileSize (self, '0 0 -3', '0 0 -3', FALSE, 2, "weapons/electro_fire.wav", CHAN_WEAPON, cvar("g_balance_electro_primary_damage"));
pointparticles(particleeffectnum("electro_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
{
local entity proj;
- W_SetupShot_ProjectileSize (self, '0 0 -4', '0 0 -4', FALSE, 2, "", cvar("g_balance_electro_secondary_damage"));
- sound(self, CHAN_WEAPON2, "weapons/electro_fire2.wav", VOL_BASE, ATTN_NORM);
+ W_SetupShot_ProjectileSize (self, '0 0 -4', '0 0 -4', FALSE, 2, "weapons/electro_fire2.wav", CHAN_WEAPON, cvar("g_balance_electro_secondary_damage"));
+
w_shotdir = v_forward; // no TrueAim for grenades please
pointparticles(particleeffectnum("electro_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
remove(self);
return;
}
- if (self.owner.weaponentity.state != WS_INUSE || (self.owner.ammo_cells <= 0 && !(self.owner.items & IT_UNLIMITED_WEAPON_AMMO)) || self.owner.deadflag != DEAD_NO || !self.owner.BUTTON_ATCK)
+ if (self.owner.weaponentity.state != WS_INUSE || (self.owner.ammo_cells <= 0 && !(self.owner.items & IT_UNLIMITED_WEAPON_AMMO)) || self.owner.deadflag != DEAD_NO || !self.owner.BUTTON_ATCK || (g_freezetag && self.owner.freezetag_frozen))
{
if(self == self.owner.lgbeam)
self.owner.lgbeam = world;
}
}
- W_SetupShot_Range(self.owner, TRUE, 0, "", cvar("g_balance_electro_primary_damage") * dt, cvar("g_balance_electro_primary_range"));
+ W_SetupShot_Range(self.owner, TRUE, 0, "", 0, cvar("g_balance_electro_primary_damage") * dt, cvar("g_balance_electro_primary_range"));
WarpZone_traceline_antilag(self.owner, w_shotorg, w_shotend, MOVE_NORMAL, self.owner, ANTILAG_LATENCY(self.owner));
// apply the damage
{
local entity proj;
- W_SetupShot_ProjectileSize (self, '-16 -16 -16', '16 16 16', FALSE, 2, "weapons/fireball_fire2.wav", cvar("g_balance_fireball_primary_damage") + cvar("g_balance_fireball_primary_bfgdamage"));
+ W_SetupShot_ProjectileSize (self, '-16 -16 -16', '16 16 16', FALSE, 2, "weapons/fireball_fire2.wav", CHAN_WEAPON, cvar("g_balance_fireball_primary_damage") + cvar("g_balance_fireball_primary_bfgdamage"));
pointparticles(particleeffectnum("fireball_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
void W_Fireball_AttackEffect(float i, vector f_diff)
{
- W_SetupShot_ProjectileSize (self, '-16 -16 -16', '16 16 16', FALSE, 0, "", 0);
+ W_SetupShot_ProjectileSize (self, '-16 -16 -16', '16 16 16', FALSE, 0, "", 0, 0);
w_shotorg += f_diff_x * v_up + f_diff_y * v_right;
pointparticles(particleeffectnum("fireball_preattack_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
}
f_diff = '+1.25 +3.75 0';
break;
}
- W_SetupShot_ProjectileSize(self, '-4 -4 -4', '4 4 4', FALSE, 2, "weapons/fireball_fire.wav", cvar("g_balance_fireball_secondary_damage"));
+ W_SetupShot_ProjectileSize(self, '-4 -4 -4', '4 4 4', FALSE, 2, "weapons/fireball_fire.wav", CHAN_WEAPON, cvar("g_balance_fireball_secondary_damage"));
traceline(w_shotorg, w_shotorg + f_diff_x * v_up + f_diff_y * v_right, MOVE_NORMAL, self);
w_shotorg = trace_endpos;
if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
self.ammo_rockets = self.ammo_rockets - cvar("g_balance_grenadelauncher_primary_ammo");
- W_SetupShot_ProjectileSize (self, '-3 -3 -3', '3 3 3', FALSE, 4, "weapons/grenade_fire.wav", cvar("g_balance_grenadelauncher_primary_damage"));
+ W_SetupShot_ProjectileSize (self, '-3 -3 -3', '3 3 3', FALSE, 4, "weapons/grenade_fire.wav", CHAN_WEAPON, cvar("g_balance_grenadelauncher_primary_damage"));
w_shotdir = v_forward; // no TrueAim for grenades please
pointparticles(particleeffectnum("grenadelauncher_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
self.ammo_rockets = self.ammo_rockets - cvar("g_balance_grenadelauncher_secondary_ammo");
- W_SetupShot_ProjectileSize (self, '-3 -3 -3', '3 3 3', FALSE, 4, "weapons/grenade_fire.wav", cvar("g_balance_grenadelauncher_secondary_damage"));
+ W_SetupShot_ProjectileSize (self, '-3 -3 -3', '3 3 3', FALSE, 4, "weapons/grenade_fire.wav", CHAN_WEAPON, cvar("g_balance_grenadelauncher_secondary_damage"));
w_shotdir = v_forward; // no TrueAim for grenades please
pointparticles(particleeffectnum("grenadelauncher_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
self.ammo_rockets = self.ammo_rockets - cvar("g_balance_hagar_primary_ammo");
- W_SetupShot (self, FALSE, 2, "weapons/hagar_fire.wav", cvar("g_balance_hagar_primary_damage"));
+ W_SetupShot (self, FALSE, 2, "weapons/hagar_fire.wav", CHAN_WEAPON, cvar("g_balance_hagar_primary_damage"));
pointparticles(particleeffectnum("hagar_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
self.ammo_rockets = self.ammo_rockets - cvar("g_balance_hagar_secondary_ammo");
- W_SetupShot (self, FALSE, 2, "weapons/hagar_fire.wav", cvar("g_balance_hagar_secondary_damage"));
- //W_SetupShot (self, FALSE, 2, "weapons/hagar_fire.wav"); // TODO: move model a little to the right
+ W_SetupShot (self, FALSE, 2, "weapons/hagar_fire.wav", CHAN_WEAPON, cvar("g_balance_hagar_secondary_damage"));
pointparticles(particleeffectnum("hagar_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
if(self.crouch)
spread = spread * cvar("g_balance_hlac_primary_spread_crouchmod");
- W_SetupShot (self, FALSE, 3, "weapons/lasergun_fire.wav", cvar("g_balance_hlac_primary_damage"));
+ W_SetupShot (self, FALSE, 3, "weapons/lasergun_fire.wav", CHAN_WEAPON, cvar("g_balance_hlac_primary_damage"));
pointparticles(particleeffectnum("laser_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
if (!g_norecoil)
{
if(self.crouch)
spread = spread * cvar("g_balance_hlac_secondary_spread_crouchmod");
- W_SetupShot (self, FALSE, 3, "weapons/lasergun_fire.wav", cvar("g_balance_hlac_secondary_damage"));
+ W_SetupShot (self, FALSE, 3, "weapons/lasergun_fire.wav", CHAN_WEAPON, cvar("g_balance_hlac_secondary_damage"));
pointparticles(particleeffectnum("laser_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
missile = spawn ();
if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
self.ammo_cells = self.ammo_cells - cvar("g_balance_hook_secondary_ammo");
- W_SetupShot (self, FALSE, 4, "weapons/hookbomb_fire.wav", cvar("g_balance_hook_secondary_damage"));
+ W_SetupShot (self, FALSE, 4, "weapons/hookbomb_fire.wav", CHAN_WEAPON, cvar("g_balance_hook_secondary_damage"));
gren = spawn ();
gren.owner = self;
s_forward = v_forward * cos(a * DEG2RAD) + v_up * sin(a * DEG2RAD);
if(nodamage)
- W_SetupShot_Dir (self, s_forward, FALSE, 3, "weapons/lasergun_fire.wav", 0);
+ W_SetupShot_Dir (self, s_forward, FALSE, 3, "weapons/lasergun_fire.wav", CHAN_WEAPON2, 0);
else if(issecondary == 1)
- W_SetupShot_Dir (self, s_forward, FALSE, 3, "weapons/lasergun_fire.wav", cvar("g_balance_laser_secondary_damage"));
+ W_SetupShot_Dir (self, s_forward, FALSE, 3, "weapons/lasergun_fire.wav", CHAN_WEAPON2, cvar("g_balance_laser_secondary_damage"));
else
- W_SetupShot_Dir (self, s_forward, FALSE, 3, "weapons/lasergun_fire.wav", cvar("g_balance_laser_primary_damage"));
+ W_SetupShot_Dir (self, s_forward, FALSE, 3, "weapons/lasergun_fire.wav", CHAN_WEAPON2, cvar("g_balance_laser_primary_damage"));
pointparticles(particleeffectnum("laser_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
missile = spawn ();
float dt;
dt = frametime;
- W_SetupShot_Range(self.owner, TRUE, 0, "", damage * dt, myradius);
+ W_SetupShot_Range(self.owner, TRUE, 0, "", 0, damage * dt, myradius);
WarpZone_traceline_antilag(self.owner, w_shotorg, w_shotend, MOVE_NORMAL, self.owner, ANTILAG_LATENCY(self.owner));
// apply the damage
if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
self.ammo_rockets = self.ammo_rockets - cvar("g_balance_minelayer_ammo");
- W_SetupShot_ProjectileSize (self, '-4 -4 -4', '4 4 4', FALSE, 5, "weapons/mine_fire.wav", cvar("g_balance_minelayer_damage"));
+ W_SetupShot_ProjectileSize (self, '-4 -4 -4', '4 4 4', FALSE, 5, "weapons/mine_fire.wav", CHAN_WEAPON, cvar("g_balance_minelayer_damage"));
pointparticles(particleeffectnum("rocketlauncher_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
mine = WarpZone_RefSys_SpawnSameRefSys(self);
float flying;
flying = IsFlying(self); // do this BEFORE to make the trace values from FireRailgunBullet last
- W_SetupShot (self, TRUE, 0, "weapons/minstanexfire.wav", 10000);
+ W_SetupShot (self, TRUE, 0, "weapons/minstanexfire.wav", CHAN_WEAPON, 10000);
yoda = 0;
damage_goodhits = 0;
mydmg *= charge;
myforce *= charge;
- W_SetupShot (self, TRUE, 5, "weapons/nexfire.wav", mydmg);
+ W_SetupShot (self, TRUE, 5, "weapons/nexfire.wav", CHAN_WEAPON, mydmg);
yoda = 0;
FireRailgunBullet (w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, mydmg, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, WEP_NEX);
if not(self.items & IT_UNLIMITED_SUPERWEAPONS)
self.weapons = self.weapons - (self.weapons & WEPBIT_PORTO);
- W_SetupShot (self, FALSE, 4, "porto/fire.wav", 0);
+ W_SetupShot (self, FALSE, 4, "porto/fire.wav", CHAN_WEAPON, 0);
// always shoot from the eye
w_shotdir = v_forward;
w_shotorg = self.origin + self.view_ofs + ((w_shotorg - self.origin - self.view_ofs) * v_forward) * v_forward;
if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
self.ammo_rockets = self.ammo_rockets - cvar("g_balance_rocketlauncher_ammo");
- W_SetupShot_ProjectileSize (self, '-3 -3 -3', '3 3 3', FALSE, 5, "weapons/rocket_fire.wav", cvar("g_balance_rocketlauncher_damage"));
+ W_SetupShot_ProjectileSize (self, '-3 -3 -3', '3 3 3', FALSE, 5, "weapons/rocket_fire.wav", CHAN_WEAPON, cvar("g_balance_rocketlauncher_damage"));
pointparticles(particleeffectnum("rocketlauncher_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
missile = WarpZone_RefSys_SpawnSameRefSys(self);
self.ammo_rockets = self.ammo_rockets - cvar("g_balance_seeker_missile_ammo");
makevectors(self.v_angle);
- W_SetupShot_ProjectileSize (self, '-2 -2 -2', '2 2 2', FALSE, 2, "weapons/seeker_fire.wav", 0);
+ W_SetupShot_ProjectileSize (self, '-2 -2 -2', '2 2 2', FALSE, 2, "weapons/seeker_fire.wav", CHAN_WEAPON, 0);
w_shotorg += f_diff;
pointparticles(particleeffectnum("seeker_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
self.ammo_rockets = self.ammo_rockets - cvar("g_balance_seeker_tag_ammo");
- W_SetupShot_ProjectileSize (self, '-2 -2 -2', '2 2 2', FALSE, 2, "weapons/tag_fire.wav", cvar("g_balance_seeker_missile_damage") * cvar("g_balance_seeker_missile_count"));
+ W_SetupShot_ProjectileSize (self, '-2 -2 -2', '2 2 2', FALSE, 2, "weapons/tag_fire.wav", CHAN_WEAPON, cvar("g_balance_seeker_missile_damage") * cvar("g_balance_seeker_missile_count"));
missile = spawn();
missile.owner = self;
f_diff = '+1.25 +3.75 0';
break;
}
- W_SetupShot_ProjectileSize (self, '-2 -2 -2', '2 2 2', FALSE, 2, "weapons/flac_fire.wav", cvar("g_balance_seeker_flac_damage"));
+ W_SetupShot_ProjectileSize (self, '-2 -2 -2', '2 2 2', FALSE, 2, "weapons/flac_fire.wav", CHAN_WEAPON, cvar("g_balance_seeker_flac_damage"));
w_shotorg += f_diff;
pointparticles(particleeffectnum("hagar_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
bulletspeed = cvar("g_balance_shotgun_primary_speed");
bulletconstant = cvar("g_balance_shotgun_primary_bulletconstant");
- W_SetupShot (self, cvar("g_antilag_bullets") && bulletspeed >= cvar("g_antilag_bullets"), 5, "weapons/shotgun_fire.wav", d * bullets);
+ W_SetupShot (self, cvar("g_antilag_bullets") && bulletspeed >= cvar("g_antilag_bullets"), 5, "weapons/shotgun_fire.wav", CHAN_WEAPON, d * bullets);
for (sc = 0;sc < bullets;sc = sc + 1)
fireBallisticBullet(w_shotorg, w_shotdir, spread, bulletspeed, 5, d, 0, f, WEP_SHOTGUN, 0, 1, bulletconstant);
endFireBallisticBullet();
meleetemp.owner = self;
meleetemp.think = shotgun_meleethink;
meleetemp.nextthink = time + cvar("g_balance_shotgun_secondary_melee_delay");
- W_SetupShot_Range(self, TRUE, 0, "", cvar("g_balance_shotgun_secondary_damage"), cvar("g_balance_shotgun_secondary_melee_range"));
+ W_SetupShot_Range(self, TRUE, 0, "", 0, cvar("g_balance_shotgun_secondary_damage"), cvar("g_balance_shotgun_secondary_melee_range"));
}
void spawnfunc_weapon_shotgun(); // defined in t_items.qc
{
vector o;
float c, n;
- W_SetupShot(self, FALSE, 2, "", cvar("g_balance_tuba_damage"));
+ W_SetupShot(self, FALSE, 2, "", 0, cvar("g_balance_tuba_damage"));
if(self.tuba_notecount)
{
self.tuba_notecount = FALSE;
else
self.ammo_nails = self.ammo_nails - cvar("g_balance_uzi_sustained_ammo");
}
- W_SetupShot (self, cvar("g_antilag_bullets") && cvar("g_balance_uzi_speed") >= cvar("g_antilag_bullets"), 0, "weapons/uzi_fire.wav", ((self.uzi_bulletcounter == 1) ? cvar("g_balance_uzi_first_damage") : cvar("g_balance_uzi_sustained_damage")));
+ W_SetupShot (self, cvar("g_antilag_bullets") && cvar("g_balance_uzi_speed") >= cvar("g_antilag_bullets"), 0, "weapons/uzi_fire.wav", CHAN_WEAPON, ((self.uzi_bulletcounter == 1) ? cvar("g_balance_uzi_first_damage") : cvar("g_balance_uzi_sustained_damage")));
if (!g_norecoil)
{
self.punchangle_x = random () - 0.5;
return;
}
- W_SetupShot (self, cvar("g_antilag_bullets") && cvar("g_balance_uzi_speed") >= cvar("g_antilag_bullets"), 0, "weapons/uzi_fire.wav", cvar("g_balance_uzi_sustained_damage"));
+ W_SetupShot (self, cvar("g_antilag_bullets") && cvar("g_balance_uzi_speed") >= cvar("g_antilag_bullets"), 0, "weapons/uzi_fire.wav", CHAN_WEAPON, cvar("g_balance_uzi_sustained_damage"));
if (!g_norecoil)
{
self.punchangle_x = random () - 0.5;
void uzi_mode1_fire_burst()
{
- W_SetupShot (self, cvar("g_antilag_bullets") && cvar("g_balance_uzi_speed") >= cvar("g_antilag_bullets"), 0, "weapons/uzi_fire.wav", cvar("g_balance_uzi_sustained_damage"));
+ W_SetupShot (self, cvar("g_antilag_bullets") && cvar("g_balance_uzi_speed") >= cvar("g_antilag_bullets"), 0, "weapons/uzi_fire.wav", CHAN_WEAPON, cvar("g_balance_uzi_sustained_damage"));
if (!g_norecoil)
{
self.punchangle_x = random () - 0.5;
--- /dev/null
+models/ctf/glow_red
+{
+ {
+ map models/ctf/glow_red.tga
+ tcMod scale 0.03 0.03
+ tcMod scroll 0.1 -0.04
+ tcMod rotate 0.1
+ }
+}
+models/ctf/glow_blue
+{
+ {
+ map models/ctf/glow_blue.tga
+ tcMod scale 0.03 0.03
+ tcMod scroll 0.1 -0.04
+ tcMod rotate 0.1
+ }
+}
\ No newline at end of file
--- /dev/null
+models/orbs/orbblue
+{
+ deformVertexes autosprite
+ dpnoshadow
+
+ {
+ map models/orbs/orbblue.tga
+ blendfunc add
+ tcmod page 4 4 0.05
+ rgbgen vertex
+ }
+}
+models/orbs/orbred
+{
+ deformVertexes autosprite
+ dpnoshadow
+
+ {
+ map models/orbs/orbred.tga
+ blendfunc add
+ tcmod page 4 4 0.05
+ rgbgen vertex
+ }
+}
+models/orbs/orbyellow
+{
+ deformVertexes autosprite
+ dpnoshadow
+
+ {
+ map models/orbs/orbyellow.tga
+ blendfunc add
+ tcmod page 4 4 0.05
+ rgbgen vertex
+ }
+}
+models/orbs/orbpink
+{
+ deformVertexes autosprite
+ dpnoshadow
+
+ {
+ map models/orbs/orbpink.tga
+ blendfunc add
+ tcmod page 4 4 0.05
+ rgbgen vertex
+ }
+}
\ No newline at end of file
--- /dev/null
+crylink_projectile_core
+{
+ surfaceparm nonsolid
+ surfaceparm nolightmap
+ deformVertexes autosprite
+ {
+ map textures/projectiles/crylink_projectile_core.tga
+ blendfunc add
+ rgbGen lightingDiffuse
+ }
+}
+crylink_projectile_long
+{
+ surfaceparm nonsolid
+ surfaceparm nolightmap
+ deformVertexes autosprite2
+ {
+ map textures/projectiles/crylink_projectile_long.tga
+ blendfunc add
+ rgbGen lightingDiffuse
+ }
+}
+hlac_projectile_core
+{
+ surfaceparm nonsolid
+ surfaceparm nolightmap
+ deformVertexes autosprite
+ {
+ map textures/projectiles/hlac_projectile_core.tga
+ blendfunc add
+ rgbGen lightingDiffuse
+ }
+}
+hlac_projectile_long
+{
+ surfaceparm nonsolid
+ surfaceparm nolightmap
+ deformVertexes autosprite2
+ {
+ map textures/projectiles/hlac_projectile_long.tga
+ blendfunc add
+ rgbGen lightingDiffuse
+ }
+}
+electro_projectile_core
+{
+ surfaceparm nonsolid
+ surfaceparm nolightmap
+ deformVertexes autosprite
+ {
+ map textures/projectiles/electro_projectile_core.tga
+ blendfunc add
+ tcmod page 4 1 0.1
+ rgbGen lightingDiffuse
+ }
+}
+electro_projectile_long
+{
+ surfaceparm nonsolid
+ surfaceparm nolightmap
+ deformVertexes autosprite2
+ {
+ map textures/projectiles/electro_projectile_long.tga
+ blendfunc add
+ tcmod page 4 1 0.1
+ rgbGen lightingDiffuse
+ }
+}
+laser_projectile_core
+{
+ surfaceparm nonsolid
+ surfaceparm nolightmap
+ deformVertexes autosprite
+ {
+ map textures/projectiles/laser_projectile_core.tga
+ blendfunc add
+ rgbGen lightingDiffuse
+ }
+}
+laser_projectile_long
+{
+ surfaceparm nonsolid
+ surfaceparm nolightmap
+ deformVertexes autosprite2
+ {
+ map textures/projectiles/laser_projectile_long.tga
+ blendfunc add
+ rgbGen lightingDiffuse
+ }
+}
\ No newline at end of file
rgbgen lightingDiffuse
}
}
+minelayer
+{
+ dpreflectcube cubemaps/default/sky
+ {
+ map textures/minelayer.tga
+ rgbgen lightingDiffuse
+ }
+}
Ben "MooKow" Banker
Calinou
chooksta
+Cuinn "Cuinnton" Herrick
Kristian "morfar" Johansson
kojn
Maik "SavageX" Merten