seta hud_progressbar_alpha "" "alpha of progressbars"
seta hud_progressbar_strength_color "" "R G B vector of the progress bar background color"
+seta hud_progressbar_superweapons_color "" "R G B vector of the progress bar background color"
seta hud_progressbar_shield_color "" "R G B vector of the progress bar background color"
seta hud_progressbar_health_color "" "R G B vector of the progress bar background color"
seta hud_progressbar_armor_color "" "R G B vector of the progress bar background color"
seta hud_panel_powerups_progressbar "" "enable progressbar in panel"
seta hud_panel_powerups_progressbar_strength "" "progressbar image for strength"
seta hud_panel_powerups_progressbar_shield "" "progressbar image for shield"
+seta hud_panel_powerups_progressbar_superweapons "" "progressbar image for superweapons"
seta hud_panel_powerups_text "" "show text/icons in the powerups panel"
seta hud_panel_healtharmor "" "enable/disable this panel, 2 = combined health/armor display"
set g_pickup_respawntime_long 30
set g_pickup_respawntime_powerup 120
set g_pickup_respawntime_weapon 15
+set g_pickup_respawntime_superweapon 120
set g_pickup_respawntime_ammo 15
set g_pickup_respawntimejitter_short 0
set g_pickup_respawntimejitter_medium 0
set g_pickup_respawntimejitter_long 0
set g_pickup_respawntimejitter_powerup 10
set g_pickup_respawntimejitter_weapon 0
+set g_pickup_respawntimejitter_superweapon 10
set g_pickup_respawntimejitter_ammo 0
// }}}
set g_balance_powerup_strength_time 30
set g_balance_powerup_strength_selfdamage 1.5
set g_balance_powerup_strength_selfforce 1.5
+set g_balance_superweapons_time 30
// }}}
// {{{ jetpack/hook
set g_pickup_respawntime_long 30
set g_pickup_respawntime_powerup 120
set g_pickup_respawntime_weapon 10
+set g_pickup_respawntime_superweapon 120
set g_pickup_respawntime_ammo 25
set g_pickup_respawntimejitter_short 0
set g_pickup_respawntimejitter_medium 0
set g_pickup_respawntimejitter_long 0
set g_pickup_respawntimejitter_powerup 10
set g_pickup_respawntimejitter_weapon 0
+set g_pickup_respawntimejitter_superweapon 10
set g_pickup_respawntimejitter_ammo 0
// }}}
set g_balance_powerup_strength_time 30
set g_balance_powerup_strength_selfdamage 1.5
set g_balance_powerup_strength_selfforce 1.5
+set g_balance_superweapons_time 30
// }}}
// {{{ jetpack/hook
set g_pickup_respawntime_long 30
set g_pickup_respawntime_powerup 120
set g_pickup_respawntime_weapon 10
+set g_pickup_respawntime_superweapon 120
set g_pickup_respawntime_ammo 15
set g_pickup_respawntimejitter_short 0
set g_pickup_respawntimejitter_medium 0
set g_pickup_respawntimejitter_long 0
set g_pickup_respawntimejitter_powerup 30
set g_pickup_respawntimejitter_weapon 0
+set g_pickup_respawntimejitter_superweapon 10
set g_pickup_respawntimejitter_ammo 0
// }}}
set g_balance_powerup_strength_time 30
set g_balance_powerup_strength_selfdamage 1.5
set g_balance_powerup_strength_selfforce 1.5
+set g_balance_superweapons_time 30
// }}}
// {{{ jetpack/hook
set g_pickup_respawntime_long 30
set g_pickup_respawntime_powerup 120
set g_pickup_respawntime_weapon 10
+set g_pickup_respawntime_superweapon 120
set g_pickup_respawntime_ammo 10
set g_pickup_respawntimejitter_short 0
set g_pickup_respawntimejitter_medium 0
set g_pickup_respawntimejitter_long 0
set g_pickup_respawntimejitter_powerup 30
set g_pickup_respawntimejitter_weapon 0
+set g_pickup_respawntimejitter_superweapon 10
set g_pickup_respawntimejitter_ammo 0
// }}}
set g_balance_powerup_strength_time 30
set g_balance_powerup_strength_selfdamage 1.5
set g_balance_powerup_strength_selfforce 1.5
+set g_balance_superweapons_time 30
// }}}
// {{{ jetpack/hook
set g_respawn_ghosts 1 "if 1 dead bodies become ghosts and float away when the player respawns"
set g_respawn_ghosts_speed 5 "the speed with which respawn ghosts float and rotate"
set g_respawn_ghosts_maxtime 6 "maximum amount of time a respawn ghost can last, minimum time is half this value. 0 disables and ghosts fade when the body would"
+set cl_deathglow 0.8 "number of seconds during which dead bodies glow out"
set sv_gibhealth 100 "Minus health a dead body must have in order to get gibbed"
// waypoint editor enable
set g_waypointeditor 0
+set g_waypointeditor_auto 0 "Automatically create waypoints for bots while playing; BEWARE, this currently creates too many of them"
set bot_ignore_bots 0 "When set, bots don't shoot at other bots"
set bot_join_empty 0 "When set, bots also play if no player has joined the server"
set bot_vs_human 0 "Bots and humans play in different teams when set. positive values to make an all-bot blue team, set to negative values to make an all-bot red team, the absolute value is the ratio bots vs humans (1 for equal count). Changes will be correctly applied only from the next game"
seta hud_progressbar_alpha "0.500000"
seta hud_progressbar_strength_color "0 0 0.6"
+seta hud_progressbar_superweapons_color "0.6 0.3 0"
seta hud_progressbar_shield_color "0.6 0 0.6"
seta hud_progressbar_health_color "0.6 0 0"
seta hud_progressbar_armor_color "0 0.6 0"
seta hud_panel_powerups_progressbar "1"
seta hud_panel_powerups_progressbar_strength "progressbar"
seta hud_panel_powerups_progressbar_shield "progressbar"
+seta hud_panel_powerups_progressbar_superweapons "progressbar"
seta hud_panel_powerups_text "1"
seta hud_panel_healtharmor 1
seta hud_progressbar_alpha "0.500000"
seta hud_progressbar_strength_color "0 0 0.6"
+seta hud_progressbar_superweapons_color "0.6 0.3 0"
seta hud_progressbar_shield_color "0.6 0 0.6"
seta hud_progressbar_health_color "0.6 0 0"
seta hud_progressbar_armor_color "0 0.6 0"
seta hud_panel_powerups_progressbar "1"
seta hud_panel_powerups_progressbar_strength "progressbar"
seta hud_panel_powerups_progressbar_shield "progressbar"
+seta hud_panel_powerups_progressbar_superweapons "progressbar"
seta hud_panel_powerups_text "1"
seta hud_panel_healtharmor 1
seta hud_progressbar_alpha "0.3"
seta hud_progressbar_strength_color "0 0 0.6"
+seta hud_progressbar_superweapons_color "0.6 0.3 0"
seta hud_progressbar_shield_color "0.6 0 0.6"
seta hud_progressbar_health_color "0.6 0 0"
seta hud_progressbar_armor_color "0 0.6 0"
seta hud_panel_powerups_progressbar "1"
seta hud_panel_powerups_progressbar_strength "progressbar"
seta hud_panel_powerups_progressbar_shield "progressbar"
+seta hud_panel_powerups_progressbar_superweapons "progressbar"
seta hud_panel_powerups_text "1"
seta hud_panel_healtharmor 1
seta hud_progressbar_alpha "0.500000"
seta hud_progressbar_strength_color "0 0 0.6"
+seta hud_progressbar_superweapons_color "0.6 0.3 0"
seta hud_progressbar_shield_color "0.6 0 0.6"
seta hud_progressbar_health_color "0.6 0 0"
seta hud_progressbar_armor_color "0 0.6 0"
seta hud_panel_powerups_progressbar "1"
seta hud_panel_powerups_progressbar_strength "progressbar"
seta hud_panel_powerups_progressbar_shield "progressbar"
+seta hud_panel_powerups_progressbar_superweapons "progressbar"
seta hud_panel_powerups_text "1"
seta hud_panel_healtharmor 1
seta hud_progressbar_alpha "0.5"
seta hud_progressbar_strength_color "0 0 0.6"
+seta hud_progressbar_superweapons_color "0.6 0.3 0"
seta hud_progressbar_shield_color "0.6 0 0.6"
seta hud_progressbar_health_color "0.6 0 0"
seta hud_progressbar_armor_color "0 0.6 0"
seta hud_panel_powerups_progressbar "0"
seta hud_panel_powerups_progressbar_strength "progressbar"
seta hud_panel_powerups_progressbar_shield "progressbar"
+seta hud_panel_powerups_progressbar_superweapons "progressbar"
seta hud_panel_powerups_text "1"
seta hud_panel_healtharmor 1
+++ /dev/null
-0 0.00048828125 0.00048828125 0.06201171875 0.06201171875
-1 0.06298828125 0.00048828125 0.12451171875 0.06201171875
-2 0.12548828125 0.00048828125 0.18701171875 0.06201171875
-3 0.18798828125 0.00048828125 0.24951171875 0.06201171875
-4 0.25048828125 0.00048828125 0.31201171875 0.06201171875
-5 0.31298828125 0.00048828125 0.37451171875 0.06201171875
-6 0.37548828125 0.00048828125 0.43701171875 0.06201171875
-7 0.43798828125 0.00048828125 0.49951171875 0.06201171875
-8 0.50048828125 0.00048828125 0.56201171875 0.06201171875
-9 0.56298828125 0.00048828125 0.62451171875 0.06201171875
-10 0.62548828125 0.00048828125 0.68701171875 0.06201171875
-11 0.68798828125 0.00048828125 0.74951171875 0.06201171875
-12 0.75048828125 0.00048828125 0.81201171875 0.06201171875
-13 0.81298828125 0.00048828125 0.87451171875 0.06201171875
-14 0.87548828125 0.00048828125 0.93701171875 0.06201171875
-15 0.93798828125 0.00048828125 0.99951171875 0.06201171875
-16 0.00048828125 0.06298828125 0.06201171875 0.12451171875
-17 0.06298828125 0.06298828125 0.12451171875 0.12451171875
-18 0.12548828125 0.06298828125 0.18701171875 0.12451171875
-19 0.18798828125 0.06298828125 0.24951171875 0.12451171875
-20 0.25048828125 0.06298828125 0.31201171875 0.12451171875
-21 0.31298828125 0.06298828125 0.37451171875 0.12451171875
-22 0.37548828125 0.06298828125 0.43701171875 0.12451171875
-23 0.43798828125 0.06298828125 0.49951171875 0.12451171875
-24 0.50048828125 0.06298828125 0.56201171875 0.12451171875
-25 0.56298828125 0.06298828125 0.62451171875 0.12451171875
-26 0.62548828125 0.06298828125 0.68701171875 0.12451171875
-27 0.68798828125 0.06298828125 0.74951171875 0.12451171875
-28 0.75048828125 0.06298828125 0.81201171875 0.12451171875
-29 0.81298828125 0.06298828125 0.87451171875 0.12451171875
-30 0.87548828125 0.06298828125 0.93701171875 0.12451171875
-31 0.93798828125 0.06298828125 0.99951171875 0.12451171875
-32 0.00048828125 0.12548828125 0.06201171875 0.18701171875
-33 0.06298828125 0.12548828125 0.12451171875 0.18701171875
-34 0.12548828125 0.12548828125 0.18701171875 0.18701171875
-35 0.18798828125 0.12548828125 0.24951171875 0.18701171875
-36 0.25048828125 0.12548828125 0.31201171875 0.18701171875
-37 0.31298828125 0.12548828125 0.37451171875 0.18701171875
-38 0.37548828125 0.12548828125 0.43701171875 0.18701171875
-39 0.43798828125 0.12548828125 0.49951171875 0.18701171875
-40 0.50048828125 0.12548828125 0.56201171875 0.18701171875
-41 0.56298828125 0.12548828125 0.62451171875 0.18701171875
-42 0.62548828125 0.12548828125 0.68701171875 0.18701171875
-43 0.68798828125 0.12548828125 0.74951171875 0.18701171875
-44 0.75048828125 0.12548828125 0.81201171875 0.18701171875
-45 0.81298828125 0.12548828125 0.87451171875 0.18701171875
-46 0.87548828125 0.12548828125 0.93701171875 0.18701171875
-47 0.93798828125 0.12548828125 0.99951171875 0.18701171875
-48 0.00048828125 0.18798828125 0.06201171875 0.24951171875
-49 0.06298828125 0.18798828125 0.12451171875 0.24951171875
-50 0.12548828125 0.18798828125 0.18701171875 0.24951171875
-51 0.18798828125 0.18798828125 0.24951171875 0.24951171875
-52 0.25048828125 0.18798828125 0.31201171875 0.24951171875
-53 0.31298828125 0.18798828125 0.37451171875 0.24951171875
-54 0.37548828125 0.18798828125 0.43701171875 0.24951171875
-55 0.43798828125 0.18798828125 0.49951171875 0.24951171875
-56 0.50048828125 0.18798828125 0.56201171875 0.24951171875
-57 0.56298828125 0.18798828125 0.62451171875 0.24951171875
-58 0.62548828125 0.18798828125 0.68701171875 0.24951171875
-59 0.68798828125 0.18798828125 0.74951171875 0.24951171875
-60 0.75048828125 0.18798828125 0.81201171875 0.24951171875
-61 0.81298828125 0.18798828125 0.87451171875 0.24951171875
-62 0.87548828125 0.18798828125 0.93701171875 0.24951171875
-63 0.93798828125 0.18798828125 0.99951171875 0.24951171875
-64 0.00048828125 0.25048828125 0.06201171875 0.31201171875
-65 0.06298828125 0.25048828125 0.12451171875 0.31201171875
-66 0.12548828125 0.25048828125 0.18701171875 0.31201171875
-67 0.18798828125 0.25048828125 0.24951171875 0.31201171875
-68 0.25048828125 0.25048828125 0.31201171875 0.31201171875
-69 0.31298828125 0.25048828125 0.37451171875 0.31201171875
-70 0.37548828125 0.25048828125 0.43701171875 0.31201171875
-71 0.43798828125 0.25048828125 0.49951171875 0.31201171875
-72 0.50048828125 0.25048828125 0.56201171875 0.31201171875
-73 0.56298828125 0.25048828125 0.62451171875 0.31201171875
-74 0.62548828125 0.25048828125 0.68701171875 0.31201171875
-75 0.68798828125 0.25048828125 0.74951171875 0.31201171875
-76 0.75048828125 0.25048828125 0.81201171875 0.31201171875
-77 0.81298828125 0.25048828125 0.87451171875 0.31201171875
-78 0.87548828125 0.25048828125 0.93701171875 0.31201171875
-79 0.93798828125 0.25048828125 0.99951171875 0.31201171875
-80 0.00048828125 0.31298828125 0.06201171875 0.37451171875
-81 0.06298828125 0.31298828125 0.12451171875 0.37451171875
-82 0.12548828125 0.31298828125 0.18701171875 0.37451171875
-83 0.18798828125 0.31298828125 0.24951171875 0.37451171875
-84 0.25048828125 0.31298828125 0.31201171875 0.37451171875
-85 0.31298828125 0.31298828125 0.37451171875 0.37451171875
-86 0.37548828125 0.31298828125 0.43701171875 0.37451171875
-87 0.43798828125 0.31298828125 0.49951171875 0.37451171875
-88 0.50048828125 0.31298828125 0.56201171875 0.37451171875
-89 0.56298828125 0.31298828125 0.62451171875 0.37451171875
-90 0.62548828125 0.31298828125 0.68701171875 0.37451171875
-91 0.68798828125 0.31298828125 0.74951171875 0.37451171875
-92 0.75048828125 0.31298828125 0.81201171875 0.37451171875
-93 0.81298828125 0.31298828125 0.87451171875 0.37451171875
-94 0.87548828125 0.31298828125 0.93701171875 0.37451171875
-95 0.93798828125 0.31298828125 0.99951171875 0.37451171875
-96 0.00048828125 0.37548828125 0.06201171875 0.43701171875
-97 0.06298828125 0.37548828125 0.12451171875 0.43701171875
-98 0.12548828125 0.37548828125 0.18701171875 0.43701171875
-99 0.18798828125 0.37548828125 0.24951171875 0.43701171875
-100 0.25048828125 0.37548828125 0.31201171875 0.43701171875
-101 0.31298828125 0.37548828125 0.37451171875 0.43701171875
-102 0.37548828125 0.37548828125 0.43701171875 0.43701171875
-103 0.43798828125 0.37548828125 0.49951171875 0.43701171875
-104 0.50048828125 0.37548828125 0.56201171875 0.43701171875
-105 0.56298828125 0.37548828125 0.62451171875 0.43701171875
-106 0.62548828125 0.37548828125 0.68701171875 0.43701171875
-107 0.68798828125 0.37548828125 0.74951171875 0.43701171875
-108 0.75048828125 0.37548828125 0.81201171875 0.43701171875
-109 0.81298828125 0.37548828125 0.87451171875 0.43701171875
-110 0.87548828125 0.37548828125 0.93701171875 0.43701171875
-111 0.93798828125 0.37548828125 0.99951171875 0.43701171875
-112 0.00048828125 0.43798828125 0.06201171875 0.49951171875
-113 0.06298828125 0.43798828125 0.12451171875 0.49951171875
-114 0.12548828125 0.43798828125 0.18701171875 0.49951171875
-115 0.18798828125 0.43798828125 0.24951171875 0.49951171875
-116 0.25048828125 0.43798828125 0.31201171875 0.49951171875
-117 0.31298828125 0.43798828125 0.37451171875 0.49951171875
-118 0.37548828125 0.43798828125 0.43701171875 0.49951171875
-119 0.43798828125 0.43798828125 0.49951171875 0.49951171875
-120 0.50048828125 0.43798828125 0.56201171875 0.49951171875
-121 0.56298828125 0.43798828125 0.62451171875 0.49951171875
-122 0.62548828125 0.43798828125 0.68701171875 0.49951171875
-123 0.68798828125 0.43798828125 0.74951171875 0.49951171875
-124 0.75048828125 0.43798828125 0.81201171875 0.49951171875
-125 0.81298828125 0.43798828125 0.87451171875 0.49951171875
-126 0.87548828125 0.43798828125 0.93701171875 0.49951171875
-127 0.93798828125 0.43798828125 0.99951171875 0.49951171875
-128 0.00048828125 0.50048828125 0.06201171875 0.56201171875
-129 0.06298828125 0.50048828125 0.12451171875 0.56201171875
-130 0.12548828125 0.50048828125 0.18701171875 0.56201171875
-131 0.18798828125 0.50048828125 0.24951171875 0.56201171875
-132 0.25048828125 0.50048828125 0.31201171875 0.56201171875
-133 0.31298828125 0.50048828125 0.37451171875 0.56201171875
-134 0.37548828125 0.50048828125 0.43701171875 0.56201171875
-135 0.43798828125 0.50048828125 0.49951171875 0.56201171875
-136 0.50048828125 0.50048828125 0.56201171875 0.56201171875
-137 0.56298828125 0.50048828125 0.62451171875 0.56201171875
-138 0.62548828125 0.50048828125 0.68701171875 0.56201171875
-139 0.68798828125 0.50048828125 0.74951171875 0.56201171875
-140 0.75048828125 0.50048828125 0.81201171875 0.56201171875
-141 0.81298828125 0.50048828125 0.87451171875 0.56201171875
-142 0.87548828125 0.50048828125 0.93701171875 0.56201171875
-143 0.93798828125 0.50048828125 0.99951171875 0.56201171875
-144 0.00048828125 0.56298828125 0.06201171875 0.62451171875
-145 0.06298828125 0.56298828125 0.12451171875 0.62451171875
-146 0.12548828125 0.56298828125 0.18701171875 0.62451171875
-147 0.18798828125 0.56298828125 0.24951171875 0.62451171875
-148 0.25048828125 0.56298828125 0.31201171875 0.62451171875
-149 0.31298828125 0.56298828125 0.37451171875 0.62451171875
-150 0.37548828125 0.56298828125 0.43701171875 0.62451171875
-151 0.43798828125 0.56298828125 0.49951171875 0.62451171875
-152 0.50048828125 0.56298828125 0.56201171875 0.62451171875
-153 0.56298828125 0.56298828125 0.62451171875 0.62451171875
-154 0.62548828125 0.56298828125 0.68701171875 0.62451171875
-155 0.68798828125 0.56298828125 0.74951171875 0.62451171875
-156 0.75048828125 0.56298828125 0.81201171875 0.62451171875
-157 0.81298828125 0.56298828125 0.87451171875 0.62451171875
-158 0.87548828125 0.56298828125 0.93701171875 0.62451171875
-159 0.93798828125 0.56298828125 0.99951171875 0.62451171875
-1000 0 0.62548828125 1 0.68701171875
-1001 0 0.68798828125 1 0.74951171875
-1002 0 0.75048828125 1 0.81201171875
-1003 0 0.81298828125 1 0.87451171875
-1004 0 0.87548828125 1 0.93701171875
-1005 0 0.93798828125 1 0.99951171875
checkmagick $magick->Annotate(
x => $s0 * $pixw + 2,
y => $t1 * $pixh - 2,
- text => $i
+ text => $i,
+ font => '/usr/share/fonts/TTF/DejaVuSansMono.ttf'
);
}
++$i;
checkmagick $magick->Annotate(
x => $s0 * $pixw + 2,
y => $t1 * $pixh - 2,
- text => $i
+ text => $i,
+ font => '/usr/share/fonts/TTF/DejaVuSansMono.ttf'
);
}
++$i;
float serverflags;
float uid2name_dialog;
+
+.float csqcmodel_isdead; // used by shownames and miscfunctions (float getplayerisdead(float) {}) to know when a player is dead
\ No newline at end of file
float autocvar_hud_panel_powerups_progressbar;
string autocvar_hud_panel_powerups_progressbar_shield;
string autocvar_hud_panel_powerups_progressbar_strength;
+string autocvar_hud_panel_powerups_progressbar_superweapons;
float autocvar_hud_panel_powerups_text;
float autocvar_hud_panel_pressedkeys;
float autocvar_hud_panel_pressedkeys_aspect;
float autocvar__cl_playerskin;
string autocvar__cl_playermodel;
float autocvar_cl_precacheplayermodels;
+float autocvar_cl_deathglow;
.float csqcmodel_saveframe4;
.float csqcmodel_framecount;
-.float csqcmodel_isdead; // for utility code
-.float csqcmodel_deathtime; // for utility code
-
#define IS_DEAD_FRAME(f) ((f) == 0 || (f) == 1)
void CSQCPlayer_FallbackFrame_PreUpdate(void)
{
#define FIX_FRAMETIME(f,ft) \
if(IS_DEAD_FRAME(self.f)) \
{ \
- self.ft = 0; \
+ self.ft = self.death_time; \
}
FIX_FRAMETIME(frame, frame1time)
FIX_FRAMETIME(frame2, frame2time)
FIX_FRAMETIME(frame4, frame4time)
}
self.csqcmodel_isdead = IS_DEAD_FRAME(self.frame);
- if(self.csqcmodel_isdead)
- self.csqcmodel_deathtime = self.frame1time;
}
float CSQCPlayer_FallbackFrame(float f)
{
self.frame4 = CSQCPlayer_FallbackFrame(self.frame4);
}
-// FEATURE: auto glowmod
-.vector glowmod;
-void CSQCPlayer_GlowMod_Apply(void)
-{
- if(self.colormap > 0)
- self.glowmod = colormapPaletteColor(((self.colormap >= 1024) ? self.colormap : stof(getplayerkeyvalue(self.colormap - 1, "colors"))) & 0x0F, TRUE) * 2;
- else
- self.glowmod = '1 1 1';
-}
-
// FEATURE: auto tag_index
.entity tag_entity;
.float tag_entity_lastmodelindex;
void CSQCModel_Effects_Apply(void)
{
float eff = self.csqcmodel_effects;
- eff &~= CSQCMODEL_EF_INVISIBLE;
+ eff &~= CSQCMODEL_EF_RESPAWNGHOST;
self.renderflags &~= (RF_DEPTHHACK | RF_ADDITIVE | RF_FULLBRIGHT | EF_NOSHADOW | RF_USEAXIS);
self.effects = 0;
adddynamiclight(self.origin, 400, '3 3 3');
if(eff & EF_DIMLIGHT)
adddynamiclight(self.origin, 200, '1.5 1.5 1.5');
- if((eff & EF_NODRAW) || (self.csqcmodel_effects & CSQCMODEL_EF_INVISIBLE) || (self.alpha < 0))
+ if((eff & EF_NODRAW) || (self.alpha < 0))
self.drawmask = 0;
if(eff & EF_ADDITIVE)
self.renderflags |= RF_ADDITIVE;
Projectile_DrawTrail(self.origin);
else
Projectile_ResetTrail(self.origin);
+
+ if(self.csqcmodel_effects & CSQCMODEL_EF_RESPAWNGHOST)
+ self.renderflags |= RF_ADDITIVE;
+ // also special in CSQCPlayer_GlowMod_Apply
+}
+
+// FEATURE: auto glowmod
+.vector glowmod;
+void CSQCPlayer_GlowMod_Apply(void)
+{
+ float cm = self.colormap;
+
+ if(self.csqcmodel_effects & CSQCMODEL_EF_RESPAWNGHOST)
+ cm = 1024;
+
+ if(self.colormap > 0)
+ self.glowmod = colormapPaletteColor(((self.colormap >= 1024) ? self.colormap : stof(getplayerkeyvalue(self.colormap - 1, "colors"))) & 0x0F, TRUE) * 2;
+ else
+ self.glowmod = '1 1 1';
+
+ if(autocvar_cl_deathglow > 0)
+ if(self.csqcmodel_isdead)
+ {
+ self.glowmod = self.glowmod * bound(0, 1 - (time - self.death_time) / autocvar_cl_deathglow, 1);
+ // prevent the zero vector
+ self.glowmod_x = max(self.glowmod_x, 0.0001);
+ self.glowmod_y = max(self.glowmod_y, 0.0001);
+ self.glowmod_z = max(self.glowmod_z, 0.0001);
+ }
}
// general functions
}
}
-void DrawNumIcon(vector myPos, vector mySize, float x, string icon, float vertical, float icon_right_align, vector color, float theAlpha)
+void DrawNumIcon_expanding(vector myPos, vector mySize, float x, string icon, float vertical, float icon_right_align, vector color, float theAlpha, float fadelerp)
{
vector newPos, newSize;
vector picpos, numpos;
picpos = newPos;
}
- drawstring_aspect(numpos, ftos(x), '2 1 0' * newSize_y, color, panel_fg_alpha * theAlpha, DRAWFLAG_NORMAL);
- drawpic_aspect_skin(picpos, icon, '1 1 0' * newSize_y, '1 1 1', panel_fg_alpha * theAlpha, DRAWFLAG_NORMAL);
+ // FIXME newSize_x is unused, is that right?
+
+ drawstring_aspect_expanding(numpos, ftos(x), '2 1 0' * newSize_y, color, panel_fg_alpha * theAlpha, DRAWFLAG_NORMAL, fadelerp);
+ drawpic_aspect_skin_expanding(picpos, icon, '1 1 0' * newSize_y, '1 1 1', panel_fg_alpha * theAlpha, DRAWFLAG_NORMAL, fadelerp);
}
-void DrawNumIcon_expanding(vector myPos, vector mySize, float x, string icon, float vertical, float icon_right_align, vector color, float fadelerp)
+void DrawNumIcon(vector myPos, vector mySize, float x, string icon, float vertical, float icon_right_align, vector color, float theAlpha)
{
- float sz;
- sz = expandingbox_sizefactor_from_fadelerp(fadelerp);
-
- DrawNumIcon(myPos + expandingbox_resize_centered_box_offset(sz, mySize, 1), mySize * sz, x, icon, vertical, icon_right_align, color, (1 - fadelerp));
+ DrawNumIcon_expanding(myPos, mySize, x, icon, vertical, icon_right_align, color, theAlpha, 0);
}
// Powerups (#2)
//
void HUD_Powerups(void)
{
- float strength_time, shield_time;
+ float strength_time, shield_time, superweapons_time;
if(!autocvar__hud_configure)
{
if(!autocvar_hud_panel_powerups) return;
if(spectatee_status == -1) return;
- if not(getstati(STAT_ITEMS, 0, 24) & (IT_STRENGTH | IT_INVINCIBLE)) return;
+ if not(getstati(STAT_ITEMS, 0, 24) & (IT_STRENGTH | IT_INVINCIBLE | IT_SUPERWEAPON)) return;
if (getstati(STAT_HEALTH) <= 0) return;
strength_time = bound(0, getstatf(STAT_STRENGTH_FINISHED) - time, 99);
shield_time = bound(0, getstatf(STAT_INVINCIBLE_FINISHED) - time, 99);
+ superweapons_time = bound(0, getstatf(STAT_SUPERWEAPONS_FINISHED) - time, 99);
+
+ if (getstati(STAT_ITEMS, 0, 24) & IT_UNLIMITED_SUPERWEAPONS)
+ superweapons_time = 99; // force max
+
+ // prevent stuff to show up on mismatch that will be fixed next frame
+ if (!(getstati(STAT_ITEMS, 0, 24) & IT_SUPERWEAPON))
+ superweapons_time = 0;
}
else
{
strength_time = 15;
shield_time = 27;
+ superweapons_time = 13;
}
HUD_Panel_UpdateCvars(powerups);
pos = panel_pos;
mySize = panel_size;
- HUD_Panel_DrawBg(bound(0, max(strength_time, shield_time), 1));
+ HUD_Panel_DrawBg(bound(0, max(strength_time, shield_time, superweapons_time), 1));
if(panel_bg_padding)
{
pos += '1 1 0' * panel_bg_padding;
float panel_ar = mySize_x/mySize_y;
float is_vertical = (panel_ar < 1);
- vector shield_offset, strength_offset;
- if (panel_ar >= 4 || (panel_ar >= 1/4 && panel_ar < 1))
+ vector shield_offset, strength_offset, superweapons_offset;
+
+ float superweapons_is = -1;
+
+ if(superweapons_time)
+ {
+ if(strength_time)
+ {
+ if(shield_time)
+ superweapons_is = 0;
+ else
+ superweapons_is = 2;
+ }
+ else
+ {
+ if(shield_time)
+ superweapons_is = 1;
+ else
+ superweapons_is = 2;
+ }
+ }
+
+ // FIXME handle superweapons here
+ if(superweapons_is == 0)
{
- mySize_x *= 0.5;
- if (autocvar_hud_panel_powerups_flip)
- shield_offset_x = mySize_x;
+ if (panel_ar >= 4 || (panel_ar >= 1/4 && panel_ar < 1))
+ {
+ mySize_x *= (1.0 / 3.0);
+ superweapons_offset_x = mySize_x;
+ if (autocvar_hud_panel_powerups_flip)
+ shield_offset_x = 2*mySize_x;
+ else
+ strength_offset_x = 2*mySize_x;
+ }
else
- strength_offset_x = mySize_x;
+ {
+ mySize_y *= (1.0 / 3.0);
+ superweapons_offset_y = mySize_y;
+ if (autocvar_hud_panel_powerups_flip)
+ shield_offset_y = 2*mySize_y;
+ else
+ strength_offset_y = 2*mySize_y;
+ }
}
else
{
- mySize_y *= 0.5;
- if (autocvar_hud_panel_powerups_flip)
- shield_offset_y = mySize_y;
+ if (panel_ar >= 4 || (panel_ar >= 1/4 && panel_ar < 1))
+ {
+ mySize_x *= 0.5;
+ if (autocvar_hud_panel_powerups_flip)
+ shield_offset_x = mySize_x;
+ else
+ strength_offset_x = mySize_x;
+ }
else
- strength_offset_y = mySize_y;
+ {
+ mySize_y *= 0.5;
+ if (autocvar_hud_panel_powerups_flip)
+ shield_offset_y = mySize_y;
+ else
+ strength_offset_y = mySize_y;
+ }
}
- float shield_baralign, strength_baralign;
- float shield_iconalign, strength_iconalign;
+ float shield_baralign, strength_baralign, superweapons_baralign;
+ float shield_iconalign, strength_iconalign, superweapons_iconalign;
+
if (autocvar_hud_panel_powerups_flip)
{
strength_baralign = (autocvar_hud_panel_powerups_baralign == 2 || autocvar_hud_panel_powerups_baralign == 1);
strength_iconalign = (autocvar_hud_panel_powerups_iconalign == 3 || autocvar_hud_panel_powerups_iconalign == 1);
}
+ if(superweapons_is == 0)
+ {
+ superweapons_iconalign = strength_iconalign;
+ superweapons_baralign = 2;
+ }
+ else if(superweapons_is == 1)
+ {
+ superweapons_offset = strength_offset;
+ superweapons_iconalign = strength_iconalign;
+ superweapons_baralign = strength_baralign;
+ }
+ else if(superweapons_is == 2)
+ {
+ superweapons_offset = shield_offset;
+ superweapons_iconalign = shield_iconalign;
+ superweapons_baralign = shield_baralign;
+ }
+
if(shield_time)
{
const float maxshield = 30;
if(shield > 1)
DrawNumIcon(pos + shield_offset, mySize, shield, "shield", is_vertical, shield_iconalign, '1 1 1', 1);
if(shield <= 5)
- DrawNumIcon_expanding(pos + shield_offset, mySize, shield, "shield", is_vertical, shield_iconalign, '1 1 1', bound(0, (shield - shield_time) / 0.5, 1));
+ DrawNumIcon_expanding(pos + shield_offset, mySize, shield, "shield", is_vertical, shield_iconalign, '1 1 1', 1, bound(0, (shield - shield_time) / 0.5, 1));
}
}
if(strength > 1)
DrawNumIcon(pos + strength_offset, mySize, strength, "strength", is_vertical, strength_iconalign, '1 1 1', 1);
if(strength <= 5)
- DrawNumIcon_expanding(pos + strength_offset, mySize, strength, "strength", is_vertical, strength_iconalign, '1 1 1', bound(0, (strength - strength_time) / 0.5, 1));
+ DrawNumIcon_expanding(pos + strength_offset, mySize, strength, "strength", is_vertical, strength_iconalign, '1 1 1', 1, bound(0, (strength - strength_time) / 0.5, 1));
+ }
+ }
+
+ if(superweapons_time)
+ {
+ const float maxsuperweapons = 30;
+ float superweapons = ceil(superweapons_time);
+ if(autocvar_hud_panel_powerups_progressbar)
+ {
+ HUD_Panel_GetProgressBarColor(superweapons);
+ HUD_Panel_DrawProgressBar(pos + superweapons_offset, mySize, autocvar_hud_panel_powerups_progressbar_superweapons, superweapons/maxsuperweapons, is_vertical, superweapons_baralign, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+ }
+ if(autocvar_hud_panel_powerups_text)
+ {
+ if(superweapons > 1)
+ DrawNumIcon(pos + superweapons_offset, mySize, superweapons, "superweapons", is_vertical, superweapons_iconalign, '1 1 1', 1);
+ if(superweapons <= 5)
+ DrawNumIcon_expanding(pos + superweapons_offset, mySize, superweapons, "superweapons", is_vertical, superweapons_iconalign, '1 1 1', 1, bound(0, (superweapons - superweapons_time) / 0.5, 1));
}
}
}
return GETPLAYERORIGIN_ERROR;
}
+
+float getplayerisdead(float pl)
+{
+ entity e;
+
+ e = CSQCModel_server2csqc(pl + 1);
+ if(e)
+ return e.csqcmodel_isdead;
+
+ return FALSE;
+}
// self.sameteam = player is on same team as local client
// self.fadedelay = time to wait before name tag starts fading in for enemies
// self.pointtime = last time you pointed at this player
-//
+// self.csqcmodel_isdead = value of csqcmodel_isdead to know when the player is dead or not
+
const float SHOWNAMES_FADESPEED = 4;
const float SHOWNAMES_FADEDELAY = 0.4;
void Draw_ShowNames(entity ent)
ent.alpha = max(0, ent.alpha - SHOWNAMES_FADESPEED * frametime);
ent.fadedelay = 0; // reset fade in delay, enemy has left the view
}
- else if(ent.healthvalue < 1) // dead player, fade out slowly
+ else if(ent.csqcmodel_isdead) // dead player, fade out slowly
ent.alpha = max(0, ent.alpha - SHOWNAMES_FADESPEED * 0.25 * frametime);
else if(overlap) // tag overlap detected, fade out
ent.alpha = max(0, ent.alpha - SHOWNAMES_FADESPEED * frametime);
e.origin = getplayerorigin(i);
if(e.origin == GETPLAYERORIGIN_ERROR)
continue;
+
+ e.csqcmodel_isdead = getplayerisdead(i);
Draw_ShowNames(e);
}
.float armorvalue;
.float sameteam;
.float fadedelay;
-.float pointtime;
+.float pointtime;
\ No newline at end of file
const float STAT_LAYED_MINES = 56;
const float STAT_HAGAR_LOAD = 57;
const float STAT_SWITCHINGWEAPON = 58;
+const float STAT_SUPERWEAPONS_FINISHED = 59;
// see DP source, quakedef.h
const float STAT_MOVEVARS_AIRSPEEDLIMIT_NONQW = 222;
CSQCMODEL_PROPERTY(4, float, ReadByte, WriteByte, modelflags) \
CSQCMODEL_PROPERTY_SCALED(8, float, ReadByte, WriteByte, alpha, 254, -1, 254) \
CSQCMODEL_PROPERTY(16, float, ReadByte, WriteByte, skin) \
- CSQCMODEL_IF(isplayer) \
- CSQCMODEL_ENDIF \
+ CSQCMODEL_PROPERTY(32, float, ReadApproxPastTime, WriteApproxPastTime, death_time) \
CSQCMODEL_IF(!isplayer) \
- CSQCMODEL_PROPERTY(32, TAG_ENTITY_TYPE, ReadShort, WriteEntity, TAG_ENTITY_NAME) \
- CSQCMODEL_PROPERTY_SCALED(64, float, ReadByte, WriteByte, glowmod_x, 255, 0, 255) \
- CSQCMODEL_PROPERTY_SCALED(64, float, ReadByte, WriteByte, glowmod_y, 255, 0, 255) \
- CSQCMODEL_PROPERTY_SCALED(64, float, ReadByte, WriteByte, glowmod_z, 255, 0, 255) \
+ CSQCMODEL_PROPERTY(64, TAG_ENTITY_TYPE, ReadShort, WriteEntity, TAG_ENTITY_NAME) \
+ CSQCMODEL_PROPERTY_SCALED(128, float, ReadByte, WriteByte, glowmod_x, 255, 0, 255) \
+ CSQCMODEL_PROPERTY_SCALED(128, float, ReadByte, WriteByte, glowmod_y, 255, 0, 255) \
+ CSQCMODEL_PROPERTY_SCALED(128, float, ReadByte, WriteByte, glowmod_z, 255, 0, 255) \
CSQCMODEL_ENDIF
// TODO get rid of colormod/glowmod here, find good solution for nex charge glowmod hack; also get rid of some useless properties on non-players that only exist for CopyBody
# endif
#endif
-#define CSQCMODEL_EF_INVISIBLE EF_SELECTABLE
+#define CSQCMODEL_EF_RESPAWNGHOST EF_SELECTABLE
float BOT_PICKUP_RATING_MID = 5000;
float BOT_PICKUP_RATING_HIGH = 10000;
-float WEP_TYPE_OTHER = 0x00; // e.g: Hook, Port-o-launch, etc
-float WEP_TYPE_SPLASH = 0x01;
-float WEP_TYPE_HITSCAN = 0x02;
-float WEP_TYPEMASK = 0x0F;
-float WEP_FLAG_CANCLIMB = 0x10;
-float WEP_FLAG_NORMAL = 0x20;
-float WEP_FLAG_HIDDEN = 0x40;
-float WEP_FLAG_RELOADABLE = 0x80;
+float WEP_TYPE_OTHER = 0x00; // e.g: Hook, Port-o-launch, etc
+float WEP_TYPE_SPLASH = 0x01;
+float WEP_TYPE_HITSCAN = 0x02;
+float WEP_TYPEMASK = 0x0F;
+float WEP_FLAG_CANCLIMB = 0x10;
+float WEP_FLAG_NORMAL = 0x20;
+float WEP_FLAG_HIDDEN = 0x40;
+float WEP_FLAG_RELOADABLE = 0x80;
+float WEP_FLAG_SUPERWEAPON = 0x100;
-float IT_UNLIMITED_WEAPON_AMMO = 1;
+float IT_UNLIMITED_WEAPON_AMMO = 1;
// when this bit is set, using a weapon does not reduce ammo. Checkpoints can give this powerup.
-float IT_UNLIMITED_SUPERWEAPONS = 2;
-// when this bit is set, using a superweapon does not throw it away. Checkpoints can give this powerup.
-float IT_CTF_SHIELDED = 4; // set for the flag shield
-// using jetpack
-float IT_USING_JETPACK = 8; // confirmation that button is pressed
-float IT_JETPACK = 16; // actual item
-float IT_FUEL_REGEN = 32; // fuel regeneration trigger
-float IT_SHELLS = 256;
-float IT_NAILS = 512;
-float IT_ROCKETS = 1024;
-float IT_CELLS = 2048;
-float IT_SUPERWEAPON = 4096;
-float IT_FUEL = 128;
-float IT_STRENGTH = 8192;
-float IT_INVINCIBLE = 16384;
-float IT_HEALTH = 32768;
+float IT_UNLIMITED_SUPERWEAPONS = 2;
+// when this bit is set, superweapons don't expire. Checkpoints can give this powerup.
+float IT_CTF_SHIELDED = 4; // set for the flag shield
+float IT_USING_JETPACK = 8; // confirmation that button is pressed
+float IT_JETPACK = 16; // actual item
+float IT_FUEL_REGEN = 32; // fuel regeneration trigger
+float IT_SHELLS = 256;
+float IT_NAILS = 512;
+float IT_ROCKETS = 1024;
+float IT_CELLS = 2048;
+float IT_SUPERWEAPON = 4096;
+float IT_FUEL = 128;
+float IT_STRENGTH = 8192;
+float IT_INVINCIBLE = 16384;
+float IT_HEALTH = 32768;
// union:
- // for items:
- float IT_KEY1 = 131072;
- float IT_KEY2 = 262144;
- // for players:
- float IT_RED_FLAG_TAKEN = 32768;
- float IT_RED_FLAG_LOST = 65536;
- float IT_RED_FLAG_CARRING = 98304;
- float IT_BLUE_FLAG_TAKEN = 131072;
- float IT_BLUE_FLAG_LOST = 262144;
- float IT_BLUE_FLAG_CARRING = 393216;
+ // for items:
+ float IT_KEY1 = 131072;
+ float IT_KEY2 = 262144;
+ // for players:
+ float IT_RED_FLAG_TAKEN = 32768;
+ float IT_RED_FLAG_LOST = 65536;
+ float IT_RED_FLAG_CARRING = 98304;
+ float IT_BLUE_FLAG_TAKEN = 131072;
+ float IT_BLUE_FLAG_LOST = 262144;
+ float IT_BLUE_FLAG_CARRING = 393216;
// end
-float IT_5HP = 524288;
-float IT_25HP = 1048576;
-float IT_ARMOR_SHARD = 2097152;
-float IT_ARMOR = 4194304;
+float IT_5HP = 524288;
+float IT_25HP = 1048576;
+float IT_ARMOR_SHARD = 2097152;
+float IT_ARMOR = 4194304;
-float IT_AMMO = 8064; // IT_SHELLS | IT_NAILS | IT_ROCKETS | IT_CELLS | IT_SUPERWEAPON | IT_FUEL;
-float IT_PICKUPMASK = 51; // IT_FUEL_REGEN | IT_JETPACK | IT_UNLIMITED_AMMO; // strength and invincible are handled separately
-float IT_UNLIMITED_AMMO = 3; // IT_UNLIMITED_SUPERWEAPONS | IT_UNLIMITED_WEAPON_AMMO;
+float IT_AMMO = 3968; // IT_SHELLS | IT_NAILS | IT_ROCKETS | IT_CELLS | IT_FUEL;
+float IT_PICKUPMASK = 51; // IT_FUEL_REGEN | IT_JETPACK | IT_UNLIMITED_AMMO; // strength and invincible are handled separately
+float IT_UNLIMITED_AMMO = 3; // IT_UNLIMITED_SUPERWEAPONS | IT_UNLIMITED_WEAPON_AMMO;
float AMMO_COUNT = 4; // amount of ammo types to show in the inventory panel
float WEP_LAST;
#define WEP_MAXCOUNT 24
float WEPBIT_ALL;
+float WEPBIT_SUPERWEAPONS;
#define REGISTER_WEAPON_2(id,bit,func,ammotype,i,weapontype,pickupbasevalue,modelname,shortname,wname) \
float id; \
float bit; \
{ \
WEP_LAST = (id = WEP_FIRST + WEP_COUNT); \
WEPBIT_ALL |= (bit = power2of(WEP_COUNT)); \
+ WEPBIT_SUPERWEAPONS |= (bit = power2of(WEP_COUNT)) * !!(weapontype & WEP_FLAG_SUPERWEAPON); \
++WEP_COUNT; \
register_weapon(id,func,ammotype,i,weapontype,pickupbasevalue,modelname,shortname,wname); \
} \
}
cvar_settemp_restore(); // this must be done LAST, but in any case
}
+
+#define APPROXPASTTIME_ACCURACY_REQUIREMENT 0.05
+#define APPROXPASTTIME_MAX (16384 * APPROXPASTTIME_ACCURACY_REQUIREMENT)
+#define APPROXPASTTIME_RANGE (64 * APPROXPASTTIME_ACCURACY_REQUIREMENT)
+// this will use the value:
+// 128
+// accuracy near zero is APPROXPASTTIME_MAX/(256*255)
+// accuracy at x is 1/derivative, i.e.
+// APPROXPASTTIME_MAX * (1 + 256 * (dt / APPROXPASTTIME_MAX))^2 / 65536
+#ifdef SVQC
+void WriteApproxPastTime(float dst, float t)
+{
+ float dt = time - t;
+
+ // warning: this is approximate; do not resend when you don't have to!
+ // be careful with sendflags here!
+ // we want: 0 -> 0.05, 1 -> 0.1, ..., 255 -> 12.75
+
+ // map to range...
+ dt = 256 * (dt / ((APPROXPASTTIME_MAX / 256) + dt));
+
+ // round...
+ dt = rint(bound(0, dt, 255));
+
+ WriteByte(dst, dt);
+}
+#endif
+#ifdef CSQC
+float ReadApproxPastTime()
+{
+ float dt = ReadByte();
+
+ // map from range...PPROXPASTTIME_MAX / 256
+ dt = (APPROXPASTTIME_MAX / 256) * (dt / (256 - dt));
+
+ return servertime - dt;
+}
+#endif
// loops through the tags of model v using counter tagnum
#define FOR_EACH_TAG(v) float tagnum; for(tagnum = 1, gettaginfo(v, tagnum);; tagnum++, gettaginfo(v, tagnum)) if not(gettaginfo_name) break; else
#endif
+#ifdef SVQC
+void WriteApproxPastTime(float dst, float t);
+#endif
+#ifdef CSQC
+float ReadApproxPastTime();
+#endif
float autocvar_g_balance_powerup_strength_selfdamage;
float autocvar_g_balance_powerup_strength_selfforce;
float autocvar_g_balance_powerup_strength_time;
+float autocvar_g_balance_superweapons_time;
float autocvar_g_balance_rocketlauncher_ammo;
float autocvar_g_balance_rocketlauncher_animtime;
float autocvar_g_balance_rocketlauncher_damage;
float autocvar_g_turrets_unit_walker_turn_swim;
float autocvar_g_use_ammunition;
float autocvar_g_waypointeditor;
+float autocvar_g_waypointeditor_auto;
float autocvar_g_waypoints_for_items;
float autocvar_g_weapon_charge_colormod_blue_full;
float autocvar_g_weapon_charge_colormod_blue_half;
localcmd("quit\n");
}
- if (currentbots > 0 || autocvar_g_waypointeditor)
+ if (currentbots > 0 || autocvar_g_waypointeditor || autocvar_g_waypointeditor_auto)
if (botframe_spawnedwaypoints)
{
if(botframe_cachedwaypointlinks)
if (autocvar_g_waypointeditor)
botframe_showwaypointlinks();
+ if (autocvar_g_waypointeditor_auto)
+ botframe_autowaypoints();
+
if(time > bot_cvar_nextthink)
{
if(currentbots>0)
self.goalstack31 = world;
}
+float navigation_waypoint_will_link(vector v, vector org, entity ent, float walkfromwp, float bestdist)
+{
+ float dist;
+ dist = vlen(v - org);
+ if (bestdist > dist)
+ {
+ traceline(v, org, TRUE, ent);
+ if (trace_fraction == 1)
+ {
+ if (walkfromwp)
+ {
+ if (tracewalk(ent, v, PL_MIN, PL_MAX, org, bot_navigation_movemode))
+ return TRUE;
+ }
+ else
+ {
+ if (tracewalk(ent, org, PL_MIN, PL_MAX, v, bot_navigation_movemode))
+ return TRUE;
+ }
+ }
+ }
+ return FALSE;
+}
+
// find the spawnfunc_waypoint near a dynamic goal such as a dropped weapon
-entity navigation_findnearestwaypoint(entity ent, float walkfromwp)
+entity navigation_findnearestwaypoint_withdist(entity ent, float walkfromwp, float bestdist)
{
entity waylist, w, best;
- float dist, bestdist;
+ float dist;
vector v, org, pm1, pm2;
+
pm1 = ent.origin + ent.mins;
pm2 = ent.origin + ent.maxs;
waylist = findchain(classname, "waypoint");
te_plasmaburn(org);
best = world;
- bestdist = 1050;
// box check failed, try walk
w = waylist;
}
else
v = w.origin;
- dist = vlen(v - org);
- if (bestdist > dist)
+ if(navigation_waypoint_will_link(v, org, ent, walkfromwp, bestdist))
{
- traceline(v, org, TRUE, ent);
- if (trace_fraction == 1)
- {
- if (walkfromwp)
- {
- //print("^1can I reach ", vtos(org), " from ", vtos(v), "?\n");
- if (tracewalk(ent, v, PL_MIN, PL_MAX, org, bot_navigation_movemode))
- {
- bestdist = dist;
- best = w;
- }
- }
- else
- {
- if (tracewalk(ent, org, PL_MIN, PL_MAX, v, bot_navigation_movemode))
- {
- bestdist = dist;
- best = w;
- }
- }
- }
+ bestdist = vlen(v - org);
+ best = w;
}
}
w = w.chain;
}
return best;
}
+entity navigation_findnearestwaypoint(entity ent, float walkfromwp)
+{
+ return navigation_findnearestwaypoint_withdist(ent, walkfromwp, 1050);
+}
// finds the waypoints near the bot initiating a navigation query
float navigation_markroutes_nearestwaypoints(entity waylist, float maxdist)
player = find(player, classname, "player");
}
}
+
+float botframe_autowaypoints_fixdown(vector v)
+{
+ tracebox(v, PL_MIN, PL_MAX, v + '0 0 -64', MOVE_NOMONSTERS, world);
+ if(trace_fraction >= 1)
+ return 0;
+ return 1;
+}
+
+float botframe_autowaypoints_createwp(vector v, entity p, .entity fld)
+{
+ entity w;
+
+ w = find(world, classname, "waypoint");
+ while (w)
+ {
+ // if a matching spawnfunc_waypoint already exists, don't add a duplicate
+ if (boxesoverlap(v - '32 32 32', v + '32 32 32', w.absmin, w.absmax))
+ //if (boxesoverlap(v - '4 4 4', v + '4 4 4', w.absmin, w.absmax))
+ return 0;
+ w = find(w, classname, "waypoint");
+ }
+
+ waypoint_schedulerelink(p.fld = waypoint_spawn(v, v, 0));
+ return 1;
+}
+
+// return value:
+// 1 = WP created
+// 0 = no action needed
+// -1 = temp fail, try from world too
+// -2 = permanent fail, do not retry
+float botframe_autowaypoints_fix_from(entity p, float walkfromwp, entity wp, .entity fld)
+{
+ // make it possible to go from p to wp, if we can
+ // if wp is world, nearest is chosen
+
+ entity w;
+ vector porg;
+ float t, tmin, tmax;
+ vector o;
+ vector save;
+
+ if(!botframe_autowaypoints_fixdown(p.origin))
+ return -2;
+ porg = trace_endpos;
+
+ if(wp)
+ {
+ // if any WP w fulfills wp -> w -> porg, then switch from wp to w
+
+ // if wp -> porg, then OK
+ float maxdist;
+ if(navigation_waypoint_will_link(wp.origin, porg, p, walkfromwp, 1050))
+ {
+ // we may find a better one
+ maxdist = vlen(wp.origin - porg);
+ }
+ else
+ {
+ // accept any "good"
+ maxdist = 2100;
+ }
+
+ float bestdist;
+ bestdist = maxdist;
+ w = find(world, classname, "waypoint");
+ while (w)
+ {
+ if(w != wp && !(w.wpflags & WAYPOINTFLAG_NORELINK))
+ {
+ float d;
+ d = vlen(wp.origin - w.origin) + vlen(w.origin - porg);
+ if(d < bestdist)
+ if(navigation_waypoint_will_link(wp.origin, w.origin, p, walkfromwp, 1050))
+ if(navigation_waypoint_will_link(w.origin, porg, p, walkfromwp, 1050))
+ {
+ bestdist = d;
+ p.fld = w;
+ }
+ }
+ w = find(w, classname, "waypoint");
+ }
+ if(bestdist < maxdist)
+ {
+ print("update chain to new nearest WP ", etos(p.fld), "\n");
+ return 0;
+ }
+
+ if(bestdist < 2100)
+ {
+ // we know maxdist < 2100
+ // so wp -> porg is still valid
+ // all is good
+ p.fld = wp;
+ return 0;
+ }
+
+ // otherwise, no existing WP can fix our issues
+ }
+ else
+ {
+ save = p.origin;
+ setorigin(p, porg);
+ w = navigation_findnearestwaypoint(p, walkfromwp);
+ setorigin(p, save);
+ if(w)
+ {
+ p.fld = w;
+ return 0;
+ }
+ }
+
+ tmin = 0;
+ tmax = 1;
+ for(;;)
+ {
+ if(tmax - tmin < 0.001)
+ {
+ // did not get a good candidate
+ return -1;
+ }
+
+ t = (tmin + tmax) * 0.5;
+ o = antilag_takebackorigin(p, time - t);
+ if(!botframe_autowaypoints_fixdown(o))
+ return -1;
+ o = trace_endpos;
+
+ if(wp)
+ {
+ if(!navigation_waypoint_will_link(wp.origin, o, p, walkfromwp, 1050))
+ {
+ // we cannot walk from wp.origin to o
+ // get closer to tmax
+ tmin = t;
+ continue;
+ }
+ }
+ else
+ {
+ save = p.origin;
+ setorigin(p, o);
+ w = navigation_findnearestwaypoint(p, walkfromwp);
+ setorigin(p, save);
+ if(!w)
+ {
+ // we cannot walk from any WP to o
+ // get closer to tmax
+ tmin = t;
+ continue;
+ }
+ }
+
+ // if we get here, o is valid regarding waypoints
+ // check if o is connected right to the player
+ // we break if it succeeds, as that means o is a good waypoint location
+ if(navigation_waypoint_will_link(o, porg, p, walkfromwp, 1050))
+ break;
+
+ // o is no good, we need to get closer to the player
+ tmax = t;
+ }
+
+ print("spawning a waypoint for connecting to ", etos(wp), "\n");
+ botframe_autowaypoints_createwp(o, p, fld);
+ return 1;
+}
+
+// automatically create missing waypoints
+.entity botframe_autowaypoints_lastwp0, botframe_autowaypoints_lastwp1;
+void botframe_autowaypoints_fix(entity p, float walkfromwp, .entity fld)
+{
+ float r;
+ r = botframe_autowaypoints_fix_from(p, walkfromwp, p.fld, fld);
+ if(r != -1)
+ return;
+ r = botframe_autowaypoints_fix_from(p, walkfromwp, world, fld);
+ if(r != -1)
+ return;
+
+ print("emergency: got no good nearby WP to build a link from, starting a new chain\n");
+ if(!botframe_autowaypoints_fixdown(p.origin))
+ return; // shouldn't happen, caught above
+ botframe_autowaypoints_createwp(trace_endpos, p, fld);
+}
+
+void botframe_autowaypoints()
+{
+ entity p;
+ entity wp0, wp1;
+ FOR_EACH_REALPLAYER(p)
+ {
+ if(p.deadflag)
+ continue;
+ // going back is broken, so only fix waypoints to walk TO the player
+ //botframe_autowaypoints_fix(p, FALSE, botframe_autowaypoints_lastwp0);
+ botframe_autowaypoints_fix(p, TRUE, botframe_autowaypoints_lastwp1);
+ //te_explosion(p.botframe_autowaypoints_lastwp0.origin);
+ }
+}
+
entity waypoint_spawnpersonal(vector position);
vector waypoint_fixorigin(vector position);
+
+void botframe_autowaypoints();
self.pauseregen_finished = 0;
self.damageforcescale = 0;
self.death_time = 0;
+ self.respawn_time = 0;
self.alpha = 0;
self.scale = 0;
self.fade_time = 0;
self.pain_finished = 0;
self.strength_finished = 0;
self.invincible_finished = 0;
+ self.superweapons_finished = 0;
self.pushltime = 0;
self.think = SUB_Null;
self.nextthink = 0;
self.weapons = start_weapons;
}
+ if(self.weapons & WEPBIT_SUPERWEAPONS) // exception for minstagib, as minstanex is a superweapon
+ self.superweapons_finished = time + autocvar_g_balance_superweapons_time;
+ else
+ self.superweapons_finished = 0;
+
if(g_weaponarena_random)
{
if(g_weaponarena_random_with_laser)
}
self.damageforcescale = 2;
self.death_time = 0;
+ self.respawn_time = 0;
self.scale = 0;
self.fade_time = 0;
self.pain_frame = 0;
self.movetype = MOVETYPE_FLY;
self.velocity = '0 0 1' * autocvar_g_respawn_ghosts_speed;
self.avelocity = randomvec() * autocvar_g_respawn_ghosts_speed * 3 - randomvec() * autocvar_g_respawn_ghosts_speed * 3;
- self.effects |= EF_ADDITIVE;
- self.oldcolormap = self.colormap; // saved for copybody to use later
- self.colormap = 0; // this originally was 512, but raises a warning in the engine, so get rid of it
+ self.effects |= CSQCMODEL_EF_RESPAWNGHOST;
pointparticles(particleeffectnum("respawn_ghost"), self.origin, '0 0 0', 1);
if(autocvar_g_respawn_ghosts_maxtime)
SUB_SetFade (self, time + autocvar_g_respawn_ghosts_maxtime / 2 + random () * (autocvar_g_respawn_ghosts_maxtime - autocvar_g_respawn_ghosts_maxtime / 2), 1.5);
}
CopyBody(1);
+
self.effects |= EF_NODRAW; // prevent another CopyBody
-
- if(self.oldcolormap) // reset it so that when they respawn it'll be back to normal
- {
- self.colormap = self.oldcolormap;
- self.oldcolormap = 0;
- }
-
PutClientInServer();
}
sprint(self, "^3Shield surrounds you\n");
}
}
+ if (self.items & IT_SUPERWEAPON)
+ {
+ self.effects = self.effects | EF_RED;
+ if (!(self.weapons & WEPBIT_SUPERWEAPONS))
+ {
+ self.superweapons_finished = 0;
+ self.items = self.items - (self.items & IT_SUPERWEAPON);
+ sprint(self, "^3Superweapons have been lost\n");
+ }
+ else if (self.items & IT_UNLIMITED_SUPERWEAPONS)
+ {
+ // don't let them run out
+ }
+ else
+ {
+ play_countdown(self.superweapons_finished, "misc/poweroff.wav");
+ if (time > self.superweapons_finished)
+ {
+ self.items = self.items - (self.items & IT_SUPERWEAPON);
+ self.weapons &~= WEPBIT_SUPERWEAPONS;
+ sprint(self, "^3Superweapons have broken down\n");
+ }
+ }
+ }
+ else
+ {
+ if (time < self.superweapons_finished)
+ {
+ self.items = self.items | IT_SUPERWEAPON;
+ sprint(self, "^3You now have a superweapon\n");
+ }
+ else
+ self.weapons &~= WEPBIT_SUPERWEAPONS; // just in case
+ }
}
if(autocvar_g_nodepthtestplayers)
return;
else
{
- number = ceil(self.death_time - time);
+ number = ceil(self.respawn_time - time);
if(number <= 0)
return;
if(number <= self.respawn_countdown)
{
self.respawn_countdown = number - 1;
- if(ceil(self.death_time - (time + 0.5)) == number) // only say it if it is the same number even in 0.5s; to prevent overlapping sounds
+ if(ceil(self.respawn_time - (time + 0.5)) == number) // only say it if it is the same number even in 0.5s; to prevent overlapping sounds
AnnounceTo(self, strcat(ftos(number), ""));
}
}
float button_pressed, force_respawn;
if(self.personal && g_race_qualifying)
{
- if(time > self.death_time)
+ if(time > self.respawn_time)
{
- self.death_time = time + 1; // only retry once a second
+ self.respawn_time = time + 1; // only retry once a second
respawn();
self.impulse = 141;
}
}
else if (self.deadflag == DEAD_RESPAWNING)
{
- if(time > self.death_time)
+ if(time > self.respawn_time)
{
- self.death_time = time + 1; // only retry once a second
+ self.respawn_time = time + 1; // only retry once a second
respawn();
}
}
.entity pusher;
.float pushltime;
-.float oldcolormap; // also used in cl_client.c:void respawn(void)
-
.float CopyBody_nextthink;
.void(void) CopyBody_think;
void CopyBody_Think(void)
self = spawn();
self.enemy = oldself;
self.lip = oldself.lip;
- self.colormap = oldself.oldcolormap;
+ self.colormap = oldself.colormap;
self.iscreature = oldself.iscreature;
self.damagedbycontents = oldself.damagedbycontents;
self.angles = oldself.angles;
self.animstate_endtime = oldself.animstate_endtime;
self.animstate_override = oldself.animstate_override;
self.animstate_looping = oldself.animstate_looping;
+ self.dphitcontentsmask = oldself.dphitcontentsmask;
+ self.death_time = oldself.death_time;
self.frame = oldself.frame;
self.pain_finished = oldself.pain_finished;
self.health = oldself.health;
if(!waves)
waves = autocvar_g_respawn_waves;
if(waves)
- self.death_time = ceil((time + sdelay) / waves) * waves;
+ self.respawn_time = ceil((time + sdelay) / waves) * waves;
else
- self.death_time = time + sdelay;
- if((sdelay + waves >= 5.0) && (self.death_time - time > 1.75))
+ self.respawn_time = time + sdelay;
+ if((sdelay + waves >= 5.0) && (self.respawn_time - time > 1.75))
self.respawn_countdown = 10; // first number to count down from is 10
else
self.respawn_countdown = -1; // do not count down
+ self.death_time = time;
if (random() < 0.5)
setanim(self, self.anim_die1, FALSE, TRUE, TRUE);
else
if(!privatesay)
if(source.classname != "player")
{
- if(teamsay || (autocvar_g_chat_nospectators == 1) || (autocvar_g_chat_nospectators == 2 && !inWarmupStage))
- teamsay = -1; // spectators
+ if not(intermission_running)
+ if(teamsay || (autocvar_g_chat_nospectators == 1) || (autocvar_g_chat_nospectators == 2 && !inWarmupStage))
+ teamsay = -1; // spectators
}
if(flood)
if(sourcemsgstr != "" && ret != 0)
{
- if(ret < 0) // fake
+ if(ret < 0) // faked message, because the player is muted
{
sprint(source, sourcemsgstr);
if(sourcecmsgstr != "" && !privatesay)
centerprint(source, sourcecmsgstr);
}
- else if(privatesay)
+ else if(privatesay) // private message, between 2 people only, not sent to server console
{
sprint(source, sourcemsgstr);
sprint(privatesay, msgstr);
if(cmsgstr != "")
centerprint(privatesay, cmsgstr);
}
- else if(teamsay > 0)
+ else if(teamsay > 0) // team message, only sent to team mates
{
sprint(source, sourcemsgstr);
+ //print(msgstr); // send to server console too
if(sourcecmsgstr != "")
centerprint(source, sourcecmsgstr);
FOR_EACH_REALPLAYER(head) if(head.team == source.team)
centerprint(head, cmsgstr);
}
}
- else if(teamsay < 0)
+ else if(teamsay < 0) // spectator message, only sent to spectators
{
sprint(source, sourcemsgstr);
+ //print(msgstr); // send to server console too
FOR_EACH_REALCLIENT(head) if(head.classname != "player")
if(head != source)
sprint(head, msgstr);
}
- else if(sourcemsgstr != msgstr)
+ else if(sourcemsgstr != msgstr) // trimmed/server fixed message, sent to all players
{
sprint(source, sourcemsgstr);
+ //print(msgstr); // send to server console too
FOR_EACH_REALCLIENT(head)
if(head != source)
sprint(head, msgstr);
}
else
- bprint(msgstr);
+ bprint(msgstr); // entirely normal message, sent to all players -- bprint sends to server console too.
}
return ret;
float W_AmmoItemCode(float wpn)
{
- return (get_weaponinfo(wpn)).items;
+ return (get_weaponinfo(wpn)).items & IT_AMMO;
}
void thrown_wep_think()
wep.colormap = own.colormap;
wa = W_AmmoItemCode(wpn);
- if(wa == IT_SUPERWEAPON || wa == 0)
+ if(wa == 0)
{
oldself = self;
self = wep;
wb = W_WeaponBit(w);
if(!wb)
return 0;
+ if(wb & WEPBIT_SUPERWEAPONS) // can't throw a superweapon, they don't work
+ return 0;
wa = W_AmmoItemCode(w);
if(start_weapons & wb)
{
- if(wa == IT_SUPERWEAPON && start_items & IT_UNLIMITED_SUPERWEAPONS)
- return 0;
- if(wa != IT_SUPERWEAPON && start_items & IT_UNLIMITED_WEAPON_AMMO)
- return 0;
// start weapons that take no ammo can't be dropped (this prevents dropping the laser, as long as it continues to use no ammo)
+ if(start_items & IT_UNLIMITED_WEAPON_AMMO)
+ return 0;
if(wa == 0)
return 0;
}
entity e;
e = get_weaponinfo(windex);
self.items &~= IT_AMMO;
- self.items = self.items | e.items;
+ self.items = self.items | (e.items & IT_AMMO);
// the two weapon entities will notice this has changed and update their models
self.weapon = windex;
float g_race_qualifying;
float inWarmupStage;
float g_pickup_respawntime_weapon;
+float g_pickup_respawntime_superweapon;
float g_pickup_respawntime_ammo;
float g_pickup_respawntime_short;
float g_pickup_respawntime_medium;
float g_pickup_respawntime_long;
float g_pickup_respawntime_powerup;
float g_pickup_respawntimejitter_weapon;
+float g_pickup_respawntimejitter_superweapon;
float g_pickup_respawntimejitter_ammo;
float g_pickup_respawntimejitter_short;
float g_pickup_respawntimejitter_medium;
.float crouch; // Crouching or not?
.float strength_finished;
-//.float speed_finished;
.float invincible_finished;
-//.float slowmo_finished;
+.float superweapons_finished;
.vector finaldest, finalangle; //plat.qc stuff
.void() think1;
//.float cnt2;
.float play_time;
+.float respawn_time;
.float death_time;
.float fade_time;
.float fade_rate;
addstat(STAT_STRENGTH_FINISHED, AS_FLOAT, strength_finished);
addstat(STAT_INVINCIBLE_FINISHED, AS_FLOAT, invincible_finished);
+ addstat(STAT_SUPERWEAPONS_FINISHED, AS_FLOAT, superweapons_finished);
addstat(STAT_PRESSED_KEYS, AS_FLOAT, pressedkeys);
addstat(STAT_FUEL, AS_INT, ammo_fuel);
addstat(STAT_SHOTORG, AS_INT, stat_shotorg);
start_weapons = WEPBIT_MINSTANEX;
weapon_action(WEP_MINSTANEX, WR_PRECACHE);
g_minstagib_invis_alpha = cvar("g_minstagib_invis_alpha");
+ start_items |= IT_UNLIMITED_SUPERWEAPONS;
if (g_minstagib_invis_alpha <= 0)
g_minstagib_invis_alpha = -1;
inWarmupStage = 0; // these modes cannot work together, sorry
g_pickup_respawntime_weapon = cvar("g_pickup_respawntime_weapon");
+ g_pickup_respawntime_superweapon = cvar("g_pickup_respawntime_superweapon");
g_pickup_respawntime_ammo = cvar("g_pickup_respawntime_ammo");
g_pickup_respawntime_short = cvar("g_pickup_respawntime_short");
g_pickup_respawntime_medium = cvar("g_pickup_respawntime_medium");
g_pickup_respawntime_long = cvar("g_pickup_respawntime_long");
g_pickup_respawntime_powerup = cvar("g_pickup_respawntime_powerup");
g_pickup_respawntimejitter_weapon = cvar("g_pickup_respawntimejitter_weapon");
+ g_pickup_respawntimejitter_superweapon = cvar("g_pickup_respawntimejitter_superweapon");
g_pickup_respawntimejitter_ammo = cvar("g_pickup_respawntimejitter_ammo");
g_pickup_respawntimejitter_short = cvar("g_pickup_respawntimejitter_short");
g_pickup_respawntimejitter_medium = cvar("g_pickup_respawntimejitter_medium");
void Send_CSQC_Centerprint_Generic(entity e, float id, string s, float duration, float countdown_num)
{
- if (clienttype(e) == CLIENTTYPE_REAL)
+ if ((clienttype(e) == CLIENTTYPE_REAL) && (e.flags & FL_CLIENT))
{
msg_entity = e;
WRITESPECTATABLE_MSG_ONE({
{
self.nix_lastchange_id = -1;
NIX_GiveCurrentWeapon(); // overrides the weapons you got when spawning
+ self.items |= IT_UNLIMITED_SUPERWEAPONS;
return 0;
}
e.spawnshieldtime = 1;
}
- else if((e.flags & FL_WEAPON) && g_weapon_stay)
+ else if((e.flags & FL_WEAPON) && !(e.flags & FL_NO_WEAPON_STAY) && g_weapon_stay)
{
// make the item translucent and not touchable
e.model = e.mdl;
case IT_FUEL_REGEN: name = "item-fuelregen"; rgb = '1 0.5 0'; break;
case IT_JETPACK: name = "item-jetpack"; rgb = '0.5 0.5 0.5'; break;
}
+ if(self.flags & FL_WEAPON)
+ {
+ entity wi = get_weaponinfo(self.weapon);
+ if(wi)
+ {
+ name = wi.model2;
+ rgb = '1 0 0';
+ }
+ }
if(!name)
{
print("Unknown powerup-marked item is wanting to respawn\n");
void Item_ScheduleRespawnIn(entity e, float t)
{
- if(e.flags & FL_POWERUP)
+ if((e.flags & FL_POWERUP) || (e.weapons & WEPBIT_SUPERWEAPONS))
{
e.think = Item_RespawnCountdown;
e.nextthink = time + max(0, t - ITEM_RESPAWN_TICKS);
if (item.strength_finished)
{
pickedup = TRUE;
- player.strength_finished = max(player.strength_finished, time) + autocvar_g_balance_powerup_strength_time;
+ player.strength_finished = max(player.strength_finished, time) + item.strength_finished;
}
if (item.invincible_finished)
{
pickedup = TRUE;
- player.invincible_finished = max(player.invincible_finished, time) + autocvar_g_balance_powerup_invincible_time;
+ player.invincible_finished = max(player.invincible_finished, time) + item.invincible_finished;
+ }
+ if (item.superweapons_finished)
+ {
+ pickedup = TRUE;
+ player.superweapons_finished = max(player.superweapons_finished, time) + item.superweapons_finished;
}
}
}
}
+void Item_Reset()
+{
+ Item_Show(self, !self.state);
+ setorigin (self, self.origin);
+ self.think = SUB_Null;
+ self.nextthink = 0;
+
+ if((self.flags & FL_POWERUP) | (self.weapons & WEPBIT_SUPERWEAPONS)) // do not spawn powerups initially!
+ Item_ScheduleInitialRespawn(self);
+}
+
void Item_FindTeam()
{
entity head, e;
head.effects &~= EF_NODRAW;
}
- if(e.flags & FL_POWERUP) // do not spawn powerups initially!
- Item_ScheduleInitialRespawn(e);
+ Item_Reset();
}
}
-void Item_Reset()
-{
- Item_Show(self, !self.state);
- setorigin (self, self.origin);
- self.think = SUB_Null;
- self.nextthink = 0;
-
- if(self.flags & FL_POWERUP) // do not spawn powerups initially!
- Item_ScheduleInitialRespawn(self);
-}
-
// Savage: used for item garbage-collection
// TODO: perhaps nice special effect?
void RemoveItem(void)
return;
}
+ if(self.model != "")
+ itemmodel = self.model;
+ if(self.item_pickupsound != "")
+ pickupsound = self.item_pickupsound;
+
self.reset = Item_Reset;
// it's a level item
if(self.spawnflags & 1)
self.bot_pickupbasevalue = pickupbasevalue;
self.mdl = itemmodel;
self.item_pickupsound = pickupsound;
+ if(self.weapons)
+ self.weapon = WEP_FIRST + log2of(lowestbit(self.weapons));
+ else
+ self.weapon = 0;
// let mappers override respawntime
if(!self.respawntime) // both set
{
self.effects = self.effects | EF_NODRAW; // marker for item team search
InitializeEntity(self, Item_FindTeam, INITPRIO_FINDTARGET);
}
- else if(self.flags & FL_POWERUP) // do not spawn powerups initially!
- Item_ScheduleInitialRespawn(self);
+ else
+ Item_Reset();
}
/* replace items in minstagib
// replace with invis
if (itemid == IT_STRENGTH)
{
- self.strength_finished = 30;
+ if(!self.strength_finished)
+ self.strength_finished = autocvar_g_balance_powerup_strength_time;
StartItem ("models/items/g_strength.md3",
"misc/powerup.wav", g_pickup_respawntime_powerup, g_pickup_respawntimejitter_powerup,
"Invisibility", IT_STRENGTH, 0, FL_POWERUP, generic_pickupevalfunc, BOT_PICKUP_RATING_MID);
// replace with speed
if (itemid == IT_INVINCIBLE)
{
- self.invincible_finished = 30;
+ if(!self.invincible_finished)
+ self.invincible_finished = autocvar_g_balance_powerup_invincible_time;
StartItem ("models/items/g_invincible.md3",
"misc/powerup_shield.wav", g_pickup_respawntime_powerup, g_pickup_respawntimejitter_powerup,
"Speed", IT_INVINCIBLE, 0, FL_POWERUP, generic_pickupevalfunc, BOT_PICKUP_RATING_MID);
entity oldself;
float i, j;
- // set the respawntime in advance (so replaced weapons can copy it)
-
- if(!self.respawntime)
- {
- e = get_weaponinfo(wpn);
- if(e.items == IT_SUPERWEAPON)
- {
- self.respawntime = g_pickup_respawntime_powerup;
- self.respawntimejitter = g_pickup_respawntimejitter_powerup;
- }
- else
- {
- self.respawntime = g_pickup_respawntime_weapon;
- self.respawntimejitter = g_pickup_respawntimejitter_weapon;
- }
- }
-
if(self.classname != "droppedweapon" && self.classname != "replacedweapon")
{
e = get_weaponinfo(wpn);
e = get_weaponinfo(wpn);
- if(e.items && e.items != IT_SUPERWEAPON)
+ if(!self.respawntime)
+ {
+ if(e.weapons & WEPBIT_SUPERWEAPONS)
+ {
+ self.respawntime = g_pickup_respawntime_superweapon;
+ self.respawntimejitter = g_pickup_respawntimejitter_superweapon;
+ }
+ else
+ {
+ self.respawntime = g_pickup_respawntime_weapon;
+ self.respawntimejitter = g_pickup_respawntimejitter_weapon;
+ }
+ }
+
+ if(e.weapons & WEPBIT_SUPERWEAPONS)
+ if(!self.superweapons_finished)
+ self.superweapons_finished = autocvar_g_balance_superweapons_time;
+
+ if(e.items)
{
for(i = 0, j = 1; i < 24; ++i, j *= 2)
{
}
}
}
- else
- {
+
+ // no weapon-stay on superweapons
+ if(self.weapons & WEPBIT_SUPERWEAPONS)
self.flags |= FL_NO_WEAPON_STAY;
- }
// weapon stay isn't supported for teamed weapons
if(self.team)
minstagib_items(IT_STRENGTH);
} else {
precache_sound("weapons/strength_fire.wav");
- self.strength_finished = 30;
+ if(!self.strength_finished)
+ self.strength_finished = autocvar_g_balance_powerup_strength_time;
StartItem ("models/items/g_strength.md3", "misc/powerup.wav", g_pickup_respawntime_powerup, g_pickup_respawntimejitter_powerup, "Strength Powerup", IT_STRENGTH, 0, FL_POWERUP, generic_pickupevalfunc, 100000);
}
}
if(g_minstagib) {
minstagib_items(IT_INVINCIBLE);
} else {
- self.invincible_finished = 30;
+ if(!self.invincible_finished)
+ self.invincible_finished = autocvar_g_balance_powerup_invincible_time;
StartItem ("models/items/g_invincible.md3", "misc/powerup_shield.wav", g_pickup_respawntime_powerup, g_pickup_respawntimejitter_powerup, "Shield", IT_INVINCIBLE, 0, FL_POWERUP, generic_pickupevalfunc, 100000);
}
}
self.strength_finished = autocvar_g_balance_powerup_strength_time;
if(!self.invincible_finished)
self.invincible_finished = autocvar_g_balance_powerup_invincible_time;
+ if(!self.superweapons_finished)
+ self.superweapons_finished = autocvar_g_balance_superweapons_time;
precache_sound("misc/itempickup.wav");
precache_sound("misc/megahealth.wav");
else if(argv(i) == "unlimited_superweapons") self.items |= IT_UNLIMITED_SUPERWEAPONS;
else if(argv(i) == "strength") self.items |= IT_STRENGTH;
else if(argv(i) == "invincible") self.items |= IT_INVINCIBLE;
+ else if(argv(i) == "superweapons") self.items |= IT_SUPERWEAPON;
else if(argv(i) == "jetpack") self.items |= IT_JETPACK;
else if(argv(i) == "fuel_regen") self.items |= IT_FUEL_REGEN;
else
self.netname = sprintf("%s %s%d %s", self.netname, itemprefix, !!(self.items & IT_UNLIMITED_SUPERWEAPONS), "unlimited_superweapons");
self.netname = sprintf("%s %s%d %s", self.netname, valueprefix, self.strength_finished * !!(self.items & IT_STRENGTH), "strength");
self.netname = sprintf("%s %s%d %s", self.netname, valueprefix, self.invincible_finished * !!(self.items & IT_INVINCIBLE), "invincible");
+ self.netname = sprintf("%s %s%d %s", self.netname, valueprefix, self.superweapons_finished * !!(self.items & IT_SUPERWEAPON), "superweapons");
self.netname = sprintf("%s %s%d %s", self.netname, itemprefix, !!(self.items & IT_JETPACK), "jetpack");
self.netname = sprintf("%s %s%d %s", self.netname, itemprefix, !!(self.items & IT_FUEL_REGEN), "fuel_regen");
if(self.ammo_shells != 0) self.netname = sprintf("%s %s%d %s", self.netname, valueprefix, max(0, self.ammo_shells), "shells");
e.strength_finished = max(0, e.strength_finished - time);
e.invincible_finished = max(0, e.invincible_finished - time);
+ e.superweapons_finished = max(0, e.superweapons_finished - time);
PREGIVE(e, items);
PREGIVE(e, weapons);
PREGIVE(e, strength_finished);
PREGIVE(e, invincible_finished);
+ PREGIVE(e, superweapons_finished);
PREGIVE(e, ammo_nails);
PREGIVE(e, ammo_cells);
PREGIVE(e, ammo_shells);
continue;
case "ALL":
got += GiveBit(e, items, IT_FUEL_REGEN, op, val);
- got += GiveValue(e, strength_finished, op, time);
- got += GiveValue(e, invincible_finished, op, time);
+ got += GiveValue(e, strength_finished, op, val);
+ got += GiveValue(e, invincible_finished, op, val);
+ got += GiveValue(e, superweapons_finished, op, val);
got += GiveBit(e, items, IT_UNLIMITED_AMMO, op, val);
case "all":
got += GiveBit(e, items, IT_JETPACK, op, val);
case "invincible":
got += GiveValue(e, invincible_finished, op, val);
break;
+ case "superweapons":
+ got += GiveValue(e, superweapons_finished, op, val);
+ break;
case "cells":
got += GiveValue(e, ammo_cells, op, val);
break;
POSTGIVE_VALUE_ROT(e, armorvalue, 1, pauserotarmor_finished, autocvar_g_balance_pause_armor_rot, pauseregen_finished, autocvar_g_balance_pause_health_regen, "misc/armor25.wav", string_null);
POSTGIVE_VALUE_ROT(e, health, 1, pauserothealth_finished, autocvar_g_balance_pause_health_rot, pauseregen_finished, autocvar_g_balance_pause_health_regen, "misc/megahealth.wav", string_null);
+ if(e.superweapons_finished <= 0)
+ if(self.weapons & WEPBIT_SUPERWEAPONS)
+ e.superweapons_finished = autocvar_g_balance_superweapons_time;
+
if (g_minstagib)
{
e.health = bound(0, e.health, 100);
e.invincible_finished = 0;
else
e.invincible_finished += time;
+ if(e.superweapons_finished <= 0)
+ e.superweapons_finished = 0;
+ else
+ e.superweapons_finished += time;
if not(e.weapons & W_WeaponBit(e.switchweapon))
_switchweapon = TRUE;
tmax_y = tmin_y + 1;
}
- setsize (trigger, tmin, tmax);
+ if(tmin_x < tmax_x)
+ if(tmin_y < tmax_y)
+ if(tmin_z < tmax_z)
+ {
+ setsize (trigger, tmin, tmax);
+ return;
+ }
+
+ // otherwise, something is fishy...
+ remove(trigger);
+ objerror("plat_spawn_inside_trigger: platform has odd size or lip, can't spawn");
}
void plat_hit_top()
self.pos2 = self.origin;
self.pos2_z = self.origin_z - self.height;
- plat_spawn_inside_trigger (); // the "start moving" trigger
-
self.reset = plat_reset;
plat_reset();
+
+ plat_spawn_inside_trigger (); // the "start moving" trigger
}
}
else
{
+ self.owner.velocity = '0 0 0';
spot = self.origin - v_forward * 200 + '0 0 64';
spot = vehicles_findgoodexit(spot);
setorigin(self.owner , spot);
}
-
+ antilag_clear(self.owner);
self.owner = world;
}
void racer_impact()
}
else
{
+ self.owner.velocity = '0 0 0';
spot = self.origin - v_forward * 200 + '0 0 64';
spot = vehicles_findgoodexit(spot);
setorigin(self.owner , spot);
}
-
+ antilag_clear(self.owner);
self.owner = world;
}
}
else
{
+ self.owner.velocity = '0 0 0';
spot = self.origin - v_forward * 200 + '0 0 64';
spot = vehicles_findgoodexit(spot);
setorigin(self.owner , spot);
}
-
+ antilag_clear(self.owner);
self.owner = world;
}
void spider_impact()
}
self.vehicle_enter();
+ antilag_clear(other);
}
/** vehicles_findgoodexit
#ifdef REGISTER_WEAPON
-REGISTER_WEAPON(FIREBALL, w_fireball, IT_FUEL, 9, WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH, BOT_PICKUP_RATING_MID, "fireball", "fireball", _("Fireball"));
+REGISTER_WEAPON(FIREBALL, w_fireball, IT_FUEL, 9, WEP_FLAG_RELOADABLE | WEP_FLAG_SUPERWEAPON | WEP_TYPE_SPLASH, BOT_PICKUP_RATING_MID, "fireball", "fireball", _("Fireball"));
#else
#ifdef SVQC
.float bot_primary_fireballmooth; // whatever a mooth is
#ifdef REGISTER_WEAPON
-REGISTER_WEAPON(MINSTANEX, w_minstanex, IT_CELLS, 7, WEP_FLAG_HIDDEN | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_HITSCAN, BOT_PICKUP_RATING_HIGH, "minstanex", "minstanex", _("MinstaNex"))
+REGISTER_WEAPON(MINSTANEX, w_minstanex, IT_CELLS, 7, WEP_FLAG_HIDDEN | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_FLAG_SUPERWEAPON | WEP_TYPE_HITSCAN, BOT_PICKUP_RATING_HIGH, "minstanex", "minstanex", _("MinstaNex"))
#else
#ifdef SVQC
.float minstanex_lasthit;