]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into terencehill/newpanelhud
authorFruitieX <rasse@rasse-laptop.(none)>
Thu, 21 Oct 2010 18:40:17 +0000 (21:40 +0300)
committerFruitieX <rasse@rasse-laptop.(none)>
Thu, 21 Oct 2010 18:40:17 +0000 (21:40 +0300)
97 files changed:
.gitattributes
Makefile
balance25.cfg
balanceLeeStricklin.cfg
balanceNexSVN.cfg
balanceSamual.cfg
balanceXonotic.cfg
defaultXonotic.cfg
effectinfo.txt
models/turrets/hellion.md3
qcsrc/client/Defs.qc
qcsrc/client/Main.qc
qcsrc/client/View.qc
qcsrc/client/bgmscript.qc
qcsrc/client/casings.qc
qcsrc/client/gibs.qc
qcsrc/client/interpolate.qc
qcsrc/client/laser.qc
qcsrc/client/modeleffects.qc
qcsrc/client/particles.qc
qcsrc/client/projectile.qc
qcsrc/client/target_music.qc
qcsrc/client/wall.qc
qcsrc/client/waypointsprites.qc
qcsrc/common/constants.qh
qcsrc/common/mapinfo.qc
qcsrc/common/util.qc
qcsrc/common/util.qh
qcsrc/menu/mbuiltin.qh
qcsrc/menu/skin-customizables.inc
qcsrc/menu/xonotic/dialog_multiplayer_join_serverinfo.c
qcsrc/menu/xonotic/serverlist.c
qcsrc/server/cl_client.qc
qcsrc/server/cl_physics.qc
qcsrc/server/cl_weaponsystem.qc
qcsrc/server/clientcommands.qc
qcsrc/server/defs.qh
qcsrc/server/extensions.qh
qcsrc/server/g_damage.qc
qcsrc/server/g_models.qc
qcsrc/server/g_subs.qc
qcsrc/server/g_triggers.qc
qcsrc/server/g_world.qc
qcsrc/server/ipban.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/pathlib/debug.qc
qcsrc/server/pathlib/main.qc
qcsrc/server/race.qc
qcsrc/server/sv_main.qc
qcsrc/server/t_items.qc
qcsrc/server/tturrets/include/turrets_early.qh
qcsrc/server/tturrets/system/system_aimprocs.qc
qcsrc/server/tturrets/system/system_damage.qc
qcsrc/server/tturrets/system/system_main.qc
qcsrc/server/tturrets/system/system_misc.qc
qcsrc/server/tturrets/system/system_scoreprocs.qc
qcsrc/server/tturrets/units/unit_ewheel.qc
qcsrc/server/tturrets/units/unit_flac.qc
qcsrc/server/tturrets/units/unit_hellion.qc
qcsrc/server/tturrets/units/unit_hk.qc
qcsrc/server/tturrets/units/unit_machinegun.qc
qcsrc/server/tturrets/units/unit_mlrs.qc
qcsrc/server/tturrets/units/unit_phaser.qc
qcsrc/server/tturrets/units/unit_plasma.qc
qcsrc/server/tturrets/units/unit_tessla.qc
qcsrc/server/tturrets/units/unit_walker.qc
qcsrc/server/vehicles/racer.qc
qcsrc/server/vehicles/raptor.qc
qcsrc/server/vehicles/spiderbot.qc
qcsrc/server/w_electro.qc
qcsrc/server/w_minelayer.qc
qcsrc/server/w_nex.qc
qcsrc/server/w_rocketlauncher.qc
qcsrc/warpzonelib/common.qc
qcsrc/warpzonelib/common.qh
qcsrc/warpzonelib/server.qc
quake.rc
sound/misc/hitground1.ogg
sound/misc/hitground2.ogg
sound/misc/hitground3.ogg
sound/misc/hitground4.ogg
sound/misc/metalhitground1.ogg
sound/misc/metalhitground2.ogg
sound/misc/metalhitground3.ogg
sound/misc/metalhitground4.ogg
sound/weapons/campingrifle_fire2.ogg [deleted file]
sound/weapons/campingrifle_fire2.wav [new file with mode: 0644]
sound/weapons/dryfire.wav [new file with mode: 0644]
unit_flac.cfg
unit_hellion.cfg
unit_hk.cfg
unit_machinegun.cfg
unit_mlrs.cfg
unit_phaser.cfg
unit_plasma.cfg
unit_plasma2.cfg
xonotic-credits.txt

index a2b2bfc3a215233e9be344f4b887e7ca6535ef18..ec3bfe3d1054e3a7f5ebd372dee7c3b00e766d3a 100644 (file)
@@ -1,31 +1,41 @@
 * -crlf
 
-*.7z -crlf -diff
+*.0 -diff -crlf
+*.1 crlf=input
+*.3 crlf=input
+*.7z -diff -crlf
 *.ac crlf=input
+*.a -diff -crlf
 *.afm crlf=input
 *.aft crlf=input
+*.ai -diff -crlf
 *.aliases crlf=input
 all crlf=input
 *.am crlf=input
 *.animinfo crlf=input
-*.aps -crlf -diff
+*.aps -diff -crlf
+*.asc -diff -crlf
 *.ase -crlf
 *.bat -crlf
 *.bgs crlf=input
-*.blend -crlf -diff
-*.bmp -crlf -diff
+*.blend1 -diff -crlf
+*.blend -diff -crlf
+blind_id -diff -crlf
+*.bmp -diff -crlf
 branch-manager crlf=input
+*.brand crlf=input
 BSDmakefile crlf=input
 bsp2ent crlf=input
-*.bsp -crlf -diff
-*.cache -crlf -diff
+*.bsp -diff -crlf
+*.cache -diff -crlf
 *.cbp -crlf
-*.cbp -crlf -diff
+*.cbp -diff -crlf
 *.c crlf=input
 *.cfg crlf=input
 *.cg crlf=input
 ChangeLog crlf=input
 CHANGES crlf=input
+cjpeg -diff -crlf
 COMPILING crlf=input
 compress-texture crlf=input
 *.conf crlf=input
@@ -33,42 +43,49 @@ CONTRIBUTORS crlf=input
 COPYING crlf=input
 *.cpp crlf=input
 create crlf=input
+*.cron crlf=input
 *.css crlf=input
-Current -crlf -diff
-*.cvsignore crlf=input
 *.cvswrappers crlf=input
-*.dat -crlf -diff
-*.db -crlf -diff
+*.d0pk -diff -crlf
+*.db -diff -crlf
 *.default crlf=input
 *.def crlf=input
-*.dem -crlf -diff
+*.dem -diff -crlf
 *.dev -crlf
-*.dll -crlf -diff
-DOCS -crlf -diff
+dir -diff -crlf
+djpeg -diff -crlf
+*.dll -diff -crlf
+DOCS -diff -crlf
 *.dot crlf=input
 DoxyConfig crlf=input
+doxyfile crlf=input
 Doxyfile crlf=input
 *.doxygen crlf=input
-*.dpm -crlf -diff
+*.dpm -diff -crlf
 *.dsp -crlf
 *.dsw -crlf
 *.dtd crlf=input
-*.dylib -crlf -diff
+*.dylib -diff -crlf
+empty -diff -crlf
 *.EncoderPlugin crlf=input
-*.ent -crlf
+*.flac -diff -crlf
 *.form crlf=input
 *.framegroups crlf=input
 *.game crlf=input
+*.gdb crlf=input
 gendox crlf=input
 gendoxfunctions crlf=input
 genDoxyfile crlf=input
-*.gif -crlf -diff
+*.gif -diff -crlf
 *.gitattributes crlf=input
 git-branch-manager crlf=input
 git-filter-index crlf=input
 git-filter-repository crlf=input
 *.gitignore crlf=input
+git-pk3-import crlf=input
+git-pk3-merge crlf=input
 git-pullall crlf=input
+git-recurse crlf=input
 git-split-repository crlf=input
 git-svn-checkout crlf=input
 git-svn-update crlf=input
@@ -81,64 +98,70 @@ GPL crlf=input
 *.hs crlf=input
 *.html crlf=input
 *.html-part crlf=input
-*.icns -crlf -diff
-*.ico -crlf -diff
+*.icns -diff -crlf
+*.ico -diff -crlf
+*.idl crlf=input
 *.idsoftware crlf=input
 *.inc crlf=input
 *.in crlf=input
+*.info-1 -diff -crlf
+*.info-2 -diff -crlf
+*.info -diff -crlf
+*.inl crlf=input
 *.instantaction crlf=input
-*.iqm -crlf -diff
+*.iqm -diff -crlf
 *.java crlf=input
 *.jhm crlf=input
 *.jnlp crlf=input
-*.jpg -crlf -diff
+jpegtran -diff -crlf
+*.jpg -diff -crlf
 *.jsmooth crlf=input
+*.la crlf=input
 LGPL crlf=input
 LICENSE crlf=input
-*.lmp -crlf -diff
+*.lmp -diff -crlf
 *.loaders crlf=input
-*.lso -crlf -diff
+*.lso -diff -crlf
+*.m4 crlf=input
 makefile crlf=input
 Makefile crlf=input
-*.makespr32 crlf=input
 makespr32 crlf=input
-*.map -crlf
+*.map -crlf filter=mapclean
 *.mapinfo crlf=input
 *.m crlf=input
-*.md3 -crlf -diff
+*.md3 -diff -crlf
 *.md5anim -crlf
 *.md5mesh -crlf
-*.mdl -crlf -diff
+*.mdl -diff -crlf
 *.med crlf=input
 *.mf crlf=input
-*.mid -crlf -diff
+*.mid -diff -crlf
 *.mk crlf=input
-*.mkdir -crlf -diff
-*.mmpz -crlf -diff
-*.modinfo crlf=input
+*.mkdir -diff -crlf
+*.mmpz -diff -crlf
 *.modules crlf=input
-nexuiz-map-compiler crlf=input
 *.nib -crlf
 *.obj -crlf
-OFFSETS -crlf -diff
-*.ogg -crlf -diff
+OFFSETS -diff -crlf
+*.ogg -diff -crlf
 *.options crlf=input
 pangorc crlf=input
 *.patch crlf=input
 *.patchsets crlf=input
-*.pcx -crlf -diff
-*.pfb -crlf -diff
-*.pfm -crlf -diff
-*.pk3 -crlf -diff
+*.pc crlf=input
+*.pcx -diff -crlf
+*.pfb -diff -crlf
+*.pfm -diff -crlf
+*.pk3 -diff -crlf
 PkgInfo crlf=input
 *.pl crlf=input
 *.plist crlf=input
 *.pm crlf=input
-*.png -crlf -diff
-POSITIONS -crlf -diff
+*.png -diff -crlf
+POSITIONS -diff -crlf
 *.proj -crlf
 *.properties crlf=input
-*.psd -crlf -diff
+*.psd -diff -crlf
 *.py crlf=input
 *.q3map1 crlf=input
 *.qc crlf=input
@@ -147,48 +170,53 @@ POSITIONS -crlf -diff
 *.rb crlf=input
 *.rc2 crlf=input
 *.rc -crlf
+rdjpgcom -diff -crlf
 *.readme crlf=input
 README crlf=input
-*.rtlights -crlf -diff
+*.rtlights -diff -crlf
 SCHEMA crlf=input
 *.scm crlf=input
-SDL -crlf -diff
-SDLMain.m crlf=input
+sdl-config crlf=input
+SDL -diff -crlf
 *.shader crlf=input
 *.sh crlf=input
 *.skin crlf=input
 *.sln -crlf
 *.sounds crlf=input
-*.sp2 -crlf -diff
-*.spr32 -crlf -diff
-*.spr -crlf -diff
+*.sp2 -diff -crlf
+*.spr32 -diff -crlf
+*.spr -diff -crlf
 *.src crlf=input
 *.strings crlf=input
-*.strip crlf=input
 strip crlf=input
-*.svg -crlf -diff
-*.TAB -crlf -diff
-*.tga -crlf -diff
-TMAP -crlf -diff
+*.svg -diff -crlf
+*.TAB -diff -crlf
+*.tga -diff -crlf
+TMAP -diff -crlf
 todo crlf=input
 TODO crlf=input
-*.ttf -crlf -diff
-*.TTF -crlf -diff
+*.ttf -diff -crlf
+*.TTF -diff -crlf
 *.txt crlf=input
-*.TXT crlf=input
 update-shaderlists crlf=input
+*.vbs -crlf
 *.vcproj -crlf
-*.wav -crlf -diff
-*.waypoints -crlf -diff
+versionbuilder crlf=input
+*.wav -diff -crlf
+*.waypoints -diff -crlf
 w crlf=input
 *.width crlf=input
 *.workspace -crlf
-*.xcf -crlf -diff
+wrjpgcom -diff -crlf
+*.xcf -diff -crlf
 *.xlink crlf=input
 *.xml crlf=input
 xonotic-map-compiler-autobuild crlf=input
 xonotic-map-compiler crlf=input
+xonotic-map-screenshot crlf=input
+xonotic-osx-agl crlf=input
+xonotic-osx-sdl crlf=input
 *.xpm crlf=input
-*.zip -crlf -diff
+*.zip -diff -crlf
 zipdiff crlf=input
-*.zym -crlf -diff
+*.zym -diff -crlf
index 83abf218dafe39bf73f32d681386e63b99c0d2a9..50a9f0b02443492731c7d9694c5ed8d3c491055d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -7,8 +7,8 @@ DIFF ?= diff
 
 FTEQCCFLAGS_WATERMARK ?= -DWATERMARK='"^1$(shell git describe) TEST BUILD"'
 FTEQCCFLAGS ?= -Werror -Wall -Wno-mundane -O3 -Ono-c -Ono-cs -flo $(FTEQCCFLAGS_EXTRA) $(FTEQCCFLAGS_WATERMARK)
-FTEQCCFLAGS_PROGS ?= 
-FTEQCCFLAGS_MENU ?= 
+FTEQCCFLAGS_PROGS ?=
+FTEQCCFLAGS_MENU ?=
 
 # NOTE: use -DUSE_FTE instead of -TFTE here!
 # It will automagically add an engine check with -TID and then change back to -TFTE
@@ -38,15 +38,18 @@ skin: gfx/menu/default/skinvalues.txt
 clean:
        rm -f progs.dat menu.dat csprogs.dat
 
-csprogs.dat: qcsrc/client/*.* qcsrc/common/*.* qcsrc/warpzonelib/*.*
+FILES_CSPROGS = qcsrc/client/progs.src $(shell sed '/\.dat/d; s,//.*,,; s,[^   ],qcsrc/client/&,' < qcsrc/client/progs.src)
+csprogs.dat: $(FILES_CSPROGS)
        @echo make[1]: Entering directory \`$(PWD)/qcsrc/client\'
        cd qcsrc/client && $(FTEQCC) $(FTEQCCFLAGS) $(FTEQCCFLAGS_CSPROGS)
 
-progs.dat: qcsrc/server/*.* qcsrc/common/*.* qcsrc/server/*/*.* qcsrc/server/*/*/*.* qcsrc/warpzonelib/*.*
+FILES_PROGS = qcsrc/server/progs.src $(shell sed '/\.dat/d; s,//.*,,; s,[^     ],qcsrc/server/&,' < qcsrc/server/progs.src)
+progs.dat: $(FILES_PROGS)
        @echo make[1]: Entering directory \`$(PWD)/qcsrc/server\'
        cd qcsrc/server && $(FTEQCC) $(FTEQCCFLAGS) $(FTEQCCFLAGS_PROGS)
 
-menu.dat: qcsrc/menu/*.* qcsrc/menu/*/*.* qcsrc/common/*.*
+FILES_MENU = qcsrc/menu/progs.src $(shell sed '/\.dat/d; s,//.*,,; s,[^        ],qcsrc/menu/&,' < qcsrc/menu/progs.src)
+menu.dat: $(FILES_MENU)
        @echo make[1]: Entering directory \`$(PWD)/qcsrc/menu\'
        cd qcsrc/menu && $(FTEQCC) $(FTEQCCFLAGS) $(FTEQCCFLAGS_MENU)
 
index 90751d279d6d0d18744618855fd2aa187adfe49e..8fb2e008abe24d533d1283178d548505fa736b70 100644 (file)
@@ -56,14 +56,19 @@ set g_balance_nix_ammoincr_fuel 2
 set g_pickup_ammo_anyway 0
 set g_pickup_weapons_anyway 0
 set g_pickup_shells 15
+set g_pickup_shells_weapon 15
 set g_pickup_shells_max 999
 set g_pickup_nails 80
+set g_pickup_nails_weapon 80
 set g_pickup_nails_max 999
 set g_pickup_rockets 15
+set g_pickup_rockets_weapon 15
 set g_pickup_rockets_max 999
 set g_pickup_cells 25
+set g_pickup_cells_weapon 25
 set g_pickup_cells_max 999
 set g_pickup_fuel 25
+set g_pickup_fuel_weapon 25
 set g_pickup_fuel_jetpack 50
 set g_pickup_fuel_max 999
 set g_pickup_armorsmall 5
@@ -425,8 +430,7 @@ set g_balance_nex_primary_damagefalloff_forcehalflife 0
 
 set g_balance_nex_secondary 0
 set g_balance_nex_secondary_charge 0
-set g_balance_nex_secondary_charge_rate 200
-set g_balance_nex_secondary_charge_ammo 10
+set g_balance_nex_secondary_charge_rate 0.1
 set g_balance_nex_secondary_damage 100
 set g_balance_nex_secondary_force 600
 set g_balance_nex_secondary_refire 1.5
@@ -437,10 +441,14 @@ 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
-set g_balance_nex_velocitydependent_falloff_rate 0.001
+set g_balance_nex_charge 0
+set g_balance_nex_charge_start 0
+set g_balance_nex_charge_rate 0.1
+set g_balance_nex_charge_limit 0.5
+set g_balance_nex_charge_shot_multiplier 0.5
+set g_balance_nex_charge_velocity_rate 0.2
+set g_balance_nex_charge_minspeed 400
+set g_balance_nex_charge_maxspeed 1000
 // }}}
 // {{{ minstanex
 set g_balance_minstanex_refire 1
index 36d5435e1b9cf4d8055bb9a5a15084c3c1574b56..eaff81828b33d704520959dabc0e8083ff37f725 100644 (file)
@@ -67,14 +67,19 @@ set g_balance_nix_ammoincr_fuel 2
 set g_pickup_ammo_anyway 0
 set g_pickup_weapons_anyway 1
 set g_pickup_shells 20
+set g_pickup_shells_weapon 20
 set g_pickup_shells_max 45
 set g_pickup_nails 120
+set g_pickup_nails_weapon 120
 set g_pickup_nails_max 300
 set g_pickup_rockets 25
+set g_pickup_rockets_weapon 25
 set g_pickup_rockets_max 150
 set g_pickup_cells 25
+set g_pickup_cells_weapon 25
 set g_pickup_cells_max 200
 set g_pickup_fuel 25
+set g_pickup_fuel_weapon 25
 set g_pickup_fuel_jetpack 50
 set g_pickup_fuel_max 999
 set g_pickup_armorsmall 10
@@ -436,8 +441,7 @@ set g_balance_nex_primary_damagefalloff_forcehalflife 9999999
 
 set g_balance_nex_secondary 0
 set g_balance_nex_secondary_charge 0
-set g_balance_nex_secondary_charge_rate 200
-set g_balance_nex_secondary_charge_ammo 10
+set g_balance_nex_secondary_charge_rate 0.1
 set g_balance_nex_secondary_damage 80
 set g_balance_nex_secondary_force -500
 set g_balance_nex_secondary_refire 1.25
@@ -448,10 +452,14 @@ 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
-set g_balance_nex_velocitydependent_falloff_rate 0.001
+set g_balance_nex_charge 0
+set g_balance_nex_charge_start 0
+set g_balance_nex_charge_rate 0.1
+set g_balance_nex_charge_limit 0.5
+set g_balance_nex_charge_shot_multiplier 0.5
+set g_balance_nex_charge_velocity_rate 0.2
+set g_balance_nex_charge_minspeed 400
+set g_balance_nex_charge_maxspeed 1000
 // }}}
 // {{{ minstanex
 set g_balance_minstanex_refire 1
index 966d58cbffaf6842582cf9877c9f0f008811f5ef..445e8b156bbde7da0e87cb2859f21a235cc64b68 100644 (file)
@@ -56,14 +56,19 @@ set g_balance_nix_ammoincr_fuel 2
 set g_pickup_ammo_anyway 0
 set g_pickup_weapons_anyway 0
 set g_pickup_shells 15
+set g_pickup_shells_weapon 15
 set g_pickup_shells_max 999
 set g_pickup_nails 80
+set g_pickup_nails_weapon 80
 set g_pickup_nails_max 999
 set g_pickup_rockets 15
+set g_pickup_rockets_weapon 15
 set g_pickup_rockets_max 999
 set g_pickup_cells 25
+set g_pickup_cells_weapon 25
 set g_pickup_cells_max 999
 set g_pickup_fuel 25
+set g_pickup_fuel_weapon 25
 set g_pickup_fuel_jetpack 50
 set g_pickup_fuel_max 999
 set g_pickup_armorsmall 5
@@ -424,8 +429,7 @@ set g_balance_nex_primary_damagefalloff_forcehalflife 1500
 
 set g_balance_nex_secondary 0
 set g_balance_nex_secondary_charge 0
-set g_balance_nex_secondary_charge_rate 200
-set g_balance_nex_secondary_charge_ammo 10
+set g_balance_nex_secondary_charge_rate 0.1
 set g_balance_nex_secondary_damage 90
 set g_balance_nex_secondary_force 200
 set g_balance_nex_secondary_refire 1.5
@@ -436,10 +440,14 @@ 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
-set g_balance_nex_velocitydependent_falloff_rate 0.001
+set g_balance_nex_charge 0
+set g_balance_nex_charge_start 0
+set g_balance_nex_charge_rate 0.1
+set g_balance_nex_charge_limit 0.5
+set g_balance_nex_charge_shot_multiplier 0.5
+set g_balance_nex_charge_velocity_rate 0.2
+set g_balance_nex_charge_minspeed 400
+set g_balance_nex_charge_maxspeed 1000
 // }}}
 // {{{ minstanex
 set g_balance_minstanex_refire 1
index 966f0b2dd0ee3f165c264f706d9d558cce72a66a..517f5c9cfbcb15c5daef1f99b74f27ed4e68ea0a 100644 (file)
@@ -56,14 +56,19 @@ set g_balance_nix_ammoincr_fuel 2
 set g_pickup_ammo_anyway 1
 set g_pickup_weapons_anyway 1
 set g_pickup_shells 30
+set g_pickup_shells_weapon 30
 set g_pickup_shells_max 120
 set g_pickup_nails 80
+set g_pickup_nails_weapon 80
 set g_pickup_nails_max 400
 set g_pickup_rockets 30
+set g_pickup_rockets_weapon 30
 set g_pickup_rockets_max 120
 set g_pickup_cells 50
+set g_pickup_cells_weapon 50
 set g_pickup_cells_max 200
 set g_pickup_fuel 25
+set g_pickup_fuel_weapon 25
 set g_pickup_fuel_jetpack 50
 set g_pickup_fuel_max 999
 set g_pickup_armorsmall 10
@@ -425,8 +430,7 @@ set g_balance_nex_primary_damagefalloff_forcehalflife 1500
 
 set g_balance_nex_secondary 0
 set g_balance_nex_secondary_charge 0
-set g_balance_nex_secondary_charge_rate 200
-set g_balance_nex_secondary_charge_ammo 10
+set g_balance_nex_secondary_charge_rate 0.1
 set g_balance_nex_secondary_damage 90
 set g_balance_nex_secondary_force 300
 set g_balance_nex_secondary_refire 1.5
@@ -437,10 +441,14 @@ 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
-set g_balance_nex_velocitydependent_falloff_rate 0.001
+set g_balance_nex_charge 0
+set g_balance_nex_charge_start 0
+set g_balance_nex_charge_rate 0.1
+set g_balance_nex_charge_limit 0.5
+set g_balance_nex_charge_shot_multiplier 0.5
+set g_balance_nex_charge_velocity_rate 0.2
+set g_balance_nex_charge_minspeed 400
+set g_balance_nex_charge_maxspeed 1000
 // }}}
 // {{{ minstanex
 set g_balance_minstanex_refire 1
index 08ee53140d88a60323a6fa79b6cc28acedc27c21..084810b55a679d4cac8355c9193f578145651465 100644 (file)
@@ -56,14 +56,19 @@ set g_balance_nix_ammoincr_fuel 2
 set g_pickup_ammo_anyway 1
 set g_pickup_weapons_anyway 1
 set g_pickup_shells 20
+set g_pickup_shells_weapon 10
 set g_pickup_shells_max 45
 set g_pickup_nails 120
+set g_pickup_nails_weapon 60
 set g_pickup_nails_max 300
 set g_pickup_rockets 25
+set g_pickup_rockets_weapon 15
 set g_pickup_rockets_max 150
 set g_pickup_cells 25
+set g_pickup_cells_weapon 15
 set g_pickup_cells_max 200
 set g_pickup_fuel 25
+set g_pickup_fuel_weapon 15
 set g_pickup_fuel_jetpack 50
 set g_pickup_fuel_max 100
 set g_pickup_armorsmall 5
@@ -270,7 +275,7 @@ set g_balance_uzi_bulletconstant 115 // 13.1qu
 // }}}
 // {{{ mortar // TODO
 set g_balance_grenadelauncher_primary_type 0
-set g_balance_grenadelauncher_primary_damage 60
+set g_balance_grenadelauncher_primary_damage 50
 set g_balance_grenadelauncher_primary_edgedamage 25
 set g_balance_grenadelauncher_primary_force 300
 set g_balance_grenadelauncher_primary_radius 100
@@ -290,7 +295,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 80
+set g_balance_grenadelauncher_secondary_damage 70
 set g_balance_grenadelauncher_secondary_edgedamage 32
 set g_balance_grenadelauncher_secondary_force 300
 set g_balance_grenadelauncher_secondary_radius 150
@@ -418,29 +423,32 @@ 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 500
-set g_balance_nex_primary_damagefalloff_maxdist 4500
-set g_balance_nex_primary_damagefalloff_halflife 2000
+set g_balance_nex_primary_damagefalloff_mindist 1000
+set g_balance_nex_primary_damagefalloff_maxdist 3000
+set g_balance_nex_primary_damagefalloff_halflife 1000
 set g_balance_nex_primary_damagefalloff_forcehalflife 2000
 
 set g_balance_nex_secondary 1
 set g_balance_nex_secondary_charge 1
-set g_balance_nex_secondary_charge_rate 200
-set g_balance_nex_secondary_charge_ammo 10
-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 500
-set g_balance_nex_secondary_damagefalloff_maxdist 4500
-set g_balance_nex_secondary_damagefalloff_halflife 4000
-set g_balance_nex_secondary_damagefalloff_forcehalflife 4000
+set g_balance_nex_secondary_charge_rate 0.15
+set g_balance_nex_secondary_damage 0
+set g_balance_nex_secondary_force 0
+set g_balance_nex_secondary_refire 0
+set g_balance_nex_secondary_animtime 0
+set g_balance_nex_secondary_ammo 4
+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 -500
-set g_balance_nex_velocitydependent_minspeed 400
-set g_balance_nex_velocitydependent_maxspeed 1000
-set g_balance_nex_velocitydependent_falloff_rate 40
+set g_balance_nex_charge 1
+set g_balance_nex_charge_start 0.2
+set g_balance_nex_charge_rate 0.05
+set g_balance_nex_charge_limit 0.5
+set g_balance_nex_charge_shot_multiplier 0.675
+set g_balance_nex_charge_velocity_rate 0.15
+set g_balance_nex_charge_minspeed 400
+set g_balance_nex_charge_maxspeed 1000
 // }}}
 // {{{ minstanex
 set g_balance_minstanex_refire 1.25
@@ -584,12 +592,12 @@ set g_balance_campingrifle_secondary_damage 50
 set g_balance_campingrifle_secondary_headshotaddeddamage 50 // 50 damage only on head
 set g_balance_campingrifle_secondary_spread 0
 set g_balance_campingrifle_secondary_force 2
-set g_balance_campingrifle_secondary_speed 30000
+set g_balance_campingrifle_secondary_speed 15000
 set g_balance_campingrifle_secondary_lifetime 5
 set g_balance_campingrifle_secondary_refire 1.5
 set g_balance_campingrifle_secondary_animtime 1.4
 set g_balance_campingrifle_secondary_ammo 10
-set g_balance_campingrifle_secondary_bulletconstant 130 // 18.3qu
+set g_balance_campingrifle_secondary_bulletconstant 130 // 10.3qu
 set g_balance_campingrifle_secondary_burstcost 0
 set g_balance_campingrifle_secondary_bullethail 0 // empty magazine on shot
 // }}}
index 15f9419fa73d85e5c919757c8c2fa2649c71a514..8d40e2ff4fddb2595154dfe0b7853e43bf9e5147 100644 (file)
@@ -249,6 +249,11 @@ v_deathtilt 0 // needed for spectators (who are dead to avoid prediction)
 cl_deathfade 1 // fade screen to dark red when dead, value represents how fast the fade is (higher is faster)
 cl_bobcycle 0 // how long the cycle of up/down view movement takes (only works if cl_bob is not 0), default is 0.6
 cl_bob 0.01 // how much view moves up/down when moving (does not move if cl_bobcycle is 0, but still enables cl_bobmodel), default is 0.02
+cl_bob2cycle 0 // how long the cycle of left/right view movement takes (only works if cl_bob2 is not 0), default is 0.6
+cl_bob2 0.01 // how much view moves left/right when moving (does not move if cl_bob2cycle is 0), default is 0.01
+cl_bobfall 0.05 "how much the view swings down when falling (influenced by the speed you hit the ground with)"
+cl_bobfallcycle 3 "speed of the bobfall swing"
+cl_bobfallspeed 200 "necessary amount of speed for bob-falling to occur"
 cl_bobmodel 1 // whether to have gun model move around on screen when moving (only works if cl_bob is not 0), default is 1
 cl_leanmodel 1 // enables weapon leaning effect when looking around
 cl_leanmodel_side_speed 0.7 "gun leaning sideways speed"
@@ -1274,6 +1279,7 @@ set cl_gravity 800        "but ignored anyway"
 set g_ban_default_bantime 5400 "90 minutes"
 set g_ban_default_masksize 3   "masksize 0 means banning by UID only, 1 means banning by /8 (IPv6: /32) network, 2 means banning by /16 (IPv6: /48) network, 3 means banning by /24 (IPv6: /56) network, 4 means banning by single IP (IPv6: /64 network)"
 set g_banned_list ""   "format: IP remainingtime IP remainingtime ..."
+set g_banned_list_idmode "1"   "when set, the IP banning system always uses the ID over the IP address (so a user in a banned IP range can connect if they have a valid signed ID)"
 alias bans "sv_cmd bans"
 alias ban "sv_cmd ban $*"         // usage: ban address(maybe incomplete, like 1.2.3) bantime(seconds)
 alias kickban "sv_cmd kickban $*" // usage: kickban # playerno bantime(seconds) masksize(bytes)
@@ -1335,7 +1341,7 @@ seta menu_sounds 0 "enables menu sound effects. 1 enables click sounds, 2 also e
 r_textbrightness 0.2
 r_textcontrast 0.8
 r_textshadow 0
-r_font_postprocess_blur 2
+r_font_postprocess_blur 1
 r_font_postprocess_outline 1
 
 // good settings for these fonts
@@ -1478,6 +1484,7 @@ set con_completion_gotomap        map
 set con_completion_vmap                map
 set con_completion_vnextmap    map
 set con_completion_vdomap      map
+set con_completion_playermodel models/player/*.iqm
 
 // these non-saved engine cvars shall be savedG
 seta cl_port $cl_port
@@ -1965,3 +1972,10 @@ r_shadow_glossexact 1
 
 // use fake light if map has no lightmaps
 r_fakelight 1
+
+// strength sound settings
+set sv_strengthsound_antispam_time 0.1 "minimum distance of strength sounds"
+set sv_strengthsound_antispam_refire_threshold 0.04 "apply minimum distance only if refire of the gun is smaller than this"
+
+// equalize looks better than fullbright
+r_equalize_entities_fullbright 1
index e78e636a4501e04e2e69c69259a01d415e1e06c3..b36570aab4865bcd52cdabb25186d7b059b04fd9 100644 (file)
@@ -4676,8 +4676,8 @@ trailspacing 16
 type static
 color 0x202020 0x404040
 size 2 2
-sizeincrease 2
-alpha 256 256 512
+sizeincrease 0.2
+alpha 256 256 256
 airfriction -4
 velocityjitter 4 4 4
 type smoke
@@ -4688,7 +4688,7 @@ type bubble
 tex 62 62
 color 0x404040 0x808080
 size 1 1
-alpha 256 256 256
+alpha 256 256 128
 gravity -0.125
 bounce 1.5
 liquidfriction 4
index 0afeae40364d19df69c2f5aadfb4bd9ee3d38c17..02ab1eed3023fd8afa26d10225bff345ae0b9bf4 100644 (file)
Binary files a/models/turrets/hellion.md3 and b/models/turrets/hellion.md3 differ
index 59a7074d7243578d95cd32b57918c9c3cd9a84c5..e816fe221a13bc4994deb8aaf2f90318b1364e38 100644 (file)
@@ -261,12 +261,7 @@ vector w_org, w_backoff;
 float campingrifle_scope;
 float nex_scope;
 
-float nex_velocitydependent;
-float nex_minvelocity;
-float nex_maxvelocity;
-float nex_speed_falloff_rate;
-float nex_speed;
-float nex_charge;
-float nex_charge_rate;
-
 float cr_maxbullets;
+
+float bgmtime;
+
index 79881410d8f9e0123472d6615d9df3652b604ea0..9ed7d92e3630a5c6e115c3c044ba98390f7b8fd7 100644 (file)
@@ -148,23 +148,6 @@ void CSQC_Init(void)
        }
        Tuba_Precache();
 
-#ifdef UID
-       {
-               // find the user ID
-               string uid;
-               registercvar("_cl_userid", "", CVAR_SAVE);
-               uid = cvar_string("_cl_userid");
-               if(strlen(uid) < 16)
-               {
-                       uid = "";
-                       for(i = 0; i < 4; ++i)
-                               uid = strcat(uid, substring(ftos(floor(10000 + random() * 10000)), 1, -1));
-               }
-               cvar_set("_cl_userid", uid);
-               localcmd(strcat("\ncmd uid ", uid, "\n"));
-       }
-#endif
-
        get_mi_min_max_texcoords(1); // try the CLEVER way first
        minimapname = strcat("gfx/", mi_shortname, "_radar.tga");
        shortmapname = mi_shortname;
@@ -457,7 +440,9 @@ void ShotOrg_Draw()
        self.angles = view_angles;
        self.angles_x = -self.angles_x;
        if not(self.cnt)
-               R_AddEntity(self);
+               self.drawmask = MASK_NORMAL;
+       else
+               self.drawmask = 0;
 }
 void ShotOrg_Draw2D()
 {
@@ -504,11 +489,12 @@ void DrawDebugModel()
        if(time - floor(time) > 0.5)
        {
                PolyDrawModel(self);
+               self.drawmask = 0;
        }
        else
        {
                self.renderflags = 0;
-               R_AddEntity(self);
+               self.drawmask = MASK_NORMAL;
        }
 }
 
@@ -1351,15 +1337,6 @@ float CSQC_Parse_TempEntity()
                        Net_WeaponComplain();
                        bHandled = true;
                        break;
-               case TE_CSQC_NEX_VELOCITY:
-                       nex_velocitydependent = ReadByte();
-                       nex_minvelocity = ReadShort();
-                       nex_maxvelocity = ReadShort();
-                       nex_speed_falloff_rate = ReadByte();
-                       nex_charge = ReadByte();
-                       nex_charge_rate = ReadByte();
-                       bHandled = true;
-                       break;
                case TE_CSQC_CR_MAXBULLETS:
                        cr_maxbullets = ReadByte();
                        bHandled = true;
index b57ef2ca176da6c6aef8c047e4ec2dede8deb56e..ea257312ac85206139a4a19849e4d28111daf20e 100644 (file)
@@ -828,15 +828,8 @@ void CSQC_UpdateView(float w, float h)
                                float f, a;
                                wcross_size = drawgetimagesize(wcross_name) * wcross_scale;
 
-                               float xyspeed;
-                               xyspeed = vlen('1 0 0' * pmove_vel_x + '0 1 0' * pmove_vel_y);
-                               if(xyspeed > nex_speed)
-                                       nex_speed = min(xyspeed, nex_maxvelocity);
-                               else
-                                       nex_speed = max(nex_minvelocity, nex_speed - nex_speed_falloff_rate * frametime);
-
-                               if (activeweapon == WEP_NEX && button_attack2 && nex_charge && getstati(GetAmmoStat(3)))
-                                       nex_speed = min(nex_maxvelocity, nex_speed + nex_charge_rate * frametime);
+                               float nex_charge;
+                               nex_charge = getstatf(STAT_NEX_CHARGE);
 
                                // ring around crosshair representing bullets left in camping rifle clip
                                if (activeweapon == WEP_CAMPINGRIFLE && cr_maxbullets)
@@ -847,12 +840,10 @@ void CSQC_UpdateView(float w, float h)
                                        a = cvar("crosshair_campingrifle_bulletcounter_alpha");
                                        DrawCircleClippedPic(wcross_origin, wcross_size_x * ring_scale, "gfx/crosshair_ring.tga", f, wcross_color, wcross_alpha * a, DRAWFLAG_ADDITIVE);
                                }
-                               else if (activeweapon == WEP_NEX && nex_velocitydependent && nex_speed > nex_minvelocity) // ring around crosshair representing velocity-dependent damage for the nex
+                               else if (activeweapon == WEP_NEX && nex_charge) // ring around crosshair representing velocity-dependent damage for the nex
                                {
-                                       f = bound(0, (nex_speed - nex_minvelocity) / (nex_maxvelocity - nex_minvelocity), 1);
-
                                        a = cvar("crosshair_nexvelocity_alpha");
-                                       DrawCircleClippedPic(wcross_origin, wcross_size_x * ring_scale, "gfx/crosshair_ring.tga", f, wcross_color, wcross_alpha * a, DRAWFLAG_ADDITIVE);
+                                       DrawCircleClippedPic(wcross_origin, wcross_size_x * ring_scale, "gfx/crosshair_ring.tga", nex_charge, wcross_color, wcross_alpha * a, DRAWFLAG_ADDITIVE);
                                }
 
 #define CROSSHAIR_DO_BLUR(M,sz,wcross_name,wcross_alpha) \
index 587a2e96cf8ac289bf287905ce5560c7eb17ab65..c23b425ae9d2e4edd0ace7c0cd77ec703b06b7ed 100644 (file)
@@ -167,7 +167,6 @@ float GetTimeForAmplitude(entity e, float amp)
 
 float BGMScript(entity e)
 {
-       float t;
        float amp, vel;
 
        if(e.bgmscript == "")
@@ -178,34 +177,33 @@ float BGMScript(entity e)
 
        e.just_toggled = FALSE;
 
-       t = gettime(GETTIME_CDTRACK);
-       if(t < 0)
+       if(bgmtime < 0)
                return -1;
 
-       if(t < e.bgmscripttime)
+       if(bgmtime < e.bgmscripttime)
        {
                //print("reset ", e.bgmscript, "\n");
                amp = GetCurrentAmplitude(e, e.bgmscripttime - e.bgmscriptstatetime + drawframetime);
 
                e.bgmscriptline = e.bgmscriptline0;
-               e.bgmscripttime = t;
+               e.bgmscripttime = bgmtime;
 
                // treat this as a stop event for all notes, to prevent sticking keys
                e.bgmscriptstate = FALSE;
                e.bgmscriptvolume = 1;
-               e.bgmscriptstatetime = t - GetTimeForAmplitude(e, amp);
+               e.bgmscriptstatetime = bgmtime - GetTimeForAmplitude(e, amp);
        }
 
        // find the CURRENT line
        for(;;)
        {
                tokenize_console(bufstr_get(bgmscriptbuf, e.bgmscriptline));
-               if(stof(argv(1)) >= t || argv(0) != e.bgmscript)
+               if(stof(argv(1)) >= bgmtime || argv(0) != e.bgmscript)
                {
-                       e.bgmscripttime = t;
-                       return GetCurrentAmplitude(e, t - e.bgmscriptstatetime);
+                       e.bgmscripttime = bgmtime;
+                       return GetCurrentAmplitude(e, bgmtime - e.bgmscriptstatetime);
                }
-               else if(t >= stof(argv(1)))
+               else if(bgmtime >= stof(argv(1)))
                {
                        e.bgmscriptline += 1;
                        e.bgmscripttime = stof(argv(1));
index e8e3073b80b02d6d1b9292d96820b9d28c71e3d5..348e4a1a6ebefd8b2820168fe2b65a2616a20d81 100644 (file)
@@ -20,9 +20,10 @@ void Casing_Draw()
        self.alpha = bound(0, self.cnt - time, 1);
 
        if(self.alpha < ALPHA_MIN_VISIBLE)
+       {
                Casing_Delete();
-       else
-               R_AddEntity(self);
+               self.drawmask = 0;
+       }
 }
 
 void Casing_Touch()
@@ -85,6 +86,7 @@ void Ent_Casing(float isNew)
        casing.angles_x = ReadByte() * 360 / 256;
        casing.angles_y = ReadByte() * 360 / 256;
        casing.angles_z = ReadByte() * 360 / 256;
+       casing.drawmask = MASK_NORMAL;
 
        if(cvar("cl_casings") && isNew) {
                casing.draw = Casing_Draw;
index f395fb6a7ba99cc8f07df85034c4a0126bfb366a..78826f8f34925e63b7e38954d0ea623f2773ee8b 100644 (file)
@@ -97,9 +97,10 @@ void Gib_Draw()
        self.alpha = bound(0, self.nextthink - time, 1);
 
        if(self.alpha < ALPHA_MIN_VISIBLE)
+       {
+               self.drawmask = 0;
                Gib_Delete();
-       else
-               R_AddEntity(self);
+       }
 }
 
 void TossGib (string mdlname, vector org, vector vconst, vector vrand, float specnum, float destroyontouch, float issilent)
@@ -130,6 +131,7 @@ void TossGib (string mdlname, vector org, vector vconst, vector vrand, float spe
        gib.damageforcescale = cvar_or("cl_gibs_damageforcescale", 3.5);
 
        gib.nextthink = time + cvar_or("cl_gibs_lifetime", 14) * (1 + prandom() * 0.15);
+       gib.drawmask = MASK_NORMAL;
 
        RubbleLimit("gib", cvar_or("cl_gibs_maxcount",100), Gib_Delete);
 }
index 5ee28b0fd22f8d9fa803f6db9d791166fbaf91c6..f96d3d7f96887ad3246e989bb8de25e18868dca8 100644 (file)
@@ -6,15 +6,17 @@
 .float itime1, itime2;
 void InterpolateOrigin_Reset()
 {
-       self.iflags &~= (IFLAG_PREVALID | IFLAG_VALID);
+       self.iflags &~= IFLAG_INTERNALMASK;
        self.itime1 = self.itime2 = 0;
 }
 void InterpolateOrigin_Note()
 {
        float dt;
+       float f0;
 
        dt = time - self.itime2;
 
+       f0 = self.iflags;
        if(self.iflags & IFLAG_PREVALID)
                self.iflags |= IFLAG_VALID;
        else
@@ -30,8 +32,16 @@ void InterpolateOrigin_Note()
        if(self.iflags & IFLAG_ANGLES)
        {
                fixedmakevectors(self.angles);
-               self.iforward1 = self.iforward2;
-               self.iup1 = self.iup2;
+               if(f0 & IFLAG_VALID)
+               {
+                       self.iforward1 = self.iforward2;
+                       self.iup1 = self.iup2;
+               }
+               else
+               {
+                       self.iforward1 = v_forward;
+                       self.iup1 = v_up;
+               }
                self.iforward2 = v_forward;
                self.iup2 = v_up;
        }
index 6703b1b11f82ad1b96d7e387d33b36d2b44b7996..0880ddc4b26548f66cfd5d99c2a049a5b7d6e12d 100644 (file)
@@ -22,14 +22,29 @@ void Draw_Laser()
        InterpolateOrigin_Do();
        if(self.count & 0x80)
        {
-               traceline(self.origin, self.velocity, 0, self);
+               if(self.count & 0x10)
+               {
+                       trace_endpos = self.velocity,
+                       trace_dphitq3surfaceflags = 0;
+               }
+               else
+                       traceline(self.origin, self.velocity, 0, self);
        }
        else
        {
-               makevectors(self.angles);
-               traceline(self.origin, self.origin + v_forward * 32768, 0, self);
-               if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_SKY)
+               if(self.count & 0x10)
+               {
+                       makevectors(self.angles);
                        trace_endpos = self.origin + v_forward * 1048576;
+                       trace_dphitq3surfaceflags = Q3SURFACEFLAG_SKY;
+               }
+               else
+               {
+                       makevectors(self.angles);
+                       traceline(self.origin, self.origin + v_forward * 32768, 0, self);
+                       if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_SKY)
+                               trace_endpos = self.origin + v_forward * 1048576;
+               }
        }
        if(self.scale != 0)
        {
@@ -58,7 +73,7 @@ void Ent_Laser()
 
        // 30 bytes, or 13 bytes for just moving
        f = ReadByte();
-       self.count = (f & 0xE0);
+       self.count = (f & 0xF0);
 
        if(self.count & 0x80)
                self.iflags = IFLAG_VELOCITY;
@@ -87,7 +102,10 @@ void Ent_Laser()
                        self.scale *= ReadByte() / 16.0; // beam radius
                        self.modelscale *= ReadByte() / 16.0; // dlight radius
                }
-               self.cnt = ReadShort() - 1; // effect number
+               if((f & 0x80) || !(f & 0x10))
+                       self.cnt = ReadShort() - 1; // effect number
+               else
+                       self.cnt = 0;
        }
        if(f & 2)
        {
index 7652577321d18ad37c3fdb07da2c2b8a1d06f02e..1b546534919412bfb7f92bb48ac6d71ed00014d6 100644 (file)
@@ -14,9 +14,12 @@ void ModelEffect_Draw()
                remove(self);
                return;
        }
+       self.drawmask = MASK_NORMAL;
        if(self.scale <= 0)
+       {
+               self.drawmask = 0;
                return;
-       R_AddEntity(self);
+       }
 }
 
 void Ent_ModelEffect(float isNew)
index d4a95b7754cddc37b6522ffa80d0930c2081d4f1..e9a02631f2e572c43c954b3a7c202201e1d0b316 100644 (file)
@@ -286,14 +286,18 @@ void Net_ReadZCurveParticles()
 void Net_ReadNexgunBeamParticle()
 {
        vector shotorg, endpos;
+       float charge;
        shotorg_x = ReadCoord(); shotorg_y = ReadCoord(); shotorg_z = ReadCoord();
        endpos_x = ReadCoord(); endpos_y = ReadCoord(); endpos_z = ReadCoord();
+       charge = ReadByte() / 255.0;
        
        pointparticles(particleeffectnum("nex_muzzleflash"), shotorg, normalize(endpos - shotorg) * 1000, 1);
        
        //draw either the old v2.3 beam or the new beam
+       charge = sqrt(charge); // divide evenly among trail spacing and alpha
+       particles_alphamin = particles_alphamax = charge;
        if (cvar("cl_particles_oldnexbeam") && (getstati(STAT_ALLOW_OLDNEXBEAM) || isdemo()))
-               WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3"), shotorg, endpos);
+               WarpZone_TrailParticles_WithMultiplier(world, particleeffectnum("TE_TEI_G3"), shotorg, endpos, charge, 1);
        else
-               WarpZone_TrailParticles(world, particleeffectnum("nex_beam"), shotorg, endpos);
+               WarpZone_TrailParticles_WithMultiplier(world, particleeffectnum("nex_beam"), shotorg, endpos, charge, 1);
 }
index 39aabc44adf4a430f357c0e6e82d4a6d07e596ef..fb07b21b8fd18473dfdb9168d5b56b4342b5873d 100644 (file)
@@ -139,6 +139,8 @@ void Projectile_Draw()
        else
                Projectile_ResetTrail(trailorigin);
 
+       self.drawmask = 0;
+
        if(!drawn)
                return;
 
@@ -152,7 +154,7 @@ void Projectile_Draw()
                        break;
        }
 
-       R_AddEntity(self);
+       self.drawmask = MASK_NORMAL;
 }
 
 void loopsound(entity e, float ch, string samp, float vol, float attn)
index a7a46d80ad5788c19e58e649c7d25c0a147b1376..b1957038eb4eb9b7c1a97574713ceed3e42bf2e4 100644 (file)
@@ -50,6 +50,11 @@ void TargetMusic_Advance()
                }
        }
        music_trigger = world;
+
+       if(best)
+               bgmtime = getsoundtime(best, CHAN_VOICE);
+       else
+               bgmtime = gettime(GETTIME_CDTRACK);
 }
 
 void Net_TargetMusic()
index 7690c05f8d1f10006e898c4644f7f686732b53ca..1c30f4eec289b6b3cedd9aefc6b08390cbc52373 100644 (file)
@@ -1,20 +1,52 @@
 .float lip;
 .float bgmscriptangular;
+.float lodmodelindex0, lodmodelindex1, lodmodelindex2;
+.float loddistance1, loddistance2;
+.vector saved;
 
 void Ent_Wall_Draw()
 {
        float f;
+       float d;
        vector save;
        var .vector fld;
 
+       if(self.bgmscriptangular)
+               self.angles = self.saved;
+       else
+               self.origin = self.saved;
+
+       if(self.lodmodelindex1)
+       {
+               d = cvar("loddebug");
+               if(d > 0)
+               {
+                       if(d == 1)
+                               self.modelindex = self.lodmodelindex0;
+                       else if(d == 2 || !self.lodmodelindex2)
+                               self.modelindex = self.lodmodelindex1;
+                       else // if(d == 3)
+                               self.modelindex = self.lodmodelindex2;
+               }
+               else
+               {
+                       d = vlen(NearestPointOnBox(self, view_origin) - view_origin);
+                       if(d < self.loddistance1)
+                               self.modelindex = self.lodmodelindex0;
+                       else if(!self.lodmodelindex2 || d < self.loddistance2)
+                               self.modelindex = self.lodmodelindex1;
+                       else
+                               self.modelindex = self.lodmodelindex2;
+               }
+       }
+
        InterpolateOrigin_Do();
 
        if(self.bgmscriptangular)
-               fld = angles;
+               self.saved = self.angles;
        else
-               fld = origin;
-       
-       save = self.fld;
+               self.saved = self.origin;
+
        f = BGMScript(self);
        if(f >= 0)
        {
@@ -28,9 +60,9 @@ void Ent_Wall_Draw()
                self.alpha = 1;
 
        if(self.alpha >= ALPHA_MIN_VISIBLE)
-               R_AddEntity(self);
-
-       self.fld = save;
+               self.drawmask = MASK_NORMAL;
+       else
+               self.drawmask = 0;
 }
 
 void Ent_Wall_Remove()
@@ -46,6 +78,11 @@ void Ent_Wall()
        InterpolateOrigin_Undo();
        self.iflags = IFLAG_ANGLES;
 
+       if(self.bgmscriptangular)
+               self.angles = self.saved;
+       else
+               self.origin = self.saved;
+
        f = ReadByte();
 
        if(f & 1)
@@ -77,7 +114,20 @@ void Ent_Wall()
 
        if(f & 8)
        {
-               self.modelindex = ReadShort();
+               if(f & 0x80)
+               {
+                       self.lodmodelindex0 = ReadShort();
+                       self.loddistance1 = ReadShort();
+                       self.lodmodelindex1 = ReadShort();
+                       self.loddistance2 = ReadShort();
+                       self.lodmodelindex2 = ReadShort();
+               }
+               else
+               {
+                       self.modelindex = ReadShort();
+                       self.loddistance1 = 0;
+                       self.loddistance2 = 0;
+               }
                self.solid = ReadByte();
                self.scale = ReadShort() / 256.0;
                if(f & 0x20)
@@ -121,6 +171,11 @@ void Ent_Wall()
 
        InterpolateOrigin_Note();
 
+       if(self.bgmscriptangular)
+               self.saved = self.angles;
+       else
+               self.saved = self.origin;
+
        self.entremove = Ent_Wall_Remove;
        self.draw = Ent_Wall_Draw;
 }
index a001732da2553a9411b4fdf4e09793dfe7d2ba7f..07e9127827dc0131c43a9874c4e4bfca87f23e2c 100644 (file)
@@ -431,6 +431,7 @@ void WaypointSprite_Load()
        {
                float dh, n, i, o, f;
                string s, sname, sframes;
+
                dh = search_begin("models/sprites/*_frame*.tga", FALSE, FALSE);
                n = search_getsize(dh);
                for(i = 0; i < n; ++i)
@@ -445,6 +446,21 @@ void WaypointSprite_Load()
                        db_put(tempdb, sname, ftos(max(f, stof(db_get(tempdb, sname)))));
                }
                search_end(dh);
+
+               dh = search_begin("models/sprites/*_frame*.jpg", FALSE, FALSE);
+               n = search_getsize(dh);
+               for(i = 0; i < n; ++i)
+               {
+                       s = search_getfilename(dh, i);
+                       s = substring(s, 15, strlen(s) - 15 - 4); // strip models/sprites/ and .jpg
+
+                       o = strstrofs(s, "_frame", 0);
+                       sname = strcat("/spriteframes/", substring(s, 0, o));
+                       sframes = substring(s, o + 6, strlen(s) - o - 6);
+                       f = stof(sframes) + 1;
+                       db_put(tempdb, sname, ftos(max(f, stof(db_get(tempdb, sname)))));
+               }
+               search_end(dh);
        }
        waypointsprite_initialized = 1;
 }
index 5e8dff7dca2645fb81564d3c243c09381ca15a9d..6f0eccfafb8af72f94a556ad5709a0554c0ccfab 100644 (file)
@@ -61,8 +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 TE_CSQC_CR_MAXBULLETS = 118;
+const float TE_CSQC_CR_MAXBULLETS = 117;
 
 const float RACE_NET_CHECKPOINT_HIT_QUALIFYING = 0; // byte checkpoint, short time, short recordtime, string recordholder
 const float RACE_NET_CHECKPOINT_CLEAR = 1;
@@ -310,6 +309,7 @@ const float STAT_NB_METERSTART = 45;
 const float STAT_SHOTORG = 46; // compressShotOrigin
 const float STAT_LEADLIMIT = 47;
 const float STAT_BULLETS_LOADED = 48;
+const float STAT_NEX_CHARGE = 49;
 
 // see DP source, quakedef.h
 const float STAT_MOVEVARS_AIRSPEEDLIMIT_NONQW = 222;
index 10b594320434f2d0bae15925d23063ac0537fcd1..835c58f64aec6baea33a728a6f97cded2194650d 100644 (file)
@@ -699,7 +699,7 @@ float MapInfo_Get_ByName(string pFilename, float pAllowGenerate, float pGametype
                        else
                                fputs(fh, strcat("cdtrack ", _MapInfo_Map_worldspawn_music, "\n"));
                }
-               else if(_MapInfo_Map_worldspawn_music)
+               else
                {
                        n = tokenize_console(cvar_string("g_cdtracks_remaplist"));
                        s = strcat(" ", cvar_string("g_cdtracks_dontusebydefault"), " ");
index f33512f2355f8823669f1140b691dfe779be7282..1efc0e3738a06a4d9e5c33cd5681571c0d1b0444 100644 (file)
@@ -1919,3 +1919,19 @@ vector vec2(vector v)
        v_z = 0;
        return v;
 }
+
+#ifndef MENUQC
+vector NearestPointOnBox(entity box, vector org)
+{
+       vector m1, m2, nearest;
+
+       m1 = box.mins + box.origin;
+       m2 = box.maxs + box.origin;
+
+       nearest_x = bound(m1_x, org_x, m2_x);
+       nearest_y = bound(m1_y, org_y, m2_y);
+       nearest_z = bound(m1_z, org_z, m2_z);
+
+       return nearest;
+}
+#endif
index 767092cc7532c689710cc82421abd15497d5d146..77b3e03202817a61ef6325761c764ce0de357aff 100644 (file)
@@ -238,3 +238,7 @@ switch(id) { \
 HUD_Panel_GetName_Part2(id)
 
 vector vec2(vector v);
+
+#ifndef MENUQC
+vector NearestPointOnBox(entity box, vector org);
+#endif
index 6d9d3345c30e0430ba892190176c3be584cd94b2..e325915c95e3791626f6c548f6b2383bbb9b0fee 100644 (file)
@@ -350,3 +350,12 @@ string(float, float) getgamedirinfo = #626;
 float log(float f) = #532;
 
 string(string format, ...) sprintf = #627;
+
+//DP_CRYPTO
+//idea: divVerent
+//darkplaces implementation: divVerent
+//field definitions: (MENUQC)
+string crypto_getkeyfp(string serveraddress) = #633; // retrieves the cached host key's CA fingerprint of a server given by IP address
+string crypto_getidfp(string serveraddress) = #634; // retrieves the cached host key fingerprint of a server given by IP address
+string crypto_getencryptlevel(string serveraddress) = #635; // 0 if never encrypting, 1 supported, 2 requested, 3 required, appended by list of allowed methods in order of preference ("AES128"), preceded by a space each
+//description:
index c3320e503874d751d0a1688c8fa9c986a851f0c0..b93ecaa7ce84d5f4cc63dd9099c78e1963b0e3f9 100644 (file)
@@ -220,6 +220,8 @@ SKINBEGIN
        SKINFLOAT(ALPHA_SERVERLIST_HIGHPING, 0.4);
        SKINFLOAT(ALPHA_SERVERLIST_FAVORITE, 0.8);
        SKINVECTOR(COLOR_SERVERLIST_FAVORITE, '1 1 1');
+       SKINFLOAT(ALPHA_SERVERLIST_IMPOSSIBLE, 0.7);
+       SKINVECTOR(COLOR_SERVERLIST_IMPOSSIBLE, '0.3 0.3 0.3');
 
        // item: server info
        SKINVECTOR(COLOR_SERVERINFO_NAME, '1 1 1');
index 7770230d316d1d39bc1930499e92c8291496fdb8..21eefeae6d72ef0ea83f5878215f6b85c7276321 100644 (file)
@@ -5,7 +5,7 @@ CLASS(XonoticServerInfoDialog) EXTENDS(XonoticDialog)
        ATTRIB(XonoticServerInfoDialog, title, string, "Server Information")
        ATTRIB(XonoticServerInfoDialog, color, vector, SKINCOLOR_DIALOG_SERVERINFO)
        ATTRIB(XonoticServerInfoDialog, intendedWidth, float, 0.68)
-       ATTRIB(XonoticServerInfoDialog, rows, float, 11)
+       ATTRIB(XonoticServerInfoDialog, rows, float, 14)
        ATTRIB(XonoticServerInfoDialog, columns, float, 12)
 
        ATTRIB(XonoticServerInfoDialog, currentServerName, string, string_null)
@@ -18,6 +18,10 @@ CLASS(XonoticServerInfoDialog) EXTENDS(XonoticDialog)
        ATTRIB(XonoticServerInfoDialog, currentServerMod, string, string_null)
        ATTRIB(XonoticServerInfoDialog, currentServerVersion, string, string_null)
        ATTRIB(XonoticServerInfoDialog, currentServerPing, string, string_null)
+       ATTRIB(XonoticServerInfoDialog, currentServerKey, string, string_null)
+       ATTRIB(XonoticServerInfoDialog, currentServerID, string, string_null)
+       ATTRIB(XonoticServerInfoDialog, currentServerEncrypt, string, string_null)
+       ATTRIB(XonoticServerInfoDialog, currentServerCanConnect, string, string_null)
 
        ATTRIB(XonoticServerInfoDialog, nameLabel, entity, NULL)
        ATTRIB(XonoticServerInfoDialog, cnameLabel, entity, NULL)
@@ -29,6 +33,10 @@ CLASS(XonoticServerInfoDialog) EXTENDS(XonoticDialog)
        ATTRIB(XonoticServerInfoDialog, modLabel, entity, NULL)
        ATTRIB(XonoticServerInfoDialog, versionLabel, entity, NULL)
        ATTRIB(XonoticServerInfoDialog, pingLabel, entity, NULL)
+       ATTRIB(XonoticServerInfoDialog, keyLabel, entity, NULL)
+       ATTRIB(XonoticServerInfoDialog, idLabel, entity, NULL)
+       ATTRIB(XonoticServerInfoDialog, encryptLabel, entity, NULL)
+       ATTRIB(XonoticServerInfoDialog, canConnectLabel, entity, NULL)
 ENDCLASS(XonoticServerInfoDialog)
 
 float SLIST_FIELD_NAME;
@@ -74,7 +82,6 @@ void XonoticServerInfoDialog_loadServerInfo(entity me, float i)
        me.currentServerType = strzone(typestr);
        me.typeLabel.setText(me.typeLabel, me.currentServerType);
 
-
        SLIST_FIELD_MAP = gethostcacheindexforkey("map");
        me.currentServerMap = strzone(gethostcachestring(SLIST_FIELD_MAP, i));
        me.mapLabel.setText(me.mapLabel, me.currentServerMap);
@@ -106,6 +113,51 @@ void XonoticServerInfoDialog_loadServerInfo(entity me, float i)
        s = ftos(gethostcachenumber(SLIST_FIELD_PING, i));
        me.currentServerPing = strzone(s);
        me.pingLabel.setText(me.pingLabel, me.currentServerPing);
+
+       print(me.currentServerCName, "\n");
+
+       s = crypto_getidfp(me.currentServerCName);
+       if not(s)
+               s = "N/A";
+       me.currentServerID = strzone(s);
+       me.idLabel.setText(me.idLabel, me.currentServerID);
+
+       s = crypto_getkeyfp(me.currentServerCName);
+       if not(s)
+               s = "N/A";
+       me.currentServerKey = strzone(s);
+       me.keyLabel.setText(me.keyLabel, me.currentServerKey);
+
+       s = crypto_getencryptlevel(me.currentServerCName);
+       if(s == "")
+       {
+               if(cvar("crypto_aeslevel") >= 3)
+                       me.currentServerEncrypt = "N/A (can't connect)";
+               else
+                       me.currentServerEncrypt = "N/A";
+       }
+       else switch(stof(substring(s, 0, 1)))
+       {
+               case 0:
+                       if(cvar("crypto_aeslevel") >= 3)
+                               me.currentServerEncrypt = "not supported (can't connect)";
+                       else
+                               me.currentServerEncrypt = "not supported";
+                       break;
+               case 1:
+                       me.currentServerEncrypt = "supported";
+                       break;
+               case 2:
+                       me.currentServerEncrypt = "requested";
+                       break;
+               case 3:
+                       if(cvar("crypto_aeslevel") <= 0)
+                               me.currentServerEncrypt = "required (can't connect)";
+                       else
+                               me.currentServerEncrypt = "required";
+                       break;
+       }
+       me.encryptLabel.setText(me.encryptLabel, me.currentServerEncrypt);
 }
 
 void XonoticServerInfoDialog_fill(entity me)
@@ -166,6 +218,24 @@ void XonoticServerInfoDialog_fill(entity me)
                        e.allowCut = 1;
                        me.pingLabel = e;
 
+       me.TR(me);
+               me.TD(me, 1, 1.75, e = makeXonoticTextLabel(0, "CA:"));
+               me.TD(me, 1, 4.0, e = makeXonoticTextLabel(0, ""));
+                       e.allowCut = 1;
+                       me.keyLabel = e;
+
+       me.TR(me);
+               me.TD(me, 1, 1.75, e = makeXonoticTextLabel(0, "Key:"));
+               me.TD(me, 1, 4.0, e = makeXonoticTextLabel(0, ""));
+                       e.allowCut = 1;
+                       me.idLabel = e;
+
+       me.TR(me);
+               me.TD(me, 1, 1.75, e = makeXonoticTextLabel(0, "Encryption:"));
+               me.TD(me, 1, 4.0, e = makeXonoticTextLabel(0, ""));
+                       e.allowCut = 1;
+                       me.encryptLabel = e;
+
        me.gotoRC(me, me.rows - 1, 0);
 
                me.TD(me, 1, me.columns - 6, e = makeXonoticButton("Close", '0 0 0'));
index d721c2555e2dbae45621da79f75b5d4601c88978..95e1f80b81d2971d37658f40ae85da4c1e7448b5 100644 (file)
@@ -95,41 +95,76 @@ void ServerList_UpdateFieldIDs()
 
 float IsFavorite(string srv)
 {
+       string p;
        float i, n;
+       if(srv == "")
+               return FALSE;
        srv = netaddress_resolve(srv, 26000);
+       p = crypto_getidfp(srv);
        n = tokenize_console(cvar_string("net_slist_favorites"));
        for(i = 0; i < n; ++i)
-               if(srv == netaddress_resolve(argv(i), 26000))
-                       return TRUE;
+       {
+               if(substring(argv(i), 0, 1) != "[" && strlen(argv(i)) == 44 && strstrofs(argv(i), ".", 0) < 0)
+               {
+                       if(p)
+                               if(argv(i) == p)
+                                       return TRUE;
+               }
+               else
+               {
+                       if(srv == netaddress_resolve(argv(i), 26000))
+                               return TRUE;
+               }
+       }
        return FALSE;
 }
 
 void ToggleFavorite(string srv)
 {
-       string s, s0, s1, s2, srv_resolved;
-       float i, n;
+       string s, s0, s1, s2, srv_resolved, p;
+       float i, n, f;
        srv_resolved = netaddress_resolve(srv, 26000);
+       p = crypto_getidfp(srv_resolved);
        s = cvar_string("net_slist_favorites");
        n = tokenize_console(s);
+       f = 0;
        for(i = 0; i < n; ++i)
-               if(srv_resolved == netaddress_resolve(argv(i), 26000))
+       {
+               if(substring(argv(i), 0, 1) != "[" && strlen(argv(i)) == 44 && strstrofs(argv(i), ".", 0) < 0)
                {
-                       s0 = s1 = s2 = "";
-                       if(i > 0)
-                               s0 = substring(s, 0, argv_end_index(i - 1));
-                       if(i < n-1)
-                               s2 = substring(s, argv_start_index(i + 1), -1);
-                       if(s0 != "" && s2 != "")
-                               s1 = " ";
-                       print("s0 = >>", s0, "<<\ns1 = >>", s1, "<<\ns2 = >>", s2, "<<\n");
-                       cvar_set("net_slist_favorites", strcat(s0, s1, s2));
-                       return;
+                       if(p)
+                               if(argv(i) != p)
+                                       continue;
                }
+               else
+               {
+                       if(srv_resolved != netaddress_resolve(argv(i), 26000))
+                               continue;
+               }
+               s0 = s1 = s2 = "";
+               if(i > 0)
+                       s0 = substring(s, 0, argv_end_index(i - 1));
+               if(i < n-1)
+                       s2 = substring(s, argv_start_index(i + 1), -1);
+               if(s0 != "" && s2 != "")
+                       s1 = " ";
+               cvar_set("net_slist_favorites", strcat(s0, s1, s2));
+               s = cvar_string("net_slist_favorites");
+               n = tokenize_console(s);
+               f = 1;
+               --i;
+       }
        
-       s1 = "";
-       if(s != "")
-               s1 = " ";
-       cvar_set("net_slist_favorites", strcat(s, " ", srv));
+       if(!f)
+       {
+               s1 = "";
+               if(s != "")
+                       s1 = " ";
+               if(p)
+                       cvar_set("net_slist_favorites", strcat(s, s1, p));
+               else
+                       cvar_set("net_slist_favorites", strcat(s, s1, srv));
+       }
 
        resorthostcache();
 }
@@ -517,7 +552,7 @@ void XonoticServerList_drawListBoxItem(entity me, float i, vector absSize, float
 {
        // layout: Ping, Server name, Map name, NP, TP, MP
        string s;
-       float p;
+       float p, q;
        vector theColor;
        float theAlpha;
 
@@ -556,6 +591,15 @@ void XonoticServerList_drawListBoxItem(entity me, float i, vector absSize, float
                theAlpha = theAlpha * (1 - SKINALPHA_SERVERLIST_FAVORITE) + SKINALPHA_SERVERLIST_FAVORITE;
        }
 
+       s = gethostcachestring(SLIST_FIELD_CNAME, i);
+       q = stof(substring(crypto_getencryptlevel(s), 0, 1));
+       if((q <= 0 && cvar("crypto_aeslevel") >= 3) || (q >= 3 && cvar("crypto_aeslevel") <= 0))
+       {
+               theColor = SKINCOLOR_SERVERLIST_IMPOSSIBLE;
+               theAlpha = SKINALPHA_SERVERLIST_IMPOSSIBLE;
+       }
+       // TODO show an icon for encryption status
+
        s = ftos(p);
        draw_Text(me.realUpperMargin * eY + (me.columnPingSize - draw_TextWidth(s, 0, me.realFontSize)) * eX, s, me.realFontSize, theColor, theAlpha, 0);
        s = draw_TextShortenToWidth(gethostcachestring(SLIST_FIELD_NAME, i), me.columnNameSize, 0, me.realFontSize);
index 7dc5520abfe036f2065f1acd66b526c0e9734645..df6c8d4b2a3f41e0793e271d8aae9a9b54512692 100644 (file)
@@ -6,18 +6,6 @@ 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);
-       WriteByte(MSG_ONE, bound(0, fabs(cvar("g_balance_nex_velocitydependent_halflife")), 1));
-       WriteShort(MSG_ONE, cvar("g_balance_nex_velocitydependent_minspeed"));
-       WriteShort(MSG_ONE, cvar("g_balance_nex_velocitydependent_maxspeed"));
-       WriteByte(MSG_ONE, cvar("g_balance_nex_velocitydependent_falloff_rate"));
-       WriteByte(MSG_ONE, cvar("g_balance_nex_secondary_charge"));
-       WriteByte(MSG_ONE, cvar("g_balance_nex_secondary_charge_rate"));
-}
-
 void send_CSQC_cr_maxbullets(entity e) {
        msg_entity = e;
        WriteByte(MSG_ONE, SVC_TEMPENTITY);
@@ -901,6 +889,8 @@ void PutClientInServer (void)
                        self.effects = 0;
                self.air_finished = time + 12;
                self.dmg = 2;
+               if(cvar("g_balance_nex_charge"))
+                       self.nex_charge = cvar("g_balance_nex_charge_start");
 
                if(inWarmupStage)
                {
@@ -1407,10 +1397,6 @@ Called when a client connects to the server
 string ColoredTeamName(float t);
 void DecodeLevelParms (void);
 //void dom_player_join_team(entity pl);
-#ifdef UID
-.float uid_kicktime;
-.string uid;
-#endif
 void ClientConnect (void)
 {
        float t;
@@ -1588,12 +1574,6 @@ void ClientConnect (void)
        else
                self.hitplotfh = -1;
 
-#ifdef UID
-       if(clienttype(self) == CLIENTTYPE_REAL)
-       if not(self.uid)
-               self.uid_kicktime = time + 60;
-#endif
-
        if(g_race || g_cts) {
                string rr;
                if(g_cts)
@@ -1617,7 +1597,6 @@ 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);
        send_CSQC_cr_maxbullets(self);
 
        CheatInitClient();
@@ -2934,16 +2913,6 @@ void PlayerPostThink (void)
                self.stat_count -= 1;
        }
 
-#ifdef UID
-       if(self.uid_kicktime)
-       if(time > self.uid_kicktime)
-       {
-               bprint("^3", self.netname, "^3 was kicked for missing UID.\n");
-               dropclient(self);
-               return;
-       }
-#endif
-
        if(sv_maxidle && frametime)
        {
                // WORKAROUND: only use dropclient in server frames (frametime set). Never use it in cl_movement frames (frametime zero).
index d9394deaf26a968573d2331a5c78d87d227a5ccd..b005dd5f3f20c575914e76107a7891ffd4198d07 100644 (file)
@@ -1326,14 +1326,16 @@ void SV_PlayerPhysics()
                }
        }
 
-       float f;
        float xyspeed;
-       f = cvar("g_balance_nex_velocitydependent_falloff_rate");
        xyspeed = vlen('1 0 0' * self.velocity_x + '0 1 0' * self.velocity_y);
-       if(xyspeed > self.nexspeed)
-               self.nexspeed = min(xyspeed, cvar("g_balance_nex_velocitydependent_maxspeed"));
-       else
-               self.nexspeed = max(cvar("g_balance_nex_velocitydependent_minspeed"), self.nexspeed - f * frametime);
+       if(self.weapon == WEP_NEX && cvar("g_balance_nex_charge") && cvar("g_balance_nex_charge_velocity_rate") && xyspeed > cvar("g_balance_nex_charge_minspeed"))
+       {
+               // add a maximum of charge_velocity_rate when going fast (f = 1), gradually increasing from minspeed (f = 0) to maxspeed
+               xyspeed = min(xyspeed, cvar("g_balance_nex_charge_maxspeed"));
+               f = (xyspeed - cvar("g_balance_nex_charge_minspeed")) / (cvar("g_balance_nex_charge_maxspeed") - cvar("g_balance_nex_charge_minspeed"));
+               // add the extra charge
+               self.nex_charge = min(1, self.nex_charge + cvar("g_balance_nex_charge_velocity_rate") * f * frametime);
+       }
 :end
        if(self.flags & FL_ONGROUND)
                self.lastground = time;
index c9a5dfc4aa1b9d61236355e94824506004053edb..4537573c5d57b28c6ed7757a4aea131bcd78d109 100644 (file)
@@ -130,6 +130,8 @@ vector w_shotend;
 // this function calculates w_shotorg and w_shotdir based on the weapon model
 // offset, trueaim and antilag, and won't put w_shotorg inside a wall.
 // make sure you call makevectors first (FIXME?)
+.float prevstrengthsound;
+.float prevstrengthsoundattempt;
 void W_SetupShot_Dir_ProjectileSize_Range(entity ent, vector s_forward, vector mi, vector ma, float antilag, float recoil, string snd, float maxdamage, float range)
 {
        float nudge = 1; // added to traceline target and subtracted from result
@@ -245,9 +247,18 @@ void W_SetupShot_Dir_ProjectileSize_Range(entity ent, vector s_forward, vector m
                sound (ent, CHAN_WEAPON, snd, VOL_BASE, ATTN_NORM);
        }
 
-       if (ent.items & IT_STRENGTH)
-       if (!g_minstagib)
-               sound (ent, CHAN_AUTO, "weapons/strength_fire.wav", VOL_BASE, ATTN_NORM);
+       if(ent.items & IT_STRENGTH)
+       if(!g_minstagib)
+       if(
+               (time > ent.prevstrengthsound + cvar("sv_strengthsound_antispam_time"))
+               ||
+               (time > ent.prevstrengthsoundattempt + cvar("sv_strengthsound_antispam_refire_threshold"))
+       ) // prevent insane sound spam
+       {
+               sound(ent, CHAN_AUTO, "weapons/strength_fire.wav", VOL_BASE, ATTN_NORM);
+               ent.prevstrengthsound = time;
+       }
+       ent.prevstrengthsoundattempt = time;
 
        // nudge w_shotend so a trace to w_shotend hits
        w_shotend = w_shotend + normalize(w_shotend - w_shotorg) * nudge;
@@ -1106,6 +1117,9 @@ float weapon_prepareattack_checkammo(float secondary)
                for(mine = world; (mine = find(mine, classname, "mine")); ) if(mine.owner == self)
                        return FALSE;
 
+               if(self.weapon == self.switchweapon) // only play once BEFORE starting to switch weapons
+                       sound (self, CHAN_AUTO, "weapons/dryfire.wav", VOL_BASE, ATTN_NORM);
+
                W_SwitchToOtherWeapon(self);
                return FALSE;
        }
index 171906428a39b2a29f146d811f3d97927a516196..a9fd886bfe9c331e34b7651faf4c4bca063703c5 100644 (file)
@@ -182,16 +182,6 @@ void SV_ParseClientCommand(string s) {
                        tokens = tokenize_console(s);
                }
                GetCvars(1);
-#ifdef UID
-       } else if(cmd == "uid") {
-               if not(self.uid)
-               {
-                       self.uid = strzone(argv(1));
-                       self.uid_kicktime = 0;
-                       print("Client ", etos(self), " has UID ", self.uid, "\n");
-                       Ban_MaybeEnforceBan(self);
-               }
-#endif
        } else if(cmd == "sentcvar") { // new system
                if(tokens == 2) // undefined cvar: use the default value on the server then
                {
index 679a1b445b019aadc29bdc713730910a617084ee..d1d86ed79a19703ceb266b0f5d8bf40e6836d7d2 100644 (file)
@@ -440,6 +440,7 @@ float next_pingtime;
 // TODO implemented fall and falling
 #define ALLPLAYERSOUNDS \
                _VOICEMSG(death) \
+               _VOICEMSG(fall) \
                _VOICEMSG(drown) \
                _VOICEMSG(gasp) \
                _VOICEMSG(jump) \
@@ -648,3 +649,5 @@ string deathmessage;
 .float active;
 .float (float act_state) setactive;
 .entity realowner;
+
+.float nex_charge;
index 18119546c63d1b82d5bd6a188961647d98f39968..b72a0500013dc8402a8257d8febd4baef1bd6f75 100644 (file)
@@ -2309,3 +2309,15 @@ float JOINTTYPE_HINGE2 = 5; // hinge2; uses origin (anchor), angles (axis1), vel
 //description:
 //various physics properties can be defined in an entity and are executed via
 //ODE
+
+//DP_CRYPTO
+//idea: divVerent
+//darkplaces implementation: divVerent
+//field definitions: (SVQC)
+.string crypto_keyfp; // fingerprint of CA key the player used to authenticate, or string_null if not verified
+.string crypto_mykeyfp; // fingerprint of CA key the server used to authenticate to the player, or string_null if not verified
+.string crypto_idfp; // fingerprint of ID used by the player entity, or string_null if not identified
+.string crypto_encryptmethod; // the string "AES128" if encrypting, and string_null if plaintext
+.string crypto_signmethod; // the string "HMAC-SHA256" if signing, and string_null if plaintext
+// there is no field crypto_myidfp, as that info contains no additional information the QC may have a use for
+//description:
index 7108fd3dbea18530d278c237c753405fe912db39..c7336356cae0363a2a8e79a4bd8bff10775c82e8 100644 (file)
@@ -850,20 +850,6 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
        }
 }
 
-vector NearestPointOnBox(entity box, vector org)
-{
-       vector m1, m2, nearest;
-
-       m1 = box.mins + box.origin;
-       m2 = box.maxs + box.origin;
-
-       nearest_x = bound(m1_x, org_x, m2_x);
-       nearest_y = bound(m1_y, org_y, m2_y);
-       nearest_z = bound(m1_z, org_z, m2_z);
-
-       return nearest;
-}
-
 void Damage_RecordDamage(entity attacker, float deathtype, float damage)
 {
        float weaponid;
@@ -1168,9 +1154,7 @@ void Fire_ApplyDamage(entity e)
        if not(Fire_IsBurning(e))
                return;
 
-       o = e.owner;
-       while(o.owner)
-               o = o.owner;
+       for(t = 0, o = e.owner; o.owner && t < 16; o = o.owner, ++t);
        if(clienttype(o) == CLIENTTYPE_NOTACLIENT)
                o = e.fire_owner;
 
index 0f0bba6e6d36fb335a5afa4485d6b2fd79e373f2..bc996fd321647183b1824eb233d052dae33e69a9 100644 (file)
@@ -57,6 +57,8 @@ float g_clientmodel_genericsendentity (entity to, float sf)
                sf |= 0x20;
        if(self.colormap != 0)
                sf |= 0x40;
+       if(self.lodmodelindex1)
+               sf |= 0x80;
        
        WriteByte(MSG_ENTITY, ENT_CLIENT_WALL);
        WriteByte(MSG_ENTITY, sf);
@@ -86,7 +88,16 @@ float g_clientmodel_genericsendentity (entity to, float sf)
 
        if(sf & 8)
        {
-               WriteShort(MSG_ENTITY, self.modelindex);
+               if(sf & 0x80)
+               {
+                       WriteShort(MSG_ENTITY, self.lodmodelindex0);
+                       WriteShort(MSG_ENTITY, bound(0, self.loddistance1, 65535));
+                       WriteShort(MSG_ENTITY, self.lodmodelindex1);
+                       WriteShort(MSG_ENTITY, bound(0, self.loddistance2, 65535));
+                       WriteShort(MSG_ENTITY, self.lodmodelindex2);
+               }
+               else
+                       WriteShort(MSG_ENTITY, self.modelindex);
                WriteByte(MSG_ENTITY, self.solid);
                WriteShort(MSG_ENTITY, floor(self.scale * 256));
                if(sf & 0x20)
@@ -124,7 +135,7 @@ float g_clientmodel_genericsendentity (entity to, float sf)
        if(!self.solid) self.solid = (sol); else if(self.solid < 0) self.solid = SOLID_NOT;
 
 #define G_CLIENTMODEL_INIT(sol) \
-       SetBrushEntityModelNoLOD(); \
+       SetBrushEntityModel(); \
        if(!self.scale) self.scale = self.modelscale; \
        self.use = g_clientmodel_setcolormaptoactivator; \
        InitializeEntity(self, g_clientmodel_dropbyspawnflags, INITPRIO_DROPTOFLOOR); \
index 1d1f0bb9bd0f1bfee26d37846ad17085026bbdb4..5d8401df98e934d637822e419582270db3484c14 100644 (file)
@@ -605,7 +605,6 @@ float angc (float a1, float a2)
 .float loddistance1;
 .float loddistance2;
 
-vector NearestPointOnBox(entity box, vector org);
 float LOD_customize()
 {
        float d;
@@ -615,7 +614,7 @@ float LOD_customize()
                d = cvar("loddebug");
                if(d == 1)
                        self.modelindex = self.lodmodelindex0;
-               else if(d == 2)
+               else if(d == 2 || !self.lodmodelindex2)
                        self.modelindex = self.lodmodelindex1;
                else // if(d == 3)
                        self.modelindex = self.lodmodelindex2;
@@ -695,7 +694,8 @@ void LODmodel_attach()
        }
 
        if(self.lodmodelindex1)
-               SetCustomizer(self, LOD_customize, LOD_uncustomize);
+               if not(self.SendEntity)
+                       SetCustomizer(self, LOD_customize, LOD_uncustomize);
 }
 
 void SetBrushEntityModel()
index a1ee74d4300439589790a925384997779f6c7de0..8ded34feae4e6fae28e931a5a18f85868c6dc8e0 100644 (file)
@@ -1076,13 +1076,15 @@ void misc_laser_think()
 float laser_SendEntity(entity to, float fl)
 {
        WriteByte(MSG_ENTITY, ENT_CLIENT_LASER);
-       fl = fl - (fl & 0xE0); // use that bit to indicate finite length laser
+       fl = fl - (fl & 0xF0); // use that bit to indicate finite length laser
        if(self.spawnflags & 2)
                fl |= 0x80;
        if(self.alpha)
                fl |= 0x40;
        if(self.scale != 1 || self.modelscale != 1)
                fl |= 0x20;
+       if(self.spawnflags & 4)
+               fl |= 0x10;
        WriteByte(MSG_ENTITY, fl);
        if(fl & 1)
        {
@@ -1102,7 +1104,8 @@ float laser_SendEntity(entity to, float fl)
                        WriteByte(MSG_ENTITY, bound(0, self.scale * 16.0, 255));
                        WriteByte(MSG_ENTITY, bound(0, self.modelscale * 16.0, 255));
                }
-               WriteShort(MSG_ENTITY, self.cnt + 1);
+               if((fl & 0x80) || !(fl & 0x10)) // effect doesn't need sending if the laser is infinite and has collision testing turned off
+                       WriteShort(MSG_ENTITY, self.cnt + 1);
        }
        if(fl & 2)
        {
@@ -1185,6 +1188,8 @@ void spawnfunc_misc_laser()
                self.scale = 1;
        if(!self.modelscale)
                self.modelscale = 1;
+       else if(self.modelscale < 0)
+               self.modelscale = 0;
        self.think = misc_laser_think;
        self.nextthink = time;
        InitializeEntity(self, misc_laser_init, INITPRIO_FINDTARGET);
@@ -1262,7 +1267,8 @@ void trigger_impulse_touch1()
     if(!pushdeltatime) return;
 
     other.velocity = other.velocity + normalize(targ.origin - self.origin) * str * pushdeltatime;
-       other.flags &~= FL_ONGROUND;
+    other.flags &~= FL_ONGROUND;
+    UpdateCSQCProjectile(other);
 }
 
 // Directionless (accelerator/decelerator) mode
@@ -1302,6 +1308,7 @@ void trigger_impulse_touch2()
 
     // div0: ticrate independent, 1 = identity (not 20)
     other.velocity = other.velocity * pow(self.strength, pushdeltatime);
+    UpdateCSQCProjectile(other);
 }
 
 // Spherical (gravity/repulsor) mode
@@ -1352,6 +1359,7 @@ void trigger_impulse_touch3()
         str = self.strength;
 
     other.velocity = other.velocity + normalize(other.origin - self.origin) * str * pushdeltatime;
+    UpdateCSQCProjectile(other);
 }
 
 /*QUAKED spawnfunc_trigger_impulse (.5 .5 .5) ?
index 9df213c1b8b3748ef74551d84b60239865dab0d3..f75b0ba49807b7461abdb782b4c5459155969959 100644 (file)
@@ -637,6 +637,8 @@ void spawnfunc_worldspawn (void)
        addstat(STAT_LEADLIMIT, AS_FLOAT, stat_leadlimit);
        addstat(STAT_BULLETS_LOADED, AS_INT, campingrifle_bulletcounter);
 
+       addstat(STAT_NEX_CHARGE, AS_FLOAT, nex_charge);
+
        // g_movementspeed hack
        addstat(STAT_MOVEVARS_AIRSPEEDLIMIT_NONQW, AS_FLOAT, stat_sv_airspeedlimit_nonqw);
        addstat(STAT_MOVEVARS_AIRACCEL_QW, AS_FLOAT, stat_sv_airaccel_qw);
@@ -1652,7 +1654,7 @@ float WinningCondition_Assault()
 
                        TeamScore_AddToTeam(assault_attacker_team, ST_ASSAULT_OBJECTIVES, 666 - TeamScore_AddToTeam(assault_attacker_team, ST_ASSAULT_OBJECTIVES, 0));
 
-                       if(ent.cnt == 1) // this was the second round
+                       if(ent.cnt == 1 || cvar("g_campaign")) // this was the second round
                        {
                                status = WINNING_YES;
                        }
index 1ec0f4d3eadc7903f1a6490903283213d50b288c..293a9b4e40497cf4a2302ecf3da74bd1e11c500d 100644 (file)
@@ -160,12 +160,15 @@ void OnlineBanList_URI_Get_Callback(float id, float status, string data)
                        continue;
 
                l = strlen(ip);
-               for(j = 0; j < l; ++j)
-                       if(strstrofs("0123456789.", substring(ip, j, 1), 0) == -1)
-                       {
-                               print("Invalid character ", substring(ip, j, 1), " in IP address ", ip, ". Skipping this ban.\n");
-                               goto skip;
-                       }
+               if(l != 44) // length 44 is a cryptographic ID
+               {
+                       for(j = 0; j < l; ++j)
+                               if(strstrofs("0123456789.", substring(ip, j, 1), 0) == -1)
+                               {
+                                       print("Invalid character ", substring(ip, j, 1), " in IP address ", ip, ". Skipping this ban.\n");
+                                       goto skip;
+                               }
+               }
 
                if(cvar("g_ban_sync_trusted_servers_verify"))
                        if((strstrofs(strcat(";", OnlineBanList_Servers, ";"), strcat(";", serverip, ";"), 0) == -1))
@@ -243,9 +246,7 @@ string ban_ip1;
 string ban_ip2;
 string ban_ip3;
 string ban_ip4;
-#ifdef UID
-string ban_uid;
-#endif
+string ban_idfp;
 
 void Ban_SaveBans()
 {
@@ -335,9 +336,10 @@ float Ban_GetClientIP(entity client)
        float i1, i2, i3, i4;
        string s;
 
-#ifdef UID
-       ban_uid = client.uid;
-#endif
+       if(client.crypto_keyfp)
+               ban_idfp = client.crypto_idfp;
+       else
+               ban_idfp = string_null;
 
        s = client.netaddress;
 
@@ -388,7 +390,7 @@ float Ban_GetClientIP(entity client)
 
 float Ban_IsClientBanned(entity client, float idx)
 {
-       float i, b, e;
+       float i, b, e, ipbanned;
        if(!ban_loaded)
                Ban_LoadBans();
        if(!Ban_GetClientIP(client))
@@ -403,20 +405,22 @@ float Ban_IsClientBanned(entity client, float idx)
                b = idx;
                e = idx + 1;
        }
+       ipbanned = FALSE;
        for(i = b; i < e; ++i)
        {
                string s;
                if(time > ban_expire[i])
                        continue;
                s = ban_ip[i];
-               if(ban_ip1 == s) return TRUE;
-               if(ban_ip2 == s) return TRUE;
-               if(ban_ip3 == s) return TRUE;
-               if(ban_ip4 == s) return TRUE;
-#ifdef UID
-               if(ban_uid == s) return TRUE;
-#endif
+               if(ban_ip1 == s) ipbanned = TRUE;
+               if(ban_ip2 == s) ipbanned = TRUE;
+               if(ban_ip3 == s) ipbanned = TRUE;
+               if(ban_ip4 == s) ipbanned = TRUE;
+               if(ban_idfp == s) return TRUE;
        }
+       if(ipbanned)
+               if(!cvar("g_banned_list_idmode") || !ban_idfp)
+                       return TRUE;
        return FALSE;
 }
 
@@ -560,12 +564,9 @@ void Ban_KickBanClient(entity client, float bantime, float masksize, string reas
                default:
                        Ban_Insert(ban_ip4, bantime, reason, 1);
                        break;
-#ifdef UID
-               case 0:
-                       Ban_Insert(ban_uid, bantime, reason, 1);
-                       break;
-#endif
        }
+       if(ban_idfp)
+               Ban_Insert(ban_idfp, bantime, reason, 1);
        /*
         * not needed, as we enforce the ban in Ban_Insert anyway
        // and kick him
index d4232424072f84aa90d2c7fd220371e4a91aa923..59428f65dbca241c03f7b330440cdd8cf75fce98 100644 (file)
@@ -1668,6 +1668,7 @@ void precache()
     precache_sound ("weapons/weapon_switch.wav");
     precache_sound ("weapons/weaponpickup.wav");
     precache_sound ("weapons/unavailable.wav");
+    precache_sound ("weapons/dryfire.wav");
     if (g_grappling_hook)
     {
         precache_sound ("weapons/hook_fire.wav"); // hook
index bad8516de6b1b7ab7392f9b93425ba1eca4c2399..64ce9da0289b935cb96f71f88ca7b25d2b0b0ee2 100644 (file)
@@ -1,8 +1,9 @@
 
+#ifdef TURRET_DEBUG
 void mark_error(vector where,float lifetime);
 void mark_info(vector where,float lifetime);
 entity mark_misc(vector where,float lifetime);
-
+#endif
 
 void pathlib_showpath(entity start)
 {
@@ -23,7 +24,9 @@ void path_dbg_think()
 
 void __showpath2_think()
 {
-    mark_info(self.origin,1);
+    #ifdef TURRET_DEBUG 
+       mark_info(self.origin,1);
+       #endif
     if(self.path_next)
     {
         self.path_next.think     = __showpath2_think;
index fbff82e9ef7c2ca6d818282cce004bdafbdd3226..9658747eeb7122f393d3cde584c63544b35593db 100644 (file)
@@ -28,7 +28,9 @@ entity pathlib_mknode(vector where,entity parent)
     node = pathlib_nodeatpoint(where);
     if(node)
     {
+       #ifdef TURRET_DEBUG
         mark_error(where, 60);
+        #endif
         return node;
     }
 
index 4dff570d317798035ea13f029c507ba6eb9f25ee..2f158898198aafe3b45aeedbe4a1a04979fbf6b8 100644 (file)
@@ -101,9 +101,7 @@ void race_InitSpectator()
 string rr;
 float grecordtime[RANKINGS_CNT];
 string grecordholder[RANKINGS_CNT];
-#ifdef UID
 string grecorduid[RANKINGS_CNT];
-#endif
 float worst_time; // last ranked time
 float have_recs; // have we already read the records from the database before?
 float race_GetTime(float pos) {
@@ -117,15 +115,11 @@ float race_GetTime(float pos) {
                for(i=0;i<RANKINGS_CNT;++i) {
                        grecordtime[i] = stof(db_get(ServerProgsDB, strcat(GetMapname(), rr, "time", ftos(i))));
                        grecordholder[i] = strzone(db_get(ServerProgsDB, strcat(GetMapname(), rr, "netname", ftos(i))));
-#ifdef UID
-                       grecorduid[i] = strzone(db_get(ServerProgsDB, strcat(GetMapname(), rr, "uid", ftos(i))));
-#endif
+                       grecorduid[i] = strzone(db_get(ServerProgsDB, strcat(GetMapname(), rr, "crypto_idfp", ftos(i))));
                }
                grecordtime[0] = stof(db_get(ServerProgsDB, strcat(GetMapname(), rr, "time")));
                grecordholder[0] = strzone(db_get(ServerProgsDB, strcat(GetMapname(), rr, "netname")));
-#ifdef UID
-               grecorduid[0] = strzone(db_get(ServerProgsDB, strcat(GetMapname(), rr, "uid")));
-#endif
+               grecorduid[0] = strzone(db_get(ServerProgsDB, strcat(GetMapname(), rr, "crypto_idfp")));
                worst_time = stof(db_get(ServerProgsDB, strcat(GetMapname(), rr, strcat("time", ftos(RANKINGS_CNT-1)))));
                have_recs = 1;
        }
@@ -137,24 +131,18 @@ string race_GetName(float pos) { // these other functions assume that race_GetTi
        return grecordholder[pos-1];
 }
 
-#ifdef UID
 float race_CheckUID(string myuid, string net_name) { // return existing UID or player name ranking pos, else 0
        float i;
+       if(myuid)
+       {
+               for (i=RANKINGS_CNT-1;i>=0;--i)
+                       if(grecorduid[i] == myuid)
+                               return i+1;
+       }
        for (i=RANKINGS_CNT-1;i>=0;--i)
-               if(grecorduid[i] == myuid)
-                       return i+1;
-       for (i=RANKINGS_CNT-1;i>=0;--i)
-               if(grecordholder[i] == net_name)
-                       return i+1;
-       return 0;
-}
-#endif
-
-float race_CheckName(string net_name) { // Does the name already exist in rankings? In that case, where? (otherwise 0)
-       float i;
-       for (i=RANKINGS_CNT-1;i>=0;--i)
-               if(grecordholder[i] == net_name)
-                       return i+1;
+               if(!grecorduid[i])
+                       if(grecordholder[i] == net_name)
+                               return i+1;
        return 0;
 }
 
@@ -224,11 +212,7 @@ string race_PlaceName(float pos) {
 void race_SetTime(entity e, float t, float match_rec) {
        float pos, prevpos;
        pos = race_GetPos(t);
-#ifdef UID
-       prevpos = race_CheckUID(e.uid, e.netname);
-#else
-       prevpos = race_CheckName(e.netname);
-#endif
+       prevpos = race_CheckUID(e.crypto_idfp, e.netname);
 
        float oldrec;
        string recorddifference;
@@ -254,37 +238,29 @@ void race_SetTime(entity e, float t, float match_rec) {
                for (i=prevpos-1;i>pos-1;--i) {
                        db_put(ServerProgsDB, strcat(GetMapname(), rr, "time", ftos(i)), ftos(grecordtime[i-1]));
                        db_put(ServerProgsDB, strcat(GetMapname(), rr, "netname", ftos(i)), grecordholder[i-1]);
-#ifdef UID
-                       db_put(ServerProgsDB, strcat(GetMapname(), rr, "uid", ftos(i)), grecorduid[i-1]);
-#endif
+                       db_put(ServerProgsDB, strcat(GetMapname(), rr, "crypto_idfp", ftos(i)), grecorduid[i-1]);
                        grecordtime[i] = grecordtime[i-1];
 
                        if (grecordholder[i])
                                strunzone(grecordholder[i]);
                        grecordholder[i] = strzone(grecordholder[i-1]);
-#ifdef UID
                        if (grecorduid[i])
                                strunzone(grecorduid[i]);
                        grecorduid[i] = strzone(grecorduid[i-1]);
-#endif
                }
        } else { // player has no ranked record yet
                for (i=RANKINGS_CNT-1;i>pos-1;--i) {
                        db_put(ServerProgsDB, strcat(GetMapname(), rr, "time", ftos(i)), ftos(grecordtime[i-1]));
                        db_put(ServerProgsDB, strcat(GetMapname(), rr, "netname", ftos(i)), grecordholder[i-1]);
-#ifdef UID
-                       db_put(ServerProgsDB, strcat(GetMapname(), rr, "uid", ftos(i)), grecorduid[i-1]);
-#endif
+                       db_put(ServerProgsDB, strcat(GetMapname(), rr, "crypto_idfp", ftos(i)), grecorduid[i-1]);
                        grecordtime[i] = grecordtime[i-1];
 
                        if (grecordholder[i])
                                strunzone(grecordholder[i]);
                        grecordholder[i] = strzone(grecordholder[i-1]);
-#ifdef UID
                        if (grecorduid[i])
                                strunzone(grecorduid[i]);
                        grecorduid[i] = strzone(grecorduid[i-1]);
-#endif
                }
        }
        
@@ -292,39 +268,31 @@ void race_SetTime(entity e, float t, float match_rec) {
        if (pos == 1) {
                db_put(ServerProgsDB, strcat(GetMapname(), rr, "time"), ftos(t));
                db_put(ServerProgsDB, strcat(GetMapname(), rr, "netname"), e.netname);
-#ifdef UID
-               db_put(ServerProgsDB, strcat(GetMapname(), rr, "uid"), e.uid);
-#endif
+               db_put(ServerProgsDB, strcat(GetMapname(), rr, "crypto_idfp"), e.crypto_idfp);
 
                grecordtime[0] = t;
 
                if (grecordholder[0])
                        strunzone(grecordholder[0]);
                grecordholder[0] = strzone(e.netname);
-#ifdef UID
                if (grecorduid[0])
                        strunzone(grecorduid[0]);
-               grecorduid[0] = strzone(e.uid);
-#endif
+               grecorduid[0] = strzone(e.crypto_idfp);
                write_recordmarker(e, time - TIME_DECODE(t), TIME_DECODE(t));
                race_send_recordtime(MSG_ALL);
        } else {
                db_put(ServerProgsDB, strcat(GetMapname(), rr, "time", ftos(pos-1)), ftos(t));
                db_put(ServerProgsDB, strcat(GetMapname(), rr, "netname", ftos(pos-1)), e.netname);
-#ifdef UID
-               db_put(ServerProgsDB, strcat(GetMapname(), rr, "uid", ftos(pos-1)), e.uid);
-#endif
+               db_put(ServerProgsDB, strcat(GetMapname(), rr, "crypto_idfp", ftos(pos-1)), e.crypto_idfp);
 
                grecordtime[pos-1] = t;
 
                if (grecordholder[pos-1])
                        strunzone(grecordholder[pos-1]);
                grecordholder[pos-1] = strzone(e.netname);
-#ifdef UID
                if (grecorduid[pos-1])
                        strunzone(grecorduid[pos-1]);
-               grecorduid[pos-1] = strzone(e.uid);
-#endif
+               grecorduid[pos-1] = strzone(e.crypto_idfp);
        }
 
        if (pos == RANKINGS_CNT)
@@ -368,53 +336,41 @@ void race_DeleteTime(float pos) {
                if (i == 0) {
                        db_put(ServerProgsDB, strcat(GetMapname(), rr, "time"), ftos(grecordtime[1]));
                        db_put(ServerProgsDB, strcat(GetMapname(), rr, "netname"), grecordholder[1]);
-#ifdef UID
-                       db_put(ServerProgsDB, strcat(GetMapname(), rr, "uid"), grecorduid[1]);
-#endif
+                       db_put(ServerProgsDB, strcat(GetMapname(), rr, "crypto_idfp"), grecorduid[1]);
                        grecordtime[0] = grecordtime[1];
                        if (grecordholder[i])
                                strunzone(grecordholder[0]);
                        grecordholder[0] = strzone(grecordholder[1]);
 
-#ifdef UID
                        if (grecorduid[i])
                                strunzone(grecorduid[0]);
                        grecorduid[0] = strzone(grecorduid[1]);
-#endif
                }
                else if (i == RANKINGS_CNT-1) {
                        db_put(ServerProgsDB, strcat(GetMapname(), rr, "time", ftos(i)), string_null);
                        db_put(ServerProgsDB, strcat(GetMapname(), rr, "netname", ftos(i)), string_null);
-#ifdef UID
-                       db_put(ServerProgsDB, strcat(GetMapname(), rr, "uid", ftos(i)), string_null);
-#endif
+                       db_put(ServerProgsDB, strcat(GetMapname(), rr, "crypto_idfp", ftos(i)), string_null);
                        grecordtime[i] = 0;
                        if (grecordholder[i])
                                strunzone(grecordholder[i]);
                        grecordholder[i] = string_null;
 
-#ifdef UID
                        if (grecorduid[i])
                                strunzone(grecorduid[i]);
                        grecorduid[i] = string_null;
-#endif
                }
                else {
                        db_put(ServerProgsDB, strcat(GetMapname(), rr, "time", ftos(i)), ftos(grecordtime[i+1]));
                        db_put(ServerProgsDB, strcat(GetMapname(), rr, "netname", ftos(i)), grecordholder[i+1]);
-#ifdef UID
-                       db_put(ServerProgsDB, strcat(GetMapname(), rr, "uid", ftos(i)), grecorduid[i+1]);
-#endif
+                       db_put(ServerProgsDB, strcat(GetMapname(), rr, "crypto_idfp", ftos(i)), grecorduid[i+1]);
                        grecordtime[i] = grecordtime[i+1];
                        if (grecordholder[i])
                                strunzone(grecordholder[i]);
                        grecordholder[i] = strzone(grecordholder[i+1]);
 
-#ifdef UID
                        if (grecorduid[i])
                                strunzone(grecorduid[i]);
                        grecorduid[i] = strzone(grecorduid[i+1]);
-#endif
                }
        }
 
index 44a47c95dc5ed653c2cf40afb68bf7c788570b5d..3b7d77d58be6ef819dfcd4ae68266588e1ed36fc 100644 (file)
@@ -77,6 +77,10 @@ void CreatureFrame (void)
                                if (dm > 0)
                                {
                                        Damage (self, world, world, dm, DEATH_FALL, self.origin, '0 0 0');
+                                       // this must be allowed to cut the normal pain sounds (played after them and on the same channel)
+                                       // there's no way to detect falling damage and prevent the pain sounds for this to be played instead
+                                       if(self.health > 0)
+                                               PlayerSound(playersound_fall, CHAN_PAIN, VOICETYPE_PLAYERSOUND);
                                }
                        }
 
index beed37321c40bc6d6ec3026577510a9c75874f8d..ba0cb8bb3e00c9873fcad5ada9cede5d344a61d8 100644 (file)
@@ -1052,7 +1052,7 @@ void weapon_defaultspawnfunc(float wpn)
                        {
                                ammofield = Item_CounterField(j);
                                if(!self.ammofield)
-                                       self.ammofield = cvar(strcat("g_pickup_", Item_CounterFieldName(j)));
+                                       self.ammofield = cvar(strcat("g_pickup_", Item_CounterFieldName(j), "_weapon"));
                        }
                }
        }
index fa07f867fcded1d6c28b131ecb2d59c0ea088d12..8cdd0f5097b581f00cda055d8a70d8c27d976fd7 100644 (file)
@@ -74,7 +74,7 @@ vector real_origin(entity ent);
 /// Dont aim.
 #define TFL_AIM_NO                  1
 /// Go for ground, not direct hit
-#define TFL_AIM_GROUND              2
+//#define TFL_AIM_GROUND              2
 /// Go for ground, not direct hit, but only if target is on ground.
 #define TFL_AIM_GROUND2             4
 /// Use balistic aim. FIXME: not implemented
@@ -87,8 +87,8 @@ vector real_origin(entity ent);
 #define TFL_AIM_INFRONT             64
 /// Aim slightly behind target
 #define TFL_AIM_BEHIND              128
-/// blend real and predicted z positions. (fake bounce prediction)
-#define TFL_AIM_ZEASE               256
+/// blend real and predicted z positions. (fake bounce prediction) 
+// #define TFL_AIM_ZEASE               256 
 /// Try to do real prediction of targets z pos at impact.
 #define TFL_AIM_ZPREDICT            512
 /// Simply aim at target's current location
@@ -266,9 +266,6 @@ vector real_origin(entity ent);
 /// on/off toggle.
 .float      tur_active;
 
-// Aim from this point,
-//.vector     tur_aimorg;
-
 /// and shoot from here. (can be non constant, think MLRS)
 .vector     tur_shotorg;
 
@@ -323,8 +320,6 @@ vector real_origin(entity ent);
 .float target_range;
 /// Dont consider targets closer then
 .float target_range_min;
-// Engage fire routine on targets within
-//.float target_range_fire; // no practical use aymore, work with target_range insted.
 /// Targets closer to this are prefered
 .float target_range_optimal;
 
@@ -353,8 +348,6 @@ vector real_origin(entity ent);
 */
 /// Maximum offset between impact and aim spot to fire
 .float aim_firetolerance_dist;
-// Maximum angular offset between head and aimspot to fire
-//.float aim_firetolerance_angle;
 /// How fast can i rotate/pitch (per second in stepmotor mode, base force in smooth modes)
 .float aim_speed;
 /// cant aim higher/lower then this
@@ -397,16 +390,12 @@ void turret_fire();
 .void()  turret_firefunc;
 /// prefire checks go here. return 1 to go bang, 0 not to.
 .float() turret_firecheckfunc;
-// Execure BEFORE main ai loop. return 0 to cancel any following proccessing.
-//.float() turret_prethink;
 /// Execure AFTER main AI loop
 .void()  turret_postthink;
 
 /// Add a target
 .float(entity e_target,entity e_sender) turret_addtarget;
 
-//.float call_diehook;
-//.float call_respwnhook;
 .void() turret_diehook;
 .void() turret_respawnhook;
 
@@ -421,27 +410,6 @@ void turret_fire();
 .float(float event_id) turret_eventhook;
 */
 
-/*
-* Some turrets need other aimsystems then other.
-* This should return the place to aim at, not acctualy turn or
-* pitch anyting.
-*
-* use turret_stdproc_aim* or Make your own.
-* Make sure you update tur_enemy_dist and tur_enemy_adist
-* with the apropriate info, if you do.
-
-removed.
-*/
-// function used to aim, usualy turret_stdproc_aim_generic
-//.vector() turret_aim;
-
-/*
-* This is where the acctual turret turning should take place
-* Use turret_stdproc_track or make your own.
-wkacked to save mem.
-*/
-// Function used to turn and pitch the .tur_head usualy turret_stdproc_track
-//.void() turret_track;
 
 /*
 * Target selection, preferably but not nessesarely
@@ -450,41 +418,11 @@ wkacked to save mem.
 /// Function to use for target evaluation. usualy turret_stdproc_targetscore_generic
 .float(entity e_turret, entity e_target) turret_score_target;
 
-/*
-* Damage, death and respawn.
-*/
-//void turret_gibs_precash();
-// generalized so save mem (on fields)
-// Function to handle incomming damage. usualy turret_stdproc_damage
-//.void(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector vforce) turret_damagefunc;
-// Function to handle the event of death. usualy turret_stdproc_die
-//.void() turret_diefunc;
-// Function that handles rebirth. usualy turret_stdproc_respawn
-//.void() turret_spawnfunc;
-
-/*
-* Stuff to plug into requierd but unused callbacks.
-*/
-/// Always return 1
-//float turret_stdproc_true();
-/// Always return 0
-//float turret_stdproc_false();
-/// Always return nothing at all
-//void turret_stdproc_nothing();
 
 /*
 * Target selection
 */
-// noting uses the following atm.
-// "closeer is beter" selection
-//float   turret_stdproc_targetscore_close(entity e_turret, entity e_target);
-// "further is beter" selection
-//float   turret_stdproc_targetscore_far(entity e_turret, entity e_target);
-// only target_range_optimal
-//float   turret_stdproc_targetscore_optimal(entity e_turret, entity e_target);
-// defendpos
-//float   turret_stdproc_targetscore_defend(entity e_turret, entity e_target);
-/// Generic fairly smart bias-aware target selection.
+/// Generic, fairly smart, bias-aware target selection.
 float   turret_stdproc_targetscore_generic(entity e_turret, entity e_target);
 /// Experimental supportunits targetselector
 float   turret_stdproc_targetscore_support(entity e_turret,entity e_target);
@@ -493,9 +431,7 @@ float   turret_stdproc_targetscore_support(entity e_turret,entity e_target);
 * Aim functions
 */
 /// Generic aimer guided by self.aim_flags
-vector turret_stdproc_aim_generic()
-// Straight line, current location
-//vector  turret_stdproc_aim_simple()
+vector turret_stdproc_aim_generic();
 
 /*
 * Turret turning & pitch
@@ -525,8 +461,6 @@ float  tvt_dist;
 
 /// updates aim org, shot org, shot dir and enemy org for selected turret
 void turret_do_updates(entity e_turret);
-//.vector tur_aimorg_updated; // creates to much aim issues. using tur_shotorg_updated insted.
-//.vector tur_shotorg_updated; // DP8815 fixes gettaginfo, no longer needed.
 .vector tur_shotdir_updated;
 
 void turrets_precash();
index a6b6b30c1be709784791ba6d4de6c37ab89121a3..99f18c20b0c545ffb42c7eb7f8cc2a240a5058e0 100644 (file)
@@ -3,15 +3,18 @@
 
 supports:
 TFL_AIM_NO
-TFL_AIM_GROUND
+TFL_AIM_GROUND2
 TFL_AIM_LEAD
 TFL_AIM_SHOTTIMECOMPENSATE
 TFL_AIM_INFRONT
 TFL_AIM_BEHIND
-TFL_AIM_ZEASE
 
 not supported:
 TFL_AIM_BALISTIC
+
+removed
+TFL_AIM_ZEASE
+TFL_AIM_GROUND
 */
 vector turret_stdproc_aim_generic()
 {
@@ -24,15 +27,7 @@ vector turret_stdproc_aim_generic()
     if(self.aim_flags & TFL_AIM_SIMPLE)
         return real_origin(self.enemy);
 
-    // Keep track of when we can shoot the next time and
-    // try to predict where the target will be then, so we can put our aimpoint there.
-    // + sys_frametime, becouse spawned REMOVE THIS IF sv_gameplayfix_delayprojectiles are 0!
-    // projectiles dont move during the first tic of their life.
-    //if (self.turrcaps_flags & TFL_TURRCAPS_HITSCAN)
-    //    mintime = max(self.attack_finished_single - time,0) + sys_frametime;
-    //else
-
-    mintime = max(self.attack_finished_single - time,0) + sys_frametime;
+       mintime = max(self.attack_finished_single - time,0) + sys_frametime ;
 
     // Baseline
     pre_pos = real_origin(self.enemy);
@@ -45,60 +40,39 @@ vector turret_stdproc_aim_generic()
 
     // Lead?
     if (self.aim_flags & TFL_AIM_LEAD)
-    if (self.aim_flags & TFL_AIM_SHOTTIMECOMPENSATE)       // Need to conpensate for shot traveltime
-    {
-        // FIXME: this cant be the best way to do this..
-        prep = pre_pos;
-        for(i = 0; i < 4; ++i)
-        {
-            distance = vlen(prep - self.tur_shotorg);
-            impact_time = distance / self.shot_speed;
-            prep = pre_pos + self.enemy.velocity * impact_time;
-        }
-
-
-        // tnx to Rudolf "div0" Polzer for this solution.
-        // hmm tobad it dont work.
-        /*
-        vector q;
-        q = solve_quadratic(self.enemy.velocity*self.enemy.velocity - self.shot_speed*self.shot_speed, 2*(pre_pos*self.enemy.velocity), pre_pos * pre_pos);
-        if(q_x > 0)
-            impact_time = q_x;
-        else
-            impact_time = q_y;
-        */
-
-        prep = pre_pos + (self.enemy.velocity * (impact_time + mintime));
-
-        if(self.aim_flags & TFL_AIM_ZPREDICT)
-        if not(self.enemy.flags & FL_ONGROUND)
-        if(self.enemy.movetype == MOVETYPE_WALK || self.enemy.movetype == MOVETYPE_TOSS || self.enemy.movetype == MOVETYPE_BOUNCE)
-        {
-            float vz;
-            prep_z = pre_pos_z;
-            vz = self.enemy.velocity_z;
-            for(i = 0; i < impact_time; i += sys_frametime)
-            {
-                vz = vz - (sv_gravity * sys_frametime);
-                prep_z = prep_z + vz * sys_frametime;
-            }
-        }
-        pre_pos = prep;
-    }
-    else
-        pre_pos = pre_pos + self.enemy.velocity * mintime;
-
-    // Smooth out predict-Z?
-    /*
-    if (self.aim_flags & TFL_AIM_ZEASE)
-    if (self.enemy.flags & FL_CLIENT)
-    {
-        vector v;
-        v = real_origin(self.enemy);
-        pre_pos_z = (pre_pos_z + v_z) * 0.5;
+    {          
+               if (self.aim_flags & TFL_AIM_SHOTTIMECOMPENSATE)       // Need to conpensate for shot traveltime
+               {
+                       // FIXME: this cant be the best way to do this..
+                       prep = pre_pos;
+                       for(i = 0; i < 4; ++i)
+                       {
+                               distance = vlen(prep - self.tur_shotorg);
+                               impact_time = distance / self.shot_speed;
+                               prep = pre_pos + self.enemy.velocity * impact_time;
+                       }
+
+                       prep = pre_pos + (self.enemy.velocity * (impact_time + mintime));
+
+                       if(self.aim_flags & TFL_AIM_ZPREDICT)
+                       if not(self.enemy.flags & FL_ONGROUND)
+                       if(self.enemy.movetype == MOVETYPE_WALK || self.enemy.movetype == MOVETYPE_TOSS || self.enemy.movetype == MOVETYPE_BOUNCE)
+                       {
+                               float vz;
+                               prep_z = pre_pos_z;
+                               vz = self.enemy.velocity_z;
+                               for(i = 0; i < impact_time; i += sys_frametime)
+                               {
+                                       vz = vz - (sv_gravity * sys_frametime);
+                                       prep_z = prep_z + vz * sys_frametime;
+                               }
+                       }
+                       pre_pos = prep;
+               }
+               else
+                       pre_pos = pre_pos + self.enemy.velocity * mintime;
     }
-    */
-
+    
     if(self.aim_flags & TFL_AIM_GROUND2)
     {
         //tracebox(pre_pos + '0 0 32',self.enemy.mins,self.enemy.maxs,pre_pos -'0 0 64',MOVE_WORLDONLY,self.enemy);
@@ -107,14 +81,5 @@ vector turret_stdproc_aim_generic()
             pre_pos = trace_endpos;
     }
 
-    /*
-    // This turret should hit the ground neer a target rather the do a direct hit
-    if (self.aim_flags & TFL_AIM_GROUND)
-    {
-        traceline(pre_pos + '0 0 8',pre_pos - '0 0 10000',MOVE_WORLDONLY,self.enemy);
-        pre_pos = trace_endpos;
-    }
-    */
-
     return pre_pos;
 }
index 9600c583cc6d0e927d37a10b87f26639c7445011..d3e0553db9800452fd252ca40c877b5900f53822 100644 (file)
@@ -17,12 +17,11 @@ void turret_trowgib(
     gib = spawn();
 
     gib.classname = "turret_gib";
-    setmodel(gib,smodel);
-    setorigin(gib,v_from);
-    SUB_SetFade(gib,time + f_lifetime,2);
+    setmodel(gib, smodel);
+    setorigin(gib, v_from);
+    SUB_SetFade(gib,time + f_lifetime, 2);
 
     gib.solid              = SOLID_BBOX;
-
     gib.movetype           = MOVETYPE_BOUNCE;
     gib.takedamage         = DAMAGE_YES;
     gib.event_damage       = turret_gib_damage;
@@ -38,7 +37,7 @@ void turret_trowgib(
         burn.effects        = EF_LOWPRECISION;//|EF_FLAME;
         setattachment(burn,gib,"");
         setorigin(burn,(gib.mins + gib.maxs) * 0.5);
-        SUB_SetFade(burn,time + (f_lifetime * 0.5) ,2);
+        SUB_SetFade(burn,time + (f_lifetime * 0.5)2);
     }
 }
 
@@ -55,15 +54,13 @@ void turret_gib_boom()
 
         s = strcat("models/turrets/head-gib",ftos(i));
         s = strcat(s,".md3");
-        // bprint("s:",s,"\n");
-        setmodel(gib,s);
+        setmodel(gib, s);
 
         setorigin(gib,self.origin);
 
         SUB_SetFade(gib,time + 5,2);
 
         gib.solid              = SOLID_BBOX;
-
         gib.movetype           = MOVETYPE_BOUNCE;
         gib.gravity            = 0.5;
         gib.damageforcescale   = 2;
@@ -161,22 +158,21 @@ void turret_stdproc_die()
         makevectors(self.angles);
         if (random() > 0.5)
         {
-            turret_trowgib(self.origin, '0 0 0','1 1 1',"models/turrets/base-gib2.md3",min(self.respawntime,20),1,1);
+            turret_trowgib(self.origin, '0 0 0', '1 1 1', "models/turrets/base-gib2.md3", min(self.respawntime, 20), 1, 1);
+            
+            t_dir = (v_up * 700) + (randomvec() * 300);            
+            turret_trowgib(self.origin, t_dir, '1 1 1', "models/turrets/base-gib3.md3", min(self.respawntime, 10), 1, 1);
+            
             t_dir = (v_up * 700) + (randomvec() * 300);
-            turret_trowgib(self.origin, t_dir,'1 1 1',"models/turrets/base-gib3.md3",min(self.respawntime,10),1,1);
-            t_dir = (v_up * 700) + (randomvec() * 300);
-            turret_trowgib(self.origin, t_dir,'1 1 1',"models/turrets/base-gib4.md3",min(self.respawntime,10),1,1);
+            turret_trowgib(self.origin, t_dir, '1 1 1', "models/turrets/base-gib4.md3", min(self.respawntime, 10), 1, 1);
         }
         else
         {
-            turret_trowgib(self.origin, '0 0 0','1 1 1',"models/turrets/base-gib1.md3",min(self.respawntime,20),1,1);
+            turret_trowgib(self.origin, '0 0 0', '1 1 1', "models/turrets/base-gib1.md3", min(self.respawntime, 20), 1, 1);
         }
 
         // Blow the top part up into the air
-        turret_trowgib2( self.origin + (v_up * 50),
-                         v_up * 150 + randomvec() * 50,
-                         '0.2 0.2 0.2',
-                         self.tur_head,time + 0.5 + (random() * 0.5));
+        turret_trowgib2( self.origin + (v_up * 50), v_up * 150 + randomvec() * 50, '0.2 0.2 0.2', self.tur_head,time + 0.5 + (random() * 0.5));
     }
 
 // Go boom
@@ -192,31 +188,23 @@ void turret_stdproc_die()
     }
     else
     {
-    // Setup respawn
+               // Setup respawn
         self.nextthink      = time + self.respawntime;
-        //self.think          = self.turret_spawnfunc;
         self.think          = turret_stdproc_respawn;
+        
         if (self.turret_diehook)
             self.turret_diehook();
     }
-
 }
 
+var const float SUB_NullFloat();
 void turret_stdproc_respawn()
 {
     // Make sure all parts belong to the same team since
     // this function doubles as "teamchange" function.
 
-    self.tur_head.team = self.team;
-
-    /*
-    COLOR_TEAM1       = 4;  // red
-    COLOR_TEAM2       = 13; // blue
-    COLOR_TEAM3       = 12; // yellow
-    COLOR_TEAM4       = 9; // pink
-    */
-
-       self.colormod = '0 0 0';
+    self.tur_head.team         = self.team;
+       self.colormod           = '0 0 0';
 
        switch(self.team)
        {
@@ -238,17 +226,16 @@ void turret_stdproc_respawn()
        }
 
     self.deadflag           = DEAD_NO;
-    self.effects            = 0;
+    self.effects            = EF_LOWPRECISION;
     self.tur_head.effects   = self.effects;
-
     self.solid              = SOLID_BBOX;
-
-    self.alpha = 1;
+    self.alpha                                 = 1;
     self.tur_head.alpha     = self.alpha;
-    self.customizeentityforclient = SUB_True;
-    self.tur_head.customizeentityforclient = SUB_True;
+    
+    self.customizeentityforclient                      = SUB_NullFloat;
+    self.tur_head.customizeentityforclient     = SUB_NullFloat;
 
-    self.takedamage = DAMAGE_AIM;
+    self.takedamage                    = DAMAGE_AIM;
     self.event_damage           = turret_stdproc_damage;
 
     self.avelocity              = '0 0 0';
index afddaef0d319bba83bbb419519bbdc8edc9f5329..af53db7c62c234f258cfb46919f1dfe29e820960 100644 (file)
@@ -19,12 +19,10 @@ float Turret_SendEntity(entity to, float sf)
 }
 */
 
-void load_unit_settings(entity ent,string unitname,float is_reload)
+void load_unit_settings(entity ent, string unitname, float is_reload)
 {
     string sbase;
 
-    // dprint("Reloading turret ",e_turret.netname,"\n");
-
     if (ent == world)
         return;
 
@@ -59,8 +57,8 @@ void load_unit_settings(entity ent,string unitname,float is_reload)
 
     ent.target_range         = cvar(strcat(sbase,"_target_range")) * ent.turret_scale_range;
     ent.target_range_min     = cvar(strcat(sbase,"_target_range_min")) * ent.turret_scale_range;
-    //ent.target_range_fire    = cvar(strcat(sbase,"_target_range_fire")) * ent.turret_scale_range;
     ent.target_range_optimal = cvar(strcat(sbase,"_target_range_optimal")) * ent.turret_scale_range;
+    //ent.target_range_fire    = cvar(strcat(sbase,"_target_range_fire")) * ent.turret_scale_range;
 
     ent.target_select_rangebias  = cvar(strcat(sbase,"_target_select_rangebias"));
     ent.target_select_samebias   = cvar(strcat(sbase,"_target_select_samebias"));
@@ -84,26 +82,8 @@ void load_unit_settings(entity ent,string unitname,float is_reload)
     if(is_reload)
         if(ent.turret_respawnhook)
             ent.turret_respawnhook();
-
-}
-
-/*
-float turret_stdproc_true()
-{
-    return 1;
 }
 
-float turret_stdproc_false()
-{
-    return 0;
-}
-
-
-void turret_stdproc_nothing()
-{
-    return;
-}
-*/
 
 /**
 ** updates enemy distances, predicted impact point/time
@@ -111,7 +91,7 @@ void turret_stdproc_nothing()
 **/
 void turret_do_updates(entity t_turret)
 {
-    vector enemy_pos,oldpos;
+    vector enemy_pos, oldpos;
     entity oldself;
 
     oldself = self;
@@ -121,8 +101,7 @@ void turret_do_updates(entity t_turret)
 
     turret_tag_fire_update();
 
-    self.tur_shotdir_updated = normalize(v_forward);
-
+    self.tur_shotdir_updated = v_forward;
     self.tur_dist_enemy  = vlen(self.tur_shotorg - enemy_pos);
     self.tur_dist_aimpos = vlen(self.tur_shotorg - self.tur_aimpos);
 
@@ -136,20 +115,16 @@ void turret_do_updates(entity t_turret)
         if(trace_ent == self.enemy)
             self.tur_dist_impact_to_aimpos = 0;
         else
-            self.tur_dist_impact_to_aimpos = vlen(trace_endpos - self.tur_aimpos);// - (vlen(self.enemy.maxs - self.enemy.mins)*0.5);
+            self.tur_dist_impact_to_aimpos = vlen(trace_endpos - self.tur_aimpos);
 
-        self.tur_impactent             = trace_ent;
-        self.tur_impacttime            = vlen(self.tur_shotorg - trace_endpos) / self.shot_speed;
 
     }
     else
-        tracebox(self.tur_shotorg, '-1 -1 -1','1 1 1',self.tur_shotorg + (self.tur_shotdir_updated * self.tur_dist_aimpos),MOVE_NORMAL,self);
-        //traceline(self.tur_shotorg, self.tur_shotorg + (self.tur_shotdir_updated * self.tur_dist_aimpos),MOVE_NORMAL,self);
-
-        self.tur_dist_impact_to_aimpos = vlen(trace_endpos - self.tur_aimpos) - (vlen(self.enemy.maxs - self.enemy.mins)*0.5);
-        self.tur_impactent             = trace_ent;
-        self.tur_impacttime            = vlen(self.tur_shotorg - trace_endpos) / self.shot_speed;
-
+        tracebox(self.tur_shotorg, '-1 -1 -1','1 1 1', self.tur_shotorg + (self.tur_shotdir_updated * self.tur_dist_aimpos),MOVE_NORMAL,self);
+       
+       self.tur_dist_impact_to_aimpos = vlen(trace_endpos - self.tur_aimpos) - (vlen(self.enemy.maxs - self.enemy.mins) * 0.5);                
+       self.tur_impactent             = trace_ent;
+       self.tur_impacttime            = vlen(self.tur_shotorg - trace_endpos) / self.shot_speed;
 
     self = oldself;
 }
@@ -224,7 +199,6 @@ vector turret_fovsearch_random()
 ** Handles head rotation according to
 ** the units .track_type and .track_flags
 **/
-//.entity aim_mark;
 void turret_stdproc_track()
 {
     vector target_angle; // This is where we want to aim
@@ -245,21 +219,16 @@ void turret_stdproc_track()
     }
     else
     {
-        // Find the direction
-        target_angle = normalize(self.tur_aimpos - self.tur_shotorg);
-        target_angle = vectoangles(target_angle); // And make a angle
+        target_angle = vectoangles(normalize(self.tur_aimpos - self.tur_shotorg)); 
     }
-
-    self.tur_head.angles_x = safeangle(self.tur_head.angles_x);
-    self.tur_head.angles_y = safeangle(self.tur_head.angles_y);
+    
+    self.tur_head.angles_x = anglemods(self.tur_head.angles_x);
+    self.tur_head.angles_y = anglemods(self.tur_head.angles_y);
 
     // Find the diffrence between where we currently aim and where we want to aim
     move_angle = target_angle - (self.angles + self.tur_head.angles);
     move_angle = shortangle_vxy(move_angle,(self.angles + self.tur_head.angles));
 
-
-
-
     switch(self.track_type)
     {
         case TFL_TRACKTYPE_STEPMOTOR:
@@ -288,8 +257,8 @@ void turret_stdproc_track()
 
         case TFL_TRACKTYPE_FLUIDINERTIA:
             f_tmp = self.aim_speed * self.ticrate; // dgr/sec -> dgr/tic
-            move_angle_x = bound(-self.aim_speed, move_angle_x * self.track_accel_pitch * f_tmp,self.aim_speed);
-            move_angle_y = bound(-self.aim_speed, move_angle_y * self.track_accel_rot * f_tmp,self.aim_speed);
+            move_angle_x = bound(-self.aim_speed, move_angle_x * self.track_accel_pitch * f_tmp, self.aim_speed);
+            move_angle_y = bound(-self.aim_speed, move_angle_y * self.track_accel_rot * f_tmp, self.aim_speed);
             move_angle = (self.tur_head.avelocity * self.track_blendrate) + (move_angle * (1 - self.track_blendrate));
             break;
 
@@ -310,12 +279,12 @@ void turret_stdproc_track()
             self.tur_head.avelocity_x = 0;
             self.tur_head.angles_x = self.aim_maxpitch;
         }
+        
         if((self.tur_head.angles_x + self.tur_head.avelocity_x * self.ticrate) < -self.aim_maxpitch)
         {
             self.tur_head.avelocity_x = 0;
-            self.tur_head.angles_x = self.aim_maxpitch;
+            self.tur_head.angles_x = -self.aim_maxpitch;
         }
-
     }
 
     //  rot
@@ -332,11 +301,9 @@ void turret_stdproc_track()
         if((self.tur_head.angles_y + self.tur_head.avelocity_y * self.ticrate) < -self.aim_maxrot)
         {
             self.tur_head.avelocity_y = 0;
-            self.tur_head.angles_y = self.aim_maxrot;
+            self.tur_head.angles_y = -self.aim_maxrot;
         }
-
     }
-
 }
 
 
@@ -369,12 +336,13 @@ float turret_stdproc_firecheck()
 
     // Ready?
     if (self.firecheck_flags & TFL_FIRECHECK_REFIRE)
-        if (self.attack_finished_single >= time) return 0;
+        if (self.attack_finished_single > time) return 0;
 
     // Special case: volly fire turret that has to fire a full volly if a shot was fired.
     if (self.shoot_flags & TFL_SHOOT_VOLLYALWAYS)
-        if not (self.volly_counter == self.shot_volly)
-            return 1;
+        if (self.volly_counter != self.shot_volly)
+                       if(self.ammo >= self.shot_dmg)
+                               return 1;               
 
     // Lack of zombies makes shooting dead things unnecessary :P
     if (self.firecheck_flags & TFL_FIRECHECK_DEAD)
@@ -395,15 +363,22 @@ float turret_stdproc_firecheck()
     if (self.firecheck_flags & TFL_FIRECHECK_OTHER_AMMO)
         if (self.enemy.ammo >= self.enemy.ammo_max)
             return 0;
+       
+       // Target of opertunity?
+       if(turret_validate_target(self, self.tur_impactent, self.target_validate_flags) > 0)
+       {
+               self.enemy = self.tur_impactent;
+               return 1;
+       }                               
 
     if (self.firecheck_flags & TFL_FIRECHECK_DISTANCES)
     {
-        // Not close enougth?
-        //if (self.tur_dist_aimpos > self.target_range_fire) return 0;
-
         // To close?
         if (self.tur_dist_aimpos < self.target_range_min)
-            return 0;
+                       if(turret_validate_target(self, self.tur_impactent, self.target_validate_flags) > 0)                    
+                               return 1; // Target of opertunity?
+                       else 
+                               return 0;                               
     }
 
     // Try to avoid FF?
@@ -416,8 +391,6 @@ float turret_stdproc_firecheck()
         if (self.tur_dist_impact_to_aimpos > self.aim_firetolerance_dist)
             return 0;
 
-        //if (self.tur_impactent != self.enemy)
-
     // Volly status
     if (self.shot_volly > 1)
         if (self.volly_counter == self.shot_volly)
@@ -448,7 +421,7 @@ float turret_stdproc_firecheck()
 ** Evaluate a entity for target valitity based on validate_flags
 ** NOTE: the caller must check takedamage before calling this, to inline this check.
 **/
-float turret_validate_target(entity e_turret,entity e_target,float validate_flags)
+float turret_validate_target(entity e_turret, entity e_target, float validate_flags)
 {
     vector v_tmp;
 
@@ -537,12 +510,8 @@ float turret_validate_target(entity e_turret,entity e_target,float validate_flag
     }
 
     // Can we even aim this thing?
-    tvt_thadv = angleofs3(e_turret.tur_head.origin,e_turret.angles + e_turret.tur_head.angles ,e_target);
-    //tvt_thadv = angleofs(e_turret.angles,e_target);
-
-
-
-    tvt_tadv  = shortangle_vxy(angleofs(e_turret,e_target),e_turret.angles);
+    tvt_thadv = angleofs3(e_turret.tur_head.origin, e_turret.angles + e_turret.tur_head.angles, e_target);
+    tvt_tadv  = shortangle_vxy(angleofs(e_turret, e_target), e_turret.angles);
     tvt_thadf = vlen(tvt_thadv);
     tvt_tadf  = vlen(tvt_tadv);
 
@@ -595,7 +564,6 @@ entity turret_select_target()
     float  score;    // target looper entity score
     entity e_enemy;  // currently best scoreing target
     float  m_score;  // currently best scoreing target's score
-    float f;
 
     m_score = 0;
     if(self.enemy)
@@ -608,17 +576,17 @@ entity turret_select_target()
     else
         self.enemy = world;
 
-    e = findradius(self.origin,self.target_range);
+    e = findradius(self.origin, self.target_range);
 
     // Nothing to aim at?
-    if (!e) return world;
+    if (!e) 
+               return world;
 
     while (e)
     {
                if(e.takedamage)
                {
-                       f = turret_validate_target(self,e,self.target_select_flags);
-                       if (f > 0)
+                       if (turret_validate_target(self, e, self.target_select_flags) > 0)
                        {
                                score = self.turret_score_target(self,e);
                                if ((score > m_score) && (score > 0))
@@ -646,7 +614,7 @@ void turret_think()
         if not (g_onslaught)
             if (self.target)
             {
-                e = find(world,targetname,self.target);
+                e = find(world, targetname,self.target);
                 if (e != world)
                     self.team = e.team;
             }
@@ -667,8 +635,7 @@ void turret_think()
     // Handle ammo
     if not (self.spawnflags & TSF_NO_AMMO_REGEN)
     if (self.ammo < self.ammo_max)
-        self.ammo = min(self.ammo + self.ammo_recharge,self.ammo_max);
-
+        self.ammo = min(self.ammo + self.ammo_recharge, self.ammo_max);
 
     // Inactive turrets needs to run the think loop,
     // So they can handle animation and wake up if need be.
@@ -678,15 +645,6 @@ void turret_think()
         return;
     }
 
-    //This is just wrong :| and unlikely to ever happen.
-    /*
-    if(self.deadflag != DEAD_NO)
-    {
-        dprint("WARNING: dead turret running the think function!\n");
-        return;
-    }
-    */
-
     // This is typicaly used for zaping every target in range
     // turret_fusionreactor uses this to recharge friendlys.
     if (self.shoot_flags & TFL_SHOOT_HITALLVALID)
@@ -758,14 +716,17 @@ void turret_think()
 
         // Check if we have a vailid enemy, and try to find one if we dont.
 
-        // g_turrets_targetscan_maxdelay forces a target re-scan this often
+        // g_turrets_targetscan_maxdelay forces a target re-scan at least this often
         float do_target_scan;
         if((self.target_select_time + cvar("g_turrets_targetscan_maxdelay")) < time)
             do_target_scan = 1;
 
         // Old target (if any) invalid?
-        if (turret_validate_target(self,self.enemy,self.target_validate_flags) <= 0)
-            do_target_scan = 1;
+        if (turret_validate_target(self, self.enemy, self.target_validate_flags) <= 0)
+        {
+               self.enemy = world;
+               do_target_scan = 1;
+        }
 
         // But never more often then g_turrets_targetscan_mindelay!
         if (self.target_select_time + cvar("g_turrets_targetscan_mindelay") > time)
@@ -809,7 +770,7 @@ void turret_think()
             turret_fire();
     }
 
-    // do any per-turret stuff
+    // do any custom per-turret stuff
     if(self.turret_postthink)
         self.turret_postthink();
 }
@@ -819,15 +780,6 @@ void turret_fire()
     if (cvar("g_turrets_nofire") != 0)
         return;
 
-    /*
-    // unlikely to ever happen.
-    if (self.deadflag != DEAD_NO)
-        return;
-
-    if not (self.tur_active)
-        return;
-    */
-
     self.turret_firefunc();
 
     self.attack_finished_single = time + self.shot_refire;
@@ -857,11 +809,11 @@ void turret_stdproc_fire()
 
 /*
     When .used a turret switch team to activator.team.
-    If activator is world, the turrets goes inactive.
+    If activator is world, the turret go inactive.
 */
 void turret_stdproc_use()
 {
-    dprint("Turret ",self.netname, " used by ",activator.classname,"\n");
+    dprint("Turret ",self.netname, " used by ", activator.classname, "\n");
 
     self.team = activator.team;
 
@@ -911,7 +863,7 @@ float turret_stdproc_init (string cvar_base_name, float csqc_shared, string base
 {
        entity e, ee;
 
-    // Are turrets allowed atm?
+    // Are turrets allowed?
     if (cvar("g_turrets") == 0)
         return 0;
 
@@ -967,7 +919,7 @@ float turret_stdproc_init (string cvar_base_name, float csqc_shared, string base
             self.team = 14; // Assume turrets are on the defending side if not explicitly set otehrwize
     }
     else if not (teamplay)
-               self.team = MAX_SHOT_DISTANCE; // Group all turrets into the same team iso they dont kill eachother.
+               self.team = MAX_SHOT_DISTANCE; // Group all turrets into the same teamso they dont kill eachother.
        else if(g_onslaught && self.targetname)
        {
                e = find(world,target,self.targetname);
@@ -978,7 +930,7 @@ float turret_stdproc_init (string cvar_base_name, float csqc_shared, string base
                }
        }
        else if(!self.team)
-               self.team = MAX_SHOT_DISTANCE; // Group all turrets into the same team iso they dont kill eachother.
+               self.team = MAX_SHOT_DISTANCE; // Group all turrets into the same teamso they dont kill eachother.
 
     /*
     * Try to guess some reasonaly defaults
@@ -988,11 +940,11 @@ float turret_stdproc_init (string cvar_base_name, float csqc_shared, string base
     * as possible beforehand.
     */
     if (self.turrcaps_flags & TFL_TURRCAPS_SUPPORT)
-        if not (self.ticrate) self.ticrate = 0.2;     // Support units generaly dont need to have a high speed ai-loop
+        self.ticrate = 0.2;     // Support units generaly dont need to have a high speed ai-loop
     else
-        if not (self.ticrate) self.ticrate = 0.1;     // 10 fps for normal turrets
+        self.ticrate = 0.1;     // 10 fps for normal turrets
 
-    self.ticrate = bound(sys_frametime,self.ticrate,60);  // keep it sane
+    self.ticrate = bound(sys_frametime, self.ticrate, 60);  // keep it sane
 
 // General stuff
     if (self.netname == "")
@@ -1000,50 +952,50 @@ float turret_stdproc_init (string cvar_base_name, float csqc_shared, string base
 
     if not (self.respawntime)
         self.respawntime = 60;
-    self.respawntime = max(-1,self.respawntime);
+    self.respawntime = max(-1, self.respawntime);
 
     if not (self.health)
         self.health = 1000;
-    self.tur_health = max(1,self.health);
+    self.tur_health = max(1, self.health);
 
     if not (self.turrcaps_flags)
         self.turrcaps_flags = TFL_TURRCAPS_RADIUSDMG | TFL_TURRCAPS_MEDPROJ | TFL_TURRCAPS_PLAYERKILL;
 
-    if (!self.damage_flags)
+    if not (self.damage_flags)
         self.damage_flags = TFL_DMG_YES | TFL_DMG_RETALIATE | TFL_DMG_AIMSHAKE;
 
 // Shot stuff.
     if not (self.shot_refire)
         self.shot_refire = 1;
-    self.shot_refire = bound(0.01,self.shot_refire,9999);
+    self.shot_refire = bound(0.01, self.shot_refire, 9999);
 
     if not (self.shot_dmg)
         self.shot_dmg  = self.shot_refire * 50;
-    self.shot_dmg = max(1,self.shot_dmg);
+    self.shot_dmg = max(1, self.shot_dmg);
 
     if not (self.shot_radius)
         self.shot_radius = self.shot_dmg * 0.5;
-    self.shot_radius = max(1,self.shot_radius);
+    self.shot_radius = max(1, self.shot_radius);
 
     if not (self.shot_speed)
         self.shot_speed = 2500;
-    self.shot_speed = max(1,self.shot_speed);
+    self.shot_speed = max(1, self.shot_speed);
 
     if not (self.shot_spread)
         self.shot_spread = 0.0125;
-    self.shot_spread = bound(0.0001,self.shot_spread,500);
+    self.shot_spread = bound(0.0001, self.shot_spread, 500);
 
     if not (self.shot_force)
         self.shot_force = self.shot_dmg * 0.5 + self.shot_radius * 0.5;
-    self.shot_force = bound(0.001,self.shot_force,MAX_SHOT_DISTANCE * 0.5);
+    self.shot_force = bound(0.001, self.shot_force, 5000);
 
     if not (self.shot_volly)
         self.shot_volly = 1;
-    self.shot_volly = bound(1,self.shot_volly,floor(self.ammo_max / self.shot_dmg));
+    self.shot_volly = bound(1, self.shot_volly, floor(self.ammo_max / self.shot_dmg));
 
     if not (self.shot_volly_refire)
         self.shot_volly_refire = self.shot_refire * self.shot_volly;
-    self.shot_volly_refire = bound(self.shot_refire,self.shot_volly_refire,60);
+    self.shot_volly_refire = bound(self.shot_refire, self.shot_volly_refire, 60);
 
     if not (self.firecheck_flags)
         self.firecheck_flags = TFL_FIRECHECK_WORLD | TFL_FIRECHECK_DEAD | TFL_FIRECHECK_DISTANCES |
@@ -1053,37 +1005,33 @@ float turret_stdproc_init (string cvar_base_name, float csqc_shared, string base
 // Range stuff.
     if not (self.target_range)
         self.target_range = self.shot_speed * 0.5;
-    self.target_range = bound(0,self.target_range,MAX_SHOT_DISTANCE);
+    self.target_range = bound(0, self.target_range, MAX_SHOT_DISTANCE);
 
     if not (self.target_range_min)
         self.target_range_min = self.shot_radius * 2;
-    self.target_range_min = bound(0,self.target_range_min,MAX_SHOT_DISTANCE);
-
-    //if (!self.target_range_fire)
-    //    self.target_range_fire = self.target_range * 0.8;
-    //self.target_range_fire = bound(0,self.target_range_fire,MAX_SHOT_DISTANCE);
+    self.target_range_min = bound(0, self.target_range_min, MAX_SHOT_DISTANCE);
 
     if not (self.target_range_optimal)
         self.target_range_optimal = self.target_range * 0.5;
-    self.target_range_optimal = bound(0,self.target_range_optimal,MAX_SHOT_DISTANCE);
+    self.target_range_optimal = bound(0, self.target_range_optimal, MAX_SHOT_DISTANCE);
 
 
 // Aim stuff.
     if not (self.aim_maxrot)
         self.aim_maxrot = 90;
-    self.aim_maxrot = bound(0,self.aim_maxrot,360);
+    self.aim_maxrot = bound(0, self.aim_maxrot, 360);
 
     if not (self.aim_maxpitch)
         self.aim_maxpitch = 20;
-    self.aim_maxpitch = bound(0,self.aim_maxpitch,90);
+    self.aim_maxpitch = bound(0, self.aim_maxpitch, 90);
 
     if not (self.aim_speed)
         self.aim_speed = 36;
-    self.aim_speed  = bound(0.1,self.aim_speed, 1000);
+    self.aim_speed  = bound(0.1, self.aim_speed, 1000);
 
     if not (self.aim_firetolerance_dist)
         self.aim_firetolerance_dist  = 5 + (self.shot_radius * 2);
-    self.aim_firetolerance_dist = bound(0.1,self.aim_firetolerance_dist,MAX_SHOT_DISTANCE);
+    self.aim_firetolerance_dist = bound(0.1, self.aim_firetolerance_dist, MAX_SHOT_DISTANCE);
 
     if not (self.aim_flags)
     {
@@ -1092,19 +1040,17 @@ float turret_stdproc_init (string cvar_base_name, float csqc_shared, string base
             self.aim_flags |= TFL_AIM_GROUND2;
     }
 
-    // Sill the most tested (and aim-effective)
     if not (self.track_type)
         self.track_type = TFL_TRACKTYPE_STEPMOTOR;
 
     if (self.track_type != TFL_TRACKTYPE_STEPMOTOR)
     {
-        // Fluid / Ineria mode. Looks mutch nicer, bit experimental &
-        // Can inmapt aim preformance alot.
-        // needs a bit diffrent aimspeed
+        // Fluid / Ineria mode. Looks mutch nicer.
+        // Can reduce aim preformance alot, needs a bit diffrent aimspeed
 
         if not (self.aim_speed)
             self.aim_speed = 180;
-        self.aim_speed = bound(0.1,self.aim_speed, 1000);
+        self.aim_speed = bound(0.1, self.aim_speed, 1000);
 
         if not (self.track_accel_pitch)
             self.track_accel_pitch = 0.5;
@@ -1123,21 +1069,21 @@ float turret_stdproc_init (string cvar_base_name, float csqc_shared, string base
 // Target selection stuff.
     if not (self.target_select_rangebias)
         self.target_select_rangebias = 1;
-    self.target_select_rangebias = bound(-10,self.target_select_rangebias,10);
+    self.target_select_rangebias = bound(-10, self.target_select_rangebias, 10);
 
     if not (self.target_select_samebias)
         self.target_select_samebias = 1;
-    self.target_select_samebias = bound(-10,self.target_select_samebias,10);
+    self.target_select_samebias = bound(-10, self.target_select_samebias, 10);
 
     if not (self.target_select_anglebias)
         self.target_select_anglebias = 1;
-    self.target_select_anglebias = bound(-10,self.target_select_anglebias,10);
+    self.target_select_anglebias = bound(-10, self.target_select_anglebias, 10);
 
     if not (self.target_select_missilebias)
         self.target_select_missilebias = -10;
 
-    self.target_select_missilebias = bound(-10,self.target_select_missilebias,10);
-    self.target_select_playerbias = bound(-10,self.target_select_playerbias,10);
+    self.target_select_missilebias = bound(-10, self.target_select_missilebias, 10);
+    self.target_select_playerbias = bound(-10, self.target_select_playerbias, 10);
 
     if not (self.target_select_flags)
     {
@@ -1159,15 +1105,15 @@ float turret_stdproc_init (string cvar_base_name, float csqc_shared, string base
 // Ammo stuff
     if not (self.ammo_max)
         self.ammo_max = self.shot_dmg * 10;
-    self.ammo_max = max(self.shot_dmg,self.ammo_max);
+    self.ammo_max = max(self.shot_dmg, self.ammo_max);
 
     if not (self.ammo)
         self.ammo = self.shot_dmg * 5;
-    self.ammo = bound(0,self.ammo,self.ammo_max);
+    self.ammo = bound(0,self.ammo, self.ammo_max);
 
     if not (self.ammo_recharge)
         self.ammo_recharge = self.shot_dmg * 0.5;
-    self.ammo_recharge = max(0,self.ammo_recharge);
+    self.ammo_recharge = max(0 ,self.ammo_recharge);
 
     // Convert the recharge from X per sec to X per ticrate
     self.ammo_recharge = self.ammo_recharge * self.ticrate;
@@ -1191,13 +1137,13 @@ float turret_stdproc_init (string cvar_base_name, float csqc_shared, string base
     self.tur_head.team    = self.team;
     self.tur_head.owner   = self;
 
-    setmodel(self,base);
-    setmodel(self.tur_head,head);
+    setmodel(self, base);
+    setmodel(self.tur_head, head);
 
-    setsize(self,'-32 -32 0','32 32 64');
-    setsize(self.tur_head,'0 0 0','0 0 0');
+    setsize(self, '-32 -32 0', '32 32 64');
+    setsize(self.tur_head, '0 0 0', '0 0 0');
 
-    setorigin(self.tur_head,'0 0 0');
+    setorigin(self.tur_head, '0 0 0');
     setattachment(self.tur_head, self, "tag_head");
 
     if (!self.health)
@@ -1225,7 +1171,7 @@ float turret_stdproc_init (string cvar_base_name, float csqc_shared, string base
 
     // In target defend mode, aim on the spot to defend when idle.
     if (self.tur_defend)
-        self.idle_aim  = self.tur_head.angles + angleofs(self.tur_head,self.tur_defend);
+        self.idle_aim  = self.tur_head.angles + angleofs(self.tur_head, self.tur_defend);
     else
         self.idle_aim  = '0 0 0';
 
@@ -1289,6 +1235,7 @@ float turret_stdproc_init (string cvar_base_name, float csqc_shared, string base
         self.use();
     }
 
+       turret_stdproc_respawn();
     return 1;
 }
 
index 161bdcbcc941ca69773ff6ebf589746fc6384a92..7b2875d7dc980d3dbc1b46163d3abcd278d76b6e 100644 (file)
@@ -1,25 +1,22 @@
-//--// Some support routines //--//
-
-#define anglemodss(a) (a - floor(a / 360) * 360)
-
-float(float v) anglemods =
+/*
+* Return a angle within +/- 360.
+*/
+float anglemods(float v)
 {
        v = v - 360 * floor(v / 360);
-       return v;
-}
-
-float safeangle(float a)
-{
-    if((a >= -360) && (a <= 360))
-        return a;
-
-
-    a -= (360 * floor(a / 360));
-
-    return a;
+       
+       if(v >= 180)
+               return v - 360;
+       else if(v <= -180)
+               return v + 360;
+       else            
+               return v;
 }
 
-float shortangle_f(float ang1,float ang2)
+/*
+* Return the short angle
+*/
+float shortangle_f(float ang1, float ang2)
 {
     if(ang1 > ang2)
     {
@@ -35,7 +32,7 @@ float shortangle_f(float ang1,float ang2)
     return ang1;
 }
 
-vector shortangle_v(vector ang1,vector ang2)
+vector shortangle_v(vector ang1, vector ang2)
 {
     vector vtmp;
 
@@ -46,7 +43,7 @@ vector shortangle_v(vector ang1,vector ang2)
     return vtmp;
 }
 
-vector shortangle_vxy(vector ang1,vector ang2)
+vector shortangle_vxy(vector ang1, vector ang2)
 {
     vector vtmp;
 
@@ -56,7 +53,10 @@ vector shortangle_vxy(vector ang1,vector ang2)
     return vtmp;
 }
 
-// Get real origin
+
+/*
+* Get "real" origin, in worldspace, even if ent is attached to something else.
+*/
 vector real_origin(entity ent)
 {
     entity e;
@@ -65,241 +65,74 @@ vector real_origin(entity ent)
     e = ent.tag_entity;
     while(e)
     {
-        // v = v + e.origin;
         v = v + ((e.absmin + e.absmax) * 0.5);
         e = e.tag_entity;
     }
-    //v = v + ent.origin;
     v = v + ((ent.absmin + ent.absmax) * 0.5);
     return v;
 }
 
-// Plug this into wherever precache is done.
-void g_turrets_common_precash()
-{
-    precache_model ("models/turrets/c512.md3");
-    precache_model ("models/marker.md3");
-}
-
-void SUB_Remove();
-void marker_think()
-{
-    if(self.cnt)
-    if(self.cnt < time)
-    {
-        self.think = SUB_Remove;
-        self.nextthink = time;
-        return;
-    }
-
-    self.frame += 1;
-    if(self.frame > 29)
-        self.frame = 0;
-
-    self.nextthink = time;
-}
-
-void mark_error(vector where,float lifetime)
-{
-    entity err;
-
-    err = spawn();
-    err.classname = "error_marker";
-    setmodel(err,"models/marker.md3");
-    setorigin(err,where);
-    err.movetype = MOVETYPE_NONE;
-    err.think = marker_think;
-    err.nextthink = time;
-    err.skin = 0;
-    if(lifetime)
-        err.cnt = lifetime + time;
-}
-
-void mark_info(vector where,float lifetime)
-{
-    entity err;
-
-    err = spawn();
-    err.classname = "info_marker";
-    setmodel(err,"models/marker.md3");
-    setorigin(err,where);
-    err.movetype = MOVETYPE_NONE;
-    err.think = marker_think;
-    err.nextthink = time;
-    err.skin = 1;
-    if(lifetime)
-        err.cnt = lifetime + time;
-}
-
-entity mark_misc(vector where,float lifetime)
-{
-    entity err;
-
-    err = spawn();
-    err.classname = "mark_misc";
-    setmodel(err,"models/marker.md3");
-    setorigin(err,where);
-    err.movetype = MOVETYPE_NONE;
-    err.think = marker_think;
-    err.nextthink = time;
-    err.skin = 3;
-    if(lifetime)
-        err.cnt = lifetime + time;
-    return err;
-}
-
-/*
-* Paint a v_color colord circle on target onwho
-* that fades away over f_time
-*/
-void paint_target(entity onwho, float f_size, vector v_color, float f_time)
-{
-    entity e;
-
-    e = spawn();
-    setmodel(e, "models/turrets/c512.md3"); // precision set above
-    e.scale = (f_size/512);
-    //setsize(e, '0 0 0', '0 0 0');
-    //setattachment(e,onwho,"");
-    setorigin(e,onwho.origin + '0 0 1');
-    e.alpha = 0.15;
-    e.movetype = MOVETYPE_FLY;
-
-    e.velocity = (v_color * 32); // + '0 0 1' * 64;
-
-    e.colormod = v_color;
-    SUB_SetFade(e,time,f_time);
-}
-
-void paint_target2(entity onwho, float f_size, vector v_color, float f_time)
-{
-    entity e;
-
-    e = spawn();
-    setmodel(e, "models/turrets/c512.md3"); // precision set above
-    e.scale = (f_size/512);
-    setsize(e, '0 0 0', '0 0 0');
-
-    setorigin(e,onwho.origin + '0 0 1');
-    e.alpha = 0.15;
-    e.movetype = MOVETYPE_FLY;
-
-    e.velocity = (v_color * 32); // + '0 0 1' * 64;
-    e.avelocity_x = -128;
-
-    e.colormod = v_color;
-    SUB_SetFade(e,time,f_time);
-}
-
-void paint_target3(vector where, float f_size, vector v_color, float f_time)
-{
-    entity e;
-    e = spawn();
-    setmodel(e, "models/turrets/c512.md3"); // precision set above
-    e.scale = (f_size/512);
-    setsize(e, '0 0 0', '0 0 0');
-    setorigin(e,where+ '0 0 1');
-    e.movetype = MOVETYPE_NONE;
-    e.velocity = '0 0 0';
-    e.colormod = v_color;
-    SUB_SetFade(e,time,f_time);
-}
-
 /*
 * Return the angle between two enteties
 */
 vector angleofs(entity from, entity to)
 {
     vector v_res;
-
-    // makevectors(from.angles);
+    
     v_res = normalize(to.origin - from.origin);
     v_res = vectoangles(v_res);
     v_res = v_res - from.angles;
 
-    if (v_res_x < 0) v_res_x += 360;
-    if (v_res_x > 180) v_res_x -= 360;
-
-    if (v_res_y < 0) v_res_y += 360;
-    if (v_res_y > 180) v_res_y -= 360;
-
-    return v_res;
-}
-
-vector angleofs2(entity from, vector to)
-{
-    vector v_res;
-
-    // makevectors(from.angles);
-    v_res = normalize(to - from.origin);
-    v_res = vectoangles(v_res);
-    v_res = v_res - from.angles;
-
-    if (v_res_x < 0) v_res_x += 360;
-    if (v_res_x > 180) v_res_x -= 360;
+    if (v_res_x < 0)   v_res_x += 360;
+    if (v_res_x > 180)         v_res_x -= 360;
 
-    if (v_res_y < 0) v_res_y += 360;
-    if (v_res_y > 180) v_res_y -= 360;
+    if (v_res_y < 0)   v_res_y += 360;
+    if (v_res_y > 180)         v_res_y -= 360;
 
     return v_res;
 }
 
-vector angleofs3(vector from,vector from_a, entity to)
+vector angleofs3(vector from, vector from_a, entity to)
 {
     vector v_res;
-
-    // makevectors(from.angles);
+    
     v_res = normalize(to.origin - from);
     v_res = vectoangles(v_res);
     v_res = v_res - from_a;
 
-    if (v_res_x < 0) v_res_x += 360;
-    if (v_res_x > 180) v_res_x -= 360;
+    if (v_res_x < 0)   v_res_x += 360;
+    if (v_res_x > 180)         v_res_x -= 360;
 
-    if (v_res_y < 0) v_res_y += 360;
-    if (v_res_y > 180) v_res_y -= 360;
+    if (v_res_y < 0)   v_res_y += 360;
+    if (v_res_y > 180)         v_res_y -= 360;
 
     return v_res;
 }
 
-float turret_tag_setup()
-{
-    if(!self.tur_head)
-    {
-        dprint("Call to turret_tag_setup with self.tur_head missing!\n");
-        self.tur_shotorg = '0 0 0';
-        return 0;
-    }
-
-    //if not(self.turrcaps_flags & TFL_TURRCAPS_HEADATTACHED)
-    //    setorigin(self.tur_head,gettaginfo(self,gettagindex(self,"tag_head")));
-
-    self.tur_shotorg = gettaginfo(self.tur_head,gettagindex(self.tur_head,"tag_fire"));
-
-    v_forward = normalize(v_forward);
-
-    return 1;
-}
-
+/*
+* Update self.tur_shotorg by getting up2date bone info
+* NOTICE this func overwrites the global v_forward, v_right and v_up vectors.
+*/
 float turret_tag_fire_update()
 {
     if(!self.tur_head)
     {
-        dprint("Call to turret_tag_fire_update with self.tur_head missing!\n");
+        error("Call to turret_tag_fire_update with self.tur_head missing!\n");
         self.tur_shotorg = '0 0 0';
-        return 0;
+        return FALSE;
     }
 
-    self.tur_shotorg = gettaginfo(self.tur_head,gettagindex(self.tur_head,"tag_fire"));
+    self.tur_shotorg = gettaginfo(self.tur_head, gettagindex(self.tur_head, "tag_fire"));
     v_forward = normalize(v_forward);
 
-    //dprint("update: tur_shotorg: ",vtos(self.tur_shotorg)," origin:", vtos(self.tur_head.origin), " angels: ", vtos(self.tur_head.angles),"\n");
-
-    return 1;
+    return TRUE;
 }
 
-void FireImoBeam (vector start,vector end,vector smin,vector smax,
-                  float bforce,float f_dmg,float f_velfactor, float deathtype)
+/*
+* Railgun-like beam, but has thickness and suppots slowing of target 
+*/
+void FireImoBeam (vector start, vector end, vector smin, vector smax,
+                  float bforce, float f_dmg, float f_velfactor, float deathtype)
 
 {
     local vector hitloc, force, endpoint, dir;
@@ -370,6 +203,13 @@ void FireImoBeam (vector start,vector end,vector smin,vector smax,
     trace_endpos = endpoint;
 }
 
+// Plug this into wherever precache is done.
+void g_turrets_common_precash()
+{
+    precache_model ("models/turrets/c512.md3");
+    precache_model ("models/marker.md3");
+}
+
 void turrets_precache_debug_models()
 {
     precache_model ("models/turrets/c512.md3");
@@ -409,5 +249,134 @@ void turrets_precash()
     //precache_model ("models/turrets/plasma.md3");
     //precache_model ("models/turrets/tesla_head.md3");
     //precache_model ("models/turrets/tesla_base.md3");
-       //turrets_precache_debug_models();
+    #ifdef TURRET_DEBUG
+       turrets_precache_debug_models();
+       #endif
+}
+
+
+#ifdef TURRET_DEBUG
+void SUB_Remove();
+void marker_think()
+{
+    if(self.cnt)
+    if(self.cnt < time)
+    {
+        self.think = SUB_Remove;
+        self.nextthink = time;
+        return;
+    }
+
+    self.frame += 1;
+    if(self.frame > 29)
+        self.frame = 0;
+
+    self.nextthink = time;
+}
+
+void mark_error(vector where,float lifetime)
+{
+    entity err;
+
+    err = spawn();
+    err.classname = "error_marker";
+    setmodel(err,"models/marker.md3");
+    setorigin(err,where);
+    err.movetype = MOVETYPE_NONE;
+    err.think = marker_think;
+    err.nextthink = time;
+    err.skin = 0;
+    if(lifetime)
+        err.cnt = lifetime + time;
+}
+
+void mark_info(vector where,float lifetime)
+{
+    entity err;
+
+    err = spawn();
+    err.classname = "info_marker";
+    setmodel(err,"models/marker.md3");
+    setorigin(err,where);
+    err.movetype = MOVETYPE_NONE;
+    err.think = marker_think;
+    err.nextthink = time;
+    err.skin = 1;
+    if(lifetime)
+        err.cnt = lifetime + time;
+}
+
+entity mark_misc(vector where,float lifetime)
+{
+    entity err;
+
+    err = spawn();
+    err.classname = "mark_misc";
+    setmodel(err,"models/marker.md3");
+    setorigin(err,where);
+    err.movetype = MOVETYPE_NONE;
+    err.think = marker_think;
+    err.nextthink = time;
+    err.skin = 3;
+    if(lifetime)
+        err.cnt = lifetime + time;
+    return err;
+}
+
+/*
+* Paint a v_color colord circle on target onwho
+* that fades away over f_time
+*/
+void paint_target(entity onwho, float f_size, vector v_color, float f_time)
+{
+    entity e;
+
+    e = spawn();
+    setmodel(e, "models/turrets/c512.md3"); // precision set above
+    e.scale = (f_size/512);
+    //setsize(e, '0 0 0', '0 0 0');
+    //setattachment(e,onwho,"");
+    setorigin(e,onwho.origin + '0 0 1');
+    e.alpha = 0.15;
+    e.movetype = MOVETYPE_FLY;
+
+    e.velocity = (v_color * 32); // + '0 0 1' * 64;
+
+    e.colormod = v_color;
+    SUB_SetFade(e,time,f_time);
+}
+
+void paint_target2(entity onwho, float f_size, vector v_color, float f_time)
+{
+    entity e;
+
+    e = spawn();
+    setmodel(e, "models/turrets/c512.md3"); // precision set above
+    e.scale = (f_size/512);
+    setsize(e, '0 0 0', '0 0 0');
+
+    setorigin(e,onwho.origin + '0 0 1');
+    e.alpha = 0.15;
+    e.movetype = MOVETYPE_FLY;
+
+    e.velocity = (v_color * 32); // + '0 0 1' * 64;
+    e.avelocity_x = -128;
+
+    e.colormod = v_color;
+    SUB_SetFade(e,time,f_time);
+}
+
+void paint_target3(vector where, float f_size, vector v_color, float f_time)
+{
+    entity e;
+    e = spawn();
+    setmodel(e, "models/turrets/c512.md3"); // precision set above
+    e.scale = (f_size/512);
+    setsize(e, '0 0 0', '0 0 0');
+    setorigin(e,where+ '0 0 1');
+    e.movetype = MOVETYPE_NONE;
+    e.velocity = '0 0 0';
+    e.colormod = v_color;
+    SUB_SetFade(e,time,f_time);
 }
+#endif 
index c78a3e0181e55316b8fc92895dea67cb84ba7b07..32c7856a3d25d5f19066ba2b09123f1ef8e945c2 100644 (file)
@@ -30,7 +30,7 @@ float turret_stdproc_targetscore_support(entity e_turret,entity e_target)
 /*
 * Generic bias aware score system.
 */
-float turret_stdproc_targetscore_generic(entity e_turret,entity e_target)
+float turret_stdproc_targetscore_generic(entity e_turret, entity e_target)
 {
     //vector v_tmp;
     float d_dist;       // Defendmode Distance
@@ -45,9 +45,10 @@ float turret_stdproc_targetscore_generic(entity e_turret,entity e_target)
 
     float ikr;          // ideal kill range
 
-    if(!e_target) return 0;
-
-    //if (e_target == e_turret.enemy) s_score = 1;
+    /*
+    if(!e_target) 
+               return 0;
+       */
 
     if (e_turret.tur_defend)
     {
@@ -83,10 +84,10 @@ float turret_stdproc_targetscore_generic(entity e_turret,entity e_target)
     if ((e_turret.target_select_playerbias > 0) && (e_target.flags & FL_CLIENT))
         p_score = 1;
 
-    d_score = max(d_score,0);
-    a_score = max(a_score,0);
-    m_score = max(m_score,0);
-    p_score = max(p_score,0);
+    d_score = max(d_score, 0);
+    a_score = max(a_score, 0);
+    m_score = max(m_score, 0);
+    p_score = max(p_score, 0);
 
     score = (d_score * e_turret.target_select_rangebias) +
             (a_score * e_turret.target_select_anglebias) +
index 3d84386a4932599be18198ffaa7b29bef633541b..aff4c0aec907ad77cb2a5a9a2ee8d2001ef72f54 100644 (file)
@@ -59,12 +59,13 @@ void ewheel_attack()
         proj.bot_dodgerating = self.shot_dmg;
         proj.think           = turret_ewheel_projectile_explode;
         proj.nextthink       = time + 9;
-        proj.solid           = SOLID_BBOX;
+        //proj.solid           = SOLID_TRIGGER;
         proj.movetype        = MOVETYPE_FLYMISSILE;
         proj.velocity        = normalize(self.tur_shotdir_updated + randomvec() * self.shot_spread) * self.shot_speed;
         proj.touch           = turret_ewheel_projectile_explode;
         proj.enemy           = self.enemy;
         proj.flags           = FL_PROJECTILE | FL_NOTARGET;
+        PROJECTILE_MAKETRIGGER(proj);
 
         CSQCProjectile(proj, TRUE, PROJECTILE_LASER, TRUE);
 
@@ -285,7 +286,9 @@ void turret_ewheel_dinit()
     }
 
     self.target_select_flags   = TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_RANGELIMTS | TFL_TARGETSELECT_TEAMCHECK | TFL_TARGETSELECT_LOS;
+    self.target_select_flags   = TFL_TARGETSELECT_RANGELIMTS | TFL_TARGETSELECT_TEAMCHECK | TFL_TARGETSELECT_LOS;
     self.target_validate_flags = TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_RANGELIMTS | TFL_TARGETSELECT_TEAMCHECK;// | TFL_TARGETSELECT_LOS;
+    self.target_validate_flags = TFL_TARGETSELECT_RANGELIMTS | TFL_TARGETSELECT_TEAMCHECK;// | TFL_TARGETSELECT_LOS;
     self.damage_flags          |= TFL_DMG_DEATH_NOGIBS;
 
     self.iscreature = TRUE;
@@ -307,7 +310,7 @@ void turret_ewheel_dinit()
     self.tur_head.aim_speed = cvar("g_turrets_unit_ewheel_turnrate");
     self.tur_head.aim_speed = self.tur_head.aim_speed / (1 / self.ticrate);
 
-    if (!turret_tag_setup())
+    if (!turret_tag_fire_update())
         dprint("Warning: Turret ",self.classname, " faild to initialize md3 tags\n");
 
     //setorigin(self,self.origin + '0 0 128');
index 3d2c51fe957ac2279bbd24384f269b8bf6c92abe..0c874fb504d99f5d14534a6978b9a7bb9b975448 100644 (file)
@@ -99,7 +99,7 @@ void turret_flac_dinit()
     self.damage_flags |= TFL_DMG_HEADSHAKE;
     self.target_select_flags |= TFL_TARGETSELECT_NOTURRETS | TFL_TARGETSELECT_MISSILESONLY;
 
-    if (!turret_tag_setup())
+    if (!turret_tag_fire_update())
         dprint("Warning: Turret ",self.classname, " faild to initialize md3 tags\n");
 
     // Our fire routine
index 0225c1653ee8f7fb66e8807c26291e68631815fa..b6408ed4f32b1f3aa936caad9234a1452fc4930e 100644 (file)
@@ -17,21 +17,23 @@ void turret_hellion_postthink()
     }
 
     if (self.tur_head.frame != 0)
-        self.tur_head.frame = self.tur_head.frame + 1;
+        self.tur_head.frame += 1;
 
-    if (self.tur_head.frame > 7)
+    if (self.tur_head.frame >= 7)
         self.tur_head.frame = 0;
 }
 
 void turret_hellion_attack()
 {
-    local entity missile;
-
+    entity missile;
+               
+       if(self.tur_head.frame != 0)
+               self.tur_shotorg = gettaginfo(self.tur_head, gettagindex(self.tur_head, "tag_fire"));
+       else
+               self.tur_shotorg = gettaginfo(self.tur_head, gettagindex(self.tur_head, "tag_fire2"));
+    
     sound (self, CHAN_WEAPON, "weapons/hagar_fire.wav", VOL_BASE, ATTN_NORM);
 
-    // switch tubes
-    //self.tur_shotorg_y = self.tur_shotorg_y * -1;
-
     missile = spawn ();
     setorigin(missile, self.tur_shotorg);
     setsize (missile, '-3 -3 -3', '3 3 3'); // give it some size so it can be shot
@@ -57,12 +59,9 @@ void turret_hellion_attack()
     missile.tur_health         = time + 9;
     missile.tur_aimpos         = randomvec() * 128;
     te_explosion (missile.origin);
-
        CSQCProjectile(missile, FALSE, PROJECTILE_ROCKET, FALSE); // no culling, has fly sound
 
-    if (self.tur_head.frame == 0)
-        self.tur_head.frame = self.tur_head.frame + 1;
-
+       self.tur_head.frame += 1;
 }
 
 void turret_hellion_missile_damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector vforce)
@@ -195,7 +194,7 @@ void turret_hellion_dinit()
         return;
     }
 
-    if (!turret_tag_setup())
+    if (!turret_tag_fire_update())
         dprint("Warning: Turret ",self.classname, " faild to initialize md3 tags\n");
 
     self.turret_firefunc  = turret_hellion_attack;
index ac1e51ecd3d45efb0688d532f5c58def3b73ad29..cea4c13bd822bef60c2c2dc6f4109f1d84c95146 100644 (file)
@@ -417,7 +417,7 @@ void turret_hk_dinit()
     self.target_validate_flags = TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_TEAMCHECK;
 
 
-    if (!turret_tag_setup())
+    if (!turret_tag_fire_update())
         dprint("Warning: Turret ",self.classname, " faild to initialize md3 tags\n");
 
     // Our fire routine
index 777ad90a831ed94fa6bb9370ce7c143f1eed9af2..4777722da86223327ccf145b01219422817e6ab1 100644 (file)
@@ -34,12 +34,10 @@ void turret_machinegun_std_init()
 
     self.ammo_flags = TFL_AMMO_BULLETS | TFL_AMMO_RECHARGE | TFL_AMMO_RECIVE;
     self.turrcaps_flags = TFL_TURRCAPS_PLAYERKILL;
-    self.aim_flags = TFL_AIM_LEAD;
-
-    if(cvar("g_antilag_bullets"))
-        self.turrcaps_flags |= TFL_TURRCAPS_HITSCAN;
-    else
-        self.aim_flags      |= TFL_AIM_SHOTTIMECOMPENSATE;
+    self.aim_flags = TFL_AIM_LEAD | TFL_AIM_SHOTTIMECOMPENSATE;
+    
+       if not (cvar("g_antilag_bullets"))
+               self.turrcaps_flags |= TFL_TURRCAPS_HITSCAN;
 
     if (turret_stdproc_init("machinegun_std",0,"models/turrets/base.md3","models/turrets/machinegun.md3") == 0)
     {
@@ -49,7 +47,7 @@ void turret_machinegun_std_init()
 
     self.damage_flags |= TFL_DMG_HEADSHAKE;
 
-    if (!turret_tag_setup())
+    if (!turret_tag_fire_update())
         dprint("Warning: Turret ",self.classname, " faild to initialize md3 tags\n");
 
     // Our fire routine
index e28b9b4aaed33a73a0a7963c37713798862fe52d..499d6de2352c15c55d591d762cca0d40eb1f32f1 100644 (file)
@@ -6,9 +6,14 @@ void turret_mlrs_rocket_touch();
 
 void turret_mlrs_postthink()
 {
-
     // 0 = full, 6 = empty
-    self.tur_head.frame = rint(6 - (self.ammo / self.shot_dmg));
+    self.tur_head.frame = bound(0, 6 - floor(0.1 + self.ammo / self.shot_dmg), 6);
+    if(self.tur_head.frame < 0)
+    {
+       dprint("ammo:",ftos(self.ammo),"\n");
+       dprint("shot_dmg:",ftos(self.shot_dmg),"\n");
+    }
+    
 }
 
 void turret_mlrs_attack()
@@ -106,7 +111,7 @@ void turret_mlrs_dinit()
     self.shoot_flags  |= TFL_SHOOT_VOLLYALWAYS;
     self.volly_counter = self.shot_volly;
 
-    if (!turret_tag_setup())
+    if (!turret_tag_fire_update())
         dprint("Warning: Turret ",self.classname, " faild to initialize md3 tags\n");
 
     // Our fire routine
index e4c07b667e208ee7542e75fe12f453e7b9b9b4ce..e454dadfb533b17410e5f83a4fa09ab0ea262764 100644 (file)
@@ -114,7 +114,7 @@ void turret_phaser_dinit()
 
     self.turrcaps_flags = TFL_TURRCAPS_SNIPER|TFL_TURRCAPS_HITSCAN|TFL_TURRCAPS_PLAYERKILL;
     self.ammo_flags = TFL_AMMO_ENERGY | TFL_AMMO_RECHARGE | TFL_AMMO_RECIVE;
-    self.aim_flags = TFL_AIM_ZEASE | TFL_AIM_LEAD;
+    self.aim_flags = TFL_AIM_LEAD;
 
     if (turret_stdproc_init("phaser_std",0,"models/turrets/base.md3","models/turrets/phaser.md3") == 0)
     {
@@ -122,7 +122,7 @@ void turret_phaser_dinit()
         return;
     }
 
-    if (!turret_tag_setup())
+    if (!turret_tag_fire_update())
         dprint("Warning: Turret ",self.classname, " faild to initialize md3 tags\n");
 
     self.turret_firecheckfunc = turret_phaser_firecheck;
index f79103b77fe64df3ae9170a7939d6a0b725ee04a..63466084a54d88a1bda1ef292bcb3f24f1a4dc8f 100644 (file)
@@ -133,7 +133,7 @@ void turret_plasma_std_init()
     self.damage_flags    |= TFL_DMG_HEADSHAKE;
     self.firecheck_flags |= TFL_FIRECHECK_AFF;
 
-    if (!turret_tag_setup())
+    if (!turret_tag_fire_update())
         dprint("Warning: Turret ",self.classname, " faild to initialize md3 tags\n");
 
     // Our fireing routine
@@ -165,7 +165,7 @@ void turret_plasma_dual_init()
     self.damage_flags    |= TFL_DMG_HEADSHAKE;
     self.firecheck_flags |= TFL_FIRECHECK_AFF;
 
-    if (!turret_tag_setup())
+    if (!turret_tag_fire_update())
         dprint("Warning: Turret ",self.classname, " faild to initialize md3 tags\n");
 
     // Our fireing routine
index 1d77c99ebff1cbf53b02152485c967fac682ebd7..443cd8b5626ef15645bdb0beb8c76c6811979dae 100644 (file)
@@ -155,7 +155,7 @@ void turret_tesla_dinit()
     self.target_validate_flags = TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_MISSILES |
                                  TFL_TARGETSELECT_RANGELIMTS | TFL_TARGETSELECT_TEAMCHECK;
 
-    if (!turret_tag_setup())
+    if (!turret_tag_fire_update())
         dprint("Warning: Turret ",self.classname, " faild to initialize md3 tags\n");
 
     self.turret_firefunc      = turret_tesla_fire;
index e1341b4605e48bc7cb0491a2024484d2bc2fb436..e12bbb83025b944179770233667eccb6f1393824 100644 (file)
@@ -718,7 +718,7 @@ void turret_walker_dinit()
         return;
     }
 
-    if (!turret_tag_setup())
+    if (!turret_tag_fire_update())
         dprint("Warning: Turret ",self.classname, " faild to initialize md3 tags\n");
 
     self.damage_flags |= TFL_DMG_DEATH_NOGIBS;
index b929c425f38e8080b0c7b7b30520f3f32bdabdf0..6f40e0b4d05b6ca6aa7a2c4e69ec60f0ffcec4ce 100644 (file)
@@ -398,11 +398,11 @@ float racer_pplug()
     ftmp2 = ftmp * -1;
 
     ftmp = bound(ftmp2, shortangle_f(player.v_angle_y - racer.angles_y, racer.angles_y), ftmp);
-    ftmp2 = safeangle(racer.angles_y + ftmp);
+    ftmp2 = anglemods(racer.angles_y + ftmp);
 
     // Roll
     ftmp = bound(-45, shortangle_f(player.v_angle_z + ((racer.angles_y - ftmp2) * racer_turnroll), racer.angles_z), 45);
-    ftmp = safeangle(racer.angles_z + ftmp);
+    ftmp = anglemods(racer.angles_z + ftmp);
     racer.angles_z = bound(-85, ftmp, 85);
 
     // Turn
@@ -413,7 +413,7 @@ float racer_pplug()
     ftmp2 = ftmp * -1;
 
     ftmp = bound(ftmp2,shortangle_f(player.v_angle_x - racer.angles_x,racer.angles_x),ftmp);
-    racer.angles_x = safeangle(racer.angles_x + ftmp);
+    racer.angles_x = anglemods(racer.angles_x + ftmp);
     racer.angles_x *= -1;
 
     df = racer.velocity * -0.5;
index 06392ec0db7978f515f6edc1d985ff8ffbf0f5fa..ee6d3976f6dbfa43ab9b4d9c7ac8cb3f1afed7fe 100644 (file)
@@ -458,14 +458,14 @@ float raptor_pplug()
     //vhic.angles_z = ftmp;
 
     // Turn
-    vhic.angles_y = safeangle(vhic.angles_y + ftmp);
+    vhic.angles_y = anglemods(vhic.angles_y + ftmp);
 
     // Pitch Body
     ftmp = raptor_pitchspeed  * sys_frametime;
 
     ftmp = bound(-ftmp, shortangle_f(player.v_angle_x - vhic.angles_x,vhic.angles_x), ftmp);
 
-    vhic.angles_x = bound(-60,safeangle(vhic.angles_x + ftmp),60);
+    vhic.angles_x = bound(-60,anglemods(vhic.angles_x + ftmp),60);
     vhic.angles_x *= -1;
 
     if(raptor_movestyle == 1)
index 32049c86266ece9838a5e63bda58be4203e1d9b4..ba4360550ebe161c4736eba5ec5d22fa0a331142 100644 (file)
@@ -367,7 +367,7 @@ float spiderbot_pplug()
             }
             else
             {
-                spider.angles_y = safeangle(spider.angles_y + ftmp);
+                spider.angles_y = anglemods(spider.angles_y + ftmp);
                 spider.tur_head.angles_y -= ftmp;
 
                 if(player.movement_x != 0)
index 4bee058f0fcff973d2d2173332b819559b8f91af..2268ca7cb150a558e9f83d325027213b238b4beb 100644 (file)
@@ -238,8 +238,10 @@ void lgbeam_think()
        if not(self.owner.items & IT_UNLIMITED_WEAPON_AMMO)
        {
                if(cvar("g_balance_electro_primary_ammo"))
-                       dt = min(frametime, self.owner.ammo_cells / cvar("g_balance_electro_primary_ammo"));
-               self.owner.ammo_cells = max(0, self.owner.ammo_cells - cvar("g_balance_electro_primary_ammo") * frametime);
+               {
+                       dt = min(dt, self.owner.ammo_cells / cvar("g_balance_electro_primary_ammo"));
+                       self.owner.ammo_cells = max(0, self.owner.ammo_cells - cvar("g_balance_electro_primary_ammo") * frametime);
+               }
        }
 
        W_SetupShot_Range(self.owner, TRUE, 0, "", cvar("g_balance_electro_primary_damage") * dt, cvar("g_balance_electro_primary_range"));
index da847d2709c19de897d57b1610a293537960cc75..8c81d89f72c355c4281510a50f34357da2d4d74c 100644 (file)
@@ -17,7 +17,7 @@ void W_Mine_Stick ()
 
        // in order for mines to face properly when sticking to the ground, they must be a server side entity rather than a csqc projectile
 
-       local entity newmine;
+       entity newmine;
        newmine = spawn();
        newmine.classname = self.classname;
 
@@ -197,8 +197,8 @@ void W_Mine_Damage (entity inflictor, entity attacker, float damage, float death
 
 void W_Mine_Attack (void)
 {
-       local entity mine;
-       local entity flash;
+       entity mine;
+       entity flash;
 
        // scan how many mines we placed, and return if we reached our limit
        if(cvar("g_balance_minelayer_limit"))
@@ -277,9 +277,9 @@ float w_minelayer(float req)
                if(skill >= 2) // skill 0 and 1 bots won't detonate mines!
                {
                        // decide whether to detonate mines
-                       local entity mine, targetlist, targ;
-                       local float edgedamage, coredamage, edgeradius, recipricoledgeradius, d;
-                       local float selfdamage, teamdamage, enemydamage;
+                       entity targetlist, targ;
+                       float edgedamage, coredamage, edgeradius, recipricoledgeradius, d;
+                       float selfdamage, teamdamage, enemydamage;
                        edgedamage = cvar("g_balance_minelayer_edgedamage");
                        coredamage = cvar("g_balance_minelayer_damage");
                        edgeradius = cvar("g_balance_minelayer_radius");
@@ -312,7 +312,7 @@ float w_minelayer(float req)
                                }
                                mine = find(mine, classname, "mine");
                        }
-                       local float desirabledamage;
+                       float desirabledamage;
                        desirabledamage = enemydamage;
                        if (teamplay != 1 && time > self.invincible_finished && time > self.spawnshieldtime)
                                desirabledamage = desirabledamage - selfdamage * cvar("g_balance_selfdamagepercent");
@@ -341,7 +341,7 @@ float w_minelayer(float req)
                                                targ = targ.chain;
                                        }
                                }else{
-                                       local float distance; distance= bound(300,vlen(self.origin-self.enemy.origin),30000);
+                                       float distance; distance= bound(300,vlen(self.origin-self.enemy.origin),30000);
                                        //As the distance gets larger, a correct detonation gets near imposible
                                        //Bots are assumed to use the mine spawnfunc_light to see if the mine gets near a player
                                        if(v_forward * normalize(mine.origin - self.enemy.origin)< 0.1)
index e4c6347fedf430d3f505b5ce7b66e22815f83409..61af784e0e08d8f0c92ce1fb79ec41bc9a0e7c6e 100644 (file)
@@ -2,23 +2,23 @@
 REGISTER_WEAPON(NEX, w_nex, IT_CELLS, 7, WEP_FLAG_NORMAL | WEP_TYPE_HITSCAN, BOT_PICKUP_RATING_HIGH, "nex", "nex", "Nex");
 #else
 #ifdef SVQC
-void SendCSQCNexBeamParticle() {
+void SendCSQCNexBeamParticle(float charge) {
        vector v;
        v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos);
        WriteByte(MSG_BROADCAST, SVC_TEMPENTITY);
        WriteByte(MSG_BROADCAST, TE_CSQC_NEXGUNBEAMPARTICLE);
-       
        WriteCoord(MSG_BROADCAST, w_shotorg_x);
        WriteCoord(MSG_BROADCAST, w_shotorg_y);
        WriteCoord(MSG_BROADCAST, w_shotorg_z);
        WriteCoord(MSG_BROADCAST, v_x);
        WriteCoord(MSG_BROADCAST, v_y);
        WriteCoord(MSG_BROADCAST, v_z);
+       WriteByte(MSG_BROADCAST, bound(0, 255 * charge, 255));
 }
 
 void W_Nex_Attack (float issecondary)
 {
-       float mydmg, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, myammo, f;
+       float mydmg, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, myammo, charge;
        if(issecondary)
        {
                mydmg = cvar("g_balance_nex_secondary_damage");
@@ -43,12 +43,15 @@ 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"), self.nexspeed);
-
-       // TODO: make it more obvious (through effects, indicator on weapon) that damage increases when speed increases
-       mydmg *= f;
-       myforce *= f;
-       //print("^1Damage: ^7", ftos(mydmg), "\n");
+       if(cvar("g_balance_nex_charge"))
+       {
+               charge = self.nex_charge;
+               self.nex_charge *= cvar("g_balance_nex_charge_shot_multiplier"); // do this AFTER setting mydmg/myforce
+       }
+       else
+               charge = 1;
+       mydmg *= charge;
+       myforce *= charge;
 
        W_SetupShot (self, TRUE, 5, "weapons/nexfire.wav", mydmg);
 
@@ -59,7 +62,7 @@ void W_Nex_Attack (float issecondary)
                AnnounceTo(self, "yoda");
 
        //beam and muzzle flash done on client
-       SendCSQCNexBeamParticle();
+       SendCSQCNexBeamParticle(charge);
        
        // flash and burn the wall
        if (trace_ent.solid == SOLID_BSP && !(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT))
@@ -73,6 +76,7 @@ void spawnfunc_weapon_nex (void); // defined in t_items.qc
 
 float w_nex(float req)
 {
+       float dt;
        if (req == WR_AIM)
        {
                self.BUTTON_ATCK = bot_aim(1000000, 0, 1, FALSE);
@@ -80,6 +84,8 @@ float w_nex(float req)
        }
        else if (req == WR_THINK)
        {
+               if(cvar("g_balance_nex_charge") && self.nex_charge < cvar("g_balance_nex_charge_limit"))
+                       self.nex_charge = min(1, self.nex_charge + cvar("g_balance_nex_charge_rate") * frametime / W_TICSPERFRAME);
                if (self.BUTTON_ATCK)
                {
                        if (weapon_prepareattack(0, cvar("g_balance_nex_primary_refire")))
@@ -92,10 +98,23 @@ float w_nex(float req)
                {
                        if(cvar("g_balance_nex_secondary_charge"))
                        {
-                               if(self.ammo_cells)
+                               dt = frametime / W_TICSPERFRAME;
+                               if(self.nex_charge < 1)
                                {
-                                       self.nexspeed = min(cvar("g_balance_nex_velocitydependent_maxspeed"), self.nexspeed + cvar("g_balance_nex_secondary_charge_rate") * frametime / W_TICSPERFRAME);
-                                       self.ammo_cells = max(0, self.ammo_cells - cvar("g_balance_nex_secondary_charge_ammo") * frametime / W_TICSPERFRAME);
+                                       dt = min(dt, (1 - self.nex_charge) / cvar("g_balance_nex_secondary_charge_rate"));
+                                       if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
+                                       {
+                                               if(cvar("g_balance_nex_secondary_ammo"))
+                                               {
+                                                       dt = min(dt, (self.ammo_cells - cvar("g_balance_nex_primary_ammo")) / cvar("g_balance_nex_secondary_ammo"));
+                                                       dt = max(0, dt);
+                                                       if(dt > 0)
+                                                       {
+                                                               self.ammo_cells = max(cvar("g_balance_nex_secondary_ammo"), self.ammo_cells - cvar("g_balance_nex_secondary_ammo") * dt);
+                                                       }
+                                               }
+                                       }
+                                       self.nex_charge += dt * cvar("g_balance_nex_secondary_charge_rate");
                                }
                        }
                        else if(cvar("g_balance_nex_secondary"))
@@ -124,7 +143,11 @@ float w_nex(float req)
        else if (req == WR_CHECKAMMO1)
                return self.ammo_cells >= cvar("g_balance_nex_primary_ammo");
        else if (req == WR_CHECKAMMO2)
+       {
+               if(cvar("g_balance_nex_secondary_charge"))
+                       return self.ammo_cells >= cvar("g_balance_nex_primary_ammo");
                return self.ammo_cells >= cvar("g_balance_nex_secondary_ammo");
+       }
        return TRUE;
 };
 #endif
index d4056763a84d1e418075a0bd7ffe6a35318eb798..12f7647e570c9b262373350a20c4260de8238152 100644 (file)
@@ -291,9 +291,13 @@ void W_Rocket_Think (void)
 
 void W_Rocket_Touch (void)
 {
+       if(WarpZone_Projectile_Touch())
+       {
+               if(wasfreed(self))
+                       W_Rocket_Unregister();
+               return;
+       }
        W_Rocket_Unregister();
-
-       PROJECTILE_TOUCH;
        W_Rocket_Explode ();
 }
 
index 1e4fc3e630c392be3223e02d4eceb526d234215c..bc23cd11ba117713b6ccc9c99ba36e0d6d68626a 100644 (file)
@@ -411,6 +411,8 @@ void WarpZone_TraceToss(entity e, entity forent)
 
 entity WarpZone_TrailParticles_trace_callback_own;
 float WarpZone_TrailParticles_trace_callback_eff;
+float WarpZone_TrailParticles_trace_callback_f;
+float WarpZone_TrailParticles_trace_callback_flags;
 void WarpZone_TrailParticles_trace_callback(vector from, vector endpos, vector to)
 {
        trailparticles(WarpZone_TrailParticles_trace_callback_own, WarpZone_TrailParticles_trace_callback_eff, from, endpos);
@@ -423,6 +425,22 @@ void WarpZone_TrailParticles(entity own, float eff, vector org, vector end)
        WarpZone_TraceBox_ThroughZone(org, '0 0 0', '0 0 0', end, MOVE_NOMONSTERS, world, world, WarpZone_TrailParticles_trace_callback);
 }
 
+#ifdef CSQC
+void WarpZone_TrailParticles_WithMultiplier_trace_callback(vector from, vector endpos, vector to)
+{
+       boxparticles(WarpZone_TrailParticles_trace_callback_eff, WarpZone_TrailParticles_trace_callback_own, from, endpos, WarpZone_TrailParticles_trace_callback_own.velocity, WarpZone_TrailParticles_trace_callback_own.velocity, WarpZone_TrailParticles_trace_callback_f, WarpZone_TrailParticles_trace_callback_flags);
+}
+
+void WarpZone_TrailParticles_WithMultiplier(entity own, float eff, vector org, vector end, float f, float boxflags)
+{
+       WarpZone_TrailParticles_trace_callback_own = own;
+       WarpZone_TrailParticles_trace_callback_eff = eff;
+       WarpZone_TrailParticles_trace_callback_f = f;
+       WarpZone_TrailParticles_trace_callback_flags = boxflags;
+       WarpZone_TraceBox_ThroughZone(org, '0 0 0', '0 0 0', end, MOVE_NOMONSTERS, world, world, WarpZone_TrailParticles_WithMultiplier_trace_callback);
+}
+#endif
+
 float WarpZone_PlaneDist(entity wz, vector v)
 {
        return (v - wz.warpzone_origin) * wz.warpzone_forward;
index 9ccd5216a63186ad15da4c573cd368d8db51d481..1b594d96d73b7c9da95404ad43e73185a1f66ba6 100644 (file)
@@ -38,6 +38,9 @@ void WarpZone_TraceLine(vector org, vector end, float nomonsters, entity forent)
 void WarpZone_TraceToss(entity e, entity forent);
 void WarpZone_TraceToss_ThroughZone(entity e, entity forent, entity zone, WarpZone_trace_callback_t cb);
 void WarpZone_TrailParticles(entity own, float eff, vector org, vector end);
+#ifdef CSQC
+void WarpZone_TrailParticles_WithMultiplier(entity own, float eff, vector org, vector end, float f, float boxflags);
+#endif
 
 .vector WarpZone_findradius_dist;
 .vector WarpZone_findradius_nearest;
index 6e0ecb5b33811de1c266da4a90c617a84d16b2c3..42cc94c3af1e25b65ad044e033753bc0469305b9 100644 (file)
@@ -243,7 +243,13 @@ float WarpZone_CheckProjectileImpact()
        entity wz;
        wz = WarpZone_Find(self.origin + self.mins, self.origin + self.maxs);
        if(!wz)
-               return FALSE;
+               return 0;
+       if(self.warpzone_teleport_time == time)
+       {
+               // just ignore if we got teleported this frame already and now hit a wall and are in a warpzone again (this will cause a detonation)
+               // print("2 warps 1 frame\n");
+               return -1;
+       }
        o0 = self.origin;
        v0 = self.velocity;
        a0 = self.angles;
@@ -262,38 +268,40 @@ float WarpZone_CheckProjectileImpact()
        pd = WarpZone_TargetPlaneDist(wz, self.origin);
        if(pd < mpd)
        {
-               dpd = normalize(self.velocity) * self.warpzone_targetforward;
+               dpd = normalize(self.velocity) * wz.warpzone_targetforward;
                setorigin(self, self.origin + normalize(self.velocity) * ((mpd - pd) / dpd));
                if(!WarpZoneLib_MoveOutOfSolid(self))
                {
                        setorigin(self, o0);
                        self.angles = a0;
                        self.velocity = v0;
-                       return FALSE;
+                       return 0;
                }
        }
        WarpZone_RefSys_Add(self, wz);
        WarpZone_StoreProjectileData(self);
        self.warpzone_teleport_time = time;
 
-       return TRUE;
+       return +1;
 }
 float WarpZone_Projectile_Touch()
 {
+       float f;
        if(other.classname == "trigger_warpzone")
                return TRUE;
        if(WarpZone_Projectile_Touch_ImpactFilter_Callback())
                return TRUE;
-       if(WarpZone_CheckProjectileImpact())
-               return TRUE;
-       if(self.warpzone_teleport_time == time) // already got teleported this frame? no collision then please
+       if((f = WarpZone_CheckProjectileImpact()) != 0)
+               return (f > 0);
+       if(self.warpzone_teleport_time == time)
        {
+               // sequence: hit warpzone, get teleported, hit wall
+               // print("2 hits 1 frame\n");
                setorigin(self, self.warpzone_oldorigin);
                self.velocity = self.warpzone_oldvelocity;
                self.angles = self.warpzone_oldangles;
                return TRUE;
        }
-
        return FALSE;
 }
 
index 40228b079a962d8d2a709a55bd781cb9b26ce62f..1ae46d1d4068f53d9e6362330d7c30064afd9cf1 100644 (file)
--- a/quake.rc
+++ b/quake.rc
@@ -8,3 +8,4 @@ stuffcmds
 //startdemos demos/demo1 demos/demo2 demos/demo3
 //startdemos
 //play announcer/male/welcome.ogg
+crypto_keygen 0 http://rm.endoftheinternet.org/~xonotic/keygen/?ca=0&key=
index d3fdb8fe02483b327cfda7cff7e6c7c2346fa097..8cfae10f605247f87c4f241ed3b62b88928a28f7 100644 (file)
Binary files a/sound/misc/hitground1.ogg and b/sound/misc/hitground1.ogg differ
index 031ee35493bf0c80c92d294c3bbd44ba7d123002..1f8a7441b43561d064a1d88e30f8466959b94e31 100644 (file)
Binary files a/sound/misc/hitground2.ogg and b/sound/misc/hitground2.ogg differ
index e139a0c7d77d64a6455f55a19b86641f68ef5431..73974a4de470f2f3beab0cb9d150ccb178185fe9 100644 (file)
Binary files a/sound/misc/hitground3.ogg and b/sound/misc/hitground3.ogg differ
index 12e02cd00bcd53ee0bad4db69e25864d32ff1ee1..0c40620d1604eab1b9c87e1361a99be99bb43f70 100644 (file)
Binary files a/sound/misc/hitground4.ogg and b/sound/misc/hitground4.ogg differ
index 8ae8803c1428f64242a2b54f233ca4bdfde35e7a..03bee01090caef40675d18674328e41df57edf78 100644 (file)
Binary files a/sound/misc/metalhitground1.ogg and b/sound/misc/metalhitground1.ogg differ
index 4928c91e2366fd419a1697adbc09cabe77325891..50f315f274fc0555e71c49550f3b61a7d979f3f6 100644 (file)
Binary files a/sound/misc/metalhitground2.ogg and b/sound/misc/metalhitground2.ogg differ
index 783e47cd40338244c4d30c13ef7a97281a98971d..0f3edb1060ff4ee9900e005ebf97a5a863fa4ef4 100644 (file)
Binary files a/sound/misc/metalhitground3.ogg and b/sound/misc/metalhitground3.ogg differ
index d4de2860378215b923d06fd2d695653b2514bff0..ad2b262557ebfbddfc67c8ec4a553bd4d0e29a1d 100644 (file)
Binary files a/sound/misc/metalhitground4.ogg and b/sound/misc/metalhitground4.ogg differ
diff --git a/sound/weapons/campingrifle_fire2.ogg b/sound/weapons/campingrifle_fire2.ogg
deleted file mode 100644 (file)
index 721b37b..0000000
Binary files a/sound/weapons/campingrifle_fire2.ogg and /dev/null differ
diff --git a/sound/weapons/campingrifle_fire2.wav b/sound/weapons/campingrifle_fire2.wav
new file mode 100644 (file)
index 0000000..66bda4f
Binary files /dev/null and b/sound/weapons/campingrifle_fire2.wav differ
diff --git a/sound/weapons/dryfire.wav b/sound/weapons/dryfire.wav
new file mode 100644 (file)
index 0000000..81e86b1
Binary files /dev/null and b/sound/weapons/dryfire.wav differ
index 762bfc057b6a6d33d0da740ee2df9e3b7c209306..17ba6a5abafe09bc945dfed207b8bd08dc78b2c3 100644 (file)
@@ -7,6 +7,8 @@ set g_turrets_unit_flac_std_shot_radius 100
 set g_turrets_unit_flac_std_shot_speed 9000
 set g_turrets_unit_flac_std_shot_spread 0.02
 set g_turrets_unit_flac_std_shot_force 25
+set g_turrets_unit_flac_std_shot_volly 0
+set g_turrets_unit_flac_std_shot_volly_refire 0
 
 set g_turrets_unit_flac_std_target_range 4000
 set g_turrets_unit_flac_std_target_range_min 500
@@ -23,11 +25,11 @@ set g_turrets_unit_flac_std_ammo 400
 set g_turrets_unit_flac_std_ammo_recharge 100
 
 set g_turrets_unit_flac_std_aim_firetolerance_dist 150
-set g_turrets_unit_flac_std_aim_speed 360
+set g_turrets_unit_flac_std_aim_speed 200
 set g_turrets_unit_flac_std_aim_maxrot 360
 set g_turrets_unit_flac_std_aim_maxpitch 35
 
 set g_turrets_unit_flac_std_track_type 3
-set g_turrets_unit_flac_std_track_accel_pitch 0.25
-set g_turrets_unit_flac_std_track_accel_rot 0.8
-set g_turrets_unit_flac_std_track_blendrate 0.6
+set g_turrets_unit_flac_std_track_accel_pitch 0.5
+set g_turrets_unit_flac_std_track_accel_rot 0.7
+set g_turrets_unit_flac_std_track_blendrate 0.2
index 784aebba0c0cce5415ad5f0f917cc6859584a5ec..cdf7546b8c93234b8a4cf5604c54c24f2d9b0429 100644 (file)
@@ -2,7 +2,7 @@ set g_turrets_unit_hellion_std_health 500
 set g_turrets_unit_hellion_std_respawntime 90
 
 set g_turrets_unit_hellion_std_shot_dmg 50
-set g_turrets_unit_hellion_std_shot_refire 0.25
+set g_turrets_unit_hellion_std_shot_refire 0.2
 set g_turrets_unit_hellion_std_shot_radius 80
 
 set g_turrets_unit_hellion_std_shot_speed 650
@@ -35,6 +35,6 @@ set g_turrets_unit_hellion_std_aim_maxpitch 20
 
 set g_turrets_unit_hellion_std_track_type 3
 set g_turrets_unit_hellion_std_track_accel_pitch 0.25
-set g_turrets_unit_hellion_std_track_accel_rot 0.5
-set g_turrets_unit_hellion_std_track_blendrate 0.75
+set g_turrets_unit_hellion_std_track_accel_rot 0.6
+set g_turrets_unit_hellion_std_track_blendrate 0.25
 
index 808235328a13018ec52d87d874ea2ab29578c8be..590181e09d1f0c01f12a82487ee7e3a1e5d4d8d1 100644 (file)
@@ -38,6 +38,6 @@ set g_turrets_unit_hk_std_aim_maxpitch 20
 
 set g_turrets_unit_hk_std_track_type 3
 set g_turrets_unit_hk_std_track_accel_pitch 0.25
-set g_turrets_unit_hk_std_track_accel_rot 0.5
-set g_turrets_unit_hk_std_track_blendrate 0.25
+set g_turrets_unit_hk_std_track_accel_rot 0.6
+set g_turrets_unit_hk_std_track_blendrate 0.2
 
index 39b60aef0bb9386cc9c9efc66fe891e63e04eaf7..1fa1e48d5ca6569dd971f8575d5db80560986b87 100644 (file)
@@ -26,13 +26,13 @@ set g_turrets_unit_machinegun_std_ammo 300
 set g_turrets_unit_machinegun_std_ammo_recharge 75
 
 set g_turrets_unit_machinegun_std_aim_firetolerance_dist 25
-set g_turrets_unit_machinegun_std_aim_speed 720
+set g_turrets_unit_machinegun_std_aim_speed 120
 set g_turrets_unit_machinegun_std_aim_maxrot 360
 set g_turrets_unit_machinegun_std_aim_maxpitch 25
 
 set g_turrets_unit_machinegun_std_track_type 3
-set g_turrets_unit_machinegun_std_track_accel_pitch 0.5
-set g_turrets_unit_machinegun_std_track_accel_rot 0.75
-set g_turrets_unit_machinegun_std_track_blendrate 0.5
+set g_turrets_unit_machinegun_std_track_accel_pitch 0.4
+set g_turrets_unit_machinegun_std_track_accel_rot 0.9
+set g_turrets_unit_machinegun_std_track_blendrate 0.2
 
 
index 8a0f1a2689bff13f2e6ed5305eddac421d4d2aca..c3f3f7859d437f9d09bc2aade560a001433b5857 100644 (file)
@@ -9,7 +9,10 @@ set g_turrets_unit_mlrs_std_shot_spread 0.05
 set g_turrets_unit_mlrs_std_shot_force 25
 
 set g_turrets_unit_mlrs_std_shot_volly 6
-set g_turrets_unit_mlrs_std_shot_volly_refire 1
+
+// !must be correctly matched with ammo_recharge as this unit use
+// volly_always. (means ammo_recharge * ammo_max must be eaqual to volly_refire)
+set g_turrets_unit_mlrs_std_shot_volly_refire 4
 
 set g_turrets_unit_mlrs_std_target_range 3000
 set g_turrets_unit_mlrs_std_target_range_min 500
@@ -21,16 +24,17 @@ set g_turrets_unit_mlrs_std_target_select_anglebias 0.5
 set g_turrets_unit_mlrs_std_target_select_playerbias 1
 set g_turrets_unit_mlrs_std_target_select_missilebias 0
 
-set g_turrets_unit_mlrs_std_ammo_max 420
-set g_turrets_unit_mlrs_std_ammo 420
-set g_turrets_unit_mlrs_std_ammo_recharge 70
+// !must be shot_dmg * 6 as this unit uses ammo to control the animation
+set g_turrets_unit_mlrs_std_ammo_max 300
+set g_turrets_unit_mlrs_std_ammo 300
+set g_turrets_unit_mlrs_std_ammo_recharge 75
 
 set g_turrets_unit_mlrs_std_aim_firetolerance_dist 120
-set g_turrets_unit_mlrs_std_aim_speed 270
+set g_turrets_unit_mlrs_std_aim_speed 100
 set g_turrets_unit_mlrs_std_aim_maxrot 360
 set g_turrets_unit_mlrs_std_aim_maxpitch 20
 
 set g_turrets_unit_mlrs_std_track_type 3
 set g_turrets_unit_mlrs_std_track_accel_pitch 0.5
-set g_turrets_unit_mlrs_std_track_accel_rot 0.8
+set g_turrets_unit_mlrs_std_track_accel_rot 0.7
 set g_turrets_unit_mlrs_std_track_blendrate 0.2
index 1a745218b914c87cb890a011f351b0e2a8d1d5e5..31de90489428c28b16e29a9518939bd33e5f3352 100644 (file)
@@ -27,12 +27,12 @@ set g_turrets_unit_phaser_std_ammo_recharge 25
 
 set g_turrets_unit_phaser_std_aim_firetolerance_dist 100
 
-set g_turrets_unit_phaser_std_aim_speed 540
+set g_turrets_unit_phaser_std_aim_speed 300
 set g_turrets_unit_phaser_std_aim_maxrot 360
 set g_turrets_unit_phaser_std_aim_maxpitch 30
 
 set g_turrets_unit_phaser_std_track_type 3
 set g_turrets_unit_phaser_std_track_accel_pitch 0.5
 set g_turrets_unit_phaser_std_track_accel_rot 0.65
-set g_turrets_unit_phaser_std_track_blendrate 0.5
+set g_turrets_unit_phaser_std_track_blendrate 0.2
 
index f42778d49e1f9326958f1e73d7eed53038816a0f..949a3e84bda931dc8768703c04440fa8bed163b6 100644 (file)
@@ -46,7 +46,7 @@ set g_turrets_unit_plasma_std_ammo_recharge 40
 // If predicted emeypos is this or closer to predicted impact, fire is ok
 set g_turrets_unit_plasma_std_aim_firetolerance_dist 120
 // Aim how fast. for track_type 1 this is dgr/sec, for 2 & 3 its the maximum angle speed added each second
-set g_turrets_unit_plasma_std_aim_speed 270
+set g_turrets_unit_plasma_std_aim_speed 200
 // Max rottation of head
 set g_turrets_unit_plasma_std_aim_maxrot 360
 // Max pitch  of head
@@ -59,6 +59,6 @@ set g_turrets_unit_plasma_std_aim_maxpitch 30
 set g_turrets_unit_plasma_std_track_type 3
 // Following controls how _track_type = 3 works.
 set g_turrets_unit_plasma_std_track_accel_pitch 0.5
-set g_turrets_unit_plasma_std_track_accel_rot 0.8
+set g_turrets_unit_plasma_std_track_accel_rot 0.7
 set g_turrets_unit_plasma_std_track_blendrate 0.2
 
index 75611c2dc08a4642f98526b7a5feeddc29b43e9b..723f6441ae2f4b5d101ff16dc2b28a8ded2fe5fe 100644 (file)
@@ -27,12 +27,12 @@ set g_turrets_unit_plasma_dual_ammo_recharge 40
 
 set g_turrets_unit_plasma_dual_aim_firetolerance_dist 200
 
-set g_turrets_unit_plasma_dual_aim_speed 270
+set g_turrets_unit_plasma_dual_aim_speed 100
 set g_turrets_unit_plasma_dual_aim_maxrot 360
 set g_turrets_unit_plasma_dual_aim_maxpitch 30
 
 set g_turrets_unit_plasma_dual_track_type 3
 set g_turrets_unit_plasma_dual_track_accel_pitch 0.5
-set g_turrets_unit_plasma_dual_track_accel_rot 0.75
-set g_turrets_unit_plasma_dual_track_blendrate 0.75
+set g_turrets_unit_plasma_dual_track_accel_rot 0.7
+set g_turrets_unit_plasma_dual_track_blendrate 0.2
 
index efc6b5c51906c9c20af6978a01cefab9ec2da954..368b64b42051a078fce4369497616de234b67eee 100644 (file)
@@ -26,6 +26,7 @@ FruitieX
 *Music / Sound FX
 mand1nga
 Merlijn Hofstra
+remaxim
 
 *Engine Code Additions & QA
 Rudolf "divVerent" Polzer
@@ -48,6 +49,7 @@ DarkPlaces
 by Forest "LordHavoc" Hale
 
 **Active Contributors
+Antonio "terencehill" Piu
 Ben "MooKow" Banker
 Calinou
 Kristian "morfar" Johansson