set g_balance_devastator_guideratedelay 0.01
set g_balance_devastator_guidestop 0
set g_balance_devastator_health 30
-set g_balance_devastator_homing_missile_speed 500
-set g_balance_devastator_homing_missile_speed_accel 1.025
-set g_balance_devastator_homing_missile_speed_accel2 1.05
-set g_balance_devastator_homing_missile_speed_decel 0.9
-set g_balance_devastator_homing_missile_speed_max 1000
-set g_balance_devastator_homing_missile_speed_turnrate 0.25
-set g_balance_devastator_homing_missile_active 0
set g_balance_devastator_lifetime 10
set g_balance_devastator_radius 110
set g_balance_devastator_refire 1.1
set g_balance_devastator_guideratedelay 0.01
set g_balance_devastator_guidestop 0
set g_balance_devastator_health 40
-set g_balance_devastator_homing_missile_speed 500
-set g_balance_devastator_homing_missile_speed_accel 1.025
-set g_balance_devastator_homing_missile_speed_accel2 1.05
-set g_balance_devastator_homing_missile_speed_decel 0.9
-set g_balance_devastator_homing_missile_speed_max 1000
-set g_balance_devastator_homing_missile_speed_turnrate 0.25
-set g_balance_devastator_homing_missile_active 0
set g_balance_devastator_lifetime 30
set g_balance_devastator_radius 150
set g_balance_devastator_refire 1
set g_balance_devastator_guideratedelay 0.01
set g_balance_devastator_guidestop 0
set g_balance_devastator_health 30
-set g_balance_devastator_homing_missile_speed 500
-set g_balance_devastator_homing_missile_speed_accel 1.025
-set g_balance_devastator_homing_missile_speed_accel2 1.05
-set g_balance_devastator_homing_missile_speed_decel 0.9
-set g_balance_devastator_homing_missile_speed_max 1000
-set g_balance_devastator_homing_missile_speed_turnrate 0.25
-set g_balance_devastator_homing_missile_active 0
set g_balance_devastator_lifetime 10
set g_balance_devastator_radius 110
set g_balance_devastator_refire 1.2
set g_balance_devastator_guideratedelay 999
set g_balance_devastator_guidestop 1
set g_balance_devastator_health 30
-set g_balance_devastator_homing_missile_speed 500
-set g_balance_devastator_homing_missile_speed_accel 1.025
-set g_balance_devastator_homing_missile_speed_accel2 1.05
-set g_balance_devastator_homing_missile_speed_decel 0.9
-set g_balance_devastator_homing_missile_speed_max 1000
-set g_balance_devastator_homing_missile_speed_turnrate 0.25
-set g_balance_devastator_homing_missile_active 0
set g_balance_devastator_lifetime 20
set g_balance_devastator_radius 110
set g_balance_devastator_refire 0.9
set g_balance_devastator_guideratedelay 0.01
set g_balance_devastator_guidestop 0
set g_balance_devastator_health 30
-set g_balance_devastator_homing_missile_speed 500
-set g_balance_devastator_homing_missile_speed_accel 1.025
-set g_balance_devastator_homing_missile_speed_accel2 1.05
-set g_balance_devastator_homing_missile_speed_decel 0.9
-set g_balance_devastator_homing_missile_speed_max 1000
-set g_balance_devastator_homing_missile_speed_turnrate 0.25
-set g_balance_devastator_homing_missile_active 0
set g_balance_devastator_lifetime 10
set g_balance_devastator_radius 110
set g_balance_devastator_refire 1.1
trailspacing 16
underwater
velocityjitter 16 16 16
-effect nade_green
- type smoke
- alpha 100 100 250
- color 0x40ff9b 0x40ff9b
- sizeincrease -1
- size 3 3
- tex 65 65
- trailspacing 1
-effect nade_green
- type smoke
- alpha 30 30 150
- color 0xff0000 0xffa2a2
- notunderwater
- sizeincrease -10
- size 15 25
- tex 65 65
- trailspacing 8
-effect nade_green
- type bubble
- alpha 256 256 256
- bounce 1.500000
- color 0x40ff9b 0x40ff9b
- gravity -0.125000
- liquidfriction 4
- size 1 1
- tex 62 62
- trailspacing 16
- underwater
- velocityjitter 16 16 16
-effect nade_brown
- type smoke
- alpha 100 100 250
- color 0xa85400 0xa85400
- sizeincrease -1
- size 3 3
- tex 65 65
- trailspacing 1
-effect nade_brown
- type smoke
- alpha 30 30 150
- color 0xff0000 0xffa2a2
- notunderwater
- sizeincrease -10
- size 15 25
- tex 65 65
- trailspacing 8
-effect nade_brown
- type bubble
- alpha 256 256 256
- bounce 1.500000
- color 0xa85400 0xa85400
- gravity -0.125000
- liquidfriction 4
- size 1 1
- tex 62 62
- trailspacing 16
- underwater
- velocityjitter 16 16 16
-effect nade_purple
- type smoke
- alpha 100 100 250
- color 0x540054 0x540054
- sizeincrease -1
- size 3 3
- tex 65 65
- trailspacing 1
-effect nade_purple
- type smoke
- alpha 30 30 150
- color 0xff0000 0xffa2a2
- notunderwater
- sizeincrease -10
- size 15 25
- tex 65 65
- trailspacing 8
-effect nade_purple
- type bubble
- alpha 256 256 256
- bounce 1.500000
- color 0x540054 0x540054
- gravity -0.125000
- liquidfriction 4
- size 1 1
- tex 62 62
- trailspacing 16
- underwater
- velocityjitter 16 16 16
effect nade_red_burn
type smoke
alpha 100 100 250
tex 71 73
trailspacing 16
velocityjitter 10 10 10
-effect nade_green_burn
- type smoke
- alpha 100 100 250
- color 0x40ff9b 0xff3c00
- sizeincrease -1
- size 5 5
- tex 65 65
- trailspacing 1
-effect nade_green_burn
- type smoke
- alpha 200 200 1000
- color 0xff0000 0xffa2a2
- notunderwater
- sizeincrease -30
- size 45 25
- tex 65 65
- trailspacing 64
-effect nade_green_burn
- type bubble
- alpha 256 256 256
- bounce 1.500000
- color 0x40ff9b 0xff3c00
- gravity -0.125000
- liquidfriction 4
- size 1 1
- tex 62 62
- trailspacing 16
- underwater
- velocityjitter 16 16 16
-effect nade_green_burn
- type smoke
- alpha 300 900 1500
- color 0x40ff9b 0xff3c00
- originjitter 2 2 2
- rotate -180 180 20 -20
- sizeincrease -40
- size 15 25
- tex 71 73
- trailspacing 16
- velocityjitter 10 10 10
-effect nade_brown_burn
- type smoke
- alpha 100 100 250
- color 0xa85400 0xff3c00
- sizeincrease -1
- size 5 5
- tex 65 65
- trailspacing 1
-effect nade_brown_burn
- type smoke
- alpha 200 200 1000
- color 0xff0000 0xffa2a2
- notunderwater
- sizeincrease -30
- size 45 25
- tex 65 65
- trailspacing 64
-effect nade_brown_burn
- type bubble
- alpha 256 256 256
- bounce 1.500000
- color 0xa85400 0xff3c00
- gravity -0.125000
- liquidfriction 4
- size 1 1
- tex 62 62
- trailspacing 16
- underwater
- velocityjitter 16 16 16
-effect nade_brown_burn
- type smoke
- alpha 300 900 1500
- color 0xa85400 0xff3c00
- originjitter 2 2 2
- rotate -180 180 20 -20
- sizeincrease -40
- size 15 25
- tex 71 73
- trailspacing 16
- velocityjitter 10 10 10
-effect nade_purple_burn
- type smoke
- alpha 100 100 250
- color 0x540054 0xff3c00
- sizeincrease -1
- size 5 5
- tex 65 65
- trailspacing 1
-effect nade_purple_burn
- type smoke
- alpha 200 200 1000
- color 0xff0000 0xffa2a2
- notunderwater
- sizeincrease -30
- size 45 25
- tex 65 65
- trailspacing 64
-effect nade_purple_burn
- type bubble
- alpha 256 256 256
- bounce 1.500000
- color 0x540054 0xff3c00
- gravity -0.125000
- liquidfriction 4
- size 1 1
- tex 62 62
- trailspacing 16
- underwater
- velocityjitter 16 16 16
-effect nade_purple_burn
- type smoke
- alpha 300 900 1500
- color 0x540054 0xff3c00
- originjitter 2 2 2
- rotate -180 180 20 -20
- sizeincrease -40
- size 15 25
- tex 71 73
- trailspacing 16
- velocityjitter 10 10 10
effect nade_blue_explode
type decal
alpha 256 256 0
size 20 40
tex 71 73
velocityjitter 324 324 324
-effect nade_green_explode
- type decal
- alpha 256 256 0
- countabsolute 1
- lightcolor 100 20 20
- lightradiusfade 1500
- lightradius 300
- originjitter 26 26 26
- size 88 88
- tex 8 16
-effect nade_green_explode
- type smoke
- alpha 80 80 650
- color 0xff0000 0xffa2a2
- countabsolute 1
- sizeincrease 1800
- size 32 32
- tex 33 33
- velocitymultiplier 44
-effect nade_green_explode
- type smoke
- airfriction 30
- alpha 400 656 2000
- color 0x40ff9b 0xa647d3
- count 16
- notunderwater
- originjitter 50 50 50
- rotate -180 180 -9 9
- sizeincrease 555
- size 20 24
- tex 48 55
- velocityjitter 320 320 320
-effect nade_green_explode
- type spark
- airfriction -9
- alpha 1500 3000 13000
- color 0x40ff9b 0xff4200
- count 8
- sizeincrease 40
- size 60 90
- stretchfactor 80
- tex 48 55
- velocityjitter 30 30 30
-effect nade_green_explode
- type smoke
- airfriction 0.040000
- alpha 128 328 390
- blend alpha
- color 0x222222 0x000000
- count 32
- gravity 0.400000
- originjitter 50 50 10
- rotate -180 180 2 -2
- sizeincrease 50
- size 60 30
- tex 0 7
- velocityjitter 200 200 200
- velocityoffset 0 0 180
-effect nade_green_explode
- type bubble
- alpha 128 256 64
- bounce 1.500000
- color 0x404040 0x808080
- count 32
- gravity -0.125000
- liquidfriction 0.250000
- originjitter 16 16 16
- size 3 6
- tex 62 62
- underwater
- velocityjitter 196 196 196
-effect nade_green_explode
- type spark
- airfriction 1
- alpha 644 956 484
- bounce 1.600000
- color 0xff0000 0xffa2a2
- count 8
- gravity 1
- liquidfriction 0.800000
- notunderwater
- originjitter 16 16 16
- size 1 2
- tex 40 40
- velocityjitter 424 424 624
- velocityoffset 0 0 80
-effect nade_green_explode
- type spark
- airfriction 0.700000
- alpha 644 956 684
- color 0xff0000 0xffa2a2
- count 16
- gravity 0.500000
- liquidfriction 0.800000
- originjitter 16 16 16
- size 1 2
- tex 40 40
- velocityjitter 424 424 624
- velocityoffset 0 0 80
-effect nade_green_explode
- type smoke
- alpha 644 956 2500
- color 0xff0000 0xffa2a2
- count 8
- notunderwater
- originjitter 64 64 64
- rotate -180 180 -100 100
- size 20 40
- tex 71 73
- velocityjitter 324 324 324
-effect nade_brown_explode
- type decal
- alpha 256 256 0
- countabsolute 1
- lightcolor 100 20 20
- lightradiusfade 1500
- lightradius 300
- originjitter 26 26 26
- size 88 88
- tex 8 16
-effect nade_brown_explode
- type smoke
- alpha 80 80 650
- color 0xff0000 0xffa2a2
- countabsolute 1
- sizeincrease 1800
- size 32 32
- tex 33 33
- velocitymultiplier 44
-effect nade_brown_explode
- type smoke
- airfriction 30
- alpha 400 656 2000
- color 0xa85400 0xa647d3
- count 16
- notunderwater
- originjitter 50 50 50
- rotate -180 180 -9 9
- sizeincrease 555
- size 20 24
- tex 48 55
- velocityjitter 320 320 320
-effect nade_brown_explode
- type spark
- airfriction -9
- alpha 1500 3000 13000
- color 0xa85400 0xff4200
- count 8
- sizeincrease 40
- size 60 90
- stretchfactor 80
- tex 48 55
- velocityjitter 30 30 30
-effect nade_brown_explode
- type smoke
- airfriction 0.040000
- alpha 128 328 390
- blend alpha
- color 0x222222 0x000000
- count 32
- gravity 0.400000
- originjitter 50 50 10
- rotate -180 180 2 -2
- sizeincrease 50
- size 60 30
- tex 0 7
- velocityjitter 200 200 200
- velocityoffset 0 0 180
-effect nade_brown_explode
- type bubble
- alpha 128 256 64
- bounce 1.500000
- color 0x404040 0x808080
- count 32
- gravity -0.125000
- liquidfriction 0.250000
- originjitter 16 16 16
- size 3 6
- tex 62 62
- underwater
- velocityjitter 196 196 196
-effect nade_brown_explode
- type spark
- airfriction 1
- alpha 644 956 484
- bounce 1.600000
- color 0xff0000 0xffa2a2
- count 8
- gravity 1
- liquidfriction 0.800000
- notunderwater
- originjitter 16 16 16
- size 1 2
- tex 40 40
- velocityjitter 424 424 624
- velocityoffset 0 0 80
-effect nade_brown_explode
- type spark
- airfriction 0.700000
- alpha 644 956 684
- color 0xff0000 0xffa2a2
- count 16
- gravity 0.500000
- liquidfriction 0.800000
- originjitter 16 16 16
- size 1 2
- tex 40 40
- velocityjitter 424 424 624
- velocityoffset 0 0 80
-effect nade_brown_explode
- type smoke
- alpha 644 956 2500
- color 0xff0000 0xffa2a2
- count 8
- notunderwater
- originjitter 64 64 64
- rotate -180 180 -100 100
- size 20 40
- tex 71 73
- velocityjitter 324 324 324
-effect nade_purple_explode
- type decal
- alpha 256 256 0
- countabsolute 1
- lightcolor 100 20 20
- lightradiusfade 1500
- lightradius 300
- originjitter 26 26 26
- size 88 88
- tex 8 16
-effect nade_purple_explode
- type smoke
- alpha 80 80 650
- color 0xff0000 0xffa2a2
- countabsolute 1
- sizeincrease 1800
- size 32 32
- tex 33 33
- velocitymultiplier 44
-effect nade_purple_explode
- type smoke
- airfriction 30
- alpha 400 656 2000
- color 0x540054 0xa647d3
- count 16
- notunderwater
- originjitter 50 50 50
- rotate -180 180 -9 9
- sizeincrease 555
- size 20 24
- tex 48 55
- velocityjitter 320 320 320
-effect nade_purple_explode
- type spark
- airfriction -9
- alpha 1500 3000 13000
- color 0x540054 0xff4200
- count 8
- sizeincrease 40
- size 60 90
- stretchfactor 80
- tex 48 55
- velocityjitter 30 30 30
-effect nade_purple_explode
- type smoke
- airfriction 0.040000
- alpha 128 328 390
- blend alpha
- color 0x222222 0x000000
- count 32
- gravity 0.400000
- originjitter 50 50 10
- rotate -180 180 2 -2
- sizeincrease 50
- size 60 30
- tex 0 7
- velocityjitter 200 200 200
- velocityoffset 0 0 180
-effect nade_purple_explode
- type bubble
- alpha 128 256 64
- bounce 1.500000
- color 0x404040 0x808080
- count 32
- gravity -0.125000
- liquidfriction 0.250000
- originjitter 16 16 16
- size 3 6
- tex 62 62
- underwater
- velocityjitter 196 196 196
-effect nade_purple_explode
- type spark
- airfriction 1
- alpha 644 956 484
- bounce 1.600000
- color 0xff0000 0xffa2a2
- count 8
- gravity 1
- liquidfriction 0.800000
- notunderwater
- originjitter 16 16 16
- size 1 2
- tex 40 40
- velocityjitter 424 424 624
- velocityoffset 0 0 80
-effect nade_purple_explode
- type spark
- airfriction 0.700000
- alpha 644 956 684
- color 0xff0000 0xffa2a2
- count 16
- gravity 0.500000
- liquidfriction 0.800000
- originjitter 16 16 16
- size 1 2
- tex 40 40
- velocityjitter 424 424 624
- velocityoffset 0 0 80
-effect nade_purple_explode
- type smoke
- alpha 644 956 2500
- color 0xff0000 0xffa2a2
- count 8
- notunderwater
- originjitter 64 64 64
- rotate -180 180 -100 100
- size 20 40
- tex 71 73
- velocityjitter 324 324 324
effect shockwave_attack
type spark
airfriction 1
alias cl_hook_gamestart_ft
alias cl_hook_gamestart_inv
alias cl_hook_gamestart_duel
-alias cl_hook_gamestart_tka //LegendGuard adds team keepaway client hook from Mario/team_keepaway 15-02-2021
alias cl_hook_gameend "rpn /cl_matchcount dup load 1 + =" // increase match count every time a game ends
alias cl_hook_shutdown
alias cl_hook_activeweapon
alias sv_vote_gametype_hook_rc
alias sv_vote_gametype_hook_tdm
alias sv_vote_gametype_hook_duel
-alias sv_hook_gamestart_tka //LegendGuard adds team keepaway hook from Mario/team_keepaway 15-02-2021
// Example preset to allow 1v1ctf to be used for the gametype voting screen.
// Aliases can have max 31 chars so the gametype can have max 9 chars.
set g_duel_respawn_delay_max 0
set g_duel_respawn_waves 0
set g_duel_weapon_stay 0
-set g_tka_respawn_delay_small 0 //LegendGuard adds team keepaway cvars from Mario/team_keepaway 15-02-2021
-set g_tka_respawn_delay_small_count 0
-set g_tka_respawn_delay_large 0
-set g_tka_respawn_delay_large_count 0
-set g_tka_respawn_delay_max 0
-set g_tka_respawn_waves 0
-set g_tka_weapon_stay 0
-
// =========
set g_duel 0 "Duel: frag the opponent more in a one versus one arena battle"
//set g_duel_warmup 180 "Have a short warmup period before beginning the actual duel"
set g_duel_with_powerups 0 "Enable powerups to spawn in the duel gamemode"
-set g_duel_not_dm_maps 0 "when this is set, DM maps will NOT be listed in duel"
-
-//LegendGuard adds tema keepaway cvars from Mario/team_keepaway 15-02-2021
-// ===============
-// team keepaway
-// ===============
-set g_tka 0 "another game mode which focuses around a ball"
-set g_tka_on_dm_maps 0 "when this is set, all DM and KA maps automatically support TKA"
-set g_tka_teams 2 "how many teams are in team keepaway (set by mapinfo)"
-set g_tka_team_spawns 0 "when 1, players spawn from the team spawnpoints of the map, if any"
-set g_tka_teams_override 0 "how many teams are in team keepaway"
-set g_tka_point_limit -1 "TKA point limit overriding the mapinfo specified one (use 0 to play without limit, and -1 to use the mapinfo's limit)"
-set g_tka_point_leadlimit -1 "TKA point lead limit overriding the mapinfo specified one (use 0 to play without limit, and -1 to use the mapinfo's limit)"
-set g_tka_score_team 1 "allow points to be awarded to teammates for any kill when the ball is in your team's possession"
-set g_tka_score_bckill 1 "points for killing the ball barrier (Ball Carrier Kill)"
-set g_tka_score_killac 1 "points for kills while holding the ball (Kill As Carrier)"
-set g_tka_score_timeinterval 1 "amount of time it takes between intervals for timepoints to be added to the score"
-set g_tka_score_timepoints 0 "points to add to score per timeinterval, 0 for no points"
-set g_tka_ballcarrier_effects 8 "Add together the numbers you want: EF_ADDITIVE (32) / EF_NODEPTHTEST (8192) / EF_DIMLIGHT (8)"
-set g_tka_ballcarrier_highspeed 1 "speed multiplier done to the person holding the ball (recommended when used with some mutators)"
-set g_tka_ballcarrier_damage 1 "damage multiplier while holding the ball"
-set g_tka_ballcarrier_force 1 "force multiplier while holding the ball"
-set g_tka_ballcarrier_selfdamage 1 "self damage multiplier while holding the ball"
-set g_tka_ballcarrier_selfforce 1 "self force multiplier while holding the ball"
-set g_tka_noncarrier_warn 1 "warn players when they kill without holding the ball"
-set g_tka_noncarrier_damage 1 "damage done to other players if both you and they don't have the ball"
-set g_tka_noncarrier_force 1 "force done to other players if both you and they don't have the ball"
-set g_tka_noncarrier_selfdamage 1 "self damage if you don't have the ball"
-set g_tka_noncarrier_selfforce 1 "self force if you don't have the ball"
-set g_tkaball_effects 0 "Add together the numbers you want: EF_ADDITIVE (32) / EF_NODEPTHTEST (8192) / EF_DIMLIGHT (8)"
-set g_tkaball_trail_color 254 "particle trail color from player/ball"
-set g_tkaball_damageforcescale 3 "Scale of force which is applied to the ball by weapons/explosions/etc"
-set g_tkaball_respawntime 10 "if no one picks up the ball, how long to wait until the ball respawns"
\ No newline at end of file
+set g_duel_not_dm_maps 0 "when this is set, DM maps will NOT be listed in duel"
\ No newline at end of file
+++ /dev/null
-g_nades 1 // activate nades in the game
-
-set g_nades_nade_damage 70 // normal nade explosion damage
-
-set g_nades_bonus 1 // adding number of extra nades when it's obtained after time bonus
-
-set g_nades_bonus_client_select 1
-
-set g_nades_bonus_type 3 // limit of number of nades when a player had
-
-set g_nades_bonus_score_time 17 // time when someone is scoring, makes adding fast one nade extra more
-
-set g_nades_heal_foe -5 // when someone is not ally of the healing orb will take damage during a certain time if this is inside the orb
-
-set g_nades_napalm_ball_damage 60 // napalm explosion damage
-
-set g_nades_napalm_ball_lifetime 3 // napalm burning time after exploded
-
-set g_nades_napalm_burntime 2 // napalm burn time when someone is burning with those flames
-
-set g_nades_entrap_time 15 // entrap orb time
-
-set g_nades_nade_refire 10
-
-set g_nades_spawn_count 1
-
-set g_nades_veil_radius 520 // veil orb radius size
-
-set g_nades_veil_time 4 // veil orb time
-
-set g_nades_ice_freeze_time 2 // How long the ice field will last
-
-set g_nades_ice_health 5 // How much health the player will have after being unfrozen
-
-set g_nades_ice_teamcheck 0 // Don't freeze teammates
-
-set g_nades_ice_explode 1 // Whether the ice nade should explode again once the ice field dissipated
\ No newline at end of file
seta notification_INFO_SPECTATE_WARNING "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
seta notification_INFO_SUPERSPEC_MISSING_UID "2" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
seta notification_INFO_SUPERWEAPON_PICKUP "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
-
seta notification_INFO_TEAMCHANGE_LARGERTEAM "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
seta notification_INFO_TEAMCHANGE_NOTALLOWED "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
+
seta notification_INFO_VERSION_BETA "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
seta notification_INFO_VERSION_OLD "2" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
seta notification_INFO_VERSION_OUTDATED "2" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
seta notification_CENTER_SUPERWEAPON_BROKEN "1" "0 = off, 1 = centerprint"
seta notification_CENTER_SUPERWEAPON_LOST "1" "0 = off, 1 = centerprint"
seta notification_CENTER_SUPERWEAPON_PICKUP "1" "0 = off, 1 = centerprint"
-
seta notification_CENTER_TEAMCHANGE_AUTO "1" "0 = off, 1 = centerprint"
seta notification_CENTER_TEAMCHANGE "1" "0 = off, 1 = centerprint"
seta notification_CENTER_TEAMCHANGE_SPECTATE "1" "0 = off, 1 = centerprint"
seta notification_CENTER_TEAMCHANGE_SUICIDE "1" "0 = off, 1 = centerprint"
seta notification_CENTER_TIMEOUT_BEGINNING "1" "0 = off, 1 = centerprint"
seta notification_CENTER_TIMEOUT_ENDING "1" "0 = off, 1 = centerprint"
+
seta notification_CENTER_VEHICLE_ENTER "1" "0 = off, 1 = centerprint"
seta notification_CENTER_VEHICLE_ENTER_GUNNER "1" "0 = off, 1 = centerprint"
seta notification_CENTER_VEHICLE_ENTER_STEAL "1" "0 = off, 1 = centerprint"
#include <client/hud/panel/centerprint.qh>
#include <client/mutators/_mod.qh>
-
#include <common/notifications/all.qh>
#include <common/stats.qh>
#include <common/mapinfo.qh>
bool autocvar_hud_panel_scoreboard_playerid = false;
string autocvar_hud_panel_scoreboard_playerid_prefix = "#";
string autocvar_hud_panel_scoreboard_playerid_suffix = " ";
-
int average_ping[NUM_TEAMS];
// mode 0: returns translated label
// fields without a label (not networked via the score system)
case "ping": sbt_field[sbt_num_fields] = SP_PING; break;
case "pl": sbt_field[sbt_num_fields] = SP_PL; break;
- case "cn": sbt_field[sbt_num_fields] = SP_COUNTRY; break; //LegendGuard adds cn label for Country column 05-04-2021
case "name": case "nick": sbt_field[sbt_num_fields] = SP_NAME; have_name = true; break;
case "|": sbt_field[sbt_num_fields] = SP_SEPARATOR; have_separator = true; break;
case "kd": case "kdr": case "kdratio": sbt_field[sbt_num_fields] = SP_KDRATIO; break;
case "sum": case "diff": case "k-d": sbt_field[sbt_num_fields] = SP_SUM; break;
+ case "cn": sbt_field[sbt_num_fields] = SP_COUNTRY; break; //LegendGuard adds cn label for Country column 05-04-2021
case "frags": sbt_field[sbt_num_fields] = SP_FRAGS; break;
default: // fields with a label
{
tmp = bound(0, f / 0.2 + tmp / 0.04, 1); // 20% is REALLY BAD pl
sbt_field_rgb = '1 0.5 0.5' - '0 0.5 0.5' * tmp;
return str;
-
+
//LegendGuard adds Country REGISTER in the switch 05-04-2021
case SP_COUNTRY:
str = Scoreboard_GetCountrycode(pl);
sbt_field_rgb = '1 1 1';
return ((pl.ping == 0) ? _("N/A") : "..."); // if 0 ping, either connecting or bot (either case can't show proper score)
}
-
//sbt_field_rgb = HUD_Get_Num_Color(fps, 200, true);
sbt_field_rgb = '1 0 0' + '0 1 1' * (bound(0, fps, 60) / 60);
return ftos(fps);
sbt_fixcolumnwidth_iconlen = f;
}
-
if(sbt_fixcolumnwidth_iconlen != 0)
{
sbt_fixcolumnwidth_iconlen *= hud_fontsize.y / hud_fontsize.x; // fix icon aspect
drawpic(pos - tmp, sbt_field_icon2, vec2(hud_fontsize.x * sbt_fixcolumnwidth_iconlen, hud_fontsize.y), sbt_field_icon2_rgb, fg_alpha, DRAWFLAG_NORMAL);
if(sbt_field_icon3 != "") //LegendGuard adds conditional for Country column 05-04-2021
drawpic(pos - tmp, sbt_field_icon3, vec2(hud_fontsize.x * sbt_fixcolumnwidth_iconlen, hud_fontsize.y), sbt_field_icon1_rgb, fg_alpha, DRAWFLAG_NORMAL);
-
}
if(sbt_field[i] == SP_SEPARATOR)
vector Scoreboard_ItemStats_Draw(vector pos, vector rgb, vector bg_size)
{
+ Inventory g_inventory = inventoryslots[current_player];
scoreboard_itemstats_fade_alpha = min(scoreboard_fade_alpha, scoreboard_itemstats_fade_alpha + frametime * 10);
int disowned_cnt = 0;
bool have_item_stats;
bool Scoreboard_ItemStats_WouldDraw(float ypos)
{
+ Inventory g_inventory = inventoryslots[current_player];
+
if (MUTATOR_CALLHOOK(DrawScoreboardItemStats))
return false;
if (!autocvar_hud_panel_scoreboard_itemstats || !g_inventory || warmup_stage || ypos > 0.91 * vid_conheight)
}
if(!teamplay) return;
-
+
if (autocvar_hud_spectatorteamdisplay)
{
// Set vars
EFFECT(0, SPAWN_YELLOW, "spawn_event_yellow")
EFFECT(0, SPAWN_PINK, "spawn_event_pink")
EFFECT(0, SPAWN_NEUTRAL, "spawn_event_neutral")
-EFFECT(0, SPAWN_GREEN, "spawn_event_green")
-EFFECT(0, SPAWN_BROWN, "spawn_event_brown")
-EFFECT(0, SPAWN_PURPLE, "spawn_event_purple")
entity EFFECT_SPAWN(int teamid)
{
switch (teamid) {
nade(yellow, "0xFFFF0F", "0xFFFF0F", "0xFFFF0F", "0xFFFF0F")
nade(pink, "0xFF0FFF", "0xFF0FFF", "0xFF0FFF", "0xFF0FFF")
nade(neutral, "0xFFFFFF", "0xFFFFFF", "0xFFFFFF", "0xFFFFFF")
-nade(green, "0x40ff9b", "0x40ff9b", "0x40ff9b", "0xffa2a2")
-nade(brown, "0xa85400", "0xa85400", "0xa85400", "0xffa2a2")
-nade(purple, "0x540054", "0x540054", "0x540054", "0xffa2a2")
#undef nade
#define nade_burn(name, colormin1, colormax1, colormin2, colormax2) \
nade_burn(yellow, "0xFFFF0F", "0xFFFF0F", "0xFFFF0F", "0xFFFF0F")
nade_burn(pink, "0xFF0FFF", "0xFF0FFF", "0xFF0FFF", "0xFF0FFF")
nade_burn(neutral, "0xFFFFFF", "0xFFFFFF", "0xFFFFFF", "0xFFFFFF")
-nade_burn(green, "0x40ff9b", "0x40ff9b", "0x40ff9b", "0xffa2a2")
-nade_burn(brown, "0xa85400", "0xa85400", "0xa85400", "0xffa2a2")
-nade_burn(purple, "0x540054", "0x540054", "0x540054", "0xffa2a2")
#undef nade_burn
#define nade_explode(name, colorlight, colormin1, colormax1, colormin2, colormax2, colormin3, colormax3) \
nade_explode(yellow, '100.0 20.0 20.0', "0xff0000", "0xffa2a2", "0xFFFF0F", "0xFFFF0F", "0xff0000", "0xffa2a2")
nade_explode(pink, '100.0 20.0 20.0', "0xff0000", "0xffa2a2", "0xFF0FFF", "0xFF0FFF", "0xff0000", "0xffa2a2")
nade_explode(neutral, '100.0 20.0 20.0', "0xff0000", "0xffa2a2", "0xFFFFFF", "0xFFFFFF", "0xff0000", "0xffa2a2")
-nade_explode(green, '100.0 20.0 20.0', "0x40ff9b", "0xffa2a2", "0x40ff9b", "0x40ff9b", "0xff0000", "0xffa2a2")
-nade_explode(brown, '100.0 20.0 20.0', "0xa85400", "0xffa2a2", "0xa85400", "0xa85400", "0xff0000", "0xffa2a2")
-nade_explode(purple, '100.0 20.0 20.0', "0x540054", "0xffa2a2", "0x540054", "0x540054", "0xff0000", "0xffa2a2")
#undef nade_explode
{ WriteByte(chan, ent.activewepid); },
{ ent.activewepid = ReadByte(); })
-
#ifdef SVQC
int ENTCS_PUBLICMASK = 0, ENTCS_PRIVATEMASK = 0;
#include <common/gamemodes/gamemode/nexball/_mod.inc>
#include <common/gamemodes/gamemode/onslaught/_mod.inc>
#include <common/gamemodes/gamemode/race/_mod.inc>
-#include <common/gamemodes/gamemode/tdm/_mod.inc>
-#include <common/gamemodes/gamemode/tka/_mod.inc> //LegendGuard adds _mod.inc from Mario/team_keepaway 15-02-2021
\ No newline at end of file
+#include <common/gamemodes/gamemode/tdm/_mod.inc>
\ No newline at end of file
#include <common/gamemodes/gamemode/nexball/_mod.qh>
#include <common/gamemodes/gamemode/onslaught/_mod.qh>
#include <common/gamemodes/gamemode/race/_mod.qh>
-#include <common/gamemodes/gamemode/tdm/_mod.qh>
-#include <common/gamemodes/gamemode/tka/_mod.qh> //LegendGuard adds _mod.qh from Mario/team_keepaway 15-02-2021
+#include <common/gamemodes/gamemode/tdm/_mod.qh>
\ No newline at end of file
for (int i = 1; i <= NUM_TEAMS; ++i)
{
Team_SetNumberOfAlivePlayers(Team_GetTeamFromIndex(i), 0);
+ Team_SetNumberOfPlayers(Team_GetTeamFromIndex(i), 0);
}
- FOREACH_CLIENT(IS_PLAYER(it) && Entity_HasValidTeam(it),
+ FOREACH_CLIENT(Entity_HasValidTeam(it),
{
++total_players;
- if (IS_DEAD(it))
+ entity team_ = Entity_GetTeam(it);
+
+ int num_total = Team_GetNumberOfPlayers(team_);
+ ++num_total;
+ Team_SetNumberOfPlayers(team_, num_total);
+
+ if (IS_DEAD(it) || !IS_PLAYER(it))
{
continue;
}
- entity team_ = Entity_GetTeam(it);
+
int num_alive = Team_GetNumberOfAlivePlayers(team_);
++num_alive;
Team_SetNumberOfAlivePlayers(team_, num_alive);
void nades_Clear(entity player);
-//z411
entity ca_LastPlayer(float tm)
{
entity last_pl = NULL;
return last_pl;
}
+
float CA_CheckWinner()
{
if(round_handler_GetEndTime() > 0 && round_handler_GetEndTime() - time <= 0)
{
Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_ROUND_OVER);
Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_ROUND_OVER);
+ Send_Notification(NOTIF_ALL, NULL, MSG_ANNCE, ANNCE_ROUND_OVER);
FOREACH_CLIENT(IS_PLAYER(it), { nades_Clear(it); });
allowed_to_spawn = false;
- game_stopped = true;
+ if(autocvar_g_ca_round_stop)
+ game_stopped = true;
round_handler_Init(5, autocvar_g_ca_warmup, autocvar_g_ca_round_timelimit);
return 1;
}
}
int winner_team = CA_GetWinnerTeam();
- bool perfect = false; //z411
+ bool perfect = false;
if(winner_team > 0)
{
- //z411
- entity tm = Team_GetTeam(winner_team);
+ entity tm = Team_GetTeam(winner_team);
entity last_pl = ca_LastPlayer(winner_team);
if(last_pl && Team_GetNumberOfPlayers(tm) >= 3) {
Give_Medal(last_pl, DEFENSE);
}
- // ----
-
+
Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, APP_TEAM_NUM(winner_team, CENTER_ROUND_TEAM_WIN));
Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(winner_team, INFO_ROUND_TEAM_WIN));
+ if(fragsleft > 1) Send_Notification(NOTIF_ALL, NULL, MSG_ANNCE, APP_TEAM_NUM(winner_team, ANNCE_ROUND_TEAM_WIN));
TeamScore_AddToTeam(winner_team, ST_CA_ROUNDS, +1);
+
+ if (Team_GetNumberOfPlayers(tm) >= 3 &&
+ Team_GetNumberOfAlivePlayers(tm) == Team_GetNumberOfPlayers(tm))
+ perfect = true;
}
else if(winner_team == -1)
{
Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_ROUND_TIED);
Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_ROUND_TIED);
+ Send_Notification(NOTIF_ALL, NULL, MSG_ANNCE, ANNCE_ROUND_TIED);
}
allowed_to_spawn = false;
- game_stopped = true;
+ if(autocvar_g_ca_round_stop)
+ game_stopped = true;
round_handler_Init(5, autocvar_g_ca_warmup, autocvar_g_ca_round_timelimit);
FOREACH_CLIENT(IS_PLAYER(it), {
nades_Clear(it);
- //z411
// Give perfect medal if everyone in the winner team is alive
if(perfect && it.team == winner_team) {
Give_Medal(it, PERFECT);
return true;
}
+MUTATOR_HOOKFUNCTION(ca, Scores_CountFragsRemaining)
+{
+ // announce remaining frags
+ return true;
+}
+
MUTATOR_HOOKFUNCTION(ca, ClientConnect)
{
entity player = M_ARGV(0, entity);
if (!warmup_stage && round_handler_IsActive() && round_handler_IsRoundStarted())
{
entity pl = ca_LastPlayerForTeam(this);
- if (pl)
+ if (pl) {
Send_Notification(NOTIF_ONE, pl, MSG_CENTER, CENTER_ALONE);
+ Send_Notification(NOTIF_ONE, pl, MSG_ANNCE, ANNCE_ALONE);
+ }
}
}
return true;
}
-MUTATOR_HOOKFUNCTION(ca, Scores_CountFragsRemaining)
-{
- // announce remaining frags
- return true;
-}
-
MUTATOR_HOOKFUNCTION(ca, SpectateSet)
{
entity client = M_ARGV(0, entity);
int autocvar_g_ca_point_limit;
int autocvar_g_ca_point_leadlimit;
float autocvar_g_ca_round_timelimit;
+bool autocvar_g_ca_round_stop;
bool autocvar_g_ca_team_spawns;
//int autocvar_g_ca_teams;
int autocvar_g_ca_teams_override;
#pragma once
#include "ctf.qh"
+
#include <common/items/item/pickup.qh>
#include <common/mutators/base.qh>
#include <common/gamemodes/sv_rules.qh>
void nades_Clear(entity);
void nades_GiveBonus(entity player, float score);
-//z411
entity freezetag_LastPlayer(float tm)
{
entity last_pl = NULL;
{
Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_ROUND_OVER);
Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_ROUND_OVER);
+ Send_Notification(NOTIF_ALL, NULL, MSG_ANNCE, ANNCE_ROUND_OVER);
+
FOREACH_CLIENT(IS_PLAYER(it), {
it.freezetag_frozen_timeout = 0;
it.freezetag_revive_time = 0;
nades_Clear(it);
});
- game_stopped = true;
+ if(autocvar_g_freezetag_round_stop)
+ game_stopped = true;
round_handler_Init(5, autocvar_g_freezetag_warmup, autocvar_g_freezetag_round_timelimit);
return true;
}
int winner_team = freezetag_getWinnerTeam();
if(winner_team > 0)
{
- //z411
- entity last_pl = freezetag_LastPlayer(winner_team);
+ entity last_pl = freezetag_LastPlayer(winner_team);
if(last_pl) {
Give_Medal(last_pl, DEFENSE);
}
- // ----
-
- Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, APP_TEAM_NUM(winner_team, CENTER_ROUND_TEAM_WIN));
- Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(winner_team, INFO_ROUND_TEAM_WIN));
+
+ Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, APP_TEAM_NUM(winner_team, CENTER_ROUND_TEAM_SCORES));
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(winner_team, INFO_ROUND_TEAM_SCORES));
TeamScore_AddToTeam(winner_team, ST_FT_ROUNDS, +1);
+ if(fragsleft > 1) AnnounceScores(winner_team);
}
else if(winner_team == -1)
{
Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_ROUND_TIED);
Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_ROUND_TIED);
+ Send_Notification(NOTIF_ALL, NULL, MSG_ANNCE, ANNCE_ROUND_TIED);
}
FOREACH_CLIENT(IS_PLAYER(it), {
nades_Clear(it);
});
- game_stopped = true;
+ if(autocvar_g_freezetag_round_stop)
+ game_stopped = true;
round_handler_Init(5, autocvar_g_freezetag_warmup, autocvar_g_freezetag_round_timelimit);
return true;
}
if(round_handler_IsRoundStarted())
{
entity pl = freezetag_LastPlayerForTeam(this);
- if(pl)
+ if(pl) {
Send_Notification(NOTIF_ONE, pl, MSG_CENTER, CENTER_ALONE);
+ Send_Notification(NOTIF_ONE, pl, MSG_ANNCE, ANNCE_ALONE);
+ }
}
}
{
FOREACH_CLIENT(IS_PLAYER(it), {
CS(it).killcount = 0;
- it.freezetag_revive_time = 0;
- it.freezetag_frozen_timeout = -1;
- PutClientInServer(it);
+
+ if(autocvar_g_freezetag_round_respawn) {
+ it.freezetag_frozen_timeout = -1;
+ PutClientInServer(it);
+ } else {
+ ResetPlayerResources(it);
+ }
+
it.freezetag_frozen_timeout = 0;
});
freezetag_count_alive_players();
{
entity targ = M_ARGV(0, entity);
targ.freezetag_frozen_time = 0;
+
+ if(autocvar_g_freezetag_revive_respawn) {
+ targ.freezetag_frozen_timeout = -1;
+ PutClientInServer(targ);
+ }
+
targ.freezetag_frozen_timeout = 0;
}
Send_Notification(NOTIF_ONE, revivers_first, MSG_CENTER, CENTER_FREEZETAG_REVIVE, player.netname);
Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_FREEZETAG_REVIVED, player.netname, revivers_first.netname);
Give_Medal(revivers_first, ASSIST);
- if(autocvar_sv_eventlog)
+ if(autocvar_sv_eventlog)
{
string revivers = "";
for(entity it = revivers_first; it; it = it.chain)
bool autocvar_g_freezetag_team_spawns;
string autocvar_g_freezetag_weaponarena = "most_available";
+bool autocvar_g_freezetag_round_respawn;
+bool autocvar_g_freezetag_round_stop;
+
const int ST_FT_ROUNDS = 1;
void freezetag_Initialize();
float autocvar_g_freezetag_revive_time_to_score = 1.5;
bool autocvar_g_freezetag_revive_nade;
float autocvar_g_freezetag_revive_nade_health;
+bool autocvar_g_freezetag_revive_respawn;
player.race_movetime_frac -= f;
player.race_movetime_count += f;
player.race_movetime = player.race_movetime_frac + player.race_movetime_count;
-
+
if(IS_PLAYER(player))
{
if (player.race_penalty)
+++ /dev/null
-// generated file; do not modify
-#include <common/gamemodes/gamemode/tka/tka.qc>
-#ifdef CSQC
- #include <common/gamemodes/gamemode/tka/cl_tka.qc>
-#endif
-#ifdef SVQC
- #include <common/gamemodes/gamemode/tka/sv_tka.qc>
-#endif
+++ /dev/null
-// generated file; do not modify
-#include <common/gamemodes/gamemode/tka/tka.qh>
-#ifdef CSQC
- #include <common/gamemodes/gamemode/tka/cl_tka.qh>
-#endif
-#ifdef SVQC
- #include <common/gamemodes/gamemode/tka/sv_tka.qh>
-#endif
+++ /dev/null
-#include "cl_tka.qh"
-
-#include <client/draw.qh>
-#include <client/hud/panel/modicons.qh>
-
-// Keepaway HUD mod icon
-int tkaball_prevstatus; // last remembered status
-float tkaball_statuschange_time; // time when the status changed
-
-// we don't need to reset for team keepaway since it immediately
-// autocorrects prevstatus as to if the player has the ball or not
-
-void HUD_Mod_TeamKeepaway(vector pos, vector mySize)
-{
- mod_active = 1; // team keepaway should always show the mod HUD
-
- float tkaball_alpha = blink(0.85, 0.15, 5);
-
- int stat_items = STAT(TKA_BALLSTATUS);
- int tkaball = (stat_items & TKA_BALL_CARRYING);
-
- if(tkaball != tkaball_prevstatus)
- {
- tkaball_statuschange_time = time;
- tkaball_prevstatus = tkaball;
- }
-
- vector tkaball_pos, tkaball_size;
-
- if(mySize.x > mySize.y) {
- tkaball_pos = pos + eX * 0.25 * mySize.x;
- tkaball_size = vec2(0.5 * mySize.x, mySize.y);
- } else {
- tkaball_pos = pos + eY * 0.25 * mySize.y;
- tkaball_size = vec2(mySize.x, 0.5 * mySize.y);
- }
-
- float tkaball_statuschange_elapsedtime = time - tkaball_statuschange_time;
- float f = bound(0, tkaball_statuschange_elapsedtime*2, 1);
-
- if(tkaball_prevstatus && f < 1)
- drawpic_aspect_skin_expanding(tkaball_pos, "keepawayball_carrying", tkaball_size, '1 1 1', panel_fg_alpha * tkaball_alpha, DRAWFLAG_NORMAL, f);
-
- if(stat_items & TKA_BALL_CARRYING) // TODO: unique team based icon while carrying
- drawpic_aspect_skin(pos, "keepawayball_carrying", vec2(mySize.x, mySize.y), '1 1 1', panel_fg_alpha * tkaball_alpha * f, DRAWFLAG_NORMAL);
- else if(stat_items & TKA_BALL_TAKEN_RED)
- drawpic_aspect_skin(pos, "tka_taken_red", vec2(mySize.x, mySize.y), '1 1 1', panel_fg_alpha * tkaball_alpha * f, DRAWFLAG_NORMAL);
- else if(stat_items & TKA_BALL_TAKEN_RED)
- drawpic_aspect_skin(pos, "tka_taken_blue", vec2(mySize.x, mySize.y), '1 1 1', panel_fg_alpha * tkaball_alpha * f, DRAWFLAG_NORMAL);
- else if(stat_items & TKA_BALL_TAKEN_RED)
- drawpic_aspect_skin(pos, "tka_taken_yellow", vec2(mySize.x, mySize.y), '1 1 1', panel_fg_alpha * tkaball_alpha * f, DRAWFLAG_NORMAL);
- else if(stat_items & TKA_BALL_TAKEN_RED)
- drawpic_aspect_skin(pos, "tka_taken_pink", vec2(mySize.x, mySize.y), '1 1 1', panel_fg_alpha * tkaball_alpha * f, DRAWFLAG_NORMAL);
-
-}
+++ /dev/null
-#pragma once
-
-void HUD_Mod_TeamKeepaway(vector pos, vector mySize);
+++ /dev/null
-#include "sv_tka.qh"
-
-#include <common/effects/all.qh>
-
-.entity ballcarried;
-
-int autocvar_g_tka_ballcarrier_effects;
-float autocvar_g_tka_ballcarrier_damage;
-float autocvar_g_tka_ballcarrier_force;
-float autocvar_g_tka_ballcarrier_highspeed;
-float autocvar_g_tka_ballcarrier_selfdamage;
-float autocvar_g_tka_ballcarrier_selfforce;
-float autocvar_g_tka_noncarrier_damage;
-float autocvar_g_tka_noncarrier_force;
-float autocvar_g_tka_noncarrier_selfdamage;
-float autocvar_g_tka_noncarrier_selfforce;
-bool autocvar_g_tka_noncarrier_warn;
-int autocvar_g_tka_score_bckill;
-int autocvar_g_tka_score_killac;
-bool autocvar_g_tka_score_team;
-int autocvar_g_tka_score_timepoints;
-float autocvar_g_tka_score_timeinterval;
-float autocvar_g_tkaball_damageforcescale;
-int autocvar_g_tkaball_effects;
-float autocvar_g_tkaball_respawntime;
-int autocvar_g_tkaball_trail_color;
-
-bool tka_ballcarrier_waypointsprite_visible_for_player(entity this, entity player, entity view) // runs on waypoints which are attached to ballcarriers, updates once per frame
-{
- if(view.ballcarried)
- if(IS_SPEC(player))
- return false; // we don't want spectators of the ballcarrier to see the attached waypoint on the top of their screen
-
- // TODO: Make the ballcarrier lack a waypointsprite whenever they have the invisibility powerup
-
- return true;
-}
-
-void tka_EventLog(string mode, entity actor) // use an alias for easy changing and quick editing later
-{
- if(autocvar_sv_eventlog)
- GameLogEcho(strcat(":tka:", mode, ((actor != NULL) ? (strcat(":", ftos(actor.team), ":", ftos(actor.playerid))) : "")));
-}
-
-void tka_TouchEvent(entity this, entity toucher);
-void tka_RespawnBall(entity this) // runs whenever the ball needs to be relocated
-{
- if(game_stopped) return;
- vector oldballorigin = this.origin;
-
- if(!MoveToRandomMapLocation(this, DPCONTENTS_SOLID | DPCONTENTS_CORPSE | DPCONTENTS_PLAYERCLIP, DPCONTENTS_SLIME | DPCONTENTS_LAVA | DPCONTENTS_SKY | DPCONTENTS_BODY | DPCONTENTS_DONOTENTER, Q3SURFACEFLAG_SKY, 10, 1024, 256))
- {
- entity spot = SelectSpawnPoint(this, true);
- setorigin(this, spot.origin);
- this.angles = spot.angles;
- }
-
- makevectors(this.angles);
- set_movetype(this, MOVETYPE_BOUNCE);
- this.velocity = '0 0 200';
- this.angles = '0 0 0';
- this.effects = autocvar_g_tkaball_effects;
- settouch(this, tka_TouchEvent);
- setthink(this, tka_RespawnBall);
- this.nextthink = time + autocvar_g_tkaball_respawntime;
- navigation_dynamicgoal_set(this, NULL);
-
- Send_Effect(EFFECT_ELECTRO_COMBO, oldballorigin, '0 0 0', 1);
- Send_Effect(EFFECT_ELECTRO_COMBO, this.origin, '0 0 0', 1);
-
- WaypointSprite_Spawn(WP_KaBall, 0, 0, this, '0 0 64', NULL, this.team, this, waypointsprite_attachedforcarrier, false, RADARICON_FLAGCARRIER);
- WaypointSprite_Ping(this.waypointsprite_attachedforcarrier);
-
- sound(this, CH_TRIGGER, SND_KA_RESPAWN, VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere)
-}
-
-void tka_TimeScoring(entity this)
-{
- if(this.owner.ballcarried)
- { // add points for holding the ball after a certain amount of time
- if(autocvar_g_tka_score_timepoints)
- GameRules_scoring_add_team(this.owner, SCORE, autocvar_g_tka_score_timepoints);
-
- GameRules_scoring_add(this.owner, TKA_BCTIME, (autocvar_g_tka_score_timeinterval / 1)); // interval is divided by 1 so that time always shows "seconds"
- this.nextthink = time + autocvar_g_tka_score_timeinterval;
- }
-}
-
-void tka_TouchEvent(entity this, entity toucher) // runs any time that the ball comes in contact with something
-{
- if (!this || game_stopped)
- return;
-
- if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)
- { // The ball fell off the map, respawn it since players can't get to it
- tka_RespawnBall(this);
- return;
- }
- if(IS_DEAD(toucher)) { return; }
- if(STAT(FROZEN, toucher)) { return; }
- if (!IS_PLAYER(toucher))
- { // The ball just touched an object, most likely the world
- Send_Effect(EFFECT_BALL_SPARKS, this.origin, '0 0 0', 1);
- sound(this, CH_TRIGGER, SND_KA_TOUCH, VOL_BASE, ATTEN_NORM);
- return;
- }
- else if(this.wait > time) { return; }
-
- // attach the ball to the player
- this.owner = toucher;
- toucher.ballcarried = this;
- GameRules_scoring_vip(toucher, true);
- setattachment(this, toucher, "");
- setorigin(this, '0 0 0');
-
- // make the ball invisible/unable to do anything/set up time scoring
- this.velocity = '0 0 0';
- set_movetype(this, MOVETYPE_NONE);
- this.effects |= EF_NODRAW;
- settouch(this, func_null);
- setthink(this, tka_TimeScoring);
- this.nextthink = time + autocvar_g_tka_score_timeinterval;
- this.takedamage = DAMAGE_NO;
- navigation_dynamicgoal_unset(this);
-
- // apply effects to player
- toucher.glow_color = autocvar_g_tkaball_trail_color;
- toucher.glow_trail = true;
- toucher.effects |= autocvar_g_tka_ballcarrier_effects;
-
- // messages and sounds
- tka_EventLog("pickup", toucher);
- Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_KEEPAWAY_PICKUP, toucher.netname);
- Send_Notification(NOTIF_ALL_EXCEPT, toucher, MSG_CENTER, CENTER_KEEPAWAY_PICKUP, toucher.netname);
- Send_Notification(NOTIF_ONE, toucher, MSG_CENTER, CENTER_KEEPAWAY_PICKUP_SELF);
- sound(this.owner, CH_TRIGGER, SND_KA_PICKEDUP, VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere)
-
- // scoring
- GameRules_scoring_add(toucher, TKA_PICKUPS, 1);
-
- // waypoints
- WaypointSprite_AttachCarrier(WP_Null, toucher, RADARICON_FLAGCARRIER);
- toucher.waypointsprite_attachedforcarrier.colormod = colormapPaletteColor(toucher.team - 1, 0);
- toucher.waypointsprite_attachedforcarrier.waypointsprite_visible_for_player = tka_ballcarrier_waypointsprite_visible_for_player;
- WaypointSprite_UpdateRule(toucher.waypointsprite_attachedforcarrier, toucher.team, SPRITERULE_TEAMPLAY);
- if(toucher.team == NUM_TEAM_1)
- WaypointSprite_UpdateSprites(toucher.waypointsprite_attachedforcarrier, WP_TkaBallCarrierRed, WP_KaBallCarrier, WP_TkaBallCarrierRed);
- else if(toucher.team == NUM_TEAM_2)
- WaypointSprite_UpdateSprites(toucher.waypointsprite_attachedforcarrier, WP_TkaBallCarrierBlue, WP_KaBallCarrier, WP_TkaBallCarrierBlue);
- else if(toucher.team == NUM_TEAM_3)
- WaypointSprite_UpdateSprites(toucher.waypointsprite_attachedforcarrier, WP_TkaBallCarrierYellow, WP_KaBallCarrier, WP_TkaBallCarrierYellow);
- else if(toucher.team == NUM_TEAM_4)
- WaypointSprite_UpdateSprites(toucher.waypointsprite_attachedforcarrier, WP_TkaBallCarrierPink, WP_KaBallCarrier, WP_TkaBallCarrierPink);
- WaypointSprite_Ping(toucher.waypointsprite_attachedforcarrier);
- WaypointSprite_Kill(this.waypointsprite_attachedforcarrier);
-}
-
-void tka_PlayerReset(entity plyr)
-{
- plyr.ballcarried = NULL;
- GameRules_scoring_vip(plyr, false);
- WaypointSprite_Kill(plyr.waypointsprite_attachedforcarrier);
-
- // reset the player effects
- plyr.glow_trail = false;
- plyr.effects &= ~autocvar_g_tka_ballcarrier_effects;
-}
-
-void tka_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, NULL, "");
- set_movetype(ball, MOVETYPE_BOUNCE);
- ball.wait = time + 1;
- settouch(ball, tka_TouchEvent);
- setthink(ball, tka_RespawnBall);
- ball.nextthink = time + autocvar_g_tkaball_respawntime;
- 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 = NULL;
- navigation_dynamicgoal_set(ball, plyr);
-
- // messages and sounds
- tka_EventLog("dropped", plyr);
- Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_KEEPAWAY_DROPPED, plyr.netname);
- Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_KEEPAWAY_DROPPED, plyr.netname);
- sound(NULL, CH_TRIGGER, SND_KA_DROPPED, VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere)
-
- // waypoints
- WaypointSprite_Spawn(WP_KaBall, 0, 0, ball, '0 0 64', NULL, ball.team, ball, waypointsprite_attachedforcarrier, false, RADARICON_FLAGCARRIER);
- WaypointSprite_UpdateRule(ball.waypointsprite_attachedforcarrier, 0, SPRITERULE_DEFAULT);
- WaypointSprite_Ping(ball.waypointsprite_attachedforcarrier);
-
- tka_PlayerReset(plyr);
-}
-
-.bool pushable;
-
-MODEL(TKA_BALL, "models/orbs/orbblue.md3");
-
-void tka_RemoveBall()
-{
- entity plyr = tka_ball.owner;
- if (plyr) // it was attached
- tka_PlayerReset(plyr);
- else
- WaypointSprite_DetachCarrier(tka_ball);
- delete(tka_ball);
- tka_ball = NULL;
-}
-
-void tka_SpawnBall()
-{
- entity e = new(keepawayball);
- setmodel(e, MDL_TKA_BALL);
- 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.damageforcescale = autocvar_g_tkaball_damageforcescale;
- e.takedamage = DAMAGE_YES;
- e.solid = SOLID_TRIGGER;
- set_movetype(e, MOVETYPE_BOUNCE);
- e.glow_color = autocvar_g_tkaball_trail_color;
- e.glow_trail = true;
- e.flags = FL_ITEM;
- IL_PUSH(g_items, e);
- e.pushable = true;
- settouch(e, tka_TouchEvent);
- e.owner = NULL;
- tka_ball = e;
- navigation_dynamicgoal_init(tka_ball, false);
-
- InitializeEntity(e, tka_RespawnBall, INITPRIO_SETLOCATION); // is this the right priority? Neh, I have no idea.. Well-- it works! So.
-}
-
-void tka_Handler_CheckBall(entity this)
-{
- if(time < game_starttime)
- {
- if (tka_ball)
- tka_RemoveBall();
- }
- else
- {
- if (!tka_ball)
- tka_SpawnBall();
- }
-
- this.nextthink = time;
-}
-
-void tka_DelayedInit(entity this) // run at the start of a match, initiates game mode
-{
- tka_Handler = new(tka_Handler);
- setthink(tka_Handler, tka_Handler_CheckBall);
- tka_Handler.nextthink = time;
-}
-
-
-// ================
-// Bot player logic
-// ================
-
-void havocbot_goalrating_tkaball(entity this, float ratingscale, vector org)
-{
- entity ball_owner = tka_ball.owner;
-
- if (ball_owner == this || SAME_TEAM(ball_owner, this)) // TODO: defend ball carrier?
- return;
-
- if (ball_owner)
- navigation_routerating(this, ball_owner, ratingscale, 2000);
- else
- navigation_routerating(this, tka_ball, ratingscale, 2000);
-}
-
-void havocbot_role_tka_carrier(entity this)
-{
- if (IS_DEAD(this))
- return;
-
- if (navigation_goalrating_timeout(this))
- {
- navigation_goalrating_start(this);
- havocbot_goalrating_items(this, 10000, this.origin, 10000);
- havocbot_goalrating_enemyplayers(this, 10000, this.origin, 10000);
- havocbot_goalrating_waypoints(this, 1, this.origin, 3000);
- navigation_goalrating_end(this);
-
- navigation_goalrating_timeout_set(this);
- }
-
- if (!this.ballcarried)
- {
- this.havocbot_role = havocbot_role_tka_collector;
- navigation_goalrating_timeout_expire(this, 2);
- }
-}
-
-void havocbot_role_tka_collector(entity this)
-{
- if (IS_DEAD(this))
- return;
-
- if (navigation_goalrating_timeout(this))
- {
- navigation_goalrating_start(this);
- havocbot_goalrating_items(this, 10000, this.origin, 10000);
- havocbot_goalrating_enemyplayers(this, 500, this.origin, 10000);
- havocbot_goalrating_tkaball(this, 8000, this.origin);
- navigation_goalrating_end(this);
-
- navigation_goalrating_timeout_set(this);
- }
-
- if (this.ballcarried)
- {
- this.havocbot_role = havocbot_role_tka_carrier;
- navigation_goalrating_timeout_expire(this, 2);
- }
-}
-
-
-// ==============
-// Hook Functions
-// ==============
-
-MUTATOR_HOOKFUNCTION(tka, PlayerDies)
-{
- entity frag_attacker = M_ARGV(1, entity);
- entity frag_target = M_ARGV(2, entity);
-
- if(frag_attacker != frag_target && IS_PLAYER(frag_attacker) && DIFF_TEAM(frag_attacker, frag_target))
- {
- if(frag_target.ballcarried) { // add to amount of times killing carrier
- GameRules_scoring_add(frag_attacker, TKA_CARRIERKILLS, 1);
- if(autocvar_g_tka_score_bckill) // add bckills to the score
- GameRules_scoring_add_team(frag_attacker, SCORE, autocvar_g_tka_score_bckill);
- }
- else if(!frag_attacker.ballcarried && !(autocvar_g_tka_score_team && SAME_TEAM(tka_ball.owner, frag_attacker)))
- {
- if(autocvar_g_tka_noncarrier_warn)
- Send_Notification(NOTIF_ONE_ONLY, frag_attacker, MSG_CENTER, CENTER_KEEPAWAY_WARN);
- }
-
- if(frag_attacker.ballcarried || (autocvar_g_tka_score_team && SAME_TEAM(tka_ball.owner, frag_attacker))) // add to amount of kills while ballcarrier (or if team scoring is enabled)
- GameRules_scoring_add_team(frag_attacker, SCORE, autocvar_g_tka_score_killac);
- }
-
- if(frag_target.ballcarried) { tka_DropEvent(frag_target); } // a player with the ball has died, drop it
-}
-
-MUTATOR_HOOKFUNCTION(tka, GiveFragsForKill)
-{
- M_ARGV(2, float) = 0; // no frags counted in keepaway
- return true; // you deceptive little bugger ;3 This needs to be true in order for this function to even count.
-}
-
-MUTATOR_HOOKFUNCTION(tka, Scores_CountFragsRemaining)
-{
- // announce remaining frags, but only when timed scoring is off
- return !autocvar_g_tka_score_timepoints;
-}
-
-MUTATOR_HOOKFUNCTION(tka, PlayerPreThink)
-{
- entity player = M_ARGV(0, entity);
-
- // clear the item used for the ball in keepaway
- STAT(TKA_BALLSTATUS, player) &= ~(TKA_BALL_TAKEN_RED | TKA_BALL_TAKEN_BLUE | TKA_BALL_TAKEN_YELLOW | TKA_BALL_TAKEN_PINK | TKA_BALL_CARRYING | TKA_BALL_DROPPED);
-
- // if the player has the ball, make sure they have the item for it (Used for HUD primarily)
- if(player.ballcarried)
- STAT(TKA_BALLSTATUS, player) |= TKA_BALL_CARRYING;
-
- if(!tka_ball.owner)
- STAT(TKA_BALLSTATUS, player) |= TKA_BALL_DROPPED;
- else
- {
- // TODO: teamless carrier?
- switch(tka_ball.owner.team)
- {
- case NUM_TEAM_1: STAT(TKA_BALLSTATUS, player) |= TKA_BALL_TAKEN_RED; break;
- case NUM_TEAM_2: STAT(TKA_BALLSTATUS, player) |= TKA_BALL_TAKEN_BLUE; break;
- case NUM_TEAM_3: STAT(TKA_BALLSTATUS, player) |= TKA_BALL_TAKEN_YELLOW; break;
- case NUM_TEAM_4: STAT(TKA_BALLSTATUS, player) |= TKA_BALL_TAKEN_PINK; break;
- }
- }
-}
-
-MUTATOR_HOOKFUNCTION(tka, PlayerUseKey)
-{
- entity player = M_ARGV(0, entity);
-
- if(MUTATOR_RETURNVALUE == 0)
- if(player.ballcarried)
- {
- tka_DropEvent(player);
- return true;
- }
-}
-
-MUTATOR_HOOKFUNCTION(tka, Damage_Calculate) // for changing damage and force values that are applied to players in g_damage.qc
-{
- entity frag_attacker = M_ARGV(1, entity);
- entity frag_target = M_ARGV(2, entity);
- float frag_damage = M_ARGV(4, float);
- vector frag_force = M_ARGV(6, vector);
-
- if(frag_attacker.ballcarried) // if the attacker is a ballcarrier
- {
- if(frag_target == frag_attacker) // damage done to yourself
- {
- frag_damage *= autocvar_g_tka_ballcarrier_selfdamage;
- frag_force *= autocvar_g_tka_ballcarrier_selfforce;
- }
- else // damage done to noncarriers
- {
- frag_damage *= autocvar_g_tka_ballcarrier_damage;
- frag_force *= autocvar_g_tka_ballcarrier_force;
- }
- }
- else if (IS_PLAYER(frag_attacker) && !frag_target.ballcarried) // if the target is a noncarrier
- {
- if(frag_target == frag_attacker) // damage done to yourself
- {
- frag_damage *= autocvar_g_tka_noncarrier_selfdamage;
- frag_force *= autocvar_g_tka_noncarrier_selfforce;
- }
- else // damage done to other noncarriers
- {
- frag_damage *= autocvar_g_tka_noncarrier_damage;
- frag_force *= autocvar_g_tka_noncarrier_force;
- }
- }
-
- M_ARGV(4, float) = frag_damage;
- M_ARGV(6, vector) = frag_force;
-}
-
-MUTATOR_HOOKFUNCTION(tka, ClientDisconnect)
-{
- entity player = M_ARGV(0, entity);
-
- if(player.ballcarried) { tka_DropEvent(player); } // a player with the ball has left the match, drop it
-}
-
-MUTATOR_HOOKFUNCTION(tka, MakePlayerObserver)
-{
- entity player = M_ARGV(0, entity);
-
- if(player.ballcarried) { tka_DropEvent(player); } // a player with the ball has left the match, drop it
-}
-
-MUTATOR_HOOKFUNCTION(tka, PlayerPowerups)
-{
- entity player = M_ARGV(0, entity);
-
- // In the future this hook is supposed to allow me to do some extra stuff with waypointsprites and invisibility powerup
- // So bare with me until I can fix a certain bug with tka_ballcarrier_waypointsprite_visible_for_player()
-
- player.effects &= ~autocvar_g_tka_ballcarrier_effects;
-
- if(player.ballcarried)
- player.effects |= autocvar_g_tka_ballcarrier_effects;
-}
-
-
-MUTATOR_HOOKFUNCTION(tka, PlayerPhysics_UpdateStats)
-{
- entity player = M_ARGV(0, entity);
- // these automatically reset, no need to worry
-
- if(player.ballcarried)
- STAT(MOVEVARS_HIGHSPEED, player) *= autocvar_g_tka_ballcarrier_highspeed;
-}
-
-MUTATOR_HOOKFUNCTION(tka, BotShouldAttack)
-{
- entity bot = M_ARGV(0, entity);
- entity targ = M_ARGV(1, entity);
-
- // if neither player has ball then don't attack unless the ball is on the ground
- if(!targ.ballcarried && !bot.ballcarried && tka_ball.owner && !(autocvar_g_tka_score_team && SAME_TEAM(tka_ball.owner, bot)))
- return true;
-}
-
-MUTATOR_HOOKFUNCTION(tka, HavocBot_ChooseRole)
-{
- entity bot = M_ARGV(0, entity);
-
- if (bot.ballcarried)
- bot.havocbot_role = havocbot_role_tka_carrier;
- else
- bot.havocbot_role = havocbot_role_tka_collector;
- return true;
-}
-
-MUTATOR_HOOKFUNCTION(tka, DropSpecialItems)
-{
- entity frag_target = M_ARGV(0, entity);
-
- if(frag_target.ballcarried)
- tka_DropEvent(frag_target);
-}
-
-MUTATOR_HOOKFUNCTION(tka, SpectateCopy)
-{
- entity spectatee = M_ARGV(0, entity);
- entity client = M_ARGV(1, entity);
-
- STAT(TKA_BALLSTATUS, client) = STAT(TKA_BALLSTATUS, spectatee);
-}
-
-MUTATOR_HOOKFUNCTION(tka, TeamBalance_CheckAllowedTeams, CBC_ORDER_EXCLUSIVE)
-{
- M_ARGV(0, float) = tka_teams;
- return true;
-}
+++ /dev/null
-#pragma once
-
-#include <common/mutators/base.qh>
-int autocvar_g_tka_point_limit;
-int autocvar_g_tka_point_leadlimit;
-bool autocvar_g_tka_team_spawns;
-void tka_DelayedInit(entity this);
-
-int tka_teams;
-//int autocvar_g_tka_teams;
-int autocvar_g_tka_teams_override;
-
-REGISTER_MUTATOR(tka, false)
-{
- MUTATOR_STATIC();
- MUTATOR_ONADD
- {
- GameRules_teams(true);
- GameRules_spawning_teams(autocvar_g_tka_team_spawns);
- GameRules_limit_score(autocvar_g_tka_point_limit);
- GameRules_limit_lead(autocvar_g_tka_point_leadlimit);
-
- tka_teams = autocvar_g_tka_teams_override;
- if(tka_teams < 2)
- tka_teams = cvar("g_tka_teams"); // read the cvar directly as it gets written earlier in the same frame
- tka_teams = BITS(bound(2, tka_teams, 4));
- GameRules_scoring(tka_teams, SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_PRIMARY, {
- field(SP_TKA_PICKUPS, "pickups", 0);
- field(SP_TKA_CARRIERKILLS, "bckills", 0);
- field(SP_TKA_BCTIME, "bctime", SFL_SORT_PRIO_SECONDARY);
- });
-
- InitializeEntity(NULL, tka_DelayedInit, INITPRIO_GAMETYPE);
- }
- return false;
-}
-
-
-entity tka_ball;
-entity tka_Handler;
-
-void(entity this) havocbot_role_tka_carrier;
-void(entity this) havocbot_role_tka_collector;
-
-void tka_DropEvent(entity plyr);
+++ /dev/null
-#include "tka.qh"
+++ /dev/null
-#pragma once
-
-#include <common/gamemodes/gamemode/deathmatch/deathmatch.qh>
-#include <common/gamemodes/gamemode/keepaway/keepaway.qh>
-#include <common/mapinfo.qh>
-#if defined(CSQC)
- #include <common/gamemodes/gamemode/tka/cl_tka.qh>
-#endif
-
-CLASS(TeamKeepaway, Gametype)
- INIT(TeamKeepaway)
- {
- this.gametype_init(this, _("Team Keepaway"),"tka","g_tka",GAMETYPE_FLAG_TEAMPLAY | GAMETYPE_FLAG_USEPOINTS,"","timelimit=15 pointlimit=50 teams=2 leadlimit=0",_("Keep the ball in your team's possession to get points for kills"));
- }
- METHOD(TeamKeepaway, m_parse_mapinfo, bool(string k, string v))
- {
- if (!k) {
- cvar_set("g_tka_teams", cvar_defstring("g_tka_teams"));
- return true;
- }
- switch (k) {
- case "teams":
- cvar_set("g_tka_teams", v);
- return true;
- }
- return false;
- }
- METHOD(TeamKeepaway, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
- {
- if(spawnpoints >= 8 && diameter > 4096)
- return true;
- return false;
- }
- METHOD(TeamKeepaway, m_isForcedSupported, bool(Gametype this))
- {
- if(cvar("g_tka_on_dm_maps"))
- {
- // if this is set, all DM and KA maps support TKA too
- if(!(MapInfo_Map_supportedGametypes & this.m_flags) && ((MapInfo_Map_supportedGametypes & MAPINFO_TYPE_DEATHMATCH.m_flags) || (MapInfo_Map_supportedGametypes & MAPINFO_TYPE_KEEPAWAY.m_flags)))
- return true; // TODO: references another gametype (alternatively, we could check which gamemodes are always enabled and append this if any are supported)
- }
- return false;
- }
- METHOD(TeamKeepaway, m_setTeams, void(string sa))
- {
- cvar_set("g_tka_teams", sa);
- }
-#ifdef CSQC
- ATTRIB(TeamKeepaway, m_modicons, void(vector pos, vector mySize), HUD_Mod_TeamKeepaway);
-#endif
-ENDCLASS(TeamKeepaway)
-REGISTER_GAMETYPE(TEAMKEEPAWAY, NEW(TeamKeepaway));
-
-const int TKA_BALL_TAKEN_RED = 1;
-const int TKA_BALL_TAKEN_BLUE = 2;
-const int TKA_BALL_TAKEN_YELLOW = 3;
-const int TKA_BALL_TAKEN_PINK = 4;
-const int TKA_BALL_CARRYING = 8;
-const int TKA_BALL_DROPPED = 12;
#ifdef CSQC
#include <client/hud/hud.qh>
-Inventory g_inventory;
+//Inventory g_inventory;
Inventory inventoryslots[255];
float last_pickup_timer;
entity last_pickup_item;
int last_pickup_times;
+
+void Inventory_remove(entity this)
+{
+ // TODO z411
+ //if(g_inventory == this)
+ // g_inventory = NULL;
+}
+
NET_HANDLE(ENT_CLIENT_INVENTORY, bool isnew)
{
make_pure(this);
- g_inventory = this;
+ //g_inventory = this;
+ //this.entremove = Inventory_remove;
float entnum = ReadByte() - 1;
inventoryslots[entnum] = this;
-
+
const int majorBits = Readbits(Inventory_groups_major);
for (int i = 0; i < Inventory_groups_major; ++i) {
if (!(majorBits & BIT(i))) {
TC(Inventory, this);
WriteHeader(MSG_ENTITY, ENT_CLIENT_INVENTORY);
TC(PlayerState, this.owner);
-
+
// z411 send entity number
WriteByte(MSG_ENTITY, etof(this.owner.m_client));
if(!g_duel) setcefc(inv, Inventory_customize);
Net_LinkEntity((inv.owner = this).inventory = inv, false, 0, Inventory_Send);
}
-
-void Inventory_delete(entity e) { delete(e.inventory.inventory); delete(e.inventory); }
+void Inventory_delete(entity e) { delete(e.inventory); }
void Inventory_update(entity e) { e.inventory.SendFlags = 0xFFFFFF; }
void Inventory_clear(entity store)
void InventoryStorage_attach(entity e) { e.inventory_store = NEW(Inventory); e.inventory_store.drawonlytoclient = e; }
void InventoryStorage_delete(entity e) { delete(e.inventory_store); }
+
+void Inventory_ClearAll() {
+ FOREACH_CLIENT(IS_PLAYER(it),
+ {
+ entity store = PS(it);
+ if (store)
+ {
+ Inventory_clear(store.inventory);
+ Inventory_update(store);
+ }
+ });
+}
#endif
#include <common/effects/all.qh>
-//LegendGuard adds purple nade parts 08-02-2021
-//LegendGuard adds green nade parts 11-02-2021
-//LegendGuard adds brown nade parts 13-02-2021
+
EFFECT(0, NADE_EXPLODE_RED, "nade_red_explode")
EFFECT(0, NADE_EXPLODE_BLUE, "nade_blue_explode")
EFFECT(0, NADE_EXPLODE_YELLOW, "nade_yellow_explode")
EFFECT(0, NADE_EXPLODE_PINK, "nade_pink_explode")
EFFECT(0, NADE_EXPLODE_NEUTRAL, "nade_neutral_explode")
-EFFECT(0, NADE_EXPLODE_GREEN, "nade_green_explode")
-EFFECT(0, NADE_EXPLODE_BROWN, "nade_brown_explode")
-EFFECT(0, NADE_EXPLODE_PURPLE, "nade_purple_explode")
-
entity EFFECT_NADE_EXPLODE(int teamid)
{
switch (teamid) {
EFFECT(1, NADE_TRAIL_YELLOW, "nade_yellow")
EFFECT(1, NADE_TRAIL_PINK, "nade_pink")
EFFECT(1, NADE_TRAIL_NEUTRAL, "nade_neutral")
-EFFECT(1, NADE_TRAIL_GREEN, "nade_green")
-EFFECT(1, NADE_TRAIL_BROWN, "nade_brown")
-EFFECT(1, NADE_TRAIL_PURPLE, "nade_purple")
entity EFFECT_NADE_TRAIL(int teamid)
{
switch (teamid) {
EFFECT(1, NADE_TRAIL_BURN_YELLOW, "nade_yellow_burn")
EFFECT(1, NADE_TRAIL_BURN_PINK, "nade_pink_burn")
EFFECT(1, NADE_TRAIL_BURN_NEUTRAL, "nade_neutral_burn")
-EFFECT(1, NADE_TRAIL_BURN_GREEN, "nade_green_burn")
-EFFECT(1, NADE_TRAIL_BURN_BROWN, "nade_brown_burn")
-EFFECT(1, NADE_TRAIL_BURN_PURPLE, "nade_purple_burn")
entity EFFECT_NADE_TRAIL_BURN(int teamid)
{
switch (teamid) {
NADE_PROJECTILE(1, PROJECTILE_NADE_VEIL_BURN, EFFECT_NADE_TRAIL_BURN_NEUTRAL);
#endif
}
-
-//LegendGuard writes Emerald nade code 01-03-2021
-REGISTER_NADE(EMERALD) {
- this.m_color = '0.33 1 0.66';
- this.m_name = _("Emerald grenade");
- this.m_icon = "nade_emerald";
-#ifdef GAMEQC
- NADE_PROJECTILE(0, PROJECTILE_NADE_EMERALD, EFFECT_NADE_TRAIL_GREEN);
- NADE_PROJECTILE(1, PROJECTILE_NADE_EMERALD_BURN, EFFECT_NADE_TRAIL_BURN_GREEN);
-#endif
-}
-
-//LegendGuard writes Ammo nade code 13-02-2021
-REGISTER_NADE(AMMO) {
- this.m_color = '0.66 0.33 0';
- this.m_name = _("Ammo grenade");
- this.m_icon = "nade_ammo";
-#ifdef GAMEQC
- NADE_PROJECTILE(0, PROJECTILE_NADE_AMMO, EFFECT_NADE_TRAIL_BROWN);
- NADE_PROJECTILE(1, PROJECTILE_NADE_AMMO_BURN, EFFECT_NADE_TRAIL_BURN_BROWN);
-#endif
-}
-
-//LegendGuard writes Dark nade code 08-02-2021
-REGISTER_NADE(DARK) {
- this.m_color = '0.23 0 0.23';
- this.m_name = _("Dark grenade");
- this.m_icon = "nade_dark";
-#ifdef GAMEQC
- NADE_PROJECTILE(0, PROJECTILE_NADE_DARK, EFFECT_NADE_TRAIL_PURPLE);
- NADE_PROJECTILE(1, PROJECTILE_NADE_DARK_BURN, EFFECT_Null);
-#endif
-}
\ No newline at end of file
M_ARGV(1, float) = STAT(VEIL_ORB_ALPHA);
return true;
}
- /*if (STAT(ARMORIZING_ORB) > time) //LegendGuard adds new nade STAT ORB (keep in mind: qcsrc/common/stats.qh) 11-02-2021
- {
- M_ARGV(0, vector) = NADE_TYPE_ARMORIZE.m_color;
- M_ARGV(1, float) = STAT(ARMORIZING_ORB_ALPHA);
- return true;
- }*/
- if (STAT(AMMUNITIONING_ORB) > time) //LegendGuard adds new nade STAT ORB (keep in mind: qcsrc/common/stats.qh) 13-02-2021
- {
- M_ARGV(0, vector) = NADE_TYPE_AMMO.m_color;
- M_ARGV(1, float) = STAT(AMMUNITIONING_ORB_ALPHA);
- return true;
- }
- if (STAT(DARK_ORB) > time) //LegendGuard adds new nade STAT ORB (keep in mind: qcsrc/common/stats.qh) 08-02-2021
- {
- M_ARGV(0, vector) = NADE_TYPE_DARK.m_color;
- M_ARGV(1, float) = STAT(DARK_ORB_ALPHA);
- return true;
- }
return false;
}
MUTATOR_HOOKFUNCTION(cl_nades, Ent_Projectile)
settouch(orb, nade_veil_touch);
orb.colormod = NADE_TYPE_VEIL.m_color;
}
-/**************LEGENDGUARD NEW NADES: EMERALD, AMMO AND DARK NADES functions "cl_nade_type 10", "cl_nade_type 11" and "cl_nade_type 12" *** //more ideas: SPAWNING MINI SPIDERS NADE, SPARKING NADE ***********************/
-// All nade icons are in these directories, samples: gfx/hud/default/nade_emerald.tga and gfx/hud/luma/nade_emerald.tga 02-03-2021
-// Mario suggests to rename itemdrop nade name to "emerald" nade 02-03-2021
-void nade_emerald_dropitem(entity e, vector org, entity itm)
-{
- Item_SetLoot(e, true);
- e.reset = SUB_Remove;
- e.noalign = true;
- StartItem(e, itm);
- e.gravity = 1;
- setorigin(e, org);
- e.velocity = randomvec() * 175 + '0 0 325';
- e.item_spawnshieldtime = time + 0.7;
- SUB_SetFade(e, time + autocvar_g_nades_emerald_lifetime, 1);
- Send_Effect(EFFECT_SMOKE_LARGE, e.origin, '0 0 0', 1);
- //EFFECT_SMOKE_LARGE is like a small white smoke
- //See effect MACROS in qcsrc/common/effects/all.inc
-}
-
-void nade_emerald_randomitem(entity e, vector org)
-{
- float a = random();
- float b = random();
- float c = random();
- float d = random();
-
- if (a > b)
- {
- if (a > 0.5)
- nade_emerald_dropitem(e, org, ((random() > 0.5) ? ITEM_ArmorSmall : ITEM_HealthSmall));
- else
- nade_emerald_dropitem(e, org, ((random() > 0.5) ? ITEM_Shells : ITEM_Bullets));
- }
- else if (c > d)
- {
- if (c > 0.5)
- nade_emerald_dropitem(e, org, ((random() > 0.5) ? ITEM_Shells : ITEM_Bullets));
- else
- nade_emerald_dropitem(e, org, ((random() > 0.5) ? ITEM_Rockets : ITEM_Cells));
- }
- else if (autocvar_g_nades_emerald_powerupjetpack_randomdrop)
- {
- if (a < 0.5)
- nade_emerald_dropitem(e, org, ((random() > 0.5) ? ITEM_Jetpack : ITEM_JetpackFuel));
- else
- nade_emerald_dropitem(e, org, ((random() > 0.5) ? ITEM_Shield : ITEM_Strength));
- }
- else
- return;
-}
-
-void nade_emerald_allammoitemdrop(entity e, vector org)
-{
- float wa = random();
- float wb = random();
-
- if (wa > wb)
- {
- if (wa > 0.5)
- nade_emerald_dropitem(e, org, ((random() > 0.5) ? ITEM_Shells : ITEM_Bullets));
- else
- nade_emerald_dropitem(e, org, ((random() > 0.5) ? ITEM_Rockets : ITEM_Cells));
- }
- else
- return;
-}
-
-void nade_emerald_dropping(vector org)
-{
- //look item MACROS in qcsrc/server/items/items.qc
- //ITEM_Shells; ITEM_Bullets; ITEM_Rockets; ITEM_Cells; ITEM_Plasma; ITEM_JetpackFuel;
- //ITEM_Strength; ITEM_Shield;
- int itemcount = autocvar_g_nades_emerald_spawncount;
- for(int j = 0; j < itemcount; ++j)
- {
- entity e = spawn();
- e.spawnfunc_checked = true;
- //int cvar which manages the ONLY dropping per each type of item 14-03-2021
-
- switch (autocvar_g_nades_emerald_dropitemselect)
- {
- case 0: nade_emerald_randomitem(e, org); return;
- case 1: nade_emerald_dropitem(e, org, ITEM_HealthSmall); return;
- case 2: nade_emerald_dropitem(e, org, ITEM_ArmorSmall); return;
- case 3: nade_emerald_allammoitemdrop(e, org); return;
- case 4: nade_emerald_dropitem(e, org, ITEM_Shells); return;
- case 5: nade_emerald_dropitem(e, org, ITEM_Bullets); return;
- case 6: nade_emerald_dropitem(e, org, ITEM_Rockets); return;
- case 7: nade_emerald_dropitem(e, org, ITEM_Cells); return;
- case 8: nade_emerald_dropitem(e, org, ITEM_Jetpack); return;
- case 9: nade_emerald_dropitem(e, org, ITEM_JetpackFuel); return;
- case 10: nade_emerald_dropitem(e, org, ITEM_Shield); return;
- case 11: nade_emerald_dropitem(e, org, ITEM_Strength); return;
- default: nade_emerald_randomitem(e, org); return;
- }
- }
-}
-
-void emerald_ball_think(entity this)
-{
- if(round_handler_IsActive())
- if(!round_handler_IsRoundStarted())
- {
- delete(this);
- return;
- }
-
- if(time > this.pushltime)
- {
- delete(this);
- return;
- }
-
- vector midpoint = ((this.absmin + this.absmax) * 0.5);
- if(pointcontents(midpoint) == CONTENT_WATER)
- {
- this.velocity = this.velocity * 0.5;
-
- if(pointcontents(midpoint + '0 0 16') == CONTENT_WATER)
- { this.velocity_z = 200; }
- }
-
- this.angles = vectoangles(this.velocity);
-
- nade_emerald_dropping(this.origin);
-
- this.nextthink = time + 0.1;
-}
-
-void nade_emerald_ball(entity this)
-{
- entity proj;
- vector kick;
-
- spamsound(this, CH_SHOTS, SND_FIREBALL_FIRE, VOL_BASE, ATTEN_NORM);
-
- proj = new(grenade);
- proj.bot_dodge = true;
- set_movetype(proj, MOVETYPE_BOUNCE);
- setmodel(proj, MDL_Null);
- proj.scale = 1;//0.5;
- setsize(proj, '-4 -4 -4', '4 4 4');
- setorigin(proj, this.origin);
- setthink(proj, emerald_ball_think);
- proj.nextthink = time;
- proj.effects = EF_LOWPRECISION;
-
- kick.x =(random() - 0.5) * 2 * autocvar_g_nades_emerald_ball_spread;
- kick.y = (random() - 0.5) * 2 * autocvar_g_nades_emerald_ball_spread;
- kick.z = (random()/2+0.5) * autocvar_g_nades_emerald_ball_spread;
- proj.velocity = kick;
-
- proj.pushltime = time + autocvar_g_nades_emerald_ball_lifetime;
-
- proj.angles = vectoangles(proj.velocity);
- proj.flags = FL_PROJECTILE;
- IL_PUSH(g_projectiles, proj);
- IL_PUSH(g_bot_dodge, proj);
- proj.missile_flags = MIF_SPLASH | MIF_PROXY | MIF_ARC;
-
- //CSQCProjectile(proj, true, PROJECTILE_NAPALM_FIRE, true);
-}
-
-
-void emerald_fountain_think(entity this)
-{
- if(round_handler_IsActive())
- if(!round_handler_IsRoundStarted())
- {
- delete(this);
- return;
- }
-
- if(time >= this.ltime)
- {
- Send_Effect(EFFECT_SMOKE_SMALL, this.origin + '0 0 1', '0 0 0', 1);
- sound(this, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM);
-
- delete(this);
- return;
- }
-
- vector midpoint = ((this.absmin + this.absmax) * 0.5);
- if(pointcontents(midpoint) == CONTENT_WATER)
- {
- this.velocity = this.velocity * 0.5;
-
- if(pointcontents(midpoint + '0 0 16') == CONTENT_WATER)
- { this.velocity_z = 200; }
-
- UpdateCSQCProjectile(this);
- }
-
- this.nextthink = time + 0.1;
- if(time >= this.nade_special_time)
- {
- this.nade_special_time = time + autocvar_g_nades_emerald_fountain_delay;
- nade_emerald_ball(this);
- }
-}
-
-void nade_emerald_boom(entity this)
-{
- for (int c = 0; c < autocvar_g_nades_emerald_ball_count; c++)
- nade_emerald_ball(this);
-
- entity fountain = new(nade_emerald_fountain);
- fountain.owner = this.owner;
- fountain.realowner = this.realowner;
- fountain.origin = this.origin;
- fountain.flags = FL_PROJECTILE;
- IL_PUSH(g_projectiles, fountain);
- IL_PUSH(g_bot_dodge, fountain);
- setorigin(fountain, fountain.origin);
- setthink(fountain, emerald_fountain_think);
- fountain.nextthink = time;
- fountain.ltime = time + autocvar_g_nades_emerald_fountain_lifetime;
- fountain.pushltime = fountain.ltime;
- fountain.team = this.team;
-
- //nade model maintaining
- setmodel(fountain, MDL_PROJECTILE_GRENADE);
- entity timer = new(nade_timer);
- setmodel(timer, MDL_NADE_TIMER);
- setattachment(timer, fountain, "");
- timer.colormap = this.colormap;
- timer.glowmod = this.glowmod;
- setthink(timer, nade_timer_think);
- timer.nextthink = time;
- timer.wait = fountain.ltime;
- timer.owner = fountain;
- timer.skin = 10;
-
- set_movetype(fountain, MOVETYPE_TOSS);
- fountain.bot_dodge = true;
- fountain.nade_special_time = time;
- setsize(fountain, '-16 -16 -16', '16 16 16');
- CSQCProjectile(fountain, true, PROJECTILE_NADE_EMERALD_BURN, true);
- nade_emerald_dropping(fountain.origin);
-}
-
-/***********************************************************************************/
-//LegendGuard develops ammo nade 13-02-2021
-void nade_ammo_touch(entity this, entity toucher)
-{
- float maxammo = 999;
- float ammo_factor;
- float amshells = GetResource(toucher, RES_SHELLS);
- float ambullets = GetResource(toucher, RES_BULLETS);
- float amrockets = GetResource(toucher, RES_ROCKETS);
- float amcells = GetResource(toucher, RES_CELLS);
- float amplasma = GetResource(toucher, RES_PLASMA);
- if(IS_PLAYER(toucher) || IS_MONSTER(toucher))
- if(!IS_DEAD(toucher))
- if(!STAT(FROZEN, toucher))
- {
- ammo_factor = autocvar_g_nades_ammo_rate*frametime/2;
- if ( toucher != this.realowner )
- {
- if ( SAME_TEAM(toucher,this) )
- {
- ammo_factor *= autocvar_g_nades_ammo_friend;
- }
- else
- {
- ammo_factor *= autocvar_g_nades_ammo_foe;
- }
- }
- if ( ammo_factor > 0 )
- {
- if (amshells < maxammo)
- {
- GiveResourceWithLimit(toucher, RES_SHELLS, ammo_factor, maxammo);
- }
-
- if (ambullets < maxammo)
- {
- GiveResourceWithLimit(toucher, RES_BULLETS, ammo_factor, maxammo);
- }
-
- if (amrockets < maxammo)
- {
- GiveResourceWithLimit(toucher, RES_ROCKETS, ammo_factor, maxammo);
- }
-
- if (amcells < maxammo)
- {
- GiveResourceWithLimit(toucher, RES_CELLS, ammo_factor, maxammo);
- }
-
- if (amplasma < maxammo)
- {
- GiveResourceWithLimit(toucher, RES_PLASMA, ammo_factor, maxammo);
- }
-
- if (this.nade_show_particles)
- {
- Send_Effect(EFFECT_HEALING, toucher.origin, '0 0 0', 1);
- }
- }
- else if ( ammo_factor < 0 )
- {
- //Foe drops ammo points
- if (amshells > 0)
- {
- SetResource(toucher, RES_SHELLS, amshells + ammo_factor);
- }
-
- if (ambullets > 0)
- {
- SetResource(toucher, RES_BULLETS, ambullets + ammo_factor);
- }
-
- if (amrockets > 0)
- {
- SetResource(toucher, RES_ROCKETS, amrockets + ammo_factor);
- }
-
- if (amcells > 0)
- {
- SetResource(toucher, RES_CELLS, amcells + ammo_factor);
- }
-
- if (amplasma > 0)
- {
- SetResource(toucher, RES_PLASMA, amplasma + ammo_factor);
- }
- return;
- }
- }
-
- if ( IS_REAL_CLIENT(toucher) || IS_VEHICLE(toucher) )
- {
- entity show_brown = (IS_VEHICLE(toucher)) ? toucher.owner : toucher;
- STAT(AMMUNITIONING_ORB, show_brown) = time+0.1;
- STAT(AMMUNITIONING_ORB_ALPHA, show_brown) = 0.75 * (this.ltime - time) / this.orb_lifetime;
- }
-}
-
-void nade_ammo_boom(entity this)
-{
- entity orb = nades_spawn_orb(this.owner, this.realowner, this.origin, autocvar_g_nades_ammo_time, autocvar_g_nades_nade_radius);
-
- settouch(orb, nade_ammo_touch);
- orb.colormod = '0.66 0.33 0';
-}
-/***********************************************************************************/
-//remember to put an image in gfx/hud/luma and gfx/hud/default per each nade_blabla.tga
-//dark nade does damage like a normal nade but the damage is minor
-//TODO: add Dark smoke effect when exploded 28-02-2021
-void dark_damage(entity this, float radius, float damage)
-{
- entity e;
-
- if ( damage < 0 )
- return;
-
- for(e = WarpZone_FindRadius(this.origin, radius, true); e; e = e.chain)
- if(!IS_DEAD(e))
- if(e.takedamage == DAMAGE_AIM)
- if(!IS_PLAYER(e) || !this.realowner || DIFF_TEAM(e, this) || !IS_MONSTER(e))
- if(!STAT(FROZEN, e))
- {
- RadiusDamage(this, this.realowner, damage, 0,
- radius, this, NULL, 0, this.projectiledeathtype, DMG_NOWEP, this.enemy);
- Damage_DamageInfo(this.origin, damage, 0,
- radius, '1 1 1' * 0, this.projectiledeathtype, 0, this);
- }
-}
-
-void nade_dark_fountain_think(entity this)
-{
- if(round_handler_IsActive())
- if(!round_handler_IsRoundStarted())
- {
- delete(this);
- return;
- }
- if(time >= this.ltime)
- {
- Send_Effect(EFFECT_SMOKE_SMALL, this.origin + '0 0 1', '0 0 0', 1);
- delete(this);
- return;
- }
-
- this.nextthink = time + 0.1;
-
- // gaussian
- float randomr;
- randomr = random();
- randomr = exp(-5*randomr*randomr)*autocvar_g_nades_dark_radius;
- float randomw;
- randomw = random()*M_PI*2;
- vector randomp;
- randomp.x = randomr*cos(randomw);
- randomp.y = randomr*sin(randomw);
- randomp.z = 1;
- Send_Effect(EFFECT_SMOKE_SMALL, this.origin + randomp, '0 0 0', 1);
-
- if(time >= this.nade_special_time)
- {
- this.nade_special_time = time + 0.7;
- Send_Effect(EFFECT_SMOKE_SMALL, this.origin, '0 0 0', 1);
- }
-}
-
-void DarkBlinking(entity e);
-//copy of the special.qc function contents for DarkBlinking
-void nade_dark_touch(entity this, entity toucher)
-{
- if ( IS_REAL_CLIENT(toucher) || IS_VEHICLE(toucher) || IS_MONSTER(toucher) )
- {
- entity show_tint = (IS_VEHICLE(toucher)) ? toucher.owner : toucher;
-
- float tint_alpha = 0.75;
- if(SAME_TEAM(toucher, this.realowner) || SAME_TEAM(toucher, this))
- {
- tint_alpha = 0.45;
- if(!STAT(DARK_ORB, show_tint))
- {
- toucher.nade_dark_prevalpha = toucher.alpha;
- toucher.alpha = 1;
- }
- }
- else
- {
- tint_alpha = 0.45;
- if(!STAT(DARK_ORB, show_tint))
- {
- DarkBlinking(toucher);
- dark_damage(this, autocvar_g_nades_dark_radius, autocvar_g_nades_dark_damage);
- }
- }
-
- STAT(DARK_ORB, show_tint) = time + 0.1;
- STAT(DARK_ORB_ALPHA, show_tint) = tint_alpha * (this.ltime - time) / this.orb_lifetime;
- }
-}
-
-void nade_dark_boom(entity this)
-{
- entity orb = nades_spawn_orb(this.owner, this.realowner, this.origin, autocvar_g_nades_dark_time, autocvar_g_nades_dark_radius);
- entity fountain = new(nade_dark_fountain);
-
- fountain.owner = this.owner;
- fountain.realowner = this.realowner;
- fountain.origin = this.origin;
- fountain.flags = FL_PROJECTILE;
- IL_PUSH(g_projectiles, fountain);
- IL_PUSH(g_bot_dodge, fountain);
- setorigin(fountain, fountain.origin);
- setthink(fountain, nade_dark_fountain_think);
- fountain.nextthink = time;
- fountain.ltime = time + autocvar_g_nades_dark_time;
- fountain.pushltime = fountain.wait = fountain.ltime;
- fountain.team = this.team;
- fountain.bot_dodge = false;
- setsize(fountain, '-16 -16 -16', '16 16 16');
- fountain.nade_special_time = time + 0.3;
- fountain.angles = this.angles;
-
- settouch(orb, nade_dark_touch);
- orb.colormod = NADE_TYPE_DARK.m_color;
- //CSQCProjectile(fountain, true, PROJECTILE_NADE_DARK_BURN, true);
-}
-/***********************************************************************************/
void nade_boom(entity this)
{
entity expef = NULL;
nade_blast = false;
expef = EFFECT_SPAWN_NEUTRAL;
break;
-
- case NADE_TYPE_EMERALD: //LegendGuard adds nade case 11-02-2021
- nade_blast = false;
- expef = EFFECT_EXPLOSION_SMALL;
- break;
-
- case NADE_TYPE_AMMO: //LegendGuard adds nade case 13-02-2021
- nade_blast = false;
- expef = EFFECT_SPAWN_BROWN;
- break;
-
- case NADE_TYPE_DARK: //LegendGuard adds nade case 08-02-2021
- nade_blast = false;
- expef = EFFECT_SPAWN_PURPLE;//expef = EFFECT_EXPLOSION_MEDIUM;
- break;
default:
case NADE_TYPE_NORMAL:
case NADE_TYPE_MONSTER: nade_monster_boom(this); break;
case NADE_TYPE_ENTRAP: nade_entrap_boom(this); break;
case NADE_TYPE_VEIL: nade_veil_boom(this); break;
- case NADE_TYPE_EMERALD: nade_emerald_boom(this); break; //LegendGuard adds the register of new nade 11-02-2021
- case NADE_TYPE_AMMO: nade_ammo_boom(this); break; //LegendGuard adds the register of new nade 13-02-2021
- case NADE_TYPE_DARK: nade_dark_boom(this); break; //LegendGuard adds the register of new nade 08-02-2021
}
IL_EACH(g_projectiles, it.classname == "grapplinghook" && it.aiment == this,
else
player.alpha = player.nade_veil_prevalpha;
}
- //LegendGuard adds nade if STAT DARK_ORB 08-02-2021
- if(STAT(DARK_ORB, player) && STAT(DARK_ORB, player) <= time)
- {
- STAT(DARK_ORB, player) = 0;
- if(player.vehicle)
- player.vehicle.alpha = player.vehicle.nade_dark_prevalpha;
- else
- player.alpha = player.nade_dark_prevalpha;
- }
}
if (!(frametime && IS_PLAYER(player)))
mon.alpha = mon.nade_veil_prevalpha;
STAT(VEIL_ORB, mon) = 0;
}
- //LegendGuard adds nade if STAT ORB 08-02-2021
- if (STAT(DARK_ORB, mon) && STAT(DARK_ORB, mon) <= time)
- {
- mon.alpha = mon.nade_dark_prevalpha;
- STAT(DARK_ORB, mon) = 0;
- }
}
MUTATOR_HOOKFUNCTION(nades, PlayerSpawn)
STAT(ENTRAP_ORB_ALPHA, client) = STAT(ENTRAP_ORB_ALPHA, spectatee);
STAT(VEIL_ORB, client) = STAT(VEIL_ORB, spectatee);
STAT(VEIL_ORB_ALPHA, client) = STAT(VEIL_ORB_ALPHA, spectatee);
- /*STAT(ARMORIZING_ORB, client) = STAT(ARMORIZING_ORB, spectatee); //LegendGuard adds nade STAT client 11-02-2021
- STAT(ARMORIZING_ORB_ALPHA, client) = STAT(ARMORIZING_ORB_ALPHA, spectatee);*/
- STAT(AMMUNITIONING_ORB, client) = STAT(AMMUNITIONING_ORB, spectatee); //LegendGuard adds nade STAT client 13-02-2021
- STAT(AMMUNITIONING_ORB_ALPHA, client) = STAT(AMMUNITIONING_ORB_ALPHA, spectatee);
- STAT(DARK_ORB, client) = STAT(DARK_ORB, spectatee); //LegendGuard adds nade STAT client 08-02-2021
- STAT(DARK_ORB_ALPHA, client) = STAT(DARK_ORB_ALPHA, spectatee);
}
MUTATOR_HOOKFUNCTION(nades, BuildMutatorsString)
float autocvar_g_nades_entrap_time = 10;
float autocvar_g_nades_veil_time = 8;
float autocvar_g_nades_veil_radius = 300;
-float autocvar_g_nades_emerald_lifetime = 5; //LegendGuard adds new nade cvars 28-02-2021
-float autocvar_g_nades_emerald_spawncount = 1;
-float autocvar_g_nades_emerald_ball_spread = 0.5;
-float autocvar_g_nades_emerald_ball_lifetime = 1; //if much time, many items will spawn
-float autocvar_g_nades_emerald_fountain_delay = 5;
-float autocvar_g_nades_emerald_ball_count = 3;
-float autocvar_g_nades_emerald_fountain_lifetime = 1; //if much time, fountain will remain
-bool autocvar_g_nades_emerald_powerupjetpack_randomdrop = 0;
-int autocvar_g_nades_emerald_dropitemselect = 0; //admin/user selects which item wants to drop in-game, if not will be random
-float autocvar_g_nades_ammo_time = 5; //LegendGuard adds new nade cvars 13-02-2021
-float autocvar_g_nades_ammo_rate = 30;
-float autocvar_g_nades_ammo_friend = 1;
-float autocvar_g_nades_ammo_foe = -2;
-float autocvar_g_nades_dark_damage = 25; //LegendGuard adds new nade cvars 08-02-2021
-float autocvar_g_nades_dark_time = 13;
-float autocvar_g_nades_dark_radius = 700;
string autocvar_g_nades_pokenade_monster_type;
float autocvar_g_nades_pokenade_monster_lifetime;
#endif
const int PROJECTILE_NADE_ENTRAP_BURN = 85;
const int PROJECTILE_NADE_VEIL = 86;
const int PROJECTILE_NADE_VEIL_BURN = 87;
-const int PROJECTILE_NADE_EMERALD = 88; //LegendGuard adds new nade MACROS 11-02-2021
-const int PROJECTILE_NADE_EMERALD_BURN = 89;
-const int PROJECTILE_NADE_AMMO = 90; //LegendGuard adds new nade MACROS 13-02-2021
-const int PROJECTILE_NADE_AMMO_BURN = 91;
-const int PROJECTILE_NADE_DARK = 92; //LegendGuard adds new nade MACROS 08-02-2021
-const int PROJECTILE_NADE_DARK_BURN = 93;
REGISTRY(Nades, BITS(4))
REGISTER_REGISTRY(Nades)
.float toss_time;
.float nade_show_particles;
.float nade_veil_prevalpha;
-.float nade_dark_prevalpha; //LegendGuard adds new nade .variable 08-02-2021
bool orb_send(entity this, entity to, int sf);
#endif
-REGISTER_NET_TEMP(TE_CSQC_DARKBLINKING); //LegendGuard registers dark blinking nade feature 09-02-2021
-
#ifdef CSQC
float cvar_cl_nade_type;
string cvar_cl_pokenade_type;
-//LegendGuard sets variables for dark nade 09-02-2021
-float autocvar_hud_panel_darkradar_maximised_zoom_scale = 1;
-float dark_appeartime;
-float dark_fadetime;
-/***************************************************************/
-void HUD_DarkBlinking()
-{
- // vectors for top right, bottom right, bottom and bottom left corners
- //vector topright = vec2(vid_conwidth, 0);
- //vector bottom = vec2(vid_conwidth / 2, vid_conheight);
- vector bottomright = vec2(vid_conwidth, vid_conheight);
- //vector bottomleft = vec2(0, vid_conheight);
-
- /*
- drawfill function parameters (qcsrc/dpdefs/menudefs.qc):
- float drawfill(vector position, vector size, vector rgb, float alpha, float flag)
- */
- drawfill('0 0 0', bottomright, '0.23 0 0.23', 0.98, DRAWFLAG_NORMAL);
-}
-
-#elif defined(SVQC)
-void DarkBlinking(entity e)
-{
- if(e == NULL)
- return;
-
- int accepted = VerifyClientEntity(e, true, false);
-
- if(accepted > 0)
- {
- msg_entity = e;
- WriteHeader(MSG_ONE, TE_CSQC_DARKBLINKING);
- }
-}
-#endif
-
-#ifdef CSQC
-const int MAX_QUADRATIC2 = 25;
-vector quadratic2_slots[MAX_QUADRATIC2];
-vector quadratic2_dirs[MAX_QUADRATIC2];
-const float QUADRATIC2_SPEED = 150;
-const float QUADRATIC2_TURNSPEED = 0.35;
-const float QUADRATIC2_SIZE = 24;
-const float QUADRATIC2_CHANCE = 0.35;
-float quadratic2_spawntime, quadratic2_fadetime;
-bool quadratic2;
-void HUD_Quadratic2()
-{
- for(int j = MAX_QUADRATIC2 - 1; j >= 0; --j)
- {
- vector slot = quadratic2_slots[j];
- vector dirs = quadratic2_dirs[j];
- float oldz = slot.z;
- if(slot)
- slot += quadratic2_dirs[j] * QUADRATIC2_SPEED * frametime;
- slot.z = oldz;
- //if(slot.z)
- //slot.z = sin(QUADRATIC2_TURNSPEED * M_PI * time);
- if(slot.y > vid_conheight || slot.x > vid_conwidth)
- slot = '0 0 0';
-
- if(slot == '0 0 0')
- {
- if(time > quadratic2_spawntime && random() <= QUADRATIC2_CHANCE) // low chance to spawn!
- {
- slot.x = bound(0, (random() * vid_conwidth + 1), vid_conwidth);
- slot.y = bound(0, (random() * vid_conheight + 1), vid_conheight);
- slot.z = 0;
- dirs = vec2(randomvec());
- quadratic2_spawntime = time + bound(0.05, random() * 0.5, 0.4); // prevent spawning another one for this amount of time!
- }
- }
- else
- {
- vector splash_size = vec2(QUADRATIC2_SIZE, QUADRATIC2_SIZE);
- if(time > dirs.z)
- {
- if(random() <= 0.05)
- slot.z = -1;
- else
- slot.z = floor(random() * 9) + 1;
- dirs.z = time + QUADRATIC2_TURNSPEED;
- }
- string chosen_number = ((slot.z == -1) ? "NOOB" : ftos(rint(slot.z)));
- draw_beginBoldFont();
- drawcolorcodedstring(vec2(slot), chosen_number, splash_size, 0.95, DRAWFLAG_NORMAL);
- draw_endBoldFont();
- }
-
- quadratic2_slots[j] = slot;
- quadratic2_dirs[j] = dirs;
- }
-}
-
-bool darkblink;
-
-STATIC_INIT_LATE(cl_darkblink_override)
-{
- localcmd("\nalias solve_quadratic2 \"cl_cmd solve_quadratic2 ${* ?}\"\n");
-}
-
-REGISTER_MUTATOR(cl_darkblink, true);
-
-MUTATOR_HOOKFUNCTION(cl_darkblink, DrawScoreboard)
-{
- return darkblink;
-}
-
-MUTATOR_HOOKFUNCTION(cl_darkblink, HUD_Draw_overlay)
-{
- if(!darkblink && !quadratic2)
- return false;
-
- if(time <= dark_fadetime && autocvar_hud_panel_darkradar_maximised_zoom_scale == 1)
- {
- HUD_DarkBlinking();
- return false;
- }
- else
- darkblink = false;
-
- if(time <= quadratic2_fadetime)
- {
- HUD_Quadratic2();
- // don't return true, we want regular HUD effects!
- }
- else
- quadratic2 = false;
-
- return false;
-}
-
-MUTATOR_HOOKFUNCTION(cl_darkblink, CSQC_ConsoleCommand)
-{
- if(MUTATOR_RETURNVALUE) // command was already handled?
- return;
-
- string cmd_name = M_ARGV(0, string);
- //int cmd_argc = M_ARGV(2, int);
-
- if(cmd_name == "solve_quadratic2")
- {
- quadratic2 = true;
- quadratic2_fadetime = time + 5;
- return true;
- }
-}
-
-NET_HANDLE(TE_CSQC_DARKBLINKING, bool isNew)
-{
- return = true;
-
- if(darkblink)
- return;
-
- localcmd("play2 sound/misc/blind\n");
- darkblink = true;
- dark_appeartime = time;
- dark_fadetime = time + 9;
-}
-#endif
-/***************************************************************/
-#ifdef CSQC
bool Projectile_isnade(int proj); // TODO: remove
void DrawAmmoNades(vector myPos, vector mySize, bool draw_expanding, float expand_time); // TODO: mutator
impressive_hits = 0;
FireRailgunBullet(actor, weaponentity, w_shotorg, w_shotorg + w_shotdir * max_shot_distance, mydmg, true, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, thiswep.m_id);
- if(yoda && flying)
- {
+ if(yoda && flying) {
Give_Medal(actor, YODA);
- Send_Notification(NOTIF_ONE, actor, MSG_ANNCE, ANNCE_ACHIEVEMENT_YODA);
}
+
if(impressive_hits && actor.oknex_lasthit)
{
Give_Medal(actor, IMPRESSIVE);
- Send_Notification(NOTIF_ONE, actor, MSG_ANNCE, ANNCE_ACHIEVEMENT_IMPRESSIVE);
impressive_hits = 0; // only every second time
}
REGISTER_WAYPOINT(KaBall, _("Ball"), "notify_ballpickedup", '0 1 1', 1);
REGISTER_WAYPOINT(KaBallCarrier, _("Ball carrier"), "keepawayball_carrying", '1 0 0', 1);
-//LegendGuard adds REGISTER_WAYPOINT from Mario/team_keepaway 15-02-2021
-REGISTER_WAYPOINT(TkaBallCarrierRed, _("Ball carrier"), "tka_taken_red", '0 1 1', 1);
-REGISTER_WAYPOINT(TkaBallCarrierBlue, _("Ball carrier"), "tka_taken_blue", '0 1 1', 1);
-REGISTER_WAYPOINT(TkaBallCarrierYellow, _("Ball carrier"), "tka_taken_yellow", '0 1 1', 1);
-REGISTER_WAYPOINT(TkaBallCarrierPink, _("Ball carrier"), "tka_taken_pink", '0 1 1', 1);
REGISTER_WAYPOINT(NbBall, _("Ball"), "", '0.91 0.85 0.62', 1);
REGISTER_WAYPOINT(NbGoal, _("Goal"), "", '1 0.5 0', 1);
MSG_INFO_NOTIF(SPECTATE_WARNING, N_CONSOLE, 0, 1, "f1secs", "", "", _("^F2You have to become a player within the next %s, otherwise you will be kicked, because spectating isn't allowed at this time!"), "")
MSG_INFO_NOTIF(SUPERWEAPON_PICKUP, N_CONSOLE, 1, 0, "s1", "s1", "superweapons", _("^BG%s^K1 picked up a Superweapon"), "")
+
MSG_INFO_NOTIF(TEAMCHANGE_LARGERTEAM, N_CONSOLE, 0, 0, "", "", "", _("^BGYou cannot change to a larger team"), "")
MSG_INFO_NOTIF(TEAMCHANGE_NOTALLOWED, N_CONSOLE, 0, 0, "", "", "", _("^BGYou are not allowed to change teams"), "")
MSG_CENTER_NOTIF(SUPERWEAPON_BROKEN, N_ENABLE, 0, 0, "", CPID_POWERUP, "0 0", _("^F2Superweapons have broken down"), "")
MSG_CENTER_NOTIF(SUPERWEAPON_LOST, N_ENABLE, 0, 0, "", CPID_POWERUP, "0 0", _("^F2Superweapons have been lost"), "")
MSG_CENTER_NOTIF(SUPERWEAPON_PICKUP, N_ENABLE, 0, 0, "", CPID_POWERUP, "0 0", _("^F2You now have a superweapon"), "")
+
MULTITEAM_CENTER(TEAMCHANGE, N_ENABLE, 0, 1, "", CPID_TEAMCHANGE, "1 f1", _("^K1Changing to ^TC^TT^K1 in ^COUNT"), "", NAME)
MSG_CENTER_NOTIF(TEAMCHANGE_AUTO, N_ENABLE, 0, 1, "", CPID_TEAMCHANGE, "1 f1", _("^K1Changing team in ^COUNT"), "")
MSG_CENTER_NOTIF(TEAMCHANGE_SPECTATE, N_ENABLE, 0, 1, "", CPID_TEAMCHANGE, "1 f1", _("^K1Spectating in ^COUNT"), "")
REGISTER_SP(MEDAL_KILLSTREAK_05);
REGISTER_SP(MEDAL_KILLSTREAK_10);
REGISTER_SP(MEDAL_KILLSTREAK_15);
-
-REGISTER_SP(SV_SURVIVALS); //LegendGuard adds REGISTER_SP from Mario/survival 15-02-2021
-REGISTER_SP(SV_HUNTS);
-
-REGISTER_SP(TKA_PICKUPS); //LegendGuard adds REGISTER_SP from Mario/team_keepaway 15-02-2021
-REGISTER_SP(TKA_BCTIME);
-REGISTER_SP(TKA_CARRIERKILLS);
#endif
void Inventory_new(PlayerState this);
void Inventory_delete(entity this);
void Inventory_clear(PlayerState this);
+//void Inventory_ClearAll();
void InventoryStorage_attach(PlayerState this);
void InventoryStorage_delete(PlayerState this);
PlayerState ps = PS(this);
if (!ps) return; // initial connect
PS(this) = NULL;
- Inventory_clear(this.inventory_store); // no need to network updates, as there is no inventory attached
+ //Inventory_clear(this.inventory_store); // no need to network updates, as there is no inventory attached
if (ps.m_client != this) return; // don't own state, spectator
ps.ps_push(ps, this);
float game_stopped;
float game_starttime; //point in time when the countdown to game start is over
float round_starttime; //point in time when the countdown to round start is over
+float overtime_starttime; // z411 point in time where first overtime started
float checkrules_overtimesadded; // z411 add
float timeout_last;
float timeout_total_time;
bool game_timeout;
-
bool autocvar_g_allow_oldvortexbeam;
int autocvar_leadlimit;
// TODO: world.qh can't be included here due to circular includes!
#define autocvar_timelimit cvar("timelimit")
#define autocvar_timelimit_override cvar("timelimit_override")
#endif
+REGISTER_STAT(WEAPONRATEFACTOR, float, W_WeaponRateFactor(this))
+REGISTER_STAT(GAME_STOPPED, int, game_stopped)
-REGISTER_STAT(GAME_TIMEOUT, bool, game_timeout) //z411 registers STAT
+REGISTER_STAT(GAME_TIMEOUT, bool, game_timeout)
REGISTER_STAT(TIMEOUT_LAST, float, timeout_last)
-REGISTER_STAT(WEAPONRATEFACTOR, float, W_WeaponRateFactor(this))
-REGISTER_STAT(GAME_STOPPED, int, game_stopped)
REGISTER_STAT(GAMESTARTTIME, float, game_starttime)
REGISTER_STAT(STRENGTH_FINISHED, float)
REGISTER_STAT(INVINCIBLE_FINISHED, float)
REGISTER_STAT(VEHICLESTAT_RELOAD2, int)
REGISTER_STAT(VEHICLESTAT_W2MODE, int)
REGISTER_STAT(NADE_TIMER, float)
-REGISTER_STAT(SECRETS_TOTAL, int, secrets_total)
-REGISTER_STAT(SECRETS_FOUND, int, secrets_found)
+//REGISTER_STAT(SECRETS_TOTAL, int, secrets_total)
+//REGISTER_STAT(SECRETS_FOUND, int, secrets_found)
REGISTER_STAT(RESPAWN_TIME, float)
REGISTER_STAT(ROUNDSTARTTIME, float, round_starttime)
-
-REGISTER_STAT(OVERTIMESADDED, float, checkrules_overtimesadded) //z411 registers STAT
-
-REGISTER_STAT(MONSTERS_TOTAL, int)
-REGISTER_STAT(MONSTERS_KILLED, int)
+REGISTER_STAT(OVERTIMESTARTTIME, float, overtime_starttime)
+REGISTER_STAT(OVERTIMESADDED, float, checkrules_overtimesadded)
+//REGISTER_STAT(MONSTERS_TOTAL, int)
+//REGISTER_STAT(MONSTERS_KILLED, int)
REGISTER_STAT(BUFFS, int)
REGISTER_STAT(NADE_BONUS, float)
REGISTER_STAT(NADE_BONUS_TYPE, int)
REGISTER_STAT(DARK_ORB, float) //LegendGuard registers new STAT 08-02-2021
REGISTER_STAT(DARK_ORB_ALPHA, float)
REGISTER_STAT(TKA_BALLSTATUS, int) //LegendGuard adds STAT from Mario/team_keepaway 15-02-2021
-
#ifdef SVQC
float autocvar_sv_showfps = 0;
#endif
#ifdef SVQC
SPECTATE_COPYFIELD(_STAT(GUNALIGN))
#endif
+
+REGISTER_STAT(MMM_ROUNDTIMER, float) //LegendGuard adds MMM_ROUNDTIMER for MMM 20-02-2021
\ No newline at end of file
void W_Devastator_Explode(entity this, entity directhitentity)
{
-
W_Devastator_Unregister(this);
if(directhitentity.takedamage == DAMAGE_AIM)
if(IS_PLAYER(directhitentity))
if(DIFF_TEAM(this.realowner, directhitentity))
if(!IS_DEAD(directhitentity))
- if(IsFlying(directhitentity))
- Send_Notification(NOTIF_ONE, this.realowner, MSG_ANNCE, ANNCE_ACHIEVEMENT_AIRSHOT);
+ if(IsFlying(directhitentity)) {
+ Give_Medal(this.realowner, AIRSHOT);
+ }
this.event_damage = func_null;
this.takedamage = DAMAGE_NO;
vector desireddir, olddir, newdir, desiredorigin, goal;
float velspeed, f;
this.nextthink = time;
+ if(game_timeout) { set_movetype(this, MOVETYPE_NONE); this.disableclientprediction = 2; return; } else { set_movetype(this, MOVETYPE_FLY); this.disableclientprediction = 0; }
if(time > this.cnt)
{
this.projectiledeathtype |= HITTYPE_BOUNCE;
UpdateCSQCProjectile(this);
}
-/***************************************/
-//LegendGuard writes homming missile part to test 02-02-2021
-//LegendGuard adds a copy from hk_weapon.qc functions and the EXPERIMENT of homing missile of this weapon worked successfully 07-02-2021
-bool validate_target(entity this, entity proj, entity targ)
-{
- if (!targ)
- return false;
-
- // we know for sure pure entities are bad targets
- if(is_pure(targ))
- return false;
-
- // If only this was used more..
- if (targ.flags & FL_NOTARGET)
- return false;
-
- // Cant touch this
- if ((targ.takedamage == DAMAGE_NO) || (GetResource(targ, RES_HEALTH) < 0))
- return false;
-
- // player
- if (IS_PLAYER(targ))
- {
- if (this.target_select_playerbias < 0)
- return false;
-
- if (IS_DEAD(targ))
- return false;
- }
-
- // Missile
- if ((targ.flags & FL_PROJECTILE) && (this.target_select_missilebias < 0))
- return false;
-
- // Team check
- if (SAME_TEAM(this, targ) || SAME_TEAM(this, targ.owner))
- return false;
-
- return true;
-}
-
-void Homing_Missile_Think(entity this)
-{
- vector vu, vd, vf, vl, vr, ve; // Vector (direction)
- float fu, fd, ff, fl, fr, fe; // Fraction to solid
- vector olddir,wishdir,newdir; // Final direction
- float lt_for; // Length of Trace FORwrad
- float lt_seek; // Length of Trace SEEK (left, right, up down)
- float pt_seek; // Pitch of Trace SEEK (How mutch to angele left, right up, down trace towards v_forward)
- float myspeed;
-
- this.nextthink = time + this.ticrate;
-
- //if (this.cnt < time)
- // W_Devastator_Explode();
-
- if (IS_DEAD(this.enemy) || IS_SPEC(this.enemy) || IS_OBSERVER(this.enemy))
- this.enemy = NULL;
-
- // Pick the closest valid target.
- if (!this.enemy)
- {
- // in this case, the lighter check is to validate it first, and check distance if it is valid
- IL_EACH(g_damagedbycontents, validate_target(this.owner, this, it),
- {
- if(vdist(it.origin, >, 5000))
- continue;
-
- if(!this.enemy)
- this.enemy = it;
- else if(vlen2(this.origin - it.origin) < vlen2(this.origin - this.enemy.origin))
- this.enemy = it;
- });
- }
-
- this.angles = vectoangles(this.velocity);
- this.angles_x = this.angles_x * -1;
- makevectors(this.angles);
- this.angles_x = this.angles_x * -1;
-
- if (this.enemy)
- {
- // Close enougth to do decent damage?
- if(vdist(this.origin - this.enemy.origin, <=, (this.owner.shot_radius * 0.25)))
- {
- W_Devastator_Explode(this, NULL);
- return;
- }
-
- // Get data on enemy position
- vector pre_pos = this.enemy.origin +
- this.enemy.velocity *
- min((vlen(this.enemy.origin - this.origin) / vlen(this.velocity)),0.5);
-
- traceline(this.origin, pre_pos,true,this.enemy);
- ve = normalize(pre_pos - this.origin);
- fe = trace_fraction;
-
- }
- else
- {
- ve = '0 0 0';
- fe = 0;
- }
-
- if ((fe != 1) || (this.enemy == NULL) || vdist(this.origin - this.enemy.origin, >, 1000))
- {
- myspeed = vlen(this.velocity);
-
- lt_for = myspeed * 3;
- lt_seek = myspeed * 2.95;
-
- // Trace forward
- traceline(this.origin, this.origin + v_forward * lt_for,false,this);
- vf = trace_endpos;
- ff = trace_fraction;
-
- // Find angular offset
- float ad = vlen(vectoangles(normalize(this.enemy.origin - this.origin)) - this.angles);
-
- // To close to something, Slow down!
- if ( ((ff < 0.7) || (ad > 4)) && (myspeed > WEP_CVAR(devastator, homing_missile_speed)) )
- myspeed = max(myspeed * WEP_CVAR(devastator, homing_missile_speed_decel), WEP_CVAR(devastator, homing_missile_speed));
-
- // Failry clear, accelerate.
- if ( (ff > 0.7) && (myspeed < WEP_CVAR(devastator, homing_missile_speed_max)) )
- myspeed = min(myspeed * WEP_CVAR(devastator, homing_missile_speed_accel), WEP_CVAR(devastator, homing_missile_speed_max));
-
- // Setup trace pitch
- pt_seek = 1 - ff;
- pt_seek = bound(0.15,pt_seek,0.8);
- if (ff < 0.5) pt_seek = 1;
-
- // Trace left
- traceline(this.origin, this.origin + (-1 * (v_right * pt_seek) + (v_forward * ff)) * lt_seek,false,this);
- vl = trace_endpos;
- fl = trace_fraction;
-
- // Trace right
- traceline(this.origin, this.origin + ((v_right * pt_seek) + (v_forward * ff)) * lt_seek ,false,this);
- vr = trace_endpos;
- fr = trace_fraction;
-
- // Trace up
- traceline(this.origin, this.origin + ((v_up * pt_seek) + (v_forward * ff)) * lt_seek ,false,this);
- vu = trace_endpos;
- fu = trace_fraction;
-
- // Trace down
- traceline(this.origin, this.origin + (-1 * (v_up * pt_seek) + (v_forward * ff)) * lt_seek ,false,this);
- vd = trace_endpos;
- fd = trace_fraction;
-
- vl = normalize(vl - this.origin);
- vr = normalize(vr - this.origin);
- vu = normalize(vu - this.origin);
- vd = normalize(vd - this.origin);
-
- // Panic tresh passed, find a single direction and turn as hard as we can
- if (pt_seek == 1)
- {
- wishdir = v_right;
- if (fl > fr) wishdir = -1 * v_right;
- if (fu > fl) wishdir = v_up;
- if (fd > fu) wishdir = -1 * v_up;
- }
- else
- {
- // Normalize our trace vectors to make a smooth path
- wishdir = normalize( (vl * fl) + (vr * fr) + (vu * fu) + (vd * fd) );
- }
-
- if (this.enemy)
- {
- if (fe < 0.1) fe = 0.1; // Make sure we always try to move sligtly towards our target
- wishdir = (wishdir * (1 - fe)) + (ve * fe);
- }
- }
- else
- {
- // Got a clear path to target, speed up fast (if not at full speed) and go straight for it.
- myspeed = vlen(this.velocity);
- if (myspeed < WEP_CVAR(devastator, homing_missile_speed_max))
- myspeed = min(myspeed * WEP_CVAR(devastator, homing_missile_speed_accel2), WEP_CVAR(devastator, homing_missile_speed_max));
-
- wishdir = ve;
- }
-
- if ((myspeed > WEP_CVAR(devastator, homing_missile_speed)) && (this.cnt > time))
- myspeed = min(myspeed * WEP_CVAR(devastator, homing_missile_speed_accel2), WEP_CVAR(devastator, homing_missile_speed_max));
-
- // Ranoutagazfish?
- if (this.cnt < time)
- {
- this.cnt = time + 0.25;
- this.nextthink = 0;
- set_movetype(this, MOVETYPE_BOUNCE);
- return;
- }
-
- // Calculate new heading
- olddir = normalize(this.velocity);
- newdir = normalize(olddir + wishdir * WEP_CVAR(devastator, homing_missile_speed_turnrate));
-
- // Set heading & speed
- this.velocity = newdir * myspeed;
-
- // Align model with new heading
- this.angles = vectoangles(this.velocity);
-
- UpdateCSQCProjectile(this);
-}
-/********************************/
-
-
void W_Devastator_Touch(entity this, entity toucher)
{
if(WarpZone_Projectile_Touch(this, toucher))
missile.angles = vectoangles(missile.velocity);
settouch(missile, W_Devastator_Touch);
-
+ setthink(missile, W_Devastator_Think);
missile.nextthink = time;
- if(WEP_CVAR(devastator, homing_missile_active) != 0)
- setthink(missile, Homing_Missile_Think); //LegendGuard sets setthink to call homing think function for homing missile test 02-02-2021
- else
- setthink(missile, W_Devastator_Think); //allows to activate the original devastator functions
-
- if(missile.enemy != NULL)
- missile.projectiledeathtype = thiswep.m_id | HITTYPE_SECONDARY;
- else
- missile.projectiledeathtype = thiswep.m_id;
-
-
missile.cnt = time + WEP_CVAR(devastator, lifetime);
missile.rl_detonate_later = (fire & 2); // allow instant detonation
missile.flags = FL_PROJECTILE;
}
}
-
METHOD(Devastator, wr_aim, void(entity thiswep, entity actor, .entity weaponentity))
{
// aim and decide to fire if appropriate
P(class, prefix, guiderate, float, NONE) \
P(class, prefix, guidestop, float, NONE) \
P(class, prefix, health, float, NONE) \
- P(class, prefix, homing_missile_active, bool, NONE) \
- P(class, prefix, homing_missile_speed, float, NONE) \
- P(class, prefix, homing_missile_speed_accel, float, NONE) \
- P(class, prefix, homing_missile_speed_accel2, float, NONE) \
- P(class, prefix, homing_missile_speed_decel, float, NONE) \
- P(class, prefix, homing_missile_speed_max, float, NONE) \
- P(class, prefix, homing_missile_speed_turnrate, float, NONE) \
P(class, prefix, lifetime, float, NONE) \
P(class, prefix, radius, float, NONE) \
P(class, prefix, refire, float, NONE) \
SendCSQCVaporizerBeamParticle(actor, impressive_hits);
if(yoda && flying)
- {
- Give_Medal(actor, YODA);
Send_Notification(NOTIF_ONE, actor, MSG_ANNCE, ANNCE_ACHIEVEMENT_YODA);
- }
- if(impressive_hits && actor.vaporizer_lasthit)
+ if(impressive_hits && actor.vaporizer_lasthit)
{
- Give_Medal(actor, IMPRESSIVE);
Send_Notification(NOTIF_ONE, actor, MSG_ANNCE, ANNCE_ACHIEVEMENT_IMPRESSIVE);
+ Give_Medal(actor, IMPRESSIVE);
impressive_hits = 0; // only every second time
}
impressive_hits = 0;
FireRailgunBullet(actor, weaponentity, w_shotorg, w_shotorg + w_shotdir * max_shot_distance, mydmg, false, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, dtype);
- if(yoda && flying)
- {
- Give_Medal(actor, YODA);
- Send_Notification(NOTIF_ONE, actor, MSG_ANNCE, ANNCE_ACHIEVEMENT_YODA);
- }
- if(impressive_hits && actor.vortex_lasthit)
+ if(yoda && flying) {
+ Give_Medal(actor, YODA);
+ }
+
+ if(impressive_hits && actor.vortex_lasthit)
{
- Give_Medal(actor, IMPRESSIVE);
- Send_Notification(NOTIF_ONE, actor, MSG_ANNCE, ANNCE_ACHIEVEMENT_IMPRESSIVE);
+ Give_Medal(actor, IMPRESSIVE);
impressive_hits = 0; // only every second time
}
GAMETYPE(MAPINFO_TYPE_CA) \
GAMETYPE(MAPINFO_TYPE_FREEZETAG) \
GAMETYPE(MAPINFO_TYPE_KEEPAWAY) \
- GAMETYPE(MAPINFO_TYPE_TEAMKEEPAWAY) \
GAMETYPE(MAPINFO_TYPE_KEYHUNT) \
GAMETYPE(MAPINFO_TYPE_LMS) \
GAMETYPE(MAPINFO_TYPE_DOMINATION) \
GAMETYPE(MAPINFO_TYPE_ASSAULT) \
/* GAMETYPE(MAPINFO_TYPE_DUEL) */ \
/* GAMETYPE(MAPINFO_TYPE_INVASION) */ \
- //LegendGuard adds GAMETYPE for menu from Mario/team_keepaway 15-02-2021
/**/
// hidden gametypes come last so indexing always works correctly
} else if (IS_PLAYER(this)) {
PutPlayerInServer(this);
}
-
+ // send team names
+ if(teamplay && IS_REAL_CLIENT(this))
+ send_TeamNames(MSG_ONE, this);
bot_relinkplayerlist();
}
#define Give_Medal(entity,medalname) \
_medal_times = GameRules_scoring_add(entity, MEDAL_##medalname, 1); \
Send_Notification(NOTIF_ONE, entity, MSG_MEDAL, MEDAL_##medalname, _medal_times);
+
}
}
-// z411 TODO
-void GameCommand_stop(int request, int argc)
-{
- switch (request)
- {
- case CMD_REQUEST_COMMAND:
- {
- if(argv(1) == "true")
- game_stopped = true;
- else
- game_stopped = false;
- return;
- }
-
- default:
- case CMD_REQUEST_USAGE:
- {
- LOG_HELP("Usage:^3 sv_cmd stop");
- LOG_HELP(" No arguments required.");
- return;
- }
- }
-}
-
void GameCommand_allspec(int request, int argc)
{
switch (request)
LOG_HELP("Usage:^3 sv_cmd setflag #client_id countrycode[0-249]");
return;
}
-
+
client.countrycode = stof(argv(2));
LOG_INFO("^2SUCCESS^7: Country flag set!");
return;
// Do not hard code aliases for these, instead create them in commands.cfg... also: keep in alphabetical order, please ;)
SERVER_COMMAND(setflag, "Set client flag") { GameCommand_setflag(request, arguments); }
SERVER_COMMAND(teamname, "Set team name") { GameCommand_teamname(request, arguments); }
-SERVER_COMMAND(stop, "Stop") { GameCommand_stop(request, arguments); }
SERVER_COMMAND(adminmsg, "Send an admin message to a client directly") { GameCommand_adminmsg(request, arguments); }
SERVER_COMMAND(allready, "Restart the server and reset the players") { GameCommand_allready(request); }
// z411
if(vote_target_type == VOTE_TARGET_TEAM && it.team != vote_caller.team) continue;
if(vote_target_type == VOTE_TARGET_SINGLE && it != vote_target) continue;
-
+
++vote_player_count;
if (IS_PLAYER(it)) ++vote_real_player_count;
switch (it.vote_selection)
restart_mapalreadyrestarted = true;
reset_map(true);
Score_ClearAll();
+ Inventory_ClearAll();
delete(this);
}
warmup_stage = 0; // once the game is restarted the game is in match stage
// reset the .ready status of all players (also spectators)
- FOREACH_CLIENT(IS_REAL_CLIENT(it), { it.ready = false; });
+ FOREACH_CLIENT(IS_REAL_CLIENT(it), {
+ it.ready = false;
+ Kill_Notification(NOTIF_ONE_ONLY, it, MSG_CENTER, CPID_MISSING_READY);
+ });
readycount = 0;
Nagger_ReadyCounted(); // NOTE: this causes a resend of that entity, and will also turn off warmup state on the client
FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it), { CS(it).allowed_timeouts = autocvar_sv_timeout_number; });
}
+ round_handler_Activate(true);
if (!sv_ready_restart_after_countdown) reset_map(true);
if (autocvar_sv_eventlog) GameLogEcho(":restart");
}
// Reset ALL scores, but only do that at the beginning of the countdown if sv_ready_restart_after_countdown is off!
// Otherwise scores could be manipulated during the countdown.
- if (!sv_ready_restart_after_countdown) Score_ClearAll();
+ if (!sv_ready_restart_after_countdown) {
+ Score_ClearAll();
+ //Inventory_ClearAll();
+ }
ReadyRestart_force();
}
case MUT_VOTEPARSE_UNACCEPTABLE: { return 0; }
}
+ vote_target_type = VOTE_TARGET_ALL;
+
switch (first_command) // now go through and parse the proper commands to adjust as needed.
{
case "kick":
if (first_command == "kickban")
command_arguments = strcat(ftos(autocvar_g_ban_default_bantime), " ", ftos(autocvar_g_ban_default_masksize), " ~");
- vote_parsed_command = strcat(first_command, " # ", ftos(etof(victim)), " ", command_arguments);
+ vote_parsed_command = strcat("defer 2 ", first_command, " # ", ftos(etof(victim)), " ", command_arguments);
vote_parsed_display = sprintf("^1%s #%d ^7%s^1 %s", first_command, etof(victim), victim.netname, reason);
}
else { print_to(caller, strcat("vcall: ", GetClientErrorString(accepted, argv(startpos + 1)), ".\n")); return 0; }
{
vote_command = ValidateMap(argv(startpos + 1), caller);
if (!vote_command) return -1;
- vote_parsed_command = strcat("gotomap ", vote_command);
+ vote_parsed_command = strcat("defer 2 gotomap ", vote_command);
vote_parsed_display = strzone(strcat("^1", vote_parsed_command));
break;
}
-
+
// z411 team calls
case "teamname":
{
}
case "restart":
+ case "shuffleteams":
+ case "allready":
+ case "endmatch":
{
// add a delay so that vote result can be seen and announcer can be heard
// if the vote is accepted
- vote_parsed_command = strcat("defer 1 ", vote_command);
+ vote_parsed_command = strcat("defer 2 ", vote_command);
vote_parsed_display = strzone(strcat("^1", vote_command));
break;
this.cnt = 0;
this.round_endtime = (this.round_timelimit) ? time + this.round_timelimit : 0;
this.nextthink = time;
+ FOREACH_CLIENT(IS_PLAYER(it), { roundaccuracy_clear(it); });
if (this.roundStart) this.roundStart();
return;
}
sk = CS(player).scorekeeper;
FOREACH(Scores, true, {
if(sk.(scores(it)) != 0)
- if(scores_label(it) != "")
- sk.SendFlags |= BIT(i % 16);
+ //if(scores_label(it) != "")
+ sk.SendFlags |= (2 ** (i % 16));
if(i != SP_ELO.m_id)
sk.(scores(it)) = 0;
});
if (!sk) continue;
FOREACH(Scores, true, {
if(sk.(scores(it)) != 0)
- if(scores_label(it) != "")
- sk.SendFlags |= BIT(i % 16);
+ //if(scores_label(it) != "")
+ sk.SendFlags |= (2 ** (i % 16));
if(i != SP_ELO.m_id)
sk.(scores(it)) = 0;
});
for(int j = 0; j < MAX_TEAMSCORE; ++j)
{
if(sk.(teamscores(j)) != 0)
- if(teamscores_label(j) != "")
- sk.SendFlags |= BIT(j);
+ //if(teamscores_label(j) != "")
+ sk.SendFlags |= (2 ** j);
sk.(teamscores(j)) = 0;
}
}
{
return s.(scores(scorefield));
}
- if(scores_label(scorefield) != "")
- s.SendFlags |= BIT(scorefield.m_id % 16);
+ //if(scores_label(scorefield) != "")
+ s.SendFlags |= (2 ** (scorefield.m_id % 16));
if(!warmup_stage)
PlayerStats_GameReport_Event_Player(s.owner, strcat(PLAYERSTATS_TOTAL, scores_label(scorefield)), score);
s.(scores(scorefield)) += score;
//.float hit_time;
.float fired_time;
+void roundaccuracy_clear(entity this)
+{
+ if (IS_INDEPENDENT_PLAYER(this)) return;
+ entity ra = this.roundaccuracy;
+
+ for (int w = 0; w <= WEP_LAST - WEP_FIRST; ++w) {
+ ra.accuracy_frags[w] = 0;
+ ra.accuracy_hit[w] = 0;
+ ra.accuracy_fired[w] = 0;
+ ra.accuracy_cnt_hit[w] = 0;
+ ra.accuracy_cnt_fired[w] = 0;
+ }
+}
+
void accuracy_add(entity this, Weapon w, float fired, float hit)
{
if (IS_INDEPENDENT_PLAYER(this)) return;
// update accuracy stats
void accuracy_add(entity e, Weapon w, float fired, float hit);
+void roundaccuracy_clear(entity this);
// helper
bool accuracy_isgooddamage(entity attacker, entity targ);
// long
BADCVAR("hostname");
+ BADCVAR("hostname_full");
BADCVAR("g_maplist");
BADCVAR("g_maplist_mostrecent");
BADCVAR("sv_motd");
+
+ BADPREFIX("g_teamnames_");
v = cvar_string(k);
d = cvar_defstring(k);
BADCVAR("g_forced_respawn");
BADCVAR("g_freezetag_point_leadlimit");
BADCVAR("g_freezetag_point_limit");
+ BADCVAR("g_freezetag_revive_respawn");
+ BADCVAR("g_freezetag_round_stop");
+ BADCVAR("g_freezetag_round_respawn");
BADCVAR("g_glowtrails");
BADCVAR("g_hats");
BADCVAR("g_casings");
BADPREFIX("sv_timeout_");
BADPREFIX("sv_vote_");
BADPREFIX("timelimit_");
+ BADPREFIX("sv_chat_");
+ BADPREFIX("sv_jingle_");
// allowed changes to server admins (please sync this to server.cfg)
// vi commands:
world_initialized = 1;
__spawnfunc_spawn_all();
+
+ if(!warmup_stage)
+ round_handler_Activate(true);
}
spawnfunc(light)
*/
//pos = FindIntermission ();
+
+ sound(NULL, CH_INFO, SND_ENDMATCH, VOL_BASE, ATTN_NONE);
VoteReset();
WeaponStats_Shutdown();
Kill_Notification(NOTIF_ALL, NULL, MSG_CENTER, CPID_Null); // kill all centerprints now
+
+ // send winner notification
+ if(teamplay) {
+ Send_Notification(NOTIF_ALL, NULL, MSG_ANNCE, APP_TEAM_NUM(WinningConditionHelper_winnerteam, ANNCE_TEAM_WINS));
+ }
if(autocvar_sv_eventlog)
GameLogEcho(":gameover");
});
target_music_kill();
-
- // z411
+
+ // z411
if(autocvar_sv_jingle_end) {
int jingles_len = 0;
string jingles[32];
//add one more overtime by simply extending the timelimit
cvar_set("timelimit", ftos(autocvar_timelimit + autocvar_timelimit_overtime));
Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_OVERTIME_TIME, autocvar_timelimit_overtime * 60);
+
+ sound(NULL, CH_INFO, SND_OVERTIME, VOL_BASE, ATTN_NONE);
+ if(checkrules_overtimesadded == 1) {
+ Send_Notification(NOTIF_ALL, NULL, MSG_ANNCE, ANNCE_OVERTIME);
+ overtime_starttime = time;
+ }
}
float GetWinningCode(float fraglimitreached, float equality)
FOREACH_CLIENT(IS_PLAYER(it), { it.winning = 0; });
}
-//z411
void AnnounceNewLeader()
{
if(teamplay) {
}
}
-//z411
void AnnounceScores(float tm)
{
WinningConditionHelper(NULL);
}
}
-int fragsleft_last;
float WinningCondition_Scores(float limit, float leadlimit)
{
// TODO make everything use THIS winning condition (except LMS)
if(MUTATOR_CALLHOOK(Scores_CountFragsRemaining))
{
- float fragsleft;
if (checkrules_suddendeathend && time >= checkrules_suddendeathend)
{
fragsleft = 1;
fragsleft_last = fragsleft;
}
}
-
- // z411 - lead announcer
+
+ // z411 - lead announcer
if(MUTATOR_CALLHOOK(Scores_AnnounceLeads)) {
if (Score_NewLeader())
AnnounceNewLeader();
}
-
+
bool fraglimit_reached = (limit && WinningConditionHelper_topscore >= limit);
bool leadlimit_reached = (leadlimit && WinningConditionHelper_topscore - WinningConditionHelper_secondscore >= leadlimit);
// again, but this shouldn't hurt
return;
}
-
- // z411 don't check rules if we're in a timeout
+
+ // z411 don't check rules if we're in a timeout
if (game_timeout) return;
float timelimit = autocvar_timelimit * 60;
Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_RACE_FINISHLAP);
else
Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_OVERTIME_FRAG);
+ sound(NULL, CH_INFO, SND_OVERTIME, VOL_BASE, ATTN_NONE);
+ Send_Notification(NOTIF_ALL, NULL, MSG_ANNCE, ANNCE_SUDDENDEATH);
}
}
else
bool autocvar_sv_freezenonclients;
void Physics_Frame()
{
- if(autocvar_sv_freezenonclients)
+ if(autocvar_sv_freezenonclients || game_timeout)
return;
IL_EACH(g_moveables, true,
{
__init_dedicated_server_shutdown();
}
-}
\ No newline at end of file
+}
string gamemode_name;
+int fragsleft;
+int fragsleft_last;
string record_type;
string clientstuff;