]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into mirceakitsune/damage_effects
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 14 Jan 2012 10:22:29 +0000 (12:22 +0200)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 14 Jan 2012 10:22:29 +0000 (12:22 +0200)
48 files changed:
_hud_descriptions.cfg
balance25.cfg
balanceFruitieX.cfg
balanceXPM.cfg
balanceXonotic.cfg
defaultXonotic.cfg
gfx/hud/default/superweapons.tga [new file with mode: 0644]
hud_luminos.cfg
hud_luminos_minimal.cfg
hud_luminos_minimal_xhair.cfg
hud_luminos_old.cfg
hud_nexuiz.cfg
particles/particlefont-template.png
particles/particlefont-template.txt [deleted file]
particles/particlefont.pl
qcsrc/client/Defs.qc
qcsrc/client/autocvars.qh
qcsrc/client/csqcmodel_hooks.qc
qcsrc/client/hud.qc
qcsrc/client/miscfunctions.qc
qcsrc/client/shownames.qc
qcsrc/client/shownames.qh
qcsrc/common/constants.qh
qcsrc/common/csqcmodel_settings.qh
qcsrc/common/items.qh
qcsrc/common/util.qc
qcsrc/common/util.qh
qcsrc/server/autocvars.qh
qcsrc/server/bot/bot.qc
qcsrc/server/bot/navigation.qc
qcsrc/server/bot/waypoints.qc
qcsrc/server/bot/waypoints.qh
qcsrc/server/cl_client.qc
qcsrc/server/cl_player.qc
qcsrc/server/cl_weapons.qc
qcsrc/server/cl_weaponsystem.qc
qcsrc/server/defs.qh
qcsrc/server/g_world.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/mutators/mutator_nix.qc
qcsrc/server/t_items.qc
qcsrc/server/t_plats.qc
qcsrc/server/vehicles/racer.qc
qcsrc/server/vehicles/raptor.qc
qcsrc/server/vehicles/spiderbot.qc
qcsrc/server/vehicles/vehicles.qc
qcsrc/server/w_fireball.qc
qcsrc/server/w_minstanex.qc

index 109d410e8046cc1ee52e1965120d4618124cece1..c8ab15f987894c7bd8a9c8963a0274dc5601cf68 100644 (file)
@@ -16,6 +16,7 @@ seta hud_dock_alpha "" "alpha of the dock"
 
 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"
@@ -88,6 +89,7 @@ seta hud_panel_powerups_bg_padding "" "if set to something else than \"\" = over
 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"
index 2374897b7a96321293da169f00756d951fca8eae..f65ee473fef5c9dc6beb3b5492d1c261fd8536aa 100644 (file)
@@ -100,12 +100,14 @@ set g_pickup_respawntime_medium 20
 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
 // }}}
 
@@ -203,6 +205,7 @@ set g_balance_powerup_strength_force 4
 set g_balance_powerup_strength_time 30
 set g_balance_powerup_strength_selfdamage 1.5
 set g_balance_powerup_strength_selfforce 1.5
+set g_balance_superweapons_time 30
 // }}}
 
 // {{{ jetpack/hook
index 8a0bbc0435cc48c47270461571394c87ebac77f4..9777b904d78438b66489804962e25366be936354 100644 (file)
@@ -100,12 +100,14 @@ set g_pickup_respawntime_medium 20
 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
 // }}}
 
@@ -203,6 +205,7 @@ set g_balance_powerup_strength_force 4
 set g_balance_powerup_strength_time 30
 set g_balance_powerup_strength_selfdamage 1.5
 set g_balance_powerup_strength_selfforce 1.5
+set g_balance_superweapons_time 30
 // }}}
 
 // {{{ jetpack/hook
index a866d75245fb85bd2a4a43a49b9c50fdcc5a1bf5..a15f060d0f269e15068c836360fb39b888181480 100644 (file)
@@ -100,12 +100,14 @@ set g_pickup_respawntime_medium 20
 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
 // }}}
 
@@ -203,6 +205,7 @@ set g_balance_powerup_strength_force 3
 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
index b4e368a28ed36ec8b45ab8ff88e6386243515d72..d42284a3066230bdd0658a16e6cdc48eeb45e3a2 100644 (file)
@@ -100,12 +100,14 @@ set g_pickup_respawntime_medium 20
 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
 // }}}
 
@@ -203,6 +205,7 @@ set g_balance_powerup_strength_force 3
 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
index 0ac407ea3de34658820573b38e0c6ebaaf1ea27f..120ed42cf1d808530e444f7f4f2cc82bd95abba0 100644 (file)
@@ -332,6 +332,7 @@ set cl_damageeffect_lifetime_max 6 "maximum lifetime a damage effect may have"
 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"
 
@@ -445,6 +446,7 @@ set bot_ai_aimskill_order_filter_5th 0.5 "Movement prediction filter. Used rarel
 
 // 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"
diff --git a/gfx/hud/default/superweapons.tga b/gfx/hud/default/superweapons.tga
new file mode 100644 (file)
index 0000000..740019e
Binary files /dev/null and b/gfx/hud/default/superweapons.tga differ
index f32279f2b9b1d36c06a97512dbd3048037d093a9..25e7dea1fd2de150e8ecfcfe8b4b0c55bdc90d7f 100644 (file)
@@ -14,6 +14,7 @@ seta hud_dock_alpha "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"
@@ -86,6 +87,7 @@ seta hud_panel_powerups_baralign "3"
 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
index 52a7d96c1327844d54a461e89f6305f0c4c95b7f..05a11b4e92981b095ed9441cd1ba20c488ecab19 100644 (file)
@@ -14,6 +14,7 @@ seta hud_dock_alpha "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"
@@ -86,6 +87,7 @@ seta hud_panel_powerups_baralign "1"
 seta hud_panel_powerups_progressbar "1"
 seta hud_panel_powerups_progressbar_strength "progressbar"
 seta hud_panel_powerups_progressbar_shield "progressbar"
+seta hud_panel_powerups_progressbar_superweapons "progressbar"
 seta hud_panel_powerups_text "1"
 
 seta hud_panel_healtharmor 1
index 2d5e07600c09265f849b888e6584ab75c87994c1..3774b9cbd68fec029181173523481ed2b1d00b2b 100644 (file)
@@ -14,6 +14,7 @@ seta hud_dock_alpha "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"
@@ -86,6 +87,7 @@ seta hud_panel_powerups_baralign "1"
 seta hud_panel_powerups_progressbar "1"
 seta hud_panel_powerups_progressbar_strength "progressbar"
 seta hud_panel_powerups_progressbar_shield "progressbar"
+seta hud_panel_powerups_progressbar_superweapons "progressbar"
 seta hud_panel_powerups_text "1"
 
 seta hud_panel_healtharmor 1
index fe7f66085519cc3ed94cf1e08cd44390e3b2ccd3..c5e2c928fab635126db5ffa90c8fc82f34981f90 100644 (file)
@@ -14,6 +14,7 @@ seta hud_dock_alpha "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"
@@ -86,6 +87,7 @@ seta hud_panel_powerups_baralign "3"
 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
index 5c2138370660bdf3e40d204af441cbe42cb81b9f..10d77e7129684ad492d4405ae1f44ee4cc596ec0 100644 (file)
@@ -14,6 +14,7 @@ seta hud_dock_alpha "0.700000"
 
 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"
@@ -86,6 +87,7 @@ seta hud_panel_powerups_baralign "0"
 seta hud_panel_powerups_progressbar "0"
 seta hud_panel_powerups_progressbar_strength "progressbar"
 seta hud_panel_powerups_progressbar_shield "progressbar"
+seta hud_panel_powerups_progressbar_superweapons "progressbar"
 seta hud_panel_powerups_text "1"
 
 seta hud_panel_healtharmor 1
index a6fd71e6e09ccd02073af8f68b2a64f65e85fd01..2228fef05d27e357b58da7785ce3e8fcc25c6820 100644 (file)
Binary files a/particles/particlefont-template.png and b/particles/particlefont-template.png differ
diff --git a/particles/particlefont-template.txt b/particles/particlefont-template.txt
deleted file mode 100644 (file)
index 6d6b740..0000000
+++ /dev/null
@@ -1,166 +0,0 @@
-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
index fd5b6df696acd923654f5054838518d23e82d5b3..2579d3b9f07250f6214bc84e6685f8587568feaf 100644 (file)
@@ -58,7 +58,8 @@ for my $row(0..$rows-1)
                        checkmagick $magick->Annotate(
                                x => $s0 * $pixw + 2,
                                y => $t1 * $pixh - 2,
-                               text => $i
+                               text => $i,
+                               font => '/usr/share/fonts/TTF/DejaVuSansMono.ttf'
                        );
                }
                ++$i;
@@ -84,7 +85,8 @@ for my $beam(0..$beams-1)
                checkmagick $magick->Annotate(
                        x => $s0 * $pixw + 2,
                        y => $t1 * $pixh - 2,
-                       text => $i
+                       text => $i,
+                       font => '/usr/share/fonts/TTF/DejaVuSansMono.ttf'
                );
        }
        ++$i;
index 5282910a2ad6288f756e48f599f539bc9e153ac8..e4519b2b3d93fef8061208aaf78ec95c1d2b1773 100644 (file)
@@ -271,3 +271,5 @@ float nex_charge_movingavg;
 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
index fae6dd8db5ff90cb59f6f83ee86caeef3c92c559..eb7c6d2fb43953d35a2dfce459a3441b6b86825c 100644 (file)
@@ -270,6 +270,7 @@ float autocvar_hud_panel_powerups_iconalign;
 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;
@@ -391,3 +392,4 @@ float autocvar_cl_forcemyplayercolors;
 float autocvar__cl_playerskin;
 string autocvar__cl_playermodel;
 float autocvar_cl_precacheplayermodels;
+float autocvar_cl_deathglow;
index 5e4d27ac5ec9d1c7888161441333047b95132f1f..a0a6e150e373dee3a051e175a75e8842cd4a4618 100644 (file)
@@ -207,9 +207,6 @@ void CSQCPlayer_ForceModel_Apply(float islocalplayer)
 .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)
 {
@@ -232,7 +229,7 @@ void CSQCPlayer_FallbackFrame_PostUpdate(float isnew)
 #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)
@@ -240,8 +237,6 @@ void CSQCPlayer_FallbackFrame_PostUpdate(float isnew)
                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)
 {
@@ -269,16 +264,6 @@ void CSQCPlayer_FallbackFrame_Apply(void)
        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;
@@ -389,7 +374,7 @@ void CSQCModel_Effects_PostUpdate(void)
 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;
@@ -402,7 +387,7 @@ void CSQCModel_Effects_Apply(void)
                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;
@@ -453,6 +438,35 @@ void CSQCModel_Effects_Apply(void)
                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
index 8db3f00eb3c38969bf94a53777b75b7df22936dc..1d0ad220022b8f1cf33cbb6282d01863cd303c59 100644 (file)
@@ -988,7 +988,7 @@ void HUD_Ammo(void)
        }
 }
 
-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;
@@ -1061,32 +1061,39 @@ void DrawNumIcon(vector myPos, vector mySize, float x, string icon, float vertic
                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
        {
@@ -1094,6 +1101,7 @@ void HUD_Powerups(void)
 
                strength_time = 15;
                shield_time = 27;
+               superweapons_time = 13;
        }
 
        HUD_Panel_UpdateCvars(powerups);
@@ -1102,7 +1110,7 @@ void HUD_Powerups(void)
        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;
@@ -1111,26 +1119,73 @@ void HUD_Powerups(void)
 
        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);
@@ -1146,6 +1201,24 @@ void HUD_Powerups(void)
                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;
@@ -1160,7 +1233,7 @@ void HUD_Powerups(void)
                        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));
                }
        }
 
@@ -1178,7 +1251,25 @@ void HUD_Powerups(void)
                        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));
                }
        }
 }
index 2bc20e9510f17f1c4513521e9cd9a217dca9933d..f4eaf927fe2b56943cc8e0ec2c287080a8325d43 100644 (file)
@@ -591,3 +591,14 @@ vector getplayerorigin(float pl)
 
        return GETPLAYERORIGIN_ERROR;
 }
+
+float getplayerisdead(float pl)
+{
+       entity e;
+       
+       e = CSQCModel_server2csqc(pl + 1);
+       if(e)
+               return e.csqcmodel_isdead;
+       
+       return FALSE;
+}
index d5e24888d34a79e03d2de8db4a8c19ca22c8219f..c2bff62c89172c3a0a203a801694182235b1da0a 100644 (file)
@@ -5,7 +5,8 @@
 // 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)
@@ -90,7 +91,7 @@ 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); 
@@ -217,6 +218,8 @@ void Draw_ShowNames_All()
                e.origin = getplayerorigin(i);
                if(e.origin == GETPLAYERORIGIN_ERROR)
                        continue;
+                       
+               e.csqcmodel_isdead = getplayerisdead(i);
 
                Draw_ShowNames(e);
        }
index adbfa57120376e5091f3c957d05557b9873de870..6e3f899ddc31cb0754465bacec20e7fac61c0eda 100644 (file)
@@ -2,4 +2,4 @@
 .float armorvalue;
 .float sameteam;
 .float fadedelay;
-.float pointtime;
+.float pointtime;
\ No newline at end of file
index 7532b3f50b0a85a25dab66ae98a40ccc79dff39c..afd2677a66230adbdb9cb41aa297501a20d7c7c2 100644 (file)
@@ -161,6 +161,7 @@ const float STAT_TYPEHIT_TIME = 55;
 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;
index 34d0634c4d751f7d6022c0dac5ed52bd79ab51ba..bdeab298ebe9172fb6239359afef528a3342ef24 100644 (file)
        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
 
@@ -82,4 +81,4 @@ float autocvar_sv_use_csqc_players;
 # endif
 #endif
 
-#define CSQCMODEL_EF_INVISIBLE EF_SELECTABLE
+#define CSQCMODEL_EF_RESPAWNGHOST EF_SELECTABLE
index c98ff786b9cb9c12ceaa380907930d2f0334d7bd..07a7625345dcddeb80745a044bebbaf9b57536a1 100644 (file)
@@ -2,53 +2,53 @@ float BOT_PICKUP_RATING_LOW   = 2500;
 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
 
@@ -94,6 +94,7 @@ float WEP_FIRST = 1;
 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; \
@@ -102,6 +103,7 @@ float WEPBIT_ALL;
        { \
                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); \
        } \
index 8f190f163cecb958f035910209175828383ae80a..57e653113235c27ac3babe72102a286a1c249366 100644 (file)
@@ -2174,3 +2174,41 @@ void m_shutdown()
        }
        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
index 436299c51686c1d845d07cdad93e0b4dbc652eed..5fd35b805139c391ae0126dc337528b5ef1c1fa5 100644 (file)
@@ -295,3 +295,9 @@ void Shutdown();
 // 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
index 6f5ea2b297c332b430d38805966e6dd714ec241f..1111909b3ea194fcbb6df6ddc698912dcaebff24 100644 (file)
@@ -568,6 +568,7 @@ float autocvar_g_balance_powerup_strength_force;
 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;
@@ -1024,6 +1025,7 @@ float autocvar_g_turrets_unit_walker_turn_strafe;
 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;
index 1658d7fac4f3c6de0c1313c7780258492b273914..039e21daed025bf588322272997456ed3f2fb240 100644 (file)
@@ -633,7 +633,7 @@ void bot_serverframe()
                        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)
@@ -685,6 +685,9 @@ void bot_serverframe()
        if (autocvar_g_waypointeditor)
                botframe_showwaypointlinks();
 
+       if (autocvar_g_waypointeditor_auto)
+               botframe_autowaypoints();
+
        if(time > bot_cvar_nextthink)
        {
                if(currentbots>0)
index 6aa6ea2a17f8a32b4f22df6d5c702df0ee591bd6..3387fdfef8fdcc1b4e5711cb9d3c165c979782b2 100644 (file)
@@ -332,12 +332,37 @@ void navigation_poproute()
        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");
@@ -362,7 +387,6 @@ entity navigation_findnearestwaypoint(entity ent, float walkfromwp)
                te_plasmaburn(org);
 
        best = world;
-       bestdist = 1050;
 
        // box check failed, try walk
        w = waylist;
@@ -382,36 +406,20 @@ entity navigation_findnearestwaypoint(entity ent, float walkfromwp)
                        }
                        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)
index e2bcc5bd628e341000f7273cd9d7dee80da44167..4db72e407da5676ad73a15eab5a3c170a1aafd67 100644 (file)
@@ -877,3 +877,205 @@ void botframe_showwaypointlinks()
                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);
+       }
+}
+
index 1bb800fd054ac5382b1a92491c2c6bf86ee0bc4e..fb7beea0fcaf74cfa73e4aa9deeded549cad3270 100644 (file)
@@ -57,3 +57,5 @@ entity waypoint_spawn(vector m1, vector m2, float f);
 entity waypoint_spawnpersonal(vector position);
 
 vector waypoint_fixorigin(vector position);
+
+void botframe_autowaypoints();
index 1db0e928a471e82e916ec4daf88b1115fbc797bd..ebf4abc4b4d85bc7181fd408221f03c75df988a4 100644 (file)
@@ -466,6 +466,7 @@ void PutObserverInServer (void)
        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;
@@ -473,6 +474,7 @@ void PutObserverInServer (void)
        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;
@@ -749,6 +751,11 @@ void PutClientInServer (void)
                        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)
@@ -774,6 +781,7 @@ void PutClientInServer (void)
                }
                self.damageforcescale = 2;
                self.death_time = 0;
+               self.respawn_time = 0;
                self.scale = 0;
                self.fade_time = 0;
                self.pain_frame = 0;
@@ -1759,23 +1767,15 @@ void respawn(void)
                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();
 }
 
@@ -1893,6 +1893,40 @@ void player_powerups (void)
                                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)
@@ -2256,13 +2290,13 @@ void ShowRespawnCountdown()
                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), ""));
                }
        }
@@ -2638,9 +2672,9 @@ void PlayerPreThink (void)
                        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;
                                }
@@ -2670,9 +2704,9 @@ void PlayerPreThink (void)
                                }
                                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();
                                        }
                                }
index 459835918d856e32e7e766fb6d12af25e4a4030f..49b52555f6ebb0734b8ee371a3b33f08b5cf8466 100644 (file)
@@ -124,8 +124,6 @@ void WeaponStats_LogKill(float awep, float abot, float vwep, float vbot)
 .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)
@@ -151,7 +149,7 @@ void CopyBody(float keepvelocity)
        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;
@@ -168,6 +166,8 @@ void CopyBody(float keepvelocity)
        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;
@@ -763,13 +763,14 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
                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
@@ -981,8 +982,9 @@ float Say(entity source, float teamsay, entity privatesay, string msgin, float f
        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)
@@ -1014,22 +1016,23 @@ float Say(entity source, float teamsay, entity privatesay, string msgin, float f
 
        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)
@@ -1040,22 +1043,24 @@ float Say(entity source, float teamsay, entity privatesay, string msgin, float f
                                                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;
index b1f6aabba106d9728c27f967dab608f6a365a0ad..8c0cb96e0eb4f0627867800f7691eb979aa53af2 100644 (file)
@@ -170,7 +170,7 @@ float W_WeaponBit(float wpn)
 
 float W_AmmoItemCode(float wpn)
 {
-       return (get_weaponinfo(wpn)).items;
+       return (get_weaponinfo(wpn)).items & IT_AMMO;
 }
 
 void thrown_wep_think()
@@ -198,7 +198,7 @@ string W_ThrowNewWeapon(entity own, float wpn, float doreduce, vector org, vecto
        wep.colormap = own.colormap;
 
        wa = W_AmmoItemCode(wpn);
-       if(wa == IT_SUPERWEAPON || wa == 0)
+       if(wa == 0)
        {
                oldself = self;
                self = wep;
@@ -288,14 +288,14 @@ float W_IsWeaponThrowable(float w)
        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;
        }
index 3b69e13eb0942f30b1e394a3a7b0813ae6e3cce7..1208766e21a99fca98117786b7391e0cb312d6f4 100644 (file)
@@ -853,7 +853,7 @@ void weapon_setup(float windex)
        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;
index 7aa2fa1664d0ef60ddf4f9dc08afd11e9efafbcd..22d9e54d6c71d4c8ea4a007a157354eb23b7e6d4 100644 (file)
@@ -27,12 +27,14 @@ float g_ctf_reverse;
 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;
@@ -89,9 +91,8 @@ float maxclients;
 .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;
@@ -104,6 +105,7 @@ float maxclients;
 //.float cnt2;
 
 .float play_time;
+.float respawn_time;
 .float death_time;
 .float fade_time;
 .float fade_rate;
index 93cea80ffd078aaac431bb5a5dbf4b4bcd699178..f699ababc19af8f4e8bd324574a7b386b6b2c769 100644 (file)
@@ -772,6 +772,7 @@ void spawnfunc_worldspawn (void)
 
        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);
index 4babf32b22eb8c9e8cb8db51b5c7b066b488becf..4b19730adcd3d15f9708bebbe7846a608598ea77 100644 (file)
@@ -908,6 +908,7 @@ void readplayerstartcvars()
                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;
@@ -1135,12 +1136,14 @@ void readlevelcvars(void)
                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");
@@ -1606,7 +1609,7 @@ void precache()
 
 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({
index 519d51daa2510edd8f23ecef335e454127bd4f9c..28bb8446902b29249d375d94e953886da444961c 100644 (file)
@@ -228,6 +228,7 @@ MUTATOR_HOOKFUNCTION(nix_PlayerSpawn)
 {
        self.nix_lastchange_id = -1;
        NIX_GiveCurrentWeapon(); // overrides the weapons you got when spawning
+       self.items |= IT_UNLIMITED_SUPERWEAPONS;
        return 0;
 }
 
index 79c39ae95d7998899e99529451df30ff22b05fed..11688ae36a67cbdca3117edb78df76df93f94786 100644 (file)
@@ -131,7 +131,7 @@ void Item_Show (entity e, float mode)
 
                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;
@@ -233,6 +233,15 @@ void Item_RespawnCountdown (void)
                                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");
@@ -256,7 +265,7 @@ void Item_RespawnCountdown (void)
 
 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);
@@ -452,12 +461,17 @@ float Item_GiveTo(entity item, entity player)
                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;
                }
        }
 
@@ -528,6 +542,17 @@ void Item_Touch (void)
        }
 }
 
+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;
@@ -554,22 +579,10 @@ void Item_FindTeam()
                        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)
@@ -736,6 +749,11 @@ void StartItem (string itemmodel, string pickupsound, float defaultrespawntime,
                        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)
@@ -810,6 +828,10 @@ void StartItem (string itemmodel, string pickupsound, float defaultrespawntime,
        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
        {
@@ -843,8 +865,8 @@ void StartItem (string itemmodel, string pickupsound, float defaultrespawntime,
                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
@@ -879,7 +901,8 @@ void minstagib_items (float itemid)
        // 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);
@@ -895,7 +918,8 @@ void minstagib_items (float itemid)
        // 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);
@@ -920,23 +944,6 @@ void weapon_defaultspawnfunc(float wpn)
        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);
@@ -1002,7 +1009,25 @@ void weapon_defaultspawnfunc(float 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)
                {
@@ -1014,10 +1039,10 @@ void weapon_defaultspawnfunc(float wpn)
                        }
                }
        }
-       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)
@@ -1234,7 +1259,8 @@ void spawnfunc_item_strength (void) {
                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);
        }
 }
@@ -1243,7 +1269,8 @@ void spawnfunc_item_invincible (void) {
        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);
        }
 }
@@ -1296,6 +1323,8 @@ void spawnfunc_target_items (void)
                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");
@@ -1318,6 +1347,7 @@ void spawnfunc_target_items (void)
                        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
@@ -1365,6 +1395,7 @@ void spawnfunc_target_items (void)
                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");
@@ -1543,11 +1574,13 @@ float GiveItems(entity e, float beginarg, float endarg)
 
        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);
@@ -1585,8 +1618,9 @@ float GiveItems(entity e, float beginarg, float endarg)
                                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);
@@ -1627,6 +1661,9 @@ float GiveItems(entity e, float beginarg, float endarg)
                        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;
@@ -1692,6 +1729,10 @@ float GiveItems(entity e, float beginarg, float endarg)
        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);
@@ -1706,6 +1747,10 @@ float GiveItems(entity e, float beginarg, float endarg)
                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;
index a556d6d0bb192dd72d9417d2535a7eafa3e82aac..6ca7aee30428ba864403a079e62c7154707e0041 100644 (file)
@@ -57,7 +57,17 @@ void plat_spawn_inside_trigger()
                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()
@@ -235,10 +245,10 @@ void spawnfunc_func_plat()
        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
 }
 
 
index fa188bbb1da4e19dabdc535e37335b5a229949d9..7f5e80e4b29ae339be8003fed9e7fe29a61a053c 100644 (file)
@@ -524,11 +524,12 @@ void racer_exit(float eject)
        }
        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()
index 7aa68061aae1f1594e16b12395fdcdad7af49210..57221afe2a169ce453d118d8a2010cdf57c0555e 100644 (file)
@@ -247,11 +247,12 @@ void raptor_exit(float eject)
        }
        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;
 }
 
index f1cb5755192f4fdfef5c5bbbc7346c6615614038..3d809e2425714cf3ce3b5fc74290223681d46aae 100644 (file)
@@ -453,11 +453,12 @@ void spiderbot_exit(float eject)
        }
        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()
index 8063c2791fd66eb0943453afe9cf92a76e890f0d..20c74d3a17e24deb0012882c634c9d527d4747d0 100644 (file)
@@ -533,6 +533,7 @@ void vehicles_enter()
     }
     
     self.vehicle_enter();
+    antilag_clear(other);
 }
 
 /** vehicles_findgoodexit
index 3cc484da9c9beaaec33fb179cd9be34de25d6807..02463c2c007444ec0b3305b55fd1c7b6cf1b222e 100644 (file)
@@ -1,5 +1,5 @@
 #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
index 7168c65724ea92582cbd6a6bd489b15245f53a39..b66386d50a59229309d6f1409648b895b3e93e68 100644 (file)
@@ -1,5 +1,5 @@
 #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;