]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge remote branch 'origin/master'
authorRudolf Polzer <divVerent@xonotic.org>
Wed, 6 Oct 2010 08:29:41 +0000 (10:29 +0200)
committerRudolf Polzer <divVerent@xonotic.org>
Wed, 6 Oct 2010 08:29:41 +0000 (10:29 +0200)
47 files changed:
balance25.cfg
balanceLeeStricklin.cfg
balanceNexSVN.cfg
balanceSamual.cfg
balanceXonotic.cfg
defaultXonotic.cfg
gfx/nex_ring.tga [new file with mode: 0644]
gfx/nightvision-bg.tga [new file with mode: 0644]
gfx/nightvision-fg.tga [new file with mode: 0644]
models/items/armor.tga [new file with mode: 0644]
models/items/armor_gloss.tga [new file with mode: 0644]
models/items/armor_glow.tga [new file with mode: 0644]
models/items/armor_norm.tga [new file with mode: 0644]
models/items/g_a1.md3 [deleted file]
models/items/g_a25.md3 [deleted file]
models/items/g_a50.md3 [deleted file]
models/items/g_armormedium.md3 [deleted file]
models/items/item_armor_big.md3 [new file with mode: 0644]
models/items/item_armor_large.md3 [new file with mode: 0644]
models/items/item_armor_medium.md3 [new file with mode: 0644]
models/items/item_armor_small.md3 [new file with mode: 0644]
qcsrc/client/Defs.qc
qcsrc/client/Main.qc
qcsrc/client/View.qc
qcsrc/client/miscfunctions.qc
qcsrc/client/wall.qc
qcsrc/common/constants.qh
qcsrc/server/bot/waypoints.qc
qcsrc/server/cl_client.qc
qcsrc/server/ctf.qc
qcsrc/server/defs.qh
qcsrc/server/g_models.qc
qcsrc/server/g_triggers.qc
qcsrc/server/g_violence.qc
qcsrc/server/ipban.qc
qcsrc/server/mutators/gamemode_keyhunt.qc
qcsrc/server/t_items.qc
qcsrc/server/t_jumppads.qc
qcsrc/server/t_plats.qc
qcsrc/server/t_teleporters.qc
qcsrc/server/teamplay.qc
qcsrc/server/w_grenadelauncher.qc
qcsrc/server/w_nex.qc
qcsrc/warpzonelib/client.qc
qcsrc/warpzonelib/common.qc
qcsrc/warpzonelib/common.qh
qcsrc/warpzonelib/server.qc

index ec040c4cd321602e729398fde0deb57b903adb8a..6287460ca329849a946f1ac2e5839451f2fabb1d 100644 (file)
@@ -268,8 +268,7 @@ set g_balance_uzi_speed 18000
 set g_balance_uzi_bulletconstant 115 // 13.1qu
 // }}}
 // {{{ mortar
-set g_balance_grenadelauncher_primary2secondary 0
-set g_balance_grenadelauncher_primary_sticky 0
+set g_balance_grenadelauncher_primary_type 0
 set g_balance_grenadelauncher_primary_damage 70
 set g_balance_grenadelauncher_primary_edgedamage 38
 set g_balance_grenadelauncher_primary_force 400
@@ -284,7 +283,12 @@ set g_balance_grenadelauncher_primary_refire 0.8
 set g_balance_grenadelauncher_primary_animtime 0.3
 set g_balance_grenadelauncher_primary_ammo 2
 set g_balance_grenadelauncher_primary_health 25
-set g_balance_grenadelauncher_secondary_sticky 0
+set g_balance_grenadelauncher_primary_damageforcescale 4
+set g_balance_grenadelauncher_primary_bouncefactor 0.5
+set g_balance_grenadelauncher_primary_bouncestop 0.075
+set g_balance_grenadelauncher_primary_remote_minbouncecnt 0
+
+set g_balance_grenadelauncher_secondary_type 1
 set g_balance_grenadelauncher_secondary_damage 70
 set g_balance_grenadelauncher_secondary_edgedamage 38
 set g_balance_grenadelauncher_secondary_force 400
@@ -302,6 +306,7 @@ set g_balance_grenadelauncher_secondary_health 10
 set g_balance_grenadelauncher_secondary_damageforcescale 4
 set g_balance_grenadelauncher_secondary_bouncefactor 0.5
 set g_balance_grenadelauncher_secondary_bouncestop 0.075
+set g_balance_grenadelauncher_secondary_remote_detonateprimary 0
 // }}}
 // {{{ electro
 set g_balance_electro_lightning 0
@@ -405,6 +410,10 @@ set g_balance_nex_secondary_damagefalloff_mindist 0
 set g_balance_nex_secondary_damagefalloff_maxdist 0
 set g_balance_nex_secondary_damagefalloff_halflife 0
 set g_balance_nex_secondary_damagefalloff_forcehalflife 0
+
+set g_balance_nex_velocitydependent_halflife 0
+set g_balance_nex_velocitydependent_minspeed 400
+set g_balance_nex_velocitydependent_maxspeed 1000
 // }}}
 // {{{ minstanex
 set g_balance_minstanex_refire 1
index 2ccca9fccc09f994f41df2669ccc6e44bcbfb898..8a0ae6c46224929acbb9574496eb204d40f22db6 100644 (file)
@@ -279,8 +279,7 @@ set g_balance_uzi_speed 18000
 set g_balance_uzi_bulletconstant 300 // 13.1qu
 // }}}
 // {{{ mortar
-set g_balance_grenadelauncher_primary2secondary 0
-set g_balance_grenadelauncher_primary_sticky 0
+set g_balance_grenadelauncher_primary_type 0
 set g_balance_grenadelauncher_primary_damage 65
 set g_balance_grenadelauncher_primary_edgedamage 35
 set g_balance_grenadelauncher_primary_force 310
@@ -295,7 +294,12 @@ set g_balance_grenadelauncher_primary_refire 0.7
 set g_balance_grenadelauncher_primary_animtime 0.3
 set g_balance_grenadelauncher_primary_ammo 2
 set g_balance_grenadelauncher_primary_health 72
-set g_balance_grenadelauncher_secondary_sticky 0
+set g_balance_grenadelauncher_primary_damageforcescale 0
+set g_balance_grenadelauncher_primary_bouncefactor 0.7
+set g_balance_grenadelauncher_primary_bouncestop 0.12
+set g_balance_grenadelauncher_primary_remote_minbouncecnt 0
+
+set g_balance_grenadelauncher_secondary_type 1
 set g_balance_grenadelauncher_secondary_damage 65
 set g_balance_grenadelauncher_secondary_edgedamage 35
 set g_balance_grenadelauncher_secondary_force 320
@@ -313,6 +317,7 @@ set g_balance_grenadelauncher_secondary_health 40
 set g_balance_grenadelauncher_secondary_damageforcescale 0
 set g_balance_grenadelauncher_secondary_bouncefactor 0.7
 set g_balance_grenadelauncher_secondary_bouncestop 0.12
+set g_balance_grenadelauncher_secondary_remote_detonateprimary 0
 // }}}
 // {{{ electro
 set g_balance_electro_lightning 0
@@ -416,6 +421,10 @@ set g_balance_nex_secondary_damagefalloff_mindist 9999999
 set g_balance_nex_secondary_damagefalloff_maxdist 9999999
 set g_balance_nex_secondary_damagefalloff_halflife 9999999
 set g_balance_nex_secondary_damagefalloff_forcehalflife 9999999
+
+set g_balance_nex_velocitydependent_halflife 0
+set g_balance_nex_velocitydependent_minspeed 400
+set g_balance_nex_velocitydependent_maxspeed 1000
 // }}}
 // {{{ minstanex
 set g_balance_minstanex_refire 1
index 6c5a74655d5a26dab09ad8476b01ed06c388ffb8..36615d790cbb7c6d12e55c5ba3ac076b61d6fb75 100644 (file)
@@ -268,8 +268,7 @@ set g_balance_uzi_speed 18000
 set g_balance_uzi_bulletconstant 115 // 13.1qu
 // }}}
 // {{{ mortar
-set g_balance_grenadelauncher_primary2secondary 0
-set g_balance_grenadelauncher_primary_sticky 0
+set g_balance_grenadelauncher_primary_type 0
 set g_balance_grenadelauncher_primary_damage 70
 set g_balance_grenadelauncher_primary_edgedamage 38
 set g_balance_grenadelauncher_primary_force 400
@@ -284,7 +283,11 @@ set g_balance_grenadelauncher_primary_refire 0.8
 set g_balance_grenadelauncher_primary_animtime 0.3
 set g_balance_grenadelauncher_primary_ammo 2
 set g_balance_grenadelauncher_primary_health 25
-set g_balance_grenadelauncher_secondary_sticky 0
+set g_balance_grenadelauncher_primary_damageforcescale 4
+set g_balance_grenadelauncher_primary_bouncefactor 0.5
+set g_balance_grenadelauncher_primary_bouncestop 0.075
+set g_balance_grenadelauncher_primary_remote_minbouncecnt 0
+set g_balance_grenadelauncher_secondary_type 1
 set g_balance_grenadelauncher_secondary_damage 70
 set g_balance_grenadelauncher_secondary_edgedamage 38
 set g_balance_grenadelauncher_secondary_force 400
@@ -302,6 +305,7 @@ set g_balance_grenadelauncher_secondary_health 10
 set g_balance_grenadelauncher_secondary_damageforcescale 4
 set g_balance_grenadelauncher_secondary_bouncefactor 0.5
 set g_balance_grenadelauncher_secondary_bouncestop 0.075
+set g_balance_grenadelauncher_secondary_remote_detonateprimary 0
 // }}}
 // {{{ electro
 set g_balance_electro_lightning 0
@@ -405,6 +409,10 @@ set g_balance_nex_secondary_damagefalloff_mindist 1000
 set g_balance_nex_secondary_damagefalloff_maxdist 3000
 set g_balance_nex_secondary_damagefalloff_halflife 1500
 set g_balance_nex_secondary_damagefalloff_forcehalflife 1500
+
+set g_balance_nex_velocitydependent_halflife 0
+set g_balance_nex_velocitydependent_minspeed 400
+set g_balance_nex_velocitydependent_maxspeed 1000
 // }}}
 // {{{ minstanex
 set g_balance_minstanex_refire 1
index 17c3e1410587e6e09948741758c83a820f65c653..aeed47e8986b05e972cc96bc387cf511d8a20a7d 100644 (file)
@@ -268,8 +268,7 @@ set g_balance_uzi_speed 18000
 set g_balance_uzi_bulletconstant 115 // 13.1qu
 // }}}
 // {{{ mortar
-set g_balance_grenadelauncher_primary2secondary 0
-set g_balance_grenadelauncher_primary_sticky 0
+set g_balance_grenadelauncher_primary_type 0
 set g_balance_grenadelauncher_primary_damage 50
 set g_balance_grenadelauncher_primary_edgedamage 38
 set g_balance_grenadelauncher_primary_force 400
@@ -284,7 +283,12 @@ set g_balance_grenadelauncher_primary_refire 0.8
 set g_balance_grenadelauncher_primary_animtime 0.3
 set g_balance_grenadelauncher_primary_ammo 2
 set g_balance_grenadelauncher_primary_health 25
-set g_balance_grenadelauncher_secondary_sticky 0
+set g_balance_grenadelauncher_primary_damageforcescale 4
+set g_balance_grenadelauncher_primary_bouncefactor 0.5
+set g_balance_grenadelauncher_primary_bouncestop 0.075
+set g_balance_grenadelauncher_primary_remote_minbouncecnt 0
+
+set g_balance_grenadelauncher_secondary_type 1
 set g_balance_grenadelauncher_secondary_damage 60
 set g_balance_grenadelauncher_secondary_edgedamage 38
 set g_balance_grenadelauncher_secondary_force 400
@@ -302,6 +306,7 @@ set g_balance_grenadelauncher_secondary_health 70
 set g_balance_grenadelauncher_secondary_damageforcescale 4
 set g_balance_grenadelauncher_secondary_bouncefactor 0.5
 set g_balance_grenadelauncher_secondary_bouncestop 0.075
+set g_balance_grenadelauncher_secondary_remote_detonateprimary 1
 // }}}
 // {{{ electro
 set g_balance_electro_lightning 0
@@ -405,6 +410,10 @@ set g_balance_nex_secondary_damagefalloff_mindist 1000
 set g_balance_nex_secondary_damagefalloff_maxdist 3000
 set g_balance_nex_secondary_damagefalloff_halflife 1500
 set g_balance_nex_secondary_damagefalloff_forcehalflife 1500
+
+set g_balance_nex_velocitydependent_halflife 0
+set g_balance_nex_velocitydependent_minspeed 400
+set g_balance_nex_velocitydependent_maxspeed 1000
 // }}}
 // {{{ minstanex
 set g_balance_minstanex_refire 1
index 076a4935b6404b5fe2a7a40dc4bec0a767754b71..e28bd844dec4d0d9214cdd7f5bdaa54f4c522232 100644 (file)
@@ -259,22 +259,21 @@ set g_balance_uzi_first_force 35
 set g_balance_uzi_first_spread 0.03
 set g_balance_uzi_first_refire 0.2
 set g_balance_uzi_first_ammo 2
-set g_balance_uzi_sustained_damage 9
+set g_balance_uzi_sustained_damage 12
 set g_balance_uzi_sustained_force 7.5
 set g_balance_uzi_sustained_spread 0.1
-set g_balance_uzi_sustained_refire 0.075
+set g_balance_uzi_sustained_refire 0.1
 set g_balance_uzi_sustained_ammo 1
 set g_balance_uzi_speed 18000
 set g_balance_uzi_bulletconstant 115 // 13.1qu
 // }}}
 // {{{ mortar // TODO
-set g_balance_grenadelauncher_primary2secondary 0
-set g_balance_grenadelauncher_primary_sticky 0
+set g_balance_grenadelauncher_primary_type 1
 set g_balance_grenadelauncher_primary_damage 60
 set g_balance_grenadelauncher_primary_edgedamage 25
 set g_balance_grenadelauncher_primary_force 300
 set g_balance_grenadelauncher_primary_radius 100
-set g_balance_grenadelauncher_primary_speed 1400
+set g_balance_grenadelauncher_primary_speed 1000
 set g_balance_grenadelauncher_primary_speed_up 225
 set g_balance_grenadelauncher_primary_speed_z 0
 set g_balance_grenadelauncher_primary_spread 0
@@ -284,7 +283,12 @@ set g_balance_grenadelauncher_primary_refire 0.8
 set g_balance_grenadelauncher_primary_animtime 0.4
 set g_balance_grenadelauncher_primary_ammo 2
 set g_balance_grenadelauncher_primary_health 72
-set g_balance_grenadelauncher_secondary_sticky 1
+set g_balance_grenadelauncher_primary_damageforcescale 0
+set g_balance_grenadelauncher_primary_bouncefactor 0.5
+set g_balance_grenadelauncher_primary_bouncestop 0.12
+set g_balance_grenadelauncher_primary_remote_minbouncecnt 1
+
+set g_balance_grenadelauncher_secondary_type 0
 set g_balance_grenadelauncher_secondary_damage 90
 set g_balance_grenadelauncher_secondary_edgedamage 32
 set g_balance_grenadelauncher_secondary_force 300
@@ -300,14 +304,15 @@ set g_balance_grenadelauncher_secondary_animtime 0.4
 set g_balance_grenadelauncher_secondary_ammo 2
 set g_balance_grenadelauncher_secondary_health 40
 set g_balance_grenadelauncher_secondary_damageforcescale 0
-set g_balance_grenadelauncher_secondary_bouncefactor 0.7
+set g_balance_grenadelauncher_secondary_bouncefactor 0.5
 set g_balance_grenadelauncher_secondary_bouncestop 0.12
+set g_balance_grenadelauncher_secondary_remote_detonateprimary 1
 // }}}
 // {{{ electro // TODO
 set g_balance_electro_lightning 1
-set g_balance_electro_primary_damage 90
+set g_balance_electro_primary_damage 85
 set g_balance_electro_primary_edgedamage 0
-set g_balance_electro_primary_force 550
+set g_balance_electro_primary_force 425
 set g_balance_electro_primary_force_up 125
 set g_balance_electro_primary_radius 850
 set g_balance_electro_primary_comboradius 75
@@ -385,26 +390,30 @@ set g_balance_crylink_secondary_line_lifetime 2 // range: 4000 full, fades to 80
 set g_balance_crylink_secondary_line_fadetime 2
 // }}}
 // {{{ nex
-set g_balance_nex_primary_damage 80
-set g_balance_nex_primary_force 400
-set g_balance_nex_primary_refire 1.25
+set g_balance_nex_primary_damage 125
+set g_balance_nex_primary_force 500
+set g_balance_nex_primary_refire 1
 set g_balance_nex_primary_animtime 0.75
 set g_balance_nex_primary_ammo 5
-set g_balance_nex_primary_damagefalloff_mindist 0
-set g_balance_nex_primary_damagefalloff_maxdist 4000
+set g_balance_nex_primary_damagefalloff_mindist 500
+set g_balance_nex_primary_damagefalloff_maxdist 4500
 set g_balance_nex_primary_damagefalloff_halflife 2000
 set g_balance_nex_primary_damagefalloff_forcehalflife 2000
 
 set g_balance_nex_secondary 1
-set g_balance_nex_secondary_damage 80
-set g_balance_nex_secondary_force -500
-set g_balance_nex_secondary_refire 1.25
+set g_balance_nex_secondary_damage 125
+set g_balance_nex_secondary_force -700
+set g_balance_nex_secondary_refire 1
 set g_balance_nex_secondary_animtime 0.75
 set g_balance_nex_secondary_ammo 5
-set g_balance_nex_secondary_damagefalloff_mindist 0
-set g_balance_nex_secondary_damagefalloff_maxdist 4000
+set g_balance_nex_secondary_damagefalloff_mindist 500
+set g_balance_nex_secondary_damagefalloff_maxdist 4500
 set g_balance_nex_secondary_damagefalloff_halflife 2000
 set g_balance_nex_secondary_damagefalloff_forcehalflife 2000
+
+set g_balance_nex_velocitydependent_halflife -500
+set g_balance_nex_velocitydependent_minspeed 400
+set g_balance_nex_velocitydependent_maxspeed 1000
 // }}}
 // {{{ minstanex
 set g_balance_minstanex_refire 1.25
@@ -530,14 +539,14 @@ set g_balance_campingrifle_reloadtime 2 // matches reload anim
 set g_balance_campingrifle_auto_reload_after_changing_weapons 0
 set g_balance_campingrifle_bursttime 0
 set g_balance_campingrifle_tracer 1
-set g_balance_campingrifle_primary_damage 50
-set g_balance_campingrifle_primary_headshotaddeddamage 50
+set g_balance_campingrifle_primary_damage 75
+set g_balance_campingrifle_primary_headshotaddeddamage 75
 set g_balance_campingrifle_primary_spread 0
 set g_balance_campingrifle_primary_force 2
 set g_balance_campingrifle_primary_speed 35000
 set g_balance_campingrifle_primary_lifetime 5
-set g_balance_campingrifle_primary_refire 0.8
-set g_balance_campingrifle_primary_animtime 0.8
+set g_balance_campingrifle_primary_refire 1.5
+set g_balance_campingrifle_primary_animtime 1.4
 set g_balance_campingrifle_primary_ammo 10
 set g_balance_campingrifle_primary_bulletconstant 130 // 56.3qu
 set g_balance_campingrifle_primary_burstcost 0
index 1f909014e46690ba779902e115a94e3b978a824d..8a23a83e6d38031eb2260fd1aeb561e6fb1b5f2e 100644 (file)
@@ -198,6 +198,10 @@ seta crosshair_fireball_color_green 1.0    "crosshair color green component to disp
 seta crosshair_fireball_color_blue 0.2 "crosshair color blue component to display when wielding the fireball"
 seta crosshair_fireball_color_alpha 1  "crosshair alpha value to display when wielding the fireball"
 seta crosshair_fireball_size 1 "crosshair size when wielding the fireball"
+seta crosshair_nexvelocity_color_red 0.8
+seta crosshair_nexvelocity_color_green 0
+seta crosshair_nexvelocity_color_blue 0
+seta crosshair_nexvelocity_alpha 0.25
 seta cl_reticle_stretch 0 "whether to stretch reticles so they fit the screen (brakes image proportions)"
 seta cl_reticle_item_nex 1 "draw aiming recticle for the nex weapon's zoom, 0 disables and values between 0 and 1 change alpha"
 seta cl_reticle_item_normal 1 "draw recticle when zooming with the zoom button, 0 disables and values between 0 and 1 change alpha"
@@ -521,6 +525,7 @@ set g_player_brightness 0   "set to 2 for brighter players"
 seta g_balance_cloaked_alpha 0.25
 
 set g_playerclip_collisions 1 "0 = disable collision testing against playerclips, might be useful on some defrag maps"
+set g_botclip_collisions 1 "0 = disable collision testing against botclips, might be useful on some defrag maps"
 
 set welcome_message_time 8
 
@@ -1938,3 +1943,6 @@ sv_clmovement_inputtimeout 0.05
 
 // exact gloss looks better, e.g. on g-23
 r_shadow_glossexact 1
+
+// use fake light if map has no lightmaps
+r_fakelight 1
diff --git a/gfx/nex_ring.tga b/gfx/nex_ring.tga
new file mode 100644 (file)
index 0000000..22e3514
Binary files /dev/null and b/gfx/nex_ring.tga differ
diff --git a/gfx/nightvision-bg.tga b/gfx/nightvision-bg.tga
new file mode 100644 (file)
index 0000000..10cba22
Binary files /dev/null and b/gfx/nightvision-bg.tga differ
diff --git a/gfx/nightvision-fg.tga b/gfx/nightvision-fg.tga
new file mode 100644 (file)
index 0000000..80e4c36
Binary files /dev/null and b/gfx/nightvision-fg.tga differ
diff --git a/models/items/armor.tga b/models/items/armor.tga
new file mode 100644 (file)
index 0000000..eebc35a
Binary files /dev/null and b/models/items/armor.tga differ
diff --git a/models/items/armor_gloss.tga b/models/items/armor_gloss.tga
new file mode 100644 (file)
index 0000000..5e9d79e
Binary files /dev/null and b/models/items/armor_gloss.tga differ
diff --git a/models/items/armor_glow.tga b/models/items/armor_glow.tga
new file mode 100644 (file)
index 0000000..416fe0e
Binary files /dev/null and b/models/items/armor_glow.tga differ
diff --git a/models/items/armor_norm.tga b/models/items/armor_norm.tga
new file mode 100644 (file)
index 0000000..c4f8471
Binary files /dev/null and b/models/items/armor_norm.tga differ
diff --git a/models/items/g_a1.md3 b/models/items/g_a1.md3
deleted file mode 100644 (file)
index 22ed73e..0000000
Binary files a/models/items/g_a1.md3 and /dev/null differ
diff --git a/models/items/g_a25.md3 b/models/items/g_a25.md3
deleted file mode 100644 (file)
index da02dcb..0000000
Binary files a/models/items/g_a25.md3 and /dev/null differ
diff --git a/models/items/g_a50.md3 b/models/items/g_a50.md3
deleted file mode 100644 (file)
index 7525f10..0000000
Binary files a/models/items/g_a50.md3 and /dev/null differ
diff --git a/models/items/g_armormedium.md3 b/models/items/g_armormedium.md3
deleted file mode 100644 (file)
index 203a936..0000000
Binary files a/models/items/g_armormedium.md3 and /dev/null differ
diff --git a/models/items/item_armor_big.md3 b/models/items/item_armor_big.md3
new file mode 100644 (file)
index 0000000..f7ac71e
Binary files /dev/null and b/models/items/item_armor_big.md3 differ
diff --git a/models/items/item_armor_large.md3 b/models/items/item_armor_large.md3
new file mode 100644 (file)
index 0000000..8be97a7
Binary files /dev/null and b/models/items/item_armor_large.md3 differ
diff --git a/models/items/item_armor_medium.md3 b/models/items/item_armor_medium.md3
new file mode 100644 (file)
index 0000000..acc90eb
Binary files /dev/null and b/models/items/item_armor_medium.md3 differ
diff --git a/models/items/item_armor_small.md3 b/models/items/item_armor_small.md3
new file mode 100644 (file)
index 0000000..f92744a
Binary files /dev/null and b/models/items/item_armor_small.md3 differ
index fbed63fc40b671ffb09f0d43d11eb5a9eecf5bad..1bd911aafb12b890f30152d8a1e17ead239fd11c 100644 (file)
@@ -260,3 +260,6 @@ vector w_org, w_backoff;
 
 float campingrifle_scope;
 float nex_scope;
+
+float nex_minvelocity;
+float nex_maxvelocity;
index 2fc1ce308bee3c0d7fd49907249f8dbd25dc205b..27b9284cd1e903e181490fa20470569bf62aa546 100644 (file)
@@ -1351,6 +1351,11 @@ float CSQC_Parse_TempEntity()
                        Net_WeaponComplain();
                        bHandled = true;
                        break;
+               case TE_CSQC_NEX_VELOCITY:
+                       nex_minvelocity = ReadShort();
+                       nex_maxvelocity = ReadShort();
+                       bHandled = true;
+                       break;
                default:
                        // No special logic for this temporary entity; return 0 so the engine can handle it
                        bHandled = false;
index 07b21d98af5af92e34f278808b3a919048666f40..6fc94ca4346d1ebfa395510f9270ad9234ad841b 100644 (file)
@@ -347,6 +347,7 @@ void CSQC_SPIDER_HUD();
 void CSQC_RAPTOR_HUD();
 
 vector freeze_pmove_org, freeze_input_angles;
+entity nightvision_noise, nightvision_noise2;
 
 void CSQC_UpdateView(float w, float h)
 {
@@ -565,6 +566,56 @@ void CSQC_UpdateView(float w, float h)
        // next R_RenderScene call
        drawstring('0 0 0', "", '1 1 0', '1 1 1', 0, 0);
 
+       if(cvar("r_fakelight") >= 2 || cvar("r_fullbright"))
+       {
+               // apply night vision effect
+               vector rgb, tc_00, tc_01, tc_10, tc_11;
+               float a;
+
+               if(!nightvision_noise)
+               {
+                       nightvision_noise = spawn();
+                       nightvision_noise.classname = "nightvision_noise";
+               }
+               if(!nightvision_noise2)
+               {
+                       nightvision_noise2 = spawn();
+                       nightvision_noise2.classname = "nightvision_noise2";
+               }
+
+               // color tint in yellow
+               drawfill('0 0 0', cvar("vid_conwidth") * '1 0 0' + cvar("vid_conheight") * '0 1 0', '0.5 1 0.3', 1, DRAWFLAG_MODULATE);
+
+               // draw BG
+               a = Noise_Pink(nightvision_noise, frametime * 1.5) * 0.05 + 0.15;
+               rgb = '1 1 1';
+               tc_00 = '0 0 0' + '0.2 0 0' * sin(time * 0.3) + '0 0.3 0' * cos(time * 0.7);
+               tc_01 = '0 2.25 0' + '0.6 0 0' * cos(time * 1.2) - '0 0.3 0' * sin(time * 2.2);
+               tc_10 = '1.5 0 0' - '0.2 0 0' * sin(time * 0.5) + '0 0.5 0' * cos(time * 1.7);
+               //tc_11 = '1 1 0' + '0.6 0 0' * sin(time * 0.6) + '0 0.3 0' * cos(time * 0.1);
+               tc_11 = tc_01 + tc_10 - tc_00;
+               R_BeginPolygon("gfx/nightvision-bg.tga", DRAWFLAG_ADDITIVE);
+               R_PolygonVertex('0 0 0', tc_00, rgb, a);
+               R_PolygonVertex(cvar("vid_conwidth") * '1 0 0', tc_10, rgb, a);
+               R_PolygonVertex(cvar("vid_conwidth") * '1 0 0' + cvar("vid_conheight") * '0 1 0', tc_11, rgb, a);
+               R_PolygonVertex(cvar("vid_conheight") * '0 1 0', tc_01, rgb, a);
+               R_EndPolygon();
+
+               // draw FG
+               a = Noise_Pink(nightvision_noise2, frametime * 0.1) * 0.05 + 0.12;
+               rgb = '0.3 0.6 0.4' + '0.1 0.4 0.2' * Noise_White(nightvision_noise2, frametime);
+               tc_00 = '0 0 0' + '1 0 0' * Noise_White(nightvision_noise2, frametime) + '0 1 0' * Noise_White(nightvision_noise2, frametime);
+               tc_01 = tc_00 + '0 3 0' * (1 + Noise_White(nightvision_noise2, frametime) * 0.2);
+               tc_10 = tc_00 + '2 0 0' * (1 + Noise_White(nightvision_noise2, frametime) * 0.3);
+               tc_11 = tc_01 + tc_10 - tc_00;
+               R_BeginPolygon("gfx/nightvision-fg.tga", DRAWFLAG_ADDITIVE);
+               R_PolygonVertex('0 0 0', tc_00, rgb, a);
+               R_PolygonVertex(cvar("vid_conwidth") * '1 0 0', tc_10, rgb, a);
+               R_PolygonVertex(cvar("vid_conwidth") * '1 0 0' + cvar("vid_conheight") * '0 1 0', tc_11, rgb, a);
+               R_PolygonVertex(cvar("vid_conheight") * '0 1 0', tc_01, rgb, a);
+               R_EndPolygon();
+       }
+
        // Draw the aiming reticle for weapons that use it
        // reticle_type is changed to the item we are zooming / aiming with, to decide which reticle to use
        // It must be a persisted float for fading out to work properly (you let go of the zoom button for
@@ -646,6 +697,24 @@ void CSQC_UpdateView(float w, float h)
                        if(cvar("viewsize") < 120)
                                CSQC_common_hud();
 
+
+               // ring around crosshair representing velocity-dependent damage for the nex
+               if (activeweapon == WEP_NEX)
+               {
+                       float f, a, curvel;
+                       vector rgb;
+
+                       rgb_x = cvar("crosshair_nexvelocity_color_red");
+                       rgb_y = cvar("crosshair_nexvelocity_color_green");
+                       rgb_z = cvar("crosshair_nexvelocity_color_blue");
+                       a = cvar("crosshair_nexvelocity_alpha");
+
+                       curvel = vlen('1 0 0' * pmove_vel_x + '0 1 0' * pmove_vel_y);
+                       f = bound(0, (curvel - nex_minvelocity) / (nex_maxvelocity - nex_minvelocity), 1);
+
+                       DrawCircleClippedPic('0.5 0 0' * vid_conwidth + '0 0.5 0' * vid_conheight, 0.1 * vid_conheight, "gfx/nex_ring.tga", f, rgb, a, DRAWFLAG_ADDITIVE);
+               }
+
                // crosshair goes VERY LAST
                if(!scoreboard_active && !camera_active && intermission != 2) {
                        // TrueAim check
index ed8f84fc28bf128c3b2e340cb0e9c2233bb5307f..5c377bffadb8ade59c381071def85021d3181ba8 100644 (file)
@@ -650,3 +650,153 @@ void PolyDrawModel(entity e)
                }
        }
 }
+
+void DrawCircleClippedPic(vector centre, float radius, string pic, float f, vector rgb, float a, float drawflag)
+{
+       float x, y, q, d;
+       vector ringsize, v, t;
+       ringsize = radius * '1 1 0';
+
+       x = cos(f * 2 * M_PI);
+       y = sin(f * 2 * M_PI);
+       q = fabs(x) + fabs(y);
+       x /= q;
+       y /= q;
+
+       if(f >= 1)
+       {
+               // draw full rectangle
+               R_BeginPolygon(pic, drawflag);
+                       v = centre;                     t = '0.5 0.5 0';
+                       v_x += 0.5 * ringsize_x;        t += '0.5 0.5 0';
+                       R_PolygonVertex(v, t, rgb, a);
+
+                       v = centre;                     t = '0.5 0.5 0';
+                       v_y += 0.5 * ringsize_y;        t += '0.5 -0.5 0';
+                       R_PolygonVertex(v, t, rgb, a);
+
+                       v = centre;                     t = '0.5 0.5 0';
+                       v_x -= 0.5 * ringsize_x;        t -= '0.5 0.5 0';
+                       R_PolygonVertex(v, t, rgb, a);
+
+                       v = centre;                     t = '0.5 0.5 0';
+                       v_y -= 0.5 * ringsize_y;        t -= '0.5 -0.5 0';
+                       R_PolygonVertex(v, t, rgb, a);
+               R_EndPolygon();
+
+               d = q - 1;
+               if(d > 0)
+               {
+                       R_BeginPolygon(pic, drawflag);
+                               v = centre;                     t = '0.5 0.5 0';
+                               R_PolygonVertex(v, t, rgb, a);
+
+                               v = centre;                     t = '0.5 0.5 0';
+                               v_x += 0.5 * ringsize_x;        t += '0.5 0.5 0';
+                               R_PolygonVertex(v, t, rgb, a);
+               }
+       }
+       else if(f > 0.75)
+       {
+               // draw upper and first triangle
+               R_BeginPolygon(pic, drawflag);
+                       v = centre;                     t = '0.5 0.5 0';
+                       v_x += 0.5 * ringsize_x;        t += '0.5 0.5 0';
+                       R_PolygonVertex(v, t, rgb, a);
+
+                       v = centre;                     t = '0.5 0.5 0';
+                       v_y += 0.5 * ringsize_y;        t += '0.5 -0.5 0';
+                       R_PolygonVertex(v, t, rgb, a);
+
+                       v = centre;                     t = '0.5 0.5 0';
+                       v_x -= 0.5 * ringsize_x;        t -= '0.5 0.5 0';
+                       R_PolygonVertex(v, t, rgb, a);
+               R_EndPolygon();
+               R_BeginPolygon(pic, drawflag);
+                       v = centre;                     t = '0.5 0.5 0';
+                       R_PolygonVertex(v, t, rgb, a);
+
+                       v = centre;                     t = '0.5 0.5 0';
+                       v_x -= 0.5 * ringsize_x;        t -= '0.5 0.5 0';
+                       R_PolygonVertex(v, t, rgb, a);
+
+                       v = centre;                     t = '0.5 0.5 0';
+                       v_y -= 0.5 * ringsize_y;        t -= '0.5 -0.5 0';
+                       R_PolygonVertex(v, t, rgb, a);
+
+               d = q - 0.75;
+               if(d <= 0)
+                       R_EndPolygon();
+       }
+       else if(f > 0.5)
+       {
+               // draw upper triangle
+               R_BeginPolygon(pic, drawflag);
+                       v = centre;                     t = '0.5 0.5 0';
+                       v_x += 0.5 * ringsize_x;        t += '0.5 0.5 0';
+                       R_PolygonVertex(v, t, rgb, a);
+
+                       v = centre;                     t = '0.5 0.5 0';
+                       v_y += 0.5 * ringsize_y;        t += '0.5 -0.5 0';
+                       R_PolygonVertex(v, t, rgb, a);
+
+                       v = centre;                     t = '0.5 0.5 0';
+                       v_x -= 0.5 * ringsize_x;        t -= '0.5 0.5 0';
+                       R_PolygonVertex(v, t, rgb, a);
+               R_EndPolygon();
+
+               d = q - 0.5;
+               if(d > 0)
+               {
+                       R_BeginPolygon(pic, drawflag);
+                               v = centre;                     t = '0.5 0.5 0';
+                               R_PolygonVertex(v, t, rgb, a);
+
+                               v = centre;                     t = '0.5 0.5 0';
+                               v_x -= 0.5 * ringsize_x;        t -= '0.5 0.5 0';
+                               R_PolygonVertex(v, t, rgb, a);
+               }
+       }
+       else if(f > 0.25)
+       {
+               // draw first triangle
+               R_BeginPolygon(pic, drawflag);
+                       v = centre;                     t = '0.5 0.5 0';
+                       R_PolygonVertex(v, t, rgb, a);
+
+                       v = centre;                     t = '0.5 0.5 0';
+                       v_x += 0.5 * ringsize_x;        t += '0.5 0.5 0';
+                       R_PolygonVertex(v, t, rgb, a);
+
+                       v = centre;                     t = '0.5 0.5 0';
+                       v_y += 0.5 * ringsize_y;        t += '0.5 -0.5 0';
+                       R_PolygonVertex(v, t, rgb, a);
+
+               d = q - 0.25;
+               if(d <= 0)
+                       R_EndPolygon();
+       }
+       else
+       {
+               d = q;
+               if(d > 0)
+               {
+                       R_BeginPolygon(pic, drawflag);
+                               v = centre;                     t = '0.5 0.5 0';
+                               R_PolygonVertex(v, t, rgb, a);
+
+                               v = centre;                     t = '0.5 0.5 0';
+                               v_x += 0.5 * ringsize_x;        t += '0.5 0.5 0';
+                               R_PolygonVertex(v, t, rgb, a);
+               }
+       }
+
+       if(d > 0)
+       {
+                       v = centre;                     t = '0.5 0.5 0';
+                       v_x += x * 0.5 * ringsize_x;    t += x * '0.5 0.5 0';
+                       v_y += y * 0.5 * ringsize_y;    t += y * '0.5 -0.5 0';
+                       R_PolygonVertex(v, t, rgb, a);
+               R_EndPolygon();
+       }
+}
index 3aa140c6e87f28a70fa695f4386688fa645b7bce..7690c05f8d1f10006e898c4644f7f686732b53ca 100644 (file)
@@ -79,7 +79,7 @@ void Ent_Wall()
        {
                self.modelindex = ReadShort();
                self.solid = ReadByte();
-               self.scale = ReadByte() / 16.0;
+               self.scale = ReadShort() / 256.0;
                if(f & 0x20)
                {
                        self.mins_x = ReadCoord();
index 5ebeb54659e4ba7e936c0666077f967fa5cd22b5..ddd24ed6bc887322941d6503ab314f0f9a0b7ab4 100644 (file)
@@ -61,6 +61,7 @@ const float TE_CSQC_NOTIFY = 112;
 const float TE_CSQC_WEAPONCOMPLAIN = 113;
 const float TE_CSQC_CAMPINGRIFLE_SCOPE = 115;
 const float TE_CSQC_NEX_SCOPE = 116;
+const float TE_CSQC_NEX_VELOCITY = 117;
 
 const float RACE_NET_CHECKPOINT_HIT_QUALIFYING = 0; // byte checkpoint, short time, short recordtime, string recordholder
 const float RACE_NET_CHECKPOINT_CLEAR = 1;
index 3cbec876133800b150f002fbc6b6ca7f5fb7dcd6..4f3640e26eac35786e17dea56cdb15bdef6c97c7 100644 (file)
@@ -16,7 +16,7 @@ entity waypoint_spawn(vector m1, vector m2, float f)
        }
 
        w = spawn();
-       w.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_PLAYERCLIP;
+       w.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_PLAYERCLIP | DPCONTENTS_BOTCLIP;
        w.classname = "waypoint";
        w.wpflags = f;
        setorigin(w, (m1 + m2) * 0.5);
index ac33ddc50b1fb42a0a09cbd30453fdbe55df43f2..d5ffae1e50d33f416fa9d05a30185107eb183e2b 100644 (file)
@@ -6,6 +6,14 @@ void send_CSQC_teamnagger() {
        WriteByte(0, TE_CSQC_TEAMNAGGER);
 }
 
+void send_CSQC_nexvelocity(entity e) {
+       msg_entity = e;
+       WriteByte(MSG_ONE, SVC_TEMPENTITY);
+       WriteByte(MSG_ONE, TE_CSQC_NEX_VELOCITY);
+       WriteShort(MSG_ONE, cvar("g_balance_nex_velocitydependent_minspeed"));
+       WriteShort(MSG_ONE, cvar("g_balance_nex_velocitydependent_maxspeed"));
+}
+
 void Announce(string snd) {
        WriteByte(MSG_ALL, SVC_TEMPENTITY);
        WriteByte(MSG_ALL, TE_CSQC_ANNOUNCE);
@@ -866,10 +874,11 @@ void PutClientInServer (void)
                self.iscreature = TRUE;
                self.movetype = MOVETYPE_WALK;
                self.solid = SOLID_SLIDEBOX;
+               self.dphitcontentsmask = DPCONTENTS_BODY | DPCONTENTS_SOLID;
                if(cvar("g_playerclip_collisions"))
-                       self.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_PLAYERCLIP;
-               else
-                       self.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY;
+                       self.dphitcontentsmask |= DPCONTENTS_PLAYERCLIP;
+               if(clienttype(self) == CLIENTTYPE_BOT && cvar("g_botclip_collisions"))
+                       self.dphitcontentsmask |= DPCONTENTS_BOTCLIP;
                self.frags = FRAGS_PLAYER;
                if(independent_players)
                        MAKE_INDEPENDENT_PLAYER(self);
@@ -1354,8 +1363,9 @@ void FixClientCvars(entity e)
        if(g_race || g_cts)
                stuffcmd(e, "cl_cmd settemp cl_movecliptokeyboard 2\n");
        if(cvar("g_antilag") == 3) // client side hitscan
-               //stuffcmd(e, "cl_cmd settemp cl_prydoncursor -1\ncl_cmd settemp cl_prydoncursor_notrace 0\n");
                stuffcmd(e, "cl_cmd settemp cl_prydoncursor_notrace 0\n");
+       if(sv_gentle)
+               stuffcmd(e, "cl_cmd settemp cl_gentle 1\n");
        /*
         * we no longer need to stuff this. Remove this comment block if you feel
         * 2.3 and higher (or was it 2.2.3?) don't need these any more
@@ -1596,6 +1606,8 @@ void ClientConnect (void)
        else if(cvar("sv_teamnagger") && !(cvar("bot_vs_human") && (c3==-1 && c4==-1)) && !g_ca) // teamnagger is currently bad for ca
                send_CSQC_teamnagger();
 
+       send_CSQC_nexvelocity(self);
+
        CheatInitClient();
 }
 
index 6e314c88efd50f223f1c6ef15a8a1ae2a7c721e6..8c0844b2246f26107bfccc482bfaed52909f65ce 100644 (file)
@@ -188,7 +188,7 @@ void place_flag()
        self.nextthink = time + 0.1;
        self.cnt = FLAG_BASE;
        self.mangle = self.angles;
-       self.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_PLAYERCLIP;
+       self.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_PLAYERCLIP | DPCONTENTS_BOTCLIP;
        //self.effects = self.effects | EF_DIMLIGHT;
        if(self.noalign)
        {
index d4ee31d802d475ba8aedb5be65ec4aa6aa6e188c..f084e18d4b0b69f6a92b5009321e419e583145c5 100644 (file)
@@ -636,4 +636,11 @@ string deathmessage;
 
 .float ballistics_density; // wall piercing factor, larger = bullet can pass through more
 
+#define ACTIVE_NOT             0
+#define ACTIVE_ACTIVE  1
+#define ACTIVE_IDLE    2
+#define ACTIVE_BUSY    2
+#define ACTIVE_TOGGLE  3
+.float active;
+.float (float act_state) setactive;
 .entity realowner;
index 8a380484a2f9791af0f2d6a3ef7dd27bc541c9e9..0f0bba6e6d36fb335a5afa4485d6b2fd79e373f2 100644 (file)
@@ -88,7 +88,7 @@ float g_clientmodel_genericsendentity (entity to, float sf)
        {
                WriteShort(MSG_ENTITY, self.modelindex);
                WriteByte(MSG_ENTITY, self.solid);
-               WriteByte(MSG_ENTITY, floor(self.scale * 16));
+               WriteShort(MSG_ENTITY, floor(self.scale * 256));
                if(sf & 0x20)
                {
                        WriteCoord(MSG_ENTITY, self.mins_x);
index 08964655d9b048faf1d0e696323dbe303c805e5d..c582594693dcbcec79372490c49eddfcbc1bc91b 100644 (file)
@@ -413,6 +413,9 @@ void spawnfunc_trigger_counter()
 .float triggerhurttime;
 void trigger_hurt_touch()
 {
+       if (self.active != ACTIVE_ACTIVE) 
+               return;
+
        // only do the EXACTTRIGGER_TOUCH checks when really needed (saves some cpu)
        if (other.iscreature)
        {
@@ -455,6 +458,7 @@ entity trigger_hurt_first;
 void spawnfunc_trigger_hurt()
 {
        EXACTTRIGGER_INIT;
+       self.active = ACTIVE_ACTIVE;
        self.touch = trigger_hurt_touch;
        if (!self.dmg)
                self.dmg = 1000;
@@ -493,6 +497,9 @@ float tracebox_hits_trigger_hurt(vector start, vector mi, vector ma, vector end)
 .float triggerhealtime;
 void trigger_heal_touch()
 {
+       if (self.active != ACTIVE_ACTIVE) 
+               return;
+       
        // only do the EXACTTRIGGER_TOUCH checks when really needed (saves some cpu)
        if (other.iscreature)
        {
@@ -514,6 +521,8 @@ void trigger_heal_touch()
 
 void spawnfunc_trigger_heal()
 {
+       self.active = ACTIVE_ACTIVE;
+       
        EXACTTRIGGER_INIT;
        self.touch = trigger_heal_touch;
        if (!self.health)
@@ -1207,6 +1216,9 @@ void trigger_impulse_touch1()
     float pushdeltatime;
     float str;
 
+       if (self.active != ACTIVE_ACTIVE) 
+               return;
+
        // FIXME: Better checking for what to push and not.
        if not(other.iscreature)
        if (other.classname != "corpse")
@@ -1258,6 +1270,9 @@ void trigger_impulse_touch2()
 {
     float pushdeltatime;
 
+       if (self.active != ACTIVE_ACTIVE) 
+               return;
+
        // FIXME: Better checking for what to push and not.
        if not(other.iscreature)
        if (other.classname != "corpse")
@@ -1295,6 +1310,9 @@ void trigger_impulse_touch3()
     float pushdeltatime;
     float str;
 
+       if (self.active != ACTIVE_ACTIVE) 
+               return;
+
        // FIXME: Better checking for what to push and not.
        if not(other.iscreature)
        if (other.classname != "corpse")
@@ -1356,6 +1374,8 @@ in directional and sperical mode. For damper/accelerator mode this is not nesses
 
 void spawnfunc_trigger_impulse()
 {
+       self.active = ACTIVE_ACTIVE;
+
        EXACTTRIGGER_INIT;
     if(self.radius)
     {
@@ -1932,3 +1952,47 @@ void spawnfunc_trigger_magicear()
        // target:
        //   what to trigger
 }
+
+void relay_activators_use()
+{
+       entity trg, os;
+       
+       os = self;
+       
+       for(trg = world; (trg = find(trg, targetname, os.target)); )
+       {
+               self = trg;
+               if (trg.setactive)
+                       trg.setactive(os.cnt);
+               else
+               {
+                       //bprint("Not using setactive\n");
+                       if(os.cnt == ACTIVE_TOGGLE)
+                               if(trg.active == ACTIVE_ACTIVE)
+                                       trg.active = ACTIVE_NOT;
+                               else    
+                                       trg.active = ACTIVE_ACTIVE;
+                       else
+                               trg.active = os.cnt;
+               }               
+       }
+       self = os;
+}
+
+void spawnfunc_relay_activate()
+{
+       self.cnt = ACTIVE_ACTIVE;
+       self.use = relay_activators_use;
+}
+
+void spawnfunc_relay_deactivate()
+{
+       self.cnt = ACTIVE_NOT;
+       self.use = relay_activators_use;        
+}
+
+void spawnfunc_relay_activatetoggle()
+{
+       self.cnt = ACTIVE_TOGGLE;
+       self.use = relay_activators_use;        
+}
index 8cecaeae689eb574dc43702f7ee6f97109dfd093..a6e73ba251b1132e343ab39ffac5bf21a1f81563 100644 (file)
@@ -19,8 +19,6 @@ void Violence_GibSplash_At(vector org, vector dir, float type, float amount, ent
        e.classname = "gibsplash";
        e.cnt = amount;
        e.state = type; // should stay smaller than 15
-       if(sv_gentle)
-               e.state |= 0x80; // "force gentle" bit
        if(!sound_allowed(MSG_BROADCAST, gibowner) || !sound_allowed(MSG_BROADCAST, attacker))
                e.state |= 0x40; // "silence" bit
        e.state |= 8 * self.species; // gib type, ranges from 0 to 15
index ebc58cea7e2847982efb41ace84d6089f001ca1c..ad09772a5354548b64bbc12e656622cf1076f83a 100644 (file)
@@ -336,19 +336,27 @@ float Ban_GetClientIP(entity client)
        string s;
 
        s = client.netaddress;
-       
+
        i1 = strstrofs(s, ".", 0);
+       if(i1 < 0)
+               i1 = strstrofs(s, ":", 0);
        if(i1 < 0)
                return FALSE;
        i2 = strstrofs(s, ".", i1 + 1);
+       if(i2 < 0)
+               i2 = strstrofs(s, ":", i1 + 1);
        if(i2 < 0)
                return FALSE;
        i3 = strstrofs(s, ".", i2 + 1);
+       if(i3 < 0)
+               i3 = strstrofs(s, ":", i2 + 1);
        if(i3 < 0)
                return FALSE;
        i4 = strstrofs(s, ".", i3 + 1);
+       if(i4 < 0)
+               i4 = strstrofs(s, ":", i3 + 1);
        if(i4 >= 0)
-               return FALSE;
+               s = substring(s, 0, i4);
        
        ban_ip1 = substring(s, 0, i1);
        ban_ip2 = substring(s, 0, i2);
index cdc4a076f6c5ae5014255b8095852eb6333d5c9f..2b6f54780e51ff98fea12f6c6527e541eba307e5 100644 (file)
@@ -750,7 +750,7 @@ void kh_Key_Spawn(entity initial_owner, float angle, float i)  // runs every tim
        key.modelindex = kh_key_dropped;
        key.model = "key";
        key.kh_dropperteam = 0;
-       key.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_PLAYERCLIP;
+       key.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_PLAYERCLIP | DPCONTENTS_BOTCLIP;
        setsize(key, KH_KEY_MIN, KH_KEY_MAX);
        key.colormod = TeamColor(initial_owner.team) * KH_KEY_BRIGHTNESS;
        key.reset = key_reset;
index c2b2deb8713cc919e32c450f30b3ebfdb009dc62..beed37321c40bc6d6ec3026577510a9c75874f8d 100644 (file)
@@ -1197,7 +1197,7 @@ void spawnfunc_item_armor_small (void) {
                self.max_armorvalue = g_pickup_armorsmall_max;
        if(!self.pickup_anyway)
                self.pickup_anyway = g_pickup_armorsmall_anyway;
-       StartItem ("models/items/g_a1.md3", "misc/armor1.wav", g_pickup_respawntime_short, g_pickup_respawntimejitter_short, "5 Armor", IT_ARMOR_SHARD, 0, 0, commodity_pickupevalfunc, BOT_PICKUP_RATING_LOW);
+       StartItem ("models/items/item_armor_small.md3", "misc/armor1.wav", g_pickup_respawntime_short, g_pickup_respawntimejitter_short, "5 Armor", IT_ARMOR_SHARD, 0, 0, commodity_pickupevalfunc, BOT_PICKUP_RATING_LOW);
 }
 
 void spawnfunc_item_armor_medium (void) {
@@ -1207,7 +1207,7 @@ void spawnfunc_item_armor_medium (void) {
                self.max_armorvalue = g_pickup_armormedium_max;
        if(!self.pickup_anyway)
                self.pickup_anyway = g_pickup_armormedium_anyway;
-       StartItem ("models/items/g_armormedium.md3", "misc/armor10.wav", g_pickup_respawntime_medium, g_pickup_respawntimejitter_medium, "25 Armor", IT_ARMOR, 0, 0, commodity_pickupevalfunc, BOT_PICKUP_RATING_MID);
+       StartItem ("models/items/item_armor_medium.md3", "misc/armor10.wav", g_pickup_respawntime_medium, g_pickup_respawntimejitter_medium, "25 Armor", IT_ARMOR, 0, 0, commodity_pickupevalfunc, BOT_PICKUP_RATING_MID);
 }
 
 void spawnfunc_item_armor_big (void) {
@@ -1217,7 +1217,7 @@ void spawnfunc_item_armor_big (void) {
                self.max_armorvalue = g_pickup_armorbig_max;
        if(!self.pickup_anyway)
                self.pickup_anyway = g_pickup_armorbig_anyway;
-       StartItem ("models/items/g_a50.md3", "misc/armor17_5.wav", g_pickup_respawntime_long, g_pickup_respawntimejitter_long, "50 Armor", IT_ARMOR, 0, 0, commodity_pickupevalfunc, 20000);
+       StartItem ("models/items/item_armor_big.md3", "misc/armor17_5.wav", g_pickup_respawntime_long, g_pickup_respawntimejitter_long, "50 Armor", IT_ARMOR, 0, 0, commodity_pickupevalfunc, 20000);
 }
 
 void spawnfunc_item_armor_large (void) {
@@ -1227,7 +1227,7 @@ void spawnfunc_item_armor_large (void) {
                self.max_armorvalue = g_pickup_armorlarge_max;
        if(!self.pickup_anyway)
                self.pickup_anyway = g_pickup_armorlarge_anyway;
-       StartItem ("models/items/g_a25.md3", "misc/armor25.wav", g_pickup_respawntime_long, g_pickup_respawntimejitter_long, "100 Armor", IT_ARMOR, 0, 0, commodity_pickupevalfunc, BOT_PICKUP_RATING_HIGH);
+       StartItem ("models/items/item_armor_large.md3", "misc/armor25.wav", g_pickup_respawntime_long, g_pickup_respawntimejitter_long, "100 Armor", IT_ARMOR, 0, 0, commodity_pickupevalfunc, BOT_PICKUP_RATING_HIGH);
 }
 
 void spawnfunc_item_health_small (void) {
index 9bb8f7c92034d88e0de65ba2f88e0039ed4f53f5..df5788f4c3a0ff251854b2fd9d5235b23b99a073 100644 (file)
@@ -127,6 +127,9 @@ vector trigger_push_calculatevelocity(vector org, entity tgt, float ht)
 
 void trigger_push_touch()
 {
+       if (self.active == ACTIVE_NOT) 
+               return;         
+               
        // FIXME: add a .float for whether an entity should be tossed by jumppads
        if (!other.iscreature)
        if (other.classname != "corpse")
@@ -229,7 +232,6 @@ void trigger_push_touch()
 };
 
 .vector dest;
-
 void trigger_push_findtarget()
 {
        local entity e;
@@ -287,7 +289,8 @@ void spawnfunc_trigger_push()
                SetMovedir ();
 
        EXACTTRIGGER_INIT;
-
+       
+       self.active = ACTIVE_ACTIVE;    
        self.use = trigger_push_use;
        self.touch = trigger_push_touch;
 
index ad80e7f9998ef08d2507e2f11bbf4fe4c0d11c88..583fc735966d68c1de4b22cce08c6fc084f4c295 100644 (file)
@@ -327,6 +327,25 @@ void spawnfunc_func_train()
        // TODO make a reset function for this one
 };
 
+void func_rotating_setactive(float astate)
+{
+       
+       if (astate == ACTIVE_TOGGLE)
+       {               
+               if(self.active == ACTIVE_ACTIVE)
+                       self.active = ACTIVE_NOT;
+               else
+                       self.active = ACTIVE_ACTIVE;
+       }
+       else
+               self.active = astate;
+               
+       if(self.active  == ACTIVE_NOT)          
+               self.avelocity = '0 0 0';
+       else
+               self.avelocity = self.pos1;
+}
+
 /*QUAKED spawnfunc_func_rotating (0 .5 .8) ? - - X_AXIS Y_AXIS
 Brush model that spins in place on one axis (default Z).
 speed   : speed to rotate (in degrees per second)
@@ -342,6 +361,10 @@ void spawnfunc_func_rotating()
                precache_sound(self.noise);
                ambientsound(self.origin, self.noise, VOL_BASE, ATTN_IDLE);
        }
+       
+       self.active = ACTIVE_ACTIVE;
+       self.setactive = func_rotating_setactive;
+       
        if (!self.speed)
                self.speed = 100;
        // FIXME: test if this turns the right way, then remove this comment (negate as needed)
@@ -353,7 +376,9 @@ void spawnfunc_func_rotating()
        // FIXME: test if this turns the right way, then remove this comment (negate as needed)
        else // Z
                self.avelocity = '0 1 0' * self.speed;
-
+       
+       self.pos1 = self.avelocity;
+    
     if(self.dmg & (!self.message))
         self.message = " was squished";
     if(self.dmg && (!self.message2))
@@ -383,6 +408,13 @@ void func_bobbing_controller_think()
 {
        local vector v;
        self.nextthink = time + 0.1;
+       
+       if not (self.owner.active == ACTIVE_ACTIVE)
+       {
+               self.owner.velocity = '0 0 0';          
+               return;
+       }
+               
        // calculate sinewave using makevectors
        makevectors((self.nextthink * self.owner.cnt + self.owner.phase * 360) * '0 1 0');
        v = self.owner.destvec + self.owner.movedir * v_forward_y;
@@ -422,6 +454,8 @@ void spawnfunc_func_bobbing()
        // time scale to get degrees
        self.cnt = 360 / self.speed;
 
+       self.active = ACTIVE_ACTIVE;
+
        // damage when blocked
        self.blocked = bobbing_blocked;
        if(self.dmg & (!self.message))
@@ -526,6 +560,10 @@ void button_use()
 //             dprint(activator.classname);
 //             dprint(" triggered a button\n");
 //     }
+
+       if not (self.active == ACTIVE_ACTIVE)
+               return;
+
        self.enemy = activator;
        button_fire ();
 };
@@ -615,6 +653,8 @@ void spawnfunc_func_button()
     if(self.noise != "")
         precache_sound(self.noise);
 
+       self.active = ACTIVE_ACTIVE;
+
        self.pos1 = self.origin;
        self.pos2 = self.pos1 + self.movedir*(fabs(self.movedir*self.size) - self.lip);
     self.flags |= FL_NOTARGET;
@@ -1636,6 +1676,12 @@ void func_fourier_controller_think()
        float n, i, t;
 
        self.nextthink = time + 0.1;
+       if not (self.owner.active == ACTIVE_ACTIVE)
+       {
+               self.owner.velocity = '0 0 0';          
+               return;
+       }
+
 
        n = floor((tokenize_console(self.owner.netname)) / 5);
        t = self.nextthink * self.owner.cnt + self.owner.phase * 360;
@@ -1683,6 +1729,8 @@ void spawnfunc_func_fourier()
        if not(InitMovingBrushTrigger())
                return;
 
+       self.active = ACTIVE_ACTIVE;
+
        // wait for targets to spawn
        controller = spawn();
        controller.classname = "func_fourier_controller";
@@ -1759,6 +1807,13 @@ vector func_vectormamamam_origin(entity o, float t)
 void func_vectormamamam_controller_think()
 {
        self.nextthink = time + 0.1;
+
+       if not (self.owner.active == ACTIVE_ACTIVE)
+       {
+               self.owner.velocity = '0 0 0';          
+               return;
+       }
+
        self.owner.velocity = (self.owner.destvec + func_vectormamamam_origin(self.owner, 0.1) - self.owner.origin) * 10;
 }
 
@@ -1843,5 +1898,7 @@ void spawnfunc_func_vectormamamam()
        // Savage: Reduce bandwith, critical on e.g. nexdm02
        self.effects |= EF_LOWPRECISION;
 
+       self.active = ACTIVE_ACTIVE;
+
        InitializeEntity(self, func_vectormamamam_findtarget, INITPRIO_FINDTARGET);
 }
index 26acf7f0ead9d4f59a5d2f5c1d8770afbf0ba3f3..eba0ea0681b3ee22edfcc378e7ca1c23f1027b17 100644 (file)
@@ -154,6 +154,9 @@ void Teleport_Touch (void)
        float p;
        string s;
 
+       if (self.active != ACTIVE_ACTIVE)
+               return;
+       
        if (other.health < 1)
                return;
        if not(other.flags & FL_CLIENT) // FIXME: Make missiles firable through the teleport too
@@ -292,7 +295,9 @@ void spawnfunc_trigger_teleport (void)
        self.angles = '0 0 0';
 
        EXACTTRIGGER_INIT;
-
+       
+       self.active = ACTIVE_ACTIVE;    
+       
        self.use = trigger_teleport_use;
 
        // this must be called to spawn the teleport waypoints for bots
index 04580e6c42eade3dc20fdfa0722dd970d93bff8f..912e22c2441e8c9aabea1cef218d45f234b3a2dc 100644 (file)
@@ -513,8 +513,6 @@ void PrintWelcomeMessage(entity pl)
                modifications = strcat(modifications, ", Low gravity");
        if(g_cloaked)
                modifications = strcat(modifications, ", Cloaked");
-       if(g_footsteps)
-               modifications = strcat(modifications, ", Steps");
        if(g_grappling_hook)
                modifications = strcat(modifications, ", Hook");
        if(g_laserguided_missile)
index 84b98b525cd3bec1be709072ffc73478cf8f951d..0bc08b8de77f2b2a6d84c9603d571bac6188421e 100644 (file)
@@ -2,6 +2,9 @@
 REGISTER_WEAPON(GRENADE_LAUNCHER, w_glauncher, IT_ROCKETS, 4, WEP_FLAG_NORMAL | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH, BOT_PICKUP_RATING_MID, "gl", "grenadelauncher", "Mortar");
 #else
 #ifdef SVQC
+.float gl_detonate_later;
+.float gl_bouncecnt;
+
 void W_Grenade_Explode (void)
 {
        if(other.takedamage == DAMAGE_AIM)
@@ -52,10 +55,47 @@ void W_Grenade_Damage (entity inflictor, entity attacker, float damage, float de
        }
 }
 
+void W_Grenade_Think1 (void)
+{
+       self.nextthink = time;
+       if (time > self.cnt)
+       {
+               other = world;
+               self.projectiledeathtype |= HITTYPE_BOUNCE;
+               W_Grenade_Explode ();
+               return;
+       }
+       if(self.gl_detonate_later && self.gl_bouncecnt >= cvar("g_balance_grenadelauncher_primary_remote_minbouncecnt"))
+               W_Grenade_Explode();
+}
+
 void W_Grenade_Touch1 (void)
 {
        PROJECTILE_TOUCH;
-       if(cvar("g_balance_grenadelauncher_primary_sticky") && (!other || (other.takedamage != DAMAGE_AIM && other.movetype == MOVETYPE_NONE)))
+       if (other.takedamage == DAMAGE_AIM || cvar("g_balance_grenadelauncher_primary_type") == 0) // always explode when hitting a player, or if normal mortar projectile
+       {
+               self.use ();
+       }
+       else if (cvar("g_balance_grenadelauncher_primary_type") == 1) // bounce
+       {
+               float r;
+               r = random() * 6;
+               if(r < 1)
+                       spamsound (self, CHAN_PROJECTILE, "weapons/grenade_bounce1.wav", VOL_BASE, ATTN_NORM);
+               else if(r < 2)
+                       spamsound (self, CHAN_PROJECTILE, "weapons/grenade_bounce2.wav", VOL_BASE, ATTN_NORM);
+               else if(r < 3)
+                       spamsound (self, CHAN_PROJECTILE, "weapons/grenade_bounce3.wav", VOL_BASE, ATTN_NORM);
+               else if(r < 4)
+                       spamsound (self, CHAN_PROJECTILE, "weapons/grenade_bounce4.wav", VOL_BASE, ATTN_NORM);
+               else if(r < 5)
+                       spamsound (self, CHAN_PROJECTILE, "weapons/grenade_bounce5.wav", VOL_BASE, ATTN_NORM);
+               else
+                       spamsound (self, CHAN_PROJECTILE, "weapons/grenade_bounce6.wav", VOL_BASE, ATTN_NORM);
+               self.projectiledeathtype |= HITTYPE_BOUNCE;
+               self.gl_bouncecnt += 1;
+       }
+       else if(cvar("g_balance_grenadelauncher_primary_type") == 2 && (!other || (other.takedamage != DAMAGE_AIM && other.movetype == MOVETYPE_NONE))) // stick
        {
                spamsound (self, CHAN_PROJECTILE, "weapons/grenade_stick.wav", VOL_BASE, ATTN_NORM);
 
@@ -71,14 +111,35 @@ void W_Grenade_Touch1 (void)
 
                self.nextthink = min(self.nextthink, time + cvar("g_balance_grenadelauncher_primary_lifetime2"));
        }
-       else
-               W_Grenade_Explode ();
 }
 
 void W_Grenade_Touch2 (void)
 {
        PROJECTILE_TOUCH;
-       if(cvar("g_balance_grenadelauncher_secondary_sticky") && (!other || (other.takedamage != DAMAGE_AIM && other.movetype == MOVETYPE_NONE)))
+       if (other.takedamage == DAMAGE_AIM || cvar("g_balance_grenadelauncher_secondary_type") == 0) // always explode when hitting a player, or if normal mortar projectile
+       {
+               self.use ();
+       }
+       else if (cvar("g_balance_grenadelauncher_secondary_type") == 1) // bounce
+       {
+               float r;
+               r = random() * 6;
+               if(r < 1)
+                       spamsound (self, CHAN_PROJECTILE, "weapons/grenade_bounce1.wav", VOL_BASE, ATTN_NORM);
+               else if(r < 2)
+                       spamsound (self, CHAN_PROJECTILE, "weapons/grenade_bounce2.wav", VOL_BASE, ATTN_NORM);
+               else if(r < 3)
+                       spamsound (self, CHAN_PROJECTILE, "weapons/grenade_bounce3.wav", VOL_BASE, ATTN_NORM);
+               else if(r < 4)
+                       spamsound (self, CHAN_PROJECTILE, "weapons/grenade_bounce4.wav", VOL_BASE, ATTN_NORM);
+               else if(r < 5)
+                       spamsound (self, CHAN_PROJECTILE, "weapons/grenade_bounce5.wav", VOL_BASE, ATTN_NORM);
+               else
+                       spamsound (self, CHAN_PROJECTILE, "weapons/grenade_bounce6.wav", VOL_BASE, ATTN_NORM);
+               self.projectiledeathtype |= HITTYPE_BOUNCE;
+               self.gl_bouncecnt += 1;
+       }
+       else if(cvar("g_balance_grenadelauncher_secondary_type") == 2 && (!other || (other.takedamage != DAMAGE_AIM && other.movetype == MOVETYPE_NONE))) // stick
        {
                spamsound (self, CHAN_PROJECTILE, "weapons/grenade_stick.wav", VOL_BASE, ATTN_NORM);
 
@@ -94,31 +155,6 @@ void W_Grenade_Touch2 (void)
 
                self.nextthink = min(self.nextthink, time + cvar("g_balance_grenadelauncher_secondary_lifetime2"));
        }
-       else
-       {
-               if (cvar("g_balance_grenadelauncher_secondary_sticky") || other.takedamage == DAMAGE_AIM)
-               {
-                       self.use ();
-               }
-               else
-               {
-                       float r;
-                       r = random() * 6;
-                       if(r < 1)
-                               spamsound (self, CHAN_PROJECTILE, "weapons/grenade_bounce1.wav", VOL_BASE, ATTN_NORM);
-                       else if(r < 2)
-                               spamsound (self, CHAN_PROJECTILE, "weapons/grenade_bounce2.wav", VOL_BASE, ATTN_NORM);
-                       else if(r < 3)
-                               spamsound (self, CHAN_PROJECTILE, "weapons/grenade_bounce3.wav", VOL_BASE, ATTN_NORM);
-                       else if(r < 4)
-                               spamsound (self, CHAN_PROJECTILE, "weapons/grenade_bounce4.wav", VOL_BASE, ATTN_NORM);
-                       else if(r < 5)
-                               spamsound (self, CHAN_PROJECTILE, "weapons/grenade_bounce5.wav", VOL_BASE, ATTN_NORM);
-                       else
-                               spamsound (self, CHAN_PROJECTILE, "weapons/grenade_bounce6.wav", VOL_BASE, ATTN_NORM);
-                       self.projectiledeathtype |= HITTYPE_BOUNCE;
-               }
-       }
 }
 
 void W_Grenade_Attack (void)
@@ -138,25 +174,32 @@ void W_Grenade_Attack (void)
        gren.bot_dodge = TRUE;
        gren.bot_dodgerating = cvar("g_balance_grenadelauncher_primary_damage");
        gren.movetype = MOVETYPE_BOUNCE;
+       gren.bouncefactor = cvar("g_balance_grenadelauncher_primary_bouncefactor");
+       gren.bouncestop = cvar("g_balance_grenadelauncher_primary_bouncestop");
        PROJECTILE_MAKETRIGGER(gren);
        gren.projectiledeathtype = WEP_GRENADE_LAUNCHER;
        setorigin(gren, w_shotorg);
        setsize(gren, '-3 -3 -3', '3 3 3');
 
-       gren.nextthink = time + cvar("g_balance_grenadelauncher_primary_lifetime");
-       gren.think = adaptor_think2use_hittype_splash;
+       gren.cnt = time + cvar("g_balance_grenadelauncher_primary_lifetime");
+       gren.nextthink = time;
+       gren.think = W_Grenade_Think1;
        gren.use = W_Grenade_Explode;
        gren.touch = W_Grenade_Touch1;
 
        gren.takedamage = DAMAGE_YES;
        gren.health = cvar("g_balance_grenadelauncher_primary_health");
+       gren.damageforcescale = cvar("g_balance_grenadelauncher_primary_damageforcescale");
        gren.event_damage = W_Grenade_Damage;
        W_SETUPPROJECTILEVELOCITY_UP(gren, g_balance_grenadelauncher_primary);
 
        gren.angles = vectoangles (gren.velocity);
        gren.flags = FL_PROJECTILE;
 
-       CSQCProjectile(gren, TRUE, PROJECTILE_GRENADE, TRUE);   
+       if(cvar("g_balance_grenadelauncher_primary_type") == 0 || cvar("g_balance_grenadelauncher_primary_type") == 2)
+               CSQCProjectile(gren, TRUE, PROJECTILE_GRENADE, TRUE);
+       else
+               CSQCProjectile(gren, TRUE, PROJECTILE_GRENADE_BOUNCING, TRUE);
 }
 
 void W_Grenade_Attack2 (void)
@@ -197,7 +240,7 @@ void W_Grenade_Attack2 (void)
        gren.angles = vectoangles (gren.velocity);
        gren.flags = FL_PROJECTILE;
 
-       if(cvar("g_balance_grenadelauncher_secondary_sticky"))
+       if(cvar("g_balance_grenadelauncher_secondary_type") == 0 || cvar("g_balance_grenadelauncher_secondary_type") == 2)
                CSQCProjectile(gren, TRUE, PROJECTILE_GRENADE, TRUE);
        else
                CSQCProjectile(gren, TRUE, PROJECTILE_GRENADE_BOUNCING, TRUE);
@@ -211,6 +254,9 @@ void spawnfunc_weapon_grenadelauncher (void)
 .float bot_secondary_grenademooth;
 float w_glauncher(float req)
 {
+       entity nade;
+       float nadefound;
+
        if (req == WR_AIM)
        {
                self.BUTTON_ATCK = FALSE;
@@ -237,17 +283,30 @@ float w_glauncher(float req)
                if (self.BUTTON_ATCK)
                if (weapon_prepareattack(0, cvar("g_balance_grenadelauncher_primary_refire")))
                {
-                       if(cvar("g_balance_grenadelauncher_primary2secondary"))
-                               W_Grenade_Attack2();
-                       else
-                               W_Grenade_Attack();
+                       W_Grenade_Attack();
                        weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_grenadelauncher_primary_animtime"), w_ready);
                }
-               if (self.BUTTON_ATCK2 && !cvar("g_balance_grenadelauncher_primary2secondary"))
-               if (weapon_prepareattack(1, cvar("g_balance_grenadelauncher_secondary_refire")))
+               if (self.BUTTON_ATCK2)
                {
-                       W_Grenade_Attack2();
-                       weapon_thinkf(WFRAME_FIRE2, cvar("g_balance_grenadelauncher_secondary_animtime"), w_ready);
+                       if (cvar("g_balance_grenadelauncher_secondary_remote_detonateprimary"))
+                       {
+                               nadefound = 0;
+                               for(nade = world; (nade = find(nade, classname, "grenade")); ) if(nade.owner == self)
+                               {
+                                       if(!nade.gl_detonate_later)
+                                       {
+                                               nade.gl_detonate_later = TRUE;
+                                               nadefound = 1;
+                                       }
+                               }
+                               if(nadefound)
+                                       sound (self, CHAN_WEAPON2, "weapons/rocket_det.wav", VOL_BASE, ATTN_NORM);
+                       }
+                       else if (weapon_prepareattack(1, cvar("g_balance_grenadelauncher_secondary_refire")))
+                       {
+                               W_Grenade_Attack2();
+                               weapon_thinkf(WFRAME_FIRE2, cvar("g_balance_grenadelauncher_secondary_animtime"), w_ready);
+                       }
                }
        }
        else if (req == WR_PRECACHE)
index a6ec07d6a819791392f8716325d6556900668445..8acf9f4c6b12c90727bf1d357f3e06eb8f873e93 100644 (file)
@@ -18,7 +18,7 @@ void SendCSQCNexBeamParticle() {
 
 void W_Nex_Attack (float issecondary)
 {
-       float mydmg, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, myammo;
+       float mydmg, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, myammo, f;
        if(issecondary)
        {
                mydmg = cvar("g_balance_nex_secondary_damage");
@@ -43,6 +43,12 @@ void W_Nex_Attack (float issecondary)
        float flying;
        flying = IsFlying(self); // do this BEFORE to make the trace values from FireRailgunBullet last
 
+       f = ExponentialFalloff(cvar("g_balance_nex_velocitydependent_minspeed"), cvar("g_balance_nex_velocitydependent_maxspeed"), cvar("g_balance_nex_velocitydependent_halflife"), vlen('1 0 0' * self.velocity_x + '0 1 0' * self.velocity_y));
+
+       // TODO: make it more obvious (through effects, indicator on weapon) that damage increases when speed increases
+       mydmg *= f;
+       myforce *= f;
+
        W_SetupShot (self, TRUE, 5, "weapons/nexfire.wav", mydmg);
 
        yoda = 0;
index d084e08084ce854d08b723911a97b63185610937..725f84ffbd24a8f09150431c7aa44e1c2f2860d2 100644 (file)
@@ -1,5 +1,20 @@
+void WarpZone_Fade_PreDraw()
+{
+       if(self.warpzone_fadestart)
+               self.alpha = bound(0, (self.warpzone_fadeend - vlen(view_origin - self.origin - 0.5 * (self.mins + self.maxs))) / (self.warpzone_fadeend - self.warpzone_fadestart), 1);
+       else
+               self.alpha = 1;
+       //print(sprintf("%v <-> %v\n", view_origin, self.origin + 0.5 * (self.mins + self.maxs)));
+       if(self.alpha <= 0)
+               self.drawmask = 0;
+       else
+               self.drawmask = MASK_NORMAL;
+}
+
 void WarpZone_Read(float isnew)
 {
+       float f;
+
        ++warpzone_warpzones_exist;
        if not(self.enemy)
        {
@@ -8,10 +23,16 @@ void WarpZone_Read(float isnew)
        }
        self.classname = "trigger_warpzone";
 
-       self.warpzone_isboxy = ReadByte();
-       self.origin_x = ReadCoord();
-       self.origin_y = ReadCoord();
-       self.origin_z = ReadCoord();
+       f = ReadByte();
+       self.warpzone_isboxy = (f & 1);
+       if(f & 4)
+       {
+               self.origin_x = ReadCoord();
+               self.origin_y = ReadCoord();
+               self.origin_z = ReadCoord();
+       }
+       else
+               self.origin = '0 0 0';
        self.modelindex = ReadShort();
        self.mins_x = ReadCoord();
        self.mins_y = ReadCoord();
@@ -33,25 +54,48 @@ void WarpZone_Read(float isnew)
        self.avelocity_y = ReadCoord();
        self.avelocity_z = ReadCoord();
 
+       if(f & 2)
+       {
+               self.warpzone_fadestart = ReadShort();
+               self.warpzone_fadeend = max(self.warpzone_fadestart + 1, ReadShort());
+       }
+       else
+       {
+               self.warpzone_fadestart = 0;
+               self.warpzone_fadeend = 0;
+       }
+
        // common stuff
        WarpZone_SetUp(self, self.enemy.oldorigin, self.enemy.avelocity, self.oldorigin, self.avelocity);
 
-       // engine currently wants this
-       self.drawmask = MASK_NORMAL;
-
        // link me
        //setmodel(self, self.model);
        setorigin(self, self.origin);
        setsize(self, self.mins, self.maxs);
+
+       // how to draw
+       // engine currently wants this
+       if(self.warpzone_fadestart)
+               self.predraw = WarpZone_Fade_PreDraw;
+       else
+               self.drawmask = MASK_NORMAL;
 }
 
 void WarpZone_Camera_Read(float isnew)
 {
+       float f;
        ++warpzone_cameras_exist;
        self.classname = "func_warpzone_camera";
-       self.origin_x = ReadCoord();
-       self.origin_y = ReadCoord();
-       self.origin_z = ReadCoord();
+
+       f = ReadByte();
+       if(f & 4)
+       {
+               self.origin_x = ReadCoord();
+               self.origin_y = ReadCoord();
+               self.origin_z = ReadCoord();
+       }
+       else
+               self.origin = '0 0 0';
        self.modelindex = ReadShort();
        self.mins_x = ReadCoord();
        self.mins_y = ReadCoord();
@@ -67,6 +111,17 @@ void WarpZone_Camera_Read(float isnew)
        self.avelocity_y = ReadCoord();
        self.avelocity_z = ReadCoord();
 
+       if(f & 2)
+       {
+               self.warpzone_fadestart = ReadShort();
+               self.warpzone_fadeend = max(self.warpzone_fadestart + 1, ReadShort());
+       }
+       else
+       {
+               self.warpzone_fadestart = 0;
+               self.warpzone_fadeend = 0;
+       }
+
        // common stuff
        WarpZone_Camera_SetUp(self, self.oldorigin, self.avelocity);
 
@@ -77,6 +132,13 @@ void WarpZone_Camera_Read(float isnew)
        //setmodel(self, self.model);
        setorigin(self, self.origin);
        setsize(self, self.mins, self.maxs);
+
+       // how to draw
+       // engine currently wants this
+       if(self.warpzone_fadestart)
+               self.predraw = WarpZone_Fade_PreDraw;
+       else
+               self.drawmask = MASK_NORMAL;
 }
 
 float warpzone_fixingview;
index 8536bd3d2c464bf575b32356ce60599432cd6190..1e4fc3e630c392be3223e02d4eceb526d234215c 100644 (file)
@@ -28,6 +28,11 @@ var float autocvar_cl_warpzone_usetrace = 1;
 vector WarpZone_camera_transform(vector org, vector ang)
 {
        vector vf, vr, vu;
+       if(self.warpzone_fadestart)
+               if(vlen(org - self.origin - 0.5 * (self.mins + self.maxs)) > self.warpzone_fadeend + 400)
+                       return org;
+                       // don't transform if zone faded out (plus 400qu safety margin for typical speeds and latencies)
+                       // unneeded on client, on server this helps a lot
        vf = v_forward;
        vr = v_right;
        vu = v_up;
@@ -61,6 +66,11 @@ void WarpZone_SetUp(entity e, vector my_org, vector my_ang, vector other_org, ve
 vector WarpZone_Camera_camera_transform(vector org, vector ang)
 {
        // a fixed camera view
+       if(self.warpzone_fadestart)
+               if(vlen(org - self.origin - 0.5 * (self.mins + self.maxs)) > self.warpzone_fadeend + 400)
+                       return org;
+                       // don't transform if zone faded out (plus 400qu safety margin for typical speeds and latencies)
+                       // unneeded on client, on server this helps a lot
        trace_endpos = self.warpzone_origin;
        makevectors(self.warpzone_angles);
        return self.warpzone_origin;
index 8405ce6d3c5febbbd4050c127f3c0a3b62df4b78..9ccd5216a63186ad15da4c573cd368d8db51d481 100644 (file)
@@ -15,6 +15,8 @@ const void func_null(void); // never assign to this one please
 .vector warpzone_targetangles;
 .vector warpzone_targetforward;
 .vector warpzone_transform;
+.float warpzone_fadestart;
+.float warpzone_fadeend;
 void WarpZone_SetUp(entity e, vector my_org, vector my_ang, vector other_org, vector other_ang);
 
 float WarpZoneLib_BoxTouchesBrush(vector mi, vector ma, entity e, entity ig);
index ecfddff1ab5b4b1b9e56a5489b446b51a9f5d90a..cfa6ef965ec768949733736a165038d08555fd28 100644 (file)
@@ -137,15 +137,26 @@ void WarpZone_Touch (void)
 
 float WarpZone_Send(entity to, float sendflags)
 {
+       float f;
        WriteByte(MSG_ENTITY, ENT_CLIENT_WARPZONE);
 
        // we must send this flag for clientside to match properly too
-       WriteByte(MSG_ENTITY, self.warpzone_isboxy);
+       f = 0;
+       if(self.warpzone_isboxy)
+               f |= 1;
+       if(self.warpzone_fadestart)
+               f |= 2;
+       if(self.origin != '0 0 0')
+               f |= 4;
+       WriteByte(MSG_ENTITY, f);
 
        // we need THESE to render the warpzone (and cull properly)...
-       WriteCoord(MSG_ENTITY, self.origin_x);
-       WriteCoord(MSG_ENTITY, self.origin_y);
-       WriteCoord(MSG_ENTITY, self.origin_z);
+       if(f & 4)
+       {
+               WriteCoord(MSG_ENTITY, self.origin_x);
+               WriteCoord(MSG_ENTITY, self.origin_y);
+               WriteCoord(MSG_ENTITY, self.origin_z);
+       }
 
        WriteShort(MSG_ENTITY, self.modelindex);
        WriteCoord(MSG_ENTITY, self.mins_x);
@@ -170,17 +181,33 @@ float WarpZone_Send(entity to, float sendflags)
        WriteCoord(MSG_ENTITY, self.warpzone_targetangles_y);
        WriteCoord(MSG_ENTITY, self.warpzone_targetangles_z);
 
+       if(f & 2)
+       {
+               WriteShort(MSG_ENTITY, self.warpzone_fadestart);
+               WriteShort(MSG_ENTITY, self.warpzone_fadeend);
+       }
+
        return TRUE;
 }
 
 float WarpZone_Camera_Send(entity to, float sendflags)
 {
+       float f;
        WriteByte(MSG_ENTITY, ENT_CLIENT_WARPZONE_CAMERA);
 
+       if(self.warpzone_fadestart)
+               f |= 2;
+       if(self.origin != '0 0 0')
+               f |= 4;
+       WriteByte(MSG_ENTITY, f);
+
        // we need THESE to render the warpzone (and cull properly)...
-       WriteCoord(MSG_ENTITY, self.origin_x);
-       WriteCoord(MSG_ENTITY, self.origin_y);
-       WriteCoord(MSG_ENTITY, self.origin_z);
+       if(f & 4)
+       {
+               WriteCoord(MSG_ENTITY, self.origin_x);
+               WriteCoord(MSG_ENTITY, self.origin_y);
+               WriteCoord(MSG_ENTITY, self.origin_z);
+       }
 
        WriteShort(MSG_ENTITY, self.modelindex);
        WriteCoord(MSG_ENTITY, self.mins_x);
@@ -199,6 +226,12 @@ float WarpZone_Camera_Send(entity to, float sendflags)
        WriteCoord(MSG_ENTITY, self.enemy.angles_y);
        WriteCoord(MSG_ENTITY, self.enemy.angles_z);
 
+       if(f & 2)
+       {
+               WriteShort(MSG_ENTITY, self.warpzone_fadestart);
+               WriteShort(MSG_ENTITY, self.warpzone_fadeend);
+       }
+
        return TRUE;
 }
 
@@ -222,7 +255,7 @@ float WarpZone_CheckProjectileImpact()
        WarpZone_TraceBox_ThroughZone(self.warpzone_oldorigin, self.mins, self.maxs, self.warpzone_oldorigin + self.warpzone_oldvelocity * frametime, MOVE_NORMAL, self, wz, WarpZone_trace_callback_t_null); // this will get us through the warpzone
        setorigin(self, trace_endpos);
        self.angles = WarpZone_TransformAngles(WarpZone_trace_transform, self.angles);
-       self.velocity = WarpZone_TransformVelocity(WarpZone_trace_transform, self.velocity);
+       self.velocity = WarpZone_TransformVelocity(WarpZone_trace_transform, self.warpzone_oldvelocity);
        
        // in case we are in our warp zone post-teleport, shift the projectile forward a bit
        mpd = max(vlen(self.mins), vlen(self.maxs));