]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge commit '6f440770dbdb' into atheros/item_keys
authorPrzemysław Grzywacz <nexather@gmail.com>
Tue, 18 Oct 2011 17:38:00 +0000 (19:38 +0200)
committerPrzemysław Grzywacz <nexather@gmail.com>
Tue, 18 Oct 2011 17:38:00 +0000 (19:38 +0200)
219 files changed:
balance25.cfg
balanceFruit.cfg
balanceLeeStricklin.cfg
balanceXonotic.cfg
balancetZork.cfg
defaultXonotic.cfg
effectinfo.txt
effects-high.cfg
effects-low.cfg
effects-med.cfg
effects-normal.cfg
effects-omg.cfg
effects-ultimate.cfg
effects-ultra.cfg
keybinds.txt
models/gibs/chunk.mdl_0.tga [new file with mode: 0644]
models/gibs/gib1.md3 [deleted file]
models/gibs/gib1.mdl [deleted file]
models/gibs/gib2.md3 [deleted file]
models/gibs/gib2.mdl [deleted file]
models/gibs/gib3.md3 [deleted file]
models/gibs/gib3.mdl [deleted file]
models/gibs/gib4.md3 [deleted file]
models/gibs/gib5.md3 [deleted file]
models/gibs/gib6.md3 [deleted file]
models/turrets/base.tga
models/turrets/base_shirt.tga [new file with mode: 0644]
models/turrets/ewheel-base.tga
models/turrets/ewheel-base_glow.tga [new file with mode: 0644]
models/turrets/ewheel-base_shirt.tga [new file with mode: 0644]
models/turrets/mggun.tga
models/turrets/mggun_shirt.tga [new file with mode: 0644]
models/turrets/mlrs.tga
models/turrets/mlrs_glow.tga
models/turrets/phaserbody.tga
models/turrets/phaserbody_glow.tga
models/turrets/phasermag.tga
models/turrets/phasermag_glow.tga
models/turrets/plasmagun.tga
models/turrets/plasmagun_glow.tga
models/turrets/plasmagun_shirt.tga [new file with mode: 0644]
models/turrets/reactor.tga
models/turrets/reactor_glow.tga
models/turrets/rocket.tga
models/turrets/rocket_glow.tga
models/turrets/tesla.tga
models/turrets/tesla_glow.tga
models/turrets/walker_base.tga
models/turrets/walker_base_glow.tga
models/weapons/akordeon.tga [new file with mode: 0644]
models/weapons/akordeon_gloss.tga [new file with mode: 0644]
models/weapons/akordeon_reflect.tga [new file with mode: 0644]
models/weapons/h_akordeon.iqm [new file with mode: 0644]
models/weapons/v_akordeon.md3 [new file with mode: 0644]
qcsrc/client/Main.qc
qcsrc/client/View.qc
qcsrc/client/autocvars.qh
qcsrc/client/ctf.qc
qcsrc/client/damage.qc
qcsrc/client/hud.qc
qcsrc/client/hud.qh
qcsrc/client/projectile.qc
qcsrc/client/teamradar.qc
qcsrc/client/tturrets.qc
qcsrc/client/tuba.qc
qcsrc/common/constants.qh
qcsrc/common/urllib.qc
qcsrc/common/urllib.qh
qcsrc/common/util.qc
qcsrc/menu/gamecommand.qc
qcsrc/menu/item/borderimage.c
qcsrc/menu/item/container.c
qcsrc/menu/item/gecko.c
qcsrc/menu/item/modalcontroller.c
qcsrc/menu/item/nexposee.c
qcsrc/menu/menu.qc
qcsrc/menu/menu.qh
qcsrc/menu/xonotic/dialog_multiplayer_create_mutators.c
qcsrc/menu/xonotic/dialog_settings_audio.c
qcsrc/menu/xonotic/dialog_settings_effects.c
qcsrc/menu/xonotic/dialog_settings_video.c
qcsrc/menu/xonotic/serverlist.c
qcsrc/menu/xonotic/util.qc
qcsrc/menu/xonotic/util.qh
qcsrc/server/assault.qc
qcsrc/server/attic/monsters/ai.qc [new file with mode: 0644]
qcsrc/server/attic/monsters/defs.qc [new file with mode: 0644]
qcsrc/server/attic/monsters/fight.qc [new file with mode: 0644]
qcsrc/server/attic/monsters/m_monsters.qc [new file with mode: 0644]
qcsrc/server/attic/monsters/monster_zombie.qc [new file with mode: 0644]
qcsrc/server/attic/vehicles/bumblebee.qc [new file with mode: 0644]
qcsrc/server/attic/vehicles/collision.qc [new file with mode: 0644]
qcsrc/server/attic/vehicles/network.qc [new file with mode: 0644]
qcsrc/server/attic/verbstack.qc [new file with mode: 0644]
qcsrc/server/autocvars.qh
qcsrc/server/bot/aim.qc
qcsrc/server/bot/bot.qc
qcsrc/server/bot/havocbot/havocbot.qc
qcsrc/server/bot/havocbot/role_assault.qc
qcsrc/server/bot/havocbot/role_ctf.qc
qcsrc/server/bot/havocbot/role_freezetag.qc
qcsrc/server/bot/havocbot/role_keepaway.qc
qcsrc/server/bot/havocbot/role_keyhunt.qc
qcsrc/server/bot/havocbot/role_onslaught.qc
qcsrc/server/bot/havocbot/roles.qc
qcsrc/server/bot/navigation.qc
qcsrc/server/bot/scripting.qc
qcsrc/server/bot/waypoints.qc
qcsrc/server/campaign.qc
qcsrc/server/cl_client.qc
qcsrc/server/cl_impulse.qc
qcsrc/server/cl_physics.qc
qcsrc/server/cl_player.qc
qcsrc/server/cl_weapons.qc
qcsrc/server/cl_weaponsystem.qc
qcsrc/server/clientcommands.qc
qcsrc/server/ctf.qc
qcsrc/server/defs.qh
qcsrc/server/domination.qc
qcsrc/server/ent_cs.qc
qcsrc/server/extensions.qh
qcsrc/server/func_breakable.qc
qcsrc/server/g_damage.qc
qcsrc/server/g_hook.qc
qcsrc/server/g_lights.qc
qcsrc/server/g_subs.qc
qcsrc/server/g_tetris.qc
qcsrc/server/g_triggers.qc
qcsrc/server/g_world.qc
qcsrc/server/gamecommand.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/mode_onslaught.qc
qcsrc/server/monsters/ai.qc [deleted file]
qcsrc/server/monsters/defs.qc [deleted file]
qcsrc/server/monsters/fight.qc [deleted file]
qcsrc/server/monsters/m_monsters.qc [deleted file]
qcsrc/server/monsters/monster_zombie.qc [deleted file]
qcsrc/server/mutators/mutator_invincibleproj.qc [new file with mode: 0644]
qcsrc/server/mutators/mutators.qh
qcsrc/server/nexball.qc
qcsrc/server/playerstats.qc
qcsrc/server/playerstats.qh
qcsrc/server/progs.src
qcsrc/server/sv_main.qc
qcsrc/server/t_halflife.qc
qcsrc/server/t_items.qc
qcsrc/server/t_jumppads.qc
qcsrc/server/t_plats.qc
qcsrc/server/t_quake3.qc
qcsrc/server/t_swamp.qc
qcsrc/server/t_teleporters.qc
qcsrc/server/target_spawn.qc
qcsrc/server/teamplay.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_common.qc [deleted file]
qcsrc/server/tturrets/units/unit_ewheel.qc
qcsrc/server/tturrets/units/unit_flac.qc
qcsrc/server/tturrets/units/unit_fusionreactor.qc
qcsrc/server/tturrets/units/unit_hellion.qc
qcsrc/server/tturrets/units/unit_hk.qc
qcsrc/server/tturrets/units/unit_mlrs.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/bumblebee.qc [deleted file]
qcsrc/server/vehicles/collision.qc [deleted file]
qcsrc/server/vehicles/network.qc [deleted file]
qcsrc/server/vehicles/vehicles.qc
qcsrc/server/verbstack.qc [deleted file]
qcsrc/server/vote.qc
qcsrc/server/w_common.qc
qcsrc/server/w_crylink.qc
qcsrc/server/w_electro.qc
qcsrc/server/w_fireball.qc
qcsrc/server/w_grenadelauncher.qc
qcsrc/server/w_hagar.qc
qcsrc/server/w_hlac.qc
qcsrc/server/w_hook.qc
qcsrc/server/w_laser.qc
qcsrc/server/w_minelayer.qc
qcsrc/server/w_minstanex.qc
qcsrc/server/w_nex.qc
qcsrc/server/w_porto.qc
qcsrc/server/w_rifle.qc
qcsrc/server/w_rocketlauncher.qc
qcsrc/server/w_seeker.qc
qcsrc/server/w_shotgun.qc
qcsrc/server/w_tuba.qc
qcsrc/server/w_uzi.qc
qcsrc/server/waypointsprites.qc
qcsrc/warpzonelib/server.qc
scripts/akordeon.shader [new file with mode: 0644]
scripts/gibs.shader [new file with mode: 0644]
scripts/nutsandbolts.shader [deleted file]
scripts/turrets.shader
sound/misc/medplat1.ogg [deleted file]
sound/misc/medplat2.ogg [deleted file]
sound/weapons/tuba1_loopnote-12.ogg [new file with mode: 0644]
sound/weapons/tuba1_loopnote-18.ogg [new file with mode: 0644]
sound/weapons/tuba1_loopnote-6.ogg [new file with mode: 0644]
sound/weapons/tuba1_loopnote-src.txt [new file with mode: 0644]
sound/weapons/tuba1_loopnote0.ogg [new file with mode: 0644]
sound/weapons/tuba1_loopnote12.ogg [new file with mode: 0644]
sound/weapons/tuba1_loopnote18.ogg [new file with mode: 0644]
sound/weapons/tuba1_loopnote24.ogg [new file with mode: 0644]
sound/weapons/tuba1_loopnote6.ogg [new file with mode: 0644]
sound/weapons/tuba_loopnote-12.ogg
sound/weapons/tuba_loopnote-18.ogg
sound/weapons/tuba_loopnote-6.ogg
sound/weapons/tuba_loopnote0.ogg
sound/weapons/tuba_loopnote12.ogg
sound/weapons/tuba_loopnote18.ogg
sound/weapons/tuba_loopnote24.ogg
sound/weapons/tuba_loopnote6.ogg

index 81381f4638cbc21084ac14e196e476554331e121..91db8f2386099ce8bd131b13cb2ce1d602fc87be 100644 (file)
@@ -155,6 +155,13 @@ set g_balance_firetransfer_time 0.9
 set g_balance_firetransfer_damage 0.8
 set g_throughfloor_damage 1
 set g_throughfloor_force 1
+set g_projectiles_damage 2
+// possible values:
+// -2: absolutely no damage to projectiles (no exceptions)
+// -1: no damage other than the exceptions (electro combo, hagar join explode, minelayer mines)
+// 0: only damage from contents (lava/slime) or exceptions 
+// 1: only self damage or damage from contents or exceptions
+// 2: allow all damage to projectiles normally
 set g_projectiles_newton_style 2
 // possible values:
 // 0: absolute velocity projectiles (like Quake)
@@ -179,6 +186,13 @@ set g_balance_falldamage_minspeed 1400
 set g_balance_falldamage_factor 0.15
 set g_balance_falldamage_maxdamage 25
 set g_balance_damagepush_speedfactor 0
+set g_balance_contents_damagerate 0.2 // ticrate interval for applying damage with playerdamage/projectiledamage
+set g_balance_contents_drowndelay 10 // time under water before a player begins drowning
+set g_balance_contents_playerdamage_drowning 20 // damage per second for while player is drowning
+set g_balance_contents_playerdamage_lava 50 // damage per second for while player is inside lava
+set g_balance_contents_playerdamage_slime 30 // damage per second for while player is inside slime
+set g_balance_contents_projectiledamage 10000 // instantly kill projectiles upon touching lava/slime
+set g_maxpushtime 8.0 "timeout for kill credit when your damage knocks someone into a death trap"
 // }}}
 
 // {{{ powerups
@@ -209,6 +223,7 @@ set g_balance_grapplehook_length_min 50
 set g_balance_grapplehook_stretch 50
 set g_balance_grapplehook_airfriction 0.2
 set g_balance_grapplehook_health 130
+set g_balance_grapplehook_damagedbycontents 0
 // }}}
 
 // {{{ weapon properties
@@ -258,11 +273,15 @@ set g_balance_shotgun_primary_ammo 1
 set g_balance_shotgun_primary_speed 12000
 set g_balance_shotgun_primary_bulletconstant 75 // 3.8qu
 set g_balance_shotgun_secondary 1
-set g_balance_shotgun_secondary_melee_delay 0.35 // match the anim
-set g_balance_shotgun_secondary_melee_range 60
-set g_balance_shotgun_secondary_melee_swing 50
-set g_balance_shotgun_secondary_melee_time 0.1
+set g_balance_shotgun_secondary_melee_delay 0.25 // 0.35 was too slow
+set g_balance_shotgun_secondary_melee_range 120
+set g_balance_shotgun_secondary_melee_swing_side 120
+set g_balance_shotgun_secondary_melee_swing_up 30
+set g_balance_shotgun_secondary_melee_time 0.15
+set g_balance_shotgun_secondary_melee_traces 10
 set g_balance_shotgun_secondary_melee_no_doubleslap 1
+set g_balance_shotgun_secondary_melee_nonplayerdamage 0
+set g_balance_shotgun_secondary_melee_multihit 1
 set g_balance_shotgun_secondary_damage 115
 set g_balance_shotgun_secondary_force 150
 set g_balance_shotgun_secondary_refire 1.1
@@ -406,6 +425,7 @@ set g_balance_electro_secondary_animtime 0.3
 set g_balance_electro_secondary_ammo 2
 set g_balance_electro_secondary_health 5
 set g_balance_electro_secondary_damageforcescale 4
+set g_balance_electro_secondary_damagedbycontents 0
 set g_balance_electro_secondary_count 1
 set g_balance_electro_secondary_bouncefactor 0.5
 set g_balance_electro_secondary_bouncestop 0.075
@@ -512,7 +532,7 @@ set g_balance_nex_charge_rate 0.1
 set g_balance_nex_charge_animlimit 0.5
 set g_balance_nex_charge_limit 0.5
 set g_balance_nex_charge_rot_rate 0
-set g_balance_nex_charge_rot_pause 0 // Dont rot down untill this long after release of charge button
+set g_balance_nex_charge_rot_pause 0 // Dont rot down until this long after release of charge button
 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
@@ -533,6 +553,8 @@ set g_balance_minstanex_reload_time 2
 set g_balance_hagar_primary_damage 37
 set g_balance_hagar_primary_edgedamage 15
 set g_balance_hagar_primary_force 100
+set g_balance_hagar_primary_health 0
+set g_balance_hagar_primary_damageforcescale 0
 set g_balance_hagar_primary_radius 65
 set g_balance_hagar_primary_spread 0.010
 set g_balance_hagar_primary_speed 3000
@@ -548,9 +570,13 @@ set g_balance_hagar_secondary_load_max 4
 set g_balance_hagar_secondary_load_hold 0
 set g_balance_hagar_secondary_load_releasedeath 1
 set g_balance_hagar_secondary_load_abort 1
+set g_balance_hagar_secondary_load_linkexplode 0
+set g_balance_hagar_secondary_load_animtime 0.2
 set g_balance_hagar_secondary_damage 37
 set g_balance_hagar_secondary_edgedamage 15
 set g_balance_hagar_secondary_force 100
+set g_balance_hagar_secondary_health 0
+set g_balance_hagar_secondary_damageforcescale 0
 set g_balance_hagar_secondary_radius 65
 set g_balance_hagar_secondary_spread 0.015
 set g_balance_hagar_secondary_speed 1400
@@ -615,6 +641,8 @@ set g_balance_hook_secondary_refire 3 // don't drop too many bombs...
 set g_balance_hook_secondary_animtime 0.3 // good shoot anim
 set g_balance_hook_secondary_power 3 // effect behaves like a square function
 set g_balance_hook_secondary_duration 1.5 // effect runs for three seconds
+set g_balance_hook_secondary_health 0
+set g_balance_hook_secondary_damageforcescale 0 
 // }}}
 // {{{ hlac
 set g_balance_hlac_primary_spread_min 0.01
index 9e73743e9d6bf5a695c860dad883467d0c4ad8f3..fac3faa206b66788ade62a556840ddd1075e4167 100644 (file)
@@ -155,6 +155,13 @@ set g_balance_firetransfer_time 0.9
 set g_balance_firetransfer_damage 0.8
 set g_throughfloor_damage 0.7
 set g_throughfloor_force 0.8
+set g_projectiles_damage 2
+// possible values:
+// -2: absolutely no damage to projectiles (no exceptions)
+// -1: no damage other than the exceptions (electro combo, hagar join explode, minelayer mines)
+// 0: only damage from contents (lava/slime) or exceptions 
+// 1: only self damage or damage from contents or exceptions
+// 2: allow all damage to projectiles normally
 set g_projectiles_newton_style 2
 // possible values:
 // 0: absolute velocity projectiles (like Quake)
@@ -179,6 +186,13 @@ set g_balance_falldamage_minspeed 800
 set g_balance_falldamage_factor 0.20
 set g_balance_falldamage_maxdamage 15
 set g_balance_damagepush_speedfactor 2.5
+set g_balance_contents_damagerate 0.2 // ticrate interval for applying damage with playerdamage/projectiledamage
+set g_balance_contents_drowndelay 10 // time under water before a player begins drowning
+set g_balance_contents_playerdamage_drowning 20 // damage per second for while player is drowning
+set g_balance_contents_playerdamage_lava 50 // damage per second for while player is inside lava
+set g_balance_contents_playerdamage_slime 30 // damage per second for while player is inside slime
+set g_balance_contents_projectiledamage 10000 // instantly kill projectiles upon touching lava/slime
+set g_maxpushtime 8.0 "timeout for kill credit when your damage knocks someone into a death trap"
 // }}}
 
 // {{{ powerups
@@ -209,6 +223,7 @@ set g_balance_grapplehook_length_min 50
 set g_balance_grapplehook_stretch 50
 set g_balance_grapplehook_airfriction 0.2
 set g_balance_grapplehook_health 130
+set g_balance_grapplehook_damagedbycontents 0
 // }}}
 
 // {{{ weapon properties
@@ -258,11 +273,15 @@ set g_balance_shotgun_primary_ammo 1
 set g_balance_shotgun_primary_speed 12000
 set g_balance_shotgun_primary_bulletconstant 75 // 3.8qu
 set g_balance_shotgun_secondary 1
-set g_balance_shotgun_secondary_melee_delay 0.35 // match the anim
-set g_balance_shotgun_secondary_melee_range 85
-set g_balance_shotgun_secondary_melee_swing 50
-set g_balance_shotgun_secondary_melee_time 0.1
-set g_balance_shotgun_secondary_melee_no_doubleslap 0
+set g_balance_shotgun_secondary_melee_delay 0.25 // 0.35 was too slow
+set g_balance_shotgun_secondary_melee_range 120
+set g_balance_shotgun_secondary_melee_swing_side 120
+set g_balance_shotgun_secondary_melee_swing_up 30
+set g_balance_shotgun_secondary_melee_time 0.15
+set g_balance_shotgun_secondary_melee_traces 10
+set g_balance_shotgun_secondary_melee_no_doubleslap 1
+set g_balance_shotgun_secondary_melee_nonplayerdamage 0
+set g_balance_shotgun_secondary_melee_multihit 1
 set g_balance_shotgun_secondary_damage 110
 set g_balance_shotgun_secondary_force 150
 set g_balance_shotgun_secondary_refire 1.1
@@ -406,6 +425,7 @@ set g_balance_electro_secondary_animtime 0.2
 set g_balance_electro_secondary_ammo 2
 set g_balance_electro_secondary_health 10
 set g_balance_electro_secondary_damageforcescale 4
+set g_balance_electro_secondary_damagedbycontents 0
 set g_balance_electro_secondary_count 3
 set g_balance_electro_secondary_bouncefactor 0.5
 set g_balance_electro_secondary_bouncestop 0.075
@@ -533,6 +553,8 @@ set g_balance_minstanex_reload_time 2
 set g_balance_hagar_primary_damage 14
 set g_balance_hagar_primary_edgedamage 6
 set g_balance_hagar_primary_force 70
+set g_balance_hagar_primary_health 0
+set g_balance_hagar_primary_damageforcescale 0
 set g_balance_hagar_primary_radius 110
 set g_balance_hagar_primary_spread 0.1
 set g_balance_hagar_primary_speed 1800
@@ -548,9 +570,13 @@ set g_balance_hagar_secondary_load_max 4
 set g_balance_hagar_secondary_load_hold 0
 set g_balance_hagar_secondary_load_releasedeath 1
 set g_balance_hagar_secondary_load_abort 1
+set g_balance_hagar_secondary_load_linkexplode 0
+set g_balance_hagar_secondary_load_animtime 0.2
 set g_balance_hagar_secondary_damage 14 // default for _load: 32
 set g_balance_hagar_secondary_edgedamage 6 // default for _load: 10
 set g_balance_hagar_secondary_force 70 // default for _load: 160
+set g_balance_hagar_secondary_health 0
+set g_balance_hagar_secondary_damageforcescale 0
 set g_balance_hagar_secondary_radius 125
 set g_balance_hagar_secondary_spread 0.15 // default for _load: 0.08
 set g_balance_hagar_secondary_speed 1800
@@ -615,6 +641,8 @@ set g_balance_hook_secondary_refire 3 // don't drop too many bombs...
 set g_balance_hook_secondary_animtime 0.2 // good shoot anim
 set g_balance_hook_secondary_power 3 // effect behaves like a square function
 set g_balance_hook_secondary_duration 1.5 // effect runs for three seconds
+set g_balance_hook_secondary_health 0
+set g_balance_hook_secondary_damageforcescale 0 
 // }}}
 // {{{ hlac
 set g_balance_hlac_primary_spread_min 0.01
index b73360f204f479af25598a4ecb83559a3abd4a94..57af50893caa74aa1b5d08b26694be026ffebb27 100644 (file)
@@ -155,6 +155,13 @@ set g_balance_firetransfer_time 0.9
 set g_balance_firetransfer_damage 0.8
 set g_throughfloor_damage 0.4
 set g_throughfloor_force 0.7
+set g_projectiles_damage 2
+// possible values:
+// -2: absolutely no damage to projectiles (no exceptions)
+// -1: no damage other than the exceptions (electro combo, hagar join explode, minelayer mines)
+// 0: only damage from contents (lava/slime) or exceptions 
+// 1: only self damage or damage from contents or exceptions
+// 2: allow all damage to projectiles normally
 set g_projectiles_newton_style 2
 // possible values:
 // 0: absolute velocity projectiles (like Quake)
@@ -179,6 +186,13 @@ set g_balance_falldamage_minspeed 1400
 set g_balance_falldamage_factor 0.15
 set g_balance_falldamage_maxdamage 25
 set g_balance_damagepush_speedfactor 0
+set g_balance_contents_damagerate 0.2 // ticrate interval for applying damage with playerdamage/projectiledamage
+set g_balance_contents_drowndelay 10 // time under water before a player begins drowning
+set g_balance_contents_playerdamage_drowning 20 // damage per second for while player is drowning
+set g_balance_contents_playerdamage_lava 50 // damage per second for while player is inside lava
+set g_balance_contents_playerdamage_slime 30 // damage per second for while player is inside slime
+set g_balance_contents_projectiledamage 10000 // instantly kill projectiles upon touching lava/slime
+set g_maxpushtime 8.0 "timeout for kill credit when your damage knocks someone into a death trap"
 // }}}
 
 // {{{ powerups
@@ -209,6 +223,7 @@ set g_balance_grapplehook_length_min 50
 set g_balance_grapplehook_stretch 50
 set g_balance_grapplehook_airfriction 0.2
 set g_balance_grapplehook_health 130
+set g_balance_grapplehook_damagedbycontents 0
 // }}}
 
 // {{{ weapon properties
@@ -258,11 +273,15 @@ set g_balance_shotgun_primary_ammo 1
 set g_balance_shotgun_primary_speed 12000
 set g_balance_shotgun_primary_bulletconstant 75 // 3.8qu
 set g_balance_shotgun_secondary 1
-set g_balance_shotgun_secondary_melee_delay 0.35 // match the anim
-set g_balance_shotgun_secondary_melee_range 85
-set g_balance_shotgun_secondary_melee_swing 50
-set g_balance_shotgun_secondary_melee_time 0.1
+set g_balance_shotgun_secondary_melee_delay 0.25 // 0.35 was too slow
+set g_balance_shotgun_secondary_melee_range 120
+set g_balance_shotgun_secondary_melee_swing_side 120
+set g_balance_shotgun_secondary_melee_swing_up 30
+set g_balance_shotgun_secondary_melee_time 0.15
+set g_balance_shotgun_secondary_melee_traces 10
 set g_balance_shotgun_secondary_melee_no_doubleslap 1
+set g_balance_shotgun_secondary_melee_nonplayerdamage 0
+set g_balance_shotgun_secondary_melee_multihit 1
 set g_balance_shotgun_secondary_damage 84
 set g_balance_shotgun_secondary_force 147
 set g_balance_shotgun_secondary_refire 1.1
@@ -406,6 +425,7 @@ set g_balance_electro_secondary_animtime 0.3
 set g_balance_electro_secondary_ammo 2
 set g_balance_electro_secondary_health 10
 set g_balance_electro_secondary_damageforcescale 4
+set g_balance_electro_secondary_damagedbycontents 0
 set g_balance_electro_secondary_count 3
 set g_balance_electro_secondary_bouncefactor 0.5
 set g_balance_electro_secondary_bouncestop 0.075
@@ -512,7 +532,7 @@ set g_balance_nex_charge_rate 0.1
 set g_balance_nex_charge_animlimit 0.5
 set g_balance_nex_charge_limit 0.5
 set g_balance_nex_charge_rot_rate 0
-set g_balance_nex_charge_rot_pause 0 // Dont rot down untill this long after release of charge button
+set g_balance_nex_charge_rot_pause 0 // Dont rot down until this long after release of charge button
 set g_balance_nex_charge_shot_multiplier 0
 set g_balance_nex_charge_velocity_rate 0.2
 set g_balance_nex_charge_minspeed ""
@@ -533,6 +553,8 @@ set g_balance_minstanex_reload_time 2
 set g_balance_hagar_primary_damage 43
 set g_balance_hagar_primary_edgedamage 15
 set g_balance_hagar_primary_force 94
+set g_balance_hagar_primary_health 0
+set g_balance_hagar_primary_damageforcescale 0
 set g_balance_hagar_primary_radius 70
 set g_balance_hagar_primary_spread 0.010
 set g_balance_hagar_primary_speed 3000
@@ -548,9 +570,13 @@ set g_balance_hagar_secondary_load_max 4
 set g_balance_hagar_secondary_load_hold 0
 set g_balance_hagar_secondary_load_releasedeath 1
 set g_balance_hagar_secondary_load_abort 1
+set g_balance_hagar_secondary_load_linkexplode 0
+set g_balance_hagar_secondary_load_animtime 0.2
 set g_balance_hagar_secondary_damage 43
 set g_balance_hagar_secondary_edgedamage 15
 set g_balance_hagar_secondary_force 100
+set g_balance_hagar_secondary_health 0
+set g_balance_hagar_secondary_damageforcescale 0
 set g_balance_hagar_secondary_radius 70
 set g_balance_hagar_secondary_spread 0.015
 set g_balance_hagar_secondary_speed 1400
@@ -615,6 +641,8 @@ set g_balance_hook_secondary_refire 3 // don't drop too many bombs...
 set g_balance_hook_secondary_animtime 0.3 // good shoot anim
 set g_balance_hook_secondary_power 3 // effect behaves like a square function
 set g_balance_hook_secondary_duration 1.5 // effect runs for three seconds
+set g_balance_hook_secondary_health 0
+set g_balance_hook_secondary_damageforcescale 0 
 // }}}
 // {{{ hlac
 set g_balance_hlac_primary_spread_min 0.01
index 182e66cb1ccb486be92967163d2036a128321033..86e36f8278992a71af6658a4b85624e0a400931b 100644 (file)
@@ -153,8 +153,15 @@ set g_weaponforcefactor 1 "weapon force multiplier"
 set g_weaponspreadfactor 1 "weapon spread multiplier"
 set g_balance_firetransfer_time 0.9
 set g_balance_firetransfer_damage 0.8
-set g_throughfloor_damage 0.4
-set g_throughfloor_force 0.7
+set g_throughfloor_damage 0.75
+set g_throughfloor_force 0.75
+set g_projectiles_damage 2
+// possible values:
+// -2: absolutely no damage to projectiles (no exceptions)
+// -1: no damage other than the exceptions (electro combo, hagar join explode, minelayer mines)
+// 0: only damage from contents (lava/slime) or exceptions 
+// 1: only self damage or damage from contents or exceptions
+// 2: allow all damage to projectiles normally
 set g_projectiles_newton_style 2
 // possible values:
 // 0: absolute velocity projectiles (like Quake)
@@ -179,6 +186,13 @@ set g_balance_falldamage_minspeed 900
 set g_balance_falldamage_factor 0.20
 set g_balance_falldamage_maxdamage 40
 set g_balance_damagepush_speedfactor 2.5
+set g_balance_contents_damagerate 0.2 // ticrate interval for applying damage with playerdamage/projectiledamage
+set g_balance_contents_drowndelay 10 // time under water before a player begins drowning
+set g_balance_contents_playerdamage_drowning 20 // damage per second for while player is drowning
+set g_balance_contents_playerdamage_lava 50 // damage per second for while player is inside lava
+set g_balance_contents_playerdamage_slime 30 // damage per second for while player is inside slime
+set g_balance_contents_projectiledamage 10000 // instantly kill projectiles upon touching lava/slime
+set g_maxpushtime 8.0 "timeout for kill credit when your damage knocks someone into a death trap"
 // }}}
 
 // {{{ powerups
@@ -208,14 +222,15 @@ set g_balance_grapplehook_force_rubber_overstretch 1000
 set g_balance_grapplehook_length_min 50
 set g_balance_grapplehook_stretch 50
 set g_balance_grapplehook_airfriction 0.2
-set g_balance_grapplehook_health 130
+set g_balance_grapplehook_health 50
+set g_balance_grapplehook_damagedbycontents 1
 // }}}
 
 // {{{ weapon properties
 // {{{ laser
 set g_balance_laser_primary_damage 25
 set g_balance_laser_primary_edgedamage 12.5
-set g_balance_laser_primary_force 250
+set g_balance_laser_primary_force 300
 set g_balance_laser_primary_radius 70
 set g_balance_laser_primary_speed 6000
 set g_balance_laser_primary_spread 0
@@ -225,7 +240,7 @@ set g_balance_laser_primary_lifetime 5
 set g_balance_laser_primary_shotangle 0
 set g_balance_laser_primary_delay 0
 set g_balance_laser_primary_gauntlet 0
-set g_balance_laser_primary_force_zscale 1.5
+set g_balance_laser_primary_force_zscale 1.25
 set g_balance_laser_primary_force_velocitybias 0
 set g_balance_laser_primary_force_other_scale 1
 set g_balance_laser_secondary 0 // when 1, a secondary laser mode exists
@@ -260,12 +275,16 @@ set g_balance_shotgun_primary_bulletconstant 75 // 3.8qu
 set g_balance_shotgun_secondary 1
 set g_balance_shotgun_secondary_melee_delay 0.25 // 0.35 was too slow
 set g_balance_shotgun_secondary_melee_range 120
-set g_balance_shotgun_secondary_melee_swing 50
-set g_balance_shotgun_secondary_melee_time 0.1
+set g_balance_shotgun_secondary_melee_swing_side 120
+set g_balance_shotgun_secondary_melee_swing_up 30
+set g_balance_shotgun_secondary_melee_time 0.15
+set g_balance_shotgun_secondary_melee_traces 10
 set g_balance_shotgun_secondary_melee_no_doubleslap 1
-set g_balance_shotgun_secondary_damage 110
+set g_balance_shotgun_secondary_melee_nonplayerdamage 40
+set g_balance_shotgun_secondary_melee_multihit 1
+set g_balance_shotgun_secondary_damage 100
 set g_balance_shotgun_secondary_force 200
-set g_balance_shotgun_secondary_refire 1.1
+set g_balance_shotgun_secondary_refire 1.25
 set g_balance_shotgun_secondary_animtime 1
 set g_balance_shotgun_reload_ammo 0 //default: 5
 set g_balance_shotgun_reload_time 2
@@ -273,14 +292,14 @@ set g_balance_shotgun_reload_time 2
 // {{{ uzi
 set g_balance_uzi_mode 1                               // Activates varible spread for sustained & burst mode secondary
 set g_balance_uzi_spread_min 0.02
-set g_balance_uzi_spread_max 0.06
+set g_balance_uzi_spread_max 0.05
 set g_balance_uzi_spread_add 0.012
 
 set g_balance_uzi_burst 3                              // # of bullets in a burst (if set to 2 or more)
 set g_balance_uzi_burst_animtime 0.3
 set g_balance_uzi_burst_refire 0.06            // refire between burst bullets
 set g_balance_uzi_burst_refire2 0.45   // refire after burst
-set g_balance_uzi_burst_spread 0.03
+set g_balance_uzi_burst_spread 0.02
 set g_balance_uzi_burst_damage 25              
 set g_balance_uzi_burst_force 20
 set g_balance_uzi_burst_ammo 3
@@ -289,12 +308,12 @@ set g_balance_uzi_first 1
 set g_balance_uzi_first_damage 14
 set g_balance_uzi_first_force 5
 set g_balance_uzi_first_spread 0.03
-set g_balance_uzi_first_refire 0.4
+set g_balance_uzi_first_refire 0.2
 set g_balance_uzi_first_ammo 1
 
-set g_balance_uzi_sustained_damage 12
+set g_balance_uzi_sustained_damage 10 // 100 dps
 set g_balance_uzi_sustained_force 5
-set g_balance_uzi_sustained_spread 0.04
+set g_balance_uzi_sustained_spread 0.03
 set g_balance_uzi_sustained_refire 0.1
 set g_balance_uzi_sustained_ammo 1
 
@@ -319,7 +338,7 @@ set g_balance_grenadelauncher_primary_lifetime2 1
 set g_balance_grenadelauncher_primary_refire 0.8
 set g_balance_grenadelauncher_primary_animtime 0.3
 set g_balance_grenadelauncher_primary_ammo 2
-set g_balance_grenadelauncher_primary_health 0
+set g_balance_grenadelauncher_primary_health 15
 set g_balance_grenadelauncher_primary_damageforcescale 0
 set g_balance_grenadelauncher_primary_remote_minbouncecnt 0
 
@@ -338,7 +357,7 @@ set g_balance_grenadelauncher_secondary_lifetime_stick 0
 set g_balance_grenadelauncher_secondary_refire 0.7
 set g_balance_grenadelauncher_secondary_animtime 0.3
 set g_balance_grenadelauncher_secondary_ammo 2
-set g_balance_grenadelauncher_secondary_health 0
+set g_balance_grenadelauncher_secondary_health 30
 set g_balance_grenadelauncher_secondary_damageforcescale 4
 set g_balance_grenadelauncher_secondary_remote_detonateprimary 0
 
@@ -375,8 +394,8 @@ set g_balance_minelayer_reload_time 2
 // }}}
 // {{{ electro
 set g_balance_electro_lightning 0
-set g_balance_electro_primary_damage 55
-set g_balance_electro_primary_edgedamage 27.5
+set g_balance_electro_primary_damage 40
+set g_balance_electro_primary_edgedamage 20
 set g_balance_electro_primary_force 200
 set g_balance_electro_primary_force_up 0
 set g_balance_electro_primary_radius 100
@@ -406,11 +425,12 @@ set g_balance_electro_secondary_animtime 0.2
 set g_balance_electro_secondary_ammo 2
 set g_balance_electro_secondary_health 5
 set g_balance_electro_secondary_damageforcescale 4
+set g_balance_electro_secondary_damagedbycontents 1
 set g_balance_electro_secondary_count 3
 set g_balance_electro_secondary_bouncefactor 0.4
 set g_balance_electro_secondary_bouncestop 0.05
-set g_balance_electro_combo_damage 40
-set g_balance_electro_combo_edgedamage 20
+set g_balance_electro_combo_damage 50
+set g_balance_electro_combo_edgedamage 25
 set g_balance_electro_combo_force 120
 set g_balance_electro_combo_radius 175
 set g_balance_electro_combo_comboradius 275
@@ -512,7 +532,7 @@ set g_balance_nex_charge_rate 0.4
 set g_balance_nex_charge_animlimit 0.5
 set g_balance_nex_charge_limit 1
 set g_balance_nex_charge_rot_rate 0
-set g_balance_nex_charge_rot_pause 0 // Dont rot down untill this long after release of charge button
+set g_balance_nex_charge_rot_pause 0 // Dont rot down until this long after release of charge button
 set g_balance_nex_charge_shot_multiplier 0
 set g_balance_nex_charge_velocity_rate 0
 set g_balance_nex_charge_minspeed 400
@@ -532,12 +552,14 @@ set g_balance_minstanex_reload_time 2
 // {{{ hagar
 set g_balance_hagar_primary_damage 25
 set g_balance_hagar_primary_edgedamage 12.5
-set g_balance_hagar_primary_force 50
-set g_balance_hagar_primary_radius 60
+set g_balance_hagar_primary_force 100
+set g_balance_hagar_primary_health 15
+set g_balance_hagar_primary_damageforcescale 0
+set g_balance_hagar_primary_radius 65
 set g_balance_hagar_primary_spread 0.04
-set g_balance_hagar_primary_speed 2000
+set g_balance_hagar_primary_speed 2200
 set g_balance_hagar_primary_lifetime 5
-set g_balance_hagar_primary_refire 0.15
+set g_balance_hagar_primary_refire 0.16667 // 6 rockets per second
 set g_balance_hagar_primary_ammo 1
 set g_balance_hagar_secondary 1
 set g_balance_hagar_secondary_load 1
@@ -545,14 +567,18 @@ set g_balance_hagar_secondary_load_speed 0.5
 set g_balance_hagar_secondary_load_spread 0.075
 set g_balance_hagar_secondary_load_spread_bias 0.5
 set g_balance_hagar_secondary_load_max 4
-set g_balance_hagar_secondary_load_hold 1
+set g_balance_hagar_secondary_load_hold 4
 set g_balance_hagar_secondary_load_releasedeath 0
 set g_balance_hagar_secondary_load_abort 1
+set g_balance_hagar_secondary_load_linkexplode 0
+set g_balance_hagar_secondary_load_animtime 0.2
 set g_balance_hagar_secondary_damage 40
 set g_balance_hagar_secondary_edgedamage 20
-set g_balance_hagar_secondary_force 50
+set g_balance_hagar_secondary_force 75
+set g_balance_hagar_secondary_health 15
+set g_balance_hagar_secondary_damageforcescale 0
 set g_balance_hagar_secondary_radius 80
-set g_balance_hagar_secondary_spread 0.06
+set g_balance_hagar_secondary_spread 0.05
 set g_balance_hagar_secondary_speed 2000
 set g_balance_hagar_secondary_lifetime_min 10
 set g_balance_hagar_secondary_lifetime_rand 0
@@ -573,7 +599,7 @@ set g_balance_rocketlauncher_lifetime 10
 set g_balance_rocketlauncher_refire 1.1
 set g_balance_rocketlauncher_animtime 0.3
 set g_balance_rocketlauncher_ammo 4
-set g_balance_rocketlauncher_health 0 // 30 // 5 hitpoints above maximum laser value -- this way lasers can't blow it up, but grenadelauncher still can most the time.
+set g_balance_rocketlauncher_health 30 // 30 // 5 hitpoints above maximum laser value -- this way lasers can't blow it up, but grenadelauncher still can most the time.
 set g_balance_rocketlauncher_damageforcescale 1 // low damage force scale so that it can still be affected by other hits, but not so much that it does a 90 degree turn
 set g_balance_rocketlauncher_detonatedelay 0.05 // positive: timer till detonation is allowed, negative: "security device" that prevents ANY remote detonation if it could hurt its owner, zero: detonatable at any time
 set g_balance_rocketlauncher_guiderate 110 // max degrees per second
@@ -591,7 +617,7 @@ set g_balance_rocketlauncher_reload_time 2
 // {{{ porto
 set g_balance_porto_primary_refire 1.5
 set g_balance_porto_primary_animtime 0.3
-set g_balance_porto_primary_speed 5000
+set g_balance_porto_primary_speed 1000
 set g_balance_porto_primary_lifetime 5
 set g_balance_portal_health 200 // these get recharged whenever the portal is used
 set g_balance_portal_lifetime 15 // these get recharged whenever the portal is used
@@ -607,7 +633,7 @@ set g_balance_hook_secondary_damage 25 // not much
 set g_balance_hook_secondary_edgedamage 5 // not much
 set g_balance_hook_secondary_radius 500 // LOTS
 set g_balance_hook_secondary_force -2000 // LOTS
-set g_balance_hook_secondary_ammo 50 // a whole pack
+set g_balance_hook_secondary_ammo 30 // a whole pack
 set g_balance_hook_secondary_lifetime 5 // infinite
 set g_balance_hook_secondary_speed 0 // not much throwing
 set g_balance_hook_secondary_gravity 5 // fast falling
@@ -615,6 +641,8 @@ set g_balance_hook_secondary_refire 3 // don't drop too many bombs...
 set g_balance_hook_secondary_animtime 0.3 // good shoot anim
 set g_balance_hook_secondary_power 3 // effect behaves like a square function
 set g_balance_hook_secondary_duration 1.5 // effect runs for three seconds
+set g_balance_hook_secondary_health 15
+set g_balance_hook_secondary_damageforcescale 0 
 // }}}
 // {{{ hlac // TO BE REMOVED
 set g_balance_hlac_primary_spread_min 0.01
index fd229feb9f394aa8157e749d210ab8cd0b751e57..b7fd9641db5d765729f1c7b86e8f76d225e2e43b 100644 (file)
@@ -155,6 +155,13 @@ set g_balance_firetransfer_time 0.9
 set g_balance_firetransfer_damage 0.8
 set g_throughfloor_damage 0.5
 set g_throughfloor_force 0.7
+set g_projectiles_damage 2
+// possible values:
+// -2: absolutely no damage to projectiles (no exceptions)
+// -1: no damage other than the exceptions (electro combo, hagar join explode, minelayer mines)
+// 0: only damage from contents (lava/slime) or exceptions 
+// 1: only self damage or damage from contents or exceptions
+// 2: allow all damage to projectiles normally
 set g_projectiles_newton_style 2
 // possible values:
 // 0: absolute velocity projectiles (like Quake)
@@ -179,6 +186,13 @@ set g_balance_falldamage_minspeed 800
 set g_balance_falldamage_factor 0.02 // maxspeed = minspeed + maxdamage / factor = 4550
 set g_balance_falldamage_maxdamage 75
 set g_balance_damagepush_speedfactor 0
+set g_balance_contents_damagerate 0.2 // ticrate interval for applying damage with playerdamage/projectiledamage
+set g_balance_contents_drowndelay 10 // time under water before a player begins drowning
+set g_balance_contents_playerdamage_drowning 20 // damage per second for while player is drowning 
+set g_balance_contents_playerdamage_lava 50 // damage per second for while player is inside lava
+set g_balance_contents_playerdamage_slime 30 // damage per second for while player is inside slime
+set g_balance_contents_projectiledamage 10000 // instantly kill projectiles upon touching lava/slime
+set g_maxpushtime 8.0 "timeout for kill credit when your damage knocks someone into a death trap"
 // }}}
 
 // {{{ powerups
@@ -209,6 +223,7 @@ set g_balance_grapplehook_length_min 50
 set g_balance_grapplehook_stretch 50
 set g_balance_grapplehook_airfriction 0.2
 set g_balance_grapplehook_health 130
+set g_balance_grapplehook_damagedbycontents 0
 // }}}
 
 // {{{ weapon properties
@@ -258,11 +273,15 @@ set g_balance_shotgun_primary_ammo 1
 set g_balance_shotgun_primary_speed 12000
 set g_balance_shotgun_primary_bulletconstant 75 // 3.8qu
 set g_balance_shotgun_secondary 1
-set g_balance_shotgun_secondary_melee_delay 0.35 // match the anim
-set g_balance_shotgun_secondary_melee_range 85
-set g_balance_shotgun_secondary_melee_swing 50
-set g_balance_shotgun_secondary_melee_time 0.1
+set g_balance_shotgun_secondary_melee_delay 0.25 // 0.35 was too slow
+set g_balance_shotgun_secondary_melee_range 120
+set g_balance_shotgun_secondary_melee_swing_side 120
+set g_balance_shotgun_secondary_melee_swing_up 30
+set g_balance_shotgun_secondary_melee_time 0.15
+set g_balance_shotgun_secondary_melee_traces 10
 set g_balance_shotgun_secondary_melee_no_doubleslap 1
+set g_balance_shotgun_secondary_melee_nonplayerdamage 0
+set g_balance_shotgun_secondary_melee_multihit 1
 set g_balance_shotgun_secondary_damage 110
 set g_balance_shotgun_secondary_force 150
 set g_balance_shotgun_secondary_refire 1.1
@@ -406,6 +425,7 @@ set g_balance_electro_secondary_animtime 0.15
 set g_balance_electro_secondary_ammo 2
 set g_balance_electro_secondary_health 10
 set g_balance_electro_secondary_damageforcescale 2
+set g_balance_electro_secondary_damagedbycontents 0
 set g_balance_electro_secondary_count 3
 set g_balance_electro_secondary_bouncefactor 0.5
 set g_balance_electro_secondary_bouncestop 0.075
@@ -511,7 +531,7 @@ set g_balance_nex_charge_rate 0.35
 set g_balance_nex_charge_animlimit 0.5
 set g_balance_nex_charge_limit 0.5
 set g_balance_nex_charge_rot_rate 0.1
-set g_balance_nex_charge_rot_pause 1 // Dont rot down untill this long after release of charge button
+set g_balance_nex_charge_rot_pause 1 // Dont rot down until this long after release of charge button
 set g_balance_nex_charge_shot_multiplier 0
 set g_balance_nex_charge_velocity_rate 0
 set g_balance_nex_charge_minspeed 400
@@ -532,6 +552,8 @@ set g_balance_minstanex_reload_time 2
 set g_balance_hagar_primary_damage 25
 set g_balance_hagar_primary_edgedamage 5
 set g_balance_hagar_primary_force 70
+set g_balance_hagar_primary_health 0
+set g_balance_hagar_primary_damageforcescale 0
 set g_balance_hagar_primary_radius 60
 set g_balance_hagar_primary_spread 0.010
 set g_balance_hagar_primary_speed 2500
@@ -547,9 +569,13 @@ set g_balance_hagar_secondary_load_max 4
 set g_balance_hagar_secondary_load_hold 0
 set g_balance_hagar_secondary_load_releasedeath 1
 set g_balance_hagar_secondary_load_abort 1
+set g_balance_hagar_secondary_load_linkexplode 0
+set g_balance_hagar_secondary_load_animtime 0.2
 set g_balance_hagar_secondary_damage 30
 set g_balance_hagar_secondary_edgedamage 15
 set g_balance_hagar_secondary_force 50
+set g_balance_hagar_secondary_health 0
+set g_balance_hagar_secondary_damageforcescale 0
 set g_balance_hagar_secondary_radius 65
 set g_balance_hagar_secondary_spread 0.015
 set g_balance_hagar_secondary_speed 1400
@@ -614,6 +640,8 @@ set g_balance_hook_secondary_refire 3 // don't drop too many bombs...
 set g_balance_hook_secondary_animtime 0.3 // good shoot anim
 set g_balance_hook_secondary_power 3 // effect behaves like a square function
 set g_balance_hook_secondary_duration 1.5 // effect runs for three seconds
+set g_balance_hook_secondary_health 0
+set g_balance_hook_secondary_damageforcescale 0 
 // }}}
 // {{{ hlac
 set g_balance_hlac_primary_spread_min 0.01
index 883f8efcea2f66ab3f01a5ab59c9c328a3c72f39..f92882f4424da8b0ca0f2693e7be3a64e0916e95 100644 (file)
@@ -353,7 +353,6 @@ set sv_timeout_resumetime 3 "how long the remaining timeout-time will be after a
 
 set g_allow_oldnexbeam 0 "If enabled, clients are allowed to use old v2.3 Nexgun beam"
 seta cl_particles_oldnexbeam 0 "Uses the old v2.3 Nexgun beam instead of the new beam, only works if server allows it (g_allow_oldnexbeam 1)"
-set sv_qcweaponanimation 0
 
 set g_telefrags 1 "telefragging, i.e. killing someone who stands in the way of someone who is teleporting"
 set g_telefrags_teamplay 1 "never telefrag team mates"
@@ -387,6 +386,7 @@ set sv_doublejump 0 "allow Quake 2-style double jumps"
 set sv_jumpspeedcap_min "" "lower bound on the baseline velocity of a jump; final velocity will be >= (jumpheight * min + jumpheight)"
 set sv_jumpspeedcap_max "" "upper bound on the baseline velocity of a jump; final velocity will be <= (jumpheight * max + jumpheight)"
 set sv_jumpspeedcap_max_disable_on_ramps 0 "disable upper baseline velocity bound on ramps to preserve the old rampjump style"
+set sv_player_jumpanim_minfall 48 "minimum distance player has to have below their feet before the jump animation will be activated (only when falling, +jump will play anim instantly)"
 
 seta sv_precacheplayermodels 1
 seta sv_precacheweapons 0
@@ -490,8 +490,8 @@ alias g_waypointeditor_unreachable "impulse 107"
 
 locs_enable 0
 pausable 0
-seta g_spawnshieldtime 1.000000 "number of seconds you are invincible after you spawned, this shield is lost after you fire"
-seta g_antilag 2       "AntiLag (0 = no AntiLag, 1 = verified client side hit scan, 2 = server side hit scan in the past, 3 = unverified client side hit scan)"
+set g_spawnshieldtime 1 "number of seconds you are invincible after you spawned, this shield is lost after you fire"
+set g_antilag 2        "AntiLag (0 = no AntiLag, 1 = verified client side hit scan, 2 = server side hit scan in the past, 3 = unverified client side hit scan)"
 set g_trueaim_minrange 44 "TrueAim minimum range (TrueAim adjusts shots so they hit the crosshair point even though the gun is not at the screen center)"
 set g_antilag_nudge 0 "don't touch"
 set g_antilag_bullets 1 "Bullets AntiLag (0 = no AntiLag, 1 = server side hit scan in the past) - DO NOT TOUCH (severely changes weapon balance)"
@@ -537,7 +537,6 @@ seta g_maplist_selectrandom 0       "if 1, a random map will be chosen as next map - D
 seta g_maplist_shuffle 1       "new randomization method: like selectrandom, but avoid playing the same maps in short succession. This works by taking out the first element and inserting it into g_maplist with a bias to the end of the list"
 set g_maplist_check_waypoints 0        "when 1, maps are skipped if there currently are bots, but the map has no waypoints"
 set samelevel 0 "when 1, always play the same level over and over again"
-set g_maxpushtime 8.0 "timeout for kill credit when your damage knocks someone into a death trap"
 
 set g_cloaked 0 "display all players mostly invisible"
 set g_player_alpha 1
@@ -553,6 +552,7 @@ alias clearmap "disconnect"
 
 set g_grappling_hook 0 "let players spawn with the grappling hook which allows them to pull themselves up"
 
+set g_invincible_projectiles 0 "set to 1 to disable any damage to projectiles in all balance configs, regardless of g_projectiles_damage"
 set g_dodging 0 "set to 1 to enable dodging in games"
 set g_rocket_flying 0 "set to 1 to enable rocket flying in all balance configs"
 
@@ -1052,6 +1052,7 @@ bind t messagemode
 bind y messagemode2
 bind z messagemode2
 bind u "+con_chat_maximize"
+bind m +hud_panel_radar_maximized
 bind i +show_info
 bind PAUSE pause
 bind F10 quit
@@ -1240,15 +1241,16 @@ set g_nick_flood_penalty 0.5 "duration of the nick flood penalty"
 set g_nick_flood_penalty_yellow 3 "number of changes to allow before warning and movement blocking"
 set g_nick_flood_penalty_red 30 "number of changes to allow before totally disorienting the player"
 
+set sv_waypointsprite_deployed_lifetime 10
+set sv_waypointsprite_deadlifetime 1
+set sv_waypointsprite_limitedrange 5120
+
 seta g_waypointsprite_uppercase 1
 set g_waypointsprite_normdistance 512
 set g_waypointsprite_minscale 0.5
 set g_waypointsprite_minalpha 0.4
 set g_waypointsprite_distancealphaexponent 2
 set g_waypointsprite_timealphaexponent 1
-set g_waypointsprite_deployed_lifetime 10
-set g_waypointsprite_deadlifetime 1
-set g_waypointsprite_limitedrange 5120
 set g_waypointsprite_stuffbinds 0
 seta g_waypointsprite_scale 1
 seta g_waypointsprite_fontsize 12
@@ -1406,7 +1408,7 @@ alias +userbind "_userbind_call userbind${1}_press"
 alias -userbind "_userbind_call userbind${1}_release"
 
 // we must change its default from 1.0 to 1 to be consistent with menuqc
-seta slowmo 1
+set slowmo 1
 
 seta menu_skin "luminos"
 set menu_slowmo 1
@@ -1437,7 +1439,7 @@ seta hud_configure_grid_alpha 0.15 "alpha for visible grid when in configure mod
 
 seta sbar_info_pos 0 "Y-axis distance from lower right corner for engine info prints"
 
-// user preference cvars (i.e. shouldn't be adjusted by a skin config) 
+// user preference cvars (i.e. shouldn't be adjusted by a skin config)
 seta hud_panel_weapons_label 1 "1 = show number of weapon, 2 = show bound key of weapon"
 seta hud_panel_weapons_complainbubble_time 1 "time that a new entry stays until it fades out"
 seta hud_panel_weapons_complainbubble_fadetime 0.25 "fade out time"
@@ -1470,6 +1472,11 @@ seta hud_panel_radar_scale 4096 "distance you can see on the team radar"
 seta hud_panel_radar_rotation 0        "rotation mode: you set what points up. 0 = player, 1 = west, 2 = south, 3 = east, 4 = north"
 seta hud_panel_radar_zoommode 0        "zoom mode: 0 = zoomed by default, 1 = zoomed when +zoom, 2 = always zoomed, 3 = always zoomed out"
 alias hud_panel_radar_rotate "toggle hud_panel_radar_rotation 0 1 2 3 4"
+seta hud_panel_radar_maximized_scale 8192 "distance you can see on the radar when maximized"
+seta hud_panel_radar_maximized_size "0.5 0.5" "size of the radar when maximized"
+alias +hud_panel_radar_maximized "cl_cmd hud_panel_radar_maximized 1"
+alias -hud_panel_radar_maximized "cl_cmd hud_panel_radar_maximized 0"
+alias hud_panel_radar_maximized "cl_cmd hud_panel_radar_maximized"
 
 seta hud_panel_score_rankings 0 "show rankings: 1 always show my own score; 2 pure rankings"
 
@@ -2160,11 +2167,23 @@ set g_playerstats_debug 0 "when 1, player stats are dumped to the console too"
 
 // create this cvar in case the engine did not
 set snd_soundradius 1200
+set snd_softclip 1
+set snd_maxchannelvolume 0
+set snd_streaming_length 2
+seta menu_snd_attenuation_method 1 "Use exponential instead of linear falloff for sound attenuation"
+alias snd_attenuation_method_0 "set menu_snd_attenuation_method 0; set snd_soundradius 1200; set snd_attenuation_exponent 1; set snd_attenuation_decibel 0" // Quake default
+alias snd_attenuation_method_1 "set menu_snd_attenuation_method 1; set snd_soundradius 2400; set snd_attenuation_exponent 4; set snd_attenuation_decibel 0" // nice approximation for method 2
+alias snd_attenuation_method_2 "set menu_snd_attenuation_method 2; set snd_soundradius 1200; set snd_attenuation_exponent 0; set snd_attenuation_decibel 10" // warning: plays sounds within up to 6000qu
+snd_attenuation_method_1
 
 // declare the channels we use
 seta snd_channel8volume 1 "QuakeC controlled background music volume"
 seta snd_channel9volume 1 "QuakeC controlled ambient sound volume"
 
+// sound randomization
+snd_identicalsoundrandomization_time -0.1
+snd_identicalsoundrandomization_tics    1
+
 // loading screen
 scr_loadingscreen_background 0
 scr_loadingscreen_barcolor "0 0.5 1"
index bf631fb254197ed732145f2538180345fddaea2d..70f5fbb4c6f8fd7f03468ae16cc2e9e7bd80399d 100644 (file)
@@ -1225,7 +1225,7 @@ trailspacing 4
 type static
 color 0xffdf72 0x811200
 tex 48 55
-size 1 2
+size 5 2
 sizeincrease -15
 alpha 100 144 988
 airfriction 8
index 48d0d43b87e409e030ca2ea3783fe1e7fd57bfd4..b385001d5eb235147e34d186fc87fe2704153513 100644 (file)
@@ -17,7 +17,6 @@ r_drawparticles_drawdistance 2000
 r_glsl_deluxemapping 1
 r_glsl_offsetmapping 1
 r_glsl_offsetmapping_reliefmapping 0
-r_hdr 0
 r_motionblur 0.5
 r_shadow_gloss 1
 r_shadow_realtime_dlight 1
index 9609a5780234582d3945e02c316c9a77d188174e..17f88444c6d238ba316eb238238ce257ead41562 100644 (file)
@@ -17,7 +17,6 @@ r_drawparticles_drawdistance 500
 r_glsl_deluxemapping 0
 r_glsl_offsetmapping 0
 r_glsl_offsetmapping_reliefmapping 0
-r_hdr 0
 r_motionblur 0
 r_shadow_gloss 0
 r_shadow_realtime_dlight 0
index 94a85e5091a2146c326077707410d87142075e2f..ab4356da768e182e3ddab34d6125cabfa0e9c265 100644 (file)
@@ -17,7 +17,6 @@ r_drawparticles_drawdistance 1000
 r_glsl_deluxemapping 0
 r_glsl_offsetmapping 0
 r_glsl_offsetmapping_reliefmapping 0
-r_hdr 0
 r_motionblur 0
 r_shadow_gloss 0
 r_shadow_realtime_dlight 1
index 7822102ba9c11e9a0a4088eecdf5550cbf108a14..8d558fc5a7ea9157c6f0f44351ea00c2c43143da 100644 (file)
@@ -17,7 +17,6 @@ r_drawparticles_drawdistance 1000
 r_glsl_deluxemapping 1
 r_glsl_offsetmapping 0
 r_glsl_offsetmapping_reliefmapping 0
-r_hdr 0
 r_motionblur 0
 r_shadow_gloss 1
 r_shadow_realtime_dlight 1
index a68a15787ded9bb5b8a10003b278054e7e29c3c3..eede2b12fae570e19efab4cd1e855b37cc39dbd5 100644 (file)
@@ -17,7 +17,6 @@ r_drawparticles_drawdistance 250
 r_glsl_deluxemapping 0
 r_glsl_offsetmapping 0
 r_glsl_offsetmapping_reliefmapping 0
-r_hdr 0
 r_motionblur 0
 r_shadow_gloss 0
 r_shadow_realtime_dlight 0
index 20cd2e563870d40b2678874e6802250a2ffbe02a..268101e31839f9e31c20b7267d840d6a2edaa1cd 100644 (file)
@@ -17,7 +17,6 @@ r_drawparticles_drawdistance 2000
 r_glsl_deluxemapping 1
 r_glsl_offsetmapping 1
 r_glsl_offsetmapping_reliefmapping 1
-r_hdr 2
 r_motionblur 0.5
 r_shadow_gloss 1
 r_shadow_realtime_dlight 1
index 94d47fab2e7cfcf4a600c625ecf6b8b401d99760..0ec7293fc78954102135ae6933b0e17f648f0b9b 100644 (file)
@@ -17,7 +17,6 @@ r_drawparticles_drawdistance 2000
 r_glsl_deluxemapping 1
 r_glsl_offsetmapping 1
 r_glsl_offsetmapping_reliefmapping 0
-r_hdr 0
 r_motionblur 0.5
 r_shadow_gloss 1
 r_shadow_realtime_dlight 1
index ca1f9b37e074d6d8ad824987262002cffda23830..2df89afae0e9f0ecf8b5dd4cdc6a737071a65a80 100644 (file)
@@ -33,6 +33,7 @@
 "togglezoom"                            "toggle zoom"
 "+showscores"                           "show scores"
 "screenshot"                            "screen shot"
+"+hud_panel_radar_maximized"            "maximize radar"
 ""                                      ""
 ""                                      "Communicate"
 "messagemode"                           "public chat"
diff --git a/models/gibs/chunk.mdl_0.tga b/models/gibs/chunk.mdl_0.tga
new file mode 100644 (file)
index 0000000..4192b70
Binary files /dev/null and b/models/gibs/chunk.mdl_0.tga differ
diff --git a/models/gibs/gib1.md3 b/models/gibs/gib1.md3
deleted file mode 100644 (file)
index 276982d..0000000
Binary files a/models/gibs/gib1.md3 and /dev/null differ
diff --git a/models/gibs/gib1.mdl b/models/gibs/gib1.mdl
deleted file mode 100644 (file)
index 8f8501c..0000000
Binary files a/models/gibs/gib1.mdl and /dev/null differ
diff --git a/models/gibs/gib2.md3 b/models/gibs/gib2.md3
deleted file mode 100644 (file)
index f5a2f73..0000000
Binary files a/models/gibs/gib2.md3 and /dev/null differ
diff --git a/models/gibs/gib2.mdl b/models/gibs/gib2.mdl
deleted file mode 100644 (file)
index b4b7425..0000000
Binary files a/models/gibs/gib2.mdl and /dev/null differ
diff --git a/models/gibs/gib3.md3 b/models/gibs/gib3.md3
deleted file mode 100644 (file)
index 8a38b42..0000000
Binary files a/models/gibs/gib3.md3 and /dev/null differ
diff --git a/models/gibs/gib3.mdl b/models/gibs/gib3.mdl
deleted file mode 100644 (file)
index 17279df..0000000
Binary files a/models/gibs/gib3.mdl and /dev/null differ
diff --git a/models/gibs/gib4.md3 b/models/gibs/gib4.md3
deleted file mode 100644 (file)
index dd4c5b5..0000000
Binary files a/models/gibs/gib4.md3 and /dev/null differ
diff --git a/models/gibs/gib5.md3 b/models/gibs/gib5.md3
deleted file mode 100644 (file)
index 6a51eb2..0000000
Binary files a/models/gibs/gib5.md3 and /dev/null differ
diff --git a/models/gibs/gib6.md3 b/models/gibs/gib6.md3
deleted file mode 100644 (file)
index 956c902..0000000
Binary files a/models/gibs/gib6.md3 and /dev/null differ
index a48d18d590240fd7b87fce086c33a0ea980fcf6b..a4f47c05babd0188c57f8597fe45b2b2acafe63e 100644 (file)
Binary files a/models/turrets/base.tga and b/models/turrets/base.tga differ
diff --git a/models/turrets/base_shirt.tga b/models/turrets/base_shirt.tga
new file mode 100644 (file)
index 0000000..2f4810e
Binary files /dev/null and b/models/turrets/base_shirt.tga differ
index e5567509037e06b854f6aeb3cc2a650102f4cfc6..93a3d35236d79dbf8cc898c704fec4180d5330a9 100644 (file)
Binary files a/models/turrets/ewheel-base.tga and b/models/turrets/ewheel-base.tga differ
diff --git a/models/turrets/ewheel-base_glow.tga b/models/turrets/ewheel-base_glow.tga
new file mode 100644 (file)
index 0000000..6ca7016
Binary files /dev/null and b/models/turrets/ewheel-base_glow.tga differ
diff --git a/models/turrets/ewheel-base_shirt.tga b/models/turrets/ewheel-base_shirt.tga
new file mode 100644 (file)
index 0000000..67c05fe
Binary files /dev/null and b/models/turrets/ewheel-base_shirt.tga differ
index fb31d6735aca7c023a320efb2a04459efcf3e8f2..be039a4ea86fc1e1b13962f10f8dc15c2ba4e905 100644 (file)
Binary files a/models/turrets/mggun.tga and b/models/turrets/mggun.tga differ
diff --git a/models/turrets/mggun_shirt.tga b/models/turrets/mggun_shirt.tga
new file mode 100644 (file)
index 0000000..67102a2
Binary files /dev/null and b/models/turrets/mggun_shirt.tga differ
index ddddb07fc0c01ee1ed0a7a5e800a7113a4297972..c1da397fb8e450b1f200ecc1f5e75efdb3655e08 100644 (file)
Binary files a/models/turrets/mlrs.tga and b/models/turrets/mlrs.tga differ
index c84fa13507f1668b2eb52cf402f38ba8097445ff..c29c16f9d6595f024c6262c1656c4ed3b626cc6e 100644 (file)
Binary files a/models/turrets/mlrs_glow.tga and b/models/turrets/mlrs_glow.tga differ
index f63f5e959ccb7fbff21a9033f1db3adcb60e04c5..3cb227403b8771a18a519929e2a8b80702d818e3 100644 (file)
Binary files a/models/turrets/phaserbody.tga and b/models/turrets/phaserbody.tga differ
index d877e73a27ea0fa06c9c53e409ea2d5e65efe8f1..6f704f0a6e7337961135c290b8f2a143dacccfe4 100644 (file)
Binary files a/models/turrets/phaserbody_glow.tga and b/models/turrets/phaserbody_glow.tga differ
index 2d5b1f988966124ec5dac5e2b08e8ca676cd915e..cb48d5eb7f1e20667b102c6f22f8e39e58ae6c79 100644 (file)
Binary files a/models/turrets/phasermag.tga and b/models/turrets/phasermag.tga differ
index b30b540ebbe4e8ba43b05db24d14b14b0d4f6556..fcf104fb7fd94d2efa7d1902b13723858efb25be 100644 (file)
Binary files a/models/turrets/phasermag_glow.tga and b/models/turrets/phasermag_glow.tga differ
index 31a4ab8b15e92e3f2ca33425eea342af8f6a3eda..cb9726712df0783290789efab9183d461e7bfbd2 100644 (file)
Binary files a/models/turrets/plasmagun.tga and b/models/turrets/plasmagun.tga differ
index 881b116d514c047c54298ed5bd137b0914147bc7..20e09fbfee452b9320325a81e0702bccda01fdb8 100644 (file)
Binary files a/models/turrets/plasmagun_glow.tga and b/models/turrets/plasmagun_glow.tga differ
diff --git a/models/turrets/plasmagun_shirt.tga b/models/turrets/plasmagun_shirt.tga
new file mode 100644 (file)
index 0000000..c56f8eb
Binary files /dev/null and b/models/turrets/plasmagun_shirt.tga differ
index c7df0397c0cfc2cdf13eec5fd3c344c8097b3020..9d95692935c18f0c7a77da459ff3bbdbd0509f3a 100644 (file)
Binary files a/models/turrets/reactor.tga and b/models/turrets/reactor.tga differ
index 720fa2e57ca0b1e731db566e4d3a1a629da27d78..573e0c03b8ed9d100322142500a31ef55c500c3f 100644 (file)
Binary files a/models/turrets/reactor_glow.tga and b/models/turrets/reactor_glow.tga differ
index e2217d181634a4027b8270290fa6d87b24264e11..cadfcba9cbea579a34ddce4752f28f9a8ad963e3 100644 (file)
Binary files a/models/turrets/rocket.tga and b/models/turrets/rocket.tga differ
index b1a84a4ed0f76878b7aacde950bf7722da83211b..33019c2c5683a27000a1669b41ec1a21e174e0fa 100644 (file)
Binary files a/models/turrets/rocket_glow.tga and b/models/turrets/rocket_glow.tga differ
index cb952b0f1fcc98eed6c1b6974d8f52f0e04ff825..b9a5e2ec99dd9c70ea4af698dfd93ce17e28eac5 100644 (file)
Binary files a/models/turrets/tesla.tga and b/models/turrets/tesla.tga differ
index 82f4e9bfa7092670d1fc5898dca77ffca2f09668..d33dec20c53b9d0e1a32aaa9675dc283138a699a 100644 (file)
Binary files a/models/turrets/tesla_glow.tga and b/models/turrets/tesla_glow.tga differ
index 2381003110178f2c415839a2ada8facbeb605ca4..41ce98375a2f142c35e6679851ae445a94a2afbb 100644 (file)
Binary files a/models/turrets/walker_base.tga and b/models/turrets/walker_base.tga differ
index bfe8dfeb05bc4f421845e2087669abdf8dfdd897..bc4ebd01ee31246611cc9c907b7370ccba974037 100644 (file)
Binary files a/models/turrets/walker_base_glow.tga and b/models/turrets/walker_base_glow.tga differ
diff --git a/models/weapons/akordeon.tga b/models/weapons/akordeon.tga
new file mode 100644 (file)
index 0000000..68b0ae0
Binary files /dev/null and b/models/weapons/akordeon.tga differ
diff --git a/models/weapons/akordeon_gloss.tga b/models/weapons/akordeon_gloss.tga
new file mode 100644 (file)
index 0000000..b03c089
Binary files /dev/null and b/models/weapons/akordeon_gloss.tga differ
diff --git a/models/weapons/akordeon_reflect.tga b/models/weapons/akordeon_reflect.tga
new file mode 100644 (file)
index 0000000..2f3eba9
Binary files /dev/null and b/models/weapons/akordeon_reflect.tga differ
diff --git a/models/weapons/h_akordeon.iqm b/models/weapons/h_akordeon.iqm
new file mode 100644 (file)
index 0000000..523ef99
Binary files /dev/null and b/models/weapons/h_akordeon.iqm differ
diff --git a/models/weapons/v_akordeon.md3 b/models/weapons/v_akordeon.md3
new file mode 100644 (file)
index 0000000..3990797
Binary files /dev/null and b/models/weapons/v_akordeon.md3 differ
index 606123ad1c1d2c2ba4696b3f792bc8eb05a65e89..9aa81be98e0ccf5b555705bfaf10d1761a0a18bd 100644 (file)
@@ -25,17 +25,17 @@ void cvar_clientsettemp_restore()
                        cvar_set(e.netname, e.message);
 }
 
-void() menu_show_error =
+void menu_show_error()
 {
        drawstring('0 200 0', _("ERROR - MENU IS VISIBLE BUT NO MENU WAS DEFINED!"), '8 8 0', '1 0 0', 1, 0);
-};
+}
 
 // CSQC_Init : Called every time the CSQC code is initialized (essentially at map load)
 // Useful for precaching things
 
-void() menu_sub_null =
+void menu_sub_null()
 {
-};
+}
 
 #ifdef USE_FTE
 float __engine_check;
@@ -358,7 +358,7 @@ float CSQC_ConsoleCommand(string strMessage)
        argc = tokenize_console(strMessage);
 
        // Acquire Command
-       local string strCmd;
+       string strCmd;
        strCmd = argv(0);
 
        if(strCmd == "hud_configure") { // config hud
@@ -507,6 +507,13 @@ void GameCommand(string msg)
        if(cmd == "mv_download") {
                Cmd_MapVote_MapDownload(argc);
        }
+       else if(cmd == "hud_panel_radar_maximized")
+       {
+               if(argc == 1)
+                       hud_panel_radar_maximized = !hud_panel_radar_maximized;
+               else
+                       hud_panel_radar_maximized = (stof(argv(1)) != 0);
+       }
        else if(cmd == "settemp") {
                cvar_clientsettemp(argv(1), argv(2));
        }
@@ -595,7 +602,7 @@ void GameCommand(string msg)
         {
             vote_active = 0; // force the panel to disappear right as we have selected the value (to prevent it from fading out in the normal vote panel pos)
             vote_prev = 0;
-            cvar_set("cl_allow_uid2name", "1");
+            localcmd("setreport cl_allow_uid2name 1\n");
             vote_change = -9999;
                        uid2name_dialog = 0;
         }
@@ -610,7 +617,7 @@ void GameCommand(string msg)
         {
             vote_active = 0;
             vote_prev = 0;
-            cvar_set("cl_allow_uid2name", "0");
+            localcmd("setreport cl_allow_uid2name 0\n");
             vote_change = -9999;
                        uid2name_dialog = 0;
         }
@@ -636,7 +643,7 @@ void GameCommand(string msg)
 // In the case of mouse input, nPrimary is xdelta, nSecondary is ydelta.
 float CSQC_InputEvent(float bInputType, float nPrimary, float nSecondary)
 {
-       local float bSkipKey;
+       float bSkipKey;
        bSkipKey = false;
 
        if (HUD_Panel_InputEvent(bInputType, nPrimary, nSecondary))
@@ -937,7 +944,7 @@ void Ent_ReadAccuracy(void)
 void Ent_RadarLink();
 void Ent_Init();
 void Ent_ScoresInfo();
-void(float bIsNewEntity) CSQC_Ent_Update =
+void CSQC_Ent_Update(float bIsNewEntity)
 {
        float t;
        float savetime;
@@ -1007,7 +1014,7 @@ void(float bIsNewEntity) CSQC_Ent_Update =
        }
 
        time = savetime;
-};
+}
 // Destructor, but does NOT deallocate the entity by calling remove(). Also
 // used when an entity changes its type. For an entity that someone interacts
 // with others, make sure it can no longer do so.
@@ -1331,10 +1338,10 @@ void Net_WeaponComplain() {
 // Return value should be 1 if CSQC handled the temporary entity, otherwise return 0 to have the engine process the event.
 float CSQC_Parse_TempEntity()
 {
-       local float bHandled;
+       float bHandled;
                bHandled  = true;
        // Acquire TE ID
-       local float nTEID;
+       float nTEID;
                nTEID = ReadByte();
 
                // NOTE: Could just do return instead of break...
index ade5155c46ff2e7c26e50070c05e31b269982085..ea10300ed9773940658a2bef5f7b0913eea06c12 100644 (file)
@@ -817,7 +817,7 @@ void CSQC_UpdateView(float w, float h)
                }
        }
        
-       if(autocvar_hud_damage && !autocvar_chase_active)
+       if(autocvar_hud_damage)
        {
                splash_size_x = max(vid_conwidth, vid_conheight);
                splash_size_y = max(vid_conwidth, vid_conheight);
@@ -865,24 +865,31 @@ void CSQC_UpdateView(float w, float h)
 
                myhealth_prev = myhealth;
 
-               if(autocvar_cl_gentle_damage || autocvar_cl_gentle)
+               // IDEA: change damage color/picture based on player model for robot/alien species?
+               // pro: matches model better
+               // contra: it's not red because blood is red, but because red is an alarming color, so red should stay
+               // maybe different reddish pics?
+               if(autocvar_chase_active >= 0) // not while the event chase camera is active
                {
-                       if(autocvar_cl_gentle_damage == 2)
+                       if(autocvar_cl_gentle_damage || autocvar_cl_gentle)
                        {
-                               if(myhealth_flash < pain_threshold) // only randomize when the flash is gone
+                               if(autocvar_cl_gentle_damage == 2)
                                {
-                                       myhealth_gentlergb = eX * random() + eY * random() + eZ * random();
+                                       if(myhealth_flash < pain_threshold) // only randomize when the flash is gone
+                                       {
+                                               myhealth_gentlergb = eX * random() + eY * random() + eZ * random();
+                                       }
                                }
+                               else
+                                       myhealth_gentlergb = stov(autocvar_hud_damage_gentle_color);
+
+                               drawfill('0 0 0', eX * vid_conwidth + eY * vid_conheight, myhealth_gentlergb, autocvar_hud_damage_gentle_alpha_multiplier * bound(0, myhealth_flash_temp, 1) * autocvar_hud_damage, DRAWFLAG_NORMAL);
                        }
                        else
-                               myhealth_gentlergb = stov(autocvar_hud_damage_gentle_color);
-
-                       drawfill('0 0 0', eX * vid_conwidth + eY * vid_conheight, myhealth_gentlergb, autocvar_hud_damage_gentle_alpha_multiplier * bound(0, myhealth_flash_temp, 1) * autocvar_hud_damage, DRAWFLAG_NORMAL);
+                               drawpic(splash_pos, "gfx/blood", splash_size, stov(autocvar_hud_damage_color), bound(0, myhealth_flash_temp, 1) * autocvar_hud_damage, DRAWFLAG_NORMAL);
                }
-               else
-                       drawpic(splash_pos, "gfx/blood", splash_size, stov(autocvar_hud_damage_color), bound(0, myhealth_flash_temp, 1) * autocvar_hud_damage, DRAWFLAG_NORMAL);
 
-               if(autocvar_hud_postprocessing)
+               if(autocvar_hud_postprocessing) // we still need to set this anyway even when chase_active is set, this way it doesn't get stuck on.
                {
                        if(autocvar_hud_damage_blur && myhealth_flash_temp)
                        {
@@ -1065,7 +1072,7 @@ void CSQC_UpdateView(float w, float h)
                                wcross_color = stov(cvar_string(strcat("crosshair_", wcross_wep, "_color")));
                        else if(autocvar_crosshair_color_by_health)
                        {
-                               local float x = getstati(STAT_HEALTH);
+                               float x = getstati(STAT_HEALTH);
 
                                //x = red
                                //y = green
@@ -1512,8 +1519,8 @@ void CSQC_Demo_Camera()
 
        if(autocvar_camera_look_player)
        {
-               local vector dir;
-               local float n;
+               vector dir;
+               float n;
 
                dir = normalize(view_origin - current_position);
                n = mouse_angles_z;
index 7451ee7c300a13b54d9f0bb56f1898798434d23e..7259761c204406119b377876e73bd7377c6db012 100644 (file)
@@ -274,6 +274,8 @@ float autocvar_hud_panel_pressedkeys_aspect;
 float autocvar_hud_panel_racetimer;
 float autocvar_hud_panel_radar;
 float autocvar_hud_panel_radar_foreground_alpha;
+float autocvar_hud_panel_radar_maximized_scale;
+vector autocvar_hud_panel_radar_maximized_size;
 float autocvar_hud_panel_radar_rotation;
 float autocvar_hud_panel_radar_scale;
 float autocvar_hud_panel_radar_zoommode;
index fd35613a51583e37c5779e0bb45e3ece0c74fc15..02a09ca7144445c2ad48145fa4788f6aa1152a79 100644 (file)
@@ -9,7 +9,7 @@ string STR_PLAYER = "player";
 string ctf_temp_1;
 float order_page;
 
-void() menu_close =
+void menu_close()
 {
        menu_visible = false;
        menu_show = menu_show_error;
@@ -19,13 +19,13 @@ void() menu_close =
          strunzone(ctf_temp_1);*/
        
        localcmd("\nin_bindmap 0 0;");
-};
+}
 
-void() order_menu_render =
+void order_menu_render()
 {
-       local vector ps, po;
-       local float i, p, n;
-       local string frags, color;
+       vector ps, po;
+       float i, p, n;
+       string frags, color;
        ps = '0 200 0';
        po = '0 8 0';
 
@@ -56,13 +56,13 @@ void() order_menu_render =
        } else {
                menu_close();
        }
-};
+}
 
-float(float bInputType, float nPrimary, float nSecondary) order_menu_action =
+float order_menu_action(float bInputType, float nPrimary, float nSecondary)
 {
-       local string arg;
-       local float p, i, n, chose;
-       local string frags, color;
+       string arg;
+       float p, i, n, chose;
+       string frags, color;
        if(bInputType != 0) // key down wanted
                return FALSE;
        
@@ -134,19 +134,19 @@ float(float bInputType, float nPrimary, float nSecondary) order_menu_action =
                return FALSE;
        }
        return TRUE;
-};
+}
 
-void() order_menu_show =
+void order_menu_show()
 {
        order_page = 0;
        menu_show = order_menu_render;
        menu_action = order_menu_action;
-};
+}
 
 
-void() ctf_menu_render =
+void ctf_menu_render()
 {
-       local vector ps, po;
+       vector ps, po;
        ps = '0 200 0';
        po = '0 8 0';
        
@@ -162,11 +162,11 @@ void() ctf_menu_render =
        } else {
                menu_close();
        }
-};
+}
 
-float(float bInputType, float nPrimary, float nSecondary) ctf_menu_action =
+float ctf_menu_action(float bInputType, float nPrimary, float nSecondary)
 {
-       local string arg;
+       string arg;
        if(bInputType != 0) // key down wanted
                return FALSE;
        
@@ -188,9 +188,9 @@ float(float bInputType, float nPrimary, float nSecondary) ctf_menu_action =
                return FALSE;
        }
        return TRUE;
-};
+}
 
-void() ctf_menu_show =
+void ctf_menu_show()
 {
        if(getstati(STAT_CTF_STATE) < 0)
                return;
@@ -198,11 +198,11 @@ void() ctf_menu_show =
        menu_action = ctf_menu_action;
        menu_visible = TRUE;
        //menu_default_binds();
-};
+}
 
-void() ctf_view =
+void ctf_view()
 {
-       local float stat;
+       float stat;
        stat = getstati(STAT_CTF_STATE);
        if(stat == CTF_STATE_ATTACK) {
                drawpic('0 0 0', "gfx/ctf_ic_atk.tga", '64 64 0', '1 1 1', 1, 0);
@@ -214,6 +214,6 @@ void() ctf_view =
        } else {
                drawstring('0 0 0', _("Awaiting orders..."), '8 8 0', '1 1 1', 0.5, 0);
        }
-};
+}
 
 #endif
index 1617e4923d8940503b7e0c9d8b3d4e49707ffc81..51029396a299e46ce1270781b905ed7c9db99f25 100644 (file)
@@ -145,6 +145,7 @@ void Ent_DamageInfo(float isNew)
        
        if(DEATH_ISTURRET(w_deathtype))
        {           
+           string _snd;
            traceline(w_org - normalize(force) * 16, w_org + normalize(force) * 16, MOVE_NOMONSTERS, world);
            if(trace_plane_normal != '0 0 0')       
             w_backoff = trace_plane_normal;
@@ -157,20 +158,13 @@ void Ent_DamageInfo(float isNew)
            {   
              case DEATH_TURRET_EWHEEL:
                 sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTN_MIN);
-                pointparticles(particleeffectnum("electro_impact"), self.origin, w_backoff * 1000, 1);
+                pointparticles(particleeffectnum("laser_impact"), self.origin, w_backoff * 1000, 1);
                 break;
              
              case DEATH_TURRET_FLAC:
-                vector org2;
-                org2 = w_org + w_backoff * 6;
-                pointparticles(particleeffectnum("hagar_explode"), org2, '0 0 0', 1);
-                if (w_random<0.15)
-                    sound(self, CH_SHOTS, "weapons/hagexp1.wav", VOL_BASE, ATTN_NORM);
-                else if (w_random<0.7)
-                    sound(self, CH_SHOTS, "weapons/hagexp2.wav", VOL_BASE, ATTN_NORM);
-                else
-                    sound(self, CH_SHOTS, "weapons/hagexp3.wav", VOL_BASE, ATTN_NORM);
-                
+                pointparticles(particleeffectnum("hagar_explode"), w_org, '0 0 0', 1);
+                _snd = strcat("weapons/hagexp", ftos(1 + rint(random() * 2)), ".waw");
+                sound(self, CH_SHOTS, _snd, VOL_BASE, ATTN_NORM);                
                 break;
                 
              case DEATH_TURRET_MLRS:
@@ -183,7 +177,6 @@ void Ent_DamageInfo(float isNew)
              
              case DEATH_TURRET_MACHINEGUN:
              case DEATH_TURRET_WALKER_GUN:
-                string _snd;
                 _snd = strcat("weapons/ric", ftos(1 + rint(random() * 2)), ".waw");
                 sound(self, CH_SHOTS, _snd, VOL_BASE, ATTN_NORM);
                 pointparticles(particleeffectnum("machinegun_impact"), self.origin, w_backoff * 1000, 1);
index 3d3fe93cc41ce8ba33a5116c9cde740b1af9c9e3..fe2e042f82623d8475bb5d397f699f1e8ebc864d 100644 (file)
@@ -1789,10 +1789,56 @@ void HUD_KillNotify(string s1, string s2, string s3, float type, float msg) // s
                                else
                                        print (sprintf(_("^1%s^1 is now conserved for centuries to come\n"), s1));
                        }
-               } else if(type == DEATH_TURRET) {
+               } else if(DEATH_ISTURRET(type)) {
                        HUD_KillNotify_Push(s1, "", 0, DEATH_GENERIC);
                        if(alsoprint)
-                               print (sprintf(_("^1%s^1 was mowed down by a turret \n"), s1));
+                       {
+                           if(gentle)
+                    print (sprintf(_("^1%s^1 ran into a turret\n"), s1));
+                else
+                {                                
+                    switch(type)
+                    {
+                        case DEATH_TURRET_EWHEEL:
+                            print (sprintf(_("^1%s^1 was laserd down by a eWheel turret \n"), s1));
+                            break;
+                        case DEATH_TURRET_FLAC:
+                            print (sprintf(_("^1%s^1 got caught in the flac \n"), s1));
+                            break;
+                        case DEATH_TURRET_MACHINEGUN:
+                            print (sprintf(_("^1%s^1 was riddeld full of riddled by a machinegun turret \n"), s1));
+                            break;
+                        case DEATH_TURRET_WALKER_GUN:
+                            print (sprintf(_("^1%s^1 got served a led enrichment by a walker turret \n"), s1));
+                            break;
+                        case DEATH_TURRET_WALKER_MEELE:
+                            print (sprintf(_("^1%s^1 was impaled by a walker turret \n"), s1));
+                            break;
+                        case DEATH_TURRET_WALKER_ROCKET:
+                            print (sprintf(_("^1%s^1 was rocketed to hell by a walker turret \n"), s1));
+                            break;
+                        case DEATH_TURRET_HELLION:
+                            print (sprintf(_("^1%s^1 was blasted away hellion turret \n"), s1));
+                            break;
+                        case DEATH_TURRET_HK:
+                            print (sprintf(_("^1%s^1 could not hide from the hunter turret \n"), s1));
+                            break;
+                        case DEATH_TURRET_MLRS:
+                            print (sprintf(_("^1%s^1 got turned into smoldering gibs by a mlrs turret \n"), s1));
+                            break;
+                        case DEATH_TURRET_PLASMA:
+                            print (sprintf(_("^1%s^1 got served some superheated plasma from a plasma turret \n"), s1));
+                            break;
+                        case DEATH_TURRET_PHASER:
+                            print (sprintf(_("^1%s^1 was phased out \n"), s1));
+                            break;
+                        case DEATH_TURRET_TESLA:                               
+                            print (sprintf(_("^1%s^1 was electrocuted by a tesla turret \n"), s1));
+                            break;
+                    }
+                }
+                       }
+                               
                } else if (type == DEATH_CUSTOM) {
                        HUD_KillNotify_Push(s1, "", 0, DEATH_CUSTOM);
                        if(alsoprint)
@@ -2339,14 +2385,34 @@ void HUD_Radar(void)
 {
        if (!autocvar__hud_configure)
        {
-               if (autocvar_hud_panel_radar == 0) return;
-               if (autocvar_hud_panel_radar != 2 && !teamplay) return;
+               if (hud_panel_radar_maximized)
+               {
+                       if (!hud_draw_maximized) return;
+               }
+               else
+               {
+                       if (autocvar_hud_panel_radar == 0) return;
+                       if (autocvar_hud_panel_radar != 2 && !teamplay) return;
+               }
        }
        else
                hud_configure_active_panel = HUD_PANEL_RADAR;
 
        HUD_Panel_UpdateCvars(radar);
        HUD_Panel_ApplyFadeAlpha();
+
+       if (hud_panel_radar_maximized && !autocvar__hud_configure)
+       {
+               panel_size = autocvar_hud_panel_radar_maximized_size;
+               panel_size_x = bound(0.2, panel_size_x, 1) * vid_conwidth;
+               panel_size_y = bound(0.2, panel_size_y, 1) * vid_conheight;
+               panel_pos_x = (vid_conwidth - panel_size_x) / 2;
+               panel_pos_y = (vid_conheight - panel_size_y) / 2;
+               
+               panel_bg = strcat(hud_skin_path, "/border_default"); // always use the default border when maximized
+               if(precache_pic(panel_bg) == "") { panel_bg = "gfx/hud/default/border_default"; } // fallback
+       }
+
        vector pos, mySize;
        pos = panel_pos;
        mySize = panel_size;
@@ -2358,8 +2424,8 @@ void HUD_Radar(void)
                mySize -= '2 2 0' * panel_bg_padding;
        }
 
-       local float color2;
-       local entity tm;
+       float color2;
+       entity tm;
        float scale2d, normalsize, bigsize;
        float f;
 
@@ -2929,7 +2995,7 @@ float vote_change; // "time" when vote_active changed
 
 void HUD_VoteWindow(void) 
 {
-       if(autocvar_cl_allow_uid2name == -1 && (gametype == GAME_CTS || gametype == GAME_RACE))
+       if(autocvar_cl_allow_uid2name == -1 && (gametype == GAME_CTS || gametype == GAME_RACE || (serverflags & SERVERFLAG_PLAYERSTATS)))
        {
                vote_active = 1;
                if (autocvar__hud_configure)
@@ -2939,7 +3005,9 @@ void HUD_VoteWindow(void)
                        print(_("^1You must answer before entering hud configure mode\n"));
                        cvar_set("_hud_configure", "0");
                }
-               vote_called_vote = strzone(_("^2Name ^7instead of \"^1Unregistered player^7\" in stats"));
+               if(vote_called_vote)
+                       strunzone(vote_called_vote);
+               vote_called_vote = strzone(_("^2Name ^7instead of \"^1Anonymous player^7\" in stats"));
                uid2name_dialog = 1;
        }
 
@@ -3847,6 +3915,8 @@ void HUD_Chat(void)
                                cvar_set("con_chatrect", "0");
                        return;
                }
+               if(autocvar__con_chat_maximized)
+                       if(!hud_draw_maximized) return;
        }
        else
                hud_configure_active_panel = HUD_PANEL_CHAT;
@@ -4872,15 +4942,17 @@ void HUD_Main (void)
                }
        }
 
+       hud_draw_maximized = 0;
        // draw panels in order specified by panel_order array
-       for(i = HUD_PANEL_NUM - 1; i >= 0; --i) {
-               if(i != HUD_PANEL_CHAT || !autocvar__con_chat_maximized) // don't draw maximized chat panel twice!
-                       HUD_DrawPanel(panel_order[i]);
-       }
+       for(i = HUD_PANEL_NUM - 1; i >= 0; --i)
+               HUD_DrawPanel(panel_order[i]);
 
-       // draw chat panel on top if it is maximized
+       hud_draw_maximized = 1; // panels that may be maximized must check this var
+       // draw maximized panels on top
+       if(hud_panel_radar_maximized)
+               HUD_Radar();
        if(autocvar__con_chat_maximized)
-               HUD_Chat(); // HUD_DrawPanel(HUD_PANEL_CHAT);
+               HUD_Chat();
 
        if(autocvar__hud_configure)
        {
index 120db4d0c223896bf209771a52fb3eed59fa65dd..2491d5ca38a7f656fc55319981070771b3124b9e 100644 (file)
@@ -3,6 +3,9 @@ float log(float f);
 float panel_order[HUD_PANEL_NUM];
 string hud_panelorder_prev;
 
+float hud_draw_maximized;
+float hud_panel_radar_maximized;
+
 vector mousepos;
 vector panel_click_distance; // mouse cursor distance from the top left corner of the panel (saved only upon a click)
 vector panel_click_resizeorigin; // coordinates for opposite point when resizing
index 31fecfaee2287e81131ebb5e5319c33983a02f7b..37ad89da52676ac4412fa0f60879658fed1e363c 100644 (file)
@@ -283,14 +283,14 @@ void Ent_Projectile()
                        case PROJECTILE_ELECTRO_BEAM: setmodel(self, "models/elaser.mdl");self.traileffect = particleeffectnum("TR_NEXUIZPLASMA"); break;
                        case PROJECTILE_GRENADE: setmodel(self, "models/grenademodel.md3");self.traileffect = particleeffectnum("TR_GRENADE"); break;
                        case PROJECTILE_GRENADE_BOUNCING: setmodel(self, "models/grenademodel.md3");self.traileffect = particleeffectnum("TR_GRENADE"); break;
-                       case PROJECTILE_MINE: setmodel(self, "models/mine.md3");self.traileffect = particleeffectnum(""); break;
+                       case PROJECTILE_MINE: setmodel(self, "models/mine.md3");self.traileffect = particleeffectnum("TR_GRENADE"); break;
                        case PROJECTILE_LASER: setmodel(self, "models/laser.mdl");self.traileffect = particleeffectnum(""); break;
                        case PROJECTILE_HLAC: setmodel(self, "models/hlac_bullet.md3");self.traileffect = particleeffectnum(""); break;
                        case PROJECTILE_PORTO_RED: setmodel(self, "models/grenademodel.md3");self.traileffect = particleeffectnum("TR_WIZSPIKE"); self.scale = 4; break;
                        case PROJECTILE_PORTO_BLUE: setmodel(self, "models/grenademodel.md3");self.traileffect = particleeffectnum("TR_WIZSPIKE"); self.scale = 4; break;
                        case PROJECTILE_HOOKBOMB: setmodel(self, "models/grenademodel.md3");self.traileffect = particleeffectnum("TR_KNIGHTSPIKE"); break;
-                       case PROJECTILE_HAGAR: setmodel(self, "models/hagarmissile.mdl");self.traileffect = particleeffectnum("TR_GRENADE"); self.scale = 0.4; break;
-                       case PROJECTILE_HAGAR_BOUNCING: setmodel(self, "models/hagarmissile.mdl");self.traileffect = particleeffectnum("TR_GRENADE"); self.scale = 0.4; break;
+                       case PROJECTILE_HAGAR: setmodel(self, "models/hagarmissile.mdl");self.traileffect = particleeffectnum("TR_GRENADE"); self.scale = 0.75; break;
+                       case PROJECTILE_HAGAR_BOUNCING: setmodel(self, "models/hagarmissile.mdl");self.traileffect = particleeffectnum("TR_GRENADE"); self.scale = 0.75; break;
                        case PROJECTILE_FIREBALL: self.model = ""; self.modelindex = 0; self.traileffect = particleeffectnum("fireball"); break; // particle effect is good enough
                        case PROJECTILE_FIREMINE: self.model = ""; self.modelindex = 0; self.traileffect = particleeffectnum("firemine"); break; // particle effect is good enough
                        case PROJECTILE_TAG: setmodel(self, "models/laser.mdl"); self.traileffect = particleeffectnum("TR_ROCKET"); break;
index 852b3609243c5961072ac75f5b217ea25733cd9c..28c992b4d4430d0af87048549ec4be504e19e409 100644 (file)
@@ -80,7 +80,7 @@ void draw_teamradar_background(float fg)
        }
 }
 
-void(vector coord3d, vector pangles, vector rgb) draw_teamradar_player =
+void draw_teamradar_player(vector coord3d, vector pangles, vector rgb)
 {
        vector coord, rgb2;
 
@@ -117,7 +117,7 @@ void(vector coord3d, vector pangles, vector rgb) draw_teamradar_player =
        R_PolygonVertex(coord-v_forward, '1 0 0', rgb, panel_fg_alpha);
        R_PolygonVertex(coord-v_right*3-v_forward*2, '1 1 0', rgb, panel_fg_alpha);
        R_EndPolygon();
-};
+}
 
 void draw_teamradar_icon(vector coord, float icon, entity pingdata, vector rgb, float a)
 {
@@ -177,6 +177,11 @@ void teamradar_loadcvars()
 {
        v_flipped = autocvar_v_flipped;
        hud_panel_radar_scale = autocvar_hud_panel_radar_scale;
+       if (hud_panel_radar_maximized && !autocvar__hud_configure)
+       {
+               if (autocvar_hud_panel_radar_maximized_scale > 0)
+                       hud_panel_radar_scale = autocvar_hud_panel_radar_maximized_scale;
+       }
        hud_panel_radar_foreground_alpha = autocvar_hud_panel_radar_foreground_alpha * panel_fg_alpha;
        hud_panel_radar_rotation = autocvar_hud_panel_radar_rotation;
        hud_panel_radar_zoommode = autocvar_hud_panel_radar_zoommode;
index 1332d60ca106f35fd90f1658be69f978b20a22f4..8fc65b3606ce73aeb7ba8f648fa1072b2b4a6175 100644 (file)
@@ -17,7 +17,6 @@ void turret_precache(float _tid)
 {    
     if (!turret_is_precache[TID_COMMON])
     {
-        dprint("turret_precache TID_COMMON\n");
         precache_sound ("weapons/rocket_impact.wav");
         precache_model ("models/turrets/base-gib1.md3");
         precache_model ("models/turrets/base-gib2.md3");
@@ -33,12 +32,7 @@ void turret_precache(float _tid)
     }
     turret_tid2info(_tid);
     if(turret_is_precache[_tid])
-    {
-        dprint("turret_precache: ", tid2info_name, " allready precachd, skipping.\n");
         return;
-    }
-    else
-        dprint("turret_precache: ", tid2info_name, " precaching.\n");
 
     switch(_tid)
     {
@@ -158,38 +152,39 @@ void turret_tid2info(float _tid)
 }
 
 void turret_remove()
-{
-    turret_tid2info(self.turret_type);
-    dprint("Removing ", tid2info_name, " turrret.\n");
-    
+{    
     remove(self.tur_head);
     self.tur_head = world;    
 }
 
+.vector glowmod;
 void turret_changeteam()
-{
-       self.colormod = '0 0 0';
-       
-       switch(self.team)
+{      
+       switch(self.team - 1)
        {
         case COLOR_TEAM1: // Red
-            self.colormod = '2 0.5 0.5';
+            self.glowmod = '2 0 0';
             break;
 
         case COLOR_TEAM2: // Blue
-            self.colormod = '0.5 0.5 2';
+            self.glowmod = '0 0 2';
             break;
 
         case COLOR_TEAM3: // Yellow
-            self.colormod = '1.4 1.4 0.6';
+            self.glowmod = '1 1 0';
             break;
 
         case COLOR_TEAM4: // Pink
-            self.colormod = '1.4 0.6 1.4';
+            self.glowmod = '1 0 1';
             break;
        }
        
-       self.tur_head.colormod = self.colormod;    
+       if(self.team)
+        self.colormap = 1024 + (self.team - 1) * 17;
+       
+       self.tur_head.colormap = self.colormap;
+       self.tur_head.glowmod = self.glowmod;
+       
 }
 
 void turret_head_draw()
@@ -212,19 +207,17 @@ void turret_draw()
     {
         dt = random();
         
-        if(dt < 0.25)
-            te_spark(self.origin + '0 0 40', randomvec() * 256 + '0 0 256', 16);    
-        
+        if(dt < 0.03)
+            te_spark(self.origin + '0 0 40', randomvec() * 256 + '0 0 256', 16);        
     }
     
-    if(self.health < 85)    
-    if(dt < 0.1)
-        pointparticles(particleeffectnum("smoke_small"), (self.origin + (randomvec() * 80)), '0 0 0', 1);        
+    if(self.health < 85)
+    if(dt < 0.01)
+        pointparticles(particleeffectnum("smoke_large"), (self.origin + (randomvec() * 80)), '0 0 0', 1);
     
     if(self.health < 32)
-    if(dt < 0.1)
-        pointparticles(particleeffectnum("smoke_large"), (self.origin + (randomvec() * 80)), '0 0 0', 1);        
-    
+    if(dt < 0.015)
+        pointparticles(particleeffectnum("smoke_small"), (self.origin + (randomvec() * 80)), '0 0 0', 1);        
 }
 
 void turret_walker_draw()
@@ -247,7 +240,7 @@ void turret_walker_draw()
     self.angles_y = self.move_angles_y;
     
     if (self.health < 127)
-    if(random() < 0.25)
+    if(random() < 0.15)
         te_spark(self.origin + '0 0 40', randomvec() * 256 + '0 0 256', 16);    
 }
 
@@ -275,7 +268,7 @@ void turret_ewheel_draw()
     self.angles_y = self.move_angles_y;
     
     if (self.health < 127)
-    if(random() < 0.25)
+    if(random() < 0.05)
         te_spark(self.origin + '0 0 40', randomvec() * 256 + '0 0 256', 16);    
 }
 
@@ -285,14 +278,19 @@ void turret_construct()
         self.tur_head = spawn();
     
     turret_tid2info(self.turret_type);
-    dprint("Constructing ", tid2info_name , " turret (", ftos(self.turret_type), ")\n");
 
     setorigin(self, self.origin);
     setmodel(self, tid2info_base);
     setmodel(self.tur_head, tid2info_head);
     setsize(self, tid2info_min, tid2info_max);
     setsize(self.tur_head, '0 0 0', '0 0 0');
-    setorigin(self.tur_head, gettaginfo(self, gettagindex(self, "tag_head")));
+    
+    if(self.turret_type == TID_EWHEEL)
+       setorigin(self.tur_head, '0 0 0');
+    else if (self.turret_type == TID_WALKER)
+        setorigin(self.tur_head, '0 0 0');
+    else
+        setorigin(self.tur_head, gettaginfo(self, gettagindex(self, "tag_head")));
 
     self.tur_head.classname     = "turret_head";
     self.tur_head.owner         = self;
@@ -306,9 +304,9 @@ void turret_construct()
     self.tur_head.movetype      = MOVETYPE_NOCLIP;    
     self.draw                   = turret_draw;
     self.entremove              = turret_remove;
-    self.drawmask = MASK_NORMAL;
-    self.tur_head.drawmask = MASK_NORMAL;
-
+    self.drawmask               = MASK_NORMAL;
+    self.tur_head.drawmask      = MASK_NORMAL;
+    self.anim_start_time        = 0;
     if(self.turret_type == TID_EWHEEL || self.turret_type == TID_WALKER)
     {
         self.gravity            = 1;
@@ -334,7 +332,7 @@ void turret_gib_draw()
     Movetype_Physics_MatchTicrate(autocvar_cl_gibs_ticrate, autocvar_cl_gibs_sloppy);
     
     self.drawmask = MASK_NORMAL;
-       
+       
        if(self.cnt)
        {
            if(time >= self.nextthink)
@@ -359,13 +357,17 @@ void turret_gibboom()
     pointparticles(particleeffectnum("rocket_explode"), self.origin, '0 0 0', 1);
 
     for (i = 1; i < 5; i = i + 1)
-        turret_gibtoss(strcat("models/turrets/head-gib", ftos(i), ".md3"), self.origin, self.velocity + randomvec() * 700, '0 0 0', FALSE);
+        turret_gibtoss(strcat("models/turrets/head-gib", ftos(i), ".md3"), self.origin + '0 0 2', self.velocity + randomvec() * 700, '0 0 0', FALSE);
 }
 
 entity turret_gibtoss(string _model, vector _from, vector _to, vector _cmod, float _explode)
 {
     entity gib;
-
+    
+    traceline(_from, _to, MOVE_NOMONSTERS, world);
+    if(trace_startsolid)
+        return world;
+    
     gib = spawn();
     setorigin(gib, _from);
     setmodel(gib, _model);
@@ -373,7 +375,7 @@ entity turret_gibtoss(string _model, vector _from, vector _to, vector _cmod, flo
        gib.solid       = SOLID_CORPSE;
     gib.draw        = turret_gib_draw;    
     gib.cnt         = _explode;
-    
+    setsize(gib, '-1 -1 -1', '1 1 1');
     if(_explode)
     {
         gib.nextthink = time + 0.2 * (autocvar_cl_gibs_lifetime * (1 + prandom() * 0.15));
@@ -389,6 +391,7 @@ entity turret_gibtoss(string _model, vector _from, vector _to, vector _cmod, flo
        gib.move_avelocity  = prandomvec() * 32;
        gib.move_time       = time;
        gib.damageforcescale = 1;
+       gib.classname = "turret_gib";
        
        return gib;
 }
@@ -397,37 +400,40 @@ void turret_die()
 {    
     entity headgib;
     
-    setmodel(self, "");
-    setmodel(self.tur_head, "");
     sound (self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
     pointparticles(particleeffectnum("rocket_explode"), self.origin, '0 0 0', 1);
     turret_tid2info(self.turret_type);
-    dprint("Turret ", tid2info_name, " dies.\n");
     
     // Base
     if(self.turret_type == TID_EWHEEL)
-        turret_gibtoss(tid2info_base, self.origin, self.velocity, '-1 -1 -1', FALSE);
+        turret_gibtoss(tid2info_base, self.origin + '0 0 18', self.velocity + '0 0 400' + '0.1 0.1 1' * (random() * 400), '-1 -1 -1', TRUE);
     else if (self.turret_type == TID_WALKER)
-        turret_gibtoss(tid2info_base, self.origin, self.velocity, '-1 -1 -1', FALSE);
+        turret_gibtoss(tid2info_base, self.origin + '0 0 18', self.velocity + '0 0 300' + '0.1 0.1 1' * (random() * 200), '-1 -1 -1', TRUE);
     else if (self.turret_type == TID_TESLA)
-        turret_gibtoss(tid2info_base, self.origin, self.velocity, '-1 -1 -1', FALSE);
+        turret_gibtoss(tid2info_base, self.origin + '0 0 18', '0 0 200', '-1 -1 -1', FALSE);
     else
     {        
         if (random() > 0.5)
-        {
-            turret_gibtoss("models/turrets/base-gib2.md3", self.origin + '0 0 2', '0 0 50' + randomvec() * 150, '0 0 0', FALSE);
-            turret_gibtoss("models/turrets/base-gib3.md3", self.origin + '0 0 2', '0 0 50' + randomvec() * 150, '0 0 0', FALSE);
-            turret_gibtoss("models/turrets/base-gib4.md3", self.origin + '0 0 2', '0 0 50' + randomvec() * 150, '0 0 0', FALSE);
+        {            
+            turret_gibtoss("models/turrets/base-gib2.md3", self.origin + '0 0 8', '0 0 50' + randomvec() * 150, '0 0 0', FALSE);
+            turret_gibtoss("models/turrets/base-gib3.md3", self.origin + '0 0 8', '0 0 50' + randomvec() * 150, '0 0 0', FALSE);
+            turret_gibtoss("models/turrets/base-gib4.md3", self.origin + '0 0 8', '0 0 50' + randomvec() * 150, '0 0 0', FALSE);
         }
         else
-            turret_gibtoss("models/turrets/base-gib1.md3", self.origin + '0 0 4', '0 0 0', '0 0 0', TRUE);
+            turret_gibtoss("models/turrets/base-gib1.md3", self.origin + '0 0 8', '0 0 0', '0 0 0', TRUE);
+
+        headgib = turret_gibtoss(tid2info_head, self.origin + '0 0 32', '0 0 200' + randomvec() * 200, '-1 -1 -1', TRUE);
+        if(headgib)
+        {
+            headgib.angles = headgib.move_angles = self.tur_head.angles;
+            headgib.avelocity = headgib.move_avelocity = self.tur_head.move_avelocity + randomvec() * 45;
+            headgib.avelocity_y = headgib.move_avelocity_y = headgib.move_avelocity_y * 5;
+            headgib.gravity = 0.5;        
+        }
     }
     
-    headgib = turret_gibtoss(tid2info_head, self.origin + '0 0 32', '0 0 200' + randomvec() * 200, '-1 -1 -1', TRUE);
-    headgib.angles = headgib.move_angles = self.tur_head.angles;
-    headgib.avelocity = headgib.move_avelocity = self.tur_head.move_avelocity + randomvec() * 45;
-    headgib.avelocity_y = headgib.move_avelocity_y = headgib.move_avelocity_y * 5;
-    headgib.gravity = 0.5;
+    setmodel(self, "null");
+    setmodel(self.tur_head, "null");
 }
 
 void ent_turret()
@@ -448,6 +454,10 @@ void ent_turret()
            
            turret_precache(self.turret_type);
            turret_construct();
+           self.colormap = 1024;
+           self.glowmod = '0 1 1'; 
+           self.tur_head.colormap = self.colormap;
+           self.tur_head.glowmod = self.glowmod;
     }
     
     if(sf & TNSF_ANG)
@@ -489,18 +499,19 @@ void ent_turret()
 
     if(sf & TNSF_STATUS)
     {
-        float _team;
-        _team = ReadByte();
-        _team -= 1; // /&)=(%&#)&%)/#&)=½!!!½!!". thanks.
-        self.health = ReadByte();
-        if(_team != self.team)
-        {
-            self.team = _team;
-            turret_changeteam();        
+        float _tmp;
+        _tmp = ReadByte();        
+        if(_tmp != self.team)
+        {            
+            self.team = _tmp;                
+            turret_changeteam();
         }
         
-        if(self.health == 0)
+        _tmp = ReadByte();        
+        if(_tmp == 0 && self.health != 0)
             turret_die();
+
+        self.health = _tmp;
     } 
     
 }
index 6e1c1f9bd78b2ab3480a1054020fbec475edbc86..2fea077c5d0c928c6629289de9273886b3e98fd9 100644 (file)
@@ -1,6 +1,6 @@
 #define TUBA_MIN -18
 #define TUBA_MAX  27
-#define TUBA_INSTRUMENTS 1
+#define TUBA_INSTRUMENTS 2
 
 #define TUBA_STARTNOTE(i,n) strcat("weapons/tuba", (i ? ftos(i) : ""), "_loopnote", ftos(n), ".wav")
 .float note; // note
@@ -117,9 +117,11 @@ void Ent_TubaNote_StopSound()
 
 void Ent_TubaNote(float bIsNew)
 {
-       float f, n, i, att;
+       float f, n, i, att, upd;
        f = ReadByte();
 
+       upd = 0;
+
        if(f & 1)
        {
                n = ReadChar();
@@ -151,7 +153,7 @@ void Ent_TubaNote(float bIsNew)
                {
                        self.note = n;
                        self.tuba_instrument = i;
-                       Ent_TubaNote_UpdateSound();
+                       upd = 1;
                }
        }
 
@@ -169,6 +171,9 @@ void Ent_TubaNote(float bIsNew)
        self.entremove = Ent_TubaNote_StopSound;
        self.enemy.think = Ent_TubaNote_Think;
        self.enemy.nextthink = time + 10;
+
+       if(upd)
+               Ent_TubaNote_UpdateSound();
 }
 
 void Tuba_Precache()
index 9c40578739b3ae00744a63dc3fd0e14bd827a250..add142d22798664d12b791bb100dc7f5e1188806 100644 (file)
@@ -575,9 +575,9 @@ float DEATH_TURRET_LAST            = 10512;
 float DEATH_WEAPONMASK = 0xFF;
 float DEATH_HITTYPEMASK = 0x1F00; // which is WAY below 10000 used for normal deaths
 float HITTYPE_SECONDARY = 0x100;
-float HITTYPE_SPLASH = 0x200;
+float HITTYPE_SPLASH = 0x200; // automatically set by RadiusDamage
 float HITTYPE_BOUNCE = 0x400;
-float HITTYPE_HEADSHOT = 0x800;
+float HITTYPE_HEADSHOT = 0x800; // automatically set by Damage (if headshotbonus is set)
 float HITTYPE_RESERVED = 0x1000; // unused yet
 
 // macros to access these
@@ -715,3 +715,4 @@ float HUD_MENU_ENABLE               = 0;
 
 #define SERVERFLAG_ALLOW_FULLBRIGHT 1
 #define SERVERFLAG_TEAMPLAY 2
+#define SERVERFLAG_PLAYERSTATS 4
index 0ab17f34a4eebed25e7dee028c104c7d5fb25602..2f7d0ee3ab4211609c20257b0f360b0021dee1bb 100644 (file)
@@ -1,5 +1,7 @@
-// files (-1 for URL)
+// files
 .float url_fh;
+#define URL_FH_CURL   -1
+#define URL_FH_STDOUT -2
 
 // URLs
 .string url_url;
@@ -35,7 +37,7 @@ float url_URI_Get_Callback(float id, float status, string data)
        url_fromid[id] = world;
 
        // if we get here, we MUST have both buffers cleared
-       if(e.url_rbuf != -1 || e.url_wbuf != -1 || e.url_fh != -1)
+       if(e.url_rbuf != -1 || e.url_wbuf != -1 || e.url_fh != URL_FH_CURL)
                error("url_URI_Get_Callback: not a request waiting for data");
 
        if(status == 0)
@@ -76,7 +78,7 @@ float url_URI_Get_Callback(float id, float status, string data)
        }
 }
 
-void url_fopen(string url, float mode, url_ready_func rdy, entity pass)
+void url_single_fopen(string url, float mode, url_ready_func rdy, entity pass)
 {
        entity e;
        float i;
@@ -91,13 +93,13 @@ void url_fopen(string url, float mode, url_ready_func rdy, entity pass)
 
                                // create a writing end that does nothing yet
                                e = spawn();
-                               e.classname = "url_fopen_file";
+                               e.classname = "url_single_fopen_file";
                                e.url_url = strzone(url);
-                               e.url_fh = -1;
+                               e.url_fh = URL_FH_CURL;
                                e.url_wbuf = buf_create();
                                if(e.url_wbuf < 0)
                                {
-                                       print("url_fopen: out of memory in buf_create\n");
+                                       print("url_single_fopen: out of memory in buf_create\n");
                                        rdy(e, pass, URL_READY_ERROR);
                                        strunzone(e.url_url);
                                        remove(e);
@@ -105,6 +107,8 @@ void url_fopen(string url, float mode, url_ready_func rdy, entity pass)
                                }
                                e.url_wbufpos = 0;
                                e.url_rbuf = -1;
+                               e.url_ready = rdy;
+                               e.url_ready_pass = pass;
                                rdy(e, pass, URL_READY_CANWRITE);
                                break;
 
@@ -122,7 +126,7 @@ void url_fopen(string url, float mode, url_ready_func rdy, entity pass)
                                                        break;
                                        if(i >= autocvar__urllib_nextslot)
                                        {
-                                               print("url_fopen: too many concurrent requests\n");
+                                               print("url_single_fopen: too many concurrent requests\n");
                                                rdy(world, pass, URL_READY_ERROR);
                                                return;
                                        }
@@ -131,7 +135,7 @@ void url_fopen(string url, float mode, url_ready_func rdy, entity pass)
                                // GET the data
                                if(!crypto_uri_postbuf(url, i + MIN_URL_ID, string_null, string_null, -1, 0))
                                {
-                                       print("url_fopen: failure in crypto_uri_postbuf\n");
+                                       print("url_single_fopen: failure in crypto_uri_postbuf\n");
                                        rdy(world, pass, URL_READY_ERROR);
                                        return;
                                }
@@ -140,9 +144,9 @@ void url_fopen(string url, float mode, url_ready_func rdy, entity pass)
                                // all). Wait for data to come from the
                                // server, then call the callback
                                e = spawn();
-                               e.classname = "url_fopen_file";
+                               e.classname = "url_single_fopen_file";
                                e.url_url = strzone(url);
-                               e.url_fh = -1;
+                               e.url_fh = URL_FH_CURL;
                                e.url_rbuf = -1;
                                e.url_wbuf = -1;
                                e.url_ready = rdy;
@@ -155,6 +159,25 @@ void url_fopen(string url, float mode, url_ready_func rdy, entity pass)
                                break;
                }
        }
+       else if(url == "-")
+       {
+               switch(mode)
+               {
+                       case FILE_WRITE:
+                       case FILE_APPEND:
+                               e = spawn();
+                               e.classname = "url_single_fopen_stdout";
+                               e.url_fh = URL_FH_STDOUT;
+                               e.url_ready = rdy;
+                               e.url_ready_pass = pass;
+                               rdy(e, pass, URL_READY_CANWRITE);
+                               break;
+                       case FILE_READ:
+                               print("url_single_fopen: cannot open '-' for reading\n");
+                               rdy(world, pass, URL_READY_ERROR);
+                               break;
+               }
+       }
        else
        {
                float fh;
@@ -167,8 +190,10 @@ void url_fopen(string url, float mode, url_ready_func rdy, entity pass)
                else
                {
                        e = spawn();
-                       e.classname = "url_fopen_file";
+                       e.classname = "url_single_fopen_file";
                        e.url_fh = fh;
+                       e.url_ready = rdy;
+                       e.url_ready_pass = pass;
                        if(mode == FILE_READ)
                                rdy(e, pass, URL_READY_CANREAD);
                        else
@@ -178,11 +203,11 @@ void url_fopen(string url, float mode, url_ready_func rdy, entity pass)
 }
 
 // close a file
-void url_fclose(entity e, url_ready_func rdy, entity pass)
+void url_fclose(entity e)
 {
        float i;
 
-       if(e.url_fh < 0)
+       if(e.url_fh == URL_FH_CURL)
        {
                if(e.url_rbuf == -1 || e.url_wbuf != -1) // not(post GET/POST request)
                if(e.url_rbuf != -1 || e.url_wbuf == -1) // not(pre POST request)
@@ -205,7 +230,7 @@ void url_fclose(entity e, url_ready_func rdy, entity pass)
                                if(i >= autocvar__urllib_nextslot)
                                {
                                        print("url_fclose: too many concurrent requests\n");
-                                       rdy(e, pass, URL_READY_ERROR);
+                                       e.url_ready(e,e.url_ready_pass, URL_READY_ERROR);
                                        buf_del(e.url_wbuf);
                                        strunzone(e.url_url);
                                        remove(e);
@@ -217,7 +242,7 @@ void url_fclose(entity e, url_ready_func rdy, entity pass)
                        if(!crypto_uri_postbuf(e.url_url, i + MIN_URL_ID, "text/plain", "", e.url_wbuf, 0))
                        {
                                print("url_fclose: failure in crypto_uri_postbuf\n");
-                               rdy(e, pass, URL_READY_ERROR);
+                               e.url_ready(e, e.url_ready_pass, URL_READY_ERROR);
                                buf_del(e.url_wbuf);
                                strunzone(e.url_url);
                                remove(e);
@@ -229,8 +254,6 @@ void url_fclose(entity e, url_ready_func rdy, entity pass)
                        // call the callback
                        buf_del(e.url_wbuf);
                        e.url_wbuf = -1;
-                       e.url_ready = rdy;
-                       e.url_ready_pass = pass;
                        e.url_id = i;
                        url_fromid[i] = e;
 
@@ -240,17 +263,22 @@ void url_fclose(entity e, url_ready_func rdy, entity pass)
                else
                {
                        // we have READ all data, just close
-                       rdy(e, pass, URL_READY_CLOSED);
+                       e.url_ready(e, e.url_ready_pass, URL_READY_CLOSED);
                        buf_del(e.url_rbuf);
                        strunzone(e.url_url);
                        remove(e);
                }
        }
+       else if(e.url_fh == URL_FH_STDOUT)
+       {
+               e.url_ready(e, e.url_ready_pass, URL_READY_CLOSED); // closing creates no reading handle
+               remove(e);
+       }
        else
        {
                // file
                fclose(e.url_fh);
-               rdy(e, pass, URL_READY_CLOSED); // closing creates no reading handle
+               e.url_ready(e, e.url_ready_pass, URL_READY_CLOSED); // closing creates no reading handle
                remove(e);
        }
 }
@@ -258,7 +286,7 @@ void url_fclose(entity e, url_ready_func rdy, entity pass)
 // with \n (blame FRIK_FILE)
 string url_fgets(entity e)
 {
-       if(e.url_fh < 0)
+       if(e.url_fh == URL_FH_CURL)
        {
                if(e.url_rbuf == -1)
                        error("url_fgets: not readable in current state");
@@ -268,6 +296,11 @@ string url_fgets(entity e)
                e.url_rbufpos += 1;
                return s;
        }
+       else if(e.url_fh == URL_FH_STDOUT)
+       {
+               // stdout
+               return string_null;
+       }
        else
        {
                // file
@@ -278,7 +311,7 @@ string url_fgets(entity e)
 // without \n (blame FRIK_FILE)
 void url_fputs(entity e, string s)
 {
-       if(e.url_fh < 0)
+       if(e.url_fh == URL_FH_CURL)
        {
                if(e.url_wbuf == -1)
                        error("url_fputs: not writable in current state");
@@ -286,9 +319,56 @@ void url_fputs(entity e, string s)
                bufstr_set(e.url_wbuf, e.url_wbufpos, s);
                e.url_wbufpos += 1;
        }
+       else if(e.url_fh == URL_FH_STDOUT)
+       {
+               // stdout
+               print(s);
+       }
        else
        {
                // file
                fputs(e.url_fh, s);
        }
 }
+
+// multi URL object, tries URLs separated by space in sequence
+void url_multi_ready(entity fh, entity me, float status)
+{
+       float n;
+       if(status == URL_READY_ERROR)
+       {
+               me.cnt += 1;
+               n = tokenize_console(me.url_url);
+               if(n <= me.cnt)
+               {
+                       me.url_ready(fh, me.url_ready_pass, status);
+                       strunzone(me.url_url);
+                       remove(me);
+                       return;
+               }
+               url_single_fopen(argv(me.cnt), me.lip, url_multi_ready, me);
+               return;
+       }
+       me.url_ready(fh, me.url_ready_pass, status);
+}
+void url_multi_fopen(string url, float mode, url_ready_func rdy, entity pass)
+{
+       float n;
+       n = tokenize_console(url);
+       if(n <= 0)
+       {
+               print("url_multi_fopen: need at least one URL\n");
+               rdy(world, pass, URL_READY_ERROR);
+               return;
+       }
+
+       entity me;
+       me = spawn();
+       me.classname = "url_multi";
+       me.url_url = strzone(url);
+       me.cnt = 0;
+       me.lip = mode;
+       me.url_ready = rdy;
+       me.url_ready_pass = pass;
+       url_single_fopen(argv(0), mode, url_multi_ready, me);
+}
index a7735ed4f3f9ee1b05d279366125e7dfe0dd4a05..f92178b2f6f6a6569b72af048fbba23811c0e69f 100644 (file)
@@ -5,8 +5,8 @@ float URL_READY_CANREAD  =  2;
 // errors: -1, or negative HTTP status code
 typedef void(entity handle, entity pass, float status) url_ready_func;
 
-void url_fopen(string url, float mode, url_ready_func rdy, entity pass);
-void url_fclose(entity e, url_ready_func rdy, entity pass);
+void url_single_fopen(string url, float mode, url_ready_func rdy, entity pass);
+void url_fclose(entity e);
 string url_fgets(entity e);
 void url_fputs(entity e, string s);
 
@@ -14,3 +14,5 @@ void url_fputs(entity e, string s);
 float url_URI_Get_Callback(float id, float status, string data);
 #define MIN_URL_ID 128
 #define NUM_URL_ID 64
+
+void url_multi_fopen(string url, float mode, url_ready_func rdy, entity pass);
index 23d4f3431941958bbf188467aa90ab8ede62061e..d97ec0918be53a64e3d55e00e296b6f5c0b31032 100644 (file)
@@ -41,8 +41,8 @@ void wordwrap_sprint(string s, float l)
 
 string unescape(string in)
 {
-       local float i, len;
-       local string str, s;
+       float i, len;
+       string str, s;
 
        // but it doesn't seem to be necessary in my tests at least
        in = strzone(in);
@@ -72,8 +72,8 @@ string unescape(string in)
 
 void wordwrap_cb(string s, float l, void(string) callback)
 {
-       local string c;
-       local float lleft, i, j, wlen;
+       string c;
+       float lleft, i, j, wlen;
 
        s = strzone(s);
        lleft = l;
@@ -1143,21 +1143,16 @@ string rgb_to_hexcolor(vector rgb)
 }
 
 // requires that m2>m1 in all coordinates, and that m4>m3
-float boxesoverlap(vector m1, vector m2, vector m3, vector m4) {return m2_x >= m3_x && m1_x <= m4_x && m2_y >= m3_y && m1_y <= m4_y && m2_z >= m3_z && m1_z <= m4_z;};
+float boxesoverlap(vector m1, vector m2, vector m3, vector m4) {return m2_x >= m3_x && m1_x <= m4_x && m2_y >= m3_y && m1_y <= m4_y && m2_z >= m3_z && m1_z <= m4_z;}
 
 // requires the same, but is a stronger condition
-float boxinsidebox(vector smins, vector smaxs, vector bmins, vector bmaxs) {return smins_x >= bmins_x && smaxs_x <= bmaxs_x && smins_y >= bmins_y && smaxs_y <= bmaxs_y && smins_z >= bmins_z && smaxs_z <= bmaxs_z;};
+float boxinsidebox(vector smins, vector smaxs, vector bmins, vector bmaxs) {return smins_x >= bmins_x && smaxs_x <= bmaxs_x && smins_y >= bmins_y && smaxs_y <= bmaxs_y && smins_z >= bmins_z && smaxs_z <= bmaxs_z;}
 
 #ifndef MENUQC
 #endif
 
 float textLengthUpToWidth(string theText, float maxWidth, vector theSize, textLengthUpToWidth_widthFunction_t w)
 {
-       float ICanHasKallerz;
-
-       // detect color codes support in the width function
-       ICanHasKallerz = (w("^7", theSize) == 0);
-
        // STOP.
        // The following function is SLOW.
        // For your safety and for the protection of those around you...
@@ -1181,7 +1176,7 @@ float textLengthUpToWidth(string theText, float maxWidth, vector theSize, textLe
        }
        while(left < right - 1);
 
-       if(ICanHasKallerz)
+       if(w("^7", theSize) == 0) // detect color codes support in the width function
        {
                // NOTE: when color codes are involved, this binary search is,
                // mathematically, BROKEN. However, it is obviously guaranteed to
@@ -1222,11 +1217,6 @@ float textLengthUpToWidth(string theText, float maxWidth, vector theSize, textLe
 
 float textLengthUpToLength(string theText, float maxWidth, textLengthUpToLength_lenFunction_t w)
 {
-       float ICanHasKallerz;
-
-       // detect color codes support in the width function
-       ICanHasKallerz = (w("^7") == 0);
-
        // STOP.
        // The following function is SLOW.
        // For your safety and for the protection of those around you...
@@ -1250,7 +1240,7 @@ float textLengthUpToLength(string theText, float maxWidth, textLengthUpToLength_
        }
        while(left < right - 1);
 
-       if(ICanHasKallerz)
+       if(w("^7") == 0) // detect color codes support in the width function
        {
                // NOTE: when color codes are involved, this binary search is,
                // mathematically, BROKEN. However, it is obviously guaranteed to
@@ -1289,6 +1279,42 @@ float textLengthUpToLength(string theText, float maxWidth, textLengthUpToLength_
        return left;
 }
 
+string find_last_color_code(string s)
+{
+       float start, len, i, carets;
+       start = strstrofs(s, "^", 0);
+       if (start == -1) // no caret found
+               return "";
+       len = strlen(s)-1;
+       for(i = len; i >= start; --i)
+       {
+               if(substring(s, i, 1) != "^")
+                       continue;
+
+               carets = 1;
+               while (i-carets >= start && substring(s, i-carets, 1) == "^")
+                       ++carets;
+
+               // check if carets aren't all escaped
+               if (carets == 1 || mod(carets, 2) == 1) // first check is just an optimization
+               {
+                       if(i+1 <= len)
+                       if(strstrofs("0123456789", substring(s, i+1, 1), 0) >= 0)
+                               return substring(s, i, 2);
+
+                       if(i+4 <= len)
+                       if(substring(s, i+1, 1) == "x")
+                       if(strstrofs("0123456789abcdefABCDEF", substring(s, i+2, 1), 0) >= 0)
+                       if(strstrofs("0123456789abcdefABCDEF", substring(s, i+3, 1), 0) >= 0)
+                       if(strstrofs("0123456789abcdefABCDEF", substring(s, i+4, 1), 0) >= 0)
+                               return substring(s, i, 5);
+               }
+               i -= carets; // this also skips one char before the carets
+       }
+
+       return "";
+}
+
 string getWrappedLine(float w, vector theFontSize, textLengthUpToWidth_widthFunction_t tw)
 {
        float cantake;
@@ -1308,6 +1334,8 @@ string getWrappedLine(float w, vector theFontSize, textLengthUpToWidth_widthFunc
                        getWrappedLine_remaining = substring(s, cantake, strlen(s) - cantake);
                        if(getWrappedLine_remaining == "")
                                getWrappedLine_remaining = string_null;
+                       else if (tw("^7", theFontSize) == 0)
+                               getWrappedLine_remaining = strcat(find_last_color_code(substring(s, 0, cantake)), getWrappedLine_remaining);
                        return substring(s, 0, cantake);
                }
                else
@@ -1315,6 +1343,8 @@ string getWrappedLine(float w, vector theFontSize, textLengthUpToWidth_widthFunc
                        getWrappedLine_remaining = substring(s, take + 1, strlen(s) - take);
                        if(getWrappedLine_remaining == "")
                                getWrappedLine_remaining = string_null;
+                       else if (tw("^7", theFontSize) == 0)
+                               getWrappedLine_remaining = strcat(find_last_color_code(substring(s, 0, take)), getWrappedLine_remaining);
                        return substring(s, 0, take);
                }
        }
@@ -1344,6 +1374,8 @@ string getWrappedLineLen(float w, textLengthUpToLength_lenFunction_t tw)
                        getWrappedLine_remaining = substring(s, cantake, strlen(s) - cantake);
                        if(getWrappedLine_remaining == "")
                                getWrappedLine_remaining = string_null;
+                       else if (tw("^7") == 0)
+                               getWrappedLine_remaining = strcat(find_last_color_code(substring(s, 0, cantake)), getWrappedLine_remaining);
                        return substring(s, 0, cantake);
                }
                else
@@ -1351,6 +1383,8 @@ string getWrappedLineLen(float w, textLengthUpToLength_lenFunction_t tw)
                        getWrappedLine_remaining = substring(s, take + 1, strlen(s) - take);
                        if(getWrappedLine_remaining == "")
                                getWrappedLine_remaining = string_null;
+                       else if (tw("^7") == 0)
+                               getWrappedLine_remaining = strcat(find_last_color_code(substring(s, 0, take)), getWrappedLine_remaining);
                        return substring(s, 0, take);
                }
        }
@@ -2051,3 +2085,13 @@ float xdecode(string s)
                return -1;
        return ((a * 22 + b) * 22 + c) * 22 + d;
 }
+
+float lowestbit(float f)
+{
+       f &~= f * 2;
+       f &~= f * 4;
+       f &~= f * 16;
+       f &~= f * 256;
+       f &~= f * 65536;
+       return f;
+}
index f3d780b6f55fe7edf13e8e18129b44199b110a6a..83ef53762c914ab5f5ca4cbd255547d14163f7a8 100644 (file)
@@ -74,8 +74,7 @@ void GameCommand(string theCommand)
 
        if(argv(0) == "sync")
        {
-               loadAllCvars(main);
-               updateCompression();
+               m_sync();
                return;
        }
 
@@ -119,18 +118,6 @@ void GameCommand(string theCommand)
                return;
        }
 
-       if(argv(0) == "setresolution")
-       {
-               updateConwidths();
-               return;
-       }
-
-       if(argv(0) == "setcompression")
-       {
-               updateCompression();
-               return;
-       }
-
        if(argv(0) == "curl")
        {
                float do_exec;
index b23078bae061a91509793dc2dd415e542993a0cd..bdeed2bb16dd941b2c4ec008e63e5448b77f2c01 100644 (file)
@@ -85,5 +85,5 @@ void BorderImage_draw(entity me)
                        draw_fontscale = df;
                }
        }
-};
+}
 #endif
index d10e6a486d99d981083a26725e8f57237c2ead7e..5e924a0eebf7726cc10825984f6e3563e352b312 100644 (file)
@@ -177,7 +177,7 @@ void Container_draw(entity me)
                e.draw(e);
                me.leaveSubitem(me);
        }
-};
+}
 
 void Container_focusLeave(entity me)
 {
index dd752e6e54797aaac05e1bf5542621328810b097..a47e5d6b4d89df9b42086d692fc9d24d5022d17b 100644 (file)
@@ -43,7 +43,7 @@ void Gecko_draw(entity me)
                draw_Picture( '0 0 0', strcat( "/", me.texturePath ), 
                        drawSize, '1 1 1', 1.0 );
        } else {
-               local vector fontsize;
+               vector fontsize;
                fontsize_x = fontsize_y = 1.0 / 30.0;
                fontsize_z = 0.0;
                draw_Text( '0 0 0', _("Browser not initialized!"), fontsize, '1 1 1', 1.0, 0 );
index 82bd6f62b8cdf1284d16b6df0a3d4c7ae7994a32..4f1ff4e9edd2cb580dff3f8f304dc39748aa1b6b 100644 (file)
@@ -227,7 +227,7 @@ void ModalController_draw(entity me)
        else
                me.setFocus(me, front);
        SUPER(ModalController).draw(me);
-};
+}
 
 void ModalController_addTab(entity me, entity other, entity tabButton)
 {
index 304bf1dd241c053fa707c13a39898f4a0377fcbf..02f12242525835f1735029b0eda0365f03907faf 100644 (file)
@@ -209,7 +209,7 @@ void Nexposee_draw(entity me)
        }
 
        SUPER(Nexposee).draw(me);
-};
+}
 
 float Nexposee_mousePress(entity me, vector pos)
 {
index 36973c96f82d899c6bf906effdf8cb65e1a939c9..f5c0f6da5d2b36fdce817b36a8e4d483272a8a7f 100644 (file)
@@ -16,9 +16,17 @@ float menuInitialized;
 float menuNotTheFirstFrame;
 float menuMouseMode;
 
-void SUB_Null() { };
+void SUB_Null() { }
 
-void() m_init =
+void m_sync()
+{
+       updateCompression();
+       updateConwidths();
+
+       loadAllCvars(main);
+}
+
+void m_init()
 {
        cvar_set("_menu_alpha", "0");
        prvm_language = strzone(cvar_string("prvm_language"));
@@ -95,7 +103,7 @@ void UpdateConWidthHeight()
        }
 }
 
-void() m_init_delayed =
+void m_init_delayed()
 {
        float fh, glob, n, i;
        string s;
@@ -169,11 +177,13 @@ void() m_init_delayed =
        menuShiftState = 0;
        menuMousePos = '0.5 0.5 0';
 
+       m_sync();
+
        if(Menu_Active)
                m_display(); // delayed menu display
-};
+}
 
-void(float key, float ascii) m_keyup =
+void m_keyup (float key, float ascii)
 {
        if(!menuInitialized)
                return;
@@ -195,9 +205,9 @@ void(float key, float ascii) m_keyup =
        if(key == K_ALT) menuShiftState -= (menuShiftState & S_ALT);
        if(key == K_CTRL) menuShiftState -= (menuShiftState & S_CTRL);
        if(key == K_SHIFT) menuShiftState -= (menuShiftState & S_SHIFT);
-};
+}
 
-void(float key, float ascii) m_keydown =
+void m_keydown(float key, float ascii)
 {
        if(!menuInitialized)
                return;
@@ -233,7 +243,7 @@ void(float key, float ascii) m_keydown =
        if(key == K_ALT) menuShiftState |= S_ALT;
        if(key == K_CTRL) menuShiftState |= S_CTRL;
        if(key == K_SHIFT) menuShiftState |= S_SHIFT;
-};
+}
 
 float SCALEMODE_CROP = 0;
 float SCALEMODE_LETTERBOX = 1;
@@ -274,7 +284,7 @@ void draw_Picture_Aligned(vector algn, float scalemode, string img, float a)
        draw_Picture(org, img, isz, '1 1 1', a);
 }
 
-void(string img, float a, string algn, float force1) drawBackground =
+void drawBackground(string img, float a, string algn, float force1)
 {
        if(main.mainNexposee.ModalController_state == 0)
                return;
@@ -600,7 +610,7 @@ void m_tooltip(vector pos)
        }
 }
 
-void() m_draw =
+void m_draw()
 {
        float t;
        float realFrametime;
@@ -777,9 +787,9 @@ void() m_draw =
        postMenuDraw();
 
        frametime = 0;
-};
+}
 
-void() m_display =
+void m_display()
 {
        Menu_Active = true;
        setkeydest(KEY_MENU);
@@ -794,9 +804,9 @@ void() m_display =
 
        main.focusEnter(main);
        main.showNotify(main);
-};
+}
 
-void() m_hide =
+void m_hide()
 {
        Menu_Active = false;
        setkeydest(KEY_GAME);
@@ -807,17 +817,17 @@ void() m_hide =
 
        main.focusLeave(main);
        main.hideNotify(main);
-};
+}
 
-void() m_toggle =
+void m_toggle()
 {
        if(Menu_Active)
                m_hide();
        else
                m_display();
-};
+}
 
-void() m_shutdown =
+void m_shutdown()
 {
        entity e;
 
@@ -828,7 +838,7 @@ void() m_shutdown =
                        if(e.destroy)
                                e.destroy(e);
        }
-};
+}
 
 void m_focus_item_chain(entity outermost, entity innermost)
 {
@@ -884,7 +894,7 @@ void m_setpointerfocus(entity wnd)
        }
 }
 
-void(string itemname) m_goto =
+void m_goto(string itemname)
 {
        entity e;
        if(!menuInitialized)
@@ -914,7 +924,7 @@ void(string itemname) m_goto =
        }
 }
 
-void() m_goto_skin_selector =
+void m_goto_skin_selector()
 {
        if(!menuInitialized)
                return;
@@ -922,7 +932,7 @@ void() m_goto_skin_selector =
        m_goto("skinselector");
 }
 
-void() m_goto_language_selector =
+void m_goto_language_selector()
 {
        if(!menuInitialized)
                return;
@@ -930,7 +940,7 @@ void() m_goto_language_selector =
        m_goto("languageselector");
 }
 
-void() m_goto_video_settings =
+void m_goto_video_settings()
 {
        if(!menuInitialized)
                return;
index e42595e58265e8ba3553a2a3fd698931f2b6a2c6..ab812437a00eba147f08570ca81e8541ea739249 100644 (file)
@@ -41,3 +41,5 @@ void SUB_Null();
 float preMenuInit(); // you have to define this for pre-menu initialization. Return 0 if initialization needs to be retried a frame later, 1 if it succeeded.
 void preMenuDraw(); // this is run before the menu is drawn. You may put some stuff there that has to be done every frame.
 void postMenuDraw(); // this is run just after the menu is drawn (or not). Useful to draw something over everything else.
+
+void m_sync();
index 6b14d1446de07fe5019b94f84aa7ac8591efd087..2711c57e7f1eb53789d075a560557c870e5fdddc 100644 (file)
@@ -72,6 +72,8 @@ string XonoticMutatorsDialog_toString(entity me)
                s = strcat(s, ", ", _("NIX"));
        if(cvar("g_rocket_flying"))
                s = strcat(s, ", ", _("Rocket Flying"));
+       if(cvar("g_invincible_projectiles"))
+               s = strcat(s, ", ", _("Invincible Projectiles"));
        if(cvar_string("g_weaponarena") != "0")
                s = strcat(s, ", ", WeaponArenaString());
        if(cvar("g_start_weapon_laser") == 0)
@@ -191,7 +193,6 @@ void XonoticMutatorsDialog_fill(entity me)
        me.TR(me);
                me.TDempty(me, 0.4);
                me.TD(me, 1, 1.8, s);
-       me.TR(me);
        me.TR(me);
                me.TD(me, 1, 2, makeXonoticTextLabel(0, _("Weapon & item mutators:")));
        me.TR(me);
@@ -200,6 +201,9 @@ void XonoticMutatorsDialog_fill(entity me)
        me.TR(me);
                me.TDempty(me, 0.2);
                me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "g_jetpack", _("Jet pack")));
+       me.TR(me);
+               me.TDempty(me, 0.2);
+               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "g_invincible_projectiles", _("Invincible Projectiles")));
        me.TR(me);
                me.TDempty(me, 0.2);
                me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "g_rocket_flying", _("Rocket Flying")));
index f85c2877cc6f8c82e44be48ed91582eb634eea20..bf3406142c4c91f188a09f2c98e66267adfcdb80 100644 (file)
@@ -127,6 +127,8 @@ void XonoticAudioSettingsTab_fill(entity me)
                me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "snd_spatialization_control", _("Headphone friendly mode")));
                setDependent(e, "snd_channels", 1.5, 0.5);
        me.TR(me);
+       me.TR(me);
+               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "menu_snd_attenuation_method", _("New style sound attenuation")));
        me.TR(me);
                me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Spatial voices:")));
                me.TD(me, 1, 2/3, e = makeXonoticRadioButton(1, "cl_voice_directional", "0", ZCTX(_("VOCS^None"))));
@@ -170,6 +172,6 @@ void XonoticAudioSettingsTab_fill(entity me)
                me.TD(me, 1, 3, e = makeXonoticCheckBoxEx(2, 0, "menu_sounds", _("Menu sounds")));
 
        me.gotoRC(me, me.rows - 1, 0);
-               me.TD(me, 1, me.columns, makeXonoticCommandButton(_("Apply immediately"), '0 0 0', "snd_restart; sendcvar cl_hitsound; sendcvar cl_autotaunt; sendcvar cl_voice_directional; sendcvar cl_voice_directional_taunt_attenuation", COMMANDBUTTON_APPLY));
+               me.TD(me, 1, me.columns, makeXonoticCommandButton(_("Apply immediately"), '0 0 0', "snd_restart; snd_attenuation_method_$menu_snd_attenuation_method; sendcvar cl_hitsound; sendcvar cl_autotaunt; sendcvar cl_voice_directional; sendcvar cl_voice_directional_taunt_attenuation", COMMANDBUTTON_APPLY));
 }
 #endif
index 585b2079683ba10c50434d7073d3e7b29dfacd12..fc8756b4b7a9ca314adbe12bbce645136dd84b41 100644 (file)
@@ -175,9 +175,7 @@ void XonoticEffectsSettingsTab_fill(entity me)
                me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "r_coronas", _("Coronas")));
                me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "r_coronas_occlusionquery", _("Use Occlusion Queries")));
        me.TR(me);
-               me.TD(me, 1, 1.2, e = makeXonoticCheckBox(0, "r_bloom", _("Bloom")));
-                       setDependent(e, "r_hdr", 0, 0);
-               me.TD(me, 1, 1.8, e = makeXonoticCheckBoxEx(2, 0, "r_hdr", _("High Dynamic Range (HDR)")));
+               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "r_bloom", _("High Dynamic Range (HDR)")));
        
        me.TR(me);
                s = makeXonoticSlider(0.1, 1, 0.1, "r_motionblur");
index b1907b604c6f3dc09ed0783e13ef1110265c3e19..79ad3eefe7db6100c9236209f14fd303343bc1d5 100644 (file)
@@ -44,14 +44,12 @@ void XonoticVideoSettingsTab_fill(entity me)
        me.TR(me);
                me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "vid_fullscreen", _("Full screen")));
                me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "vid_vsync", _("Vertical Synchronization")));
-       me.TR(me);
        me.TR(me);
                me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "vid_gl20", _("Use OpenGL 2.0 shaders (GLSL)")));
        me.TR(me);
                me.TDempty(me, 0.2);
                me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "v_glslgamma", _("Use GLSL to handle color control")));
                        setDependent(e, "vid_gl20", 1, 1);
-       me.TR(me);
        me.TR(me);
                me.TD(me, 1, 3, e = makeXonoticTextLabel(0, _("Vertex Buffer Objects (VBOs)")));
        me.TR(me);
@@ -62,6 +60,16 @@ void XonoticVideoSettingsTab_fill(entity me)
                me.TDempty(me, 0.2);
                me.TD(me, 1, 0.9, e = makeXonoticRadioButton(1, "gl_vbo", "2", _("Vertices")));
                me.TD(me, 1, 1.9, e = makeXonoticRadioButton(1, "gl_vbo", "1", _("Vertices and Triangles")));
+       me.TR(me);
+               me.TD(me, 1, 3, e = makeXonoticTextLabel(0, _("Frame Buffer Objects (FBOs)")));
+       me.TR(me);
+               me.TDempty(me, 0.2);
+               me.TD(me, 1, 0.9, e = makeXonoticRadioButton(1, "r_viewfbo", "0", _("None")));
+               me.TD(me, 1, 0.9, e = makeXonoticRadioButton(1, "r_viewfbo", "1", _("8bpp")));
+       me.TR(me);
+               me.TDempty(me, 0.2);
+               me.TD(me, 1, 0.9, e = makeXonoticRadioButton(1, "r_viewfbo", "2", _("16bpp HDR")));
+               me.TD(me, 1, 0.9, e = makeXonoticRadioButton(1, "r_viewfbo", "3", _("32bpp HDR")));
        me.TR(me);
        me.TR(me);
                me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Depth first:")));
@@ -70,9 +78,6 @@ void XonoticVideoSettingsTab_fill(entity me)
                        e.addValue(e, ZCTX(_("DF^World")), "1");
                        e.addValue(e, ZCTX(_("DF^All")), "2");
                        e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               if(cvar_type("apple_multithreadedgl") & CVAR_TYPEFLAG_ENGINE)
-                       me.TD(me, 1, 3, e = makeXonoticCheckBox(1, "apple_multithreadedgl", _("Disable multithreaded OpenGL")));
        me.TR(me);
                me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "gl_finish", _("Wait for GPU to finish each frame")));
 
@@ -106,6 +111,6 @@ void XonoticVideoSettingsTab_fill(entity me)
                me.TD(me, 1, 2, e = makeXonoticSlider(0.5, 2.0, 0.05, "r_hdr_scenebrightness"));
 
        me.gotoRC(me, me.rows - 1, 0);
-               me.TD(me, 1, me.columns, makeXonoticCommandButton(_("Apply immediately"), '0 0 0', "menu_cmd setresolution; vid_restart; menu_restart; togglemenu; defer 0.1 \"menu_cmd videosettings\"", COMMANDBUTTON_APPLY));
+               me.TD(me, 1, me.columns, makeXonoticCommandButton(_("Apply immediately"), '0 0 0', "menu_cmd sync; vid_restart; menu_restart; togglemenu; defer 0.1 \"menu_cmd videosettings\"", COMMANDBUTTON_APPLY));
 }
 #endif
index e6b0d6232f5ef0760f430e19c6e244dbf2f22081..f02d747cc91f1f0e229c56074c217dc2609e2c5e 100644 (file)
@@ -238,7 +238,7 @@ void XonoticServerList_refreshServerList(entity me, float mode)
        }
        else */
        {
-               float m, o;
+               float m, o, i, n; // moin moin
                string s, typestr, modstr;
                s = me.filterString;
 
@@ -261,15 +261,22 @@ void XonoticServerList_refreshServerList(entity me, float mode)
                // ping: reject negative ping (no idea why this happens in the first place, engine bug)
                sethostcachemasknumber(++m, SLIST_FIELD_PING, 0, SLIST_TEST_GREATEREQUAL);
 
+               // show full button
                if(!me.filterShowFull)
                {
                        sethostcachemasknumber(++m, SLIST_FIELD_FREESLOTS, 1, SLIST_TEST_GREATEREQUAL); // legacy
                        sethostcachemaskstring(++m, SLIST_FIELD_QCSTATUS, ":S0:", SLIST_TEST_NOTCONTAIN); // g_maxplayers support
                }
+
+               // show empty button
                if(!me.filterShowEmpty)
                        sethostcachemasknumber(++m, SLIST_FIELD_NUMHUMANS, 1, SLIST_TEST_GREATEREQUAL);
+
+               // gametype filtering
                if(typestr != "")
                        sethostcachemaskstring(++m, SLIST_FIELD_QCSTATUS, strcat(typestr, ":"), SLIST_TEST_STARTSWITH);
+
+               // mod filtering
                if(modstr != "")
                {
                        if(substring(modstr, 0, 1) == "!")
@@ -277,6 +284,13 @@ void XonoticServerList_refreshServerList(entity me, float mode)
                        else
                                sethostcachemaskstring(++m, SLIST_FIELD_MOD, resolvemod(modstr), SLIST_TEST_EQUAL);
                }
+
+               // server banning
+               n = tokenizebyseparator(_Nex_ExtResponseSystem_BannedServers, " ");
+               for(i = 0; i < n; ++i)
+                       if(argv(i) != "")
+                               sethostcachemaskstring(++m, SLIST_FIELD_CNAME, argv(i), SLIST_TEST_NOTSTARTSWITH);
+
                m = SLIST_MASK_OR - 1;
                if(s != "")
                {
@@ -308,6 +322,13 @@ void XonoticServerList_draw(entity me)
 {
        float i, found, owned;
 
+       if(_Nex_ExtResponseSystem_BannedServersNeedsRefresh)
+       {
+               if(!me.needsRefresh)
+                       me.needsRefresh = 2;
+               _Nex_ExtResponseSystem_BannedServersNeedsRefresh = 0;
+       }
+
        if(me.currentSortField == -1)
        {
                me.setSortOrder(me, SLIST_FIELD_PING, +1);
index 65a5d3e71a60fad721cddb189660e0489891c6ab..b8215d52cac6c97150ea863fa05c7dd885d02a25 100644 (file)
@@ -325,6 +325,12 @@ void UpdateNotification_URI_Get_Callback(float id, float status, string data)
                }
 
                _Nex_ExtResponseSystem_UpdateTo = strzone(_Nex_ExtResponseSystem_UpdateTo);
+
+               if(n >= 4)
+               {
+                       _Nex_ExtResponseSystem_BannedServers = strzone(argv(3));
+                       _Nex_ExtResponseSystem_BannedServersNeedsRefresh = 1;
+               }
        }
 }
 
index 1720710d2c44de09db39110aa93b9a84578ebb5d..d8f66f4e967ec242cafb3da865da541619a2ac9f 100644 (file)
@@ -47,3 +47,6 @@ void dialog_hudpanel_common_notoggle(entity me, string panelname);
        me.TR(me); \
                me.TD(me, 1, 4, e = makeXonoticCheckBox(0, strzone(strcat("hud_panel_", panelname)), _("Enable panel"))); \
        DIALOG_HUDPANEL_COMMON_NOTOGGLE()
+
+string _Nex_ExtResponseSystem_BannedServers;
+float _Nex_ExtResponseSystem_BannedServersNeedsRefresh;
index 517da81684928019729e385b6feb244b32963021..45fa5c77d43aabc688d325e9f8f6edd191cc2c7f 100644 (file)
@@ -115,7 +115,7 @@ void assault_objective_decrease_use() {
 
 void assault_setenemytoobjective()
 {
-       local entity objective;
+       entity objective;
        for(objective = world; (objective = find(objective, targetname, self.target)); ) {
                if(objective.classname == "target_objective") {
                        if(self.enemy == world)
@@ -350,7 +350,7 @@ void assault_new_round()
        }
 
 
-       local entity ent;
+       entity ent;
        for(ent = world; (ent = nextent(ent)); )
        {
                if(clienttype(ent) == CLIENTTYPE_NOTACLIENT)
diff --git a/qcsrc/server/attic/monsters/ai.qc b/qcsrc/server/attic/monsters/ai.qc
new file mode 100644 (file)
index 0000000..59989e7
--- /dev/null
@@ -0,0 +1,891 @@
+void() movetarget_f;
+void() t_movetarget;
+void() FoundTarget;
+
+float MONSTER_WANDER = 64; // disable wandering around
+float MONSTER_APPEAR = 128; // spawn invisible, and appear when triggered
+
+.float ismonster;
+.float monsterawaitingteleport; // avoid awaking monsters in teleport rooms
+
+// when a monster becomes angry at a player, that monster will be used
+// as the sight target the next frame so that monsters near that one
+// will wake up even if they wouldn't have noticed the player
+//
+entity sight_entity;
+float sight_entity_time;
+
+/*
+
+.enemy
+Will be world if not currently angry at anyone.
+
+.movetarget
+The next path spot to walk toward.  If .enemy, ignore .movetarget.
+When an enemy is killed, the monster will try to return to it's path.
+
+.huntt_ime
+Set to time + something when the player is in sight, but movement straight for
+him is blocked.  This causes the monster to use wall following code for
+movement direction instead of sighting on the player.
+
+.ideal_yaw
+A yaw angle of the intended direction, which will be turned towards at up
+to 45 deg / state.  If the enemy is in view and hunt_time is not active,
+this will be the exact line towards the enemy.
+
+.pausetime
+A monster will leave it's stand state and head towards it's .movetarget when
+time > .pausetime.
+
+walkmove(angle, speed) primitive is all or nothing
+*/
+
+
+//
+// globals
+//
+//float current_yaw;
+
+float(float v) anglemod =
+{
+       v = v - 360 * floor(v / 360);
+       return v;
+}
+
+/*
+==============================================================================
+
+MOVETARGET CODE
+
+The angle of the movetarget effects standing and bowing direction, but has no effect on movement, which allways heads to the next target.
+
+targetname
+must be present.  The name of this movetarget.
+
+target
+the next spot to move to.  If not present, stop here for good.
+
+pausetime
+The number of seconds to spend standing or bowing for path_stand or path_bow
+
+==============================================================================
+*/
+
+
+void() movetarget_f =
+{
+       if (!self.targetname)
+               objerror ("monster_movetarget: no targetname");
+
+       self.solid = SOLID_TRIGGER;
+       self.touch = t_movetarget;
+       setsize (self, '-8 -8 -8', '8 8 8');
+}
+
+/*QUAKED path_corner (0.5 0.3 0) (-8 -8 -8) (8 8 8)
+Monsters will continue walking towards the next target corner.
+*/
+void() path_corner =
+{
+       movetarget_f ();
+}
+
+/*
+=============
+t_movetarget
+
+Something has bumped into a movetarget.  If it is a monster
+moving towards it, change the next destination and continue.
+==============
+*/
+void() t_movetarget =
+{
+       entity temp;
+
+       if (other.health < 1)
+               return;
+       if (other.movetarget != self)
+               return;
+
+       if (other.enemy)
+               return;         // fighting, not following a path
+
+       temp = self;
+       self = other;
+       other = temp;
+
+       /* PLEASE FIX THE SOUND CHANNEL BEFORE ACTIVATING THIS
+       if (self.classname == "monster_ogre")
+               sound (self, CHAN_VOICE, "ogre/ogdrag.wav", 1, ATTN_IDLE);// play chainsaw drag sound
+       */
+
+//dprint ("t_movetarget\n");
+       self.goalentity = self.movetarget = find (world, targetname, other.target);
+       self.ideal_yaw = vectoyaw(self.goalentity.origin - self.origin);
+       if (!self.movetarget)
+       {
+               self.pausetime = time + 999999;
+               self.th_stand ();
+               return;
+       }
+}
+
+void() monster_wanderpaththink =
+{
+       vector v, v1;
+       float b, c;
+       self.nextthink = time + random() * 10 + 1;
+       if (self.owner.health < 1) // dead, also handled in death code
+       {
+               self.owner.movetarget = world;
+               remove(self);
+               return;
+       }
+       b = -1;
+       c = 10;
+       while (c > 0)
+       {
+               c = c - 1;
+               v = randomvec();
+               traceline(self.owner.origin, v * 1024 + self.owner.origin, FALSE, self);
+               v = trace_endpos - (normalize(v) * 16) - self.owner.origin;
+               if (vlen(v) > b)
+               {
+                       b = vlen(v);
+                       v1 = v;
+               }
+       }
+       setorigin(self, v1 + self.owner.origin);
+       self.owner.ideal_yaw = vectoyaw(self.origin - self.owner.origin);
+}
+
+void() monster_wanderpathtouch =
+{
+       if (other.health < 1)
+               return;
+       if (other.movetarget != self)
+               return;
+
+       if (other.enemy)
+               return;         // fighting, not following a path
+
+       /* PLEASE FIX THE SOUND CHANNEL BEFORE ACTIVATING THIS
+       if (other.classname == "monster_ogre")
+               sound (other, CHAN_VOICE, "ogre/ogdrag.wav", 1, ATTN_IDLE);// play chainsaw drag sound
+       */
+       monster_wanderpaththink();
+}
+
+void() monster_spawnwanderpath =
+{
+       newmis = spawn();
+       newmis.classname = "monster_wanderpath";
+       newmis.solid = SOLID_TRIGGER;
+       newmis.touch = monster_wanderpathtouch;
+       setsize (newmis, '-8 -8 -8', '8 8 8');
+       newmis.think = monster_wanderpaththink;
+       newmis.nextthink = time + random() * 10 + 1;
+       newmis.owner = self;
+       self.goalentity = self.movetarget = newmis;
+}
+
+void() monster_checkbossflag =
+{
+//#NO AUTOCVARS START
+#if 0
+       float healthboost;
+       float r;
+
+       // monsterbosses cvar or spawnflag 64 causes a monster to be a miniboss
+       if ((self.spawnflags & 64) || (random() * 100 < cvar("monsterbosspercent")))
+       {
+               self.radsuit_finished = time + 1000000000;
+               r = random() * 4;
+               if (r < 2)
+               {
+                       self.super_damage_finished = time + 1000000000;
+                       healthboost = 30 + self.health * 0.5;
+                       self.effects = self.effects | (EF_FULLBRIGHT | EF_BLUE);
+               }
+               if (r >= 1)
+               {
+                       healthboost = 30 + self.health * bound(0.5, skill * 0.5, 1.5);
+                       self.effects = self.effects | (EF_FULLBRIGHT | EF_RED);
+                       self.healthregen = max(self.healthregen, min(skill * 10, 30));
+               }
+               self.health = self.health + healthboost;
+               self.max_health = self.health;
+               self.bodyhealth = self.bodyhealth * 2 + healthboost;
+               do
+               {
+                       self.colormod_x = random();
+                       self.colormod_y = random();
+                       self.colormod_z = random();
+                       self.colormod =  normalize(self.colormod);
+               }
+               while (self.colormod_x > 0.6 && self.colormod_y > 0.6 && self.colormod_z > 0.6);
+       }
+#endif
+//#NO AUTOCVARS END
+}
+
+
+//============================================================================
+
+/*
+=============
+range
+
+returns the range catagorization of an entity reletive to self
+0      melee range, will become hostile even if back is turned
+1      visibility and infront, or visibility and show hostile
+2      infront and show hostile
+3      only triggered by damage
+=============
+*/
+float(entity targ) range =
+{
+       float r;
+       r = vlen ((self.origin + self.view_ofs) - (targ.origin + targ.view_ofs));
+       if (r < 120)
+               return RANGE_MELEE;
+       if (r < 500)
+               return RANGE_NEAR;
+       if (r < 2000) // increased from 1000 for DP
+               return RANGE_MID;
+       return RANGE_FAR;
+}
+
+/*
+=============
+visible
+
+returns 1 if the entity is visible to self, even if not infront ()
+=============
+*/
+float (entity targ) visible =
+{
+       if (vlen(targ.origin - self.origin) > 5000) // long traces are slow
+               return FALSE;
+
+       traceline ((self.origin + self.view_ofs), (targ.origin + targ.view_ofs), TRUE, self);   // see through other monsters
+
+       if (trace_inopen && trace_inwater)
+               return FALSE;                   // sight line crossed contents
+
+       if (trace_fraction == 1)
+               return TRUE;
+       return FALSE;
+}
+
+
+/*
+=============
+infront
+
+returns 1 if the entity is in front (in sight) of self
+=============
+*/
+float(entity targ) infront =
+{
+       float dot;
+
+       makevectors (self.angles);
+       dot = normalize (targ.origin - self.origin) * v_forward;
+
+       return (dot > 0.3);
+}
+// returns 0 if not infront, or the dotproduct if infront
+float(vector dir, entity targ) infront2 =
+{
+       float dot;
+
+       dir = normalize(dir);
+       dot = normalize (targ.origin - self.origin) * dir;
+
+       if (dot >= 0.3) return dot; // infront
+       return 0;
+}
+
+
+//============================================================================
+
+/*
+===========
+ChangeYaw
+
+Turns towards self.ideal_yaw at self.yaw_speed
+Sets the global variable current_yaw
+Called every 0.1 sec by monsters
+============
+*/
+/*
+
+void() ChangeYaw =
+{
+       float ideal, move;
+
+//current_yaw = self.ideal_yaw;
+// mod down the current angle
+       current_yaw = anglemod( self.angles_y );
+       ideal = self.ideal_yaw;
+
+       if (current_yaw == ideal)
+               return;
+
+       move = ideal - current_yaw;
+       if (ideal > current_yaw)
+       {
+               if (move > 180)
+                       move = move - 360;
+       }
+       else
+       {
+               if (move < -180)
+                       move = move + 360;
+       }
+
+       if (move > 0)
+       {
+               if (move > self.yaw_speed)
+                       move = self.yaw_speed;
+       }
+       else
+       {
+               if (move < 0-self.yaw_speed )
+                       move = 0-self.yaw_speed;
+       }
+
+       current_yaw = anglemod (current_yaw + move);
+
+       self.angles_y = current_yaw;
+}
+
+*/
+
+
+//============================================================================
+
+void() HuntTarget =
+{
+       self.goalentity = self.enemy;
+       self.think = self.th_run;
+       self.ideal_yaw = vectoyaw(self.enemy.origin - self.origin);
+       self.nextthink = time + 0.1;
+       SUB_AttackFinished (1); // wait a while before first attack
+}
+
+.void() th_sightsound;
+
+void() SightSound =
+{
+       if (self.health < 1)
+               return;
+       // skill 5 does not play sight sounds, instead you only hear the appear sound as they are about to attack
+       if (skill >= 5)
+       if (self.classname != "monster_hellfish")
+               return;
+
+       if (self.th_sightsound)
+               self.th_sightsound();
+}
+
+void() FoundTarget =
+{
+       if (self.health < 1 || !self.th_run)
+               return;
+       if (self.enemy.health < 1 || !self.enemy.takedamage)
+               return;
+       if (self.enemy.classname == "player")
+       {
+               // let other monsters see this monster for a while
+               sight_entity = self;
+               sight_entity_time = time + 0.1;
+       }
+
+       self.show_hostile = time + 1;           // wake up other monsters
+
+       SightSound ();
+       HuntTarget ();
+}
+
+/*
+//float checkplayertime;
+entity lastcheckplayer;
+entity havocbot_list;
+
+
+entity() checkplayer =
+{
+       entity check;
+       float worldcount;
+       // we can just fallback on checkclient if there are no bots
+       if (!havocbot_list)
+               return checkclient();
+*/
+       /*
+       if (time < checkplayertime)
+       {
+               traceline(self.origin + self.view_ofs, lastcheckplayer.origin + lastcheckplayer.view_ofs, TRUE, self);
+               if (trace_fraction == 1)
+                       return lastcheckplayer;
+               if (trace_ent == lastcheckplayer)
+                       return lastcheckplayer;
+       }
+       checkplayertime = time + 0.1;
+       */
+/*
+       check = lastcheckplayer;
+       worldcount = 0;
+       c = 0;
+       do
+       {
+               c = c + 1;
+               check = findfloat(check, havocattack, TRUE);
+               if (check.classname == "player" || check.classname == "turretbase")
+               {
+                       traceline(self.origin + self.view_ofs, check.origin + check.view_ofs, TRUE, self);
+                       if (trace_fraction == 1)
+                               return lastcheckplayer = check;
+                       if (trace_ent == check)
+                               return lastcheckplayer = check;
+               }
+               else if (check == world)
+               {
+                       worldcount = worldcount + 1;
+                       if (worldcount >= 2)
+                               return lastcheckplayer = check;
+               }
+       }
+       while(check != lastcheckplayer && c < 100);
+       return world;
+}
+*/
+
+/*
+===========
+FindTarget
+
+Self is currently not attacking anything, so try to find a target
+
+Returns TRUE if an enemy was sighted
+
+When a player fires a missile, the point of impact becomes a fakeplayer so
+that monsters that see the impact will respond as if they had seen the
+player.
+
+To avoid spending too much time, only a single client (or fakeclient) is
+checked each frame.  This means multi player games will have slightly
+slower noticing monsters.
+============
+*/
+.float findtarget;
+float() FindTarget =
+{
+       entity client;
+       float r;
+
+       if (self.health < 1)
+               return FALSE;
+
+       // if the first or second spawnflag bit is set, the monster will only
+       // wake up on really seeing the player, not another monster getting angry
+
+       if (self.spawnflags & 3)
+       {
+               // don't wake up on seeing another monster getting angry
+               client = checkclient ();
+               if (!client)
+                       return FALSE;   // current check entity isn't in PVS
+       }
+       else
+       {
+               if (sight_entity_time >= time)
+               {
+                       client = sight_entity;
+                       if (client.enemy == self.enemy)
+                               return TRUE;
+               }
+               else
+               {
+                       client = checkclient ();
+                       if (!client)
+                               return FALSE;   // current check entity isn't in PVS
+               }
+       }
+
+       if (client == self.enemy)
+               return FALSE;
+
+       if (client.flags & FL_NOTARGET)
+               return FALSE;
+
+#if 0
+       if (client.items & IT_INVISIBILITY)
+               return FALSE;
+#endif
+
+       // on skill 5 the monsters usually ignore the player and remain ghostlike
+       if (skill >= 5)
+       if (self.classname != "monster_hellfish")
+       if (random() < 0.99)
+               return FALSE;
+
+       r = range(client);
+       if (r == RANGE_FAR)
+               return FALSE;
+
+       if (!visible (client))
+               return FALSE;
+
+       if (r == RANGE_NEAR)
+       {
+               if (client.show_hostile < time && !infront (client))
+                       return FALSE;
+       }
+       else if (r == RANGE_MID)
+       {
+               // LordHavoc: was if ( /* client.show_hostile < time || */ !infront (client))
+               if (client.show_hostile < time && !infront (client))
+                       return FALSE;
+       }
+
+       //
+       // got one
+       //
+
+       if (client.model == "")
+               return FALSE;
+       self.enemy = client;
+       if (self.enemy.classname != "player" && self.enemy.classname != "turretbase")
+       {
+               self.enemy = self.enemy.enemy;
+               if (self.enemy.classname != "player" && self.enemy.classname != "turretbase")
+               {
+                       self.enemy = world;
+                       return FALSE;
+               }
+       }
+
+       FoundTarget ();
+
+       return TRUE;
+}
+
+
+//=============================================================================
+
+void(float dist) ai_forward =
+{
+       walkmove (self.angles_y, dist);
+}
+
+void(float dist) ai_back =
+{
+       walkmove ( (self.angles_y+180), dist);
+}
+
+
+void(float a) monster_setalpha;
+
+/*
+=============
+ai_pain
+
+stagger back a bit
+=============
+*/
+void(float dist) ai_pain =
+{
+       if (self.health < 1)
+               return;
+       ai_back (dist);
+}
+
+/*
+=============
+ai_painforward
+
+stagger back a bit
+=============
+*/
+void(float dist) ai_painforward =
+{
+       if (self.health < 1)
+               return;
+       walkmove (self.ideal_yaw, dist);
+}
+
+/*
+=============
+ai_walk
+
+The monster is walking it's beat
+=============
+*/
+void(float dist) ai_walk =
+{
+       if (self.health < 1)
+               return;
+
+       movedist = dist;
+
+       // check for noticing a player
+       if (self.oldenemy.takedamage)
+       if (self.oldenemy.health >= 1)
+       {
+               self.enemy = self.oldenemy;
+               self.oldenemy = world;
+               FoundTarget();
+               monster_setalpha(0);
+               return;
+       }
+       if (self.enemy)
+       {
+               if (self.enemy.takedamage)
+               {
+                       if (self.enemy.health >= 1)
+                       {
+                               FoundTarget();
+                               monster_setalpha(0);
+                               return;
+                       }
+                       else
+                               self.enemy = world;
+               }
+               else
+                       self.enemy = world;
+       }
+
+       self.findtarget = TRUE;
+
+       movetogoal (dist);
+       monster_setalpha(0);
+}
+
+
+/*
+=============
+ai_stand
+
+The monster is staying in one place for a while, with slight angle turns
+=============
+*/
+void() ai_stand =
+{
+       if (self.health < 1)
+               return;
+       if (self.enemy)
+       {
+               if (self.enemy.takedamage)
+               {
+                       if (self.enemy.health >= 1)
+                       {
+                               FoundTarget();
+                               monster_setalpha(0);
+                               return;
+                       }
+                       else
+                               self.enemy = world;
+               }
+               else
+                       self.enemy = world;
+       }
+       self.findtarget = TRUE;
+
+       if (time > self.pausetime)
+       {
+               self.th_walk ();
+               monster_setalpha(0);
+               return;
+       }
+
+// change angle slightly
+
+       monster_setalpha(0);
+}
+
+/*
+=============
+ai_turn
+
+don't move, but turn towards ideal_yaw
+=============
+*/
+void() ai_turn =
+{
+       if (self.enemy)
+       {
+               if (self.enemy.takedamage)
+               {
+                       if (self.enemy.health >= 1)
+                       {
+                               FoundTarget();
+                               monster_setalpha(0);
+                               return;
+                       }
+                       else
+                               self.enemy = world;
+               }
+               else
+                       self.enemy = world;
+       }
+       self.findtarget = TRUE;
+
+       ChangeYaw ();
+       monster_setalpha(0);
+}
+
+//=============================================================================
+
+/*
+=============
+ChooseTurn
+=============
+*/
+void(vector pDestvec) ChooseTurn =
+{
+       vector dir, newdir;
+
+       dir = self.origin - pDestvec;
+
+       newdir_x = trace_plane_normal_y;
+       newdir_y = 0 - trace_plane_normal_x;
+       newdir_z = 0;
+
+       if (dir * newdir > 0)
+       {
+               dir_x = 0 - trace_plane_normal_y;
+               dir_y = trace_plane_normal_x;
+       }
+       else
+       {
+               dir_x = trace_plane_normal_y;
+               dir_y = 0 - trace_plane_normal_x;
+       }
+
+       dir_z = 0;
+       self.ideal_yaw = vectoyaw(dir);
+}
+
+/*
+============
+FacingIdeal
+
+============
+*/
+float() FacingIdeal =
+{
+       float delta;
+
+       delta = anglemod(self.angles_y - self.ideal_yaw);
+       if (delta > 45 && delta < 315)
+               return FALSE;
+       return TRUE;
+}
+
+
+//=============================================================================
+
+.float() th_checkattack;
+
+
+
+/*
+=============
+ai_run
+
+The monster has an enemy it is trying to kill
+=============
+*/
+void(float dist) ai_run =
+{
+       float ofs;
+       if (self.health < 1)
+               return;
+       movedist = dist;
+       // see if the enemy is dead
+       if (self.enemy.health < 1 || self.enemy.takedamage == DAMAGE_NO)
+       {
+               self.enemy = world;
+               // FIXME: look all around for other targets
+               if (self.oldenemy.health >= 1 && self.oldenemy.takedamage)
+               {
+                       self.enemy = self.oldenemy;
+                       self.oldenemy = world;
+                       HuntTarget ();
+               }
+               else
+               {
+                       if (self.movetarget)
+                               self.th_walk ();
+                       else
+                               self.th_stand ();
+                       return;
+               }
+       }
+
+       // wake up other monsters
+       self.show_hostile = time + 1;
+
+       // check knowledge of enemy
+       enemy_range = range(self.enemy);
+
+       self.ideal_yaw = vectoyaw(self.enemy.origin - self.origin);
+       ChangeYaw ();
+
+       if (self.attack_state == AS_MELEE)
+       {
+               //dprint ("ai_run_melee\n");
+               //Turn and close until within an angle to launch a melee attack
+               if (FacingIdeal())
+               {
+                       self.th_melee ();
+                       self.attack_state = AS_STRAIGHT;
+               }
+               return;
+       }
+       else if (self.attack_state == AS_MISSILE)
+       {
+               //dprint ("ai_run_missile\n");
+               //Turn in place until within an angle to launch a missile attack
+               if (FacingIdeal())
+               if (self.th_missile ())
+                       self.attack_state = AS_STRAIGHT;
+               return;
+       }
+
+       if (self.th_checkattack())
+               return;                                 // beginning an attack
+
+       if (visible(self.enemy))
+               self.search_time = time + 5;
+       else if (coop)
+       {
+               // look for other coop players
+               if (self.search_time < time)
+                       self.findtarget = TRUE;
+       }
+
+       if (self.attack_state == AS_SLIDING)
+       {
+               //dprint ("ai_run_slide\n");
+               //Strafe sideways, but stay at aproximately the same range
+               if (self.lefty)
+                       ofs = 90;
+               else
+                       ofs = -90;
+
+               if (walkmove (self.ideal_yaw + ofs, movedist))
+                       return;
+
+               self.lefty = !self.lefty;
+
+               walkmove (self.ideal_yaw - ofs, movedist);
+       }
+
+       // head straight in
+       movetogoal (dist);              // done in C code...
+}
+
diff --git a/qcsrc/server/attic/monsters/defs.qc b/qcsrc/server/attic/monsters/defs.qc
new file mode 100644 (file)
index 0000000..1982142
--- /dev/null
@@ -0,0 +1,55 @@
+.entity movetarget;
+.float pausetime;
+
+.void()         th_stand;
+.void()         th_walk;
+.void()         th_run;
+.float()        th_missile; // LordHavoc: changed from void() to float(), returns true if attacking
+.void()         th_melee;
+//.void(entity attacker, float damage, float damgtype, string dethtype)           th_pain; // TODO Xonotic uses event_damage
+//.void()         th_die; // TODO never called directly by Xonotic
+.entity         oldenemy;               // mad at this player before taking damage
+entity  newmis;                 // launch_spike sets this after spawning it
+
+// range values
+float   RANGE_MELEE                             = 0;
+float   RANGE_NEAR                              = 1;
+float   RANGE_MID                               = 2;
+float   RANGE_FAR                               = 3;
+
+float DMG_KNIGHT_MELEE_BASE           =    0;
+float DMG_KNIGHT_MELEE_RANDOM1        =    3;
+float DMG_KNIGHT_MELEE_RANDOM2        =    3;
+float DMG_KNIGHT_MELEE_RANDOM3        =    3;
+
+.float          show_hostile; 
+       // set to time+0.2 whenever a client fires a
+       // weapon or takes damage.  Used to alert
+       // monsters that otherwise would let the player go
+
+float movedist;
+.float lefty;
+.float search_time;
+.float attack_state;
+
+float   AS_STRAIGHT             = 1;
+float   AS_SLIDING              = 2;
+float   AS_MELEE                = 3;
+float   AS_MISSILE              = 4;
+
+float SKILL4_MINALPHA         = 0.4;
+
+float monsterwander;
+//#NO AUTOCVARS START
+/*
+        monsterwander = cvar("monsterwander");
+        // monsterwander is always on in skill 5
+        if (skill >= 5)
+                monsterwander = TRUE;
+*/
+//#NO AUTOCVARS END
+
+.float candrown;
+
+.void(vector org, float bodydamage, float armordamage, vector vel, float damgtype) bleedfunc;
+void(vector org, float bodydamage, float armordamage, vector vel, float damgtype) genericbleedfunc;
diff --git a/qcsrc/server/attic/monsters/fight.qc b/qcsrc/server/attic/monsters/fight.qc
new file mode 100644 (file)
index 0000000..a8fcd8e
--- /dev/null
@@ -0,0 +1,252 @@
+
+/*
+
+A monster is in fight mode if it thinks it can effectively attack its
+enemy.
+
+When it decides it can't attack, it goes into hunt mode.
+
+*/
+
+void SUB_AttackFinished (float normal)
+{
+       self.cnt = 0;           // refire count for nightmare
+       if (skill < 3)
+               ATTACK_FINISHED(self) = time + normal;
+}
+
+float CanDamage(entity targ, entity inflictor)
+{
+       if (targ.movetype == MOVETYPE_PUSH)
+       {
+               traceline(inflictor.origin, 0.5 * (targ.absmin + targ.absmax), TRUE, self);
+               if (trace_fraction == 1)
+                       return TRUE;
+               if (trace_ent == targ)
+                       return TRUE;
+               return FALSE;
+       }
+
+       traceline(inflictor.origin, targ.origin, TRUE, self);
+       if (trace_fraction == 1)
+               return TRUE;
+       traceline(inflictor.origin, targ.origin + '15 15 0', TRUE, self);
+       if (trace_fraction == 1)
+               return TRUE;
+       traceline(inflictor.origin, targ.origin + '-15 -15 0', TRUE, self);
+       if (trace_fraction == 1)
+               return TRUE;
+       traceline(inflictor.origin, targ.origin + '-15 15 0', TRUE, self);
+       if (trace_fraction == 1)
+               return TRUE;
+       traceline(inflictor.origin, targ.origin + '15 -15 0', TRUE, self);
+       if (trace_fraction == 1)
+               return TRUE;
+
+       return FALSE;
+}
+
+float(float v) anglemod;
+
+void(vector dest) ChooseTurn;
+
+void() ai_face;
+
+
+float enemy_range;
+
+
+//=============================================================================
+
+/*
+===========
+GenericCheckAttack
+
+The player is in view, so decide to move or launch an attack
+Returns FALSE if movement should continue
+============
+*/
+float() GenericCheckAttack =
+{
+       vector spot1, spot2;
+       entity targ;
+       float chance;
+
+       if (self.health < 1)
+               return FALSE;
+       targ = self.enemy;
+
+       if (vlen(targ.origin - self.origin) > 5000) // long traces are slow
+               return FALSE;
+
+// see if any entities are in the way of the shot
+       spot1 = self.origin + self.view_ofs;
+       spot2 = targ.origin + targ.view_ofs;
+
+       traceline (spot1, spot2, FALSE, self);
+
+       if (trace_ent != targ)
+               return FALSE; // don't have a clear shot
+
+       if (trace_inopen && trace_inwater)
+               return FALSE; // sight line crossed contents
+
+       if (enemy_range == RANGE_MELEE)
+       {       // melee attack
+               if (self.th_melee)
+               {
+                       self.th_melee ();
+                       return TRUE;
+               }
+       }
+
+// missile attack
+       if (time < ATTACK_FINISHED(self))
+               return FALSE;
+
+       if (!self.th_missile)
+               return FALSE;
+
+       if (enemy_range == RANGE_FAR)
+               return FALSE;
+
+       if (enemy_range == RANGE_MELEE)
+       {
+               chance = 0.9;
+               ATTACK_FINISHED(self) = 0;
+       }
+       else if (enemy_range == RANGE_NEAR)
+       {
+               if (self.th_melee)
+                       chance = 0.2;
+               else
+                       chance = 0.4;
+       }
+       else if (enemy_range == RANGE_MID)
+       {
+               if (self.th_melee)
+                       chance = 0.05;
+               else
+                       chance = 0.1;
+       }
+       else
+               chance = 0;
+
+       if (random () < chance)
+       if (self.th_missile ())
+       {
+               SUB_AttackFinished (2*random());
+               return TRUE;
+       }
+
+       return FALSE;
+}
+
+
+/*
+=============
+ai_face
+
+Stay facing the enemy
+=============
+*/
+void() ai_face =
+{
+       self.ideal_yaw = vectoyaw(self.enemy.origin - self.origin);
+       ChangeYaw ();
+}
+
+/*
+=============
+ai_charge
+
+The monster is in a melee attack, so get as close as possible to .enemy
+=============
+*/
+float (entity targ) visible;
+float(entity targ) infront;
+float(entity targ) range;
+
+void(float d) ai_charge =
+{
+       if (self.health < 1)
+               return;
+       ai_face ();
+       movetogoal (d);         // done in C code...
+}
+
+void() ai_charge_side =
+{
+       if (self.health < 1)
+               return;
+       vector dtemp;
+       float heading;
+
+// aim to the left of the enemy for a flyby
+
+       self.ideal_yaw = vectoyaw(self.enemy.origin - self.origin);
+       ChangeYaw ();
+
+       makevectors (self.angles);
+       dtemp = self.enemy.origin - 30*v_right;
+       heading = vectoyaw(dtemp - self.origin);
+
+       walkmove(heading, 20);
+}
+
+
+/*
+=============
+ai_melee
+
+=============
+*/
+void() ai_melee =
+{
+       vector delta;
+       float ldmg;
+
+       if (self.health < 1)
+               return;
+       if (!self.enemy)
+               return;         // removed before stroke
+
+       delta = self.enemy.origin - self.origin;
+
+       if (vlen(delta) > 60)
+               return;
+
+       ldmg = DMG_KNIGHT_MELEE_BASE + DMG_KNIGHT_MELEE_RANDOM1 * random();
+       ldmg = ldmg + DMG_KNIGHT_MELEE_RANDOM2 * random();
+       ldmg = ldmg + DMG_KNIGHT_MELEE_RANDOM3 * random();
+       traceline(self.origin, self.enemy.origin, FALSE, self);
+
+       Damage (self.enemy, self, self, ldmg, self.projectiledeathtype, trace_endpos, '0 0 0'); // TODO add force to monster melee attacks?
+}
+
+
+void() ai_melee_side =
+{
+       vector delta;
+       float ldmg;
+
+       if (self.health < 1)
+               return;
+       if (!self.enemy)
+               return;         // removed before stroke
+
+       ai_charge_side();
+
+       delta = self.enemy.origin - self.origin;
+
+       if (vlen(delta) > 60)
+               return;
+       if (!CanDamage (self.enemy, self))
+               return;
+       ldmg = DMG_KNIGHT_MELEE_BASE + DMG_KNIGHT_MELEE_RANDOM1 * random();
+       ldmg = ldmg + DMG_KNIGHT_MELEE_RANDOM2 * random();
+       ldmg = ldmg + DMG_KNIGHT_MELEE_RANDOM3 * random();
+       traceline(self.origin, self.enemy.origin, FALSE, self);
+       Damage (self.enemy, self, self, ldmg, self.projectiledeathtype, trace_endpos, '0 0 0');
+}
+
diff --git a/qcsrc/server/attic/monsters/m_monsters.qc b/qcsrc/server/attic/monsters/m_monsters.qc
new file mode 100644 (file)
index 0000000..3e160d9
--- /dev/null
@@ -0,0 +1,475 @@
+/* ALL MONSTERS SHOULD BE 1 0 0 IN COLOR */
+
+// name =[framenum,    nexttime, nextthink] {code}
+// expands to:
+// name ()
+// {
+//             self.frame=framenum;
+//             self.nextthink = time + nexttime;
+//             self.think = nextthink
+//             <code>
+// }
+
+.float ismonster;
+
+.float modelindex2;
+
+/*
+================
+monster_use
+
+Using a monster makes it angry at the current activator
+LordHavoc: using a monster with the spawnflag 'Appear' makes it appear
+================
+*/
+void() monster_use =
+{
+       if (self.enemy)
+               return;
+       if (self.health < 1)
+               return;
+       if (self.mdl)
+       if (self.spawnflags & MONSTER_APPEAR)
+       {
+               self.nextthink = time + 0.1;
+               self.spawnflags = self.spawnflags - MONSTER_APPEAR;
+               self.solid = SOLID_SLIDEBOX;
+               self.takedamage = DAMAGE_AIM;
+               //self.movetype = MOVETYPE_STEP;
+               self.model = self.mdl;
+               self.mdl = "";
+               self.modelindex = self.modelindex2;
+               self.modelindex2 = 0;
+               //setorigin(self, self.origin + '0 0 1');
+               spawn_tdeath(self.origin, self, self.origin);
+               return;
+       }
+
+#if 0
+       if (activator.items & IT_INVISIBILITY)
+               return;
+#endif
+       if (activator.flags & FL_NOTARGET)
+               return;
+       if (activator.classname != "player")
+               return;
+
+       // delay reaction so if the monster is teleported, its sound is still heard
+       self.enemy = activator;
+       self.nextthink = time + 0.1;
+       self.think = FoundTarget;
+}
+
+void() monster_appearsetup =
+{
+       if ((self.spawnflags & MONSTER_APPEAR) == 0)
+               return;
+       self.mdl = self.model;
+       self.modelindex2 = self.modelindex;
+       self.modelindex = 0;
+       self.solid = SOLID_NOT;
+       self.takedamage = DAMAGE_NO;
+       //self.movetype = MOVETYPE_NONE;
+       self.nextthink = -1;
+       self.model = "";
+}
+
+/*
+================
+monster_setalpha
+
+Sets relative alpha of monster in skill 4 mode.
+================
+*/
+void(float a) monster_setalpha =
+{
+       if (skill < 4 || self.classname == "monster_hellfish")
+       {
+               self.alpha = 1.0;
+               return;
+       }
+
+       if (skill >= 5)
+       {
+               // randomly forget enemy, this makes monsters randomly return to their normal ghostlike state
+               if (a == 0)
+               if (self.enemy)
+               if (random() < 0.1)
+                       self.enemy = world;
+               // randomly blink (playing the same alarming sound as if attacking)
+               if (self.enemy == world)
+               {
+                       a = 0;
+                       if (time >= 0.3) // don't blink during the init process because it might become permanent
+                       if (random() < 0.005)
+                       {
+                               // blink for an instant, this causes the appear sound, alarming the player as if under attack
+                               /* PLEASE FIX THE SOUND CHANNEL BEFORE ACTIVATING THIS
+                               sound(self, CHAN_AUTO, "wizard/wsight.wav", 1, ATTN_NORM);
+                               */
+                               a = 1;
+                       }
+               }
+               // if ghosted, become non-solid and immune to damage
+               if (a <= 0 || self.enemy == world)
+               {
+                       self.solid = SOLID_NOT;
+                       self.takedamage = DAMAGE_NO;
+               }
+               else
+               {
+                       // if unghosting, make sure we have an enemy, otherwise stay ghosted (even if blinking) so we can't be shot while blinking
+                       /* PLEASE FIX THE SOUND CHANNEL BEFORE ACTIVATING THIS
+                       if (self.solid != SOLID_SLIDEBOX)
+                               sound(self, CHAN_AUTO, "wizard/wsight.wav", 1, ATTN_NORM);
+                       */
+                       self.solid = SOLID_SLIDEBOX;
+                       self.takedamage = DAMAGE_AIM;
+               }
+       }
+       self.alpha = SKILL4_MINALPHA + (1 - SKILL4_MINALPHA) * bound(0, a, 1);
+}
+
+/*
+================
+monster_death_use
+
+When a mosnter dies, it fires all of its targets with the current
+enemy as activator.
+================
+*/
+void() monster_death_use =
+{
+// fall to ground
+       if (self.flags & FL_FLY)
+               self.flags = self.flags - FL_FLY;
+       if (self.flags & FL_SWIM)
+               self.flags = self.flags - FL_SWIM;
+
+       if (!self.target)
+               return;
+
+       activator = self.enemy;
+       SUB_UseTargets ();
+}
+
+
+void() monsterinwall =
+{
+       entity e;
+       if (!autocvar_developer)
+               return;
+       // this is handy for level designers,
+       // puts a spikey ball where the error is...
+       e = spawn();
+       setorigin(e, self.origin);
+       setmodel (e, "models/ebomb.mdl");
+       e.movetype = MOVETYPE_NONE;
+       e.solid = SOLID_NOT;
+       e.think = SUB_Null;
+       e.nextthink = -1;
+       e.scale = 16;
+}
+
+//============================================================================
+
+void() walkmonster_start_go =
+{
+       self.origin_z = self.origin_z + 1; // raise off floor a bit
+
+       tracebox(self.origin, self.mins, self.maxs, self.origin, TRUE, self);
+       if (trace_startsolid)
+       {
+               dprint("walkmonster in wall at: ");
+               dprint(vtos(self.origin));
+               dprint("\n");
+               monsterinwall();
+               droptofloor();
+       }
+       else
+       {
+               droptofloor();
+               if (!walkmove(0,0))
+               {
+                       dprint("walkmonster in wall at: ");
+                       dprint(vtos(self.origin));
+                       dprint("\n");
+                       monsterinwall();
+               }
+       }
+
+       //self.cantrigger = TRUE;
+
+       self.takedamage = DAMAGE_AIM;
+
+       self.ideal_yaw = self.angles * '0 1 0';
+       if (!self.yaw_speed)
+               self.yaw_speed = 20;
+       self.view_ofs = '0 0 25';
+       self.use = monster_use;
+
+       self.flags = self.flags | FL_MONSTER;
+
+       if (monsterwander)
+               self.spawnflags = self.spawnflags | MONSTER_WANDER;
+
+       if (self.target)
+       {
+               self.goalentity = self.movetarget = find(world, targetname, self.target);
+               self.ideal_yaw = vectoyaw(self.goalentity.origin - self.origin);
+               if (!self.movetarget)
+               {
+                       dprint("Monster can't find target at ");
+                       dprint(vtos(self.origin));
+                       dprint("\n");
+               }
+               // this used to be an objerror
+               if (self.movetarget.classname == "path_corner")
+                       self.th_walk ();
+               else
+               {
+                       if ((self.spawnflags & MONSTER_WANDER) && (!self.monsterawaitingteleport) && (self.spawnflags & 3) == 0 && (world.model != "maps/e1m7.bsp"))
+                       {
+                               monster_spawnwanderpath();
+                               self.ideal_yaw = vectoyaw(self.goalentity.origin - self.origin);
+                               self.th_walk ();
+                       }
+                       else
+                       {
+                               self.pausetime = 99999999;
+                               self.th_stand ();
+                       }
+               }
+       }
+       else
+       {
+               if ((self.spawnflags & MONSTER_WANDER) && (!self.monsterawaitingteleport) && (self.spawnflags & 3) == 0 && (world.model != "maps/e1m7.bsp"))
+               {
+                       monster_spawnwanderpath();
+                       self.ideal_yaw = vectoyaw(self.goalentity.origin - self.origin);
+                       self.th_walk ();
+               }
+               else
+               {
+                       self.pausetime = 99999999;
+                       self.th_stand ();
+               }
+       }
+
+// spread think times so they don't all happen at same time
+       self.nextthink = self.nextthink + random()*0.5 + 0.1;
+       self.iscreature = TRUE;
+       self.damagedbycontents = TRUE;
+
+       force_retouch = 2; // mainly to detect teleports
+
+       monster_appearsetup();
+}
+
+
+void() walkmonster_start =
+{
+       self.candrown = 1; // this is turned off by some monsters like zombies
+       // delay drop to floor to make sure all doors have been spawned
+       // spread think times so they don't all happen at same time
+       self.nextthink = time + random()*0.5 + 0.3;
+       self.think = walkmonster_start_go;
+       total_monsters = total_monsters + 1;
+       self.bot_attack = TRUE;
+       self.frags = 2; // actually just used to get havocbots to attack it...
+       self.bleedfunc = genericbleedfunc;
+       self.ismonster = TRUE;
+
+       monster_setalpha (0);
+}
+
+
+
+void() flymonster_start_go =
+{
+       self.takedamage = DAMAGE_AIM;
+
+       self.ideal_yaw = self.angles * '0 1 0';
+       if (!self.yaw_speed)
+               self.yaw_speed = 10;
+       self.view_ofs = '0 0 25';
+       self.use = monster_use;
+
+       self.flags = self.flags | FL_FLY;
+       self.flags = self.flags | FL_MONSTER;
+
+       if (!walkmove(0,0))
+       {
+               dprint("flymonster in wall at: ");
+               dprint(vtos(self.origin));
+               dprint("\n");
+               monsterinwall();
+       }
+
+       //self.cantrigger = TRUE;
+
+       if (monsterwander)
+               self.spawnflags = self.spawnflags | MONSTER_WANDER;
+
+       if (self.target)
+       {
+               self.goalentity = self.movetarget = find(world, targetname, self.target);
+               if (!self.movetarget)
+               {
+                       dprint("Monster can't find target at ");
+                       dprint(vtos(self.origin));
+                       dprint("\n");
+               }
+               // this used to be an objerror
+               if (self.movetarget.classname == "path_corner")
+                       self.th_walk ();
+               else
+               {
+                       if ((self.spawnflags & MONSTER_WANDER) && (!self.monsterawaitingteleport) && (self.spawnflags & 3) == 0 && (world.model != "maps/e1m7.bsp"))
+                       {
+                               monster_spawnwanderpath();
+                               self.ideal_yaw = vectoyaw(self.goalentity.origin - self.origin);
+                               self.th_walk ();
+                       }
+                       else
+                       {
+                               self.pausetime = 99999999;
+                               self.th_stand ();
+                       }
+               }
+       }
+       else
+       {
+               if ((self.spawnflags & MONSTER_WANDER) && (!self.monsterawaitingteleport) && (self.spawnflags & 3) == 0 && (world.model != "maps/e1m7.bsp"))
+               {
+                       monster_spawnwanderpath();
+                       self.ideal_yaw = vectoyaw(self.goalentity.origin - self.origin);
+                       self.th_walk ();
+               }
+               else
+               {
+                       self.pausetime = 99999999;
+                       self.th_stand ();
+               }
+       }
+       self.iscreature = TRUE;
+       self.damagedbycontents = TRUE;
+
+       force_retouch = 2; // mainly to detect teleports
+
+       monster_appearsetup();
+}
+
+void() flymonster_start =
+{
+       self.candrown = 1;
+       // spread think times so they don't all happen at same time
+       self.nextthink = time + random()*0.5 + 0.1;
+       self.think = flymonster_start_go;
+       total_monsters = total_monsters + 1;
+       self.bot_attack = TRUE;
+       self.frags = 2; // actually just used to get havocbots to attack it...
+       self.bleedfunc = genericbleedfunc;
+       self.ismonster = TRUE;
+
+       monster_setalpha (0);
+}
+
+
+void() swimmonster_start_go =
+{
+       if (deathmatch)
+       {
+               remove(self);
+               return;
+       }
+
+       //self.cantrigger = TRUE;
+
+       self.takedamage = DAMAGE_AIM;
+
+       self.ideal_yaw = self.angles * '0 1 0';
+       if (!self.yaw_speed)
+               self.yaw_speed = 10;
+       self.view_ofs = '0 0 10';
+       self.use = monster_use;
+
+       self.flags = self.flags | FL_SWIM;
+       self.flags = self.flags | FL_MONSTER;
+
+       if (monsterwander)
+               self.spawnflags = self.spawnflags | MONSTER_WANDER;
+
+       if (self.target)
+       {
+               self.goalentity = self.movetarget = find(world, targetname, self.target);
+               if (!self.movetarget)
+               {
+                       dprint("Monster can't find target at ");
+                       dprint(vtos(self.origin));
+                       dprint("\n");
+               }
+               // this used to be an objerror
+               if (self.movetarget.classname == "path_corner")
+                       self.th_walk ();
+               else
+               {
+                       if ((self.spawnflags & MONSTER_WANDER) && (!self.monsterawaitingteleport) && (self.spawnflags & 3) == 0 && (world.model != "maps/e1m7.bsp"))
+                       {
+                               monster_spawnwanderpath();
+                               self.ideal_yaw = vectoyaw(self.goalentity.origin - self.origin);
+                               self.th_walk ();
+                       }
+                       else
+                       {
+                               self.pausetime = 99999999;
+                               self.th_stand ();
+                       }
+               }
+       }
+       else
+       {
+               if ((self.spawnflags & MONSTER_WANDER) && (!self.monsterawaitingteleport) && (self.spawnflags & 3) == 0 && (world.model != "maps/e1m7.bsp"))
+               {
+                       monster_spawnwanderpath();
+                       self.ideal_yaw = vectoyaw(self.goalentity.origin - self.origin);
+                       self.th_walk ();
+               }
+               else
+               {
+                       self.pausetime = 99999999;
+                       self.th_stand ();
+               }
+       }
+       self.iscreature = TRUE;
+       self.damagedbycontents = TRUE;
+
+       force_retouch = 2; // mainly to detect teleports
+
+       monster_appearsetup();
+}
+
+void() swimmonster_start =
+{
+       // spread think times so they don't all happen at same time
+       self.candrown = 0;
+       self.nextthink = time + random()*0.5 + 0.1;
+       self.think = swimmonster_start_go;
+       total_monsters = total_monsters + 1;
+       self.bot_attack = TRUE;
+       self.frags = 2; // actually just used to get havocbots to attack it...
+       self.bleedfunc = genericbleedfunc;
+       self.ismonster = TRUE;
+
+       monster_setalpha(0);
+}
+
+void(vector org, float bodydamage, float armordamage, vector force, float damgtype) genericbleedfunc =
+{
+        vector v;
+        v = '0 0 0' - force * 0.05;
+        if (armordamage > 0)
+                te_spark(org, v, armordamage * 3);
+        if (bodydamage > 0)
+                te_blood(org, v, bodydamage);
+}
diff --git a/qcsrc/server/attic/monsters/monster_zombie.qc b/qcsrc/server/attic/monsters/monster_zombie.qc
new file mode 100644 (file)
index 0000000..c95c2ea
--- /dev/null
@@ -0,0 +1,575 @@
+//#define MONSTES_ENABLED
+#ifdef MONSTES_ENABLED
+
+float autocvar_g_monster_zombie_attack_run_damage;
+float autocvar_g_monster_zombie_attack_run_delay;
+float autocvar_g_monster_zombie_attack_run_force;
+float autocvar_g_monster_zombie_attack_run_hitrange;
+float autocvar_g_monster_zombie_attack_run_range;
+float autocvar_g_monster_zombie_attack_stand_damage;
+float autocvar_g_monster_zombie_attack_stand_delay;
+float autocvar_g_monster_zombie_attack_stand_force;
+float autocvar_g_monster_zombie_attack_stand_range;
+float autocvar_g_monster_zombie_health;
+float autocvar_g_monster_zombie_idle_timer_max;
+float autocvar_g_monster_zombie_idle_timer_min;
+float autocvar_g_monster_zombie_movespeed;
+float autocvar_g_monster_zombie_respawntime;
+float autocvar_g_monster_zombie_stopspeed;
+float autocvar_g_monster_zombie_targetrange;
+float autocvar_g_monster_zombie_turnspeed;
+float autocvar_g_monsters;
+
+
+#define zombie_anim_attackleap         0
+#define zombie_anim_attackrun1         1
+#define zombie_anim_attackrun2         2
+#define zombie_anim_attackrun3         3
+#define zombie_anim_attackstanding1    4
+#define zombie_anim_attackstanding2    5
+#define zombie_anim_attackstanding3    6
+#define zombie_anim_blockend           7
+#define zombie_anim_blockstart         8
+#define zombie_anim_deathback1         9
+#define zombie_anim_deathback2         10
+#define zombie_anim_deathback3         11
+#define zombie_anim_deathfront1        12
+#define zombie_anim_deathfront2        13
+#define zombie_anim_deathfront3        14
+#define zombie_anim_deathleft1         15
+#define zombie_anim_deathleft2         16
+#define zombie_anim_deathright1        17
+#define zombie_anim_deathright2        18
+#define zombie_anim_idle               19
+#define zombie_anim_painback1          20
+#define zombie_anim_painback2          21
+#define zombie_anim_painfront1         22
+#define zombie_anim_painfront2         23
+#define zombie_anim_runbackwards       24
+#define zombie_anim_runbackwardsleft   25
+#define zombie_anim_runbackwardsright  26
+#define zombie_anim_runforward         27
+#define zombie_anim_runforwardleft     28
+#define zombie_anim_runforwardright    29
+#define zombie_anim_spawn              30
+
+#define ZOMBIE_MIN                                      '-18 -18 -25'
+#define ZOMBIE_MAX                                      '18 18 47'
+
+#define ZV_IDLE     10
+
+#define ZV_PATH     100
+#define ZV_HUNT     200
+
+#define ZV_ATTACK_FIND  10
+#define ZV_ATTACK_RUN   20
+#define ZV_ATTACK_STAND 30
+
+#define ZV_PATH2 10000
+
+//.entity verbs_idle;
+//.entity verbs_attack;
+//.entity verbs_move;
+
+//.float  state_timeout;
+//.void() monster_state;
+#define MONSTERFLAG_NORESPAWN 2
+
+void zombie_spawn();
+
+float zombie_scoretarget(entity trg)
+{
+    float  tmp;
+    vector ang1;
+
+    if (trg.takedamage == DAMAGE_AIM)
+    if not (trg.flags & FL_NOTARGET)
+    if (trg.deadflag == DEAD_NO)
+    if (trg.team != self.team)
+    {
+        if((self.origin_z - trg.origin_z) < 128)
+        {
+            ang1 = normalize(self.origin - trg.origin);
+            tmp = vlen(ang1 - v_forward);
+            if(tmp > 1.5)
+            {
+                traceline(self.origin + '0 0 47',trg.origin + '0 0 32',MOVE_NORMAL,self);
+                if(trace_ent != trg)
+                    return 0;
+
+                return (autocvar_g_monster_zombie_targetrange - vlen(self.origin - trg.origin)) * tmp;
+            }
+            else if(self.enemy == trg)
+                return (autocvar_g_monster_zombie_targetrange - vlen(self.origin - trg.origin)) * tmp;
+        }
+    }
+
+    return 0;
+}
+
+void zombie_corpse_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+{
+    //dprint("zombie_corpse_damage\n");
+    Violence_GibSplash_At(hitloc, force, 2, bound(0, damage, 200) / 16, self, attacker);
+
+    self.health -= damage;
+
+    if(self.health < 0)
+    {
+        Violence_GibSplash(self, 1, 1, attacker);
+        remove(self);
+    }
+}
+
+void zombie_die(vector dir)
+{
+    vector v;
+    float f;
+
+    entity dummy;
+
+    dummy = spawn();
+    setmodel(dummy,"models/monsters/zombie.dpm");
+    setorigin(dummy, self.origin);
+    dummy.velocity  = self.velocity;
+    dummy.movetype  = MOVETYPE_BOUNCE;
+    dummy.think     = SUB_Remove;
+    dummy.nextthink = time + 3;
+    dummy.health    = 50;
+    dummy.takedamage = DAMAGE_YES;
+    dummy.event_damage = zombie_corpse_damage;
+    dummy.solid      = SOLID_CORPSE;
+    setsize(dummy,self.mins,self.maxs);
+
+    SUB_SetFade(dummy,time + 5,2);
+
+
+    v = normalize(self.origin - dir);
+    f = vlen(v_forward - v) - 1;
+    if(f > 0.5)
+        dummy.frame = zombie_anim_deathfront1 + rint(random() * 2);
+    else if(f < 0.5)
+        dummy.frame = zombie_anim_deathback1 + rint(random() * 2);
+    else
+    {
+        f = vlen(v_right - v) - 1;
+        if(f > 0.5)
+            dummy.frame = zombie_anim_deathright1 + rint(random() * 2);
+        else if(f < 0.5)
+            dummy.frame = zombie_anim_deathleft1 + rint(random() * 2);
+    }
+
+
+    if(self.spawnflags & MONSTERFLAG_NORESPAWN)
+    {
+        self.think = SUB_Remove;
+        self.nextthink = time;
+        return;
+    }
+
+    setmodel(self,"");
+    self.solid          = SOLID_NOT;
+    self.takedamage     = DAMAGE_NO;
+    self.event_damage   = SUB_Null;
+    self.enemy          = world;
+    self.think          = zombie_spawn;
+    self.nextthink      = time + autocvar_g_monster_zombie_respawntime;
+    self.pain_finished  = self.nextthink;
+}
+
+void zombie_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+{
+
+    vector v;
+    float f;
+
+    v = normalize(self.origin - hitloc);
+    f = vlen(v_forward - v) - 1;
+
+
+    self.health -= damage;
+    self.velocity = self.velocity + force;
+    if(self.health <= 0)
+    {
+        zombie_die(hitloc);
+        return;
+    }
+
+    Violence_GibSplash_At(hitloc, force, 2, bound(0, damage, 200) / 16, self, attacker);
+
+       if (damage > 50)
+               Violence_GibSplash_At(hitloc, force * -0.1, 3, 1, self, attacker);
+       if (damage > 100)
+               Violence_GibSplash_At(hitloc, force * -0.2, 3, 1, self, attacker);
+
+    if (time > self.pain_finished)
+    {
+        if(f < 0.5)
+        {
+            if(random() < 0.5)
+                self.frame = zombie_anim_painback1;
+            else
+                self.frame = zombie_anim_painback2;
+        }
+        else
+        {
+            if(random() < 0.5)
+                self.frame = zombie_anim_painfront1;
+            else
+                self.frame = zombie_anim_painfront2;
+        }
+
+        self.pain_finished = time + 0.36;
+    }
+}
+
+.vector bvec;
+.float bvec_time;
+
+void zombie_move()
+{
+    vector real_angle;
+    float vz, tdiff, tspeed;
+
+    tdiff = time - self.zoomstate;
+    tspeed = tdiff * autocvar_g_monster_zombie_turnspeed;
+    vz = self.velocity_z;
+    self.zoomstate = time;
+
+    if(self.bvec_time < time)
+    {
+        self.bvec_time = time + 0.2;
+        self.bvec = steerlib_beamsteer(steerlib_attract2(self.moveto,0.5,500,0.95),512,32,34,64);
+    }
+
+    if(self.enemy)
+        self.moveto = self.enemy.origin;
+    else
+        self.moveto = self.origin + v_forward;
+
+    self.steerto = normalize(steerlib_attract2(self.moveto,0.5,500,0.95) + self.bvec);
+
+    self.angles_y = safeangle(self.angles_y);
+    real_angle = vectoangles(self.steerto) - self.angles;
+    self.angles_y += bound(-10, real_angle_y, 10);
+
+    if(vlen(self.origin - self.moveto) > 64)
+    {
+        movelib_move_simple(v_forward ,autocvar_g_monster_zombie_movespeed,0.6);
+        if(time > self.pain_finished)
+            if(self.attack_finished_single < time)
+                self.frame = zombie_anim_runforward;
+    }
+    else
+    {
+        movelib_beak_simple(autocvar_g_monster_zombie_stopspeed);
+        if(time > self.pain_finished)
+            if(self.attack_finished_single < time)
+                self.frame = zombie_anim_idle;
+    }
+
+    self.velocity_z = vz;
+    self.steerto = self.origin;
+}
+
+float zombie_verb_idle_roam(float eval)
+{
+    switch (eval)
+    {
+    case VCM_EVAL:
+
+        if(self.enemy)
+            return VS_CALL_NO;
+
+        return verb.verb_static_value;
+
+    case VCM_DO:
+
+        self.moveto = v_forward * 128;
+        self.steerto = v_forward; //steerlib_beamsteer(v_forward,512,32,34,64);
+
+        return VS_CALL_YES_DOING;
+    }
+
+    return VS_CALL_YES_DONE;
+}
+
+float zombie_verb_idle_stand(float eval)
+{
+    switch (eval)
+    {
+    case VCM_EVAL:
+
+        if(self.enemy)
+            return VS_CALL_NO;
+
+        return verb.verb_static_value;
+
+    case VCM_DO:
+
+        self.moveto   = self.origin;
+        self.frame    = zombie_anim_idle;
+        self.velocity = '0 0 0';
+
+        return VS_CALL_YES_DOING;
+    }
+
+    return VS_CALL_YES_DONE;
+}
+
+float zombie_verb_idle(float eval)
+{
+    switch (eval)
+    {
+    case VCM_EVAL:
+
+        if(self.enemy)
+            return VS_CALL_NO;
+
+        return verb.verb_static_value;
+
+    case VCM_DO:
+        float t;
+
+        t = autocvar_g_monster_zombie_idle_timer_max -  autocvar_g_monster_zombie_idle_timer_min;
+        t = autocvar_g_monster_zombie_idle_timer_min + (random() * t);
+
+        if(random() < 0.5)
+            verbstack_push(self.verbs_idle, zombie_verb_idle_roam,  ZV_IDLE + 1, t, self);
+        else
+            verbstack_push(self.verbs_idle, zombie_verb_idle_stand, ZV_IDLE + 1, 0.1, self);
+
+        return VS_CALL_YES_DOING;
+    }
+
+    return VS_CALL_YES_DONE;
+}
+
+float zombie_verb_attack_findtarget(float eval)
+{
+    switch (eval)
+    {
+    case VCM_EVAL:
+        if(self.enemy)
+            return VS_CALL_NO;
+
+        return verb.verb_static_value;
+
+    case VCM_DO:
+
+        entity trg, best_trg;
+        float trg_score, best_trg_score;
+
+        trg = findradius(self.origin,autocvar_g_monster_zombie_targetrange);
+        while(trg)
+        {
+            trg_score = zombie_scoretarget(trg);
+            if(trg_score > best_trg_score)
+            {
+                best_trg = trg;
+                best_trg_score = trg_score;
+            }
+
+            trg = trg.chain;
+        }
+
+        if(best_trg)
+        {
+            self.enemy = best_trg;
+            dprint("Selected: ",best_trg.netname, " as target.\n");
+        }
+
+        return VS_CALL_YES_DOING;
+    }
+
+    return VS_CALL_YES_DONE;
+}
+
+void zombie_runattack_damage()
+{
+    entity oldself;
+    oldself = self;
+    self = self.owner;
+
+    if(vlen(self.origin - self.enemy.origin) > autocvar_g_monster_zombie_attack_run_hitrange)
+        return;
+
+    if(vlen(normalize(self.origin - self.enemy.origin) - v_forward) < 1.6)
+        return;
+
+    Damage(self.enemy, self, self, autocvar_g_monster_zombie_attack_run_damage, DEATH_TURRET, self.enemy.origin, normalize(self.enemy.origin - self.origin)  * autocvar_g_monster_zombie_attack_run_force);
+
+    self = oldself;
+    self.think = SUB_Remove;
+    self.nextthink = time;
+}
+
+float zombie_verb_attack_run(float eval)
+{
+    switch (eval)
+    {
+    case VCM_EVAL:
+        if not (self.enemy)
+            return VS_CALL_NO;
+
+        if(self.attack_finished_single > time)
+            return VS_CALL_NO;
+
+        if(vlen(self.origin - self.enemy.origin) > autocvar_g_monster_zombie_attack_run_range)
+            return VS_CALL_NO;
+
+        if(vlen(normalize(self.origin - self.enemy.origin) - v_forward) < 1.6)
+            return VS_CALL_NO;
+
+        return verb.verb_static_value;
+
+    case VCM_DO:
+        entity pain;
+        pain = spawn();
+        pain.owner = self;
+        pain.think = zombie_runattack_damage;
+        pain.nextthink = time + autocvar_g_monster_zombie_attack_run_delay;
+
+        self.attack_finished_single = time + 0.7;
+        self.frame = zombie_anim_attackrun1 + rint(random() * 2);
+
+        return VS_CALL_YES_DOING;
+    }
+
+    return VS_CALL_YES_DONE;
+}
+
+void zombie_standattack_damage()
+{
+    //entity oldself;
+    //oldself = self;
+    //self = self.owner;
+
+    setorigin(self,self.owner.origin + v_forward * 32);
+    RadiusDamage(self, self.owner, autocvar_g_monster_zombie_attack_stand_damage,autocvar_g_monster_zombie_attack_stand_damage,16,self, autocvar_g_monster_zombie_attack_stand_force,DEATH_TURRET,world);
+    //float RadiusDamage (entity inflictor, entity attacker, float coredamage, float edgedamage, float rad, entity ignore, float forceintensity, float deathtype, entity directhitentity)
+
+
+    //self = oldself;
+    self.think = SUB_Remove;
+    self.nextthink = time;
+}
+
+float zombie_verb_attack_stand(float eval)
+{
+    switch (eval)
+    {
+    case VCM_EVAL:
+        if not (self.enemy)
+            return VS_CALL_NO;
+
+        if(self.attack_finished_single > time)
+            return VS_CALL_NO;
+
+        if(vlen(self.origin - self.enemy.origin) > autocvar_g_monster_zombie_attack_stand_range)
+            return VS_CALL_NO;
+
+        if(vlen(normalize(self.origin - self.enemy.origin) - v_forward) < 1.8)
+            return VS_CALL_NO;
+
+        return verb.verb_static_value;
+
+    case VCM_DO:
+        entity pain;
+        pain = spawn();
+        pain.owner = self;
+        pain.think = zombie_runattack_damage;
+        pain.nextthink = time + autocvar_g_monster_zombie_attack_stand_delay;
+
+        self.attack_finished_single = time + 0.7;
+        self.frame = zombie_anim_attackstanding1 + rint(random() * 1);
+        dprint("frame:",ftos(self.frame),"\n");
+
+        return VS_CALL_YES_DOING;
+    }
+
+    return VS_CALL_YES_DONE;
+}
+
+void zombie_think()
+{
+    self.angles_x *= -1;
+    makevectors(self.angles);
+    self.angles_x *= -1;
+
+    if (zombie_scoretarget(self.enemy) == 0)
+        self.enemy = world;
+
+    verbstack_pop(self.verbs_attack);
+    //verbstack_pop(self.verbs_move);
+
+    if not (self.enemy)
+        verbstack_pop(self.verbs_idle);
+
+    zombie_move();
+
+    if(self.enemy)
+        self.nextthink = time;
+    else
+        self.nextthink = time + 0.2;
+}
+
+void zombie_spawn()
+{
+    setmodel(self,"models/monsters/zombie.dpm");
+
+    self.solid          = SOLID_BBOX;
+    self.takedamage     = DAMAGE_AIM;
+    self.event_damage   = zombie_damage;
+    self.enemy          = world;
+    self.frame          = zombie_anim_spawn;
+    self.think          = zombie_think;
+    self.nextthink      = time + 2.1;
+    self.pain_finished  = self.nextthink;
+    self.movetype       = MOVETYPE_WALK;
+    self.health         = autocvar_g_monster_zombie_health;
+    self.velocity       = '0 0 0';
+    self.angles         = self.pos2;
+    self.moveto         = self.origin;
+    self.flags          = FL_MONSTER;
+
+    setorigin(self,self.pos1);
+    setsize(self,ZOMBIE_MIN,ZOMBIE_MAX);
+}
+
+
+void spawnfunc_monster_zombie()
+{
+    if not(autocvar_g_monsters)
+    {
+        remove(self);
+        return;
+    }
+
+    precache_model("models/monsters/zombie.dpm");
+
+
+    self.verbs_idle   = spawn();
+    self.verbs_attack = spawn();
+
+    self.verbs_idle.owner = self;
+    self.verbs_attack.owner = self;
+
+    self.think      = zombie_spawn;
+    self.nextthink  = time + 2;
+
+    traceline(self.origin + '0 0 10', self.origin - '0 0 32', MOVE_WORLDONLY, self);
+
+    self.pos1 = trace_endpos;
+    self.pos2 = self.angles;
+    self.team = MAX_SHOT_DISTANCE -1;
+
+    verbstack_push(self.verbs_idle, zombie_verb_idle, ZV_IDLE,0 , self);
+
+    verbstack_push(self.verbs_attack, zombie_verb_attack_findtarget, ZV_ATTACK_FIND,0 , self);
+    verbstack_push(self.verbs_attack, zombie_verb_attack_run, ZV_ATTACK_RUN,0 , self);
+    verbstack_push(self.verbs_attack, zombie_verb_attack_stand, ZV_ATTACK_STAND,0 , self);
+
+}
+
+#endif // MONSTES_ENABLED
diff --git a/qcsrc/server/attic/vehicles/bumblebee.qc b/qcsrc/server/attic/vehicles/bumblebee.qc
new file mode 100644 (file)
index 0000000..f784563
--- /dev/null
@@ -0,0 +1,371 @@
+#ifdef SVQC
+// Auto cvars
+float autocvar_g_vehicle_bumblebee_speed_forward;
+float autocvar_g_vehicle_bumblebee_speed_strafe;
+float autocvar_g_vehicle_bumblebee_speed_up;
+float autocvar_g_vehicle_bumblebee_speed_down;
+float autocvar_g_vehicle_bumblebee_turnspeed;
+float autocvar_g_vehicle_bumblebee_pitchspeed;
+float autocvar_g_vehicle_bumblebee_pitchlimit;
+float autocvar_g_vehicle_bumblebee_friction;
+
+float autocvar_g_vehicle_bumblebee_energy;
+float autocvar_g_vehicle_bumblebee_energy_regen;
+float autocvar_g_vehicle_bumblebee_energy_regen_pause;
+
+float autocvar_g_vehicle_bumblebee_health;
+float autocvar_g_vehicle_bumblebee_health_regen;
+float autocvar_g_vehicle_bumblebee_health_regen_pause;
+
+float autocvar_g_vehicle_bumblebee_shield;
+float autocvar_g_vehicle_bumblebee_shield_regen;
+float autocvar_g_vehicle_bumblebee_shield_regen_pause;
+
+float autocvar_g_vehicle_bumblebee_cannon_cost;
+float autocvar_g_vehicle_bumblebee_cannon_damage;
+float autocvar_g_vehicle_bumblebee_cannon_radius;
+float autocvar_g_vehicle_bumblebee_cannon_refire;
+float autocvar_g_vehicle_bumblebee_cannon_speed;
+float autocvar_g_vehicle_bumblebee_cannon_spread;
+float autocvar_g_vehicle_bumblebee_cannon_force;
+
+float autocvar_g_vehicle_bumblebee_cannon_turnspeed;
+float autocvar_g_vehicle_bumblebee_cannon_pitchlimit_down;
+float autocvar_g_vehicle_bumblebee_cannon_pitchlimit_up;
+float autocvar_g_vehicle_bumblebee_cannon_turnlimit_in;
+float autocvar_g_vehicle_bumblebee_cannon_turnlimit_out;
+
+float autocvar_g_vehicle_bumblebee_respawntime;
+
+float autocvar_g_vehicle_bumblebee_blowup_radius;
+float autocvar_g_vehicle_bumblebee_blowup_coredamage;
+float autocvar_g_vehicle_bumblebee_blowup_edgedamage;
+float autocvar_g_vehicle_bumblebee_blowup_forceintensity;
+
+#define BUMB_MIN '-120 -120 -40'
+#define BUMB_MAX '120 120 40'
+
+.entity gunner1;
+//.entity gunner2;
+.vector lastaim;
+float bumb_gunner_frame()
+{
+    entity vehic, gun, gunner;
+    float ftmp, ftmp2;
+    vector vtmp;
+
+    vehic   = self.vehicle;
+    gun     = self.vehicle.gun1;
+    gunner  = self;
+
+    self    = vehic;
+    vehic.solid = SOLID_NOT;
+    crosshair_trace(gunner);
+
+    //vtmp = gettaginfo(vehic, gettagindexvehic, "tag_hardpoint01"));
+    vtmp = gettaginfo(gun, gettagindex(gun, "muzzle"));
+    vtmp = vectoangles(normalize(trace_endpos - vtmp)); // Find the direction & angle
+    vtmp = shortangle_vxy(vtmp - (vehic.angles + gun.angles), vehic.angles + gun.angles);     // Find aim offset
+
+    // Bind to aimspeed
+    ftmp2 = autocvar_g_vehicle_bumblebee_cannon_turnspeed * frametime; ftmp = -ftmp2;
+    vtmp_x = bound(ftmp, vtmp_x, ftmp2);
+    vtmp_y = bound(ftmp, vtmp_y, ftmp2);
+    // Bind to limts
+    gun.angles_x = bound(-autocvar_g_vehicle_bumblebee_cannon_pitchlimit_down, vtmp_x + gun.angles_x, autocvar_g_vehicle_bumblebee_cannon_pitchlimit_up);
+    gun.angles_y = bound(-autocvar_g_vehicle_bumblebee_cannon_turnlimit_in,  vtmp_y + gun.angles_y, autocvar_g_vehicle_bumblebee_cannon_turnlimit_out);
+
+    if(gunner.BUTTON_ATCK && gun.cnt <= time)
+    {
+        vtmp = gettaginfo(gun, gettagindex(gun, "muzzle"));
+        v_forward = normalize(v_forward);
+        vtmp += v_forward * 50;
+
+        fireBullet (vtmp, v_forward, autocvar_g_vehicle_spiderbot_minigun_spread, autocvar_g_vehicle_spiderbot_minigun_damage,
+            autocvar_g_vehicle_spiderbot_minigun_spread, DEATH_SBMINIGUN, 0);
+
+        gun.cnt = time + 0.1;
+    }
+
+    setorigin(gunner, vehic.origin);
+    gunner.velocity = vehic.velocity;
+
+    vehic.solid = SOLID_BBOX;
+    gunner.BUTTON_ATCK = gunner.BUTTON_ATCK2 = gunner.BUTTON_CROUCH = 0;
+    self = gunner;
+    return 1;
+}
+
+void bumb_gunner_enter()
+{
+    if(self.gunner1 != world)
+        return;
+
+    self.gunner1         = other;
+    self.gunner1.vehicle = self;
+
+    msg_entity = other;
+    WriteByte (MSG_ONE, SVC_SETVIEWPORT);
+    WriteEntity(MSG_ONE, self.gun1);
+    WriteByte (MSG_ONE, SVC_SETVIEWANGLES);
+    if(self.tur_head)
+    {
+        WriteAngle(MSG_ONE, self.gun1.angles_x + self.angles_x); // tilt
+        WriteAngle(MSG_ONE, self.gun1.angles_y + self.angles_y); // yaw
+        WriteAngle(MSG_ONE, 0);                                  // roll
+    }
+    other.PlayerPhysplug = bumb_gunner_frame;
+}
+
+float bumb_pilot_frame()
+{
+    entity pilot, gunner, vehic;
+    vector newvel;
+
+    pilot = self;
+    vehic = self.vehicle;
+    self   = vehic;
+
+    if(pilot.BUTTON_USE && vehic.deadflag == DEAD_NO)
+    {
+        self = vehic;
+        vehicles_exit(VHEF_NORMAL);
+        self = pilot;
+        return 0;
+    }
+
+    if(vehic.deadflag != DEAD_NO)
+    {
+        self = pilot;
+        pilot.BUTTON_ATCK = pilot.BUTTON_ATCK2 = 0;
+        return 1;
+    }
+
+    crosshair_trace(pilot);
+
+    vector vang;
+    float ftmp;
+
+    vang = vehic.angles;
+    newvel = vectoangles(normalize(trace_endpos - self.origin + '0 0 32'));
+    vang_x *= -1;
+    newvel_x *= -1;
+    if(newvel_x > 180)  newvel_x -= 360;
+    if(newvel_x < -180) newvel_x += 360;
+    if(newvel_y > 180)  newvel_y -= 360;
+    if(newvel_y < -180) newvel_y += 360;
+
+    ftmp = shortangle_f(pilot.v_angle_y - vang_y, vang_y);
+    if(ftmp > 180)  ftmp -= 360; if(ftmp < -180) ftmp += 360;
+    vehic.avelocity_y = bound(-autocvar_g_vehicle_bumblebee_turnspeed, ftmp + vehic.avelocity_y * 0.9, autocvar_g_vehicle_bumblebee_turnspeed);
+
+    // Pitch
+    ftmp = 0;
+    if(pilot.movement_x > 0 && vang_x < autocvar_g_vehicle_bumblebee_pitchlimit) ftmp = 5;
+    else if(pilot.movement_x < 0 && vang_x > -autocvar_g_vehicle_bumblebee_pitchlimit) ftmp = -20;
+
+    newvel_x = bound(-autocvar_g_vehicle_bumblebee_pitchlimit, newvel_x , autocvar_g_vehicle_bumblebee_pitchlimit);
+    ftmp = vang_x - bound(-autocvar_g_vehicle_bumblebee_pitchlimit, newvel_x + ftmp, autocvar_g_vehicle_bumblebee_pitchlimit);
+    vehic.avelocity_x = bound(-autocvar_g_vehicle_bumblebee_pitchspeed, ftmp + vehic.avelocity_x * 0.9, autocvar_g_vehicle_bumblebee_pitchspeed);
+
+    vehic.angles_x = anglemods(vehic.angles_x);
+    vehic.angles_y = anglemods(vehic.angles_y);
+    vehic.angles_z = anglemods(vehic.angles_z);
+
+    makevectors('0 1 0' * vehic.angles_y);
+    newvel = vehic.velocity * -autocvar_g_vehicle_bumblebee_friction;
+
+    if(pilot.movement_x != 0)
+    {
+        if(pilot.movement_x > 0)
+            newvel += v_forward  * autocvar_g_vehicle_bumblebee_speed_forward;
+        else if(pilot.movement_x < 0)
+            newvel -= v_forward  * autocvar_g_vehicle_bumblebee_speed_forward;
+    }
+
+    if(pilot.movement_y != 0)
+    {
+        if(pilot.movement_y < 0)
+            newvel -= v_right * autocvar_g_vehicle_bumblebee_speed_strafe;
+        else if(pilot.movement_y > 0)
+            newvel += v_right * autocvar_g_vehicle_bumblebee_speed_strafe;
+        ftmp = newvel * v_right;
+        ftmp *= frametime * 0.1;
+        vehic.angles_z = bound(-15, vehic.angles_z + ftmp, 15);
+    }
+    else
+    {
+        vehic.angles_z *= 0.95;
+        if(vehic.angles_z >= -1 && vehic.angles_z <= -1)
+            vehic.angles_z = 0;
+    }
+
+    if(pilot.BUTTON_CROUCH)
+        newvel -=   v_up * autocvar_g_vehicle_bumblebee_speed_down;
+    else if (pilot.BUTTON_JUMP)
+        newvel +=  v_up * autocvar_g_vehicle_bumblebee_speed_up;
+
+    vehic.velocity  += newvel * frametime;
+    pilot.velocity = pilot.movement  = vehic.velocity;
+    setorigin(pilot,vehic.origin + '0 0 32');
+
+
+    if(vehic.vehicle_flags  & VHF_SHIELDREGEN)
+        vehicles_regen(dmg_time, vehicle_shield, autocvar_g_vehicle_bumblebee_shield, autocvar_g_vehicle_bumblebee_shield_regen_pause, autocvar_g_vehicle_bumblebee_shield_regen, frametime);
+
+    if(vehic.vehicle_flags  & VHF_HEALTHREGEN)
+        vehicles_regen(dmg_time, vehicle_health, autocvar_g_vehicle_bumblebee_health, autocvar_g_vehicle_bumblebee_health_regen_pause, autocvar_g_vehicle_bumblebee_health_regen, frametime);
+
+    if(vehic.vehicle_flags  & VHF_ENERGYREGEN)
+        vehicles_regen(cnt, vehicle_energy, autocvar_g_vehicle_bumblebee_energy, autocvar_g_vehicle_bumblebee_energy_regen_pause, autocvar_g_vehicle_bumblebee_energy_regen, frametime);
+
+    VEHICLE_UPDATE_PLAYER(health, bumblebee);
+    VEHICLE_UPDATE_PLAYER(energy, bumblebee);
+    if(vehic.vehicle_flags & VHF_HASSHIELD)
+        VEHICLE_UPDATE_PLAYER(shield, bumblebee);
+
+    pilot.BUTTON_ATCK = pilot.BUTTON_ATCK2 = pilot.BUTTON_CROUCH = 0;
+    self = pilot;
+
+    return 1;
+}
+
+void bumb_think()
+{
+    self.velocity = self.velocity * 0.99;
+    self.nextthink = time + 0.1;
+}
+
+void bumb_enter()
+{
+    self.touch  = bumb_gunner_enter;
+}
+
+void bumb_exit(float eject)
+{
+    self.owner = world;
+    self.touch = vehicles_touch;
+}
+
+void bumb_spawn()
+{
+    self.vehicle_health = autocvar_g_vehicle_bumblebee_health;
+    self.vehicle_shield = autocvar_g_vehicle_bumblebee_shield;
+    self.movetype       = MOVETYPE_TOSS;
+    self.solid          = SOLID_BBOX;
+    //self.vehicle_energy = 1;
+    self.movetype = MOVETYPE_FLY;
+    setorigin(self, self.origin + '0 0 25');
+}
+
+void bumb_die()
+{
+    self.health       = 0;
+    self.event_damage = SUB_Null;
+    self.solid        = SOLID_CORPSE;
+    self.takedamage   = DAMAGE_NO;
+    self.deadflag     = DEAD_DYING;
+    self.movetype     = MOVETYPE_BOUNCE;
+
+    pointparticles(particleeffectnum("rocket_explode"), findbetterlocation (self.origin, 16), '0 0 0', 1);
+}
+
+void bumb_dinit()
+{
+    if not (vehicle_initialize(
+             "Bumblebee",
+             "models/vehicles/bumblebee_body.dpm",
+             "",
+             "models/vehicles/spiderbot_cockpit.dpm",
+             "", "", "tag_viewport",
+             HUD_BUMBLEBEE,
+             BUMB_MIN, BUMB_MAX,
+             FALSE,
+             bumb_spawn, autocvar_g_vehicle_bumblebee_respawntime,
+             bumb_pilot_frame,
+             bumb_enter, bumb_exit,
+             bumb_die,   bumb_think,
+             FALSE))
+    {
+        remove(self);
+        return;
+    }
+    self.gun1 = spawn();
+    setmodel(self.gun1, "models/vehicles/bumblebee_ray.dpm");
+    setattachment(self.gun1, self, "tag_hardpoint03");
+
+    self.gun1 = spawn();
+    self.gun2 = spawn();
+
+    self.gun1.owner = self;
+    self.gun2.owner = self;
+
+    setmodel(self.gun1, "models/vehicles/bumblebee_plasma_right.dpm");
+    setmodel(self.gun2, "models/vehicles/bumblebee_plasma_left.dpm");
+
+    setattachment(self.gun1, self, "tag_hardpoint01");
+    setattachment(self.gun2, self, "tag_hardpoint02");
+
+    vector ofs;
+    ofs = gettaginfo(self, gettagindex(self, "tag_hardpoint01"));
+    ofs -= self.origin;
+    setattachment(self.gun1, self, "");
+    setorigin(self.gun1, ofs);
+
+    ofs = gettaginfo(self, gettagindex(self, "tag_hardpoint02"));
+    ofs -= self.origin;
+    setattachment(self.gun2, self, "");
+    setorigin(self.gun2, ofs);
+
+
+}
+
+void spawnfunc_vehicle_bumblebee()
+{
+
+    precache_model ("models/vehicles/bumblebee_body.dpm");
+    precache_model ("models/vehicles/bumblebee_plasma_left.dpm");
+    precache_model ("models/vehicles/bumblebee_plasma_right.dpm");
+    precache_model ("models/vehicles/bumblebee_ray.dpm");
+
+    //vehicles_configcheck("vehicle_bumblebee.cfg", autocvar_g_vehicle_bumblebee_health);
+
+    if(autocvar_g_vehicle_bumblebee_energy)
+        if(autocvar_g_vehicle_bumblebee_energy_regen)
+            self.vehicle_flags |= VHF_ENERGYREGEN;
+
+    if(autocvar_g_vehicle_bumblebee_shield)
+        self.vehicle_flags |= VHF_HASSHIELD;
+
+    if(autocvar_g_vehicle_bumblebee_shield_regen)
+        self.vehicle_flags |= VHF_SHIELDREGEN;
+
+    if(autocvar_g_vehicle_bumblebee_health_regen)
+        self.vehicle_flags |= VHF_HEALTHREGEN;
+
+    self.think = bumb_dinit;
+    self.nextthink = time + 1;
+}
+#endif // SVQC
+
+#ifdef CSQC
+void bumblebee_draw()
+{
+
+}
+
+void bumblebee_draw2d()
+{
+
+}
+
+void bumblebee_read_extra()
+{
+
+}
+
+void vehicle_bumblebee_assemble()
+{
+
+}
+#endif //CSQC
diff --git a/qcsrc/server/attic/vehicles/collision.qc b/qcsrc/server/attic/vehicles/collision.qc
new file mode 100644 (file)
index 0000000..11488a0
--- /dev/null
@@ -0,0 +1,55 @@
+vector collision_force;
+vector collision_angle;
+
+vector bb1[9];
+vector bb2[9];
+
+float collision_run()
+{
+    vector vtmp, vmin, vmax, vrot, vforce, vtmp2, vtmp3;
+    float i, fvel, bcol;
+
+
+    // Extract the 8 bbox corners from mins/maxs for self
+    vmax = self.maxs;
+    vmin = self.mins;
+    bb1[0] = vmax;
+    vtmp   = vmax; vtmp_x = vmin_x; bb1[1] = vtmp;
+    vtmp   = vmax; vtmp_y = vmin_y; bb1[2] = vtmp;
+    vtmp   = vmin; vtmp_z = vmax_z; bb1[3] = vtmp;
+    bb1[4] = vmin;
+    vtmp   = vmin; vtmp_x = vmax_x; bb1[5] = vtmp;
+    vtmp   = vmin; vtmp_y = vmax_y; bb1[6] = vtmp;
+    vtmp   = vmax; vtmp_z = vmin_z; bb1[7] = vtmp;
+
+    makevectors(self.angles + '-2 0 0' * self.angles_x);
+    bcol = 0;
+
+    // Pass1: Transform by rotation, ajust points by impact/s
+    for(i = 8; i >= 0; --i)
+    {
+        vtmp = bb1[i];
+        vtmp = self.origin + vtmp_x * v_forward - vtmp_y * v_right + vtmp_z * v_up;
+        traceline(self.origin, vtmp, MOVE_WORLDONLY, self);
+        te_lightning1(world,self.origin,vtmp);
+        if(trace_fraction != 1.0)
+        {
+            vforce += (trace_endpos - vtmp);
+            vtmp3 = self.origin + self.velocity * frametime;
+            vtmp2 =  vectoangles(normalize(vtmp - vtmp3));
+            vrot   += (vectoangles(normalize(trace_endpos - vtmp3)) - vtmp2);
+            bcol += 1;
+        }
+    }
+
+    if(bcol)
+    {
+
+        vtmp = self.origin + self.velocity * frametime;
+        self.angles += vrot * frametime;
+        self.velocity += vforce * frametime;
+
+    }
+
+}
+
diff --git a/qcsrc/server/attic/vehicles/network.qc b/qcsrc/server/attic/vehicles/network.qc
new file mode 100644 (file)
index 0000000..688aa7c
--- /dev/null
@@ -0,0 +1,237 @@
+#ifdef VEHICLES_CSQC
+// SendFlags
+float VSF_SETUP       = 1;          /// Send vehicle type etc
+float VSF_ORIGIN      = 2;          /// Send location
+float VSF_MOVEMENT    = 4;          /// Send movement update (and angles)
+float VSF_AVEL        = 8;          /// Send Angular velocity
+float VSF_STATS       = 16;         /// Send ammo, health etc
+float VSF_EXTRA       = 32;         /// Send additional data (turret rotations etc). Handeld per vehicle type.
+float VSF_ANIMINFO    = 64;         /// Animation info
+float VSF_FULL_UPDATE = 16777215;    /// Send everything
+
+float VSX_FAR   = 1;
+float VSX_OWNER = 2;
+float VSX_GUN1  = 4;
+float VSX_GUN2  = 8;
+
+#ifdef SVQC
+#define VSX_FARDISTANCE 2000
+float send_vehile(entity to, float sf)
+{
+       float dist, xf;
+
+    var void WriteFunc(float, float);
+
+    dist = vlen(self.origin - to.origin);
+    if(to == self.owner)
+        xf |= VSX_OWNER;
+    else if(dist > VSX_FARDISTANCE)
+        xf |= VSX_FAR;
+
+       // Always send a movement and origin to owner
+       if(to == self.owner)
+           sf |= VSF_ORIGIN | VSF_MOVEMENT;
+
+       WriteByte(MSG_ENTITY, ENT_CLIENT_VEHICLE);
+
+       // We need to know client-side what was sent
+       WriteByte(MSG_ENTITY, sf);
+       WriteByte(MSG_ENTITY, xf);
+
+       if(sf & VSF_SETUP)
+       {
+        WriteByte(MSG_ENTITY,  self.hud);        //vehicle type = hud
+        WriteByte(MSG_ENTITY,  self.team);
+        WriteShort(MSG_ENTITY, self.colormap);
+        WriteShort(MSG_ENTITY, self.vehicle_flags);
+       }
+
+    if(sf & VSF_ORIGIN)
+    {
+        WriteFunc = ((xf & VSX_FAR) ? WriteShort : WriteCoord);
+        WriteFunc(MSG_ENTITY, self.origin_x);
+        WriteFunc(MSG_ENTITY, self.origin_y);
+        WriteFunc(MSG_ENTITY, self.origin_z);
+    }
+
+    if(sf & VSF_MOVEMENT)
+    {
+        WriteFunc = ((xf & VSX_FAR) ? WriteShort : WriteCoord);
+        WriteFunc(MSG_ENTITY, self.velocity_x);
+        WriteFunc(MSG_ENTITY, self.velocity_y);
+        WriteFunc(MSG_ENTITY, self.velocity_z);
+
+        WriteFunc = ((xf & VSX_FAR) ? WriteShort : WriteAngle);
+        WriteFunc(MSG_ENTITY, self.angles_x);
+        WriteFunc(MSG_ENTITY, self.angles_y);
+        WriteFunc(MSG_ENTITY, self.angles_z);
+    }
+
+    if(sf & VSF_AVEL)
+    {
+        WriteFunc = ((xf & VSX_FAR) ? WriteShort : WriteCoord);
+        WriteFunc(MSG_ENTITY, self.avelocity_x);
+        WriteFunc(MSG_ENTITY, self.avelocity_y);
+        WriteFunc(MSG_ENTITY, self.avelocity_z);
+    }
+
+    if(sf & VSF_STATS)
+    {
+        WriteByte(MSG_ENTITY, self.vehicle_health);
+        if(xf & VSX_OWNER)
+        {
+            WriteByte(MSG_ENTITY, self.vehicle_shield);
+            WriteByte(MSG_ENTITY, self.vehicle_energy);
+
+            WriteByte(MSG_ENTITY, self.vehicle_ammo1);
+            WriteByte(MSG_ENTITY, self.vehicle_reload1);
+
+            WriteByte(MSG_ENTITY, self.vehicle_ammo2);
+            WriteByte(MSG_ENTITY, self.vehicle_reload2);
+
+        }
+    }
+
+    if(sf & VSF_EXTRA)
+        self.vehile_send_exta(to, sf);
+
+    return TRUE;
+}
+
+void net_link_vehile()
+{
+    self.SendFlags = 0xFFFFFF;
+    Net_LinkEntity(self, FALSE, 0, send_vehile);
+}
+#endif // SVQC
+
+#ifdef CSQC
+void vehicle_spiderbot_assemble()
+{
+
+}
+
+void vehicle_raptor_assemble()
+{
+
+}
+
+void vehicle_bumblebee_assemble()
+{
+
+}
+
+.float lastupdate;
+void read_vehicle(float bIsNew)
+{
+    float sf, xf;
+    var float ReadFunc();
+
+    sf = ReadByte();
+    xf = ReadByte();
+
+    if(xf & VSX_OWNER)
+        vehicle = self;
+
+       if(sf & VSF_SETUP)
+       {
+        self.vehicle_hud   = ReadByte();
+        self.team          = ReadByte();
+        self.colormap      = ReadShort();
+        self.vehicle_flags = ReadShort();
+
+        switch(self.vehicle_hud)
+        {
+            case HUD_WAKIZASHI:
+                vehicle_racer_assemble();
+                break;
+            case HUD_SPIDERBOT:
+                vehicle_spiderbot_assemble();
+                break;
+            case HUD_RAPTOR:
+                vehicle_raptor_assemble();
+                break;
+            case HUD_BUMBLEBEE:
+                vehicle_bumblebee_assemble();
+                break;
+            default:
+                break;
+        }
+       }
+
+       if(self.vehicle_hud == HUD_WAKIZASHI && xf & VSX_OWNER)
+       {
+
+        vehicle_hudmodel.owner  = self;
+       }
+
+    //if(xf & VSX_FAR)
+    //    dprint("Client vehicle faaar set\n");
+
+    if(sf & VSF_ORIGIN)
+    {
+        ReadFunc = ((xf & VSX_FAR) ? ReadShort : ReadCoord);
+        self.origin_x = ReadFunc();
+        self.origin_y = ReadFunc();
+        self.origin_z = ReadFunc();
+
+        setorigin(self, self.origin);
+        //self.lastupdate = time;
+    }
+
+    if(sf & VSF_MOVEMENT)
+    {
+        ReadFunc = ((xf & VSX_FAR) ? ReadShort : ReadCoord);
+        self.velocity_x  = ReadFunc();
+        self.velocity_y  = ReadFunc();
+        self.velocity_z  = ReadFunc();
+
+        ReadFunc = ((sf & VSX_FAR) ? ReadShort : ReadAngle);
+        self.angles_x = ReadFunc();
+        self.angles_y = ReadFunc();
+        self.angles_z = ReadFunc();
+
+        //self.lastupdate = time;
+        // self.move_velocity  = self.velocity;
+        // self.move_angles    = self.angles;
+    }
+
+    if(sf & VSF_AVEL)
+    {
+        ReadFunc = ((xf & VSX_FAR) ? ReadShort : ReadCoord);
+        self.avelocity_x = ReadFunc();
+        self.avelocity_y = ReadFunc();
+        self.avelocity_z = ReadFunc();
+
+        // self.move_avelocity  = self.avelocity;
+    }
+
+    if(sf & VSF_STATS)
+    {
+        self.vehicle_health = ReadByte();
+        if(xf & VSX_OWNER)
+        {
+            self.vehicle_shield  = ReadByte();
+            self.vehicle_energy  = ReadByte();
+            self.vehicle_ammo1   = ReadByte();
+            self.vehicle_reload1 = ReadByte();
+            self.vehicle_ammo2   = ReadByte();
+            self.vehicle_reload2 = ReadByte();
+        }
+    }
+
+    if(sf & VSF_EXTRA)
+        self.vehile_read_exta(sf);
+
+}
+
+#endif // CSQC
+#else
+#ifdef CSQC
+.float lastupdate;
+void read_vehicle(float bIsNew)
+{
+
+}
+#endif
+#endif // VEHICLES_CSQC
diff --git a/qcsrc/server/attic/verbstack.qc b/qcsrc/server/attic/verbstack.qc
new file mode 100644 (file)
index 0000000..b0601af
--- /dev/null
@@ -0,0 +1,274 @@
+/// Some default stacks.
+.entity verbs_idle;
+.entity verbs_attack;
+.entity verbs_move;
+//.entity vchain;
+
+/// This global gets set to the verb in question each time the stack manager calls verb_call
+entity verb;
+//.entity current_verb;
+//.float verb_done;
+
+/// Execure this verb
+#define VCM_DO     0
+/// Return the value of this verb. Return VS_CALL_REMOVE to delete it.
+#define VCM_EVAL   1
+/// This verb is beeing removed NOW (not sent when verb_call returns VS_CALL_REMOVE)
+#define VCM_REMOVE 2
+
+/// Verb callback
+.float(float message) verb_call;
+
+/// Points to this verb's stack.
+.entity  verbstack;
+
+/// Static value of this verb
+.float verb_static_value;
+
+/// verb_call returns this when a verb in not doable
+#define VS_CALL_NO        0
+/// verb_call(VCM_DO) returns this when a verb is executing
+#define VS_CALL_YES_DOING -1
+/// verb_call(VCM_DO) returns this when a verb did execure and is done
+#define VS_CALL_YES_DONE  -2
+/// verb_call(VCM_DO) returns this when a verb should be deleted by the stack manager
+#define VS_CALL_REMOVE    -3
+
+/*
+void verbstack_updatechain(entity stack)
+{
+    entity vrb, v;
+    if not (stack)
+        return;
+
+    dprint("verbstack_updatechain\n");
+
+    vrb = findchainentity(verbstack, stack);
+    if not (vrb)
+    {
+        stack.vchain = world;
+        return;
+    }
+
+    stack.vchain = vrb;
+    v = vrb;
+
+    while(vrb)
+    {
+        vrb = vrb.chain;
+
+
+    }
+}
+
+void verbstack_remove(entity vverb)
+{
+    entity vstack;
+    dprint("verbstack_remove\n");
+
+    vstack = verb.verbstack;
+    remove(vverb);
+    vverb.verbstack = world;
+    verbstack_updatechain(vstack);
+
+    //vverb.think = SUB_Remove;
+    //vverb.nextthink = time;
+}
+
+void verbstack_thinkremove()
+{
+    dprint("verbstack_thinkremove\n");
+    verbstack_remove(self);
+}
+*/
+
+/**
+    Push a new verb onto the specified stack. Set vrb_life to make it time-limited.
+**/
+entity verbstack_push(entity stack, float(float eval) vrb_call, float val_static, float vrb_life,entity verb_owner)
+{
+    entity vrb;
+
+    if not(stack)
+        return world;
+
+    if not(vrb_call)
+        return world;
+
+    vrb                   = spawn();
+    vrb.owner             = verb_owner;
+    vrb.verbstack         = stack;
+    vrb.verb_call         = vrb_call;
+    vrb.verb_static_value = val_static;
+
+    vrb.classname         = "verb";
+    stack.classname       = "verbstack";
+
+    if(vrb_life)
+    {
+        //vrb.think     = verbstack_thinkremove;
+        vrb.think     = SUB_Remove;
+        vrb.nextthink = time + vrb_life;
+    }
+
+    //verbstack_updatechain(stack);
+
+    return vrb;
+}
+
+/**
+    Find the best verb in this stack and execurte it.
+    ALso remove any verbs returning VS_CALL_REMOVE on VCM_EVAL or VCM_DO
+**/
+float verbstack_pop(entity stack)
+{
+    entity vrb, bestverb, oldself;
+    float  value, bestvalue;
+
+    oldself = self;
+
+    vrb = findchainentity(verbstack,stack);
+    //vrb = stack.vchain;
+    //dprint("owner:", stack.owner.classname, " vsn:", stack.classname,"\n");
+    while(vrb)
+    {
+        //dprint("vn:", vrb.classname,"\n");
+        verb  = vrb;
+        vrb   = vrb.chain;
+        self  = verb.owner;
+        value = verb.verb_call(VCM_EVAL);
+
+        if(value < 0)
+        {
+            if(value == VS_CALL_REMOVE)
+                remove(verb);
+        }
+        else
+        {
+            if(value > bestvalue)
+            {
+                bestverb  = verb;
+                bestvalue = value;
+            }
+        }
+    }
+
+    if(bestverb)
+    {
+        verb  = bestverb;
+        self  = verb.owner;
+        value = verb.verb_call(VCM_DO);
+
+        if(value == VS_CALL_REMOVE)
+            remove(bestverb);
+    }
+
+    self = oldself;
+
+    return value;
+}
+
+float verbstack_popfifo(entity stack)
+{
+    entity oldself;
+    float ret;
+
+    oldself = self;
+    verb = findentity(stack,verbstack,stack);
+    if not (verb)
+        ret = 0;
+    else
+    {
+        self = verb.owner;
+        ret = verb.verb_call(VCM_DO);
+
+        if(ret == VS_CALL_REMOVE)
+            remove(verb);
+    }
+
+    self = oldself;
+    return ret;
+}
+
+/**
+    Find the best verb in this stack and return it.
+    ALso remove any verbs returning VS_CALL_REMOVE on VCM_EVAL.
+**/
+entity verbstack_pull(entity stack)
+{
+    entity vrb;
+    entity bestverb, oldself;
+    float  value, bestvalue;
+
+    oldself = self;
+
+    vrb = findchainentity(verbstack,stack);
+    while(vrb)
+    {
+        self = vrb.owner;
+
+        verb  = vrb;
+        vrb   = vrb.chain;
+        value = verb.verb_call(VCM_EVAL);
+
+        if(value < 0)
+        {
+            if(value == VS_CALL_REMOVE)
+                remove(verb);
+        }
+        else
+        {
+            if(value > bestvalue)
+            {
+                bestverb = verb;
+                bestvalue = value;
+            }
+        }
+    }
+
+    self = oldself;
+
+    return bestverb;
+}
+
+entity verbstack_pullfifo(entity stack)
+{
+    return findentity(stack,verbstack,stack);
+}
+
+/**
+    Delete every verb on this stack, signaling them with VCM_REMOVE first.
+**/
+void verbstack_flush(entity stack)
+{
+    entity vrb, oldself;
+
+    oldself = self;
+
+    vrb = findchainentity(verbstack,stack);
+    while(vrb)
+    {
+        self = vrb.owner;
+
+        verb = vrb;
+        vrb  = vrb.chain;
+        verb.verb_call(VCM_REMOVE);
+        remove(verb);
+    }
+
+    self = oldself;
+
+    //stack.vchain = world;
+}
+
+void verbstack_doverb(entity vrb)
+{
+    float value;
+
+    verb  = vrb;
+    self  = verb.owner;
+    value = verb.verb_call(VCM_DO);
+
+    if(value == VS_CALL_REMOVE)
+        remove(vrb);
+}
index c91bfa640907599c0bdedc0f6fcd4132273e7702..0187f44e60cc26f3c4d05b2e1d20f10339d8d448 100644 (file)
@@ -120,6 +120,12 @@ float autocvar_g_balance_rifle_secondary_tracer;
 float autocvar_g_balance_rifle_reload_ammo;
 float autocvar_g_balance_rifle_reload_time;
 float autocvar_g_balance_cloaked_alpha;
+float autocvar_g_balance_contents_damagerate;
+float autocvar_g_balance_contents_drowndelay;
+float autocvar_g_balance_contents_playerdamage_drowning;
+float autocvar_g_balance_contents_playerdamage_lava;
+float autocvar_g_balance_contents_playerdamage_slime;
+float autocvar_g_balance_contents_projectiledamage;
 float autocvar_g_balance_crylink_primary_ammo;
 float autocvar_g_balance_crylink_primary_animtime;
 float autocvar_g_balance_crylink_primary_bouncedamagefactor;
@@ -215,6 +221,7 @@ float autocvar_g_balance_electro_secondary_bouncestop;
 float autocvar_g_balance_electro_secondary_count;
 float autocvar_g_balance_electro_secondary_damage;
 float autocvar_g_balance_electro_secondary_damageforcescale;
+float autocvar_g_balance_electro_secondary_damagedbycontents;
 float autocvar_g_balance_electro_secondary_edgedamage;
 float autocvar_g_balance_electro_secondary_force;
 float autocvar_g_balance_electro_secondary_health;
@@ -280,6 +287,7 @@ float autocvar_g_balance_grapplehook_length_min;
 float autocvar_g_balance_grapplehook_speed_fly;
 float autocvar_g_balance_grapplehook_speed_pull;
 float autocvar_g_balance_grapplehook_stretch;
+float autocvar_g_balance_grapplehook_damagedbycontents;
 float autocvar_g_balance_grenadelauncher_bouncefactor;
 float autocvar_g_balance_grenadelauncher_bouncestop;
 float autocvar_g_balance_grenadelauncher_primary_ammo;
@@ -318,6 +326,8 @@ float autocvar_g_balance_hagar_primary_ammo;
 float autocvar_g_balance_hagar_primary_damage;
 float autocvar_g_balance_hagar_primary_edgedamage;
 float autocvar_g_balance_hagar_primary_force;
+float autocvar_g_balance_hagar_primary_health;
+float autocvar_g_balance_hagar_primary_damageforcescale;
 float autocvar_g_balance_hagar_primary_lifetime;
 float autocvar_g_balance_hagar_primary_radius;
 float autocvar_g_balance_hagar_primary_refire;
@@ -331,10 +341,14 @@ float autocvar_g_balance_hagar_secondary_load_max;
 float autocvar_g_balance_hagar_secondary_load_hold;
 float autocvar_g_balance_hagar_secondary_load_releasedeath;
 float autocvar_g_balance_hagar_secondary_load_abort;
+float autocvar_g_balance_hagar_secondary_load_linkexplode;
+float autocvar_g_balance_hagar_secondary_load_animtime;
 float autocvar_g_balance_hagar_secondary_ammo;
 float autocvar_g_balance_hagar_secondary_damage;
 float autocvar_g_balance_hagar_secondary_edgedamage;
 float autocvar_g_balance_hagar_secondary_force;
+float autocvar_g_balance_hagar_secondary_health;
+float autocvar_g_balance_hagar_secondary_damageforcescale;
 float autocvar_g_balance_hagar_secondary_lifetime_min;
 float autocvar_g_balance_hagar_secondary_lifetime_rand;
 float autocvar_g_balance_hagar_secondary_radius;
@@ -397,6 +411,8 @@ float autocvar_g_balance_hook_secondary_power;
 float autocvar_g_balance_hook_secondary_radius;
 float autocvar_g_balance_hook_secondary_refire;
 float autocvar_g_balance_hook_secondary_speed;
+float autocvar_g_balance_hook_secondary_health;
+float autocvar_g_balance_hook_secondary_damageforcescale;
 float autocvar_g_balance_keyhunt_damageforcescale;
 float autocvar_g_balance_keyhunt_delay_collect;
 float autocvar_g_balance_keyhunt_delay_return;
@@ -655,9 +671,13 @@ float autocvar_g_balance_shotgun_secondary_damage;
 float autocvar_g_balance_shotgun_secondary_force;
 float autocvar_g_balance_shotgun_secondary_melee_delay;
 float autocvar_g_balance_shotgun_secondary_melee_range;
-float autocvar_g_balance_shotgun_secondary_melee_swing;
+float autocvar_g_balance_shotgun_secondary_melee_swing_side;
+float autocvar_g_balance_shotgun_secondary_melee_swing_up;
 float autocvar_g_balance_shotgun_secondary_melee_time;
+float autocvar_g_balance_shotgun_secondary_melee_traces;
 float autocvar_g_balance_shotgun_secondary_melee_no_doubleslap;
+float autocvar_g_balance_shotgun_secondary_melee_nonplayerdamage;
+float autocvar_g_balance_shotgun_secondary_melee_multihit;
 float autocvar_g_balance_shotgun_secondary_refire;
 float autocvar_g_balance_shotgun_reload_ammo;
 float autocvar_g_balance_shotgun_reload_time;
@@ -857,24 +877,7 @@ float autocvar_g_minstagib_extralives;
 float autocvar_g_minstagib_speed_highspeed;
 #define autocvar_g_mirrordamage cvar("g_mirrordamage")
 #define autocvar_g_mirrordamage_virtual cvar("g_mirrordamage_virtual")
-float autocvar_g_monster_zombie_attack_run_damage;
-float autocvar_g_monster_zombie_attack_run_delay;
-float autocvar_g_monster_zombie_attack_run_force;
-float autocvar_g_monster_zombie_attack_run_hitrange;
-float autocvar_g_monster_zombie_attack_run_range;
-float autocvar_g_monster_zombie_attack_stand_damage;
-float autocvar_g_monster_zombie_attack_stand_delay;
-float autocvar_g_monster_zombie_attack_stand_force;
-float autocvar_g_monster_zombie_attack_stand_range;
-float autocvar_g_monster_zombie_health;
-float autocvar_g_monster_zombie_idle_timer_max;
-float autocvar_g_monster_zombie_idle_timer_min;
-float autocvar_g_monster_zombie_movespeed;
-float autocvar_g_monster_zombie_respawntime;
-float autocvar_g_monster_zombie_stopspeed;
-float autocvar_g_monster_zombie_targetrange;
-float autocvar_g_monster_zombie_turnspeed;
-float autocvar_g_monsters;
+
 var float autocvar_g_movement_highspeed = 1;
 float autocvar_g_multijump;
 float autocvar_g_multijump_add;
@@ -925,6 +928,7 @@ float autocvar_g_playerstats_debug;
 float autocvar_g_powerup_shield;
 float autocvar_g_powerup_strength;
 float autocvar_g_powerup_superhealth;
+float autocvar_g_projectiles_damage;
 float autocvar_g_projectiles_newton_style;
 float autocvar_g_projectiles_newton_style_2_maxfactor;
 float autocvar_g_projectiles_newton_style_2_minfactor;
@@ -1024,9 +1028,6 @@ float autocvar_g_turrets_unit_walker_turn_swim;
 float autocvar_g_use_ammunition;
 float autocvar_g_waypointeditor;
 float autocvar_g_waypoints_for_items;
-float autocvar_g_waypointsprite_deadlifetime;
-float autocvar_g_waypointsprite_deployed_lifetime;
-float autocvar_g_waypointsprite_limitedrange;
 float autocvar_g_weapon_charge_colormod_blue_full;
 float autocvar_g_weapon_charge_colormod_blue_half;
 float autocvar_g_weapon_charge_colormod_green_full;
@@ -1134,10 +1135,10 @@ string autocvar_sv_player_headsize;
 string autocvar_sv_player_maxs;
 string autocvar_sv_player_mins;
 string autocvar_sv_player_viewoffset;
+float autocvar_sv_player_jumpanim_minfall;
 float autocvar_sv_precacheplayermodels;
 float autocvar_sv_precacheweapons;
 float autocvar_sv_q3acompat_machineshotgunswap;
-float autocvar_sv_qcweaponanimation;
 float autocvar_sv_ready_restart;
 float autocvar_sv_ready_restart_after_countdown;
 float autocvar_sv_ready_restart_repeatable;
@@ -1174,6 +1175,9 @@ float autocvar_sv_warsowbunny_airforwardaccel;
 float autocvar_sv_warsowbunny_backtosideratio;
 float autocvar_sv_warsowbunny_topspeed;
 float autocvar_sv_warsowbunny_turnaccel;
+float autocvar_sv_waypointsprite_deadlifetime;
+float autocvar_sv_waypointsprite_deployed_lifetime;
+float autocvar_sv_waypointsprite_limitedrange;
 string autocvar_sv_weaponstats_file;
 float autocvar_sv_gibhealth;
 float autocvar_sys_ticrate;
index b678bf1b660de2a9920d29ebc5e8af7a2ef554ab..3bff21ecf00a4801bd083ba12315087312f28931 100644 (file)
@@ -6,8 +6,8 @@ entity ka_ball;
 
 float findtrajectorywithleading(vector org, vector m1, vector m2, entity targ, float shotspeed, float shotspeedupward, float maxtime, float shotdelay, entity ignore)
 {
-       local float c, savesolid, shottime;
-       local vector dir, end, v, o;
+       float c, savesolid, shottime;
+       vector dir, end, v, o;
        if (shotspeed < 1)
                return FALSE; // could cause division by zero if calculated
        if (targ.solid < SOLID_BBOX) // SOLID_NOT and SOLID_TRIGGER
@@ -78,7 +78,7 @@ float findtrajectorywithleading(vector org, vector m1, vector m2, entity targ, f
        // leave a valid one even if it won't reach
        findtrajectory_velocity = normalize(end - org) * shotspeed + shotspeedupward * '0 0 1';
        return FALSE;
-};
+}
 
 void lag_update()
 {
@@ -87,7 +87,7 @@ void lag_update()
        if (self.lag3_time) if (time > self.lag3_time) {self.lag_func(self.lag3_time, self.lag3_float1, self.lag3_float2, self.lag3_entity1, self.lag3_vec1, self.lag3_vec2, self.lag3_vec3, self.lag3_vec4);self.lag3_time = 0;}
        if (self.lag4_time) if (time > self.lag4_time) {self.lag_func(self.lag4_time, self.lag4_float1, self.lag4_float2, self.lag4_entity1, self.lag4_vec1, self.lag4_vec2, self.lag4_vec3, self.lag4_vec4);self.lag4_time = 0;}
        if (self.lag5_time) if (time > self.lag5_time) {self.lag_func(self.lag5_time, self.lag5_float1, self.lag5_float2, self.lag5_entity1, self.lag5_vec1, self.lag5_vec2, self.lag5_vec3, self.lag5_vec4);self.lag5_time = 0;}
-};
+}
 
 float lag_additem(float t, float f1, float f2, entity e1, vector v1, vector v2, vector v3, vector v4)
 {
@@ -98,7 +98,7 @@ float lag_additem(float t, float f1, float f2, entity e1, vector v1, vector v2,
        if (self.lag5_time == 0) {self.lag5_time = t;self.lag5_float1 = f1;self.lag5_float2 = f2;self.lag5_entity1 = e1;self.lag5_vec1 = v1;self.lag5_vec2 = v2;self.lag5_vec3 = v3;self.lag5_vec4 = v4;return TRUE;}
        // no room for it (what is the best thing to do here??)
        return FALSE;
-};
+}
 
 float bot_shouldattack(entity e)
 {
@@ -142,7 +142,7 @@ float bot_shouldattack(entity e)
        if(e.flags & FL_NOTARGET)
                return FALSE;
        return TRUE;
-};
+}
 
 void bot_lagfunc(float t, float f1, float f2, entity e1, vector v1, vector v2, vector v3, vector v4)
 {
@@ -165,12 +165,12 @@ void bot_lagfunc(float t, float f1, float f2, entity e1, vector v1, vector v2, v
                self.bot_canfire = (random() < 0.95);
        else
                self.bot_canfire = 1;
-};
+}
 
 float bot_aimdir(vector v, float maxfiredeviation)
 {
-       local float dist, delta_t, blend;
-       local vector desiredang, diffang;
+       float dist, delta_t, blend;
+       vector desiredang, diffang;
 
        //dprint("aim ", self.netname, ": old:", vtos(self.v_angle));
        // make sure v_angle is sane first
@@ -271,7 +271,7 @@ float bot_aimdir(vector v, float maxfiredeviation)
        //diffang = diffang + randomvec() * (dist * 0.05 * (3.5 - bound(0, skill, 3)));
 
        // turn
-       local float r, fixedrate, blendrate;
+       float r, fixedrate, blendrate;
        fixedrate = autocvar_bot_ai_aimskill_fixedrate / bound(1,dist,1000);
        blendrate = autocvar_bot_ai_aimskill_blendrate;
        r = max(fixedrate, blendrate);
@@ -310,18 +310,18 @@ float bot_aimdir(vector v, float maxfiredeviation)
        //dprint(" diff:", vtos(diffang), "\n");
 
        return self.bot_canfire && (time < self.bot_firetimer);
-};
+}
 
 vector bot_shotlead(vector targorigin, vector targvelocity, float shotspeed, float shotdelay)
 {
        // Try to add code here that predicts gravity effect here, no clue HOW to though ... well not yet atleast...
        return targorigin + targvelocity * (shotdelay + vlen(targorigin - shotorg) / shotspeed);
-};
+}
 
 float bot_aim(float shotspeed, float shotspeedupward, float maxshottime, float applygravity)
 {
-       local float f, r, hf, distanceratio;
-       local vector v;
+       float f, r, hf, distanceratio;
+       vector v;
        /*
        eprint(self);
        dprint("bot_aim(", ftos(shotspeed));
@@ -387,4 +387,4 @@ float bot_aim(float shotspeed, float shotspeedupward, float maxshottime, float a
        //      return FALSE;
        self.dphitcontentsmask = hf;
        return TRUE;
-};
+}
index 351625bb555cef6c001bd02508161691158a9051..7bb507579a529f618e8a8c3ea45c38c17eba1291 100644 (file)
@@ -12,7 +12,7 @@
 
 entity bot_spawn()
 {
-       local entity oldself, bot;
+       entity oldself, bot;
        bot = spawnclient();
        if (bot)
        {
@@ -25,7 +25,7 @@ entity bot_spawn()
                self = oldself;
        }
        return bot;
-};
+}
 
 void bot_think()
 {
@@ -103,7 +103,7 @@ void bot_think()
 
        // now call the current bot AI (havocbot for example)
        self.bot_ai();
-};
+}
 
 void bot_setnameandstuff()
 {
@@ -235,11 +235,11 @@ void bot_setnameandstuff()
 
        self.cvar_cl_accuracy_data_share = 1;  // share the bots weapon accuracy data with the world
        self.cvar_cl_accuracy_data_receive = 0;  // don't receive any weapon accuracy data
-};
+}
 
 void bot_custom_weapon_priority_setup()
 {
-       local float tokens, i, c, w;
+       float tokens, i, c, w;
 
        bot_custom_weapon = FALSE;
 
@@ -312,11 +312,11 @@ void bot_custom_weapon_priority_setup()
                bot_weapons_close[c] = -1;
 
        bot_custom_weapon = TRUE;
-};
+}
 
 void bot_endgame()
 {
-       local entity e;
+       entity e;
        //dprint("bot_endgame\n");
        e = bot_list;
        while (e)
@@ -325,12 +325,12 @@ void bot_endgame()
                e = e.nextbot;
        }
        // if dynamic waypoints are ever implemented, save them here
-};
+}
 
 void bot_relinkplayerlist()
 {
-       local entity e;
-       local entity prevbot;
+       entity e;
+       entity prevbot;
        player_count = 0;
        currentbots = 0;
        player_list = e = findchainflags(flags, FL_CLIENT);
@@ -357,7 +357,7 @@ void bot_relinkplayerlist()
        dprint(strcat("relink: ", ftos(currentbots), " bots seen.\n"));
        bot_strategytoken = bot_list;
        bot_strategytoken_taken = TRUE;
-};
+}
 
 void bot_clientdisconnect()
 {
@@ -405,12 +405,12 @@ void bot_clientconnect()
                JoinBestTeam(self, FALSE, TRUE);
 
        havocbot_setupbot();
-};
+}
 
 void bot_removefromlargestteam()
 {
-       local float besttime, bestcount, thiscount;
-       local entity best, head;
+       float besttime, bestcount, thiscount;
+       entity best, head;
        CheckAllowedTeams(world);
        GetTeamCounts(world);
        head = findchainfloat(isbot, TRUE);
@@ -446,12 +446,12 @@ void bot_removefromlargestteam()
        }
        currentbots = currentbots - 1;
        dropclient(best);
-};
+}
 
 void bot_removenewest()
 {
-       local float besttime;
-       local entity best, head;
+       float besttime;
+       entity best, head;
 
        if(teamplay)
        {
@@ -475,7 +475,7 @@ void bot_removenewest()
        }
        currentbots = currentbots - 1;
        dropclient(best);
-};
+}
 
 void autoskill(float factor)
 {
@@ -537,28 +537,10 @@ void bot_calculate_stepheightvec(void)
                // 0.75 factor is for safety to make the jumps easy
 }
 
-void bot_serverframe()
+float bot_fixcount()
 {
-       float realplayers, bots, activerealplayers;
        entity head;
-
-       if (intermission_running)
-               return;
-
-       if (time < 2)
-               return;
-
-       bot_calculate_stepheightvec();
-       bot_navigation_movemode = ((autocvar_bot_navigation_ignoreplayers) ? MOVE_NOMONSTERS : MOVE_NORMAL);
-
-       if(time > autoskill_nextthink)
-       {
-               float a;
-               a = autocvar_skill_auto;
-               if(a)
-                       autoskill(a);
-               autoskill_nextthink = time + 5;
-       }
+       float realplayers, bots, activerealplayers;
 
        activerealplayers = 0;
        realplayers = 0;
@@ -597,8 +579,6 @@ void bot_serverframe()
                bots = 0;
        }
 
-       bot_ignore_bots = autocvar_bot_ignore_bots;
-
        // only add one bot per frame to avoid utter chaos
        if(time > botframe_nextthink)
        {
@@ -608,14 +588,44 @@ void bot_serverframe()
                        if (bot_spawn() == world)
                        {
                                bprint("Can not add bot, server full.\n");
-                               botframe_nextthink = time + 10;
-                               break;
+                               return FALSE;
                        }
                }
                while (currentbots > bots)
                        bot_removenewest();
        }
 
+       return TRUE;
+}
+
+void bot_serverframe()
+{
+       if (intermission_running)
+               return;
+
+       if (time < 2)
+               return;
+
+       bot_calculate_stepheightvec();
+       bot_navigation_movemode = ((autocvar_bot_navigation_ignoreplayers) ? MOVE_NOMONSTERS : MOVE_NORMAL);
+
+       if(time > autoskill_nextthink)
+       {
+               float a;
+               a = autocvar_skill_auto;
+               if(a)
+                       autoskill(a);
+               autoskill_nextthink = time + 5;
+       }
+
+       if(time > botframe_nextthink)
+       {
+               if(!bot_fixcount())
+                       botframe_nextthink = time + 10;
+       }
+
+       bot_ignore_bots = autocvar_bot_ignore_bots;
+
        if(botframe_spawnedwaypoints)
        {
                if(autocvar_waypoint_benchmark)
@@ -633,7 +643,7 @@ void bot_serverframe()
                else
                {
                        // TODO: Make this check cleaner
-                       local entity wp = findchain(classname, "waypoint");
+                       entity wp = findchain(classname, "waypoint");
                        if(time - wp.nextthink > 10)
                                waypoint_save_links();
                }
@@ -662,7 +672,7 @@ void bot_serverframe()
 
                if (botframe_nextdangertime < time)
                {
-                       local float interval;
+                       float interval;
                        interval = autocvar_bot_ai_dangerdetectioninterval;
                        if (botframe_nextdangertime < time - interval * 1.5)
                                botframe_nextdangertime = time;
@@ -680,4 +690,4 @@ void bot_serverframe()
                        bot_custom_weapon_priority_setup();
                bot_cvar_nextthink = time + 5;
        }
-};
+}
index ad9f3d185c57b7c18d50593f622cbf177c063a00..9b7198cef821f83efb36eeabae7e4923ae502989 100644 (file)
@@ -35,8 +35,8 @@ void havocbot_ai()
                if(self.waterlevel==WATERLEVEL_SWIMMING || self.aistatus & AI_STATUS_OUT_WATER)
                {
                        // Look for the closest waypoint out of water
-                       local entity newgoal, head;
-                       local float bestdistance, distance;
+                       entity newgoal, head;
+                       float bestdistance, distance;
 
                        newgoal = world;
                        bestdistance = 10000;
@@ -119,8 +119,8 @@ void havocbot_ai()
                self.aistatus |= AI_STATUS_ROAMING;
                self.aistatus &~= AI_STATUS_ATTACKING;
 
-               local vector now,v,next;//,heading;
-               local float aimdistance,skillblend,distanceblend,blend;
+               vector now,v,next;//,heading;
+               float aimdistance,skillblend,distanceblend,blend;
                next = now = ( (self.goalcurrent.absmin + self.goalcurrent.absmax) * 0.5) - (self.origin + self.view_ofs);
                aimdistance = vlen(now);
                //heading = self.velocity;
@@ -173,12 +173,12 @@ void havocbot_ai()
                        }
                }
        }
-};
+}
 
 void havocbot_keyboard_movement(vector destorg)
 {
-       local vector keyboard;
-       local float blend, maxspeed;
+       vector keyboard;
+       float blend, maxspeed;
        float sk;
 
        sk = skill + self.bot_moveskill;
@@ -196,7 +196,7 @@ void havocbot_keyboard_movement(vector destorg)
                , time);
        keyboard = self.movement * (1.0 / maxspeed);
 
-       local float trigger, trigger1;
+       float trigger, trigger1;
        blend = bound(0,sk*0.1,1);
        trigger = autocvar_bot_ai_keyboard_threshold;
        trigger1 = 0 - trigger;
@@ -248,13 +248,13 @@ void havocbot_keyboard_movement(vector destorg)
        blend = bound(0,vlen(destorg-self.origin)/autocvar_bot_ai_keyboard_distance,1); // When getting close move with 360 degree
        //dprint("movement ", vtos(self.movement), " keyboard ", vtos(keyboard), " blend ", ftos(blend), "\n");
        self.movement = self.movement + (keyboard - self.movement) * blend;
-};
+}
 
 void havocbot_bunnyhop(vector dir)
 {
-       local float bunnyhopdistance;
-       local vector deviation;
-       local float maxspeed;
+       float bunnyhopdistance;
+       vector deviation;
+       float maxspeed;
        vector gco, gno;
 
        if(autocvar_g_midair)
@@ -306,7 +306,7 @@ void havocbot_bunnyhop(vector dir)
                                // for a period of time
                                if(time - self.bot_timelastseengoal > autocvar_bot_ai_bunnyhop_firstjumpdelay)
                                {
-                                       local float checkdistance;
+                                       float checkdistance;
                                        checkdistance = TRUE;
 
                                        // don't run if it is too close
@@ -394,23 +394,23 @@ void havocbot_bunnyhop(vector dir)
                }
        }
 #endif
-};
+}
 
 void havocbot_movetogoal()
 {
-       local vector destorg;
-       local vector diff;
-       local vector dir;
-       local vector flatdir;
-       local vector m1;
-       local vector m2;
-       local vector evadeobstacle;
-       local vector evadelava;
-       local float s;
-       local float maxspeed;
-       local vector gco;
-       //local float dist;
-       local vector dodge;
+       vector destorg;
+       vector diff;
+       vector dir;
+       vector flatdir;
+       vector m1;
+       vector m2;
+       vector evadeobstacle;
+       vector evadelava;
+       float s;
+       float maxspeed;
+       vector gco;
+       //float dist;
+       vector dodge;
        //if (self.goalentity)
        //      te_lightning2(self, self.origin, (self.goalentity.absmin + self.goalentity.absmax) * 0.5);
        self.movement = '0 0 0';
@@ -493,8 +493,8 @@ void havocbot_movetogoal()
                {
                        if(fabs(self.velocity_z)<50)
                        {
-                               local entity head, newgoal;
-                               local float distance, bestdistance;
+                               entity head, newgoal;
+                               float distance, bestdistance;
 
                                for (head = findchain(classname, "waypoint"); head; head = head.chain)
                                {
@@ -577,8 +577,8 @@ void havocbot_movetogoal()
                        else
                                dir = normalize(( ( self.goalcurrent.absmin + self.goalcurrent.absmax ) * 0.5 ) - self.origin);
 
-                       local vector xyvelocity = self.velocity; xyvelocity_z = 0;
-                       local float xyspeed = xyvelocity * dir;
+                       vector xyvelocity = self.velocity; xyvelocity_z = 0;
+                       float xyspeed = xyvelocity * dir;
 
                        if(xyspeed < (maxspeed / 2))
                        {
@@ -726,7 +726,7 @@ void havocbot_movetogoal()
                        }
 
                        // avoiding dangers and obstacles
-                       local vector dst_ahead, dst_down;
+                       vector dst_ahead, dst_down;
                        makevectors(self.v_angle_y * '0 1 0');
                        dst_ahead = self.origin + self.view_ofs + (self.velocity * 0.4) + (v_forward * 32 * 3);
                        dst_down = dst_ahead + '0 0 -1500';
@@ -851,13 +851,13 @@ void havocbot_movetogoal()
        if ((dir * v_up) >= autocvar_sv_jumpvelocity*0.5 && (self.flags & FL_ONGROUND)) self.BUTTON_JUMP=1;
        if (((dodge * v_up) > 0) && random()*frametime >= 0.2*bound(0,(10-skill-self.bot_dodgeskill)*0.1,1)) self.BUTTON_JUMP=TRUE;
        if (((dodge * v_up) < 0) && random()*frametime >= 0.5*bound(0,(10-skill-self.bot_dodgeskill)*0.1,1)) self.havocbot_ducktime=time+0.3/bound(0.1,skill+self.bot_dodgeskill,10);
-};
+}
 
 void havocbot_chooseenemy()
 {
-       local entity head, best, head2;
-       local float rating, bestrating, i, hf;
-       local vector eye, v;
+       entity head, best, head2;
+       float rating, bestrating, i, hf;
+       vector eye, v;
        if (autocvar_bot_nofire || IS_INDEPENDENT_PLAYER(self))
        {
                self.enemy = world;
@@ -947,7 +947,7 @@ void havocbot_chooseenemy()
 
        self.enemy = best;
        self.havocbot_stickenemy = TRUE;
-};
+}
 
 float havocbot_chooseweapon_checkreload(float new_weapon)
 {
@@ -960,7 +960,7 @@ float havocbot_chooseweapon_checkreload(float new_weapon)
        // if this weapon is scheduled for reloading, don't switch to it during combat
        if (self.weapon_load[new_weapon] < 0)
        {
-               local float i, other_weapon_available;
+               float i, other_weapon_available;
                for(i = WEP_FIRST; i <= WEP_LAST; ++i)
                {
                        // if we are out of ammo for all other weapons, it's an emergency to switch to anything else
@@ -976,7 +976,7 @@ float havocbot_chooseweapon_checkreload(float new_weapon)
 
 void havocbot_chooseweapon()
 {
-       local float i;
+       float i;
 
        // ;)
        if(g_weaponarena == WEPBIT_TUBA)
@@ -1006,11 +1006,11 @@ void havocbot_chooseweapon()
        if(i < 1)
                return;
 
-       local float w;
-       local float distance; distance=bound(10,vlen(self.origin-self.enemy.origin)-200,10000);
+       float w;
+       float distance; distance=bound(10,vlen(self.origin-self.enemy.origin)-200,10000);
 
        // Should it do a weapon combo?
-       local float af, ct, combo_time, combo;
+       float af, ct, combo_time, combo;
 
        af = ATTACK_FINISHED(self);
        ct = autocvar_bot_ai_weapon_combo_threshold;
@@ -1074,11 +1074,11 @@ void havocbot_chooseweapon()
                        }
                }
        }
-};
+}
 
 void havocbot_aim()
 {
-       local vector selfvel, enemyvel;
+       vector selfvel, enemyvel;
 //     if(self.flags & FL_INWATER)
 //             return;
        if (time < self.nextaim)
@@ -1096,7 +1096,7 @@ void havocbot_aim()
        }
        else
                lag_additem(time + self.ping, 0, 0, world, self.origin, selfvel, ( self.goalcurrent.absmin + self.goalcurrent.absmax ) * 0.5, '0 0 0');
-};
+}
 
 float havocbot_moveto_refresh_route()
 {
@@ -1111,7 +1111,7 @@ float havocbot_moveto_refresh_route()
 
 float havocbot_moveto(vector pos)
 {
-       local entity wp;
+       entity wp;
 
        if(self.aistatus & AI_STATUS_WAYPOINT_PERSONAL_GOING)
        {
@@ -1153,7 +1153,7 @@ float havocbot_moveto(vector pos)
                        debuggoalstack();
 
                // Heading
-               local vector dir = ( ( self.goalcurrent.absmin + self.goalcurrent.absmax ) * 0.5 ) - (self.origin + self.view_ofs);
+               vector dir = ( ( self.goalcurrent.absmin + self.goalcurrent.absmax ) * 0.5 ) - (self.origin + self.view_ofs);
                dir_z = 0;
                bot_aimdir(dir, -1);
 
@@ -1245,9 +1245,9 @@ vector havocbot_dodge()
        // LordHavoc: disabled because this is too expensive
        return '0 0 0';
 #if 0
-       local entity head;
-       local vector dodge, v, n;
-       local float danger, bestdanger, vl, d;
+       entity head;
+       vector dodge, v, n;
+       float danger, bestdanger, vl, d;
        dodge = '0 0 0';
        bestdanger = -20;
        // check for dangerous objects near bot or approaching bot
@@ -1290,4 +1290,4 @@ vector havocbot_dodge()
        }
        return dodge;
 #endif
-};
+}
index 5c0be477cc45ed81c1fd228060093f64af0537a0..4456802d5cd59b2bb003225faaa279e37d6cb977 100644 (file)
@@ -19,8 +19,8 @@ void(float ratingscale, vector org, float sradius) havocbot_goalrating_enemyplay
 
 void havocbot_goalrating_ast_targets(float ratingscale)
 {
-       entity ad, best, pl, wp, tod;
-       float radius, found, bestvalue, c;
+       entity ad, best, wp, tod;
+       float radius, found, bestvalue;
        vector p;
 
        ad = findchain(classname, "func_assault_destructible");
@@ -135,7 +135,7 @@ void havocbot_role_ast_offense()
 
                self.bot_strategytime = time + autocvar_bot_ai_strategyinterval;
        }
-};
+}
 
 void havocbot_role_ast_defense()
 {
@@ -169,7 +169,7 @@ void havocbot_role_ast_defense()
 
                self.bot_strategytime = time + autocvar_bot_ai_strategyinterval;
        }
-};
+}
 
 void havocbot_role_ast_setrole(entity bot, float role)
 {
@@ -186,13 +186,10 @@ void havocbot_role_ast_setrole(entity bot, float role)
                        bot.havocbot_role_timeout = 0;
                        break;
        }
-};
+}
 
 void havocbot_ast_reset_role(entity bot)
 {
-       local entity head;
-       local float c;
-
        if(self.deadflag != DEAD_NO)
                return;
 
@@ -200,9 +197,9 @@ void havocbot_ast_reset_role(entity bot)
                havocbot_role_ast_setrole(bot, HAVOCBOT_AST_ROLE_OFFENSE);
        else
                havocbot_role_ast_setrole(bot, HAVOCBOT_AST_ROLE_DEFENSE);
-};
+}
 
 void havocbot_chooserole_ast()
 {
        havocbot_ast_reset_role(self);
-};
+}
index f85f2ef64c3e8a0c0964d5d344eb6977ef1c300d..74c611ea18ddf6bdfe8f54dc94c3de1c29c59c57 100644 (file)
@@ -40,7 +40,7 @@ entity havocbot_ctf_find_flag(entity bot)
                f = f.ctf_worldflagnext;
        }
        return world;
-};
+}
 
 entity havocbot_ctf_find_enemy_flag(entity bot)
 {
@@ -53,7 +53,7 @@ entity havocbot_ctf_find_enemy_flag(entity bot)
                f = f.ctf_worldflagnext;
        }
        return world;
-};
+}
 
 float havocbot_ctf_teamcount(entity bot, vector org, float radius)
 {
@@ -73,11 +73,11 @@ float havocbot_ctf_teamcount(entity bot, vector org, float radius)
        }
 
        return c;
-};
+}
 
 void havocbot_goalrating_ctf_ourflag(float ratingscale)
 {
-       local entity head;
+       entity head;
        head = ctf_worldflaglist;
        while (head)
        {
@@ -87,11 +87,11 @@ void havocbot_goalrating_ctf_ourflag(float ratingscale)
        }
        if (head)
                navigation_routerating(head, ratingscale, 10000);
-};
+}
 
 void havocbot_goalrating_ctf_ourbase(float ratingscale)
 {
-       local entity head;
+       entity head;
        head = ctf_worldflaglist;
        while (head)
        {
@@ -103,11 +103,11 @@ void havocbot_goalrating_ctf_ourbase(float ratingscale)
                return;
 
        navigation_routerating(head.basewaypoint, ratingscale, 10000);
-};
+}
 
 void havocbot_goalrating_ctf_enemyflag(float ratingscale)
 {
-       local entity head;
+       entity head;
        head = ctf_worldflaglist;
        while (head)
        {
@@ -117,7 +117,7 @@ void havocbot_goalrating_ctf_enemyflag(float ratingscale)
        }
        if (head)
                navigation_routerating(head, ratingscale, 10000);
-};
+}
 
 void havocbot_goalrating_ctf_enemybase(float ratingscale)
 {
@@ -127,7 +127,7 @@ void havocbot_goalrating_ctf_enemybase(float ratingscale)
                return;
        }
 
-       local entity head;
+       entity head;
 
        head = havocbot_ctf_find_enemy_flag(self);
 
@@ -135,11 +135,11 @@ void havocbot_goalrating_ctf_enemybase(float ratingscale)
                return;
 
        navigation_routerating(head.basewaypoint, ratingscale, 10000);
-};
+}
 
 void havocbot_goalrating_ctf_ourstolenflag(float ratingscale)
 {
-       local entity mf;
+       entity mf;
 
        mf = havocbot_ctf_find_flag(self);
 
@@ -148,11 +148,11 @@ void havocbot_goalrating_ctf_ourstolenflag(float ratingscale)
 
        if(mf.tag_entity)
                navigation_routerating(mf.tag_entity, ratingscale, 10000);
-};
+}
 
 void havocbot_goalrating_ctf_droppedflags(float ratingscale, vector org, float radius)
 {
-       local entity head;
+       entity head;
        head = ctf_worldflaglist;
        while (head)
        {
@@ -171,12 +171,12 @@ void havocbot_goalrating_ctf_droppedflags(float ratingscale, vector org, float r
 
                head = head.ctf_worldflagnext;
        }
-};
+}
 
 void havocbot_goalrating_ctf_carrieritems(float ratingscale, vector org, float sradius)
 {
-       local entity head;
-       local float t;
+       entity head;
+       float t;
        head = findchainfloat(bot_pickup, TRUE);
        while (head)
        {
@@ -192,7 +192,7 @@ void havocbot_goalrating_ctf_carrieritems(float ratingscale, vector org, float s
                }
                head = head.chain;
        }
-};
+}
 
 void havocbot_role_ctf_setrole(entity bot, float role)
 {
@@ -237,7 +237,7 @@ void havocbot_role_ctf_setrole(entity bot, float role)
                        break;
        }
        dprint("\n");
-};
+}
 
 void havocbot_role_ctf_carrier()
 {
@@ -275,11 +275,11 @@ void havocbot_role_ctf_carrier()
                        return;
                }
        }
-};
+}
 
 void havocbot_role_ctf_escort()
 {
-       local entity mf, ef;
+       entity mf, ef;
 
        if(self.deadflag != DEAD_NO)
        {
@@ -335,12 +335,12 @@ void havocbot_role_ctf_escort()
                havocbot_goalrating_items(10000, self.origin, 10000);
                navigation_goalrating_end();
        }
-};
+}
 
 void havocbot_role_ctf_offense()
 {
-       local entity mf, ef;
-       local vector pos;
+       entity mf, ef;
+       vector pos;
 
        if(self.deadflag != DEAD_NO)
        {
@@ -416,12 +416,12 @@ void havocbot_role_ctf_offense()
                havocbot_goalrating_items(1000, self.origin, 10000);
                navigation_goalrating_end();
        }
-};
+}
 
 // Retriever (temporary role):
 void havocbot_role_ctf_retriever()
 {
-       local entity mf;
+       entity mf;
 
        if(self.deadflag != DEAD_NO)
        {
@@ -454,7 +454,7 @@ void havocbot_role_ctf_retriever()
 
        if (self.bot_strategytime < time)
        {
-               local float radius;
+               float radius;
                radius = 10000;
 
                self.bot_strategytime = time + autocvar_bot_ai_strategyinterval;
@@ -465,11 +465,11 @@ void havocbot_role_ctf_retriever()
                havocbot_goalrating_items(500, self.origin, radius);
                navigation_goalrating_end();
        }
-};
+}
 
 void havocbot_role_ctf_middle()
 {
-       local entity mf;
+       entity mf;
 
        if(self.deadflag != DEAD_NO)
        {
@@ -501,7 +501,7 @@ void havocbot_role_ctf_middle()
 
        if (self.bot_strategytime < time)
        {
-               local vector org;
+               vector org;
 
                org = havocbot_ctf_middlepoint;
                org_z = self.origin_z;
@@ -516,11 +516,11 @@ void havocbot_role_ctf_middle()
                havocbot_goalrating_ctf_enemybase(2500);
                navigation_goalrating_end();
        }
-};
+}
 
 void havocbot_role_ctf_defense()
 {
-       local entity mf;
+       entity mf;
 
        if(self.deadflag != DEAD_NO)
        {
@@ -552,8 +552,8 @@ void havocbot_role_ctf_defense()
        }
        if (self.bot_strategytime < time)
        {
-               local float radius;
-               local vector org;
+               float radius;
+               vector org;
 
                org = mf.dropped_origin;
                radius = havocbot_ctf_middlepoint_radius;
@@ -562,8 +562,8 @@ void havocbot_role_ctf_defense()
                navigation_goalrating_start();
 
                // if enemies are closer to our base, go there
-               local entity head, closestplayer;
-               local float distance, bestdistance;
+               entity head, closestplayer;
+               float distance, bestdistance;
                distance = 10000;
                FOR_EACH_PLAYER(head)
                {
@@ -591,7 +591,7 @@ void havocbot_role_ctf_defense()
                havocbot_goalrating_items(5000, self.origin, 10000);
                navigation_goalrating_end();
        }
-};
+}
 
 void havocbot_calculate_middlepoint()
 {
@@ -610,13 +610,13 @@ void havocbot_calculate_middlepoint()
        }
        havocbot_ctf_middlepoint = p1 + ((p2-p1) * 0.5);
        havocbot_ctf_middlepoint_radius  = vlen(p2-p1) * 0.5;
-};
+}
 
 void havocbot_ctf_reset_role(entity bot)
 {
-       local float cdefense, cmiddle, coffense;
-       local entity mf, ef, head;
-       local float c;
+       float cdefense, cmiddle, coffense;
+       entity mf, ef, head;
+       float c;
 
        if(bot.deadflag != DEAD_NO)
                return;
@@ -676,9 +676,9 @@ void havocbot_ctf_reset_role(entity bot)
                havocbot_role_ctf_setrole(bot, HAVOCBOT_CTF_ROLE_OFFENSE);
        else
                havocbot_role_ctf_setrole(bot, HAVOCBOT_CTF_ROLE_MIDDLE);
-};
+}
 
 void havocbot_chooserole_ctf()
 {
        havocbot_ctf_reset_role(self);
-};
+}
index c81d7d0f350f48671a168e57248a3cf858be79db..4e5669eb2ecad7642fbd75b4c9f89f458efaf757 100644 (file)
@@ -3,7 +3,7 @@ void() havocbot_role_ft_offense;
 
 void havocbot_goalrating_freeplayers(float ratingscale, vector org, float sradius)
 {
-       local entity head;
+       entity head;
        float distance;
 
        FOR_EACH_PLAYER(head)
@@ -25,11 +25,11 @@ void havocbot_goalrating_freeplayers(float ratingscale, vector org, float sradiu
                        }
                }
        }
-};
+}
 
 void havocbot_role_ft_offense()
 {
-       local entity head;
+       entity head;
        float unfrozen;
 
        if(self.deadflag != DEAD_NO)
@@ -66,7 +66,7 @@ void havocbot_role_ft_offense()
                //havocbot_goalrating_waypoints(1, self.origin, 1000);
                navigation_goalrating_end();
        }
-};
+}
 
 void havocbot_role_ft_freeing()
 {
@@ -95,7 +95,7 @@ void havocbot_role_ft_freeing()
                //havocbot_goalrating_waypoints(1, self.origin, 1000);
                navigation_goalrating_end();
        }
-};
+}
 
 void havocbot_chooserole_ft()
 {
@@ -106,4 +106,4 @@ void havocbot_chooserole_ft()
                self.havocbot_role = havocbot_role_ft_freeing;
        else
                self.havocbot_role = havocbot_role_ft_offense;
-};
+}
index 8ea23f1af02225b0a04a33652f113709e234fe3f..ede6208a16ba677e16068e7648f1e1515e037fc4 100644 (file)
@@ -9,8 +9,8 @@ entity ka_ball;
 
 void havocbot_goalrating_ball(float ratingscale, vector org)
 {
-       local float t;
-       local entity ball_owner;
+       float t;
+       entity ball_owner;
        ball_owner = ka_ball.owner;
 
        if (ball_owner == self)
@@ -25,7 +25,7 @@ void havocbot_goalrating_ball(float ratingscale, vector org)
 
        // Ball has been dropped so collect.
        navigation_routerating(ka_ball, ratingscale, 2000);
-};
+}
 
 void havocbot_role_ka_carrier()
 {
@@ -48,7 +48,7 @@ void havocbot_role_ka_carrier()
                self.havocbot_role = havocbot_role_ka_collector;
                self.bot_strategytime = 0;
        }
-};
+}
 
 void havocbot_role_ka_collector()
 {
@@ -71,7 +71,7 @@ void havocbot_role_ka_collector()
                self.havocbot_role = havocbot_role_ka_carrier;
                self.bot_strategytime = 0;
        }
-};
+}
 
 void havocbot_chooserole_ka()
 {
@@ -79,4 +79,4 @@ void havocbot_chooserole_ka()
                self.havocbot_role = havocbot_role_ka_carrier;
        else
                self.havocbot_role = havocbot_role_ka_collector;
-};
+}
index 8e30b37b5c569ce3f900f9b3e95934a0cef3acd3..3b641d9ce757762c430d03be58e9b4e948dc90ea 100644 (file)
@@ -8,7 +8,7 @@ entity kh_worldkeylist;
 
 void havocbot_goalrating_kh(float ratingscale_team, float ratingscale_dropped, float ratingscale_enemy)
 {
-       local entity head;
+       entity head;
        for (head = kh_worldkeylist; head; head = head.kh_worldkeynext)
        {
                if(head.owner == self)
@@ -33,7 +33,7 @@ void havocbot_goalrating_kh(float ratingscale_team, float ratingscale_dropped, f
        }
 
        havocbot_goalrating_items(1, self.origin, 10000);
-};
+}
 
 void havocbot_role_kh_carrier()
 {
@@ -101,7 +101,7 @@ void havocbot_role_kh_defense()
 
                navigation_goalrating_end();
        }
-};
+}
 
 void havocbot_role_kh_offense()
 {
@@ -143,7 +143,7 @@ void havocbot_role_kh_offense()
 
                navigation_goalrating_end();
        }
-};
+}
 
 void havocbot_role_kh_freelancer()
 {
@@ -193,11 +193,11 @@ void havocbot_role_kh_freelancer()
 
                navigation_goalrating_end();
        }
-};
+}
 
 void havocbot_chooserole_kh()
 {
-       local float r;
+       float r;
 
        if(self.deadflag != DEAD_NO)
                return;
@@ -209,4 +209,4 @@ void havocbot_chooserole_kh()
                self.havocbot_role = havocbot_role_kh_defense;
        else
                self.havocbot_role = havocbot_role_kh_freelancer;
-};
+}
index bc84340287ff8938e5e3b60d80d9073f41443095..3ae7379be757278c00478a55b39854b410027096 100644 (file)
@@ -27,8 +27,8 @@ void(float ratingscale, vector org, float sradius) havocbot_goalrating_enemyplay
 
 void havocbot_goalrating_ons_offenseitems(float ratingscale, vector org, float sradius)
 {
-       local entity head;
-       local float t, i, c, needarmor, needweapons;
+       entity head;
+       float t, i, c, needarmor, needweapons;
 
        // Needs armor/health?
        if(self.health<100)
@@ -67,7 +67,7 @@ void havocbot_goalrating_ons_offenseitems(float ratingscale, vector org, float s
                }
                head = head.chain;
        }
-};
+}
 
 void havocbot_role_ons_setrole(entity bot, float role)
 {
@@ -94,12 +94,12 @@ void havocbot_role_ons_setrole(entity bot, float role)
                        break;
        }
        dprint("\n");
-};
+}
 
 float havocbot_ons_teamcount(entity bot, float role)
 {
-       local float c;
-       local entity head;
+       float c;
+       entity head;
 
        FOR_EACH_PLAYER(head)
        if(head.team==self.team)
@@ -107,7 +107,7 @@ float havocbot_ons_teamcount(entity bot, float role)
                ++c;
 
        return c;
-};
+}
 
 void havocbot_goalrating_ons_controlpoints_attack(float ratingscale)
 {
@@ -231,12 +231,12 @@ void havocbot_goalrating_ons_controlpoints_attack(float ratingscale)
                if not(found)
                        navigation_routerating(cp, ratingscale, 10000);
        }
-};
+}
 
 float havocbot_goalrating_ons_generator_attack(float ratingscale)
 {
-       local entity g, wp, bestwp;
-       local float found, best;
+       entity g, wp, bestwp;
+       float found, best;
 
        for (g = findchain(classname, "onslaught_generator"); g; g = g.chain)
        {
@@ -286,7 +286,7 @@ float havocbot_goalrating_ons_generator_attack(float ratingscale)
                }
        }
        return FALSE;
-};
+}
 
 void havocbot_role_ons_offense()
 {
@@ -321,22 +321,22 @@ void havocbot_role_ons_offense()
 
                self.bot_strategytime = time + autocvar_bot_ai_strategyinterval;
        }
-};
+}
 
 void havocbot_role_ons_assistant()
 {
        havocbot_ons_reset_role(self);
-};
+}
 
 void havocbot_role_ons_defense()
 {
        havocbot_ons_reset_role(self);
-};
+}
 
 void havocbot_ons_reset_role(entity bot)
 {
-       local entity head;
-       local float c;
+       entity head;
+       float c;
 
        if(self.deadflag != DEAD_NO)
                return;
@@ -358,9 +358,9 @@ void havocbot_ons_reset_role(entity bot)
        }
 
        havocbot_role_ons_setrole(bot, HAVOCBOT_ONS_ROLE_OFFENSE);
-};
+}
 
 void havocbot_chooserole_ons()
 {
        havocbot_ons_reset_role(self);
-};
+}
index 93a683a9341cba58301801faabc56598b05187f2..d0c10651b88134d364377b5f8edb641658710ad7 100644 (file)
@@ -7,9 +7,9 @@
 
 void havocbot_goalrating_items(float ratingscale, vector org, float sradius)
 {
-       local entity head;
-       local entity player;
-       local float rating, d, discard, distance, friend_distance, enemy_distance;
+       entity head;
+       entity player;
+       float rating, d, discard, distance, friend_distance, enemy_distance;
        vector o;
        ratingscale = ratingscale * 0.0001; // items are rated around 10000 already
        head = findchainfloat(bot_pickup, TRUE);
@@ -125,11 +125,11 @@ void havocbot_goalrating_items(float ratingscale, vector org, float sradius)
                        navigation_routerating(head, rating * ratingscale, 2000);
                head = head.chain;
        }
-};
+}
 
 void havocbot_goalrating_controlpoints(float ratingscale, vector org, float sradius)
 {
-       local entity head;
+       entity head;
        head = findchain(classname, "dom_controlpoint");
        while (head)
        {
@@ -144,12 +144,12 @@ void havocbot_goalrating_controlpoints(float ratingscale, vector org, float srad
                }
                head = head.chain;
        }
-};
+}
 
 void havocbot_goalrating_enemyplayers(float ratingscale, vector org, float sradius)
 {
-       local entity head;
-       local float t, noteam, distance;
+       entity head;
+       float t, noteam, distance;
        noteam = ((self.team == 0) || !teamplay); // fteqcc sucks
 
        if (autocvar_bot_nofire)
@@ -207,10 +207,10 @@ void havocbot_goalrating_enemyplayers(float ratingscale, vector org, float sradi
                        navigation_routerating(head, t * ratingscale, 2000);
                }
        }
-};
+}
 
 // choose a role according to the situation
-void() havocbot_role_dm;
+void havocbot_role_dm();
 
 //DOM:
 //go to best items, or control points you don't own
@@ -229,7 +229,7 @@ void havocbot_role_dom()
                //havocbot_goalrating_waypoints(1, self.origin, 1000);
                navigation_goalrating_end();
        }
-};
+}
 
 //DM:
 //go to best items
@@ -247,7 +247,7 @@ void havocbot_role_dm()
                //havocbot_goalrating_waypoints(1, self.origin, 1000);
                navigation_goalrating_end();
        }
-};
+}
 
 //Race:
 //go to next checkpoint, and annoy enemies
@@ -281,22 +281,22 @@ void havocbot_role_race()
 
                navigation_goalrating_end();
        }
-};
+}
 
 void havocbot_chooserole_dm()
 {
        self.havocbot_role = havocbot_role_dm;
-};
+}
 
 void havocbot_chooserole_race()
 {
        self.havocbot_role = havocbot_role_race;
-};
+}
 
 void havocbot_chooserole_dom()
 {
        self.havocbot_role = havocbot_role_dom;
-};
+}
 
 void havocbot_chooserole()
 {
@@ -320,4 +320,4 @@ void havocbot_chooserole()
                havocbot_chooserole_ast();
        else // assume anything else is deathmatch
                havocbot_chooserole_dm();
-};
+}
index 636c0d58a0871945da808c91d61a971e4e3fd9bf..6aa6ea2a17f8a32b4f22df6d5c702df0ee591bd6 100644 (file)
@@ -4,15 +4,15 @@
 
 float tracewalk(entity e, vector start, vector m1, vector m2, vector end, float movemode)
 {
-       local vector org;
-       local vector move;
-       local vector dir;
-       local float dist;
-       local float totaldist;
-       local float stepdist;
-       local float yaw;
-       local float ignorehazards;
-       local float swimming;
+       vector org;
+       vector move;
+       vector dir;
+       float dist;
+       float totaldist;
+       float stepdist;
+       float yaw;
+       float ignorehazards;
+       float swimming;
 
        if(autocvar_bot_debug_tracewalk)
        {
@@ -147,7 +147,7 @@ float tracewalk(entity e, vector start, vector m1, vector m2, vector end, float
                                                traceline( org, move, movemode, e);
                                                if ( trace_ent.classname == "door_rotating" || trace_ent.classname == "door")
                                                {
-                                                       local vector nextmove;
+                                                       vector nextmove;
                                                        move = trace_endpos;
                                                        while(trace_ent.classname == "door_rotating" || trace_ent.classname == "door")
                                                        {
@@ -185,7 +185,7 @@ float tracewalk(entity e, vector start, vector m1, vector m2, vector end, float
                        // moved successfully
                        if(swimming)
                        {
-                               local float c;
+                               float c;
                                c = pointcontents(org + '0 0 1');
                                if not(c == CONTENT_WATER || c == CONTENT_LAVA || c == CONTENT_SLIME)
                                        swimming = FALSE;
@@ -204,7 +204,7 @@ float tracewalk(entity e, vector start, vector m1, vector m2, vector end, float
                debugnodestatus(org, DEBUG_NODE_FAIL);
 
        return FALSE;
-};
+}
 
 /////////////////////////////////////////////////////////////////////////////
 // goal stack
@@ -247,7 +247,7 @@ void navigation_clearroute()
        self.goalstack29 = world;
        self.goalstack30 = world;
        self.goalstack31 = world;
-};
+}
 
 // add a new goal at the beginning of the stack
 // (in other words: add a new prerequisite before going to the later goals)
@@ -290,7 +290,7 @@ void navigation_pushroute(entity e)
        self.goalstack02 = self.goalstack01;
        self.goalstack01 = self.goalcurrent;
        self.goalcurrent = e;
-};
+}
 
 // remove first goal from stack
 // (in other words: remove a prerequisite for reaching the later goals)
@@ -330,14 +330,14 @@ void navigation_poproute()
        self.goalstack29 = self.goalstack30;
        self.goalstack30 = self.goalstack31;
        self.goalstack31 = world;
-};
+}
 
 // find the spawnfunc_waypoint near a dynamic goal such as a dropped weapon
 entity navigation_findnearestwaypoint(entity ent, float walkfromwp)
 {
-       local entity waylist, w, best;
-       local float dist, bestdist;
-       local vector v, org, pm1, pm2;
+       entity waylist, w, best;
+       float dist, bestdist;
+       vector v, org, pm1, pm2;
        pm1 = ent.origin + ent.mins;
        pm2 = ent.origin + ent.maxs;
        waylist = findchain(classname, "waypoint");
@@ -373,7 +373,7 @@ entity navigation_findnearestwaypoint(entity ent, float walkfromwp)
                {
                        if (w.wpisbox)
                        {
-                               local vector wm1, wm2;
+                               vector wm1, wm2;
                                wm1 = w.origin + w.mins;
                                wm2 = w.origin + w.maxs;
                                v_x = bound(wm1_x, org_x, wm2_x);
@@ -416,9 +416,9 @@ entity navigation_findnearestwaypoint(entity ent, float walkfromwp)
 // finds the waypoints near the bot initiating a navigation query
 float navigation_markroutes_nearestwaypoints(entity waylist, float maxdist)
 {
-       local entity head;
-       local vector v, m1, m2, diff;
-       local float c;
+       entity head;
+       vector v, m1, m2, diff;
+       float c;
 //     navigation_testtracewalk = TRUE;
        c = 0;
        head = waylist;
@@ -461,9 +461,9 @@ float navigation_markroutes_nearestwaypoints(entity waylist, float maxdist)
 // updates a path link if a spawnfunc_waypoint link is better than the current one
 void navigation_markroutes_checkwaypoint(entity w, entity wp, float cost2, vector p)
 {
-       local vector m1;
-       local vector m2;
-       local vector v;
+       vector m1;
+       vector m2;
+       vector v;
        if (wp.wpisbox)
        {
                m1 = wp.absmin;
@@ -482,14 +482,14 @@ void navigation_markroutes_checkwaypoint(entity w, entity wp, float cost2, vecto
                wp.wpfire = 1;
                wp.wpnearestpoint = v;
        }
-};
+}
 
 // queries the entire spawnfunc_waypoint network for pathes leading away from the bot
 void navigation_markroutes(entity fixed_source_waypoint)
 {
-       local entity w, wp, waylist;
-       local float searching, cost, cost2;
-       local vector p;
+       entity w, wp, waylist;
+       float searching, cost, cost2;
+       vector p;
        w = waylist = findchain(classname, "waypoint");
        while (w)
        {
@@ -513,7 +513,7 @@ void navigation_markroutes(entity fixed_source_waypoint)
        {
                // try a short range search for the nearest waypoints, and expand the search repeatedly if none are found
                // as this search is expensive we will use lower values if the bot is on the air
-               local float i, increment, maxdistance;
+               float i, increment, maxdistance;
                if(self.flags & FL_ONGROUND)
                {
                        increment = 750;
@@ -578,14 +578,14 @@ void navigation_markroutes(entity fixed_source_waypoint)
                        w = w.chain;
                }
        }
-};
+}
 
 // queries the entire spawnfunc_waypoint network for pathes leading to the bot
 void navigation_markroutes_inverted(entity fixed_source_waypoint)
 {
-       local entity w, wp, waylist;
-       local float searching, cost, cost2;
-       local vector p;
+       entity w, wp, waylist;
+       float searching, cost, cost2;
+       vector p;
        w = waylist = findchain(classname, "waypoint");
        while (w)
        {
@@ -641,7 +641,7 @@ void navigation_markroutes_inverted(entity fixed_source_waypoint)
                        w = w.chain;
                }
        }
-};
+}
 
 // updates the best goal according to a weighted calculation of travel cost and item value of a new proposed item
 void navigation_routerating(entity e, float f, float rangebias)
@@ -684,8 +684,8 @@ void navigation_routerating(entity e, float f, float rangebias)
                //      dprint("jetpack ai: can bridge these two points\n");
 
                        // Lower the altitude of these points as much as possible
-                       local float zdistance, xydistance, cost, t, fuel;
-                       local vector down, npa, npb;
+                       float zdistance, xydistance, cost, t, fuel;
+                       vector down, npa, npb;
 
                        down = '0 0 -1' * (PL_MAX_z - PL_MIN_z) * 10;
 
@@ -825,7 +825,7 @@ void navigation_routerating(entity e, float f, float rangebias)
                }
        }
        //dprint("\n");
-};
+}
 
 // adds an item to the the goal stack with the path to a given item
 float navigation_routetogoal(entity e, vector startposition)
@@ -870,13 +870,13 @@ float navigation_routetogoal(entity e, vector startposition)
        }
 
        return FALSE;
-};
+}
 
 // removes any currently touching waypoints from the goal stack
 // (this is how bots detect if they reached a goal)
 void navigation_poptouchedgoals()
 {
-       local vector org, m1, m2;
+       vector org, m1, m2;
        org = self.origin;
        m1 = org + self.mins;
        m2 = org + self.maxs;
@@ -971,7 +971,7 @@ void navigation_goalrating_start()
        navigation_clearroute();
        navigation_bestgoal = world;
        navigation_markroutes(world);
-};
+}
 
 // ends a goal selection session (updates goal stack to the best goal)
 void navigation_goalrating_end()
@@ -994,13 +994,13 @@ void navigation_goalrating_end()
 
                self.navigation_hasgoals = FALSE; // Reset this value
        }
-};
+}
 
 void botframe_updatedangerousobjects(float maxupdate)
 {
-       local entity head, bot_dodgelist;
-       local vector m1, m2, v, o;
-       local float c, d, danger;
+       entity head, bot_dodgelist;
+       vector m1, m2, v, o;
+       float c, d, danger;
        c = 0;
        bot_dodgelist = findchainfloat(bot_dodge, TRUE);
        botframe_dangerwaypoint = find(botframe_dangerwaypoint, classname, "waypoint");
@@ -1032,7 +1032,7 @@ void botframe_updatedangerousobjects(float maxupdate)
                        break;
                botframe_dangerwaypoint = find(botframe_dangerwaypoint, classname, "waypoint");
        }
-};
+}
 
 void navigation_unstuck()
 {
@@ -1176,8 +1176,8 @@ void debugnodestatus(vector position, float status)
 // Debug the goal stack visually
 void debuggoalstack()
 {
-       local entity goal;
-       local vector org, go;
+       entity goal;
+       vector org, go;
 
        if(self.goalcounter==0)goal=self.goalcurrent;
        else if(self.goalcounter==1)goal=self.goalstack01;
index 63151cac1b8e845e4be1e26663984dc24661775a..6b1eba8277d9cc9f8ab7ccc6b65d765ef387137b 100644 (file)
@@ -273,7 +273,7 @@ void bot_commands_init()
 // Returns first bot with matching name
 entity find_bot_by_name(string name)
 {
-       local entity bot;
+       entity bot;
 
        bot = findchainflags(flags, FL_CLIENT);
        while (bot)
@@ -291,8 +291,8 @@ entity find_bot_by_name(string name)
 // Returns a bot by number on list
 entity find_bot_by_number(float number)
 {
-       local entity bot;
-       local float c;
+       entity bot;
+       float c;
 
        if(!number)
                return world;
@@ -313,7 +313,7 @@ entity find_bot_by_number(float number)
 
 float bot_decodecommand(string cmdstring)
 {
-       local float cmd_parm_type, i;
+       float cmd_parm_type, i;
        float sp;
        string parm;
 
@@ -372,8 +372,8 @@ float bot_decodecommand(string cmdstring)
 
 void bot_cmdhelp(string scmd)
 {
-       local float i, ntype;
-       local string stype;
+       float i, ntype;
+       string stype;
 
        if(!bot_cmds_initialized)
                bot_commands_init();
@@ -487,8 +487,8 @@ void bot_cmdhelp(string scmd)
 
 void bot_list_commands()
 {
-       local float i;
-       local string ptype;
+       float i;
+       string ptype;
 
        if(!bot_cmds_initialized)
                bot_commands_init();
@@ -625,7 +625,7 @@ float bot_cmd_turn()
 
 float bot_cmd_select_weapon()
 {
-       local float id;
+       float id;
 
        id = bot_cmd.bot_cmd_parm_float;
 
@@ -679,8 +679,8 @@ float bot_cmd_eval(string expr)
 
 float bot_cmd_if()
 {
-       local string expr, val_a, val_b;
-       local float cmpofs;
+       string expr, val_a, val_b;
+       float cmpofs;
 
        if(self.bot_cmd_condition_status != CMD_CONDITION_NONE)
        {
@@ -777,7 +777,7 @@ float bot_cmd_aim()
        // Current direction
        if(self.bot_cmd_aim_endtime)
        {
-               local float progress;
+               float progress;
 
                progress = min(1 - (self.bot_cmd_aim_endtime - time) / (self.bot_cmd_aim_endtime - self.bot_cmd_aim_begintime),1);
                self.v_angle = self.bot_cmd_aim_begin + ((self.bot_cmd_aim_end - self.bot_cmd_aim_begin) * progress);
@@ -792,8 +792,8 @@ float bot_cmd_aim()
        }
 
        // New aiming direction
-       local string parms;
-       local float tokens, step;
+       string parms;
+       float tokens, step;
 
        parms = bot_cmd.bot_cmd_parm_string;
 
@@ -830,10 +830,10 @@ float bot_cmd_aimtarget()
                return bot_cmd_aim();
        }
 
-       local entity e;
-       local string parms;
-       local vector v;
-       local float tokens, step;
+       entity e;
+       string parms;
+       vector v;
+       float tokens, step;
 
        parms = bot_cmd.bot_cmd_parm_string;
 
@@ -1027,7 +1027,7 @@ float bot_cmd_keypress_handler(string key, float enabled)
 
 float bot_cmd_presskey()
 {
-       local string key;
+       string key;
 
        key = bot_cmd.bot_cmd_parm_string;
 
@@ -1038,7 +1038,7 @@ float bot_cmd_presskey()
 
 float bot_cmd_releasekey()
 {
-       local string key;
+       string key;
 
        key = bot_cmd.bot_cmd_parm_string;
 
@@ -1213,7 +1213,7 @@ void bot_resetqueues()
 // NOTE: Of course you need to include your commands here too :)
 float bot_execute_commands_once()
 {
-       local float status, ispressingkey;
+       float status, ispressingkey;
 
        // Find command
        bot_setcurrentcommand();
@@ -1346,7 +1346,7 @@ float bot_execute_commands_once()
        {
                if(autocvar_g_debug_bot_commands)
                {
-                       local string parms;
+                       string parms;
 
                        switch(bot_cmd_parm_type[bot_cmd.bot_cmd_type])
                        {
index c48545e5aa2c922e60a7503b6c4103a4f8842221..e2bcc5bd628e341000f7273cd9d7dee80da44167 100644 (file)
@@ -3,7 +3,7 @@
 // (suitable for spawnfunc_waypoint editor)
 entity waypoint_spawn(vector m1, vector m2, float f)
 {
-       local entity w;
+       entity w;
        w = find(world, classname, "waypoint");
 
        if not(f & WAYPOINTFLAG_PERSONAL)
@@ -67,12 +67,12 @@ entity waypoint_spawn(vector m1, vector m2, float f)
                w.model = "";
 
        return w;
-};
+}
 
 // add a new link to the spawnfunc_waypoint, replacing the furthest link it already has
 void waypoint_addlink(entity from, entity to)
 {
-       local float c;
+       float c;
 
        if (from == to)
                return;
@@ -92,7 +92,7 @@ void waypoint_addlink(entity from, entity to)
        {
                // if either is a box we have to find the nearest points on them to
                // calculate the distance properly
-               local vector v1, v2, m1, m2;
+               vector v1, v2, m1, m2;
                v1 = from.origin;
                m1 = to.absmin;
                m2 = to.absmax;
@@ -144,15 +144,15 @@ void waypoint_addlink(entity from, entity to)
        if (from.wp01mincost < c) {from.wp02 = to;from.wp02mincost = c;return;} from.wp02 = from.wp01;from.wp02mincost = from.wp01mincost;
        if (from.wp00mincost < c) {from.wp01 = to;from.wp01mincost = c;return;} from.wp01 = from.wp00;from.wp01mincost = from.wp00mincost;
        from.wp00 = to;from.wp00mincost = c;return;
-};
+}
 
 // relink this spawnfunc_waypoint
 // (precompile a list of all reachable waypoints from this spawnfunc_waypoint)
 // (SLOW!)
 void waypoint_think()
 {
-       local entity e;
-       local vector sv, sm1, sm2, ev, em1, em2, dv;
+       entity e;
+       vector sv, sm1, sm2, ev, em1, em2, dv;
 
        bot_calculate_stepheightvec();
 
@@ -226,12 +226,12 @@ void waypoint_think()
        }
        navigation_testtracewalk = 0;
        self.wplinked = TRUE;
-};
+}
 
 void waypoint_clearlinks(entity wp)
 {
        // clear links to other waypoints
-       local float f;
+       float f;
        f = 10000000;
        wp.wp00 = wp.wp01 = wp.wp02 = wp.wp03 = wp.wp04 = wp.wp05 = wp.wp06 = wp.wp07 = world;
        wp.wp08 = wp.wp09 = wp.wp10 = wp.wp11 = wp.wp12 = wp.wp13 = wp.wp14 = wp.wp15 = world;
@@ -244,7 +244,7 @@ void waypoint_clearlinks(entity wp)
        wp.wp24mincost = wp.wp25mincost = wp.wp26mincost = wp.wp27mincost = wp.wp28mincost = wp.wp29mincost = wp.wp30mincost = wp.wp31mincost = f;
 
        wp.wplinked = FALSE;
-};
+}
 
 // tell a spawnfunc_waypoint to relink
 void waypoint_schedulerelink(entity wp)
@@ -254,7 +254,7 @@ void waypoint_schedulerelink(entity wp)
        // TODO: add some sort of visible box in edit mode for box waypoints
        if (autocvar_g_waypointeditor)
        {
-               local vector m1, m2;
+               vector m1, m2;
                m1 = wp.mins;
                m2 = wp.maxs;
                setmodel(wp, "models/runematch/rune.mdl"); wp.effects = EF_LOWPRECISION;
@@ -287,7 +287,7 @@ void spawnfunc_waypoint()
        // schedule a relink after other waypoints have had a chance to spawn
        waypoint_clearlinks(self);
        //waypoint_schedulerelink(self);
-};
+}
 
 // remove a spawnfunc_waypoint, and schedule all neighbors to relink
 void waypoint_remove(entity e)
@@ -327,12 +327,12 @@ void waypoint_remove(entity e)
        waypoint_schedulerelink(e.wp31);
        // and now remove the spawnfunc_waypoint
        remove(e);
-};
+}
 
 // empties the map of waypoints
 void waypoint_removeall()
 {
-       local entity head, next;
+       entity head, next;
        head = findchain(classname, "waypoint");
        while (head)
        {
@@ -340,13 +340,13 @@ void waypoint_removeall()
                remove(head);
                head = next;
        }
-};
+}
 
 // tell all waypoints to relink
 // (is this useful at all?)
 void waypoint_schedulerelinkall()
 {
-       local entity head;
+       entity head;
        relink_total = relink_walkculled = relink_pvsculled = relink_lengthculled = 0;
        head = findchain(classname, "waypoint");
        while (head)
@@ -354,15 +354,15 @@ void waypoint_schedulerelinkall()
                waypoint_schedulerelink(head);
                head = head.chain;
        }
-};
+}
 
 // Load waypoint links from file
 float waypoint_load_links()
 {
-       local string filename, s;
-       local float file, tokens, c, found;
-       local entity wp_from, wp_to;
-       local vector wp_to_pos, wp_from_pos;
+       string filename, s;
+       float file, tokens, c, found;
+       entity wp_from, wp_to;
+       vector wp_to_pos, wp_from_pos;
        filename = strcat("maps/", mapname);
        filename = strcat(filename, ".waypoints.cache");
        file = fopen(filename, FILE_READ);
@@ -451,14 +451,14 @@ float waypoint_load_links()
 
        botframe_cachedwaypointlinks = TRUE;
        return TRUE;
-};
+}
 
 void waypoint_load_links_hardwired()
 {
-       local string filename, s;
-       local float file, tokens, c, found;
-       local entity wp_from, wp_to;
-       local vector wp_to_pos, wp_from_pos;
+       string filename, s;
+       float file, tokens, c, found;
+       entity wp_from, wp_to;
+       vector wp_to_pos, wp_from_pos;
        filename = strcat("maps/", mapname);
        filename = strcat(filename, ".waypoints.hardwired");
        file = fopen(filename, FILE_READ);
@@ -549,14 +549,14 @@ void waypoint_load_links_hardwired()
        dprint(" waypoint links from maps/");
        dprint(mapname);
        dprint(".waypoints.hardwired\n");
-};
+}
 
 // Save all waypoint links to a file
 void waypoint_save_links()
 {
-       local string filename, s;
-       local float file, c, i;
-       local entity w, link;
+       string filename, s;
+       float file, c, i;
+       entity w, link;
        filename = strcat("maps/", mapname);
        filename = strcat(filename, ".waypoints.cache");
        file = fopen(filename, FILE_WRITE);
@@ -627,14 +627,14 @@ void waypoint_save_links()
        print(" waypoints links to maps/");
        print(mapname);
        print(".waypoints.cache\n");
-};
+}
 
 // save waypoints to gamedir/data/maps/mapname.waypoints
 void waypoint_saveall()
 {
-       local string filename, s;
-       local float file, c;
-       local entity w;
+       string filename, s;
+       float file, c;
+       entity w;
        filename = strcat("maps/", mapname);
        filename = strcat(filename, ".waypoints");
        file = fopen(filename, FILE_WRITE);
@@ -671,14 +671,14 @@ void waypoint_saveall()
        }
        waypoint_save_links();
        botframe_loadedforcedlinks = FALSE;
-};
+}
 
 // load waypoints from file
 float waypoint_loadall()
 {
-       local string filename, s;
-       local float file, cwp, cwb, fl;
-       local vector m1, m2;
+       string filename, s;
+       float file, cwp, cwb, fl;
+       vector m1, m2;
        cwp = 0;
        cwb = 0;
        filename = strcat("maps/", mapname);
@@ -722,7 +722,7 @@ float waypoint_loadall()
                dprint(" failed\n");
        }
        return cwp + cwb;
-};
+}
 
 vector waypoint_fixorigin(vector position)
 {
@@ -736,7 +736,7 @@ vector waypoint_fixorigin(vector position)
 
 void waypoint_spawnforitem_force(entity e, vector org)
 {
-       local entity w;
+       entity w;
 
        // Fix the waypoint altitude if necessary
        org = waypoint_fixorigin(org);
@@ -772,12 +772,12 @@ void waypoint_spawnforitem(entity e)
                return;
 
        waypoint_spawnforitem_force(e, e.origin);
-};
+}
 
 void waypoint_spawnforteleporter_boxes(entity e, vector org1, vector org2, vector destination1, vector destination2, float timetaken)
 {
-       local entity w;
-       local entity dw;
+       entity w;
+       entity dw;
        w = waypoint_spawn(org1, org2, WAYPOINTFLAG_GENERATED | WAYPOINTFLAG_TELEPORT | WAYPOINTFLAG_NORELINK);
        dw = waypoint_spawn(destination1, destination2, WAYPOINTFLAG_GENERATED);
        // one way link to the destination
@@ -787,20 +787,20 @@ void waypoint_spawnforteleporter_boxes(entity e, vector org1, vector org2, vecto
        // (teleporters are not goals, so this is probably useless)
        e.nearestwaypoint = w;
        e.nearestwaypointtimeout = time + 1000000000;
-};
+}
 
 void waypoint_spawnforteleporter_v(entity e, vector org, vector destination, float timetaken)
 {
        org = waypoint_fixorigin(org);
        destination = waypoint_fixorigin(destination);
        waypoint_spawnforteleporter_boxes(e, org, org, destination, destination, timetaken);
-};
+}
 
 void waypoint_spawnforteleporter(entity e, vector destination, float timetaken)
 {
        destination = waypoint_fixorigin(destination);
        waypoint_spawnforteleporter_boxes(e, e.absmin, e.absmax, destination, destination, timetaken);
-};
+}
 
 entity waypoint_spawnpersonal(vector position)
 {
@@ -819,11 +819,11 @@ entity waypoint_spawnpersonal(vector position)
        waypoint_schedulerelink(w);
 
        return w;
-};
+}
 
 void botframe_showwaypointlinks()
 {
-       local entity player, head, w;
+       entity player, head, w;
        if (time < botframe_waypointeditorlightningtime)
                return;
        botframe_waypointeditorlightningtime = time + 0.5;
@@ -876,4 +876,4 @@ void botframe_showwaypointlinks()
                }
                player = find(player, classname, "player");
        }
-};
+}
index c64716d9e2134517db182084a82a6ce611cd74ac..5a68e96058ce0acd36724480d955d9a7213fb44f 100644 (file)
@@ -169,7 +169,7 @@ void CampaignPreIntermission()
        entity head;
        float won;
        float lost;
-       local string savevar;
+       string savevar;
 
        won = 0;
 
index 60f457362c3786ec39a28241ac1854d5da3f4810..9e8539039a307c496a449ca8cac4365f34a45a36 100644 (file)
@@ -118,7 +118,7 @@ void spawnpoint_use()
                self.team = activator.team;
                some_spawn_has_been_used = 1;
        }
-};
+}
 
 // Returns:
 //   _x: prio (-1 if unusable)
@@ -153,7 +153,7 @@ vector Spawn_Score(entity spot, entity playerlist, float teamcheck, float anypoi
 
        // filter out spots for assault
        if(spot.target != "") {
-               local entity ent;
+               entity ent;
                float good, found;
                ent = find(world, targetname, spot.target);
 
@@ -224,7 +224,7 @@ float spawn_allbad;
 float spawn_allgood;
 entity Spawn_FilterOutBadSpots(entity firstspot, entity playerlist, float mindist, float teamcheck, float anypoint)
 {
-       local entity spot, spotlist, spotlistend;
+       entity spot, spotlist, spotlistend;
        spawn_allgood = TRUE;
        spawn_allbad = TRUE;
 
@@ -299,7 +299,7 @@ entity Spawn_WeightedPoint(entity firstspot, float lower, float upper, float exp
 {
        // weight of a point: bound(lower, mindisttoplayer, upper)^exponent
        // multiplied by spot.cnt (useful if you distribute many spawnpoints in a small area)
-       local entity spot;
+       entity spot;
 
        RandomSelection_Init();
        for(spot = firstspot; spot; spot = spot.chain)
@@ -317,9 +317,9 @@ Finds a point to respawn
 */
 entity SelectSpawnPoint (float anypoint)
 {
-       local float teamcheck;
-       local entity firstspot_new;
-       local entity spot, firstspot, playerlist;
+       float teamcheck;
+       entity firstspot_new;
+       entity spot, firstspot, playerlist;
 
        spot = find (world, classname, "testplayerstart");
        if (spot)
@@ -662,6 +662,7 @@ void PutObserverInServer (void)
        
        self.classname = "observer";
        self.iscreature = FALSE;
+       self.damagedbycontents = FALSE;
        self.health = -666;
        self.takedamage = DAMAGE_NO;
        self.solid = SOLID_NOT;
@@ -754,9 +755,9 @@ void PutObserverInServer (void)
 
 void FixPlayermodel()
 {
-       local string defaultmodel;
-       local float defaultskin, chmdl, oldskin;
-       local vector m1, m2;
+       string defaultmodel;
+       float defaultskin, chmdl, oldskin;
+       vector m1, m2;
 
        defaultmodel = "";
 
@@ -902,6 +903,7 @@ void PutClientInServer (void)
                self.classname = "player";
                self.wasplayer = TRUE;
                self.iscreature = TRUE;
+               self.damagedbycontents = TRUE;
                self.movetype = MOVETYPE_WALK;
                self.solid = SOLID_SLIDEBOX;
                self.dphitcontentsmask = DPCONTENTS_BODY | DPCONTENTS_SOLID;
@@ -1844,6 +1846,7 @@ void ClientDisconnect (void)
 
        Portal_ClearAll(self);
 
+       RemoveGrapplingHook(self);
        if(self.flagcarried)
                DropFlag(self.flagcarried, world, world);
        if(self.ballcarried && g_nexball)
@@ -1911,7 +1914,7 @@ void ChatBubbleThink()
                self.model = self.mdl;
        else
                self.model = "";
-};
+}
 
 void UpdateChatBubble()
 {
@@ -1940,7 +1943,7 @@ void UpdateChatBubble()
 // added to the model skins
 /*void UpdateColorModHack()
 {
-       local float c;
+       float c;
        c = self.clientcolors & 15;
        // LordHavoc: only bothering to support white, green, red, yellow, blue
             if (!teamplay) self.colormod = '0 0 0';
@@ -1950,7 +1953,7 @@ void UpdateChatBubble()
        else if (c == 12) self.colormod = '1.22 1.22 0.10';
        else if (c == 13) self.colormod = '0.10 0.10 1.73';
        else self.colormod = '1 1 1';
-};*/
+}*/
 
 .float oldcolormap;
 void respawn(void)
@@ -2527,16 +2530,16 @@ float nJoinAllowed(float includeMe) {
                return FALSE; // forced spectators can never join
 
        // TODO simplify this
-       local entity e;
+       entity e;
 
-       local float totalClients;
+       float totalClients;
        FOR_EACH_CLIENT(e)
                totalClients += 1;
 
        if (!autocvar_g_maxplayers)
                return maxclients - totalClients + includeMe;
 
-       local float currentlyPlaying;
+       float currentlyPlaying;
        FOR_EACH_REALPLAYER(e)
                currentlyPlaying += 1;
 
@@ -2949,14 +2952,14 @@ void PlayerPreThink (void)
 
                self.prevorigin = self.origin;
 
-               if ((self.BUTTON_CROUCH && !self.hook.state) || self.health <= g_bloodloss)
+               if (((self.BUTTON_CROUCH && !self.hook.state) || self.health <= g_bloodloss) && self.animstate_startframe != self.anim_melee_x) // prevent crouching if using melee attack
                {
                        if (!self.crouch)
                        {
                                self.crouch = TRUE;
                                self.view_ofs = PL_CROUCH_VIEW_OFS;
                                setsize (self, PL_CROUCH_MIN, PL_CROUCH_MAX);
-                               setanim(self, self.anim_duck, FALSE, TRUE, TRUE);
+                               // setanim(self, self.anim_duck, FALSE, TRUE, TRUE); // this anim is BROKEN anyway
                        }
                }
                else
index 9e211e5f504086be15b3c2bd7361262b946349fc..9e662bb848e204b1a5b59dcd283424247d396951 100644 (file)
@@ -35,7 +35,7 @@
 
 void ImpulseCommands (void)
 {
-       local float imp;
+       float imp;
        vector org;
        float i;
        float m;
index b7e8bc22648b631647bf33898c4be713dc3d46f9..b675c56e962ed9d94a5f8fddbdd01c3d619ff073 100644 (file)
@@ -171,7 +171,7 @@ void PlayerJump (void)
 
        if (self.crouch)
                setanim(self, self.anim_duckjump, FALSE, TRUE, TRUE);
-       else
+       else if (self.animstate_startframe != self.anim_melee_x || (self.animstate_startframe == self.anim_melee_x && time - self.animstate_starttime >= 21/20)) // jump animation shouldn't override melee until we have animation blending (or until the anim finished, 21/20 = numframes/fps)
                setanim(self, self.anim_jump, FALSE, TRUE, TRUE);
 
        if(g_jump_grunt)
@@ -182,7 +182,7 @@ void PlayerJump (void)
 }
 void CheckWaterJump()
 {
-       local vector start, end;
+       vector start, end;
 
 // check for a jump-out-of-water
        makevectors (self.angles);
@@ -207,7 +207,7 @@ void CheckWaterJump()
                        return;
                }
        }
-};
+}
 void CheckPlayerJump()
 {
        if(self.flags & FL_ONGROUND)
@@ -697,8 +697,8 @@ float speedaward_lastupdate;
 float speedaward_lastsent;
 void SV_PlayerPhysics()
 {
-       local vector wishvel, wishdir, v;
-       local float wishspeed, f, maxspd_mod, spd, maxairspd, airaccel, swampspd_mod, buttons;
+       vector wishvel, wishdir, v;
+       float wishspeed, f, maxspd_mod, spd, maxairspd, airaccel, swampspd_mod, buttons;
        string temps;
        float buttons_prev;
        float not_allowed_to_move;
@@ -732,6 +732,7 @@ void SV_PlayerPhysics()
        maxspd_mod *= autocvar_g_movement_highspeed;
 
        // fix physics stats for g_movement_highspeed
+       // TODO maybe rather use maxairspeed? needs testing
        self.stat_sv_airaccel_qw = AdjustAirAccelQW(autocvar_sv_airaccel_qw, maxspd_mod);
        if(autocvar_sv_airstrafeaccel_qw)
                self.stat_sv_airstrafeaccel_qw = AdjustAirAccelQW(autocvar_sv_airstrafeaccel_qw, maxspd_mod);
@@ -1340,4 +1341,4 @@ void SV_PlayerPhysics()
 
        self.lastflags = self.flags;
        self.lastclassname = self.classname;
-};
+}
index e5e2d377cf4981f7d9527d1a4ca7f927caf87bec..f9fb0aa61ebd0459f1621ec91074021447dc5468 100644 (file)
@@ -21,7 +21,7 @@ void WeaponStats_ready(entity fh, entity pass, float status)
        switch(status)
        {
                case URL_READY_CANWRITE:
-                       // url_fopen returned, we can write
+                       // we can write
                        prefix = strcat(autocvar_hostname, "\t", GetGametype(), "_", GetMapname(), "\t");
                        url_fputs(fh, "#begin statsfile\n");
                        url_fputs(fh, strcat("#date ", strftime(TRUE, "%a %b %e %H:%M:%S %Z %Y"), "\n"));
@@ -46,9 +46,7 @@ void WeaponStats_ready(entity fh, entity pass, float status)
                                        }
                                }
                        url_fputs(fh, "#end\n\n");
-                       url_fclose(fh, WeaponStats_ready, world);
-                       buf_del(weaponstats_buffer);
-                       weaponstats_buffer = -1;
+                       url_fclose(fh);
                        break;
                case URL_READY_CANREAD:
                        // url_fclose is processing, we got a response for writing the data
@@ -57,15 +55,19 @@ void WeaponStats_ready(entity fh, entity pass, float status)
                        while((s = url_fgets(fh)))
                                print("  ", s, "\n");
                        print("End of response.\n");
-                       url_fclose(fh, WeaponStats_ready, world);
+                       url_fclose(fh);
                        break;
                case URL_READY_CLOSED:
                        // url_fclose has finished
                        print("Weapon stats written\n");
+                       buf_del(weaponstats_buffer);
+                       weaponstats_buffer = -1;
                        break;
                case URL_READY_ERROR:
                default:
                        print("Weapon stats writing failed: ", ftos(status), "\n");
+                       buf_del(weaponstats_buffer);
+                       weaponstats_buffer = -1;
                        break;
        }
 }
@@ -76,7 +78,7 @@ void WeaponStats_Shutdown()
                return;
        if(autocvar_sv_weaponstats_file != "")
        {
-               url_fopen(autocvar_sv_weaponstats_file, FILE_APPEND, WeaponStats_ready, world);
+               url_multi_fopen(autocvar_sv_weaponstats_file, FILE_APPEND, WeaponStats_ready, world);
        }
        else
        {
@@ -124,7 +126,7 @@ void WeaponStats_LogKill(float awep, float abot, float vwep, float vbot)
 
 void CopyBody(float keepvelocity)
 {
-       local entity oldself;
+       entity oldself;
        if (self.effects & EF_NODRAW)
                return;
        oldself = self;
@@ -134,6 +136,7 @@ void CopyBody(float keepvelocity)
        self.colormap = oldself.colormap;
        self.glowmod = oldself.glowmod;
        self.iscreature = oldself.iscreature;
+       self.damagedbycontents = oldself.damagedbycontents;
        self.angles = oldself.angles;
        self.avelocity = oldself.avelocity;
        self.classname = "body";
@@ -199,74 +202,35 @@ float player_getspecies()
 
 void player_setupanimsformodel()
 {
-       local string animfilename;
-       local float animfile;
        // defaults for legacy .zym models without animinfo files
-       self.anim_die1 = '0 1 0.5'; // 2 seconds
-       self.anim_die2 = '1 1 0.5'; // 2 seconds
-       self.anim_draw = '2 1 3'; // TODO: analyze models and set framerate
-       self.anim_duck = '3 1 100'; // this anim seems bogus in most models, so make it play VERY briefly!
-       self.anim_duckwalk = '4 1 1';
-       self.anim_duckjump = '5 1 100'; // zym anims keep playing until changed, so this only has to start the anim, landing will end it
-       self.anim_duckidle = '6 1 1';
-       self.anim_idle = '7 1 1';
-       self.anim_jump = '8 1 100'; // zym anims keep playing until changed, so this only has to start the anim, landing will end it
-       self.anim_pain1 = '9 1 2'; // 0.5 seconds
-       self.anim_pain2 = '10 1 2'; // 0.5 seconds
-       self.anim_shoot = '11 1 5'; // TODO: analyze models and set framerate
-       self.anim_taunt = '12 1 0.33'; // FIXME?  there is no code using this anim
-       self.anim_run = '13 1 1';
-       self.anim_runbackwards = '14 1 1';
-       self.anim_strafeleft = '15 1 1';
-       self.anim_straferight = '16 1 1';
-       self.anim_dead1 = '17 1 1';
-       self.anim_dead2 = '18 1 1';
-       self.anim_forwardright = '19 1 1';
-       self.anim_forwardleft = '20 1 1';
-       self.anim_backright = '21 1 1';
-       self.anim_backleft  = '22 1 1';
-       self.anim_melee = '23 1 1';
-       animparseerror = FALSE;
-       animfilename = strcat(self.model, ".animinfo");
-       animfile = fopen(animfilename, FILE_READ);
-       if (animfile >= 0)
-       {
-               self.anim_die1         = animparseline(animfile);
-               self.anim_die2         = animparseline(animfile);
-               self.anim_draw         = animparseline(animfile);
-               self.anim_duck         = animparseline(animfile);
-               self.anim_duckwalk     = animparseline(animfile);
-               self.anim_duckjump     = animparseline(animfile);
-               self.anim_duckidle     = animparseline(animfile);
-               self.anim_idle         = animparseline(animfile);
-               self.anim_jump         = animparseline(animfile);
-               self.anim_pain1        = animparseline(animfile);
-               self.anim_pain2        = animparseline(animfile);
-               self.anim_shoot        = animparseline(animfile);
-               self.anim_taunt        = animparseline(animfile);
-               self.anim_run          = animparseline(animfile);
-               self.anim_runbackwards = animparseline(animfile);
-               self.anim_strafeleft   = animparseline(animfile);
-               self.anim_straferight  = animparseline(animfile);
-               self.anim_forwardright = animparseline(animfile);
-               self.anim_forwardleft  = animparseline(animfile);
-               self.anim_backright    = animparseline(animfile);
-               self.anim_backleft     = animparseline(animfile);
-               self.anim_melee        = animparseline(animfile);
-               fclose(animfile);
-
-               // derived anims
-               self.anim_dead1 = '0 1 1' + '1 0 0' * (self.anim_die1_x + self.anim_die1_y - 1);
-               self.anim_dead2 = '0 1 1' + '1 0 0' * (self.anim_die2_x + self.anim_die2_y - 1);
-
-               if (animparseerror)
-                       print("Parse error in ", animfilename, ", some player animations are broken\n");
-       }
-       else
-               dprint("File ", animfilename, " not found, assuming legacy .zym model animation timings\n");
+       self.anim_die1 = animfixfps(self, '0 1 0.5'); // 2 seconds
+       self.anim_die2 = animfixfps(self, '1 1 0.5'); // 2 seconds
+       self.anim_draw = animfixfps(self, '2 1 3');
+       // self.anim_duck = '3 1 100'; // This anim is broken, use slot 3 as a new free slot in the future ;)
+       self.anim_duckwalk = animfixfps(self, '4 1 1');
+       self.anim_duckjump = '5 1 100'; // NOTE: zym anims keep playing until changed, so this only has to start the anim, landing will end it
+       self.anim_duckidle = animfixfps(self, '6 1 1');
+       self.anim_idle = animfixfps(self, '7 1 1');
+       self.anim_jump = '8 1 100'; // NOTE: zym anims keep playing until changed, so this only has to start the anim, landing will end it
+       self.anim_pain1 = animfixfps(self, '9 1 2'); // 0.5 seconds
+       self.anim_pain2 = animfixfps(self, '10 1 2'); // 0.5 seconds
+       self.anim_shoot = animfixfps(self, '11 1 5'); // analyze models and set framerate
+       self.anim_taunt = animfixfps(self, '12 1 0.33');
+       self.anim_run = animfixfps(self, '13 1 1');
+       self.anim_runbackwards = animfixfps(self, '14 1 1');
+       self.anim_strafeleft = animfixfps(self, '15 1 1');
+       self.anim_straferight = animfixfps(self, '16 1 1');
+       self.anim_dead1 = animfixfps(self, '17 1 1');
+       self.anim_dead2 = animfixfps(self, '18 1 1');
+       self.anim_forwardright = animfixfps(self, '19 1 1');
+       self.anim_forwardleft = animfixfps(self, '20 1 1');
+       self.anim_backright = animfixfps(self, '21 1 1');
+       self.anim_backleft  = animfixfps(self, '22 1 1');
+       self.anim_melee = animfixfps(self, '23 1 1');
+       // TODO introspect models for finding right "fps" value (1/duration)
        // reset animstate now
        setanim(self, self.anim_idle, TRUE, FALSE, TRUE);
-};
+}
 
 void player_anim (void)
 {
@@ -290,13 +254,32 @@ void player_anim (void)
 
        if (!self.animstate_override)
        {
-               if (!(self.flags & FL_ONGROUND))
+               if (!(self.flags & FL_ONGROUND) || self.BUTTON_JUMP)
                {
                        if (self.crouch)
-                               setanim(self, self.anim_duckjump, FALSE, TRUE, self.restart_jump);
+                       {
+                               if (self.animstate_startframe != self.anim_duckjump_x) // don't perform another trace if already playing the crouch jump anim
+                               {
+                                       traceline(self.origin + '0 0 1' * PL_CROUCH_MIN_z, self.origin + '0 0 1' * (PL_CROUCH_MIN_z - autocvar_sv_player_jumpanim_minfall), TRUE, self);
+                                       if(!trace_startsolid && trace_fraction == 1 || !(self.animstate_startframe == self.anim_duckwalk_x || self.animstate_startframe == self.anim_duckidle_x)) // don't get stuck on non-crouch anims
+                                       {
+                                               setanim(self, self.anim_duckjump, FALSE, TRUE, self.restart_jump);
+                                               self.restart_jump = FALSE;
+                                       }
+                               }
+                       }
                        else
-                               setanim(self, self.anim_jump, FALSE, TRUE, self.restart_jump);
-                       self.restart_jump = FALSE;
+                       {
+                if (self.animstate_startframe != self.anim_jump_x) // don't perform another trace if already playing the jump anim
+                {
+                    traceline(self.origin + '0 0 1' * PL_MIN_z, self.origin + '0 0 1' * (PL_MIN_z - autocvar_sv_player_jumpanim_minfall), TRUE, self);
+                    if(!trace_startsolid && trace_fraction == 1 || self.animstate_startframe == self.anim_idle_x || (self.animstate_startframe == self.anim_melee_x && time - self.animstate_starttime >= 21/20)) // don't get stuck on idle animation in midair, nor melee after it finished
+                    {
+                        setanim(self, self.anim_jump, FALSE, TRUE, self.restart_jump);
+                        self.restart_jump = FALSE;
+                    }
+                }
+                       }
                }
                else if (self.crouch)
                {
@@ -360,7 +343,7 @@ void SpawnThrownWeapon (vector org, float w)
 
 void PlayerCorpseDamage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
 {
-       local float take, save;
+       float take, save;
        vector v;
        Violence_GibSplash_At(hitloc, force, 2, bound(0, damage, 200) / 16, self, attacker);
 
@@ -416,7 +399,7 @@ void freezetag_CheckWinner();
 
 void PlayerDamage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
 {
-       local float take, save, waves, sdelay, dh, da, j;
+       float take, save, waves, sdelay, dh, da, j;
        vector v;
        float valid_damage_for_weaponstats;
        float excess;
@@ -510,7 +493,8 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
                        self.armorvalue = self.armorvalue - save;
                        self.health = self.health - take;
                        // pause regeneration for 5 seconds
-                       self.pauseregen_finished = max(self.pauseregen_finished, time + autocvar_g_balance_pause_health_regen);
+                       if(take)
+                self.pauseregen_finished = max(self.pauseregen_finished, time + autocvar_g_balance_pause_health_regen);
 
                        if (time > self.pain_finished)          //Don't switch pain sequences like crazy
                        {
@@ -519,10 +503,13 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
                                if(sv_gentle < 1) {
                                        if(self.classname != "body") // pain anim is BORKED on our ZYMs, FIXME remove this once we have good models
                                        {
-                                               if (random() > 0.5)
-                                                       setanim(self, self.anim_pain1, FALSE, TRUE, TRUE);
-                                               else
-                                                       setanim(self, self.anim_pain2, FALSE, TRUE, TRUE);
+                                               if (!self.animstate_override)
+                                               {
+                                                       if (random() > 0.5)
+                                                               setanim(self, self.anim_pain1, FALSE, TRUE, TRUE);
+                                                       else
+                                                               setanim(self, self.anim_pain2, FALSE, TRUE, TRUE);
+                                               }
                                        }
 
                                        if(sound_allowed(MSG_BROADCAST, attacker))
@@ -544,7 +531,7 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
                                }
 
                                // throw off bot aim temporarily
-                               local float shake;
+                               float shake;
                                shake = damage * 5 / (bound(0,skill,100) + 1);
                                self.v_angle_x = self.v_angle_x + (random() * 2 - 1) * shake;
                                self.v_angle_y = self.v_angle_y + (random() * 2 - 1) * shake;
@@ -674,6 +661,8 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
                MUTATOR_CALLHOOK(PlayerDies);
                weapon_action(self.weapon, WR_PLAYERDEATH);
 
+               RemoveGrapplingHook(self);
+
                if(self.flagcarried)
                {
                        if(attacker.classname != "player")
index 4a333934ae84a5ddc83f4281e2f7406daff1ef9a..edf5b1f5e5c697d07087509075ef53edc2af5bd0 100644 (file)
@@ -17,7 +17,7 @@ void W_SwitchWeapon(float imp)
        {
                W_TriggerReload();
        }
-};
+}
 
 .float weaponcomplainindex;
 float W_GetCycleWeapon(entity pl, string weaponorder, float dir, float imp, float complain, float skipmissing)
@@ -149,14 +149,14 @@ void W_LastWeapon()
 float w_getbestweapon(entity e)
 {
        return W_GetCycleWeapon(e, e.cvar_cl_weaponpriority, 0, -1, FALSE, TRUE);
-};
+}
 
 // generic weapons table
 // TODO should they be macros instead?
 float weapon_action(float wpn, float wrequest)
 {
        return (get_weaponinfo(wpn)).weapon_func(wrequest);
-};
+}
 
 string W_Name(float weaponid)
 {
@@ -287,7 +287,7 @@ float W_IsWeaponThrowable(float w)
 // toss current weapon
 void W_ThrowWeapon(vector velo, vector delta, float doreduce)
 {
-       local float w, wb;
+       float w, wb;
        string a;
 
        w = self.weapon;
@@ -317,7 +317,7 @@ void W_ThrowWeapon(vector velo, vector delta, float doreduce)
                sprint(self, strcat("You dropped the ^2", W_Name(w), "\n"));
        else
                sprint(self, strcat("You dropped the ^2", W_Name(w), " with ", a, "\n"));
-};
+}
 
 // Bringed back weapon frame
 void W_WeaponFrame()
@@ -414,7 +414,7 @@ void W_WeaponFrame()
        // call the think code which may fire the weapon
        // and do so multiple times to resolve framerate dependency issues if the
        // server framerate is very low and the weapon fire rate very high
-       local float c;
+       float c;
        c = 0;
        while (c < W_TICSPERFRAME)
        {
@@ -469,4 +469,4 @@ void W_WeaponFrame()
        else
                self.currentammo = 1;
 #endif
-};
+}
index 73928031f5951f5979c21d6dac05ef8a7e7d9432..4acb8da891fa4fa4158b5ef01b7026a176cced5e 100644 (file)
@@ -127,15 +127,28 @@ vector w_shotorg;
 vector w_shotdir;
 vector w_shotend;
 
+.float prevstrengthsound;
+.float prevstrengthsoundattempt;
+void W_PlayStrengthSound(entity player) // void W_PlayStrengthSound
+{
+               if((!g_minstagib)
+                       && (player.items & IT_STRENGTH)
+                       && ((time > player.prevstrengthsound + autocvar_sv_strengthsound_antispam_time) // prevent insane sound spam
+                       || (time > player.prevstrengthsoundattempt + autocvar_sv_strengthsound_antispam_refire_threshold)))
+               {
+                       sound(player, CH_TRIGGER, "weapons/strength_fire.wav", VOL_BASE, ATTN_NORM);
+                       player.prevstrengthsound = time;
+               }
+               player.prevstrengthsoundattempt = time;
+}
+
 // 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 chan, float maxdamage, float range)
 {
        float nudge = 1; // added to traceline target and subtracted from result
-       local float oldsolid;
+       float oldsolid;
        vector vecs, dv;
        oldsolid = ent.dphitcontentsmask;
        if(ent.weapon == WEP_RIFLE)
@@ -241,24 +254,14 @@ void W_SetupShot_Dir_ProjectileSize_Range(entity ent, vector s_forward, vector m
                ent.punchangle_x = recoil * -1;
 
        if (snd != "")
-               sound (ent, chan, snd, VOL_BASE, ATTN_NORM);
-
-       if(ent.items & IT_STRENGTH)
-       if(!g_minstagib)
-       if(
-               (time > ent.prevstrengthsound + autocvar_sv_strengthsound_antispam_time)
-               ||
-               (time > ent.prevstrengthsoundattempt + autocvar_sv_strengthsound_antispam_refire_threshold)
-       ) // prevent insane sound spam
        {
-               sound(ent, CH_TRIGGER, "weapons/strength_fire.wav", VOL_BASE, ATTN_NORM);
-               ent.prevstrengthsound = time;
+               sound (ent, chan, snd, VOL_BASE, ATTN_NORM);
+               W_PlayStrengthSound(ent);
        }
-       ent.prevstrengthsoundattempt = time;
 
        // nudge w_shotend so a trace to w_shotend hits
        w_shotend = w_shotend + normalize(w_shotend - w_shotorg) * nudge;
-};
+}
 
 #define W_SetupShot_Dir_ProjectileSize(ent,s_forward,mi,ma,antilag,recoil,snd,chan,maxdamage) W_SetupShot_Dir_ProjectileSize_Range(ent, s_forward, mi, ma, antilag, recoil, snd, chan, maxdamage, MAX_SHOT_DISTANCE)
 #define W_SetupShot_ProjectileSize(ent,mi,ma,antilag,recoil,snd,chan,maxdamage) W_SetupShot_Dir_ProjectileSize(ent, v_forward, mi, ma, antilag, recoil, snd, chan, maxdamage)
@@ -275,26 +278,6 @@ float CL_Weaponentity_CustomizeEntityForClient()
        return TRUE;
 }
 
-float qcweaponanimation;
-vector weapon_offset = '0 -10 0';
-vector weapon_adjust = '10 0 -15';
-.vector weapon_morph0origin;
-.vector weapon_morph0angles;
-.float  weapon_morph0time;
-.vector weapon_morph1origin;
-.vector weapon_morph1angles;
-.float  weapon_morph1time;
-.vector weapon_morph2origin;
-.vector weapon_morph2angles;
-.float  weapon_morph2time;
-.vector weapon_morph3origin;
-.vector weapon_morph3angles;
-.float  weapon_morph3time;
-.vector weapon_morph4origin;
-.vector weapon_morph4angles;
-.float  weapon_morph4time;
-#define QCWEAPONANIMATION_ORIGIN(e) ((weapon_offset_x + e.view_ofs_x) * v_forward - (weapon_offset_y + e.view_ofs_y) * v_right + (weapon_offset_z + e.view_ofs_z) * v_up + weapon_adjust)
-
 /*
  * supported formats:
  *
@@ -348,8 +331,6 @@ vector weapon_adjust = '10 0 -15';
 //   remove the ent
 void CL_WeaponEntity_SetModel(string name)
 {
-       string animfilename;
-       float animfile;
        float v_shot_idx;
        if (name != "")
        {
@@ -361,140 +342,115 @@ void CL_WeaponEntity_SetModel(string name)
                if(!v_shot_idx)
                        v_shot_idx = gettagindex(self, "tag_shot");
 
-               if(qcweaponanimation)
+               setmodel(self, strcat("models/weapons/h_", name, ".iqm")); // precision set below
+               // preset some defaults that work great for renamed zym files (which don't need an animinfo)
+               self.anim_fire1  = animfixfps(self, '0 1 0.01');
+               self.anim_fire2  = animfixfps(self, '1 1 0.01');
+               self.anim_idle   = animfixfps(self, '2 1 0.01');
+               self.anim_reload = animfixfps(self, '3 1 0.01');
+
+               // if we have a "weapon" tag, let's attach the v_ model to it ("invisible hand" style model)
+               // if we don't, this is a "real" animated model
+               if(gettagindex(self, "weapon"))
+               {
+                       if (!self.weaponentity)
+                               self.weaponentity = spawn();
+                       setmodel(self.weaponentity, strcat("models/weapons/v_", name, ".md3")); // precision does not matter
+                       setattachment(self.weaponentity, self, "weapon");
+               }
+               else if(gettagindex(self, "tag_weapon"))
                {
-                       self.angles = '0 0 0';
-                       makevectors(self.angles_x * '-1 0 0' + self.angles_y * '0 1 0' + self.angles_z * '0 0 1');
-                       self.movedir = weapon_offset_x * v_forward - weapon_offset_y * v_right + weapon_offset_z * v_up + weapon_adjust;
-                       self.movedir_x += 32;
-                       self.spawnorigin = self.movedir;
-                       // oldorigin - not calculated here
+                       if (!self.weaponentity)
+                               self.weaponentity = spawn();
+                       setmodel(self.weaponentity, strcat("models/weapons/v_", name, ".md3")); // precision does not matter
+                       setattachment(self.weaponentity, self, "tag_weapon");
                }
                else
                {
-                       setmodel(self, strcat("models/weapons/h_", name, ".iqm")); // precision set below
-                       animfilename = strcat("models/weapons/h_", name, ".iqm.animinfo");
-                       animfile = fopen(animfilename, FILE_READ);
-                       // preset some defaults that work great for renamed zym files (which don't need an animinfo)
-                       self.anim_fire1  = '0 1 0.01';
-                       self.anim_fire2  = '1 1 0.01';
-                       self.anim_idle   = '2 1 0.01';
-                       self.anim_reload = '3 1 0.01';
-                       if (animfile >= 0)
-                       {
-                               animparseerror = FALSE;
-                               self.anim_fire1  = animparseline(animfile);
-                               self.anim_fire2  = animparseline(animfile);
-                               self.anim_idle   = animparseline(animfile);
-                               self.anim_reload = animparseline(animfile);
-                               fclose(animfile);
-                               if (animparseerror)
-                                       print("Parse error in ", animfilename, ", some player animations are broken\n");
-                       }
-
-                       // if we have a "weapon" tag, let's attach the v_ model to it ("invisible hand" style model)
-                       // if we don't, this is a "real" animated model
-                       if(gettagindex(self, "weapon"))
-                       {
-                               if (!self.weaponentity)
-                                       self.weaponentity = spawn();
-                               setmodel(self.weaponentity, strcat("models/weapons/v_", name, ".md3")); // precision does not matter
-                               setattachment(self.weaponentity, self, "weapon");
-                       }
-                       else if(gettagindex(self, "tag_weapon"))
-                       {
-                               if (!self.weaponentity)
-                                       self.weaponentity = spawn();
-                               setmodel(self.weaponentity, strcat("models/weapons/v_", name, ".md3")); // precision does not matter
-                               setattachment(self.weaponentity, self, "tag_weapon");
-                       }
-                       else
-                       {
-                               if(self.weaponentity)
-                                       remove(self.weaponentity);
-                               self.weaponentity = world;
-                       }
+                       if(self.weaponentity)
+                               remove(self.weaponentity);
+                       self.weaponentity = world;
+               }
 
-                       setorigin(self,'0 0 0');
-                       self.angles = '0 0 0';
-                       self.frame = 0;
-                       self.viewmodelforclient = world;
+               setorigin(self,'0 0 0');
+               self.angles = '0 0 0';
+               self.frame = 0;
+               self.viewmodelforclient = world;
 
-                       float idx;
+               float idx;
 
-                       if(v_shot_idx) // v_ model attached to invisible h_ model
+               if(v_shot_idx) // v_ model attached to invisible h_ model
+               {
+                       self.movedir = gettaginfo(self.weaponentity, v_shot_idx);
+               }
+               else
+               {
+                       idx = gettagindex(self, "shot");
+                       if(!idx)
+                               idx = gettagindex(self, "tag_shot");
+                       if(idx)
+                               self.movedir = gettaginfo(self, idx);
+                       else
                        {
-                               self.movedir = gettaginfo(self.weaponentity, v_shot_idx);
+                               print("WARNING: weapon model ", self.model, " does not support the 'shot' tag, will display shots TOTALLY wrong\n");
+                               self.movedir = '0 0 0';
                        }
+               }
+
+               if(self.weaponentity) // v_ model attached to invisible h_ model
+               {
+                       idx = gettagindex(self.weaponentity, "shell");
+                       if(!idx)
+                               idx = gettagindex(self.weaponentity, "tag_shell");
+                       if(idx)
+                               self.spawnorigin = gettaginfo(self.weaponentity, idx);
+               }
+               else
+                       idx = 0;
+               if(!idx)
+               {
+                       idx = gettagindex(self, "shell");
+                       if(!idx)
+                               idx = gettagindex(self, "tag_shell");
+                       if(idx)
+                               self.spawnorigin = gettaginfo(self, idx);
                        else
                        {
-                               idx = gettagindex(self, "shot");
-                               if(!idx)
-                                       idx = gettagindex(self, "tag_shot");
-                               if(idx)
-                                       self.movedir = gettaginfo(self, idx);
-                               else
-                               {
-                                       print("WARNING: weapon model ", self.model, " does not support the 'shot' tag, will display shots TOTALLY wrong\n");
-                                       self.movedir = '0 0 0';
-                               }
+                               print("WARNING: weapon model ", self.model, " does not support the 'shell' tag, will display casings wrong\n");
+                               self.spawnorigin = self.movedir;
                        }
+               }
 
-                       if(self.weaponentity) // v_ model attached to invisible h_ model
+               if(v_shot_idx)
+               {
+                       self.oldorigin = '0 0 0'; // use regular attachment
+               }
+               else
+               {
+                       if(self.weaponentity)
                        {
-                               idx = gettagindex(self.weaponentity, "shell");
+                               idx = gettagindex(self, "weapon");
                                if(!idx)
-                                       idx = gettagindex(self.weaponentity, "tag_shell");
-                               if(idx)
-                                       self.spawnorigin = gettaginfo(self.weaponentity, idx);
+                                       idx = gettagindex(self, "tag_weapon");
                        }
                        else
-                               idx = 0;
-                       if(!idx)
                        {
-                               idx = gettagindex(self, "shell");
+                               idx = gettagindex(self, "handle");
                                if(!idx)
-                                       idx = gettagindex(self, "tag_shell");
-                               if(idx)
-                                       self.spawnorigin = gettaginfo(self, idx);
-                               else
-                               {
-                                       print("WARNING: weapon model ", self.model, " does not support the 'shell' tag, will display casings wrong\n");
-                                       self.spawnorigin = self.movedir;
-                               }
+                                       idx = gettagindex(self, "tag_handle");
                        }
-
-                       if(v_shot_idx)
+                       if(idx)
                        {
-                               self.oldorigin = '0 0 0'; // use regular attachment
+                               self.oldorigin = self.movedir - gettaginfo(self, idx);
                        }
                        else
                        {
-                               if(self.weaponentity)
-                               {
-                                       idx = gettagindex(self, "weapon");
-                                       if(!idx)
-                                               idx = gettagindex(self, "tag_weapon");
-                               }
-                               else
-                               {
-                                       idx = gettagindex(self, "handle");
-                                       if(!idx)
-                                               idx = gettagindex(self, "tag_handle");
-                               }
-                               if(idx)
-                               {
-                                       self.oldorigin = self.movedir - gettaginfo(self, idx);
-                               }
-                               else
-                               {
-                                       print("WARNING: weapon model ", self.model, " does not support the 'handle' tag and neither does the v_ model support the 'shot' tag, will display muzzle flashes TOTALLY wrong\n");
-                                       self.oldorigin = '0 0 0'; // there is no way to recover from this
-                               }
+                               print("WARNING: weapon model ", self.model, " does not support the 'handle' tag and neither does the v_ model support the 'shot' tag, will display muzzle flashes TOTALLY wrong\n");
+                               self.oldorigin = '0 0 0'; // there is no way to recover from this
                        }
-
-                       self.viewmodelforclient = self.owner;
                }
+
+               self.viewmodelforclient = self.owner;
        }
        else
        {
@@ -526,24 +482,9 @@ void CL_WeaponEntity_SetModel(string name)
        self.spawnorigin += self.view_ofs; // offset the casings origin by the same amount
 
        // check if an instant weapon switch occurred
-       if (qcweaponanimation)
-       {
-               if (self.state == WS_READY)
-               {
-                       self.angles = '0 0 0';
-                       makevectors(self.angles_x * '-1 0 0' + self.angles_y * '0 1 0' + self.angles_z * '0 0 1');
-                       setorigin(self, QCWEAPONANIMATION_ORIGIN(self));
-               }
-       }
-       else
-               setorigin(self, self.view_ofs);
+       setorigin(self, self.view_ofs);
        // reset animstate now
        self.wframe = WFRAME_IDLE;
-       self.weapon_morph0time = 0;
-       self.weapon_morph1time = 0;
-       self.weapon_morph2time = 0;
-       self.weapon_morph3time = 0;
-       self.weapon_morph4time = 0;
        setanim(self, self.anim_idle, TRUE, FALSE, TRUE);
 }
 
@@ -617,161 +558,24 @@ void CL_Weaponentity_Think()
        }
 
        self.angles = '0 0 0';
-       local float f;
+       float f;
        f = 0;
        if (self.state == WS_RAISE && !intermission_running)
        {
                f = (self.owner.weapon_nextthink - time) * g_weaponratefactor / autocvar_g_balance_weaponswitchdelay;
                self.angles_x = -90 * f * f;
-               if (qcweaponanimation)
-               {
-                       makevectors(self.angles_x * '-1 0 0' + self.angles_y * '0 1 0' + self.angles_z * '0 0 1');
-                       setorigin(self, QCWEAPONANIMATION_ORIGIN(self));
-               }
        }
        else if (self.state == WS_DROP && !intermission_running)
        {
                f = 1 - (self.owner.weapon_nextthink - time) * g_weaponratefactor / autocvar_g_balance_weaponswitchdelay;
                self.angles_x = -90 * f * f;
-               if (qcweaponanimation)
-               {
-                       makevectors(self.angles_x * '-1 0 0' + self.angles_y * '0 1 0' + self.angles_z * '0 0 1');
-                       setorigin(self, QCWEAPONANIMATION_ORIGIN(self));
-               }
        }
        else if (self.state == WS_CLEAR)
        {
                f = 1;
                self.angles_x = -90 * f * f;
-               if (qcweaponanimation)
-               {
-                       makevectors(self.angles_x * '-1 0 0' + self.angles_y * '0 1 0' + self.angles_z * '0 0 1');
-                       setorigin(self, QCWEAPONANIMATION_ORIGIN(self));
-               }
-       }
-       else if (qcweaponanimation && time < self.owner.weapon_morph1time)
-       {
-               f = (time - self.owner.weapon_morph0time) / (self.owner.weapon_morph1time - self.owner.weapon_morph0time);
-               f = 1 - pow(1 - f, 3);
-               self.angles = self.owner.weapon_morph0angles * (1 - f) + self.owner.weapon_morph1angles * f;
-               setorigin(self, self.owner.weapon_morph0origin * (1 - f) + self.owner.weapon_morph1origin * f);
-       }
-       else if (qcweaponanimation && time < self.owner.weapon_morph2time)
-       {
-               f = (time - self.owner.weapon_morph1time) / (self.owner.weapon_morph2time - self.owner.weapon_morph1time);
-               f = 1 - pow(1 - f, 3);
-               self.angles = self.owner.weapon_morph1angles * (1 - f) + self.owner.weapon_morph2angles * f;
-               setorigin(self, self.owner.weapon_morph1origin * (1 - f) + self.owner.weapon_morph2origin * f);
        }
-       else if (qcweaponanimation && time < self.owner.weapon_morph3time)
-       {
-               f = (time - self.owner.weapon_morph2time) / (self.owner.weapon_morph3time - self.owner.weapon_morph2time);
-               f = 1 - pow(1 - f, 3);
-               self.angles = self.owner.weapon_morph2angles * (1 - f) + self.owner.weapon_morph3angles * f;
-               setorigin(self, self.owner.weapon_morph2origin * (1 - f) + self.owner.weapon_morph3origin * f);
-       }
-       else if (qcweaponanimation && time < self.owner.weapon_morph4time)
-       {
-               f = (time - self.owner.weapon_morph3time) / (self.owner.weapon_morph4time - self.owner.weapon_morph3time);
-               f = 1 - pow(1 - f, 3);
-               self.angles = self.owner.weapon_morph3angles * (1 - f) + self.owner.weapon_morph4angles * f;
-               setorigin(self, self.owner.weapon_morph3origin * (1 - f) + self.owner.weapon_morph4origin * f);
-       }
-       else if (qcweaponanimation)
-       {
-               // begin a new idle morph
-               self.owner.weapon_morph0time   = time;
-               self.owner.weapon_morph0angles = self.angles;
-               self.owner.weapon_morph0origin = self.origin;
-
-               float r;
-               float t;
-
-               r = random();
-               if (r < 0.1)
-               {
-                       // turn gun to the left to look at it
-                       t = 2;
-                       self.owner.weapon_morph1time   = time + t * 0.2;
-                       self.owner.weapon_morph1angles = randomvec() * 3 + '-5 30 0';
-                       makevectors(self.owner.weapon_morph1angles_x * '-1 0 0' + self.owner.weapon_morph1angles_y * '0 1 0' + self.owner.weapon_morph1angles_z * '0 0 1');
-                       self.owner.weapon_morph1origin = QCWEAPONANIMATION_ORIGIN(self);
-
-                       self.owner.weapon_morph2time   = time + t * 0.6;
-                       self.owner.weapon_morph2angles = randomvec() * 3 + '-5 30 0';
-                       makevectors(self.owner.weapon_morph2angles_x * '-1 0 0' + self.owner.weapon_morph2angles_y * '0 1 0' + self.owner.weapon_morph2angles_z * '0 0 1');
-                       self.owner.weapon_morph2origin = QCWEAPONANIMATION_ORIGIN(self);
-
-                       self.owner.weapon_morph3time   = time + t;
-                       self.owner.weapon_morph3angles = '0 0 0';
-                       makevectors(self.owner.weapon_morph3angles_x * '-1 0 0' + self.owner.weapon_morph3angles_y * '0 1 0' + self.owner.weapon_morph3angles_z * '0 0 1');
-                       self.owner.weapon_morph3origin = QCWEAPONANIMATION_ORIGIN(self);
-               }
-               else if (r < 0.2)
-               {
-                       // raise the gun a bit
-                       t = 2;
-                       self.owner.weapon_morph1time   = time + t * 0.2;
-                       self.owner.weapon_morph1angles = randomvec() * 3 + '30 -10 0';
-                       makevectors(self.owner.weapon_morph1angles_x * '-1 0 0' + self.owner.weapon_morph1angles_y * '0 1 0' + self.owner.weapon_morph1angles_z * '0 0 1');
-                       self.owner.weapon_morph1origin = QCWEAPONANIMATION_ORIGIN(self);
-
-                       self.owner.weapon_morph2time   = time + t * 0.5;
-                       self.owner.weapon_morph2angles = randomvec() * 3 + '30 -10 5';
-                       makevectors(self.owner.weapon_morph2angles_x * '-1 0 0' + self.owner.weapon_morph2angles_y * '0 1 0' + self.owner.weapon_morph2angles_z * '0 0 1');
-                       self.owner.weapon_morph2origin = QCWEAPONANIMATION_ORIGIN(self);
-
-                       self.owner.weapon_morph3time   = time + t;
-                       self.owner.weapon_morph3angles = '0 0 0';
-                       makevectors(self.owner.weapon_morph3angles_x * '-1 0 0' + self.owner.weapon_morph3angles_y * '0 1 0' + self.owner.weapon_morph3angles_z * '0 0 1');
-                       self.owner.weapon_morph3origin = QCWEAPONANIMATION_ORIGIN(self);
-               }
-               else if (r < 0.3)
-               {
-                       // tweak it a bit
-                       t = 5;
-                       self.owner.weapon_morph1time   = time + t * 0.3;
-                       self.owner.weapon_morph1angles = randomvec() * 6;
-                       makevectors(self.owner.weapon_morph1angles_x * '-1 0 0' + self.owner.weapon_morph1angles_y * '0 1 0' + self.owner.weapon_morph1angles_z * '0 0 1');
-                       self.owner.weapon_morph1origin = QCWEAPONANIMATION_ORIGIN(self);
-
-                       self.owner.weapon_morph2time   = time + t * 0.7;
-                       self.owner.weapon_morph2angles = randomvec() * 6;
-                       makevectors(self.owner.weapon_morph2angles_x * '-1 0 0' + self.owner.weapon_morph2angles_y * '0 1 0' + self.owner.weapon_morph2angles_z * '0 0 1');
-                       self.owner.weapon_morph2origin = QCWEAPONANIMATION_ORIGIN(self);
-
-                       self.owner.weapon_morph3time   = time + t;
-                       self.owner.weapon_morph3angles = '0 0 0';
-                       makevectors(self.owner.weapon_morph3angles_x * '-1 0 0' + self.owner.weapon_morph3angles_y * '0 1 0' + self.owner.weapon_morph3angles_z * '0 0 1');
-                       self.owner.weapon_morph3origin = QCWEAPONANIMATION_ORIGIN(self);
-               }
-               else
-               {
-                       // hold it mostly steady
-                       t = random() * 6 + 4;
-                       self.owner.weapon_morph1time   = time + t * 0.2;
-                       self.owner.weapon_morph1angles = randomvec() * 1;
-                       makevectors(self.owner.weapon_morph1angles_x * '-1 0 0' + self.owner.weapon_morph1angles_y * '0 1 0' + self.owner.weapon_morph1angles_z * '0 0 1');
-                       self.owner.weapon_morph1origin = QCWEAPONANIMATION_ORIGIN(self);
-
-                       self.owner.weapon_morph2time   = time + t * 0.5;
-                       self.owner.weapon_morph2angles = randomvec() * 1;
-                       makevectors(self.owner.weapon_morph2angles_x * '-1 0 0' + self.owner.weapon_morph2angles_y * '0 1 0' + self.owner.weapon_morph2angles_z * '0 0 1');
-                       self.owner.weapon_morph2origin = QCWEAPONANIMATION_ORIGIN(self);
-
-                       self.owner.weapon_morph3time   = time + t * 0.7;
-                       self.owner.weapon_morph3angles = randomvec() * 1;
-                       makevectors(self.owner.weapon_morph3angles_x * '-1 0 0' + self.owner.weapon_morph3angles_y * '0 1 0' + self.owner.weapon_morph3angles_z * '0 0 1');
-                       self.owner.weapon_morph3origin = QCWEAPONANIMATION_ORIGIN(self);
-               }
-
-               self.owner.weapon_morph4time   = time + t;
-               self.owner.weapon_morph4angles = '0 0 0';
-               makevectors(self.owner.weapon_morph4angles_x * '-1 0 0' + self.owner.weapon_morph4angles_y * '0 1 0' + self.owner.weapon_morph4angles_z * '0 0 1');
-               self.owner.weapon_morph4origin = QCWEAPONANIMATION_ORIGIN(self);
-
-       }
-};
+}
 
 void CL_ExteriorWeaponentity_Think()
 {
@@ -856,7 +660,6 @@ void CL_ExteriorWeaponentity_Think()
 
                if(autocvar_g_loituma)
                {
-                       vector moddir, modup;
                        vector modangles;
                        float t;
 
@@ -878,7 +681,7 @@ void CL_ExteriorWeaponentity_Think()
 
        self.glowmod = self.owner.weaponentity_glowmod;
        self.colormap = self.owner.colormap;
-};
+}
 
 // spawning weaponentity for client
 void CL_SpawnWeaponentity()
@@ -905,7 +708,7 @@ void CL_SpawnWeaponentity()
        self.exteriorweaponentity.angles = '0 0 0';
        self.exteriorweaponentity.think = CL_ExteriorWeaponentity_Think;
        self.exteriorweaponentity.nextthink = time;
-};
+}
 
 void Send_WeaponComplain (entity e, float wpn, string wpnname, float type)
 {
@@ -921,8 +724,8 @@ void Send_WeaponComplain (entity e, float wpn, string wpnname, float type)
 
 float client_hasweapon(entity cl, float wpn, float andammo, float complain)
 {
-       local float weaponbit, f;
-       local entity oldself;
+       float weaponbit, f;
+       entity oldself;
 
        if(time < self.hasweapon_complain_spam)
                complain = 0;
@@ -952,7 +755,7 @@ float client_hasweapon(entity cl, float wpn, float andammo, float complain)
                                f = f + weapon_action(wpn, WR_CHECKAMMO2);
 
                                // always allow selecting the Mine Layer if we placed mines, so that we can detonate them
-                               local entity mine;
+                               entity mine;
                                if(wpn == WEP_MINE_LAYER)
                                for(mine = world; (mine = find(mine, classname, "mine")); ) if(mine.owner == self)
                                        f = 1;
@@ -1017,7 +820,7 @@ float client_hasweapon(entity cl, float wpn, float andammo, float complain)
                play2(cl, "weapons/unavailable.wav");
        }
        return FALSE;
-};
+}
 
 // Weapon subs
 void w_clear()
@@ -1032,20 +835,19 @@ void w_clear()
                self.weaponentity.state = WS_CLEAR;
                self.weaponentity.effects = 0;
        }
-};
+}
 
 void w_ready()
 {
        if (self.weaponentity)
                self.weaponentity.state = WS_READY;
        weapon_thinkf(WFRAME_IDLE, 1000000, w_ready);
-};
+}
 
 // Setup weapon for client (after this raise frame will be launched)
 void weapon_setup(float windex)
 {
        entity e;
-       qcweaponanimation = autocvar_sv_qcweaponanimation;
        e = get_weaponinfo(windex);
        self.items &~= IT_AMMO;
        self.items = self.items | e.items;
@@ -1055,7 +857,7 @@ void weapon_setup(float windex)
        self.switchingweapon = windex; // to make sure
        self.weaponname = e.mdl;
        self.bulletcounter = 0;
-};
+}
 
 // perform weapon to attack (weaponstate and attack_finished check is here)
 void W_SwitchToOtherWeapon(entity pl)
@@ -1076,7 +878,7 @@ float weapon_prepareattack_checkammo(float secondary)
        if (!weapon_action(self.weapon, WR_CHECKAMMO1 + secondary))
        {
                // always keep the Mine Layer if we placed mines, so that we can detonate them
-               local entity mine;
+               entity mine;
                if(self.weapon == WEP_MINE_LAYER)
                for(mine = world; (mine = find(mine, classname, "mine")); ) if(mine.owner == self)
                        return FALSE;
@@ -1177,82 +979,16 @@ void weapon_thinkf(float fr, float t, void() func)
        if (self.weaponentity)
        {
                self.weaponentity.wframe = fr;
-               if (qcweaponanimation)
-               {
-                       if (fr != WFRAME_IDLE)
-                       {
-                               self.weapon_morph0time = time;
-                               self.weapon_morph0angles = self.weaponentity.angles;
-                               self.weapon_morph0origin = self.weaponentity.origin;
-
-                               self.weapon_morph1angles = '0 0 0';
-                               self.weapon_morph1time = time + t;
-                               makevectors(self.weapon_morph1angles_x * '-1 0 0' + self.weapon_morph1angles_y * '0 1 0' + self.weapon_morph1angles_z * '0 0 1');
-                               self.weapon_morph1origin = QCWEAPONANIMATION_ORIGIN(self.weaponentity);
-
-                               self.weapon_morph2angles = '0 0 0';
-                               self.weapon_morph2time = time + t;
-                               makevectors(self.weapon_morph2angles_x * '-1 0 0' + self.weapon_morph2angles_y * '0 1 0' + self.weapon_morph2angles_z * '0 0 1');
-                               self.weapon_morph2origin = QCWEAPONANIMATION_ORIGIN(self.weaponentity);
-
-                               self.weapon_morph3angles = '0 0 0';
-                               self.weapon_morph3time = time + t;
-                               makevectors(self.weapon_morph3angles_x * '-1 0 0' + self.weapon_morph3angles_y * '0 1 0' + self.weapon_morph3angles_z * '0 0 1');
-                               self.weapon_morph3origin = QCWEAPONANIMATION_ORIGIN(self.weaponentity);
-
-                               self.weapon_morph4angles = '0 0 0';
-                               self.weapon_morph4time = time + t;
-                               makevectors(self.weapon_morph4angles_x * '-1 0 0' + self.weapon_morph4angles_y * '0 1 0' + self.weapon_morph4angles_z * '0 0 1');
-                               self.weapon_morph4origin = QCWEAPONANIMATION_ORIGIN(self.weaponentity);
-
-                               if (fr == WFRAME_FIRE1)
-                               {
-                                       self.weapon_morph1angles = '5 0 0';
-                                       self.weapon_morph1time = time + t * 0.1;
-                                       makevectors(self.weapon_morph1angles_x * '-1 0 0' + self.weapon_morph1angles_y * '0 1 0' + self.weapon_morph1angles_z * '0 0 1');
-                                       self.weapon_morph1origin = QCWEAPONANIMATION_ORIGIN(self.weaponentity);
-                                       self.weapon_morph4time = time + t + 1; // delay idle effect
-                               }
-                               else if (fr == WFRAME_FIRE2)
-                               {
-                                       self.weapon_morph1angles = '10 0 0';
-                                       self.weapon_morph1time = time + t * 0.1;
-                                       makevectors(self.weapon_morph1angles_x * '-1 0 0' + self.weapon_morph1angles_y * '0 1 0' + self.weapon_morph1angles_z * '0 0 1');
-                                       self.weapon_morph1origin = QCWEAPONANIMATION_ORIGIN(self.weaponentity);
-                                       self.weapon_morph4time = time + t + 1; // delay idle effect
-                               }
-                               else if (fr == WFRAME_RELOAD)
-                               {
-                                       self.weapon_morph1time = time + t * 0.05;
-                                       self.weapon_morph1angles = '-10 40 0';
-                                       makevectors(self.weapon_morph1angles_x * '-1 0 0' + self.weapon_morph1angles_y * '0 1 0' + self.weapon_morph1angles_z * '0 0 1');
-                                       self.weapon_morph1origin = QCWEAPONANIMATION_ORIGIN(self.weaponentity);
-
-                                       self.weapon_morph2time = time + t * 0.15;
-                                       self.weapon_morph2angles = '-10 40 5';
-                                       makevectors(self.weapon_morph2angles_x * '-1 0 0' + self.weapon_morph2angles_y * '0 1 0' + self.weapon_morph2angles_z * '0 0 1');
-                                       self.weapon_morph2origin = QCWEAPONANIMATION_ORIGIN(self.weaponentity);
-
-                                       self.weapon_morph3time = time + t * 0.25;
-                                       self.weapon_morph3angles = '-10 40 0';
-                                       makevectors(self.weapon_morph3angles_x * '-1 0 0' + self.weapon_morph3angles_y * '0 1 0' + self.weapon_morph3angles_z * '0 0 1');
-                                       self.weapon_morph3origin = QCWEAPONANIMATION_ORIGIN(self.weaponentity);
-                               }
-                       }
-               }
-               else
-               {
-                       if (fr == WFRAME_IDLE)
-                               a = self.weaponentity.anim_idle;
-                       else if (fr == WFRAME_FIRE1)
-                               a = self.weaponentity.anim_fire1;
-                       else if (fr == WFRAME_FIRE2)
-                               a = self.weaponentity.anim_fire2;
-                       else if (fr == WFRAME_RELOAD)
-                               a = self.weaponentity.anim_reload;
-                       a_z *= g_weaponratefactor;
-                       setanim(self.weaponentity, a, restartanim == FALSE, restartanim, restartanim);
-               }
+               if (fr == WFRAME_IDLE)
+                       a = self.weaponentity.anim_idle;
+               else if (fr == WFRAME_FIRE1)
+                       a = self.weaponentity.anim_fire1;
+               else if (fr == WFRAME_FIRE2)
+                       a = self.weaponentity.anim_fire2;
+               else if (fr == WFRAME_RELOAD)
+                       a = self.weaponentity.anim_reload;
+               a_z *= g_weaponratefactor;
+               setanim(self.weaponentity, a, restartanim == FALSE, restartanim, restartanim);
        }
 
        v_forward = of;
@@ -1294,13 +1030,19 @@ void weapon_thinkf(float fr, float t, void() func)
                        anim_z = anim_y / (t + sys_frametime);
                        setanim(self, anim, FALSE, TRUE, TRUE);
                }
+               else if (self.animstate_startframe == self.anim_idle_x) // only allow shoot anim to override idle animation until we have animation blending
+               {
+                       anim = self.anim_shoot;
+                       anim_z = anim_y / (t + sys_frametime);
+                       setanim(self, anim, FALSE, TRUE, TRUE);
+               }
        }
-};
+}
 
 void weapon_boblayer1(float spd, vector org)
 {
        // VorteX: haste can be added here
-};
+}
 
 vector W_CalculateProjectileVelocity(vector pvelocity, vector mvelocity, float forceAbsolute)
 {
@@ -1379,38 +1121,30 @@ void W_AttachToShotorg(entity flash, vector offset)
        entity xflash;
        flash.owner = self;
        flash.angles_z = random() * 360;
-       if(qcweaponanimation)
-       {
-               setorigin(flash, w_shotorg + w_shotdir * 50);
-               flash.angles = vectoangles(w_shotdir);
-               flash.angles_z = random() * 360;
-       }
+
+       if(gettagindex(self.weaponentity, "shot"))
+               setattachment(flash, self.weaponentity, "shot");
        else
-       {
-               if(gettagindex(self.weaponentity, "shot"))
-                       setattachment(flash, self.weaponentity, "shot");
-               else
-                       setattachment(flash, self.weaponentity, "tag_shot");
-               setorigin(flash, offset);
+               setattachment(flash, self.weaponentity, "tag_shot");
+       setorigin(flash, offset);
 
-               xflash = spawn();
-               copyentity(flash, xflash);
+       xflash = spawn();
+       copyentity(flash, xflash);
 
-               flash.viewmodelforclient = self;
+       flash.viewmodelforclient = self;
 
-               if(self.weaponentity.oldorigin_x > 0)
-               {
-                       setattachment(xflash, self.exteriorweaponentity, "");
-                       setorigin(xflash, self.weaponentity.oldorigin + offset);
-               }
+       if(self.weaponentity.oldorigin_x > 0)
+       {
+               setattachment(xflash, self.exteriorweaponentity, "");
+               setorigin(xflash, self.weaponentity.oldorigin + offset);
+       }
+       else
+       {
+               if(gettagindex(self.exteriorweaponentity, "shot"))
+                       setattachment(xflash, self.exteriorweaponentity, "shot");
                else
-               {
-                       if(gettagindex(self.exteriorweaponentity, "shot"))
-                               setattachment(xflash, self.exteriorweaponentity, "shot");
-                       else
-                               setattachment(xflash, self.exteriorweaponentity, "tag_shot");
-                       setorigin(xflash, offset);
-               }
+                       setattachment(xflash, self.exteriorweaponentity, "tag_shot");
+               setorigin(xflash, offset);
        }
 }
 
index f89d383631c453c35f2d64ee2fd0d82528d56a6e..2ffa4afd9007578ba97f864e7f41621d02f328db 100644 (file)
@@ -174,7 +174,7 @@ void SV_ParseClientCommand(string s) {
        } else if(cmd == "autoswitch") {
                // be backwards compatible with older clients (enabled)
                self.autoswitch = ("0" != argv(1));
-               local string autoswitchmsg;
+               string autoswitchmsg;
                if (self.autoswitch) {
                        autoswitchmsg = "on";
                } else {
@@ -450,7 +450,7 @@ void SV_ParseClientCommand(string s) {
 
 void ReadyRestartForce()
 {
-       local entity e;
+       entity e;
 
        bprint("^1Server is restarting...\n");
 
@@ -538,8 +538,8 @@ void ReadyRestart()
  */
 void ReadyCount()
 {
-       local entity e;
-       local float r, p;
+       entity e;
+       float r, p;
 
        r = p = 0;
 
@@ -590,10 +590,10 @@ void evaluateTimeout() {
                //if the map uses a timelimit make sure that timeout cannot be called right before the map ends
                if (autocvar_timelimit) {
                        //a timelimit was used
-                       local float myTl;
+                       float myTl;
                        myTl = autocvar_timelimit;
 
-                       local float lastPossibleTimeout;
+                       float lastPossibleTimeout;
                        lastPossibleTimeout = (myTl*60) - autocvar_sv_timeout_leadtime - 1;
 
                        if (lastPossibleTimeout < time - game_starttime)
index 7b78958451dc79f6ae5d5ae80eac1d16343b858c..6f7198c2a9f225e803fe7f63d5faa557063262a6 100644 (file)
@@ -193,7 +193,7 @@ void place_flag()
        }
 
        InitializeEntity(self, ctf_flag_spawnstuff, INITPRIO_SETLOCATION);
-};
+}
 
 void LogCTF(string mode, float flagteam, entity actor)
 {
@@ -232,7 +232,7 @@ void RegenFlag(entity e)
        e.cnt = FLAG_BASE;
        e.owner = world;
        e.flags = FL_ITEM | FL_NOTARGET; // clear FL_ONGROUND and any other junk
-};
+}
 
 void ReturnFlag(entity e)
 {
@@ -253,11 +253,11 @@ void ReturnFlag(entity e)
        }
        e.owner = world;
        RegenFlag(e);
-};
+}
 
 void DropFlag(entity e, entity penalty_receiver, entity attacker)
 {
-       local entity p;
+       entity p;
 
        if(e.classname != "item_flag_team")
        {
@@ -329,11 +329,11 @@ void DropFlag(entity e, entity penalty_receiver, entity attacker)
        tracebox(e.origin, e.mins, e.maxs, e.origin, TRUE, e);
        if(trace_startsolid)
                dprint("FLAG FALLTHROUGH will happen SOON\n");
-};
+}
 
 void FlagThink()
 {
-       local entity e;
+       entity e;
 
        self.nextthink = time + 0.1;
 
@@ -402,7 +402,7 @@ void FlagThink()
                DropFlag(self, world, world);
                return;
        }
-};
+}
 
 float ctf_usekey()
 {
@@ -417,15 +417,15 @@ float ctf_usekey()
 void flag_cap_ring_spawn(vector org)
 {
        shockwave_spawn("models/ctf/shockwavetransring.md3", org - '0 0 15', -0.8, 0, 1);
-};
+}
 
 void FlagTouch()
 {
        if(gameover) return;
 
-       local float t;
-       local entity player;
-       local string s, s0, h0, h1;
+       float t;
+       entity player;
+       string s, s0, h0, h1;
        if (other.classname != "player")
                return;
        if (other.health < 1) // ignore dead players
@@ -635,7 +635,7 @@ void FlagTouch()
                        WaypointSprite_AttachCarrier("flagcarrier", other, RADARICON_FLAGCARRIER, '1 1 0');
                }
        }
-};
+}
 
 /*QUAKED spawnfunc_info_player_team1 (1 0 0) (-16 -16 -24) (16 16 24)
 CTF Starting point for a player
@@ -654,8 +654,8 @@ void spawnfunc_info_player_team1()
        }
        self.team = COLOR_TEAM1; // red
        spawnfunc_info_player_deathmatch();
-};
-//self.team = 4;self.classname = "info_player_start";spawnfunc_info_player_start();};
+}
+//self.team = 4;self.classname = "info_player_start";spawnfunc_info_player_start();}
 
 /*QUAKED spawnfunc_info_player_team2 (1 0 0) (-16 -16 -24) (16 16 24)
 CTF Starting point for a player in
@@ -674,8 +674,8 @@ void spawnfunc_info_player_team2()
        }
        self.team = COLOR_TEAM2; // blue
        spawnfunc_info_player_deathmatch();
-};
-//self.team = 13;self.classname = "info_player_start";spawnfunc_info_player_start();};
+}
+//self.team = 13;self.classname = "info_player_start";spawnfunc_info_player_start();}
 
 /*QUAKED spawnfunc_info_player_team3 (1 0 0) (-16 -16 -24) (16 16 24)
 CTF Starting point for a player in
@@ -694,7 +694,7 @@ void spawnfunc_info_player_team3()
        }
        self.team = COLOR_TEAM3; // yellow
        spawnfunc_info_player_deathmatch();
-};
+}
 
 
 /*QUAKED spawnfunc_info_player_team4 (1 0 0) (-16 -16 -24) (16 16 24)
@@ -714,7 +714,7 @@ void spawnfunc_info_player_team4()
        }
        self.team = COLOR_TEAM4; // purple
        spawnfunc_info_player_deathmatch();
-};
+}
 
 void item_flag_reset()
 {
@@ -741,7 +741,7 @@ void item_flag_postspawn()
                self.glow_size = 25;
                self.glow_trail = 1;
        }
-};
+}
 
 /*QUAKED spawnfunc_item_flag_team1 (0 0.5 0.8) (-48 -48 -37) (48 48 37)
 CTF flag for team one (Red).
@@ -841,7 +841,7 @@ void spawnfunc_item_flag_team1()
        precache_model("models/ctf/shockwavetransring.md3");
 
        self.reset = item_flag_reset;
-};
+}
 
 /*QUAKED spawnfunc_item_flag_team2 (0 0.5 0.8) (-48 -48 -24) (48 48 64)
 CTF flag for team two (Blue).
@@ -940,7 +940,7 @@ void spawnfunc_item_flag_team2()
        precache_model("models/ctf/shockwavetransring.md3");
 
        self.reset = item_flag_reset;
-};
+}
 
 
 /*QUAKED spawnfunc_ctf_team (0 .5 .8) (-16 -16 -24) (16 16 32)
@@ -967,12 +967,12 @@ void spawnfunc_ctf_team()
        }
        self.classname = "ctf_team";
        self.team = self.cnt + 1;
-};
+}
 
 // code from here on is just to support maps that don't have control point and team entities
 void ctf_spawnteam (string teamname, float teamcolor)
 {
-       local entity oldself;
+       entity oldself;
        oldself = self;
        self = spawn();
        self.classname = "ctf_team";
@@ -982,7 +982,7 @@ void ctf_spawnteam (string teamname, float teamcolor)
        spawnfunc_ctf_team();
 
        self = oldself;
-};
+}
 
 // spawn some default teams if the map is not set up for ctf
 void ctf_spawnteams()
@@ -993,7 +993,7 @@ void ctf_spawnteams()
 
        ctf_spawnteam("Red", COLOR_TEAM1 - 1);
        ctf_spawnteam("Blue", COLOR_TEAM2 - 1);
-};
+}
 
 void ctf_delayedinit()
 {
@@ -1002,7 +1002,7 @@ void ctf_delayedinit()
                ctf_spawnteams();
 
        ScoreRules_ctf();
-};
+}
 
 void ctf_init()
 {
@@ -1017,7 +1017,7 @@ void ctf_init()
 //#NO AUTOCVARS START
        g_ctf_win_mode = cvar("g_ctf_win_mode");
 //#NO AUTOCVARS END
-};
+}
 
 void ctf_setstatus2(entity flag, float shift)
 {
@@ -1032,7 +1032,7 @@ void ctf_setstatus2(entity flag, float shift)
        {
                // no status bits
        }
-};
+}
 
 void ctf_setstatus()
 {
@@ -1042,7 +1042,7 @@ void ctf_setstatus()
        self.items &~= IT_BLUE_FLAG_LOST;
        self.items &~= IT_CTF_SHIELDED;
 
-       local entity flag;
+       entity flag;
        float redflags, blueflags;
 
        if(self.ctf_captureshielded)
@@ -1078,9 +1078,9 @@ void ctf_setstatus()
                                ctf_setstatus2(flag, IT_BLUE_FLAG_TAKEN);
                }
        }
-};
+}
 /*
-entity(float cteam) ctf_team_has_commander =
+entity ctf_team_has_commander(float cteam)
 {
        entity pl;
        if(cteam != COLOR_TEAM1 || cteam != COLOR_TEAM2)
@@ -1092,15 +1092,15 @@ entity(float cteam) ctf_team_has_commander =
                }
        }
        return world;
-};
+}
 
-void(entity e, float st) ctf_setstate =
+void ctf_setstate(entity e, float st)
 {
        e.ctf_state = st;
        ++e.version;
-};
+}
 
-void(float cteam) ctf_new_commander =
+void ctf_new_commander(float cteam)
 {
        entity pl, plmax;
 
@@ -1123,9 +1123,9 @@ void(float cteam) ctf_new_commander =
        ctf_setstate(plmax, 3);
        sprint(plmax, "^3You're the commander now!\n");
        centerprint(plmax, "^3You're the commander now!\n");
-};
+}
 
-void() ctf_clientconnect =
+void ctf_clientconnect()
 {
        self.iscommander = FALSE;
 
@@ -1139,9 +1139,9 @@ void() ctf_clientconnect =
        if(self.team != 0 && self.classname == "player" && !ctf_team_has_commander(self.team)) {
                ctf_new_commander(self.team);
        }
-};
+}
 
-void() ctf_playerchanged =
+void ctf_playerchanged()
 {
        if(!self.team || self.classname != "player") {
                ctf_setstate(self, -1);
@@ -1164,18 +1164,18 @@ void() ctf_playerchanged =
        self.team_saved = self.team;
 
        ctf_new_commander(self.team);
-};
+}
 
-void() ctf_clientdisconnect =
+void ctf_clientdisconnect()
 {
        if(self.iscommander)
        {
                ctf_new_commander(self.team);
        }
-};
+}
 
 entity GetPlayer(string);
-float() ctf_clientcommand =
+float ctf_clientcommand()
 {
        entity e;
        if(argv(0) == "order") {
@@ -1216,5 +1216,5 @@ float() ctf_clientcommand =
                return TRUE;
        }
        return FALSE;
-};
+}
 */
index 5915773ce20c487c51ae519823edabf2bf2eb470..d9b6fec2ecf56b39397503ad43e4f2260e3499b1 100644 (file)
@@ -128,7 +128,7 @@ float maxclients;
 .vector anim_die1; // player dies
 .vector anim_die2; // player dies differently
 .vector anim_draw; // player pulls out a weapon
-.vector anim_duck; // player crouches (from idle to duckidle)
+// .vector anim_duck; // player crouches (from idle to duckidle)
 .vector anim_duckwalk; // player walking while crouching
 .vector anim_duckjump; // player jumping from a crouch
 .vector anim_duckidle; // player idling while crouching
@@ -189,6 +189,7 @@ void setanim(entity e, vector anim, float looping, float override, float restart
 
 .float watersound_finished;
 .float iscreature;
+.float damagedbycontents;
 .vector oldvelocity;
 
 .float pauseregen_finished;
index a4cee747131100efe733169aa349c65b46defcd5..9e56023cb500ebb5425d08321fbff54d55d4a7e8 100644 (file)
@@ -60,8 +60,8 @@ void() dom_spawnteams;
 
 void dompoint_captured ()
 {
-       local entity head;
-       local float old_delay, old_team, real_team;
+       entity head;
+       float old_delay, old_team, real_team;
 
        // now that the delay has expired, switch to the latest team to lay claim to this point
        head = self.owner;
@@ -179,7 +179,7 @@ void dompoint_captured ()
 
        FOR_EACH_REALCLIENT(head)
                set_dom_state(head);
-};
+}
 
 void AnimateDomPoint()
 {
@@ -196,7 +196,7 @@ void AnimateDomPoint()
 
 void dompointthink()
 {
-       local float fragamt;
+       float fragamt;
 
        self.nextthink = time + 0.1;
 
@@ -239,7 +239,7 @@ void dompointthink()
 
 void dompointtouch()
 {
-       local entity head;
+       entity head;
        if (other.classname != "player")
                return;
        if (other.health < 1)
@@ -287,7 +287,7 @@ void dompointtouch()
        self.enemy = other; // individual player scoring
        self.enemy_playerid = other.playerid;
        dompoint_captured();
-};
+}
 
 /*QUAKED spawnfunc_dom_team (0 .5 .8) (-32 -32 -24) (32 32 32)
 Team declaration for Domination gameplay, this allows you to decide what team
@@ -336,11 +336,11 @@ void spawnfunc_dom_team()
        // this would have to be changed if used in quakeworld
        if(self.cnt)
                self.team = self.cnt + 1; // WHY are these different anyway?
-};
+}
 
 void dom_controlpoint_setup()
 {
-       local entity head;
+       entity head;
        // find the spawnfunc_dom_team representing unclaimed points
        head = find(world, classname, "dom_team");
        while(head && head.netname != "")
@@ -391,7 +391,7 @@ void dom_controlpoint_setup()
 
        waypoint_spawnforitem(self);
        WaypointSprite_SpawnFixed("dom-neut", self.origin + '0 0 32', self, sprite, RADARICON_DOMPOINT, '0 1 1');
-};
+}
 
 
 
@@ -607,12 +607,12 @@ void spawnfunc_dom_controlpoint()
        self.effects = self.effects | EF_LOWPRECISION;
        if (autocvar_g_domination_point_fullbright)
                self.effects |= EF_FULLBRIGHT;
-};
+}
 
 // code from here on is just to support maps that don't have control point and team entities
 void dom_spawnteam (string teamname, float teamcolor, string pointmodel, float pointskin, string capsound, string capnarration, string capmessage)
 {
-       local entity oldself;
+       entity oldself;
        oldself = self;
        self = spawn();
        self.classname = "dom_team";
@@ -635,11 +635,11 @@ void dom_spawnteam (string teamname, float teamcolor, string pointmodel, float p
 
        //eprint(self);
        self = oldself;
-};
+}
 
 void dom_spawnpoint(vector org)
 {
-       local entity oldself;
+       entity oldself;
        oldself = self;
        self = spawn();
        self.classname = "dom_controlpoint";
@@ -648,7 +648,7 @@ void dom_spawnpoint(vector org)
        setorigin(self, org);
        spawnfunc_dom_controlpoint();
        self = oldself;
-};
+}
 
 // spawn some default teams if the map is not set up for domination
 void dom_spawnteams()
@@ -666,11 +666,11 @@ void dom_spawnteams()
        if(numteams > 3)
                dom_spawnteam("Pink", COLOR_TEAM4-1, "models/domination/dom_pink.md3", 0, "domination/claim.wav", "", "Pink team has captured a control point");
        dom_spawnteam("", 0, "models/domination/dom_unclaimed.md3", 0, "", "", "");
-};
+}
 
 void dom_delayedinit()
 {
-       local entity head;
+       entity head;
 
        // if no teams are found, spawn defaults, if custom teams are set, use them
        if (find(world, classname, "dom_team") == world || autocvar_g_domination_teams_override >= 2)
@@ -691,7 +691,7 @@ void dom_delayedinit()
        }
 
        ScoreRules_dom();
-};
+}
 
 void dom_init()
 {
@@ -711,5 +711,5 @@ void dom_init()
        addstat(STAT_DOM_PPS_BLUE, AS_FLOAT, dom_pps_blue);
        if(c3 >= 0) addstat(STAT_DOM_PPS_YELLOW, AS_FLOAT, dom_pps_yellow);
        if(c4 >= 0) addstat(STAT_DOM_PPS_PINK, AS_FLOAT, dom_pps_pink);
-};
+}
 
index f127fb26e83e7a4471b7f6dfe09faaacf648becd..af9a73ecaed21e347608e137aa2ec52b6ccd5d81 100644 (file)
@@ -18,7 +18,7 @@
 void entcs_init()
 {
        print("Initializing ClientSide information entities\n");
-};
+}
 
 float entcs_customize()
 {
@@ -56,7 +56,7 @@ float entcs_send(entity to, float sf)
        if(sf & 16)
                WriteByte(MSG_ENTITY, self.armorvalue / 10); // FIXME use a better scale?
        return TRUE;
-};
+}
 
 void entcs_think()
 {
@@ -85,11 +85,11 @@ void entcs_think()
                self.armorvalue = o.armorvalue;
                self.SendFlags |= 16;
        }
-};
+}
 
 entity attach_entcs()
 {
-       local entity ent;
+       entity ent;
 
        ent = spawn();
        ent.classname = "entcs_sender_v2";
@@ -103,10 +103,10 @@ entity attach_entcs()
        self.entcs = ent;
 
        return ent;
-};
+}
 
 void detach_entcs()
 {
        remove(self.entcs);
        self.entcs = world;
-};
+}
index 57d943438e5a2f36caf3c9c37dfad4b7cb4ff34d..c514de5687b82c95f41ff9ef1685b87293b1d7f1 100644 (file)
@@ -1385,7 +1385,7 @@ float(entity clent) clienttype = #455; // returns one of the CLIENTTYPE_* consta
 //How to use:
 /*
        // to spawn a bot
-       local entity oldself;
+       entity oldself;
        oldself = self;
        self = spawnclient();
        if (!self)
@@ -1401,7 +1401,7 @@ float(entity clent) clienttype = #455; // returns one of the CLIENTTYPE_* consta
        self = oldself;
 
        // to remove all bots
-       local entity head;
+       entity head;
        head = find(world, classname, "player");
        while (head)
        {
@@ -1463,9 +1463,9 @@ float(entity clent) clienttype = #455; // returns one of the CLIENTTYPE_* consta
 //it is a good idea to return FALSE early in the function if possible to reduce cpu usage, because this function may be called many thousands of times per frame if there are many customized entities on a 64+ player server.
 //you are free to change anything in self, but please do not change any other entities (the results may be very inconsistent).
 //example ideas for use of this extension:
-//making icons over teammates' heads which are only visible to teammates.  for exasmple: float() playericon_customizeentityforclient = {return self.owner.team == other.team;};
-//making cloaked players more visible to their teammates than their enemies.  for example: float() player_customizeentityforclient = {if (self.items & IT_CLOAKING) {if (self.team == other.team) self.alpha = 0.6;else self.alpha = 0.1;} return TRUE;};
-//making explosion models that face the viewer (does not work well with chase_active).  for example: float() explosion_customizeentityforclient = {self.angles = vectoangles(other.origin + other.view_ofs - self.origin);self.angles_x = 0 - self.angles_x;};
+//making icons over teammates' heads which are only visible to teammates.  for exasmple: float() playericon_customizeentityforclient = {return self.owner.team == other.team;}
+//making cloaked players more visible to their teammates than their enemies.  for example: float() player_customizeentityforclient = {if (self.items & IT_CLOAKING) {if (self.team == other.team) self.alpha = 0.6;else self.alpha = 0.1;} return TRUE;}
+//making explosion models that face the viewer (does not work well with chase_active).  for example: float() explosion_customizeentityforclient = {self.angles = vectoangles(other.origin + other.view_ofs - self.origin);self.angles_x = 0 - self.angles_x;}
 //implementation notes:
 //entity customization is done before per-client culling (visibility for instance) because the entity may be doing setorigin to display itself in different locations on different clients, may be altering its .modelindex, .effects and other fields important to culling, so customized entities increase cpu usage (non-customized entities can use all the early culling they want however, as they are not changing on a per client basis).
 
@@ -2145,7 +2145,7 @@ float(float modlindex, float framenum) frameduration = #277; // returns the inte
 //"leftarm" (which is a child of "torso") which would return 2 instead...
 float(float skel, float bonenum, string g1, string g2, string g3, string g4, string g5, string g6) example_skel_findbonegroup =
 {
-       local string bonename;
+       string bonename;
        while (bonenum >= 0)
        {
                bonename = skel_get_bonename(skel, bonenum);
@@ -2158,12 +2158,12 @@ float(float skel, float bonenum, string g1, string g2, string g3, string g4, str
                bonenum = skel_get_boneparent(skel, bonenum);
        }
        return 0;
-};
+}
 // create a skeletonindex for our player using current modelindex
 void() example_skel_player_setup =
 {
        self.skeletonindex = skel_create(self.modelindex);
-};
+}
 // setup bones of skeleton based on an animation
 // note: animmodelindex can be a different model than self.modelindex
 void(float animmodelindex, float framegroup, float framegroupstarttime) example_skel_player_update_begin =
@@ -2181,12 +2181,12 @@ void(float animmodelindex, float framegroup, float framegroupstarttime) example_
        self.lerpfrac3 = 0;
        self.lerpfrac4 = 0;
        skel_build(self.skeletonindex, self, animmodelindex, 0, 0, 100000);
-};
+}
 // apply a different framegroup animation to bones with a specified parent
 void(float animmodelindex, float framegroup, float framegroupstarttime, float blendalpha, string groupbonename, string excludegroupname1, string excludegroupname2) example_skel_player_update_applyoverride =
 {
-       local float bonenum;
-       local float numbones;
+       float bonenum;
+       float numbones;
        self.frame = framegroup;
        self.frame2 = 0;
        self.frame3 = 0;
@@ -2206,18 +2206,18 @@ void(float animmodelindex, float framegroup, float framegroupstarttime, float bl
                        skel_build(self.skeletonindex, self, animmodelindex, 1 - blendalpha, bonenum, bonenum + 1);
                bonenum = bonenum + 1;
        }
-};
+}
 // make eyes point at a target location, be sure v_forward, v_right, v_up are set correctly before calling
 void(vector eyetarget, string bonename) example_skel_player_update_eyetarget =
 {
-       local float bonenum;
-       local vector ang;
-       local vector oldforward, oldright, oldup;
-       local vector relforward, relright, relup, relorg;
-       local vector boneforward, boneright, boneup, boneorg;
-       local vector parentforward, parentright, parentup, parentorg;
-       local vector u, v;
-       local vector modeleyetarget;
+       float bonenum;
+       vector ang;
+       vector oldforward, oldright, oldup;
+       vector relforward, relright, relup, relorg;
+       vector boneforward, boneright, boneup, boneorg;
+       vector parentforward, parentright, parentup, parentorg;
+       vector u, v;
+       vector modeleyetarget;
        bonenum = skel_find_bone(self.skeletonindex, bonename) - 1;
        if (bonenum < 0)
                return;
@@ -2257,14 +2257,14 @@ void(vector eyetarget, string bonename) example_skel_player_update_eyetarget =
        v_forward = oldforward;
        v_right = oldright;
        v_up = oldup;
-};
+}
 // delete skeleton when we're done with it
 // note: skeleton remains valid until next frame when it is really deleted
 void() example_skel_player_delete =
 {
        skel_delete(self.skeletonindex);
        self.skeletonindex = 0;
-};
+}
 //
 // END OF EXAMPLES FOR FTE_CSQC_SKELETONOBJECTS
 //
index 192e5cd7fb2e69f5b20b5708f4aec9af11224e28..4d29b014faff68c9528bb954d3d51512e88b6d3e 100644 (file)
@@ -37,7 +37,7 @@ void func_breakable_damage(entity inflictor, entity attacker, float damage, floa
 // func_breakable
 // - basically func_assault_destructible for general gameplay use
 //
-void LaunchDebris (string debrisname, vector force) =
+void LaunchDebris (string debrisname, vector force)
 {
        local   entity dbr;
 
@@ -65,7 +65,7 @@ void LaunchDebris (string debrisname, vector force) =
        if(dbr.damageforcescale)
                dbr.takedamage = DAMAGE_YES;
        SUB_SetFade(dbr, time + self.debristime + crandom() * self.debristimejitter, self.debrisfadetime);
-};
+}
 
 void func_breakable_colormod()
 {
@@ -83,7 +83,7 @@ void func_breakable_colormod()
 
 void func_breakable_look_destroyed()
 {
-       local float floor_z;
+       float floor_z;
 
        if(self.solid == SOLID_BSP) // in case a misc_follow moved me, save the current origin first
                self.dropped_origin = self.origin;
index 994ee260baefb3384a4522de33f146b2d562bcdb..5a583fc15ad101f07180877866f28641c5247c07 100644 (file)
@@ -501,7 +501,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
        if (gameover || targ.killcount == -666)
                return;
 
-       local entity oldself;
+       entity oldself;
        oldself = self;
        self = targ;
         damage_targ = targ;
@@ -758,26 +758,29 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
                if(targ.takedamage == DAMAGE_AIM)
                if(targ != attacker)
                {
-                       if(targ.classname == "player")
+                       if(damage_headshotbonus > 0)
                        {
-                               // HEAD SHOT:
-                               // find height of hit on player axis
-                               // if above view_ofs and below maxs, and also in the middle half of the bbox, it is head shot
-                               vector headmins, headmaxs, org;
-                               org = antilag_takebackorigin(targ, time - ANTILAG_LATENCY(attacker));
-                               headmins = org + GetHeadshotMins(targ);
-                               headmaxs = org + GetHeadshotMaxs(targ);
-                               if(trace_hits_box(railgun_start, railgun_end, headmins, headmaxs))
+                               if(targ.classname == "player")
+                               {
+                                       // HEAD SHOT:
+                                       // find height of hit on player axis
+                                       // if above view_ofs and below maxs, and also in the middle half of the bbox, it is head shot
+                                       vector headmins, headmaxs, org;
+                                       org = antilag_takebackorigin(targ, time - ANTILAG_LATENCY(attacker));
+                                       headmins = org + GetHeadshotMins(targ);
+                                       headmaxs = org + GetHeadshotMaxs(targ);
+                                       if(trace_hits_box(railgun_start, railgun_end, headmins, headmaxs))
+                                       {
+                                               deathtype |= HITTYPE_HEADSHOT;
+                                       }
+                               }
+                               else if(targ.classname == "turret_head")
                                {
                                        deathtype |= HITTYPE_HEADSHOT;
                                }
+                               if(deathtype & HITTYPE_HEADSHOT)
+                                       damage *= 1 + damage_headshotbonus;
                        }
-                       else if(targ.classname == "turret_head")
-                       {
-                               deathtype |= HITTYPE_HEADSHOT;
-                       }
-                       if(deathtype & HITTYPE_HEADSHOT)
-                               damage *= 1 + damage_headshotbonus;
 
                        entity victim;
                        if((targ.vehicle_flags & VHF_ISVEHICLE) && targ.owner)
@@ -985,13 +988,13 @@ float RadiusDamage (entity inflictor, entity attacker, float coredamage, float e
                                        finaldmg = coredamage * power + edgedamage * (1 - power);
                                        if (finaldmg > 0)
                                        {
-                                               local float a;
-                                               local float c;
-                                               local float hits;
-                                               local float total;
-                                               local float hitratio;
-                                               local vector hitloc;
-                                               local vector myblastorigin;
+                                               float a;
+                                               float c;
+                                               float hits;
+                                               float total;
+                                               float hitratio;
+                                               vector hitloc;
+                                               vector myblastorigin;
                                                myblastorigin = WarpZone_TransformOrigin(targ, blastorigin);
                                                center = targ.origin + (targ.mins + targ.maxs) * 0.5;
                                                // if it's a player, use the view origin as reference
index 4f655ca5738220c1dc75da1c95849f347b2cef68..b08ef098609732a67a18effdfd6e094d7f1f4a3e 100644 (file)
@@ -116,9 +116,9 @@ void GrapplingHookThink()
 {
        float spd, dist, minlength, pullspeed, ropestretch, ropeairfriction, rubberforce, newlength, rubberforce_overstretch, s;
        vector dir, org, end, v0, dv, v, myorg, vs;
-       if(self.realowner.health <= 0 || self.realowner.hook != self)   // how did that happen?
-       {                                                                                                               // well, better fix it anyway
-               remove(self);
+       if(self.realowner.hook != self) // how did that happen?
+       {
+               error("Owner lost the hook!\n");
                return;
        }
        if(LostMovetypeFollow(self))
@@ -271,25 +271,29 @@ void GrapplingHookTouch (void)
 
 void GrapplingHook_Damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
 {
-       if(self.health > 0)
+       if(self.health <= 0)
+               return;
+               
+       if (!W_CheckProjectileDamage(inflictor.realowner, self.realowner, deathtype, -1)) // no exceptions
+               return; // g_balance_projectiledamage says to halt
+                       
+       self.health = self.health - damage;
+               
+       if (self.health <= 0)
        {
-               self.health = self.health - damage;
-               if (self.health <= 0)
+               if(attacker != self.realowner)
                {
-                       if(attacker != self.realowner)
-                       {
-                               self.realowner.pusher = attacker;
-                               self.realowner.pushltime = time + autocvar_g_maxpushtime;
-                       }
-                       RemoveGrapplingHook(self.realowner);
+                       self.realowner.pusher = attacker;
+                       self.realowner.pushltime = time + autocvar_g_maxpushtime;
                }
+               RemoveGrapplingHook(self.realowner);
        }
 }
 
 void FireGrapplingHook (void)
 {
-       local entity missile;
-       local vector org;
+       entity missile;
+       vector org;
        float s;
        vector vs;
 
@@ -324,6 +328,7 @@ void FireGrapplingHook (void)
        self.hook = missile;
        missile.reset = GrapplingHookReset;
        missile.classname = "grapplinghook";
+       missile.flags = FL_PROJECTILE;
 
        missile.movetype = MOVETYPE_FLY;
        PROJECTILE_MAKETRIGGER(missile);
@@ -349,6 +354,7 @@ void FireGrapplingHook (void)
        missile.event_damage = GrapplingHook_Damage;
        missile.takedamage = DAMAGE_AIM;
        missile.damageforcescale = 0;
+       missile.damagedbycontents = (autocvar_g_balance_grapplehook_damagedbycontents);
 
        missile.hook_start = missile.hook_end = missile.origin;
 
index d5cc657bffc7f50bf860182748ccd1e608326ed3..b5f4bcf8441b0f382dd10813e60c1517c80107be 100644 (file)
@@ -34,10 +34,10 @@ void dynlight_think()
                remove(self);
 
        self.nextthink = time + 0.1;
-};
+}
 void dynlight_find_aiment()
 {
-       local entity targ;
+       entity targ;
        if (!self.target)
                objerror ("dynlight: no target to follow");
 
@@ -50,10 +50,10 @@ void dynlight_find_aiment()
        self.v_angle = self.angles - targ.angles;
        self.think = dynlight_think;
        self.nextthink = time + 0.1;
-};
+}
 void dynlight_find_path()
 {
-       local entity targ;
+       entity targ;
        if (!self.target)
                objerror ("dynlight: no target to follow");
 
@@ -62,10 +62,10 @@ void dynlight_find_path()
        setorigin (self, targ.origin);
        self.think = train_next;
        self.nextthink = time + 0.1;
-};
+}
 void dynlight_find_target()
 {
-       local entity targ;
+       entity targ;
        if (!self.target)
                objerror ("dynlight: no target to follow");
 
@@ -81,7 +81,7 @@ void dynlight_use()
                self.light_lev = self.lefty;
        else
                self.light_lev = 0;
-};
+}
 void spawnfunc_dynlight()
 {
        local   entity  targ;
@@ -125,4 +125,4 @@ void spawnfunc_dynlight()
                InitializeEntity(self, dynlight_find_path, INITPRIO_FINDTARGET);
                return;
        }
-};
+}
index c311f3774f45f59c7ad934e6b5992e673c1b4f54..e9f9b3454e18ef0151812464e7ce7aabecabf6b9 100644 (file)
@@ -1,4 +1,4 @@
-void SUB_Null() {};
+void SUB_Null() {}
 float SUB_True() { return 1; }
 float SUB_False() { return 0; }
 
@@ -41,7 +41,7 @@ void setanim(entity e, vector anim, float looping, float override, float restart
        e.animstate_override = override;
        e.frame = e.animstate_startframe;
        e.frame1time = servertime;
-};
+}
 
 void updateanim(entity e)
 {
@@ -56,31 +56,20 @@ void updateanim(entity e)
        }
        e.frame = e.animstate_startframe + bound(0, (time - e.animstate_starttime) * e.animstate_framerate, e.animstate_numframes - 1);
        //print(ftos(time), " -> ", ftos(e.frame), "\n");
-};
-
-float animparseerror;
-vector animparseline(float animfile)
-{
-       local string line;
-       local float c;
-       local vector anim;
-       if (animfile < 0)
-               return '0 1 2';
-       line = fgets(animfile);
-       c = tokenize_console(line);
-       if (c < 3)
+}
+
+vector animfixfps(entity e, vector a)
+{
+       // multi-frame anim: keep as-is
+       if(a_y == 1)
        {
-               animparseerror = TRUE;
-               return '0 1 2';
+               float dur;
+               dur = frameduration(e.modelindex, a_x);
+               if(dur > 0)
+                       a_z = 1.0 / dur;
        }
-       anim_x = stof(argv(0));
-       anim_y = stof(argv(1));
-       anim_z = stof(argv(2));
-       // don't allow completely bogus values
-       if (anim_x < 0 || anim_y < 1 || anim_z < 0.001)
-               anim = '0 1 2';
-       return anim;
-};
+       return a;
+}
 
 /*
 ==================
@@ -381,8 +370,8 @@ Additionally it moves players back into the past before the trace and restores t
 */
 void tracebox_antilag_force_wz (entity source, vector v1, vector mi, vector ma, vector v2, float nomonst, entity forent, float lag, float wz)
 {
-       local entity player;
-       local float oldsolid;
+       entity player;
+       float oldsolid;
 
        // check whether antilagged traces are enabled
        if (lag < 0.001)
@@ -836,7 +825,7 @@ void SetMovedir()
        }
 
        self.angles = '0 0 0';
-};
+}
 
 void InitTrigger()
 {
@@ -848,7 +837,7 @@ void InitTrigger()
        self.movetype = MOVETYPE_NONE;
        self.modelindex = 0;
        self.model = "";
-};
+}
 
 void InitSolidBSPTrigger()
 {
@@ -860,7 +849,7 @@ void InitSolidBSPTrigger()
        self.movetype = MOVETYPE_NONE; // why was this PUSH? -div0
 //     self.modelindex = 0;
        self.model = "";
-};
+}
 
 float InitMovingBrushTrigger()
 {
@@ -875,4 +864,4 @@ float InitMovingBrushTrigger()
                return 0;
        }
        return 1;
-};
+}
index 21208a2a197acaa25e38e55f8f4aaf81e227c7f4..d194c94314279ecb9412f342c322fb359780d317 100644 (file)
@@ -56,7 +56,7 @@ float SVC_CENTERPRINTa                = 26;
 float Tetris_Level()
 {
        return ((floor((self.tet_lines / 10)) + 1));
-};
+}
 
 void tetsnd(string snd)
 {
@@ -75,7 +75,7 @@ void SetLine(float ln, string vl)
        if(ln < 1 || ln > TET_LINES)
                error("WTF");
        bufstr_set(tet_line_buf, ln + TET_LINES * num_for_edict(self), vl);
-};
+}
 
 string GetLine(float ln)
 {
@@ -84,14 +84,14 @@ string GetLine(float ln)
        if(ln < 1 || ln > TET_LINES)
                return TET_EMPTY_LINE;
        return bufstr_get(tet_line_buf, ln + TET_LINES * num_for_edict(self));
-};
+}
 
 float GetXBlock(float x, string dat)
 {
        if(x < 1 || x > TET_WIDTH)
                error("WTF");
        return stof(substring(dat, x-1, 1));
-};
+}
 
 string SetXBlock(float x, string dat, float new)
 {
@@ -100,13 +100,13 @@ string SetXBlock(float x, string dat, float new)
                ftos(new),
                substring(dat, x, -1)
        );
-};
+}
 
 
 float GetSquare(float x, float y)
 {
        return GetXBlock(x,  GetLine(y));
-};
+}
 
 void SetSquare(float x, float y, float val)
 {
@@ -114,7 +114,7 @@ void SetSquare(float x, float y, float val)
        dat = GetLine(y);
        dat  = SetXBlock(x, dat, val);
        SetLine(y, dat);
-};
+}
 
 float PieceColor(float pc)
 {
@@ -235,7 +235,7 @@ float PieceMetric(float x, float y, float rot, float pc)
                return !!(ce_y & pow(4, x-1)); // second row
        else
                return 0; // illegal parms
-};
+}
 vector tet_piecemins;
 vector tet_piecemaxs;
 void PieceMinsMaxs(float rot, float pc)
@@ -343,7 +343,7 @@ void WriteTetrisString(string s)
 
 float pnum(float num, float dig)
 {
-       local float f, i;
+       float f, i;
        if (num < 0)
        {
                WriteChar(MSG_ONE, 173);
@@ -361,7 +361,7 @@ float pnum(float num, float dig)
        }
        WriteChar(MSG_ONE, 176 + num);
        return dig;
-};
+}
 
 void DrawLine(float ln)
 {
@@ -523,7 +523,7 @@ void ResetTetris()
        self.piece_type = 0;
        self.next_piece = self.tet_lines = self.tet_score = 0;
        self.tet_piece_bucket = 0;
-};
+}
 
 void Tet_GameExit()
 {
@@ -532,7 +532,7 @@ void Tet_GameExit()
        self.tet_vs_id = 0;
        ResetTetris();
        self.movetype = MOVETYPE_WALK;
-};
+}
 
 void PrintField()
 {
@@ -800,14 +800,14 @@ float RandomPiece()
                self.tet_piece_bucket = b;
                return p + 1;
        }
-};
+}
 
 void TetAddScore(float n)
 {
        self.tet_score = self.tet_score + n * Tetris_Level();
        if (self.tet_score > tet_high_score)
                tet_high_score = self.tet_score;
-};
+}
 float CheckMetrics(float piece, float orgx, float orgy, float rot) /*FIXDECL*/
 {
        // check to see if the piece, if moved to the locations will overlap
@@ -954,7 +954,7 @@ void CompletedLines()
                tetsnd("tetline");
        else
                tetsnd("tetland");
-};
+}
 
 void HandleGame(float keyss)
 {
@@ -1087,7 +1087,7 @@ void HandleGame(float keyss)
                return;
        }
        CementPiece(self.piece_type, self.piece_pos_x, self.piece_pos_y, self.piece_pos_z);
-};
+}
 
 /*
 *********************************
@@ -1127,7 +1127,7 @@ void TetrisImpulse()
                Tet_GameExit();
                self.impulse = 0;
        }
-};
+}
 
 
 float TetrisPreFrame()
@@ -1144,24 +1144,24 @@ float TetrisPreFrame()
        else
                self.tet_drawtime = time + 0.5;
        return 1;
-};
+}
 float frik_anglemoda(float v)
 {
        return v - floor(v/360) * 360;
-};
+}
 float angcompa(float y1, float y2)
 {
        y1 = frik_anglemoda(y1);
        y2 = frik_anglemoda(y2);
 
-       local float answer;
+       float answer;
        answer = y1 - y2;
        if (answer > 180)
                answer = answer - 360;
        else if (answer < -180)
                answer = answer + 360;
        return answer;
-};
+}
 
 .float tetkey_down, tetkey_rotright, tetkey_left, tetkey_right, tetkey_rotleft, tetkey_drop;
 
@@ -1240,7 +1240,7 @@ float TetrisPostFrame()
        }
 
        return 1;
-};
+}
 
 #else
 
index 6407cefaa901351ada791a7e5e2dffb084d0fb18..0ab2b423354013da80c2e56215aecd053eebfcca 100644 (file)
@@ -10,7 +10,7 @@ void DelayThink()
        activator = self.enemy;
        SUB_UseTargets ();
        remove(self);
-};
+}
 
 /*
 ==============================
@@ -33,7 +33,7 @@ match (string)self.target and call their .use function
 */
 void SUB_UseTargets()
 {
-       local entity t, stemp, otemp, act;
+       entity t, stemp, otemp, act;
        string s;
        float i;
 
@@ -132,7 +132,7 @@ void SUB_UseTargets()
        activator = act;
        self = stemp;
        other = otemp;
-};
+}
 
 
 //=============================================================================
@@ -149,7 +149,7 @@ void multi_wait()
                self.takedamage = DAMAGE_YES;
                self.solid = SOLID_BBOX;
        }
-};
+}
 
 
 // the trigger was just touched/killed/used
@@ -194,14 +194,14 @@ void multi_trigger()
                // called wheil C code is looping through area links...
                self.touch = SUB_Null;
        }
-};
+}
 
 void multi_use()
 {
        self.goalentity = other;
        self.enemy = activator;
        multi_trigger();
-};
+}
 
 void multi_touch()
 {
@@ -226,7 +226,7 @@ void multi_touch()
        self.enemy = other;
        self.goalentity = other;
        multi_trigger ();
-};
+}
 
 void multi_eventdamage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
 {
@@ -318,7 +318,7 @@ void spawnfunc_trigger_multiple()
                        setorigin (self, self.origin);  // make sure it links into the world
                }
        }
-};
+}
 
 
 /*QUAKED spawnfunc_trigger_once (.5 .5 .5) ? notouch
@@ -338,7 +338,7 @@ void spawnfunc_trigger_once()
 {
        self.wait = -1;
        spawnfunc_trigger_multiple();
-};
+}
 
 //=============================================================================
 
@@ -349,7 +349,7 @@ void spawnfunc_trigger_relay()
 {
        self.use = SUB_UseTargets;
        self.reset = spawnfunc_trigger_relay; // this spawnfunc resets fully
-};
+}
 
 void delay_use()
 {
@@ -402,7 +402,7 @@ void counter_use()
                centerprint(activator, "Sequence completed!");
        self.enemy = activator;
        multi_trigger ();
-};
+}
 
 void counter_reset()
 {
@@ -426,7 +426,7 @@ void spawnfunc_trigger_counter()
 
        self.use = counter_use;
        self.reset = counter_reset;
-};
+}
 
 void trigger_hurt_use()
 {
@@ -484,7 +484,7 @@ void trigger_hurt_touch()
        }
 
        return;
-};
+}
 
 /*QUAKED spawnfunc_trigger_hurt (.5 .5 .5) ?
 Any object touching this will be hurt
@@ -514,7 +514,7 @@ void spawnfunc_trigger_hurt()
        if(trigger_hurt_last)
                trigger_hurt_last.trigger_hurt_next = self;
        trigger_hurt_last = self;
-};
+}
 
 float tracebox_hits_trigger_hurt(vector start, vector mi, vector ma, vector end)
 {
@@ -558,7 +558,7 @@ void trigger_heal_touch()
                        }
                }
        }
-};
+}
 
 void spawnfunc_trigger_heal()
 {
@@ -573,7 +573,7 @@ void spawnfunc_trigger_heal()
        if(self.noise == "")
                self.noise = "misc/mediumhealth.wav";
        precache_sound(self.noise);
-};
+}
 
 
 //////////////////////////////////////////////////////////////
@@ -615,12 +615,12 @@ void trigger_gravity_check_think()
                self.count -= 1;
                self.nextthink = time;
        }
-};
+}
 
 void trigger_gravity_use()
 {
        self.state = !self.state;
-};
+}
 
 void trigger_gravity_touch()
 {
@@ -668,7 +668,7 @@ void trigger_gravity_touch()
                        sound (other, CH_TRIGGER, self.noise, VOL_BASE, ATTN_NORM);
                UpdateCSQCProjectile(self.owner);
        }
-};
+}
 
 void spawnfunc_trigger_gravity()
 {
@@ -687,7 +687,7 @@ void spawnfunc_trigger_gravity()
                if(self.spawnflags & 2)
                        self.state = FALSE;
        }
-};
+}
 
 //=============================================================================
 
@@ -822,7 +822,7 @@ void spawnfunc_target_speaker()
                ambientsound (self.origin, self.noise, VOL_BASE * self.volume, self.atten);
                remove(self);
        }
-};
+}
 
 
 void spawnfunc_func_stardust() {
@@ -1025,7 +1025,7 @@ float rainsnow_SendEntity(entity to, float sf)
        WriteShort(MSG_ENTITY, self.count);
        WriteByte(MSG_ENTITY, self.cnt);
        return 1;
-};
+}
 
 /*QUAKED spawnfunc_func_rain (0 .5 .8) ?
 This is an invisible area like a trigger, which rain falls inside of.
@@ -1062,7 +1062,7 @@ void spawnfunc_func_rain()
        self.Version = 1;
 
        Net_LinkEntity(self, FALSE, 0, rainsnow_SendEntity);
-};
+}
 
 
 /*QUAKED spawnfunc_func_snow (0 .5 .8) ?
@@ -1100,7 +1100,7 @@ void spawnfunc_func_snow()
        self.Version = 1;
 
        Net_LinkEntity(self, FALSE, 0, rainsnow_SendEntity);
-};
+}
 
 
 void FireRailgunBullet (vector start, vector end, float bdamage, float bforce, float mindist, float maxdist, float halflifedist, float forcehalflifedist, float deathtype);
@@ -1642,7 +1642,7 @@ void spawnfunc_trigger_multivibrator()
        self.state = 0;
        self.use = multivibrator_toggle;
        self.think = multivibrator_send;
-       self.nextthink = time;
+       self.nextthink = max(1, time);
 
        IFTARGETED
                multivibrator_reset();
@@ -2118,9 +2118,9 @@ void spawnfunc_target_changelevel_use()
                localcmd("endmatch\n");
        else
                localcmd(strcat("changelevel ", self.chmap, "\n"));
-};
+}
 
 void spawnfunc_target_changelevel()
 {
        self.use = spawnfunc_target_changelevel_use;
-};
+}
index 93157819efe8f6685c7594ba38e0f35942d0fe2a..b134886d4f6fcfc54281c1af591fb028650650c8 100644 (file)
@@ -101,7 +101,7 @@ void fteqcc_testbugs()
  * players. Also plays reminder sounds.
  */
 void timeoutHandler_Think() {
-       local entity plr;
+       entity plr;
        if (timeoutStatus == 1) {
                if (remainingLeadTime > 0) {
                        //centerprint the information to every player
@@ -253,6 +253,7 @@ void cvar_changes_init()
                BADPREFIX("con_");
                BADPREFIX("scoreboard_");
                BADPREFIX("g_campaign");
+               BADPREFIX("g_waypointsprite_");
                BADPREFIX("gl_");
                BADPREFIX("joy");
                BADPREFIX("hud_");
@@ -278,7 +279,6 @@ void cvar_changes_init()
 
                // private
                BADCVAR("developer");
-               BADCVAR("g_banned_list");
                BADCVAR("log_dest_udp");
                BADCVAR("log_file");
                BADCVAR("net_address");
@@ -286,6 +286,7 @@ void cvar_changes_init()
                BADCVAR("port");
                BADCVAR("savedgamecfg");
                BADCVAR("serverconfig");
+               BADCVAR("sv_autoscreenshot");
                BADCVAR("sv_heartbeatperiod");
                BADCVAR("sv_vote_master_password");
                BADCVAR("sys_colortranslation");
@@ -294,6 +295,7 @@ void cvar_changes_init()
                BADCVAR("timestamps");
                BADPREFIX("developer_");
                BADPREFIX("g_ban_");
+               BADPREFIX("g_banned_list");
                BADPREFIX("g_chat_flood_");
                BADPREFIX("g_playerstats_");
                BADPREFIX("g_voice_flood_");
@@ -306,6 +308,7 @@ void cvar_changes_init()
                BADPREFIX("sv_logscores_");
                BADPREFIX("sv_master");
                BADPREFIX("sv_weaponstats_");
+               BADPREFIX("sv_waypointsprite_");
 
                // these can contain player IDs, so better hide
                BADPREFIX("g_forced_team_");
@@ -628,7 +631,7 @@ void spawnfunc_worldspawn (void)
 
        allowed_to_spawn = TRUE;
 
-       local entity head;
+       entity head;
        head = nextent(world);
        maxclients = 0;
        while(head)
@@ -1098,7 +1101,7 @@ void GameResetCfg()
 {
        // settings persist, except...
        localcmd("\nsettemp_restore\n");
-};
+}
 
 void Map_Goto()
 {
@@ -1237,7 +1240,7 @@ string GetNextMap()
        }
 
        return "";
-};
+}
 
 float DoNextMapOverride()
 {
@@ -1288,13 +1291,13 @@ float DoNextMapOverride()
                return TRUE;
        }
        return FALSE;
-};
+}
 
 void GotoNextMap()
 {
-       //local string nextmap;
-       //local float n, nummaps;
-       //local string s;
+       //string nextmap;
+       //float n, nummaps;
+       //string s;
        if (alreadychangedlevel)
                return;
        alreadychangedlevel = TRUE;
@@ -1324,7 +1327,7 @@ void GotoNextMap()
                }
                Map_Goto();
        }
-};
+}
 
 
 /*
@@ -1360,7 +1363,7 @@ void IntermissionThink()
                        return;
 
        MapVote_Start();
-};
+}
 
 /*
 ============
@@ -1407,7 +1410,7 @@ entity FindIntermission()
 
        //objerror ("FindIntermission: no spot");
        return world;
-};
+}
 */
 
 /*
@@ -1623,7 +1626,7 @@ void CheckRules_Player()
 
        // fixme: don't check players; instead check spawnfunc_dom_team and spawnfunc_ctf_team entities
        //   (div0: and that in CheckRules_World please)
-};
+}
 
 float checkrules_equality;
 float checkrules_suddendeathwarning;
@@ -1732,7 +1735,7 @@ void ClearWinners(void)
 float WinningCondition_Onslaught()
 {
        entity head;
-       local float t1, t2, t3, t4;
+       float t1, t2, t3, t4;
 
        WinningConditionHelper(); // set worldstatus
 
@@ -1792,7 +1795,7 @@ float LMS_NewPlayerLives()
 void assault_new_round();
 float WinningCondition_Assault()
 {
-       local float status;
+       float status;
 
        WinningConditionHelper(); // set worldstatus
 
@@ -1807,7 +1810,7 @@ float WinningCondition_Assault()
                SetWinners(team, COLOR_TEAM1);
        }
 
-       local entity ent;
+       entity ent;
        ent = find(world, classname, "target_assault_roundend");
        if(ent)
        {
@@ -1824,7 +1827,7 @@ float WinningCondition_Assault()
                        }
                        else
                        {
-                               local entity oldself;
+                               entity oldself;
                                oldself = self;
                                self = ent;
                                assault_new_round();
@@ -2279,7 +2282,7 @@ void CheckRules_World()
                //print("WINNING\n");
                NextLevel();
        }
-};
+}
 
 float mapvote_nextthink;
 float mapvote_initialized;
@@ -2799,7 +2802,7 @@ void MapVote_Think()
        }
 
        MapVote_Tick();
-};
+}
 
 string GotoMap(string m)
 {
index a8537a0ae88c93cb92cf845f5463fd389abc0c10..f5b662be35e51a5e6a80a72a6ca70ac800cdaaa7 100644 (file)
@@ -385,7 +385,7 @@ void RadarMap_Think()
        else
        {
                // close the file
-               fputs(self.cnt, "};\n");
+               fputs(self.cnt, "}\n");
                fclose(self.cnt);
                print("Finished. Please edit data/", self.netname, " with an image editing application and place it in the TGA format in the gfx folder.\n");
                RadarMap_Next();
@@ -854,7 +854,7 @@ void GameCommand(string command)
        if (argv(0) == "nospectators")
        {
                blockSpectators = 1;
-               local entity plr;
+               entity plr;
                FOR_EACH_CLIENT(plr) //give every spectator <g_maxplayers_spectator_blocktime> seconds time to become a player
                {
                        if(plr.classname == "spectator" || plr.classname == "observer")
@@ -1259,7 +1259,7 @@ void GameCommand(string command)
 
        if(argv(0) == "bot_cmd")
        {
-               local entity bot;
+               entity bot;
 
                if(argv(1) == "help")
                {
@@ -1283,6 +1283,17 @@ void GameCommand(string command)
                        return;
                }
 
+               // set bot count
+               if(argv(1) == "setbots")
+               {
+                       if(argc >= 3 && argv(1) == "setbots")
+                       {
+                               cvar_settemp("minplayers", "0");
+                               cvar_settemp("bot_number", argv(2));
+                               bot_fixcount();
+                       }
+               }
+
                // Load cmds from file
                if(argv(1) == "load" && argc == 3)
                {
@@ -1301,12 +1312,26 @@ void GameCommand(string command)
 
                                if(argc >= 3 && argv(0) == "sv_cmd" && argv(1) == "bot_cmd")
                                {
-                                       // let's start at token 2 so we can skip sv_cmd bot_cmd
-                                       bot = find_bot_by_number(stof(argv(2)));
-                                       if(bot == world)
-                                               bot = find_bot_by_name(argv(2));
-                                       if(bot)
-                                               bot_queuecommand(bot, strcat(argv(3), " ", argv(4)));
+                                       if(argv(2) == "reset")
+                                       {
+                                               bot_resetqueues();
+                                       }
+                                       else if(argv(2) == "setbots")
+                                       {
+                                               cvar_settemp("minplayers", "0");
+                                               cvar_settemp("bot_number", argv(3));
+                                               if(!bot_fixcount())
+                                                       print("Sorry, could not set requested bot count\n");
+                                       }
+                                       else
+                                       {
+                                               // let's start at token 2 so we can skip sv_cmd bot_cmd
+                                               bot = find_bot_by_number(stof(argv(2)));
+                                               if(bot == world)
+                                                       bot = find_bot_by_name(argv(2));
+                                               if(bot)
+                                                       bot_queuecommand(bot, strcat(argv(3), " ", argv(4)));
+                                       }
                                }
                                else
                                        localcmd(strcat(s, "\n"));
index 19465d09dd1a156e397abb29ca4fac14d7633ae8..27c04f8a4d02499a2549a81c9aedec74ec53958e 100644 (file)
@@ -367,13 +367,13 @@ void spawnfunc_target_location()
     self.classname = "target_location";
     // location name in netname
     // eventually support: count, teamgame selectors, line of sight?
-};
+}
 
 void spawnfunc_info_location()
 {
     self.classname = "target_location";
     self.message = self.netname;
-};
+}
 
 string NearestLocation(vector p)
 {
@@ -740,13 +740,13 @@ string playername(entity p)
 
 vector randompos(vector m1, vector m2)
 {
-    local vector v;
+    vector v;
     m2 = m2 - m1;
     v_x = m2_x * random() + m1_x;
     v_y = m2_y * random() + m1_y;
     v_z = m2_z * random() + m1_z;
     return  v;
-};
+}
 
 //#NO AUTOCVARS START
 
@@ -1122,6 +1122,8 @@ string GetGametype(); // g_world.qc
 void readlevelcvars(void)
 {
        // first load all the mutators
+       if(cvar("g_invincible_projectiles"))
+               MUTATOR_ADD(mutator_invincibleprojectiles);
        if(cvar("g_nix"))
                MUTATOR_ADD(mutator_nix);
        if(cvar("g_dodging"))
@@ -1290,7 +1292,9 @@ float sound_allowed(float dest, entity e)
     {
         if (e.classname == "body")
             e = e.enemy;
-        if (e.owner && e.owner != e)
+       else if (e.realowner && e.realowner != e)
+            e = e.realowner;
+       else if (e.owner && e.owner != e)
             e = e.owner;
         else
             break;
@@ -1456,7 +1460,7 @@ float spamsound(entity e, float chan, string samp, float vol, float atten)
 
 void play2team(float t, string filename)
 {
-    local entity head;
+    entity head;
 
     if (autocvar_bot_sound_monopoly)
         return;
@@ -1630,7 +1634,7 @@ void precache()
     if(autocvar_sv_precacheweapons)
     {
         //precache weapon models/sounds
-        local float wep;
+        float wep;
         wep = WEP_FIRST;
         while (wep <= WEP_LAST)
         {
@@ -2043,7 +2047,6 @@ float MAX_IPBAN_URIS           = 16;
 float URI_GET_DISCARD          = 0;
 float URI_GET_IPBAN            = 1;
 float URI_GET_IPBAN_END        = 16;
-float URI_GET_PLAYERSTATS_SENT = 17;
 
 void URI_Get_Callback(float id, float status, string data)
 {
@@ -2064,10 +2067,6 @@ void URI_Get_Callback(float id, float status, string data)
         // online ban list
         OnlineBanList_URI_Get_Callback(id, status, data);
     }
-    else if (id == URI_GET_PLAYERSTATS_SENT)
-    {
-        PlayerStats_Sent_URI_Get_Callback(id, status, data);
-    }
     else
     {
         print("Received HTTP request data for an invalid id ", ftos(id), ".\n");
index 4f8aee2e76431f3cb36d5f438007c7037cdd6076..f6e3de4cddf854cf024b8a9f4ad6f3d51caac1b3 100644 (file)
@@ -43,11 +43,11 @@ void ons_throwgib_think()
        if(d>2)
        if(random()<0.6)
                pointparticles(particleeffectnum("onslaught_generator_gib_flame"), self.origin, '0 0 0', 1);
-};
+}
 
 void ons_throwgib(vector v_from, vector v_to, string smodel, float f_lifetime, float b_burn)
 {
-       local entity gib;
+       entity gib;
 
        gib = spawn();
 
@@ -70,12 +70,12 @@ void ons_throwgib(vector v_from, vector v_to, string smodel, float f_lifetime, f
        }
        else
                SUB_SetFade(gib, gib.giblifetime, 2);
-};
+}
 
 void onslaught_updatelinks()
 {
-       local entity l, links;
-       local float stop, t1, t2, t3, t4;
+       entity l, links;
+       float stop, t1, t2, t3, t4;
        // first check if the game has ended
        dprint("--- updatelinks ---\n");
        links = findchain(classname, "onslaught_link");
@@ -258,7 +258,7 @@ void onslaught_updatelinks()
                dprint("--- game over ---\n");
        else
                dprint("--- done updating links ---\n");
-};
+}
 
 float onslaught_controlpoint_can_be_linked(entity cp, float t)
 {
@@ -375,8 +375,8 @@ float onslaught_controlpoint_attackable(entity cp, float t)
 float overtime_msg_time;
 void onslaught_generator_think()
 {
-       local float d;
-       local entity e;
+       float d;
+       entity e;
        self.nextthink = ceil(time + 1);
        if (!gameover)
        {
@@ -406,12 +406,12 @@ void onslaught_generator_think()
                else if (overtime_msg_time)
                        overtime_msg_time = 0;
        }
-};
+}
 
 void onslaught_generator_ring_spawn(vector org)
 {
        modeleffect_spawn("models/onslaught/shockwavetransring.md3", 0, 0, org, '0 0 0', '0 0 0', '0 0 0', 0, -16, 0.1, 1.25, 0.25);
-};
+}
 
 void onslaught_generator_ray_think()
 {
@@ -429,7 +429,7 @@ void onslaught_generator_ray_think()
 
        self.scale += 0.2;
        self.count +=1;
-};
+}
 
 void onslaught_generator_ray_spawn(vector org)
 {
@@ -442,12 +442,12 @@ void onslaught_generator_ray_spawn(vector org)
        e.scale = random() * 5 + 8;
        e.think = onslaught_generator_ray_think;
        e.nextthink = time + 0.05;
-};
+}
 
 void onslaught_generator_shockwave_spawn(vector org)
 {
        shockwave_spawn("models/onslaught/shockwave.md3", org, -64, 0.75, 0.5);
-};
+}
 
 void onslaught_generator_damage_think()
 {
@@ -467,7 +467,7 @@ void onslaught_generator_damage_think()
                }
                else
                        pointparticles(particleeffectnum("torch_small"), self.origin + randompos('-60 -60 -20', '60 60 60'), '0 0 0', 1);
-};
+}
 
 void onslaught_generator_damage_spawn(entity gd_owner)
 {
@@ -478,12 +478,12 @@ void onslaught_generator_damage_spawn(entity gd_owner)
        setorigin(e, gd_owner.origin);
        e.think = onslaught_generator_damage_think;
        e.nextthink = time+1;
-};
+}
 
 void onslaught_generator_deaththink()
 {
-       local vector org;
-       local float i;
+       vector org;
+       float i;
 
        if not (self.count)
                self.count = 40;
@@ -544,11 +544,11 @@ void onslaught_generator_deaththink()
                self.nextthink = time + 0.05;
 
        self.count = self.count - 1;
-};
+}
 
 void onslaught_generator_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
 {
-       local float i;
+       float i;
        if (damage <= 0)
                return;
        if(inWarmupStage)
@@ -664,7 +664,7 @@ void onslaught_generator_damage(entity inflictor, entity attacker, float damage,
        if(random() < damage/200+0.2)
                if(random() < 0.5)
                        ons_throwgib(hitloc + '0 0 20', randomvec()*360, "models/onslaught/gen_gib1.md3", 5, FALSE);
-};
+}
 
 // update links after a delay
 void onslaught_generator_delayed()
@@ -673,7 +673,7 @@ void onslaught_generator_delayed()
        // now begin normal thinking
        self.think = onslaught_generator_think;
        self.nextthink = time;
-};
+}
 
 string onslaught_generator_waypointsprite_for_team(entity e, float t)
 {
@@ -850,7 +850,7 @@ void spawnfunc_onslaught_generator()
                return;
        }
 
-       local entity e;
+       entity e;
        precache_model("models/onslaught/generator.md3");
        precache_model("models/onslaught/generator_shield.md3");
        precache_model("models/onslaught/generator_dmg1.md3");
@@ -919,7 +919,7 @@ void spawnfunc_onslaught_generator()
        onslaught_updatelinks();
 
        self.reset = onslaught_generator_reset;
-};
+}
 
 .float waslinked;
 .float cp_bob_spd;
@@ -1031,7 +1031,7 @@ void onslaught_controlpoint_icon_damage(entity inflictor, entity attacker, float
 
                remove(self);
        }
-};
+}
 
 void onslaught_controlpoint_icon_think()
 {
@@ -1139,11 +1139,11 @@ void onslaught_controlpoint_icon_think()
                else if (random() > 0.5)
                        sound(self, CH_PAIN, "onslaught/ons_spark2.wav", VOL_BASE, ATTN_NORM);
        }
-};
+}
 
 void onslaught_controlpoint_icon_buildthink()
 {
-       local entity oself;
+       entity oself;
        float a;
 
        self.nextthink = time + sys_frametime;
@@ -1188,14 +1188,14 @@ void onslaught_controlpoint_icon_buildthink()
 
        if(random() < 0.9 - self.health / self.max_health)
                pointparticles(particleeffectnum("rage"), self.origin + 10 * randomvec(), '0 0 -1', 1);
-};
+}
 
 
 
 
 void onslaught_controlpoint_touch()
 {
-       local entity e;
+       entity e;
        float a;
        if (other.classname != "player")
                return;
@@ -1228,7 +1228,7 @@ void onslaught_controlpoint_touch()
        self.colormap = e.colormap;
        WaypointSprite_UpdateBuildFinished(self.sprite, time + (e.max_health - e.health) / (e.count / sys_frametime));
        onslaught_updatelinks();
-};
+}
 
 void onslaught_controlpoint_reset()
 {
@@ -1267,7 +1267,7 @@ keys:
  */
 void spawnfunc_onslaught_controlpoint()
 {
-       local entity e;
+       entity e;
        if (!g_onslaught)
        {
                remove(self);
@@ -1320,7 +1320,7 @@ void spawnfunc_onslaught_controlpoint()
        onslaught_updatelinks();
 
        self.reset = onslaught_controlpoint_reset;
-};
+}
 
 float onslaught_link_send(entity to, float sendflags)
 {
@@ -1424,4 +1424,4 @@ void spawnfunc_onslaught_link()
                objerror("target and target2 must be set\n");
        InitializeEntity(self, onslaught_link_delayed, INITPRIO_FINDTARGET);
        Net_LinkEntity(self, FALSE, 0, onslaught_link_send);
-};
+}
diff --git a/qcsrc/server/monsters/ai.qc b/qcsrc/server/monsters/ai.qc
deleted file mode 100644 (file)
index b7c7755..0000000
+++ /dev/null
@@ -1,891 +0,0 @@
-void() movetarget_f;
-void() t_movetarget;
-void() FoundTarget;
-
-float MONSTER_WANDER = 64; // disable wandering around
-float MONSTER_APPEAR = 128; // spawn invisible, and appear when triggered
-
-.float ismonster;
-.float monsterawaitingteleport; // avoid awaking monsters in teleport rooms
-
-// when a monster becomes angry at a player, that monster will be used
-// as the sight target the next frame so that monsters near that one
-// will wake up even if they wouldn't have noticed the player
-//
-entity sight_entity;
-float sight_entity_time;
-
-/*
-
-.enemy
-Will be world if not currently angry at anyone.
-
-.movetarget
-The next path spot to walk toward.  If .enemy, ignore .movetarget.
-When an enemy is killed, the monster will try to return to it's path.
-
-.huntt_ime
-Set to time + something when the player is in sight, but movement straight for
-him is blocked.  This causes the monster to use wall following code for
-movement direction instead of sighting on the player.
-
-.ideal_yaw
-A yaw angle of the intended direction, which will be turned towards at up
-to 45 deg / state.  If the enemy is in view and hunt_time is not active,
-this will be the exact line towards the enemy.
-
-.pausetime
-A monster will leave it's stand state and head towards it's .movetarget when
-time > .pausetime.
-
-walkmove(angle, speed) primitive is all or nothing
-*/
-
-
-//
-// globals
-//
-//float current_yaw;
-
-float(float v) anglemod =
-{
-       v = v - 360 * floor(v / 360);
-       return v;
-};
-
-/*
-==============================================================================
-
-MOVETARGET CODE
-
-The angle of the movetarget effects standing and bowing direction, but has no effect on movement, which allways heads to the next target.
-
-targetname
-must be present.  The name of this movetarget.
-
-target
-the next spot to move to.  If not present, stop here for good.
-
-pausetime
-The number of seconds to spend standing or bowing for path_stand or path_bow
-
-==============================================================================
-*/
-
-
-void() movetarget_f =
-{
-       if (!self.targetname)
-               objerror ("monster_movetarget: no targetname");
-
-       self.solid = SOLID_TRIGGER;
-       self.touch = t_movetarget;
-       setsize (self, '-8 -8 -8', '8 8 8');
-};
-
-/*QUAKED path_corner (0.5 0.3 0) (-8 -8 -8) (8 8 8)
-Monsters will continue walking towards the next target corner.
-*/
-void() path_corner =
-{
-       movetarget_f ();
-};
-
-/*
-=============
-t_movetarget
-
-Something has bumped into a movetarget.  If it is a monster
-moving towards it, change the next destination and continue.
-==============
-*/
-void() t_movetarget =
-{
-       local entity temp;
-
-       if (other.health < 1)
-               return;
-       if (other.movetarget != self)
-               return;
-
-       if (other.enemy)
-               return;         // fighting, not following a path
-
-       temp = self;
-       self = other;
-       other = temp;
-
-       /* PLEASE FIX THE SOUND CHANNEL BEFORE ACTIVATING THIS
-       if (self.classname == "monster_ogre")
-               sound (self, CHAN_VOICE, "ogre/ogdrag.wav", 1, ATTN_IDLE);// play chainsaw drag sound
-       */
-
-//dprint ("t_movetarget\n");
-       self.goalentity = self.movetarget = find (world, targetname, other.target);
-       self.ideal_yaw = vectoyaw(self.goalentity.origin - self.origin);
-       if (!self.movetarget)
-       {
-               self.pausetime = time + 999999;
-               self.th_stand ();
-               return;
-       }
-};
-
-void() monster_wanderpaththink =
-{
-       local vector v, v1;
-       local float b, c;
-       self.nextthink = time + random() * 10 + 1;
-       if (self.owner.health < 1) // dead, also handled in death code
-       {
-               self.owner.movetarget = world;
-               remove(self);
-               return;
-       }
-       b = -1;
-       c = 10;
-       while (c > 0)
-       {
-               c = c - 1;
-               v = randomvec();
-               traceline(self.owner.origin, v * 1024 + self.owner.origin, FALSE, self);
-               v = trace_endpos - (normalize(v) * 16) - self.owner.origin;
-               if (vlen(v) > b)
-               {
-                       b = vlen(v);
-                       v1 = v;
-               }
-       }
-       setorigin(self, v1 + self.owner.origin);
-       self.owner.ideal_yaw = vectoyaw(self.origin - self.owner.origin);
-};
-
-void() monster_wanderpathtouch =
-{
-       if (other.health < 1)
-               return;
-       if (other.movetarget != self)
-               return;
-
-       if (other.enemy)
-               return;         // fighting, not following a path
-
-       /* PLEASE FIX THE SOUND CHANNEL BEFORE ACTIVATING THIS
-       if (other.classname == "monster_ogre")
-               sound (other, CHAN_VOICE, "ogre/ogdrag.wav", 1, ATTN_IDLE);// play chainsaw drag sound
-       */
-       monster_wanderpaththink();
-};
-
-void() monster_spawnwanderpath =
-{
-       newmis = spawn();
-       newmis.classname = "monster_wanderpath";
-       newmis.solid = SOLID_TRIGGER;
-       newmis.touch = monster_wanderpathtouch;
-       setsize (newmis, '-8 -8 -8', '8 8 8');
-       newmis.think = monster_wanderpaththink;
-       newmis.nextthink = time + random() * 10 + 1;
-       newmis.owner = self;
-       self.goalentity = self.movetarget = newmis;
-};
-
-void() monster_checkbossflag =
-{
-//#NO AUTOCVARS START
-#if 0
-       local float healthboost;
-       local float r;
-
-       // monsterbosses cvar or spawnflag 64 causes a monster to be a miniboss
-       if ((self.spawnflags & 64) || (random() * 100 < cvar("monsterbosspercent")))
-       {
-               self.radsuit_finished = time + 1000000000;
-               r = random() * 4;
-               if (r < 2)
-               {
-                       self.super_damage_finished = time + 1000000000;
-                       healthboost = 30 + self.health * 0.5;
-                       self.effects = self.effects | (EF_FULLBRIGHT | EF_BLUE);
-               }
-               if (r >= 1)
-               {
-                       healthboost = 30 + self.health * bound(0.5, skill * 0.5, 1.5);
-                       self.effects = self.effects | (EF_FULLBRIGHT | EF_RED);
-                       self.healthregen = max(self.healthregen, min(skill * 10, 30));
-               }
-               self.health = self.health + healthboost;
-               self.max_health = self.health;
-               self.bodyhealth = self.bodyhealth * 2 + healthboost;
-               do
-               {
-                       self.colormod_x = random();
-                       self.colormod_y = random();
-                       self.colormod_z = random();
-                       self.colormod =  normalize(self.colormod);
-               }
-               while (self.colormod_x > 0.6 && self.colormod_y > 0.6 && self.colormod_z > 0.6);
-       }
-#endif
-//#NO AUTOCVARS END
-};
-
-
-//============================================================================
-
-/*
-=============
-range
-
-returns the range catagorization of an entity reletive to self
-0      melee range, will become hostile even if back is turned
-1      visibility and infront, or visibility and show hostile
-2      infront and show hostile
-3      only triggered by damage
-=============
-*/
-float(entity targ) range =
-{
-       local float r;
-       r = vlen ((self.origin + self.view_ofs) - (targ.origin + targ.view_ofs));
-       if (r < 120)
-               return RANGE_MELEE;
-       if (r < 500)
-               return RANGE_NEAR;
-       if (r < 2000) // increased from 1000 for DP
-               return RANGE_MID;
-       return RANGE_FAR;
-};
-
-/*
-=============
-visible
-
-returns 1 if the entity is visible to self, even if not infront ()
-=============
-*/
-float (entity targ) visible =
-{
-       if (vlen(targ.origin - self.origin) > 5000) // long traces are slow
-               return FALSE;
-
-       traceline ((self.origin + self.view_ofs), (targ.origin + targ.view_ofs), TRUE, self);   // see through other monsters
-
-       if (trace_inopen && trace_inwater)
-               return FALSE;                   // sight line crossed contents
-
-       if (trace_fraction == 1)
-               return TRUE;
-       return FALSE;
-};
-
-
-/*
-=============
-infront
-
-returns 1 if the entity is in front (in sight) of self
-=============
-*/
-float(entity targ) infront =
-{
-       local float dot;
-
-       makevectors (self.angles);
-       dot = normalize (targ.origin - self.origin) * v_forward;
-
-       return (dot > 0.3);
-};
-// returns 0 if not infront, or the dotproduct if infront
-float(vector dir, entity targ) infront2 =
-{
-       local float dot;
-
-       dir = normalize(dir);
-       dot = normalize (targ.origin - self.origin) * dir;
-
-       if (dot >= 0.3) return dot; // infront
-       return 0;
-};
-
-
-//============================================================================
-
-/*
-===========
-ChangeYaw
-
-Turns towards self.ideal_yaw at self.yaw_speed
-Sets the global variable current_yaw
-Called every 0.1 sec by monsters
-============
-*/
-/*
-
-void() ChangeYaw =
-{
-       local float ideal, move;
-
-//current_yaw = self.ideal_yaw;
-// mod down the current angle
-       current_yaw = anglemod( self.angles_y );
-       ideal = self.ideal_yaw;
-
-       if (current_yaw == ideal)
-               return;
-
-       move = ideal - current_yaw;
-       if (ideal > current_yaw)
-       {
-               if (move > 180)
-                       move = move - 360;
-       }
-       else
-       {
-               if (move < -180)
-                       move = move + 360;
-       }
-
-       if (move > 0)
-       {
-               if (move > self.yaw_speed)
-                       move = self.yaw_speed;
-       }
-       else
-       {
-               if (move < 0-self.yaw_speed )
-                       move = 0-self.yaw_speed;
-       }
-
-       current_yaw = anglemod (current_yaw + move);
-
-       self.angles_y = current_yaw;
-};
-
-*/
-
-
-//============================================================================
-
-void() HuntTarget =
-{
-       self.goalentity = self.enemy;
-       self.think = self.th_run;
-       self.ideal_yaw = vectoyaw(self.enemy.origin - self.origin);
-       self.nextthink = time + 0.1;
-       SUB_AttackFinished (1); // wait a while before first attack
-};
-
-.void() th_sightsound;
-
-void() SightSound =
-{
-       if (self.health < 1)
-               return;
-       // skill 5 does not play sight sounds, instead you only hear the appear sound as they are about to attack
-       if (skill >= 5)
-       if (self.classname != "monster_hellfish")
-               return;
-
-       if (self.th_sightsound)
-               self.th_sightsound();
-};
-
-void() FoundTarget =
-{
-       if (self.health < 1 || !self.th_run)
-               return;
-       if (self.enemy.health < 1 || !self.enemy.takedamage)
-               return;
-       if (self.enemy.classname == "player")
-       {
-               // let other monsters see this monster for a while
-               sight_entity = self;
-               sight_entity_time = time + 0.1;
-       }
-
-       self.show_hostile = time + 1;           // wake up other monsters
-
-       SightSound ();
-       HuntTarget ();
-};
-
-/*
-//float checkplayertime;
-entity lastcheckplayer;
-entity havocbot_list;
-
-
-entity() checkplayer =
-{
-       local entity check;
-       local float worldcount;
-       // we can just fallback on checkclient if there are no bots
-       if (!havocbot_list)
-               return checkclient();
-*/
-       /*
-       if (time < checkplayertime)
-       {
-               traceline(self.origin + self.view_ofs, lastcheckplayer.origin + lastcheckplayer.view_ofs, TRUE, self);
-               if (trace_fraction == 1)
-                       return lastcheckplayer;
-               if (trace_ent == lastcheckplayer)
-                       return lastcheckplayer;
-       }
-       checkplayertime = time + 0.1;
-       */
-/*
-       check = lastcheckplayer;
-       worldcount = 0;
-       c = 0;
-       do
-       {
-               c = c + 1;
-               check = findfloat(check, havocattack, TRUE);
-               if (check.classname == "player" || check.classname == "turretbase")
-               {
-                       traceline(self.origin + self.view_ofs, check.origin + check.view_ofs, TRUE, self);
-                       if (trace_fraction == 1)
-                               return lastcheckplayer = check;
-                       if (trace_ent == check)
-                               return lastcheckplayer = check;
-               }
-               else if (check == world)
-               {
-                       worldcount = worldcount + 1;
-                       if (worldcount >= 2)
-                               return lastcheckplayer = check;
-               }
-       }
-       while(check != lastcheckplayer && c < 100);
-       return world;
-};
-*/
-
-/*
-===========
-FindTarget
-
-Self is currently not attacking anything, so try to find a target
-
-Returns TRUE if an enemy was sighted
-
-When a player fires a missile, the point of impact becomes a fakeplayer so
-that monsters that see the impact will respond as if they had seen the
-player.
-
-To avoid spending too much time, only a single client (or fakeclient) is
-checked each frame.  This means multi player games will have slightly
-slower noticing monsters.
-============
-*/
-.float findtarget;
-float() FindTarget =
-{
-       local entity client;
-       local float r;
-
-       if (self.health < 1)
-               return FALSE;
-
-       // if the first or second spawnflag bit is set, the monster will only
-       // wake up on really seeing the player, not another monster getting angry
-
-       if (self.spawnflags & 3)
-       {
-               // don't wake up on seeing another monster getting angry
-               client = checkclient ();
-               if (!client)
-                       return FALSE;   // current check entity isn't in PVS
-       }
-       else
-       {
-               if (sight_entity_time >= time)
-               {
-                       client = sight_entity;
-                       if (client.enemy == self.enemy)
-                               return TRUE;
-               }
-               else
-               {
-                       client = checkclient ();
-                       if (!client)
-                               return FALSE;   // current check entity isn't in PVS
-               }
-       }
-
-       if (client == self.enemy)
-               return FALSE;
-
-       if (client.flags & FL_NOTARGET)
-               return FALSE;
-
-#if 0
-       if (client.items & IT_INVISIBILITY)
-               return FALSE;
-#endif
-
-       // on skill 5 the monsters usually ignore the player and remain ghostlike
-       if (skill >= 5)
-       if (self.classname != "monster_hellfish")
-       if (random() < 0.99)
-               return FALSE;
-
-       r = range(client);
-       if (r == RANGE_FAR)
-               return FALSE;
-
-       if (!visible (client))
-               return FALSE;
-
-       if (r == RANGE_NEAR)
-       {
-               if (client.show_hostile < time && !infront (client))
-                       return FALSE;
-       }
-       else if (r == RANGE_MID)
-       {
-               // LordHavoc: was if ( /* client.show_hostile < time || */ !infront (client))
-               if (client.show_hostile < time && !infront (client))
-                       return FALSE;
-       }
-
-       //
-       // got one
-       //
-
-       if (client.model == "")
-               return FALSE;
-       self.enemy = client;
-       if (self.enemy.classname != "player" && self.enemy.classname != "turretbase")
-       {
-               self.enemy = self.enemy.enemy;
-               if (self.enemy.classname != "player" && self.enemy.classname != "turretbase")
-               {
-                       self.enemy = world;
-                       return FALSE;
-               }
-       }
-
-       FoundTarget ();
-
-       return TRUE;
-};
-
-
-//=============================================================================
-
-void(float dist) ai_forward =
-{
-       walkmove (self.angles_y, dist);
-};
-
-void(float dist) ai_back =
-{
-       walkmove ( (self.angles_y+180), dist);
-};
-
-
-void(float a) monster_setalpha;
-
-/*
-=============
-ai_pain
-
-stagger back a bit
-=============
-*/
-void(float dist) ai_pain =
-{
-       if (self.health < 1)
-               return;
-       ai_back (dist);
-};
-
-/*
-=============
-ai_painforward
-
-stagger back a bit
-=============
-*/
-void(float dist) ai_painforward =
-{
-       if (self.health < 1)
-               return;
-       walkmove (self.ideal_yaw, dist);
-};
-
-/*
-=============
-ai_walk
-
-The monster is walking it's beat
-=============
-*/
-void(float dist) ai_walk =
-{
-       if (self.health < 1)
-               return;
-
-       movedist = dist;
-
-       // check for noticing a player
-       if (self.oldenemy.takedamage)
-       if (self.oldenemy.health >= 1)
-       {
-               self.enemy = self.oldenemy;
-               self.oldenemy = world;
-               FoundTarget();
-               monster_setalpha(0);
-               return;
-       }
-       if (self.enemy)
-       {
-               if (self.enemy.takedamage)
-               {
-                       if (self.enemy.health >= 1)
-                       {
-                               FoundTarget();
-                               monster_setalpha(0);
-                               return;
-                       }
-                       else
-                               self.enemy = world;
-               }
-               else
-                       self.enemy = world;
-       }
-
-       self.findtarget = TRUE;
-
-       movetogoal (dist);
-       monster_setalpha(0);
-};
-
-
-/*
-=============
-ai_stand
-
-The monster is staying in one place for a while, with slight angle turns
-=============
-*/
-void() ai_stand =
-{
-       if (self.health < 1)
-               return;
-       if (self.enemy)
-       {
-               if (self.enemy.takedamage)
-               {
-                       if (self.enemy.health >= 1)
-                       {
-                               FoundTarget();
-                               monster_setalpha(0);
-                               return;
-                       }
-                       else
-                               self.enemy = world;
-               }
-               else
-                       self.enemy = world;
-       }
-       self.findtarget = TRUE;
-
-       if (time > self.pausetime)
-       {
-               self.th_walk ();
-               monster_setalpha(0);
-               return;
-       }
-
-// change angle slightly
-
-       monster_setalpha(0);
-};
-
-/*
-=============
-ai_turn
-
-don't move, but turn towards ideal_yaw
-=============
-*/
-void() ai_turn =
-{
-       if (self.enemy)
-       {
-               if (self.enemy.takedamage)
-               {
-                       if (self.enemy.health >= 1)
-                       {
-                               FoundTarget();
-                               monster_setalpha(0);
-                               return;
-                       }
-                       else
-                               self.enemy = world;
-               }
-               else
-                       self.enemy = world;
-       }
-       self.findtarget = TRUE;
-
-       ChangeYaw ();
-       monster_setalpha(0);
-};
-
-//=============================================================================
-
-/*
-=============
-ChooseTurn
-=============
-*/
-void(vector pDestvec) ChooseTurn =
-{
-       local vector dir, newdir;
-
-       dir = self.origin - pDestvec;
-
-       newdir_x = trace_plane_normal_y;
-       newdir_y = 0 - trace_plane_normal_x;
-       newdir_z = 0;
-
-       if (dir * newdir > 0)
-       {
-               dir_x = 0 - trace_plane_normal_y;
-               dir_y = trace_plane_normal_x;
-       }
-       else
-       {
-               dir_x = trace_plane_normal_y;
-               dir_y = 0 - trace_plane_normal_x;
-       }
-
-       dir_z = 0;
-       self.ideal_yaw = vectoyaw(dir);
-};
-
-/*
-============
-FacingIdeal
-
-============
-*/
-float() FacingIdeal =
-{
-       local float delta;
-
-       delta = anglemod(self.angles_y - self.ideal_yaw);
-       if (delta > 45 && delta < 315)
-               return FALSE;
-       return TRUE;
-};
-
-
-//=============================================================================
-
-.float() th_checkattack;
-
-
-
-/*
-=============
-ai_run
-
-The monster has an enemy it is trying to kill
-=============
-*/
-void(float dist) ai_run =
-{
-       local float ofs;
-       if (self.health < 1)
-               return;
-       movedist = dist;
-       // see if the enemy is dead
-       if (self.enemy.health < 1 || self.enemy.takedamage == DAMAGE_NO)
-       {
-               self.enemy = world;
-               // FIXME: look all around for other targets
-               if (self.oldenemy.health >= 1 && self.oldenemy.takedamage)
-               {
-                       self.enemy = self.oldenemy;
-                       self.oldenemy = world;
-                       HuntTarget ();
-               }
-               else
-               {
-                       if (self.movetarget)
-                               self.th_walk ();
-                       else
-                               self.th_stand ();
-                       return;
-               }
-       }
-
-       // wake up other monsters
-       self.show_hostile = time + 1;
-
-       // check knowledge of enemy
-       enemy_range = range(self.enemy);
-
-       self.ideal_yaw = vectoyaw(self.enemy.origin - self.origin);
-       ChangeYaw ();
-
-       if (self.attack_state == AS_MELEE)
-       {
-               //dprint ("ai_run_melee\n");
-               //Turn and close until within an angle to launch a melee attack
-               if (FacingIdeal())
-               {
-                       self.th_melee ();
-                       self.attack_state = AS_STRAIGHT;
-               }
-               return;
-       }
-       else if (self.attack_state == AS_MISSILE)
-       {
-               //dprint ("ai_run_missile\n");
-               //Turn in place until within an angle to launch a missile attack
-               if (FacingIdeal())
-               if (self.th_missile ())
-                       self.attack_state = AS_STRAIGHT;
-               return;
-       }
-
-       if (self.th_checkattack())
-               return;                                 // beginning an attack
-
-       if (visible(self.enemy))
-               self.search_time = time + 5;
-       else if (coop)
-       {
-               // look for other coop players
-               if (self.search_time < time)
-                       self.findtarget = TRUE;
-       }
-
-       if (self.attack_state == AS_SLIDING)
-       {
-               //dprint ("ai_run_slide\n");
-               //Strafe sideways, but stay at aproximately the same range
-               if (self.lefty)
-                       ofs = 90;
-               else
-                       ofs = -90;
-
-               if (walkmove (self.ideal_yaw + ofs, movedist))
-                       return;
-
-               self.lefty = !self.lefty;
-
-               walkmove (self.ideal_yaw - ofs, movedist);
-       }
-
-       // head straight in
-       movetogoal (dist);              // done in C code...
-};
-
diff --git a/qcsrc/server/monsters/defs.qc b/qcsrc/server/monsters/defs.qc
deleted file mode 100644 (file)
index 1982142..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-.entity movetarget;
-.float pausetime;
-
-.void()         th_stand;
-.void()         th_walk;
-.void()         th_run;
-.float()        th_missile; // LordHavoc: changed from void() to float(), returns true if attacking
-.void()         th_melee;
-//.void(entity attacker, float damage, float damgtype, string dethtype)           th_pain; // TODO Xonotic uses event_damage
-//.void()         th_die; // TODO never called directly by Xonotic
-.entity         oldenemy;               // mad at this player before taking damage
-entity  newmis;                 // launch_spike sets this after spawning it
-
-// range values
-float   RANGE_MELEE                             = 0;
-float   RANGE_NEAR                              = 1;
-float   RANGE_MID                               = 2;
-float   RANGE_FAR                               = 3;
-
-float DMG_KNIGHT_MELEE_BASE           =    0;
-float DMG_KNIGHT_MELEE_RANDOM1        =    3;
-float DMG_KNIGHT_MELEE_RANDOM2        =    3;
-float DMG_KNIGHT_MELEE_RANDOM3        =    3;
-
-.float          show_hostile; 
-       // set to time+0.2 whenever a client fires a
-       // weapon or takes damage.  Used to alert
-       // monsters that otherwise would let the player go
-
-float movedist;
-.float lefty;
-.float search_time;
-.float attack_state;
-
-float   AS_STRAIGHT             = 1;
-float   AS_SLIDING              = 2;
-float   AS_MELEE                = 3;
-float   AS_MISSILE              = 4;
-
-float SKILL4_MINALPHA         = 0.4;
-
-float monsterwander;
-//#NO AUTOCVARS START
-/*
-        monsterwander = cvar("monsterwander");
-        // monsterwander is always on in skill 5
-        if (skill >= 5)
-                monsterwander = TRUE;
-*/
-//#NO AUTOCVARS END
-
-.float candrown;
-
-.void(vector org, float bodydamage, float armordamage, vector vel, float damgtype) bleedfunc;
-void(vector org, float bodydamage, float armordamage, vector vel, float damgtype) genericbleedfunc;
diff --git a/qcsrc/server/monsters/fight.qc b/qcsrc/server/monsters/fight.qc
deleted file mode 100644 (file)
index 10d00a1..0000000
+++ /dev/null
@@ -1,252 +0,0 @@
-
-/*
-
-A monster is in fight mode if it thinks it can effectively attack its
-enemy.
-
-When it decides it can't attack, it goes into hunt mode.
-
-*/
-
-void SUB_AttackFinished (float normal)
-{
-       self.cnt = 0;           // refire count for nightmare
-       if (skill < 3)
-               ATTACK_FINISHED(self) = time + normal;
-}
-
-float CanDamage(entity targ, entity inflictor)
-{
-       if (targ.movetype == MOVETYPE_PUSH)
-       {
-               traceline(inflictor.origin, 0.5 * (targ.absmin + targ.absmax), TRUE, self);
-               if (trace_fraction == 1)
-                       return TRUE;
-               if (trace_ent == targ)
-                       return TRUE;
-               return FALSE;
-       }
-
-       traceline(inflictor.origin, targ.origin, TRUE, self);
-       if (trace_fraction == 1)
-               return TRUE;
-       traceline(inflictor.origin, targ.origin + '15 15 0', TRUE, self);
-       if (trace_fraction == 1)
-               return TRUE;
-       traceline(inflictor.origin, targ.origin + '-15 -15 0', TRUE, self);
-       if (trace_fraction == 1)
-               return TRUE;
-       traceline(inflictor.origin, targ.origin + '-15 15 0', TRUE, self);
-       if (trace_fraction == 1)
-               return TRUE;
-       traceline(inflictor.origin, targ.origin + '15 -15 0', TRUE, self);
-       if (trace_fraction == 1)
-               return TRUE;
-
-       return FALSE;
-}
-
-float(float v) anglemod;
-
-void(vector dest) ChooseTurn;
-
-void() ai_face;
-
-
-float enemy_range;
-
-
-//=============================================================================
-
-/*
-===========
-GenericCheckAttack
-
-The player is in view, so decide to move or launch an attack
-Returns FALSE if movement should continue
-============
-*/
-float() GenericCheckAttack =
-{
-       local vector spot1, spot2;
-       local entity targ;
-       local float chance;
-
-       if (self.health < 1)
-               return FALSE;
-       targ = self.enemy;
-
-       if (vlen(targ.origin - self.origin) > 5000) // long traces are slow
-               return FALSE;
-
-// see if any entities are in the way of the shot
-       spot1 = self.origin + self.view_ofs;
-       spot2 = targ.origin + targ.view_ofs;
-
-       traceline (spot1, spot2, FALSE, self);
-
-       if (trace_ent != targ)
-               return FALSE; // don't have a clear shot
-
-       if (trace_inopen && trace_inwater)
-               return FALSE; // sight line crossed contents
-
-       if (enemy_range == RANGE_MELEE)
-       {       // melee attack
-               if (self.th_melee)
-               {
-                       self.th_melee ();
-                       return TRUE;
-               }
-       }
-
-// missile attack
-       if (time < ATTACK_FINISHED(self))
-               return FALSE;
-
-       if (!self.th_missile)
-               return FALSE;
-
-       if (enemy_range == RANGE_FAR)
-               return FALSE;
-
-       if (enemy_range == RANGE_MELEE)
-       {
-               chance = 0.9;
-               ATTACK_FINISHED(self) = 0;
-       }
-       else if (enemy_range == RANGE_NEAR)
-       {
-               if (self.th_melee)
-                       chance = 0.2;
-               else
-                       chance = 0.4;
-       }
-       else if (enemy_range == RANGE_MID)
-       {
-               if (self.th_melee)
-                       chance = 0.05;
-               else
-                       chance = 0.1;
-       }
-       else
-               chance = 0;
-
-       if (random () < chance)
-       if (self.th_missile ())
-       {
-               SUB_AttackFinished (2*random());
-               return TRUE;
-       }
-
-       return FALSE;
-};
-
-
-/*
-=============
-ai_face
-
-Stay facing the enemy
-=============
-*/
-void() ai_face =
-{
-       self.ideal_yaw = vectoyaw(self.enemy.origin - self.origin);
-       ChangeYaw ();
-};
-
-/*
-=============
-ai_charge
-
-The monster is in a melee attack, so get as close as possible to .enemy
-=============
-*/
-float (entity targ) visible;
-float(entity targ) infront;
-float(entity targ) range;
-
-void(float d) ai_charge =
-{
-       if (self.health < 1)
-               return;
-       ai_face ();
-       movetogoal (d);         // done in C code...
-};
-
-void() ai_charge_side =
-{
-       if (self.health < 1)
-               return;
-       local vector dtemp;
-       local float heading;
-
-// aim to the left of the enemy for a flyby
-
-       self.ideal_yaw = vectoyaw(self.enemy.origin - self.origin);
-       ChangeYaw ();
-
-       makevectors (self.angles);
-       dtemp = self.enemy.origin - 30*v_right;
-       heading = vectoyaw(dtemp - self.origin);
-
-       walkmove(heading, 20);
-};
-
-
-/*
-=============
-ai_melee
-
-=============
-*/
-void() ai_melee =
-{
-       local vector delta;
-       local float ldmg;
-
-       if (self.health < 1)
-               return;
-       if (!self.enemy)
-               return;         // removed before stroke
-
-       delta = self.enemy.origin - self.origin;
-
-       if (vlen(delta) > 60)
-               return;
-
-       ldmg = DMG_KNIGHT_MELEE_BASE + DMG_KNIGHT_MELEE_RANDOM1 * random();
-       ldmg = ldmg + DMG_KNIGHT_MELEE_RANDOM2 * random();
-       ldmg = ldmg + DMG_KNIGHT_MELEE_RANDOM3 * random();
-       traceline(self.origin, self.enemy.origin, FALSE, self);
-
-       Damage (self.enemy, self, self, ldmg, self.projectiledeathtype, trace_endpos, '0 0 0'); // TODO add force to monster melee attacks?
-};
-
-
-void() ai_melee_side =
-{
-       local vector delta;
-       local float ldmg;
-
-       if (self.health < 1)
-               return;
-       if (!self.enemy)
-               return;         // removed before stroke
-
-       ai_charge_side();
-
-       delta = self.enemy.origin - self.origin;
-
-       if (vlen(delta) > 60)
-               return;
-       if (!CanDamage (self.enemy, self))
-               return;
-       ldmg = DMG_KNIGHT_MELEE_BASE + DMG_KNIGHT_MELEE_RANDOM1 * random();
-       ldmg = ldmg + DMG_KNIGHT_MELEE_RANDOM2 * random();
-       ldmg = ldmg + DMG_KNIGHT_MELEE_RANDOM3 * random();
-       traceline(self.origin, self.enemy.origin, FALSE, self);
-       Damage (self.enemy, self, self, ldmg, self.projectiledeathtype, trace_endpos, '0 0 0');
-};
-
diff --git a/qcsrc/server/monsters/m_monsters.qc b/qcsrc/server/monsters/m_monsters.qc
deleted file mode 100644 (file)
index ceb3f20..0000000
+++ /dev/null
@@ -1,472 +0,0 @@
-/* ALL MONSTERS SHOULD BE 1 0 0 IN COLOR */
-
-// name =[framenum,    nexttime, nextthink] {code}
-// expands to:
-// name ()
-// {
-//             self.frame=framenum;
-//             self.nextthink = time + nexttime;
-//             self.think = nextthink
-//             <code>
-// };
-
-.float ismonster;
-
-.float modelindex2;
-
-/*
-================
-monster_use
-
-Using a monster makes it angry at the current activator
-LordHavoc: using a monster with the spawnflag 'Appear' makes it appear
-================
-*/
-void() monster_use =
-{
-       if (self.enemy)
-               return;
-       if (self.health < 1)
-               return;
-       if (self.mdl)
-       if (self.spawnflags & MONSTER_APPEAR)
-       {
-               self.nextthink = time + 0.1;
-               self.spawnflags = self.spawnflags - MONSTER_APPEAR;
-               self.solid = SOLID_SLIDEBOX;
-               self.takedamage = DAMAGE_AIM;
-               //self.movetype = MOVETYPE_STEP;
-               self.model = self.mdl;
-               self.mdl = "";
-               self.modelindex = self.modelindex2;
-               self.modelindex2 = 0;
-               //setorigin(self, self.origin + '0 0 1');
-               spawn_tdeath(self.origin, self, self.origin);
-               return;
-       }
-
-#if 0
-       if (activator.items & IT_INVISIBILITY)
-               return;
-#endif
-       if (activator.flags & FL_NOTARGET)
-               return;
-       if (activator.classname != "player")
-               return;
-
-       // delay reaction so if the monster is teleported, its sound is still heard
-       self.enemy = activator;
-       self.nextthink = time + 0.1;
-       self.think = FoundTarget;
-};
-
-void() monster_appearsetup =
-{
-       if ((self.spawnflags & MONSTER_APPEAR) == 0)
-               return;
-       self.mdl = self.model;
-       self.modelindex2 = self.modelindex;
-       self.modelindex = 0;
-       self.solid = SOLID_NOT;
-       self.takedamage = DAMAGE_NO;
-       //self.movetype = MOVETYPE_NONE;
-       self.nextthink = -1;
-       self.model = "";
-};
-
-/*
-================
-monster_setalpha
-
-Sets relative alpha of monster in skill 4 mode.
-================
-*/
-void(float a) monster_setalpha =
-{
-       if (skill < 4 || self.classname == "monster_hellfish")
-       {
-               self.alpha = 1.0;
-               return;
-       }
-
-       if (skill >= 5)
-       {
-               // randomly forget enemy, this makes monsters randomly return to their normal ghostlike state
-               if (a == 0)
-               if (self.enemy)
-               if (random() < 0.1)
-                       self.enemy = world;
-               // randomly blink (playing the same alarming sound as if attacking)
-               if (self.enemy == world)
-               {
-                       a = 0;
-                       if (time >= 0.3) // don't blink during the init process because it might become permanent
-                       if (random() < 0.005)
-                       {
-                               // blink for an instant, this causes the appear sound, alarming the player as if under attack
-                               /* PLEASE FIX THE SOUND CHANNEL BEFORE ACTIVATING THIS
-                               sound(self, CHAN_AUTO, "wizard/wsight.wav", 1, ATTN_NORM);
-                               */
-                               a = 1;
-                       }
-               }
-               // if ghosted, become non-solid and immune to damage
-               if (a <= 0 || self.enemy == world)
-               {
-                       self.solid = SOLID_NOT;
-                       self.takedamage = DAMAGE_NO;
-               }
-               else
-               {
-                       // if unghosting, make sure we have an enemy, otherwise stay ghosted (even if blinking) so we can't be shot while blinking
-                       /* PLEASE FIX THE SOUND CHANNEL BEFORE ACTIVATING THIS
-                       if (self.solid != SOLID_SLIDEBOX)
-                               sound(self, CHAN_AUTO, "wizard/wsight.wav", 1, ATTN_NORM);
-                       */
-                       self.solid = SOLID_SLIDEBOX;
-                       self.takedamage = DAMAGE_AIM;
-               }
-       }
-       self.alpha = SKILL4_MINALPHA + (1 - SKILL4_MINALPHA) * bound(0, a, 1);
-};
-
-/*
-================
-monster_death_use
-
-When a mosnter dies, it fires all of its targets with the current
-enemy as activator.
-================
-*/
-void() monster_death_use =
-{
-// fall to ground
-       if (self.flags & FL_FLY)
-               self.flags = self.flags - FL_FLY;
-       if (self.flags & FL_SWIM)
-               self.flags = self.flags - FL_SWIM;
-
-       if (!self.target)
-               return;
-
-       activator = self.enemy;
-       SUB_UseTargets ();
-};
-
-
-void() monsterinwall =
-{
-       local entity e;
-       if (!autocvar_developer)
-               return;
-       // this is handy for level designers,
-       // puts a spikey ball where the error is...
-       e = spawn();
-       setorigin(e, self.origin);
-       setmodel (e, "models/ebomb.mdl");
-       e.movetype = MOVETYPE_NONE;
-       e.solid = SOLID_NOT;
-       e.think = SUB_Null;
-       e.nextthink = -1;
-       e.scale = 16;
-};
-
-//============================================================================
-
-void() walkmonster_start_go =
-{
-       self.origin_z = self.origin_z + 1; // raise off floor a bit
-
-       tracebox(self.origin, self.mins, self.maxs, self.origin, TRUE, self);
-       if (trace_startsolid)
-       {
-               dprint("walkmonster in wall at: ");
-               dprint(vtos(self.origin));
-               dprint("\n");
-               monsterinwall();
-               droptofloor();
-       }
-       else
-       {
-               droptofloor();
-               if (!walkmove(0,0))
-               {
-                       dprint("walkmonster in wall at: ");
-                       dprint(vtos(self.origin));
-                       dprint("\n");
-                       monsterinwall();
-               }
-       }
-
-       //self.cantrigger = TRUE;
-
-       self.takedamage = DAMAGE_AIM;
-
-       self.ideal_yaw = self.angles * '0 1 0';
-       if (!self.yaw_speed)
-               self.yaw_speed = 20;
-       self.view_ofs = '0 0 25';
-       self.use = monster_use;
-
-       self.flags = self.flags | FL_MONSTER;
-
-       if (monsterwander)
-               self.spawnflags = self.spawnflags | MONSTER_WANDER;
-
-       if (self.target)
-       {
-               self.goalentity = self.movetarget = find(world, targetname, self.target);
-               self.ideal_yaw = vectoyaw(self.goalentity.origin - self.origin);
-               if (!self.movetarget)
-               {
-                       dprint("Monster can't find target at ");
-                       dprint(vtos(self.origin));
-                       dprint("\n");
-               }
-               // this used to be an objerror
-               if (self.movetarget.classname == "path_corner")
-                       self.th_walk ();
-               else
-               {
-                       if ((self.spawnflags & MONSTER_WANDER) && (!self.monsterawaitingteleport) && (self.spawnflags & 3) == 0 && (world.model != "maps/e1m7.bsp"))
-                       {
-                               monster_spawnwanderpath();
-                               self.ideal_yaw = vectoyaw(self.goalentity.origin - self.origin);
-                               self.th_walk ();
-                       }
-                       else
-                       {
-                               self.pausetime = 99999999;
-                               self.th_stand ();
-                       }
-               }
-       }
-       else
-       {
-               if ((self.spawnflags & MONSTER_WANDER) && (!self.monsterawaitingteleport) && (self.spawnflags & 3) == 0 && (world.model != "maps/e1m7.bsp"))
-               {
-                       monster_spawnwanderpath();
-                       self.ideal_yaw = vectoyaw(self.goalentity.origin - self.origin);
-                       self.th_walk ();
-               }
-               else
-               {
-                       self.pausetime = 99999999;
-                       self.th_stand ();
-               }
-       }
-
-// spread think times so they don't all happen at same time
-       self.nextthink = self.nextthink + random()*0.5 + 0.1;
-       self.iscreature = TRUE;
-
-       force_retouch = 2; // mainly to detect teleports
-
-       monster_appearsetup();
-};
-
-
-void() walkmonster_start =
-{
-       self.candrown = 1; // this is turned off by some monsters like zombies
-       // delay drop to floor to make sure all doors have been spawned
-       // spread think times so they don't all happen at same time
-       self.nextthink = time + random()*0.5 + 0.3;
-       self.think = walkmonster_start_go;
-       total_monsters = total_monsters + 1;
-       self.bot_attack = TRUE;
-       self.frags = 2; // actually just used to get havocbots to attack it...
-       self.bleedfunc = genericbleedfunc;
-       self.ismonster = TRUE;
-
-       monster_setalpha (0);
-};
-
-
-
-void() flymonster_start_go =
-{
-       self.takedamage = DAMAGE_AIM;
-
-       self.ideal_yaw = self.angles * '0 1 0';
-       if (!self.yaw_speed)
-               self.yaw_speed = 10;
-       self.view_ofs = '0 0 25';
-       self.use = monster_use;
-
-       self.flags = self.flags | FL_FLY;
-       self.flags = self.flags | FL_MONSTER;
-
-       if (!walkmove(0,0))
-       {
-               dprint("flymonster in wall at: ");
-               dprint(vtos(self.origin));
-               dprint("\n");
-               monsterinwall();
-       }
-
-       //self.cantrigger = TRUE;
-
-       if (monsterwander)
-               self.spawnflags = self.spawnflags | MONSTER_WANDER;
-
-       if (self.target)
-       {
-               self.goalentity = self.movetarget = find(world, targetname, self.target);
-               if (!self.movetarget)
-               {
-                       dprint("Monster can't find target at ");
-                       dprint(vtos(self.origin));
-                       dprint("\n");
-               }
-               // this used to be an objerror
-               if (self.movetarget.classname == "path_corner")
-                       self.th_walk ();
-               else
-               {
-                       if ((self.spawnflags & MONSTER_WANDER) && (!self.monsterawaitingteleport) && (self.spawnflags & 3) == 0 && (world.model != "maps/e1m7.bsp"))
-                       {
-                               monster_spawnwanderpath();
-                               self.ideal_yaw = vectoyaw(self.goalentity.origin - self.origin);
-                               self.th_walk ();
-                       }
-                       else
-                       {
-                               self.pausetime = 99999999;
-                               self.th_stand ();
-                       }
-               }
-       }
-       else
-       {
-               if ((self.spawnflags & MONSTER_WANDER) && (!self.monsterawaitingteleport) && (self.spawnflags & 3) == 0 && (world.model != "maps/e1m7.bsp"))
-               {
-                       monster_spawnwanderpath();
-                       self.ideal_yaw = vectoyaw(self.goalentity.origin - self.origin);
-                       self.th_walk ();
-               }
-               else
-               {
-                       self.pausetime = 99999999;
-                       self.th_stand ();
-               }
-       }
-       self.iscreature = TRUE;
-
-       force_retouch = 2; // mainly to detect teleports
-
-       monster_appearsetup();
-};
-
-void() flymonster_start =
-{
-       self.candrown = 1;
-       // spread think times so they don't all happen at same time
-       self.nextthink = time + random()*0.5 + 0.1;
-       self.think = flymonster_start_go;
-       total_monsters = total_monsters + 1;
-       self.bot_attack = TRUE;
-       self.frags = 2; // actually just used to get havocbots to attack it...
-       self.bleedfunc = genericbleedfunc;
-       self.ismonster = TRUE;
-
-       monster_setalpha (0);
-};
-
-
-void() swimmonster_start_go =
-{
-       if (deathmatch)
-       {
-               remove(self);
-               return;
-       }
-
-       //self.cantrigger = TRUE;
-
-       self.takedamage = DAMAGE_AIM;
-
-       self.ideal_yaw = self.angles * '0 1 0';
-       if (!self.yaw_speed)
-               self.yaw_speed = 10;
-       self.view_ofs = '0 0 10';
-       self.use = monster_use;
-
-       self.flags = self.flags | FL_SWIM;
-       self.flags = self.flags | FL_MONSTER;
-
-       if (monsterwander)
-               self.spawnflags = self.spawnflags | MONSTER_WANDER;
-
-       if (self.target)
-       {
-               self.goalentity = self.movetarget = find(world, targetname, self.target);
-               if (!self.movetarget)
-               {
-                       dprint("Monster can't find target at ");
-                       dprint(vtos(self.origin));
-                       dprint("\n");
-               }
-               // this used to be an objerror
-               if (self.movetarget.classname == "path_corner")
-                       self.th_walk ();
-               else
-               {
-                       if ((self.spawnflags & MONSTER_WANDER) && (!self.monsterawaitingteleport) && (self.spawnflags & 3) == 0 && (world.model != "maps/e1m7.bsp"))
-                       {
-                               monster_spawnwanderpath();
-                               self.ideal_yaw = vectoyaw(self.goalentity.origin - self.origin);
-                               self.th_walk ();
-                       }
-                       else
-                       {
-                               self.pausetime = 99999999;
-                               self.th_stand ();
-                       }
-               }
-       }
-       else
-       {
-               if ((self.spawnflags & MONSTER_WANDER) && (!self.monsterawaitingteleport) && (self.spawnflags & 3) == 0 && (world.model != "maps/e1m7.bsp"))
-               {
-                       monster_spawnwanderpath();
-                       self.ideal_yaw = vectoyaw(self.goalentity.origin - self.origin);
-                       self.th_walk ();
-               }
-               else
-               {
-                       self.pausetime = 99999999;
-                       self.th_stand ();
-               }
-       }
-       self.iscreature = TRUE;
-
-       force_retouch = 2; // mainly to detect teleports
-
-       monster_appearsetup();
-};
-
-void() swimmonster_start =
-{
-       // spread think times so they don't all happen at same time
-       self.candrown = 0;
-       self.nextthink = time + random()*0.5 + 0.1;
-       self.think = swimmonster_start_go;
-       total_monsters = total_monsters + 1;
-       self.bot_attack = TRUE;
-       self.frags = 2; // actually just used to get havocbots to attack it...
-       self.bleedfunc = genericbleedfunc;
-       self.ismonster = TRUE;
-
-       monster_setalpha(0);
-};
-
-void(vector org, float bodydamage, float armordamage, vector force, float damgtype) genericbleedfunc =
-{
-        local vector v;
-        v = '0 0 0' - force * 0.05;
-        if (armordamage > 0)
-                te_spark(org, v, armordamage * 3);
-        if (bodydamage > 0)
-                te_blood(org, v, bodydamage);
-}
diff --git a/qcsrc/server/monsters/monster_zombie.qc b/qcsrc/server/monsters/monster_zombie.qc
deleted file mode 100644 (file)
index 2973dee..0000000
+++ /dev/null
@@ -1,555 +0,0 @@
-//#define MONSTES_ENABLED
-#ifdef MONSTES_ENABLED
-
-#define zombie_anim_attackleap         0
-#define zombie_anim_attackrun1         1
-#define zombie_anim_attackrun2         2
-#define zombie_anim_attackrun3         3
-#define zombie_anim_attackstanding1    4
-#define zombie_anim_attackstanding2    5
-#define zombie_anim_attackstanding3    6
-#define zombie_anim_blockend           7
-#define zombie_anim_blockstart         8
-#define zombie_anim_deathback1         9
-#define zombie_anim_deathback2         10
-#define zombie_anim_deathback3         11
-#define zombie_anim_deathfront1        12
-#define zombie_anim_deathfront2        13
-#define zombie_anim_deathfront3        14
-#define zombie_anim_deathleft1         15
-#define zombie_anim_deathleft2         16
-#define zombie_anim_deathright1        17
-#define zombie_anim_deathright2        18
-#define zombie_anim_idle               19
-#define zombie_anim_painback1          20
-#define zombie_anim_painback2          21
-#define zombie_anim_painfront1         22
-#define zombie_anim_painfront2         23
-#define zombie_anim_runbackwards       24
-#define zombie_anim_runbackwardsleft   25
-#define zombie_anim_runbackwardsright  26
-#define zombie_anim_runforward         27
-#define zombie_anim_runforwardleft     28
-#define zombie_anim_runforwardright    29
-#define zombie_anim_spawn              30
-
-#define ZOMBIE_MIN                                      '-18 -18 -25'
-#define ZOMBIE_MAX                                      '18 18 47'
-
-#define ZV_IDLE     10
-
-#define ZV_PATH     100
-#define ZV_HUNT     200
-
-#define ZV_ATTACK_FIND  10
-#define ZV_ATTACK_RUN   20
-#define ZV_ATTACK_STAND 30
-
-#define ZV_PATH2 10000
-
-//.entity verbs_idle;
-//.entity verbs_attack;
-//.entity verbs_move;
-
-//.float  state_timeout;
-//.void() monster_state;
-#define MONSTERFLAG_NORESPAWN 2
-
-void zombie_spawn();
-
-float zombie_scoretarget(entity trg)
-{
-    float  tmp;
-    vector ang1;
-
-    if (trg.takedamage == DAMAGE_AIM)
-    if not (trg.flags & FL_NOTARGET)
-    if (trg.deadflag == DEAD_NO)
-    if (trg.team != self.team)
-    {
-        if((self.origin_z - trg.origin_z) < 128)
-        {
-            ang1 = normalize(self.origin - trg.origin);
-            tmp = vlen(ang1 - v_forward);
-            if(tmp > 1.5)
-            {
-                traceline(self.origin + '0 0 47',trg.origin + '0 0 32',MOVE_NORMAL,self);
-                if(trace_ent != trg)
-                    return 0;
-
-                return (autocvar_g_monster_zombie_targetrange - vlen(self.origin - trg.origin)) * tmp;
-            }
-            else if(self.enemy == trg)
-                return (autocvar_g_monster_zombie_targetrange - vlen(self.origin - trg.origin)) * tmp;
-        }
-    }
-
-    return 0;
-}
-
-void zombie_corpse_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
-{
-    //dprint("zombie_corpse_damage\n");
-    Violence_GibSplash_At(hitloc, force, 2, bound(0, damage, 200) / 16, self, attacker);
-
-    self.health -= damage;
-
-    if(self.health < 0)
-    {
-        Violence_GibSplash(self, 1, 1, attacker);
-        remove(self);
-    }
-}
-
-void zombie_die(vector dir)
-{
-    vector v;
-    float f;
-
-    entity dummy;
-
-    dummy = spawn();
-    setmodel(dummy,"models/monsters/zombie.dpm");
-    setorigin(dummy, self.origin);
-    dummy.velocity  = self.velocity;
-    dummy.movetype  = MOVETYPE_BOUNCE;
-    dummy.think     = SUB_Remove;
-    dummy.nextthink = time + 3;
-    dummy.health    = 50;
-    dummy.takedamage = DAMAGE_YES;
-    dummy.event_damage = zombie_corpse_damage;
-    dummy.solid      = SOLID_CORPSE;
-    setsize(dummy,self.mins,self.maxs);
-
-    SUB_SetFade(dummy,time + 5,2);
-
-
-    v = normalize(self.origin - dir);
-    f = vlen(v_forward - v) - 1;
-    if(f > 0.5)
-        dummy.frame = zombie_anim_deathfront1 + rint(random() * 2);
-    else if(f < 0.5)
-        dummy.frame = zombie_anim_deathback1 + rint(random() * 2);
-    else
-    {
-        f = vlen(v_right - v) - 1;
-        if(f > 0.5)
-            dummy.frame = zombie_anim_deathright1 + rint(random() * 2);
-        else if(f < 0.5)
-            dummy.frame = zombie_anim_deathleft1 + rint(random() * 2);
-    }
-
-
-    if(self.spawnflags & MONSTERFLAG_NORESPAWN)
-    {
-        self.think = SUB_Remove;
-        self.nextthink = time;
-        return;
-    }
-
-    setmodel(self,"");
-    self.solid          = SOLID_NOT;
-    self.takedamage     = DAMAGE_NO;
-    self.event_damage   = SUB_Null;
-    self.enemy          = world;
-    self.think          = zombie_spawn;
-    self.nextthink      = time + autocvar_g_monster_zombie_respawntime;
-    self.pain_finished  = self.nextthink;
-}
-
-void zombie_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
-{
-
-    vector v;
-    float f;
-
-    v = normalize(self.origin - hitloc);
-    f = vlen(v_forward - v) - 1;
-
-
-    self.health -= damage;
-    self.velocity = self.velocity + force;
-    if(self.health <= 0)
-    {
-        zombie_die(hitloc);
-        return;
-    }
-
-    Violence_GibSplash_At(hitloc, force, 2, bound(0, damage, 200) / 16, self, attacker);
-
-       if (damage > 50)
-               Violence_GibSplash_At(hitloc, force * -0.1, 3, 1, self, attacker);
-       if (damage > 100)
-               Violence_GibSplash_At(hitloc, force * -0.2, 3, 1, self, attacker);
-
-    if (time > self.pain_finished)
-    {
-        if(f < 0.5)
-        {
-            if(random() < 0.5)
-                self.frame = zombie_anim_painback1;
-            else
-                self.frame = zombie_anim_painback2;
-        }
-        else
-        {
-            if(random() < 0.5)
-                self.frame = zombie_anim_painfront1;
-            else
-                self.frame = zombie_anim_painfront2;
-        }
-
-        self.pain_finished = time + 0.36;
-    }
-}
-
-.vector bvec;
-.float bvec_time;
-
-void zombie_move()
-{
-    vector real_angle;
-    float vz, tdiff, tspeed;
-
-    tdiff = time - self.zoomstate;
-    tspeed = tdiff * autocvar_g_monster_zombie_turnspeed;
-    vz = self.velocity_z;
-    self.zoomstate = time;
-
-    if(self.bvec_time < time)
-    {
-        self.bvec_time = time + 0.2;
-        self.bvec = steerlib_beamsteer(steerlib_attract2(self.moveto,0.5,500,0.95),512,32,34,64);
-    }
-
-    if(self.enemy)
-        self.moveto = self.enemy.origin;
-    else
-        self.moveto = self.origin + v_forward;
-
-    self.steerto = normalize(steerlib_attract2(self.moveto,0.5,500,0.95) + self.bvec);
-
-    self.angles_y = safeangle(self.angles_y);
-    real_angle = vectoangles(self.steerto) - self.angles;
-    self.angles_y += bound(-10, real_angle_y, 10);
-
-    if(vlen(self.origin - self.moveto) > 64)
-    {
-        movelib_move_simple(v_forward ,autocvar_g_monster_zombie_movespeed,0.6);
-        if(time > self.pain_finished)
-            if(self.attack_finished_single < time)
-                self.frame = zombie_anim_runforward;
-    }
-    else
-    {
-        movelib_beak_simple(autocvar_g_monster_zombie_stopspeed);
-        if(time > self.pain_finished)
-            if(self.attack_finished_single < time)
-                self.frame = zombie_anim_idle;
-    }
-
-    self.velocity_z = vz;
-    self.steerto = self.origin;
-}
-
-float zombie_verb_idle_roam(float eval)
-{
-    switch (eval)
-    {
-    case VCM_EVAL:
-
-        if(self.enemy)
-            return VS_CALL_NO;
-
-        return verb.verb_static_value;
-
-    case VCM_DO:
-
-        self.moveto = v_forward * 128;
-        self.steerto = v_forward; //steerlib_beamsteer(v_forward,512,32,34,64);
-
-        return VS_CALL_YES_DOING;
-    }
-
-    return VS_CALL_YES_DONE;
-}
-
-float zombie_verb_idle_stand(float eval)
-{
-    switch (eval)
-    {
-    case VCM_EVAL:
-
-        if(self.enemy)
-            return VS_CALL_NO;
-
-        return verb.verb_static_value;
-
-    case VCM_DO:
-
-        self.moveto   = self.origin;
-        self.frame    = zombie_anim_idle;
-        self.velocity = '0 0 0';
-
-        return VS_CALL_YES_DOING;
-    }
-
-    return VS_CALL_YES_DONE;
-}
-
-float zombie_verb_idle(float eval)
-{
-    switch (eval)
-    {
-    case VCM_EVAL:
-
-        if(self.enemy)
-            return VS_CALL_NO;
-
-        return verb.verb_static_value;
-
-    case VCM_DO:
-        float t;
-
-        t = autocvar_g_monster_zombie_idle_timer_max -  autocvar_g_monster_zombie_idle_timer_min;
-        t = autocvar_g_monster_zombie_idle_timer_min + (random() * t);
-
-        if(random() < 0.5)
-            verbstack_push(self.verbs_idle, zombie_verb_idle_roam,  ZV_IDLE + 1, t, self);
-        else
-            verbstack_push(self.verbs_idle, zombie_verb_idle_stand, ZV_IDLE + 1, 0.1, self);
-
-        return VS_CALL_YES_DOING;
-    }
-
-    return VS_CALL_YES_DONE;
-}
-
-float zombie_verb_attack_findtarget(float eval)
-{
-    switch (eval)
-    {
-    case VCM_EVAL:
-        if(self.enemy)
-            return VS_CALL_NO;
-
-        return verb.verb_static_value;
-
-    case VCM_DO:
-
-        entity trg, best_trg;
-        float trg_score, best_trg_score;
-
-        trg = findradius(self.origin,autocvar_g_monster_zombie_targetrange);
-        while(trg)
-        {
-            trg_score = zombie_scoretarget(trg);
-            if(trg_score > best_trg_score)
-            {
-                best_trg = trg;
-                best_trg_score = trg_score;
-            }
-
-            trg = trg.chain;
-        }
-
-        if(best_trg)
-        {
-            self.enemy = best_trg;
-            dprint("Selected: ",best_trg.netname, " as target.\n");
-        }
-
-        return VS_CALL_YES_DOING;
-    }
-
-    return VS_CALL_YES_DONE;
-}
-
-void zombie_runattack_damage()
-{
-    entity oldself;
-    oldself = self;
-    self = self.owner;
-
-    if(vlen(self.origin - self.enemy.origin) > autocvar_g_monster_zombie_attack_run_hitrange)
-        return;
-
-    if(vlen(normalize(self.origin - self.enemy.origin) - v_forward) < 1.6)
-        return;
-
-    Damage(self.enemy, self, self, autocvar_g_monster_zombie_attack_run_damage, DEATH_TURRET, self.enemy.origin, normalize(self.enemy.origin - self.origin)  * autocvar_g_monster_zombie_attack_run_force);
-
-    self = oldself;
-    self.think = SUB_Remove;
-    self.nextthink = time;
-}
-
-float zombie_verb_attack_run(float eval)
-{
-    switch (eval)
-    {
-    case VCM_EVAL:
-        if not (self.enemy)
-            return VS_CALL_NO;
-
-        if(self.attack_finished_single > time)
-            return VS_CALL_NO;
-
-        if(vlen(self.origin - self.enemy.origin) > autocvar_g_monster_zombie_attack_run_range)
-            return VS_CALL_NO;
-
-        if(vlen(normalize(self.origin - self.enemy.origin) - v_forward) < 1.6)
-            return VS_CALL_NO;
-
-        return verb.verb_static_value;
-
-    case VCM_DO:
-        entity pain;
-        pain = spawn();
-        pain.owner = self;
-        pain.think = zombie_runattack_damage;
-        pain.nextthink = time + autocvar_g_monster_zombie_attack_run_delay;
-
-        self.attack_finished_single = time + 0.7;
-        self.frame = zombie_anim_attackrun1 + rint(random() * 2);
-
-        return VS_CALL_YES_DOING;
-    }
-
-    return VS_CALL_YES_DONE;
-}
-
-void zombie_standattack_damage()
-{
-    //entity oldself;
-    //oldself = self;
-    //self = self.owner;
-
-    setorigin(self,self.owner.origin + v_forward * 32);
-    RadiusDamage(self, self.owner, autocvar_g_monster_zombie_attack_stand_damage,autocvar_g_monster_zombie_attack_stand_damage,16,self, autocvar_g_monster_zombie_attack_stand_force,DEATH_TURRET,world);
-    //float RadiusDamage (entity inflictor, entity attacker, float coredamage, float edgedamage, float rad, entity ignore, float forceintensity, float deathtype, entity directhitentity)
-
-
-    //self = oldself;
-    self.think = SUB_Remove;
-    self.nextthink = time;
-}
-
-float zombie_verb_attack_stand(float eval)
-{
-    switch (eval)
-    {
-    case VCM_EVAL:
-        if not (self.enemy)
-            return VS_CALL_NO;
-
-        if(self.attack_finished_single > time)
-            return VS_CALL_NO;
-
-        if(vlen(self.origin - self.enemy.origin) > autocvar_g_monster_zombie_attack_stand_range)
-            return VS_CALL_NO;
-
-        if(vlen(normalize(self.origin - self.enemy.origin) - v_forward) < 1.8)
-            return VS_CALL_NO;
-
-        return verb.verb_static_value;
-
-    case VCM_DO:
-        entity pain;
-        pain = spawn();
-        pain.owner = self;
-        pain.think = zombie_runattack_damage;
-        pain.nextthink = time + autocvar_g_monster_zombie_attack_stand_delay;
-
-        self.attack_finished_single = time + 0.7;
-        self.frame = zombie_anim_attackstanding1 + rint(random() * 1);
-        dprint("frame:",ftos(self.frame),"\n");
-
-        return VS_CALL_YES_DOING;
-    }
-
-    return VS_CALL_YES_DONE;
-}
-
-void zombie_think()
-{
-    self.angles_x *= -1;
-    makevectors(self.angles);
-    self.angles_x *= -1;
-
-    if (zombie_scoretarget(self.enemy) == 0)
-        self.enemy = world;
-
-    verbstack_pop(self.verbs_attack);
-    //verbstack_pop(self.verbs_move);
-
-    if not (self.enemy)
-        verbstack_pop(self.verbs_idle);
-
-    zombie_move();
-
-    if(self.enemy)
-        self.nextthink = time;
-    else
-        self.nextthink = time + 0.2;
-}
-
-void zombie_spawn()
-{
-    setmodel(self,"models/monsters/zombie.dpm");
-
-    self.solid          = SOLID_BBOX;
-    self.takedamage     = DAMAGE_AIM;
-    self.event_damage   = zombie_damage;
-    self.enemy          = world;
-    self.frame          = zombie_anim_spawn;
-    self.think          = zombie_think;
-    self.nextthink      = time + 2.1;
-    self.pain_finished  = self.nextthink;
-    self.movetype       = MOVETYPE_WALK;
-    self.health         = autocvar_g_monster_zombie_health;
-    self.velocity       = '0 0 0';
-    self.angles         = self.pos2;
-    self.moveto         = self.origin;
-    self.flags          = FL_MONSTER;
-
-    setorigin(self,self.pos1);
-    setsize(self,ZOMBIE_MIN,ZOMBIE_MAX);
-}
-
-
-void spawnfunc_monster_zombie()
-{
-    if not(autocvar_g_monsters)
-    {
-        remove(self);
-        return;
-    }
-
-    precache_model("models/monsters/zombie.dpm");
-
-
-    self.verbs_idle   = spawn();
-    self.verbs_attack = spawn();
-
-    self.verbs_idle.owner = self;
-    self.verbs_attack.owner = self;
-
-    self.think      = zombie_spawn;
-    self.nextthink  = time + 2;
-
-    traceline(self.origin + '0 0 10', self.origin - '0 0 32', MOVE_WORLDONLY, self);
-
-    self.pos1 = trace_endpos;
-    self.pos2 = self.angles;
-    self.team = MAX_SHOT_DISTANCE -1;
-
-    verbstack_push(self.verbs_idle, zombie_verb_idle, ZV_IDLE,0 , self);
-
-    verbstack_push(self.verbs_attack, zombie_verb_attack_findtarget, ZV_ATTACK_FIND,0 , self);
-    verbstack_push(self.verbs_attack, zombie_verb_attack_run, ZV_ATTACK_RUN,0 , self);
-    verbstack_push(self.verbs_attack, zombie_verb_attack_stand, ZV_ATTACK_STAND,0 , self);
-
-}
-
-#endif // MONSTES_ENABLED
diff --git a/qcsrc/server/mutators/mutator_invincibleproj.qc b/qcsrc/server/mutators/mutator_invincibleproj.qc
new file mode 100644 (file)
index 0000000..d1ab520
--- /dev/null
@@ -0,0 +1,30 @@
+MUTATOR_HOOKFUNCTION(invincibleprojectiles_EditProjectile)
+{
+       if(other.health)
+       {
+               // disable health which in effect disables damage calculations
+               other.health = 0;
+       }
+       return 0;
+}
+
+MUTATOR_HOOKFUNCTION(invincibleprojectiles_BuildMutatorsString)
+{
+       ret_string = strcat(ret_string, ":InvincibleProjectiles");
+       return 0;
+}
+
+MUTATOR_HOOKFUNCTION(invincibleprojectiles_BuildMutatorsPrettyString)
+{
+       ret_string = strcat(ret_string, ", Invincible Projectiles");
+       return 0;
+}
+
+MUTATOR_DEFINITION(mutator_invincibleprojectiles)
+{
+       MUTATOR_HOOK(EditProjectile, invincibleprojectiles_EditProjectile, CBC_ORDER_ANY);
+       MUTATOR_HOOK(BuildMutatorsString, invincibleprojectiles_BuildMutatorsString, CBC_ORDER_ANY);
+       MUTATOR_HOOK(BuildMutatorsPrettyString, invincibleprojectiles_BuildMutatorsPrettyString, CBC_ORDER_ANY);
+
+       return 0;
+}
index d9fff4490467b77fd2f146dd68ec4a416882d6bb..1ae28abe54ff961700c030d9e305119aa51bd5ec 100644 (file)
@@ -2,6 +2,7 @@ MUTATOR_DECLARATION(gamemode_keyhunt);
 MUTATOR_DECLARATION(gamemode_freezetag);
 MUTATOR_DECLARATION(gamemode_keepaway);
 
+MUTATOR_DECLARATION(mutator_invincibleprojectiles);
 MUTATOR_DECLARATION(mutator_nix);
 MUTATOR_DECLARATION(mutator_dodging);
 MUTATOR_DECLARATION(mutator_rocketflying);
index 3aa65f6f5aeda2f0ef6ee6f03c6180520fb64848..a068a33a54e236017194c3ec5ac05e5caa0b9df1 100644 (file)
@@ -79,7 +79,7 @@ void ball_restart (void)
 
 void nexball_setstatus (void)
 {
-       local entity oldself;
+       entity oldself;
        self.items &~= IT_KEY1;
        if (self.ballcarried)
        {
@@ -118,7 +118,7 @@ void football_touch();
 
 void DropOwner (void)
 {
-       local entity ownr;
+       entity ownr;
        ownr = self.owner;
        DropBall(self, ownr.origin, ownr.velocity);
        makevectors(ownr.v_angle_y * '0 1 0');
@@ -128,7 +128,7 @@ void DropOwner (void)
 
 void GiveBall (entity plyr, entity ball)
 {
-       local entity ownr;
+       entity ownr;
 
        if ((ownr = ball.owner))
        {
@@ -407,14 +407,14 @@ void spawnfunc_nexball_team (void)
 void nb_spawnteam (string teamname, float teamcolor)
 {
        dprint("^2spawned team ", teamname, "\n");
-       local entity e;
+       entity e;
        e = spawn();
        e.classname = "nexball_team";
        e.netname = teamname;
        e.cnt = teamcolor;
        e.team = e.cnt + 1;
        nb_teams += 1;
-};
+}
 
 void nb_spawnteams (void)
 {
@@ -592,7 +592,7 @@ void spawnfunc_ball_bound      (void) { spawnfunc_nexball_out(); }
 
 void W_Nexball_Touch (void)
 {
-       local entity ball, attacker;
+       entity ball, attacker;
        attacker = self.owner;
 
        PROJECTILE_TOUCH;
@@ -621,8 +621,8 @@ void W_Nexball_Touch (void)
 
 void W_Nexball_Attack (float t)
 {
-       local entity ball;
-       local float mul, mi, ma;
+       entity ball;
+       float mul, mi, ma;
        if (!(ball = self.ballcarried))
                return;
 
@@ -654,7 +654,7 @@ void W_Nexball_Attack (float t)
 
 void W_Nexball_Attack2 (void)
 {
-       local entity missile;
+       entity missile;
        if (!(balls & BALL_BASKET))
                return;
        W_SetupShot (self, FALSE, 2, "nexball/shoot2.wav", CH_WEAPON_A, 0);
index 35ad9b6185fc8d6b5471079c26b09b99ce867d4d..d74cb0f38bb14edda35a797cc094d041524fc7d8 100644 (file)
@@ -3,7 +3,6 @@ string teamstats_last;
 string playerstats_last;
 string events_last;
 .float playerstats_addedglobalinfo;
-float playerstats_requested;
 .string playerstats_id;
 
 void PlayerStats_Init()
@@ -17,7 +16,9 @@ void PlayerStats_Init()
        playerstats_db = db_create();
        if(playerstats_db >= 0)
                playerstats_waitforme = FALSE; // must wait for it at match end
-       
+
+       serverflags |= SERVERFLAG_PLAYERSTATS;  
+
        PlayerStats_AddEvent(PLAYERSTATS_ALIVETIME);
        PlayerStats_AddEvent(PLAYERSTATS_WINS);
        PlayerStats_AddEvent(PLAYERSTATS_MATCHES);
@@ -154,12 +155,6 @@ void PlayerStats_TeamScore(float t, string event_id, float value) // TODO: doesn
        db_put(playerstats_db, key, ftos(val));
 }
 
-void PlayerStats_Sent_URI_Get_Callback(float id, float status, string data)
-{
-       if(playerstats_requested)
-               playerstats_waitforme = TRUE;
-}
-
 /*
        format spec:
 
@@ -176,7 +171,6 @@ void PlayerStats_Sent_URI_Get_Callback(float id, float status, string data)
        M: map name
        S: "hostname" of the server
        C: number of "unpure" cvar changes
-    W: winning team ID
        P: player ID of an existing player; this also sets the owner for all following "n", "e" and "t" lines (lower case!)
        n: nickname of the player (optional)
     t: team ID
@@ -190,12 +184,12 @@ void PlayerStats_Sent_URI_Get_Callback(float id, float status, string data)
                        total-<scoreboardname>: total score of that scoreboard item
                        scoreboard-<scoreboardname>: end-of-game score of that scoreboard item (can differ in non-team games)
                        achievement-<achievementname>: achievement counters
-            rank <number>: rank of player
-            acc-<weapon netname>-hit: total damage dealt
-            acc-<weapon netname>-fired: total damage that all fired projectiles *could* have dealt
-            acc-<weapon netname>-cnt-hit: amount of shots that actually hit
-            acc-<weapon netname>-cnt-fired: amount of fired shots
-            acc-<weapon netname>-frags: amount of frags dealt by weapon
+                       rank <number>: rank of player
+                       acc-<weapon netname>-hit: total damage dealt
+                       acc-<weapon netname>-fired: total damage that all fired projectiles *could* have dealt
+                       acc-<weapon netname>-cnt-hit: amount of shots that actually hit
+                       acc-<weapon netname>-cnt-fired: amount of fired shots
+                       acc-<weapon netname>-frags: amount of frags dealt by weapon
 */
 
 void PlayerStats_ready(entity fh, entity pass, float status)
@@ -241,9 +235,7 @@ void PlayerStats_ready(entity fh, entity pass, float status)
                                }
                        }
                        url_fputs(fh, "\n");
-                       db_close(playerstats_db);
-                       playerstats_db = -1;
-                       url_fclose(fh, PlayerStats_ready, world);
+                       url_fclose(fh);
                        break;
                case URL_READY_CANREAD:
                        // url_fclose is processing, we got a response for writing the data
@@ -252,12 +244,14 @@ void PlayerStats_ready(entity fh, entity pass, float status)
                        while((s = url_fgets(fh)))
                                print("  ", s, "\n");
                        print("End of response.\n");
-                       url_fclose(fh, PlayerStats_ready, world);
+                       url_fclose(fh);
                        break;
                case URL_READY_CLOSED:
                        // url_fclose has finished
                        print("Player stats written\n");
                        playerstats_waitforme = TRUE;
+                       db_close(playerstats_db);
+                       playerstats_db = -1;
                        break;
                case URL_READY_ERROR:
                default:
@@ -283,8 +277,8 @@ void PlayerStats_Shutdown()
        uri = autocvar_g_playerstats_uri;
        if(uri != "")
        {
-               url_fopen(uri, FILE_APPEND, PlayerStats_ready, world);
                playerstats_waitforme = FALSE;
+               url_multi_fopen(uri, FILE_APPEND, PlayerStats_ready, world);
        }
        else
        {
@@ -295,6 +289,26 @@ void PlayerStats_Shutdown()
 }
 //#NO AUTOCVARS END
 
+void PlayerStats_Accuracy(entity p)
+{
+    entity a, w;
+    a = p.accuracy;
+    float i;
+
+    for(i = WEP_FIRST; i <= WEP_LAST; ++i)
+    {
+        w = get_weaponinfo(i);
+
+        PlayerStats_Event(p, strcat("acc-", w.netname, "-hit"), a.(accuracy_hit[i-1]));
+        PlayerStats_Event(p, strcat("acc-", w.netname, "-fired"), a.(accuracy_fired[i-1]));
+
+        PlayerStats_Event(p, strcat("acc-", w.netname, "-cnt-hit"), a.(accuracy_cnt_hit[i-1]));
+        PlayerStats_Event(p, strcat("acc-", w.netname, "-cnt-fired"), a.(accuracy_cnt_fired[i-1]));
+
+        PlayerStats_Event(p, strcat("acc-", w.netname, "-frags"), a.(accuracy_frags[i-1]));
+    }
+}
+
 void PlayerStats_AddGlobalInfo(entity p)
 {
        if(playerstats_db < 0)
@@ -321,38 +335,30 @@ void PlayerStats_AddGlobalInfo(entity p)
        if(stof(db_get(playerstats_db, sprintf("%d:%s", p.playerstats_id, PLAYERSTATS_ALIVETIME))) > 0)
                PlayerStats_Event(p, PLAYERSTATS_JOINS, 1);
 
+       PlayerStats_Accuracy(p);
+
        strunzone(p.playerstats_id);
        p.playerstats_id = string_null;
 }
 
-void PlayerStats_Accuracy(entity p)
-{
-    entity a, w;
-    a = p.accuracy;
-    float i;
-
-    for(i = WEP_FIRST; i <= WEP_LAST; ++i)
-    {
-        w = get_weaponinfo(i);
-
-        PlayerStats_Event(p, strcat("acc-", w.netname, "-hit"), a.(accuracy_hit[i-1]));
-        PlayerStats_Event(p, strcat("acc-", w.netname, "-fired"), a.(accuracy_fired[i-1]));
-
-        PlayerStats_Event(p, strcat("acc-", w.netname, "-cnt-hit"), a.(accuracy_cnt_hit[i-1]));
-        PlayerStats_Event(p, strcat("acc-", w.netname, "-cnt-fired"), a.(accuracy_cnt_fired[i-1]));
-
-        PlayerStats_Event(p, strcat("acc-", w.netname, "-frags"), a.(accuracy_frags[i-1]));
-    }
-}
-
 void PlayerStats_EndMatch(float finished)
 {
        entity p, winner;
-    winner = PlayerScore_Sort(score_dummyfield);
-       FOR_EACH_PLAYER(p) // spectators intentionally not included
+       winner = PlayerScore_Sort(score_dummyfield);
+       FOR_EACH_CLIENT(p) // spectators intentionally not included
        {
-               PlayerScore_PlayerStats(p);
                PlayerStats_Accuracy(p);
+               if(g_arena || g_lms || g_ca)
+               {
+                       if(p.alivetime <= 0)
+                               continue;
+               }
+               else
+               {
+                       if(p.classname != "player")
+                               continue;
+               }
+               PlayerScore_PlayerStats(p);
                PlayerStats_Event(p, PLAYERSTATS_SCOREBOARD_VALID, 1);
                if(finished)
                {
index f546e560590025c124a4615905e07a2c15252a3e..b99366434b9e214bbeff607a333dc81f1d6271b6 100644 (file)
@@ -44,9 +44,6 @@ void PlayerStats_TeamScore(float t, string event_id, float value);
 // call at game over
 void PlayerStats_Shutdown(); // send stats to the server
 
-// URI GET callback
-void PlayerStats_Sent_URI_Get_Callback(float id, float status, string data);
-
 // call this whenever a player leaves
 void PlayerStats_AddGlobalInfo(entity p);
 
index 87e66136ad677199293f13235160ddbadd801a1a..01624a709414a02920347e193c719ca09d8d1d37 100644 (file)
@@ -169,11 +169,7 @@ target_music.qc
 
 ../common/items.qc
 
-monsters/defs.qc
-monsters/fight.qc
-monsters/ai.qc
-monsters/m_monsters.qc
-monsters/monster_zombie.qc
+
 accuracy.qc
 csqcprojectile.qc
 
@@ -189,6 +185,7 @@ mutators/base.qc
 mutators/gamemode_keyhunt.qc
 mutators/gamemode_freezetag.qc
 mutators/gamemode_keepaway.qc
+mutators/mutator_invincibleproj.qc
 mutators/mutator_nix.qc
 mutators/mutator_dodging.qc
 mutators/mutator_rocketflying.qc
index 15f43ad9eb730f980a1c40827213b13106c84a55..ce5828affc0194d1c051cf26b3412b6ff2688c61 100644 (file)
@@ -1,28 +1,31 @@
-
 void CreatureFrame (void)
 {
-       local entity oldself;
-       local float dm;
+       entity oldself;
+       float dm;
+       
        oldself = self;
-       for(self = world; (self = findfloat(self, iscreature, TRUE)); )
+       for(self = world; (self = findfloat(self, damagedbycontents, TRUE)); )
        {
-               if (self.movetype == MOVETYPE_NOCLIP)
-                       continue;
+               if (self.movetype == MOVETYPE_NOCLIP) { continue; }
+               
                float vehic = (self.vehicle_flags & VHF_ISVEHICLE);
-               if (self.waterlevel)
+               float projectile = (self.flags & FL_PROJECTILE);
+               
+               if (self.watertype <= CONTENT_WATER && self.waterlevel > 0) // workaround a retarded bug made by id software :P (yes, it's that old of a bug)
                {
                        if (!(self.flags & FL_INWATER))
                        {
                                self.flags |= FL_INWATER;
                                self.dmgtime = 0;
                        }
-                       if(!vehic) // vehicles don't drown
+
+                       if(!vehic && !projectile) // vehicles and projectiles don't drown
                        {
                                if (self.waterlevel != WATERLEVEL_SUBMERGED)
                                {
-                                       if(self.air_finished < time + 9)
+                                       if(self.air_finished < time)
                                                PlayerSound(playersound_gasp, CH_PLAYER, VOICETYPE_PLAYERSOUND);
-                                       self.air_finished = time + 12;
+                                       self.air_finished = time + autocvar_g_balance_contents_drowndelay;
                                        self.dmg = 2;
                                }
                                else if (self.air_finished < time)
@@ -30,31 +33,40 @@ void CreatureFrame (void)
                                        if (!self.deadflag)
                                        if (self.pain_finished < time)
                                        {
-                                               Damage (self, world, world, 5, DEATH_DROWN, self.origin, '0 0 0');
+                                               Damage (self, world, world, autocvar_g_balance_contents_playerdamage_drowning * autocvar_g_balance_contents_damagerate, DEATH_DROWN, self.origin, '0 0 0');
                                                self.pain_finished = time + 0.5;
                                        }
                                }
                        }
+                       
                        if (self.dmgtime < time)
                        {
-                               self.dmgtime = time + 0.2;
-                               if (self.watertype == CONTENT_LAVA)
+                               self.dmgtime = time + autocvar_g_balance_contents_damagerate; 
+                               
+                               if (!projectile)
                                {
-                                       if (self.watersound_finished < time)
+                                       if (self.watertype == CONTENT_LAVA)
                                        {
-                                               self.watersound_finished = time + 0.5;
-                                               sound (self, CH_PLAYER, "player/lava.wav", VOL_BASE, ATTN_NORM);
+                                               if (self.watersound_finished < time)
+                                               {
+                                                       self.watersound_finished = time + 0.5;
+                                                       sound (self, CH_PLAYER, "player/lava.wav", VOL_BASE, ATTN_NORM);
+                                               }
+                                               Damage (self, world, world, autocvar_g_balance_contents_playerdamage_lava * autocvar_g_balance_contents_damagerate * self.waterlevel, DEATH_LAVA, self.origin, '0 0 0');
                                        }
-                                       Damage (self, world, world, 6 * self.waterlevel, DEATH_LAVA, self.origin, '0 0 0');
-                               }
-                               else if (self.watertype == CONTENT_SLIME)
-                               {
-                                       if (self.watersound_finished < time)
+                                       else if (self.watertype == CONTENT_SLIME)
                                        {
-                                               self.watersound_finished = time + 0.5;
-                                               sound (self, CH_PLAYER, "player/slime.wav", VOL_BASE, ATTN_NORM);
+                                               if (self.watersound_finished < time)
+                                               {
+                                                       self.watersound_finished = time + 0.5;
+                                                       sound (self, CH_PLAYER, "player/slime.wav", VOL_BASE, ATTN_NORM);
+                                               }
+                                               Damage (self, world, world, autocvar_g_balance_contents_playerdamage_slime * autocvar_g_balance_contents_damagerate * self.waterlevel, DEATH_SLIME, self.origin, '0 0 0');
                                        }
-                                       Damage (self, world, world, 2 * self.waterlevel, DEATH_SLIME, self.origin, '0 0 0');
+                               }
+                               else if ((self.watertype == CONTENT_LAVA) || (self.watertype == CONTENT_SLIME))
+                               {
+                                       Damage (self, world, world, autocvar_g_balance_contents_projectiledamage * autocvar_g_balance_contents_damagerate * self.waterlevel, DEATH_SLIME, self.origin, '0 0 0');
                                }
                        }
                }
@@ -70,7 +82,7 @@ void CreatureFrame (void)
                        self.dmg = 2;
                }
 
-               if(!vehic) // vehicles don't get falling damage
+               if(!vehic && !projectile) // vehicles don't get falling damage
                {
                        // check for falling damage
                        float velocity_len = vlen(self.velocity);
index 26ad056f2f602227b58892a12774b932cbde52d4..0a95b78d06c96f930eb903b746000a48d232d991 100644 (file)
@@ -6,33 +6,33 @@
 .float  rendermode;
 .vector rendercolor;
 
-void spawnfunc_weapon_crossbow() {};
-void spawnfunc_weapon_handgrenade() {};
-void spawnfunc_ammo_crossbow() {};
-void spawnfunc_ammo_9mmclip() {};
-void spawnfunc_ammo_gaussclip() {};
-void spawnfunc_weapon_rpg() {};
-void spawnfunc_weapon_357() {};
-void ammo_ARgrenades() {};
-void spawnfunc_item_battery() {};
-void spawnfunc_ammo_rpgclip() {};
-void weapon_9mmAR() {};
-void spawnfunc_weapon_tripmine() {};
-void spawnfunc_weapon_snark() {};
-void spawnfunc_ammo_buckshot() {};
-void ammo_9mmAR() {};
-void spawnfunc_ammo_357() {};
-void spawnfunc_weapon_gauss() {};
-void spawnfunc_weapon_hornetgun() {};
-//void spawnfunc_weapon_shotgun() {};
-void spawnfunc_item_healthkit() {};
-void spawnfunc_item_longjump() {};
-void spawnfunc_item_antidote() {};
-void spawnfunc_func_recharge() {};
-void spawnfunc_info_node() {};
-void spawnfunc_env_sound() {};
-void spawnfunc_light_spot() {};
-void spawnfunc_func_healthcharger() {};
+void spawnfunc_weapon_crossbow() {}
+void spawnfunc_weapon_handgrenade() {}
+void spawnfunc_ammo_crossbow() {}
+void spawnfunc_ammo_9mmclip() {}
+void spawnfunc_ammo_gaussclip() {}
+void spawnfunc_weapon_rpg() {}
+void spawnfunc_weapon_357() {}
+void ammo_ARgrenades() {}
+void spawnfunc_item_battery() {}
+void spawnfunc_ammo_rpgclip() {}
+void weapon_9mmAR() {}
+void spawnfunc_weapon_tripmine() {}
+void spawnfunc_weapon_snark() {}
+void spawnfunc_ammo_buckshot() {}
+void ammo_9mmAR() {}
+void spawnfunc_ammo_357() {}
+void spawnfunc_weapon_gauss() {}
+void spawnfunc_weapon_hornetgun() {}
+//void spawnfunc_weapon_shotgun() {}
+void spawnfunc_item_healthkit() {}
+void spawnfunc_item_longjump() {}
+void spawnfunc_item_antidote() {}
+void spawnfunc_func_recharge() {}
+void spawnfunc_info_node() {}
+void spawnfunc_env_sound() {}
+void spawnfunc_light_spot() {}
+void spawnfunc_func_healthcharger() {}
 
 
 void func_ladder_touch()
@@ -46,17 +46,17 @@ void func_ladder_touch()
 
        other.ladder_time = time + 0.1;
        other.ladder_entity = self;
-};
+}
 
 void spawnfunc_func_ladder()
 {
        EXACTTRIGGER_INIT;
        self.touch = func_ladder_touch;
-};
+}
 
 void spawnfunc_func_water()
 {
        EXACTTRIGGER_INIT;
        self.touch = func_ladder_touch;
-};
+}
 
index 0c0801eaa7d0e4a6b62e5906a1e89db7716b49b2..f7a8d2aec157a966e0299a89402e2b280af92721 100644 (file)
@@ -559,7 +559,7 @@ void RemoveItem(void)
 // pickup evaluation functions
 // these functions decide how desirable an item is to the bots
 
-float generic_pickupevalfunc(entity player, entity item) {return item.bot_pickupbasevalue;};
+float generic_pickupevalfunc(entity player, entity item) {return item.bot_pickupbasevalue;}
 
 float weapon_pickupevalfunc(entity player, entity item)
 {
@@ -616,7 +616,7 @@ float weapon_pickupevalfunc(entity player, entity item)
        }
 
        return item.bot_pickupbasevalue * c;
-};
+}
 
 float commodity_pickupevalfunc(entity player, entity item)
 {
@@ -669,7 +669,7 @@ float commodity_pickupevalfunc(entity player, entity item)
                c = c + max(0, 1 - player.health / item.max_health);
 
        return item.bot_pickupbasevalue * c;
-};
+}
 
 
 .float is_item;
@@ -855,7 +855,7 @@ void StartItem (string itemmodel, string pickupsound, float defaultrespawntime,
  */
 void minstagib_items (float itemid)
 {
-       local float rnd;
+       float rnd;
        self.classname = "minstagib";
 
        // replace rocket launchers and nex guns with ammo cells
index 888b94456ff6496223698d7a2bce47054f7276d6..bf17e3faf0ece436d0508dc64c4a9bc517103566 100644 (file)
@@ -30,8 +30,8 @@ void trigger_push_use()
 
 vector trigger_push_calculatevelocity(vector org, entity tgt, float ht)
 {
-       local float grav, sdist, zdist, vs, vz, jumpheight;
-       local vector sdir, torg;
+       float grav, sdist, zdist, vs, vz, jumpheight;
+       vector sdir, torg;
 
        torg = tgt.origin + (tgt.mins + tgt.maxs) * 0.5;
 
@@ -127,8 +127,6 @@ vector trigger_push_calculatevelocity(vector org, entity tgt, float ht)
 
 void trigger_push_touch()
 {
-       vector move;
-
        if (self.active == ACTIVE_NOT)
                return;
 
@@ -177,12 +175,12 @@ void trigger_push_touch()
                        sound (other, CH_TRIGGER, self.noise, VOL_BASE, ATTN_NORM);
                        self.pushltime = time + 0.2;
                }
-               local float ct;
+               float ct;
                ct = clienttype(other);
                if( ct == CLIENTTYPE_REAL || ct == CLIENTTYPE_BOT)
                {
-                       local float i;
-                       local float found;
+                       float i;
+                       float found;
                        found = FALSE;
                        for(i = 0; i < other.jumppadcount && i < NUM_JUMPPADSUSED; ++i)
                                if(other.(jumppadsused[i]) == self)
@@ -200,6 +198,14 @@ void trigger_push_touch()
                        }
                        else
                                other.lastteleporttime = time;
+
+                       if (!other.animstate_override)
+                       {
+                               if (other.crouch)
+                                       setanim(other, other.anim_duckjump, FALSE, TRUE, TRUE);
+                               else
+                                       setanim(other, other.anim_jump, FALSE, TRUE, TRUE);
+                       }
                }
                else
                        other.jumppadcount = TRUE;
@@ -241,14 +247,13 @@ void trigger_push_touch()
                self.think = SUB_Remove;
                self.nextthink = time;
        }
-};
+}
 
 .vector dest;
 void trigger_push_findtarget()
 {
-       local entity e, t;
-       local vector org;
-       local float flighttime;
+       entity e, t;
+       vector org;
 
        // first calculate a typical start point for the jump
        org = (self.absmin + self.absmax) * 0.5;
@@ -298,7 +303,7 @@ void trigger_push_findtarget()
                waypoint_spawnforteleporter(self, trace_endpos, vlen(trace_endpos - org) / vlen(e.velocity));
                remove(e);
        }
-};
+}
 
 /*
  * ENTITY PARAMETERS:
@@ -333,8 +338,8 @@ void spawnfunc_trigger_push()
 
        // this must be called to spawn the teleport waypoints for bots
        InitializeEntity(self, trigger_push_findtarget, INITPRIO_FINDTARGET);
-};
+}
 
-void spawnfunc_target_push() {};
-void spawnfunc_info_notnull() {};
-void spawnfunc_target_position() {};
+void spawnfunc_target_push() {}
+void spawnfunc_info_notnull() {}
+void spawnfunc_target_position() {}
index e0d1ca6f55882e3dc9954c08986f07cece7e0e30..f116e74a1cebf880cf86c1bfd72eae9c09b2ea1b 100644 (file)
@@ -31,8 +31,8 @@ float PLAT_LOW_TRIGGER = 1;
 
 void plat_spawn_inside_trigger()
 {
-       local entity trigger;
-       local vector tmin, tmax;
+       entity trigger;
+       vector tmin, tmax;
 
        trigger = spawn();
        trigger.touch = plat_center_touch;
@@ -58,7 +58,7 @@ void plat_spawn_inside_trigger()
        }
 
        setsize (trigger, tmin, tmax);
-};
+}
 
 void plat_hit_top()
 {
@@ -66,27 +66,27 @@ void plat_hit_top()
        self.state = 1;
        self.think = plat_go_down;
        self.nextthink = self.ltime + 3;
-};
+}
 
 void plat_hit_bottom()
 {
        sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTN_NORM);
        self.state = 2;
-};
+}
 
 void plat_go_down()
 {
        sound (self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTN_NORM);
        self.state = 3;
        SUB_CalcMove (self.pos2, self.speed, plat_hit_bottom);
-};
+}
 
 void plat_go_up()
 {
        sound (self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTN_NORM);
        self.state = 4;
        SUB_CalcMove (self.pos1, self.speed, plat_hit_top);
-};
+}
 
 void plat_center_touch()
 {
@@ -101,7 +101,7 @@ void plat_center_touch()
                plat_go_up ();
        else if (self.state == 1)
                self.nextthink = self.ltime + 1;        // delay going down
-};
+}
 
 void plat_outside_touch()
 {
@@ -114,14 +114,14 @@ void plat_outside_touch()
        self = self.enemy;
        if (self.state == 1)
                plat_go_down ();
-};
+}
 
 void plat_trigger_use()
 {
        if (self.think)
                return;         // already activated
        plat_go_down();
-};
+}
 
 
 void plat_crush()
@@ -144,7 +144,7 @@ void plat_crush()
        // plat state already had changed
        // this isn't a bug per se!
     }
-};
+}
 
 void plat_use()
 {
@@ -152,7 +152,7 @@ void plat_use()
        if (self.state != 4)
                objerror ("plat_use: not in up state");
        plat_go_down();
-};
+}
 
 .string sound1, sound2;
 
@@ -172,7 +172,7 @@ void plat_reset()
        }
 }
 
-void spawnfunc_path_corner() { };
+void spawnfunc_path_corner() { }
 void spawnfunc_func_plat()
 {
        if (!self.t_length)
@@ -240,7 +240,7 @@ void spawnfunc_func_plat()
 
        self.reset = plat_reset;
        plat_reset();
-};
+}
 
 
 void() train_next;
@@ -265,11 +265,11 @@ void train_wait()
        SUB_UseTargets();
        self = oldself;
        self.enemy = world;
-};
+}
 
 void train_next()
 {
-       local entity targ;
+       entity targ;
        targ = find(world, targetname, self.target);
        self.enemy = targ;
        self.target = targ.target;
@@ -286,11 +286,11 @@ void train_next()
 
        if(self.noise != "")
                sound(self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTN_IDLE);
-};
+}
 
 void func_train_find()
 {
-       local entity targ;
+       entity targ;
        targ = find(world, targetname, self.target);
        self.target = targ.target;
        if (!self.target)
@@ -298,7 +298,7 @@ void func_train_find()
        setorigin(self, targ.origin - self.mins);
        self.nextthink = self.ltime + 1;
        self.think = train_next;
-};
+}
 
 /*QUAKED spawnfunc_func_train (0 .5 .8) ?
 Ridable platform, targets spawnfunc_path_corner path to follow.
@@ -332,7 +332,7 @@ void spawnfunc_func_train()
        self.dmgtime2 = time;
 
        // TODO make a reset function for this one
-};
+}
 
 void func_rotating_setactive(float astate)
 {
@@ -408,12 +408,12 @@ void spawnfunc_func_rotating()
        self.think = SUB_Null;
 
        // TODO make a reset function for this one
-};
+}
 
 .float height;
 void func_bobbing_controller_think()
 {
-       local vector v;
+       vector v;
        self.nextthink = time + 0.1;
        
        if not (self.owner.active == ACTIVE_ACTIVE)
@@ -428,7 +428,7 @@ void func_bobbing_controller_think()
        if(self.owner.classname == "func_bobbing") // don't brake stuff if the func_bobbing was killtarget'ed
                // * 10 so it will arrive in 0.1 sec
                self.owner.velocity = (v - self.owner.origin) * 10;
-};
+}
 
 /*QUAKED spawnfunc_func_bobbing (0 .5 .8) ? X_AXIS Y_AXIS
 Brush model that moves back and forth on one axis (default Z).
@@ -441,7 +441,7 @@ dmgtime : See above.
 */
 void spawnfunc_func_bobbing()
 {
-       local entity controller;
+       entity controller;
        if (self.noise != "")
        {
                precache_sound(self.noise);
@@ -492,12 +492,12 @@ void spawnfunc_func_bobbing()
        self.effects |= EF_LOWPRECISION;
 
        // TODO make a reset function for this one
-};
+}
 
 .float freq;
 void func_pendulum_controller_think()
 {
-       local float v;
+       float v;
        self.nextthink = time + 0.1;
 
        if not (self.owner.active == ACTIVE_ACTIVE)
@@ -514,11 +514,11 @@ void func_pendulum_controller_think()
                // * 10 so it will arrive in 0.1 sec
                self.owner.avelocity_z = (remainder(v - self.owner.angles_z, 360)) * 10;
        }
-};
+}
 
 void spawnfunc_func_pendulum()
 {
-       local entity controller;
+       entity controller;
        if (self.noise != "")
        {
                precache_sound(self.noise);
@@ -568,7 +568,7 @@ void spawnfunc_func_pendulum()
        //self.effects |= EF_LOWPRECISION;
 
        // TODO make a reset function for this one
-};
+}
 
 // button and multiple button
 
@@ -583,12 +583,12 @@ void button_wait()
        activator = self.enemy;
        SUB_UseTargets();
        self.frame = 1;                 // use alternate textures
-};
+}
 
 void button_done()
 {
        self.state = STATE_BOTTOM;
-};
+}
 
 void button_return()
 {
@@ -597,13 +597,13 @@ void button_return()
        self.frame = 0;                 // use normal textures
        if (self.health)
                self.takedamage = DAMAGE_YES;   // can be shot again
-};
+}
 
 
 void button_blocked()
 {
        // do nothing, just don't come all the way back out
-};
+}
 
 
 void button_fire()
@@ -619,7 +619,7 @@ void button_fire()
 
        self.state = STATE_UP;
        SUB_CalcMove (self.pos2, self.speed, button_wait);
-};
+}
 
 void button_reset()
 {
@@ -644,7 +644,7 @@ void button_use()
 
        self.enemy = activator;
        button_fire ();
-};
+}
 
 void button_touch()
 {
@@ -663,7 +663,7 @@ void button_touch()
        if (other.owner)
                self.enemy = other.owner;
        button_fire ();
-};
+}
 
 void button_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
 {
@@ -681,7 +681,7 @@ void button_damage(entity inflictor, entity attacker, float damage, float deatht
                self.enemy = damage_attacker;
                button_fire ();
        }
-};
+}
 
 
 /*QUAKED spawnfunc_func_button (0 .5 .8) ?
@@ -738,7 +738,7 @@ void spawnfunc_func_button()
     self.flags |= FL_NOTARGET;
 
        button_reset();
-};
+}
 
 
 float DOOR_START_OPEN = 1;
@@ -820,7 +820,7 @@ void door_blocked()
                        door_go_down ();
        }
 */
-};
+}
 
 
 void door_hit_top()
@@ -838,14 +838,14 @@ void door_hit_top()
                self.think = door_rotating_go_down;
        }
        self.nextthink = self.ltime + self.wait;
-};
+}
 
 void door_hit_bottom()
 {
        if (self.noise1 != "")
                sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTN_NORM);
        self.state = STATE_BOTTOM;
-};
+}
 
 void door_go_down()
 {
@@ -859,7 +859,7 @@ void door_go_down()
 
        self.state = STATE_DOWN;
        SUB_CalcMove (self.pos1, self.speed, door_hit_bottom);
-};
+}
 
 void door_go_up()
 {
@@ -882,7 +882,7 @@ void door_go_up()
        self.message = "";
        SUB_UseTargets();
        self.message = oldmessage;
-};
+}
 
 
 
@@ -948,8 +948,8 @@ float door_check_keys(void) {
 
 void door_fire()
 {
-       local entity    oself;
-       local entity    starte;
+       entity  oself;
+       entity  starte;
 
        if (self.owner != self)
                objerror ("door_fire: self.owner != self");
@@ -1003,12 +1003,12 @@ void door_fire()
                self = self.enemy;
        } while ( (self != starte) && (self != world) );
        self = oself;
-};
+}
 
 
 void door_use()
 {
-       local entity oself;
+       entity oself;
 
        //dprint("door_use (model: ");dprint(self.model);dprint(")\n");
        
@@ -1019,7 +1019,7 @@ void door_use()
                door_fire ();
                self = oself;
        }
-};
+}
 
 
 void door_trigger_touch()
@@ -1041,12 +1041,12 @@ void door_trigger_touch()
 
        self = self.owner;
        door_use ();
-};
+}
 
 
 void door_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
 {
-       local entity oself;
+       entity oself;
        if(self.spawnflags & DOOR_NOSPLASH)
                if(!(DEATH_ISSPECIAL(deathtype)) && (deathtype & HITTYPE_SPLASH))
                        return;
@@ -1066,7 +1066,7 @@ void door_damage(entity inflictor, entity attacker, float damage, float deathtyp
                door_use ();
                self = oself;
        }
-};
+}
 
 
 /*
@@ -1091,7 +1091,7 @@ void door_touch()
                        centerprint (other, self.owner.message);
                play2(other, "misc/talk.wav");
        }
-};
+}
 
 
 void door_generic_plat_blocked()
@@ -1131,7 +1131,7 @@ void door_generic_plat_blocked()
                        door_rotating_go_down ();
        }
 */
-};
+}
 
 
 void door_rotating_hit_top()
@@ -1143,7 +1143,7 @@ void door_rotating_hit_top()
                return;         // don't come down automatically
        self.think = door_rotating_go_down;
        self.nextthink = self.ltime + self.wait;
-};
+}
 
 void door_rotating_hit_bottom()
 {
@@ -1155,7 +1155,7 @@ void door_rotating_hit_bottom()
                self.lip = 0;
        }
        self.state = STATE_BOTTOM;
-};
+}
 
 void door_rotating_go_down()
 {
@@ -1169,7 +1169,7 @@ void door_rotating_go_down()
 
        self.state = STATE_DOWN;
        SUB_CalcAngleMove (self.pos1, self.speed, door_rotating_hit_bottom);
-};
+}
 
 void door_rotating_go_up()
 {
@@ -1191,7 +1191,7 @@ void door_rotating_go_up()
        self.message = "";
        SUB_UseTargets();
        self.message = oldmessage;
-};
+}
 
 
 
@@ -1207,8 +1207,8 @@ SPAWNING FUNCTIONS
 
 entity spawn_field(vector fmins, vector fmaxs)
 {
-       local entity    trigger;
-       local   vector  t1, t2;
+       entity  trigger;
+       vector  t1, t2;
 
        trigger = spawn();
        trigger.classname = "doortriggerfield";
@@ -1221,7 +1221,7 @@ entity spawn_field(vector fmins, vector fmaxs)
        t2 = fmaxs;
        setsize (trigger, t1 - '60 60 8', t2 + '60 60 8');
        return (trigger);
-};
+}
 
 
 float EntitiesTouching(entity e1, entity e2)
@@ -1239,7 +1239,7 @@ float EntitiesTouching(entity e1, entity e2)
        if (e1.absmax_z < e2.absmin_z)
                return FALSE;
        return TRUE;
-};
+}
 
 
 /*
@@ -1251,8 +1251,8 @@ LinkDoors
 */
 void LinkDoors()
 {
-       local entity    t, starte;
-       local vector    cmins, cmaxs;
+       entity  t, starte;
+       vector  cmins, cmaxs;
 
        if (self.enemy)
                return;         // already linked by another door
@@ -1333,7 +1333,7 @@ void LinkDoors()
                }
        } while (1 );
 
-};
+}
 
 
 /*QUAKED spawnfunc_func_door (0 .5 .8) ? START_OPEN x DOOR_DONT_LINK GOLD_KEY SILVER_KEY TOGGLE
@@ -1449,7 +1449,7 @@ void spawnfunc_func_door()
        InitializeEntity(self, LinkDoors, INITPRIO_LINKDOORS);
 
        self.reset = door_reset;
-};
+}
 
 /*QUAKED spawnfunc_func_door_rotating (0 .5 .8) ? START_OPEN BIDIR DOOR_DONT_LINK BIDIR_IN_DOWN x TOGGLE X_AXIS Y_AXIS
 if two doors touch, they are assumed to be connected and operate as a unit.
@@ -1573,7 +1573,7 @@ void spawnfunc_func_door_rotating()
        InitializeEntity(self, LinkDoors, INITPRIO_LINKDOORS);
 
        self.reset = door_rotating_reset;
-};
+}
 
 /*
 =============================================================================
@@ -1600,7 +1600,7 @@ float SECRET_YES_SHOOT = 16;      // shootable even if targeted
 
 void fd_secret_use()
 {
-       local float temp;
+       float temp;
        string message_save;
 
        self.health = 10000;
@@ -1646,7 +1646,7 @@ void fd_secret_use()
        SUB_CalcMove(self.dest1, self.speed, fd_secret_move1);
        if (self.noise2 != "")
                sound(self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTN_NORM);
-};
+}
 
 // Wait after first movement...
 void fd_secret_move1()
@@ -1655,7 +1655,7 @@ void fd_secret_move1()
        self.think = fd_secret_move2;
        if (self.noise3 != "")
                sound(self, CH_TRIGGER_SINGLE, self.noise3, VOL_BASE, ATTN_NORM);
-};
+}
 
 // Start moving sideways w/sound...
 void fd_secret_move2()
@@ -1663,7 +1663,7 @@ void fd_secret_move2()
        if (self.noise2 != "")
                sound(self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTN_NORM);
        SUB_CalcMove(self.dest2, self.speed, fd_secret_move3);
-};
+}
 
 // Wait here until time to go back...
 void fd_secret_move3()
@@ -1675,7 +1675,7 @@ void fd_secret_move3()
                self.nextthink = self.ltime + self.wait;
                self.think = fd_secret_move4;
        }
-};
+}
 
 // Move backward...
 void fd_secret_move4()
@@ -1683,7 +1683,7 @@ void fd_secret_move4()
        if (self.noise2 != "")
                sound(self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTN_NORM);
        SUB_CalcMove(self.dest1, self.speed, fd_secret_move5);
-};
+}
 
 // Wait 1 second...
 void fd_secret_move5()
@@ -1692,14 +1692,14 @@ void fd_secret_move5()
        self.think = fd_secret_move6;
        if (self.noise3 != "")
                sound(self, CH_TRIGGER_SINGLE, self.noise3, VOL_BASE, ATTN_NORM);
-};
+}
 
 void fd_secret_move6()
 {
        if (self.noise2 != "")
                sound(self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTN_NORM);
        SUB_CalcMove(self.oldorigin, self.speed, fd_secret_done);
-};
+}
 
 void fd_secret_done()
 {
@@ -1711,7 +1711,7 @@ void fd_secret_done()
        }
        if (self.noise3 != "")
                sound(self, CH_TRIGGER_SINGLE, self.noise3, VOL_BASE, ATTN_NORM);
-};
+}
 
 void secret_blocked()
 {
@@ -1719,7 +1719,7 @@ void secret_blocked()
                return;
        self.attack_finished_single = time + 0.5;
        //T_Damage (other, self, self, self.dmg, self.dmg, self.deathtype, DT_IMPACT, (self.absmin + self.absmax) * 0.5, '0 0 0', Obituary_Generic);
-};
+}
 
 /*
 ==============
@@ -1743,7 +1743,7 @@ void secret_touch()
                        centerprint (other, self.message);
                play2(other, "misc/talk.wav");
        }
-};
+}
 
 void secret_reset()
 {
@@ -1811,7 +1811,7 @@ void spawnfunc_func_door_secret()
 
        self.reset = secret_reset;
        secret_reset();
-};
+}
 
 /*QUAKED spawnfunc_func_fourier (0 .5 .8) ?
 Brush model that moves in a pattern of added up sine waves, can be used e.g. for circular motions.
@@ -1826,7 +1826,7 @@ dmgtime: See above.
 
 void func_fourier_controller_think()
 {
-       local vector v;
+       vector v;
        float n, i, t;
 
        self.nextthink = time + 0.1;
@@ -1851,11 +1851,11 @@ void func_fourier_controller_think()
        if(self.owner.classname == "func_fourier") // don't brake stuff if the func_fourier was killtarget'ed
                // * 10 so it will arrive in 0.1 sec
                self.owner.velocity = (v - self.owner.origin) * 10;
-};
+}
 
 void spawnfunc_func_fourier()
 {
-       local entity controller;
+       entity controller;
        if (self.noise != "")
        {
                precache_sound(self.noise);
@@ -1899,7 +1899,7 @@ void spawnfunc_func_fourier()
        self.effects |= EF_LOWPRECISION;
 
        // TODO make a reset function for this one
-};
+}
 
 // reusing some fields havocbots declared
 .entity wp00, wp01, wp02, wp03;
@@ -1992,7 +1992,7 @@ void func_vectormamamam_findtarget()
 
        self.destvec = self.origin - func_vectormamamam_origin(self.owner, 0);
 
-       local entity controller;
+       entity controller;
        controller = spawn();
        controller.classname = "func_vectormamamam_controller";
        controller.owner = self;
index 45ab457f20490060381dd9804c84a74ab4af7345..f415e1fd1d397ad2a632c78648054d70c1f3ffaa 100644 (file)
@@ -164,7 +164,7 @@ float DoesQ3ARemoveThisEntity()
        if(self.gametype)
        {
                string gametypename;
-               // static char *gametypeNames[] = {"ffa", "tournament", "single", "team", "ctf", "oneflag", "obelisk", "harvester", "teamtournament"};
+               // static char *gametypeNames[] = {"ffa", "tournament", "single", "team", "ctf", "oneflag", "obelisk", "harvester", "teamtournament"}
                gametypename = "ffa";
                if(teamplay)
                        gametypename = "team";
index 5ad7e62cb7243691bd8d6ebabd3fb241d0319785..4f3e54420c227de13552c503f8de4bbbae9b3c6a 100644 (file)
@@ -98,4 +98,4 @@ void spawnfunc_trigger_swamp(void)
                self.swamp_interval = 1;
        if(self.swamp_slowdown <= 0) 
                self.swamp_slowdown = 0.5;
-};
+}
index e069aec9f3d7e18c1d2f9af5cfecc21aa745cd80..5d5b0a02c49bc2014ce502800254af43cc56384c 100644 (file)
@@ -141,14 +141,18 @@ void TeleportPlayer(entity teleporter, entity player, vector to, vector to_angle
        }
 }
 
-void Simple_TeleportPlayer(entity teleporter, entity player)
+entity Simple_TeleportPlayer(entity teleporter, entity player)
 {
        vector locout;
        entity e;
        float p;
        
        // Find the output teleporter
-       if(!teleporter.enemy)
+       if(teleporter.enemy)
+       {
+               e = teleporter.enemy;
+       }
+       else
        { 
                RandomSelection_Init();
                for(e = world; (e = find(e, targetname, teleporter.target)); )
@@ -162,23 +166,25 @@ void Simple_TeleportPlayer(entity teleporter, entity player)
                        }
                        RandomSelection_Add(e, 0, string_null, (e.cnt ? e.cnt : 1), p);
                }
-               teleporter.enemy = RandomSelection_chosen_ent;
+               e = RandomSelection_chosen_ent;
        }
 
-       if(!teleporter.enemy) { sprint(player, "Teleport destination vanished. Sorry... please complain to the mapper.\n"); }
+       if(!e) { sprint(player, "Teleport destination vanished. Sorry... please complain to the mapper.\n"); }
        
-       makevectors(teleporter.enemy.mangle);
+       makevectors(e.mangle);
 
-       if(teleporter.enemy.speed)
-               if(vlen(player.velocity) > teleporter.enemy.speed)
-                       player.velocity = normalize(player.velocity) * max(0, teleporter.enemy.speed);
+       if(e.speed)
+               if(vlen(player.velocity) > e.speed)
+                       player.velocity = normalize(player.velocity) * max(0, e.speed);
                        
        if(autocvar_g_teleport_maxspeed)
                if(vlen(player.velocity) > autocvar_g_teleport_maxspeed)
                        player.velocity = normalize(player.velocity) * max(0, autocvar_g_teleport_maxspeed);
 
-       locout = teleporter.enemy.origin + '0 0 1' * (1 - player.mins_z - 24);
-       TeleportPlayer(teleporter, player, locout, teleporter.enemy.mangle, v_forward * vlen(player.velocity), '0 0 0', '0 0 0', TELEPORT_FLAGS_TELEPORTER);
+       locout = e.origin + '0 0 1' * (1 - player.mins_z - 24);
+       TeleportPlayer(teleporter, player, locout, e.mangle, v_forward * vlen(player.velocity), '0 0 0', '0 0 0', TELEPORT_FLAGS_TELEPORTER);
+
+       return e;
 }
 
 void Teleport_Touch (void)
@@ -190,7 +196,6 @@ void Teleport_Touch (void)
                return;
        
        if not(other.iscreature)
-       if (other.deadflag != DEAD_NO)
                return;
 
        // for gameplay: vehicles can't teleport
@@ -209,7 +214,8 @@ void Teleport_Touch (void)
        if(other.classname == "player")
                RemoveGrapplingHook(other);
                
-       Simple_TeleportPlayer(self, other);
+       entity e;
+       e = Simple_TeleportPlayer(self, other);
 
        activator = other;
        s = self.target; self.target = string_null;
@@ -217,7 +223,7 @@ void Teleport_Touch (void)
        if not(self.target) self.target = s;
 
        oldself = self;
-       self = self.enemy;
+       self = e;
        SUB_UseTargets();
        self = oldself;
 }
@@ -323,8 +329,13 @@ void WarpZone_PostTeleportPlayer_Callback(entity pl)
 {
        UpdateCSQCProjectileAfterTeleport(pl);
        // "disown" projectiles after teleport
+       if(pl.owner)
        if(pl.owner == pl.realowner)
+       {
+               if(!(pl.flags & FL_PROJECTILE))
+                       print("A non-projectile got through a warpzone and its owner cleared. It's a ", pl.classname, ".\n");
                pl.owner = world;
+       }
        if(pl.classname == "player")
        {
                // reset tracking of oldvelocity for impact damage (sudden velocity changes)
index 1253fe1c07abb9132279becd9becbeff6b00bbfa..e04e2cad88f5cb33bd2639ff3f56df2593ccbdbf 100644 (file)
@@ -345,4 +345,4 @@ void trigger_relay_if_use()
 void spawnfunc_trigger_relay_if()
 {
        self.use = trigger_relay_if_use;
-};
+}
index c5f8988b94387f795231865cf18464cc8fb38c66..173e6ec270e2b27b3247613a7ad18938a9ef1841 100644 (file)
@@ -437,7 +437,7 @@ void InitGameplayMode()
 }
 
 string GetClientVersionMessage() {
-       local string versionmsg;
+       string versionmsg;
        if (self.version_mismatch) {
                if(self.version < autocvar_gameversion) {
                        versionmsg = "^3Your client version is outdated.\n\n\n### YOU WON'T BE ABLE TO PLAY ON THIS SERVER ###\n\n\nPlease update!!!^8";
@@ -487,7 +487,7 @@ string getwelcomemessage(void)
                modifications = strcat(modifications, ", Jet pack");
        modifications = substring(modifications, 2, strlen(modifications) - 2);
 
-       local string versionmessage;
+       string versionmessage;
        versionmessage = GetClientVersionMessage();
 
        s = strcat("This is Xonotic ", autocvar_g_xonoticversion, "\n", versionmessage);
@@ -1275,13 +1275,13 @@ void AuditTeams()
 // code from here on is just to support maps that don't have team entities
 void tdm_spawnteam (string teamname, float teamcolor)
 {
-       local entity e;
+       entity e;
        e = spawn();
        e.classname = "tdm_team";
        e.netname = teamname;
        e.cnt = teamcolor;
        e.team = e.cnt + 1;
-};
+}
 
 // spawn some default teams if the map is not set up for tdm
 void tdm_spawnteams()
@@ -1299,16 +1299,16 @@ void tdm_spawnteams()
                tdm_spawnteam("Yellow", COLOR_TEAM3-1);
        if(numteams >= 4)
                tdm_spawnteam("Pink", COLOR_TEAM4-1);
-};
+}
 
 void tdm_delayedinit()
 {
        // if no teams are found, spawn defaults
        if (find(world, classname, "tdm_team") == world)
                tdm_spawnteams();
-};
+}
 
 void tdm_init()
 {
        InitializeEntity(world, tdm_delayedinit, INITPRIO_GAMETYPE);
-};
+}
index d52c00307c0474f5ff59b7a6e81c0ddf79291826..9d108c6ae8433c565fdf8162a2c1fbe226feb54c 100644 (file)
@@ -75,26 +75,16 @@ vector real_origin(entity ent);
 .float aim_flags;
 /// Dont aim.
 #define TFL_AIM_NO                  1
-/// Go for ground, not direct hit
-//#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
-#define TFL_AIM_BALISTIC            8
+#define TFL_AIM_GROUNDGROUND        2
 /// Try to predict target movement (does not account for gravity)
-#define TFL_AIM_LEAD                16
+#define TFL_AIM_LEAD                4
 /// Compensate for shot traveltime when lead
-#define TFL_AIM_SHOTTIMECOMPENSATE  32
-/// Aim slightly in front of target
-#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 
+#define TFL_AIM_SHOTTIMECOMPENSATE  8
 /// Try to do real prediction of targets z pos at impact.
-#define TFL_AIM_ZPREDICT            512
+#define TFL_AIM_ZPREDICT            16
 /// Simply aim at target's current location
-#define TFL_AIM_SIMPLE              1024
+#define TFL_AIM_SIMPLE              32
 
 /// track (turn and pitch head) flags
 .float track_flags;
@@ -111,7 +101,7 @@ vector real_origin(entity ent);
 #define TFL_TRACKTYPE_STEPMOTOR    1
 /// Smoth absolute movement. Looks ok, fair accuracy.
 #define TFL_TRACKTYPE_FLUIDPRECISE 2
-/// Simulated inertia. "Wobbly mode" Looks kool, can mean really bad accuracy depending on how the feilds below are set
+/// Simulated inertia. "Wobbly mode" Looks kool, can mean really bad accuracy depending on how the fields below are set
 #define TFL_TRACKTYPE_FLUIDINERTIA 3
 /// TFL_TRACKTYPE_FLUIDINERTIA: pitch multiplier
 .float track_accel_pitch;
@@ -122,8 +112,6 @@ vector real_origin(entity ent);
 
 /// How prefire check is preformed
 .float firecheck_flags;
-/// Dont kill the world
-#define TFL_FIRECHECK_WORLD       2
 /// Dont kill the dead
 #define TFL_FIRECHECK_DEAD        4
 /// Range limits apply
@@ -147,7 +135,7 @@ vector real_origin(entity ent);
 /// Check own .attack_finished_single vs time
 #define TFL_FIRECHECK_REFIRE     4096
 /// Move the acctual target to aimspot before tracing impact (and back after)
-#define TFL_FIRECHECK_VERIFIED   8192
+//#define TFL_FIRECHECK_VERIFIED   8192
 /// Dont do any chekcs
 #define TFL_FIRECHECK_NO         16384
 
@@ -203,7 +191,8 @@ vector real_origin(entity ent);
 #define TFL_TURRCAPS_ISTURRET 65536
 
 /// Ammo types needed and/or provided
-.float ammo_flags;
+//.float ammo_flags;
+#define ammo_flags currentammo
 /// Has and needs no ammo
 #define  TFL_AMMO_NONE     64
 /// Uses power
@@ -237,8 +226,6 @@ vector real_origin(entity ent);
 #define  TFL_DMG_HEADSHAKE       128
 /// Die and stay dead.
 #define  TFL_DMG_DEATH_NORESPAWN 256
-/// Supress std turret gibs on death
-#define  TFL_DMG_DEATH_NOGIBS    512
 
 // Spawnflags
 /// Spawn in teambased modes
@@ -265,9 +252,6 @@ vector real_origin(entity ent);
 /// Defend this entity (or ratehr this entitys position)
 .entity     tur_defend;
 
-/// on/off toggle.
-.float      tur_active;
-
 /// and shoot from here. (can be non constant, think MLRS)
 .vector     tur_shotorg;
 
index 843af3d5ad64fad215932d91c7c25a7300febf92..a291e3ab15759496c1e8a316d29c0cc12aa136a7 100644 (file)
@@ -3,18 +3,9 @@
 
 supports:
 TFL_AIM_NO
-TFL_AIM_GROUND2
+TFL_AIM_GROUNDGROUND
 TFL_AIM_LEAD
 TFL_AIM_SHOTTIMECOMPENSATE
-TFL_AIM_INFRONT
-TFL_AIM_BEHIND
-
-not supported:
-TFL_AIM_BALISTIC
-
-removed
-TFL_AIM_ZEASE
-TFL_AIM_GROUND
 */
 vector turret_stdproc_aim_generic()
 {
@@ -32,12 +23,6 @@ vector turret_stdproc_aim_generic()
     // Baseline
     pre_pos = real_origin(self.enemy);
 
-    if (self.aim_flags & TFL_AIM_INFRONT)   // Aim a bit in front of the target
-        pre_pos = pre_pos + (normalize(self.enemy.velocity) * 64);
-
-    if (self.aim_flags & TFL_AIM_BEHIND)    // Aim a bit behind the target
-        pre_pos = pre_pos - (normalize(self.enemy.velocity) * 32);
-
     // Lead?
     if (self.aim_flags & TFL_AIM_LEAD)
     {          
@@ -73,7 +58,7 @@ vector turret_stdproc_aim_generic()
                        pre_pos = pre_pos + self.enemy.velocity * mintime;
     }
     
-    if(self.aim_flags & TFL_AIM_GROUND2)
+    if(self.aim_flags & TFL_AIM_GROUNDGROUND)
     {
         //tracebox(pre_pos + '0 0 32',self.enemy.mins,self.enemy.maxs,pre_pos -'0 0 64',MOVE_WORLDONLY,self.enemy);
         traceline(pre_pos + '0 0 32',pre_pos -'0 0 64',MOVE_WORLDONLY,self.enemy);
index 8daad2734101a1e53f8ebe5f42bf599effa7e0eb..48f76219bd40a6417432422749ab5800f57a1c0f 100644 (file)
@@ -88,7 +88,7 @@ void turret_stdproc_damage (entity inflictor, entity attacker, float damage, flo
         return;
 
     // Inactive turrets take no damage. (hm..)
-    if not (self.tur_active)
+    if not (self.active)
         return;
 
     if (teamplay)
@@ -113,7 +113,6 @@ void turret_stdproc_damage (entity inflictor, entity attacker, float damage, flo
         self.tur_head.angles_y = self.tur_head.angles_y + (-0.5 + random()) * damage;
         
         self.SendFlags  |= TNSF_ANG;
-
     }
 
     if (self.turrcaps_flags & TFL_TURRCAPS_MOVE)
index de3e06537552308ec721306c96947a2c7bc16853..cc01f29d30c81153e1d59842407ea030755b875f 100644 (file)
@@ -141,6 +141,72 @@ void load_unit_settings(entity ent, string unitname, float is_reload)
             ent.turret_respawnhook();
 }
 
+void turret_projectile_explode()
+{
+    
+    self.takedamage = DAMAGE_NO;
+    self.event_damage = SUB_Null;    
+#ifdef TURRET_DEBUG
+    float d;
+    d = RadiusDamage (self, self.owner, self.owner.shot_dmg, 0, self.owner.shot_radius, self, self.owner.shot_force, self.totalfrags, world);
+    self.owner.tur_dbg_dmg_t_h = self.owner.tur_dbg_dmg_t_h + d;
+    self.owner.tur_dbg_dmg_t_f = self.owner.tur_dbg_dmg_t_f + self.owner.shot_dmg;
+#else
+    RadiusDamage (self, self.realowner, self.owner.shot_dmg, 0, self.owner.shot_radius, self, self.owner.shot_force, self.totalfrags, world);
+#endif
+    remove(self);
+}
+
+void turret_projectile_touch()
+{
+    PROJECTILE_TOUCH;
+    turret_projectile_explode();
+}
+
+void turret_projectile_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector vforce)
+{
+    self.velocity  += vforce;
+    self.health    -= damage;
+    //self.realowner  = attacker; // Dont change realowner, it does not make much sense for turrets
+    if(self.health <= 0)
+        W_PrepareExplosionByDamage(self.owner, turret_projectile_explode);
+}
+
+entity turret_projectile(string _snd, float _size, float _health, float _death, float _proj_type, float _cull, float _cli_anim)
+{
+    entity proj;
+
+    sound (self, CH_WEAPON_A, _snd, VOL_BASE, ATTN_NORM);
+    proj                 = spawn ();
+    setorigin(proj, self.tur_shotorg);
+    setsize(proj, '-0.5 -0.5 -0.5' * _size, '0.5 0.5 0.5' * _size);
+    proj.owner           = self;
+    proj.realowner       = self;
+    proj.bot_dodge       = TRUE;
+    proj.bot_dodgerating = self.shot_dmg;    
+    proj.think           = turret_projectile_explode;
+    proj.touch           = turret_projectile_touch;
+    proj.nextthink       = time + 9;    
+    proj.movetype        = MOVETYPE_FLYMISSILE;
+    proj.velocity        = normalize(self.tur_shotdir_updated + randomvec() * self.shot_spread) * self.shot_speed;    
+    proj.flags           = FL_PROJECTILE;
+    proj.enemy           = self.enemy;
+    proj.totalfrags      = _death;
+    PROJECTILE_MAKETRIGGER(proj);
+    if(_health)
+    {
+        proj.health         = _health;
+        proj.takedamage     = DAMAGE_YES;
+        proj.event_damage   = turret_projectile_damage;
+    }
+    else
+        proj.flags |= FL_NOTARGET;
+
+    CSQCProjectile(proj, _cli_anim, _proj_type, _cull);
+    
+    return proj;
+}
+
 /**
 ** updates enemy distances, predicted impact point/time
 ** and updated aim<->predict impact distance.
@@ -161,20 +227,20 @@ void turret_do_updates(entity t_turret)
     self.tur_dist_enemy  = vlen(self.tur_shotorg - enemy_pos);
     self.tur_dist_aimpos = vlen(self.tur_shotorg - self.tur_aimpos);
 
-    if((self.firecheck_flags & TFL_FIRECHECK_VERIFIED) && (self.enemy))
+    /*if((self.firecheck_flags & TFL_FIRECHECK_VERIFIED) && (self.enemy))
     {
         oldpos = self.enemy.origin;
-        setorigin(self.enemy,self.tur_aimpos);
-        tracebox(self.tur_shotorg, '-1 -1 -1','1 1 1',self.tur_shotorg + (self.tur_shotdir_updated * self.tur_dist_aimpos),MOVE_NORMAL,self);
-        setorigin(self.enemy,oldpos);
+        setorigin(self.enemy, self.tur_aimpos);
+        tracebox(self.tur_shotorg, '-1 -1 -1', '1 1 1', self.tur_shotorg + (self.tur_shotdir_updated * self.tur_dist_aimpos), MOVE_NORMAL,self);
+        setorigin(self.enemy, oldpos);
 
         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);
     }
-    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);
+    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);
        
        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;
@@ -266,7 +332,7 @@ void turret_stdproc_track()
     if (self.track_flags == TFL_TRACK_NO)
         return;
 
-    if not (self.tur_active)
+    if not (self.active)
         target_angle = self.idle_aim - ('1 0 0' * self.aim_maxpitch);
     else if (self.enemy == world)
     {
@@ -414,7 +480,11 @@ void turret_stdproc_track()
 float turret_stdproc_firecheck()
 {
     // This one just dont care =)
-    if (self.firecheck_flags & TFL_FIRECHECK_NO) return 1;
+    if (self.firecheck_flags & TFL_FIRECHECK_NO) 
+        return 1;
+
+    if (self.enemy == world)
+        return 0;
 
     // Ready?
     if (self.firecheck_flags & TFL_FIRECHECK_REFIRE)
@@ -431,11 +501,6 @@ float turret_stdproc_firecheck()
         if (self.enemy.deadflag != DEAD_NO)
             return 0;
 
-    // Plz stop killing the world!
-    if (self.firecheck_flags & TFL_FIRECHECK_WORLD)
-        if (self.enemy == world)
-            return 0;
-
     // Own ammo?
     if (self.firecheck_flags & TFL_FIRECHECK_OWM_AMMO)
         if (self.ammo < self.shot_dmg)
@@ -479,9 +544,9 @@ float turret_stdproc_firecheck()
             if (self.ammo < (self.shot_dmg * self.shot_volly))
                 return 0;
 
-    if(self.firecheck_flags & TFL_FIRECHECK_VERIFIED)
+    /*if(self.firecheck_flags & TFL_FIRECHECK_VERIFIED)
         if(self.tur_impactent != self.enemy)
-            return 0;
+            return 0;*/
 
     return 1;
 }
@@ -693,7 +758,7 @@ void turret_think()
     // ONS uses somewhat backwards linking.
     if (teamplay)
     {
-        if not (g_onslaught)
+        if (g_onslaught)
             if (self.target)
             {
                 e = find(world, targetname,self.target);
@@ -721,7 +786,7 @@ void turret_think()
                        
     // Inactive turrets needs to run the think loop,
     // So they can handle animation and wake up if need be.
-    if not (self.tur_active)
+    if not (self.active)
     {
         turret_stdproc_track();
         return;
@@ -902,9 +967,9 @@ void turret_stdproc_use()
     self.team = activator.team;
 
     if(self.team == 0)
-        self.tur_active = 0;
+        self.active = ACTIVE_NOT;
     else
-        self.tur_active = 1;
+        self.active = ACTIVE_ACTIVE;
 
 }
 
@@ -963,32 +1028,10 @@ float turret_stdproc_init (string cvar_base_name, string base, string head, floa
     if not (e)
     {
         e = spawn();
-
-        /*
-        setorigin(e,'0 0 0');
-        setmodel(e,"models/turrets/plasma.md3");
-        vector v;
-        v = gettaginfo(e,gettagindex(e,"tag_fire"));
-        if(v == '0 0 0')
-        {
-            //objerror("^1ERROR: Engine is borken! Turrets will NOT work. force g_turrets to 0 to run maps with turrets anyway.");
-            //crash();
-        }
-        setmodel(e,"");
-        */
-
         e.classname = "turret_manager";
         e.think = turrets_manager_think;
         e.nextthink = time + 2;
     }
-
-    /*
-    if(csqc_shared)
-    {
-        dprint("WARNING: turret requested csqc_shared but this is not implemented. Expect strange things to happen.\n");
-        csqc_shared = 0;
-    }
-    */
     
     if not (self.spawnflags & TSF_SUSPENDED)
         droptofloor_builtin();
@@ -1038,11 +1081,14 @@ float turret_stdproc_init (string cvar_base_name, string base, string head, floa
     * if it hits a glitch in my logic :P so try to set as mutch
     * as possible beforehand.
     */
-    if (self.turrcaps_flags & TFL_TURRCAPS_SUPPORT)
-        self.ticrate = 0.2;     // Support units generaly dont need to have a high speed ai-loop
-    else
-        self.ticrate = 0.1;     // 10 fps for normal turrets
-
+    if not(self.ticrate)
+    {        
+        if (self.turrcaps_flags & TFL_TURRCAPS_SUPPORT)
+            self.ticrate = 0.2;     // Support units generaly dont need to have a high speed ai-loop
+        else
+            self.ticrate = 0.1;     // 10 fps for normal turrets
+    }
+    
     self.ticrate = bound(sys_frametime, self.ticrate, 60);  // keep it sane
 
 // General stuff
@@ -1097,9 +1143,9 @@ float turret_stdproc_init (string cvar_base_name, string base, string head, floa
     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 |
+        self.firecheck_flags = TFL_FIRECHECK_DEAD | TFL_FIRECHECK_DISTANCES |
                                TFL_FIRECHECK_LOS | TFL_FIRECHECK_AIMDIST | TFL_FIRECHECK_TEAMCECK |
-                               TFL_FIRECHECK_OWM_AMMO | TFL_FIRECHECK_REFIRE | TFL_FIRECHECK_WORLD;
+                               TFL_FIRECHECK_OWM_AMMO | TFL_FIRECHECK_REFIRE;
 
 // Range stuff.
     if not (self.target_range)
@@ -1136,7 +1182,7 @@ float turret_stdproc_init (string cvar_base_name, string base, string head, floa
     {
         self.aim_flags = TFL_AIM_LEAD | TFL_AIM_SHOTTIMECOMPENSATE;
         if(self.turrcaps_flags & TFL_TURRCAPS_RADIUSDMG)
-            self.aim_flags |= TFL_AIM_GROUND2;
+            self.aim_flags |= TFL_AIM_GROUNDGROUND;
     }
 
     if not (self.track_type)
@@ -1312,7 +1358,7 @@ float turret_stdproc_init (string cvar_base_name, string base, string head, floa
 
     self.classname = "turret_main";
 
-    self.tur_active = 1;
+    self.active = ACTIVE_ACTIVE;
 
     // In ONS mode, and linked to a ONS ent. need to call the use to set team.
     if (g_onslaught && ee)
@@ -1322,10 +1368,8 @@ float turret_stdproc_init (string cvar_base_name, string base, string head, floa
     }
     
        turret_link();
-       turret_stdproc_respawn();
-           
-    if (!turret_tag_fire_update())
-        dprint("Warning: Turret ",self.classname, " faild to initialize md3 tags\n");
+       turret_stdproc_respawn();           
+    turret_tag_fire_update();
     
     return 1;
 }
index f97f1091faeea7353b472af2e194537275a0812d..1c0a3bad5269ef4552a0b71686b6a8c0d44c6599 100644 (file)
@@ -113,7 +113,8 @@ vector angleofs3(vector from, vector from_a, entity to)
 * 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()
+#define turret_tag_fire_update() self.tur_shotorg = gettaginfo(self.tur_head, gettagindex(self.tur_head, "tag_fire"));v_forward = normalize(v_forward)
+float turret_tag_fire_update_s()
 {
     if(!self.tur_head)
     {
@@ -135,8 +136,8 @@ 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;
-    local entity ent;
+    vector hitloc, force, endpoint, dir;
+    entity ent;
 
     dir = normalize(end - start);
     force = dir * bforce;
index 316d45bbced89e0e467e7f8436bd5ecd7536a85e..05717bf184dab0401ec6bc21c1417772185a0827 100644 (file)
@@ -59,7 +59,7 @@ float turret_stdproc_targetscore_generic(entity _turret, entity _target)
 
     if(_turret.target_range < vlen(_turret.tur_shotorg - real_origin(_target)))
     {
-        dprint("Wtf?\n");
+        //dprint("Wtf?\n");
         score *= 0.001;
     }
 
diff --git a/qcsrc/server/tturrets/units/unit_common.qc b/qcsrc/server/tturrets/units/unit_common.qc
deleted file mode 100644 (file)
index 8b13789..0000000
+++ /dev/null
@@ -1 +0,0 @@
-
index 86f5c44021ba6f987c8333e7fa5f3d456b82f8a4..6b8f8e7d4cbadaa337953dee17dc4f5cacaa7349 100644 (file)
@@ -4,52 +4,17 @@
 #define ewheel_amin_bck_slow 3
 #define ewheel_amin_bck_fast 4
 
-void turret_ewheel_projectile_explode()
-{
-#ifdef TURRET_DEBUG
-    float d;
-
-    d = RadiusDamage (self, self.owner, self.owner.shot_dmg, 0, self.owner.shot_radius, world, self.owner.shot_force, DEATH_TURRET_EWHEEL, world);
-    self.owner.tur_dbg_dmg_t_h = self.owner.tur_dbg_dmg_t_h + d;
-    self.owner.tur_dbg_dmg_t_f = self.owner.tur_dbg_dmg_t_f + self.owner.shot_dmg;
-#else
-    RadiusDamage (self, self.owner, self.owner.shot_dmg, 0, self.owner.shot_radius, world, self.owner.shot_force, DEATH_TURRET_EWHEEL, world);
-#endif
-
-    remove (self);
-}
-
-
 void ewheel_attack()
 {
-    entity proj;
     float i;
 
     for (i = 0; i < 1; ++i)
     {
         turret_do_updates(self);
 
-        sound (self, CH_WEAPON_A, "weapons/lasergun_fire.wav", VOL_BASE, ATTN_NORM);
+        turret_projectile("weapons/lasergun_fire.wav", 1, 0, DEATH_TURRET_EWHEEL, PROJECTILE_LASER, TRUE, TRUE);    
         pointparticles(particleeffectnum("laser_muzzleflash"), self.tur_shotorg, self.tur_shotdir_updated * 1000, 1);
 
-        proj                    = spawn ();
-        setorigin(proj, self.tur_shotorg);
-        proj.classname       = "ewheel bolt";
-        proj.owner           = self;
-        proj.bot_dodge       = FALSE;
-        proj.bot_dodgerating = self.shot_dmg;
-        proj.think           = turret_ewheel_projectile_explode;
-        proj.nextthink       = time + 9;
-        //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);
-
         self.tur_head.frame += 2;
 
         if (self.tur_head.frame > 3)
@@ -142,12 +107,14 @@ void  ewheel_move_enemy()
         movelib_beak_simple(autocvar_g_turrets_unit_ewheel_speed_stop);
     }
     
-    if(self.frame != newframe)
+    turrets_setframe(newframe , FALSE);
+    
+    /*if(self.frame != newframe)
     {
         self.frame = newframe;
         self.SendFlags |= TNSF_ANIM;
         self.anim_start_time = time;
-    }
+    }*/
 }
 
 
@@ -280,21 +247,19 @@ void turret_ewheel_dinit()
         remove(self);
         return;
     }
-
+    
+    self.frame = 1;
     self.target_select_flags   = TFL_TARGETSELECT_PLAYERS | 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.damage_flags          |= TFL_DMG_DEATH_NOGIBS;
-
     self.iscreature = TRUE;
+    self.damagedbycontents = TRUE;
     self.movetype   = MOVETYPE_WALK;
     self.solid      = SOLID_SLIDEBOX;
     self.takedamage = DAMAGE_AIM;
+    self.idle_aim   = '0 0 0';
+    self.pos1       = self.origin;
 
     setsize(self, '-32 -32 0', '32 32 48');
-    self.idle_aim = '0 0 0';
-
-    self.pos1 = self.origin;
 
     // Our fire routine
     self.turret_firefunc  = ewheel_attack;
index e5360d88776a497533532b67af277d91dfbcf90a..975abbd4c928254ec566a3d8858df8ad67b3f28a 100644 (file)
@@ -1,72 +1,50 @@
 void spawnfunc_turret_flac();
 void turret_flac_dinit();
 void turret_flac_attack();
-void turret_flac_projectile_explode();
 
-void turret_flac_attack()
+void turret_flac_projectile_think_explode()
 {
-    local entity proj;
-
-    turret_tag_fire_update();
-
-    sound (self, CH_WEAPON_A, "weapons/hagar_fire.wav", VOL_BASE, ATTN_NORM);
-    proj = spawn ();
-    setorigin(proj, self.tur_shotorg);
-    setsize(proj, '0 0 0', '0 0 0');
-    proj.classname          = "flac_projectile";
-    proj.owner              = self;
-    proj.bot_dodge          = TRUE;
-    proj.bot_dodgerating    = self.shot_dmg;
-    proj.solid              = SOLID_BBOX;
-    proj.movetype           = MOVETYPE_FLYMISSILE;
-    proj.flags              = FL_PROJECTILE;
-    proj.takedamage         = DAMAGE_NO;
-    proj.velocity           = normalize(self.tur_shotdir_updated + randomvec() * self.shot_spread) * self.shot_speed;
-    proj.angles             = vectoangles(proj.velocity);
-    proj.touch              = turret_flac_projectile_explode;
-    proj.think              = turret_flac_projectile_explode;
-    proj.nextthink          = time + max(self.tur_impacttime,(self.shot_radius * 3) / self.shot_speed);
-    proj.enemy              = self.enemy;
-    proj.cnt                = time + 5;
-
-    CSQCProjectile(proj, TRUE, PROJECTILE_HAGAR, TRUE);
-
-    self.tur_head.frame = self.tur_head.frame + 1;
-    if (self.tur_head.frame >= 4) self.tur_head.frame = 0;
-
-}
-
-void turret_flac_projectile_explode()
-{
-    if( (self.enemy != world) &&
-        (vlen(self.origin - self.enemy.origin) < self.owner.shot_radius * 3) )
-    {
-        // OMG HAXX!
+    if(self.enemy != world)
+    if(vlen(self.origin - self.enemy.origin) < self.owner.shot_radius * 3)
         setorigin(self,self.enemy.origin + randomvec() * self.owner.shot_radius);
-    }
-    self.event_damage = SUB_Null;
-
+            
 #ifdef TURRET_DEBUG
-    float ftmp;
-    ftmp = RadiusDamage (self, self.owner, self.owner.shot_dmg, 0, self.owner.shot_radius, world, self.owner.shot_force, DEATH_TURRET_FLAC, world);
-    self.owner.tur_dbg_dmg_t_h = self.owner.tur_dbg_dmg_t_h + ftmp; //self.owner.shot_dmg;
+    float d;
+    d = RadiusDamage (self, self.owner, self.owner.shot_dmg, self.owner.shot_dmg, self.owner.shot_radius, self, self.owner.shot_force, self.totalfrags, world);
+    self.owner.tur_dbg_dmg_t_h = self.owner.tur_dbg_dmg_t_h + d;
     self.owner.tur_dbg_dmg_t_f = self.owner.tur_dbg_dmg_t_f + self.owner.shot_dmg;
 #else
-    RadiusDamage (self, self.owner, self.owner.shot_dmg, self.owner.shot_dmg * 0.5, self.owner.shot_radius, world, self.owner.shot_force, DEATH_TURRET_FLAC, world);
+    RadiusDamage (self, self.realowner, self.owner.shot_dmg, self.owner.shot_dmg, self.owner.shot_radius, self, self.owner.shot_force, self.totalfrags, world);
 #endif
-
-    remove (self);
+    remove(self);
 }
 
+void turret_flac_attack()
+{
+    entity proj;
+
+    turret_tag_fire_update();
+    
+    proj = turret_projectile("weapons/hagar_fire.wav", 5, 0, DEATH_TURRET_FLAC, PROJECTILE_HAGAR, TRUE, TRUE);    
+    pointparticles(particleeffectnum("laser_muzzleflash"), self.tur_shotorg, self.tur_shotdir_updated * 1000, 1);
+    proj.think      = turret_flac_projectile_think_explode;
+    proj.nextthink  = time + self.tur_impacttime + (random() * 0.01 - random() * 0.01);
+
+    self.tur_head.frame = self.tur_head.frame + 1;
+    if (self.tur_head.frame >= 4) 
+        self.tur_head.frame = 0;
+
+}
 
 void turret_flac_dinit()
 {
-    if (self.netname == "")      self.netname  = "FLAC Cannon";
+    if (self.netname == "")      
+        self.netname  = "FLAC Cannon";
 
     self.turrcaps_flags = TFL_TURRCAPS_RADIUSDMG | TFL_TURRCAPS_FASTPROJ | TFL_TURRCAPS_MISSILEKILL;
     self.ammo_flags     = TFL_AMMO_ROCKETS | TFL_AMMO_RECHARGE;
     self.aim_flags      = TFL_AIM_LEAD | TFL_AIM_SHOTTIMECOMPENSATE;
-
+    
     if (turret_stdproc_init("flac_std", "models/turrets/base.md3", "models/turrets/flac.md3", TID_FLAC) == 0)
     {
         remove(self);
@@ -76,8 +54,7 @@ void turret_flac_dinit()
 
     self.damage_flags |= TFL_DMG_HEADSHAKE;
     self.target_select_flags |= TFL_TARGETSELECT_NOTURRETS | TFL_TARGETSELECT_MISSILESONLY;
-
-
+    
     // Our fire routine
     self.turret_firefunc  = turret_flac_attack;
 
index e499a29c617e80f4851f82e047fdc4c2c5bdc6db..8118b8f234dfa1cb23d2c52d737489679dd47ab1 100644 (file)
@@ -62,7 +62,7 @@ void turret_fusionreactor_dinit()
     self.turrcaps_flags      = TFL_TURRCAPS_SUPPORT | TFL_TURRCAPS_AMMOSOURCE;
     self.ammo_flags          = TFL_AMMO_ENERGY | TFL_AMMO_RECHARGE;
     self.target_select_flags = TFL_TARGETSELECT_TEAMCHECK | TFL_TARGETSELECT_OWNTEAM | TFL_TARGETSELECT_RANGELIMTS;
-    self.firecheck_flags     = TFL_FIRECHECK_OWM_AMMO | TFL_FIRECHECK_OTHER_AMMO | TFL_FIRECHECK_DISTANCES | TFL_FIRECHECK_DEAD | TFL_FIRECHECK_WORLD;
+    self.firecheck_flags     = TFL_FIRECHECK_OWM_AMMO | TFL_FIRECHECK_OTHER_AMMO | TFL_FIRECHECK_DISTANCES | TFL_FIRECHECK_DEAD;
     self.shoot_flags         = TFL_SHOOT_HITALLVALID;
     self.aim_flags           = TFL_AIM_NO;
     self.track_flags         = TFL_TRACK_NO;
index 84f8e90028aee2881264b0a74b8e23ec03882b1e..08bfad2a611e71546139ce17ff9beee69f02b62d 100644 (file)
@@ -1,75 +1,6 @@
-.float      shot_speed_max;
-.float      shot_speed_gain;
-
 void spawnfunc_turret_hellion();
 void turret_hellion_dinit();
 void turret_hellion_attack();
-void turret_hellion_missile_explode();
-void turret_hellion_missile_think();
-void turret_hellion_missile_damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector vforce)
-
-void turret_hellion_postthink()
-{
-    if (autocvar_g_turrets_reloadcvars)
-    {
-        if (!self.shot_speed_max)  self.shot_speed_max  = autocvar_g_turrets_unit_hellion_std_shot_speed_max;
-        if (!self.shot_speed_gain) self.shot_speed_gain = autocvar_g_turrets_unit_hellion_std_shot_speed_gain;
-    }
-
-    if (self.tur_head.frame != 0)
-        self.tur_head.frame += 1;
-
-    if (self.tur_head.frame >= 7)
-        self.tur_head.frame = 0;
-}
-
-void turret_hellion_attack()
-{
-    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, CH_WEAPON_A, "weapons/hagar_fire.wav", VOL_BASE, ATTN_NORM);
-
-    missile = spawn ();
-    setorigin(missile, self.tur_shotorg);
-    setsize (missile, '-3 -3 -3', '3 3 3'); // give it some size so it can be shot
-
-    missile.classname          = "hellion_missile";
-    missile.owner              = self;
-    missile.bot_dodge          = TRUE;
-    missile.bot_dodgerating    = self.shot_dmg;
-    missile.takedamage         = DAMAGE_YES;
-    missile.event_damage       = turret_hellion_missile_damage;
-    missile.damageforcescale   = 2;
-    missile.health             = 10;
-    missile.enemy              = self.enemy;
-    missile.think              = turret_hellion_missile_think;
-    missile.nextthink          = time;// + 0.2;
-    missile.solid              = SOLID_BBOX;
-    missile.movetype           = MOVETYPE_FLY;
-    missile.velocity           = normalize(self.tur_shotdir_updated + randomvec() * self.shot_spread) * self.shot_speed;
-    missile.angles             = vectoangles(missile.velocity);
-    missile.touch              = turret_hellion_missile_explode;
-    missile.flags              = FL_PROJECTILE;
-    missile.solid              = SOLID_BBOX;
-    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
-
-       self.tur_head.frame += 1;
-}
-
-void turret_hellion_missile_damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector vforce)
-{
-    self.health = self.health - damage;
-    self.velocity = self.velocity + vforce;
-    if (self.health <= 0) turret_hellion_missile_explode();
-}
 
 void turret_hellion_missile_think()
 {
@@ -82,7 +13,7 @@ void turret_hellion_missile_think()
     olddir = normalize(self.velocity);
 
     if(self.tur_health < time)
-        turret_hellion_missile_explode();
+        turret_projectile_explode();
 
     // Enemy dead? just keep on the current heading then.
     if ((self.enemy == world) || (self.enemy.deadflag != DEAD_NO))
@@ -95,10 +26,10 @@ void turret_hellion_missile_think()
         self.angles = vectoangles(self.velocity);
 
         if ( (vlen(self.origin - self.owner.origin)) > (self.owner.shot_radius * 5) )
-            turret_hellion_missile_explode();
+            turret_projectile_explode();
 
         // Accelerate
-        self.velocity = olddir * min(vlen(self.velocity) * self.owner.shot_speed_gain,self.owner.shot_speed_max);
+        self.velocity = olddir * min(vlen(self.velocity) * autocvar_g_turrets_unit_hellion_std_shot_speed_gain, autocvar_g_turrets_unit_hellion_std_shot_speed_max);
 
         UpdateCSQCProjectile(self);
 
@@ -107,7 +38,7 @@ void turret_hellion_missile_think()
 
     // Enemy in range?
     if (vlen(self.origin - self.enemy.origin) < self.owner.shot_radius * 0.2)
-        turret_hellion_missile_explode();
+        turret_projectile_explode();
 
     // Predict enemy position
     itime = vlen(self.enemy.origin - self.origin) / vlen(self.velocity);
@@ -125,55 +56,49 @@ void turret_hellion_missile_think()
     self.angles = vectoangles(self.velocity);
 
     // Accelerate
-    self.velocity = newdir * min(vlen(self.velocity) * self.owner.shot_speed_gain,self.owner.shot_speed_max);
+    self.velocity = newdir * min(vlen(self.velocity) * autocvar_g_turrets_unit_hellion_std_shot_speed_gain, autocvar_g_turrets_unit_hellion_std_shot_speed_max);
 
     if (itime < 0.05)
-        self.think = turret_hellion_missile_explode;
+        self.think = turret_projectile_explode;
 
     UpdateCSQCProjectile(self);
 }
-
-void turret_hellion_missile_explode()
+void turret_hellion_attack()
 {
-    float d;
-
-    if(self.event_damage != SUB_Null)
-    {
-        self.event_damage = SUB_Null;
-        self.think = turret_hellion_missile_explode;
-        self.nextthink = time;
-        return;
-    }
-
-    self.event_damage = SUB_Null;
-    d = RadiusDamage (self, self.owner, self.owner.shot_dmg, 0, self.owner.shot_radius, world, self.owner.shot_force, DEATH_TURRET_HELLION, world);
-
-#ifdef TURRET_DEBUG
-    self.owner.tur_dbg_dmg_t_h = self.owner.tur_dbg_dmg_t_h + d; //self.owner.shot_dmg;
-    self.owner.tur_dbg_dmg_t_f = self.owner.tur_dbg_dmg_t_f + self.owner.shot_dmg;
-#endif
+    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"));
+    
+    missile = turret_projectile("weapons/rocket_fire.wav", 6, 10, DEATH_TURRET_HELLION, PROJECTILE_ROCKET, FALSE, FALSE);
+    te_explosion (missile.origin);
+    missile.think        = turret_hellion_missile_think;
+    missile.nextthink    = time;
+    missile.flags        = FL_PROJECTILE;
+    missile.tur_health   = time + 9;
+    missile.tur_aimpos   = randomvec() * 128;
+       self.tur_head.frame += 1;
+}
 
-    // Target dead, get another is still targeting the same.
-    if ((self.enemy.deadflag != DEAD_NO) && (self.enemy == self.owner.enemy))
-        self.owner.enemy = world;
+void turret_hellion_postthink()
+{
+    if (self.tur_head.frame != 0)
+        self.tur_head.frame += 1;
 
-    remove (self);
+    if (self.tur_head.frame >= 7)
+        self.tur_head.frame = 0;
 }
 
 void turret_hellion_dinit()
 {
     if (self.netname == "")      self.netname  = "Hellion Missile Turret";
 
-    if not (self.shot_speed_max)
-        self.shot_speed_max  = autocvar_g_turrets_unit_hellion_std_shot_speed_max;
-
-    if not (self.shot_speed_gain)
-        self.shot_speed_gain = autocvar_g_turrets_unit_hellion_std_shot_speed_gain;
-
     self.turrcaps_flags = TFL_TURRCAPS_RADIUSDMG | TFL_TURRCAPS_FASTPROJ | TFL_TURRCAPS_PLAYERKILL | TFL_TURRCAPS_MISSILEKILL;
     self.aim_flags = TFL_AIM_SIMPLE;
     self.target_select_flags = TFL_TARGETSELECT_LOS | TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_RANGELIMTS | TFL_TARGETSELECT_TEAMCHECK ;
-    self.firecheck_flags = TFL_FIRECHECK_WORLD | TFL_FIRECHECK_DEAD | TFL_FIRECHECK_DISTANCES | TFL_FIRECHECK_TEAMCECK | TFL_FIRECHECK_REFIRE | TFL_FIRECHECK_AFF | TFL_FIRECHECK_OWM_AMMO;
+    self.firecheck_flags = TFL_FIRECHECK_DEAD | TFL_FIRECHECK_DISTANCES | TFL_FIRECHECK_TEAMCECK | TFL_FIRECHECK_REFIRE | TFL_FIRECHECK_AFF | TFL_FIRECHECK_OWM_AMMO;
     self.ammo_flags = TFL_AMMO_ROCKETS | TFL_AMMO_RECHARGE;
 
     if (turret_stdproc_init("hellion_std", "models/turrets/base.md3", "models/turrets/hellion.md3", TID_HELLION) == 0)
index 5ad222fa09c93ffbee62968df451a2864f6db7b2..d61289dcbe62e50a458c92f482c30cd5ba0ec0de 100644 (file)
@@ -7,31 +7,7 @@
 void spawnfunc_turret_hk();
 void turret_hk_dinit();
 void turret_hk_attack();
-void turret_hk_missile_explode();
-void turret_hk_missile_think();
-void turret_hk_missile_damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force);
-float turret_hk_addtarget(entity e_target,entity e_sender);
-//void turret_hk_missile_touch();
-
-float hk_maxspeed;
-float hk_minspeed;
-float hk_accel;
-float hk_accel2;
-float hk_decel;
 
-float turret_hk_addtarget(entity e_target,entity e_sender)
-{
-    if (e_target)
-    {
-        if (turret_validate_target(self,e_target,self.target_validate_flags) > 0)
-        {
-            self.enemy = e_target;
-            return 1;
-        }
-    }
-
-    return 0;
-}
 
 float hk_is_valid_target(entity e_target)
 {
@@ -66,62 +42,6 @@ float hk_is_valid_target(entity e_target)
 
     return 1;
 }
-
-void turret_hk_missile_damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
-{
-    if (attacker.team == self.team)
-        damage *= 0.5;
-
-    self.velocity += force;
-
-    self.health -= damage;
-
-    if (self.health <= 0)
-        turret_hk_missile_explode();
-}
-
-void turret_hk_attack()
-{
-    local entity missile;
-    //local entity flash2;
-
-    sound (self, CH_WEAPON_A, "weapons/rocket_fire.wav", VOL_BASE, ATTN_NORM);
-
-    missile                    = spawn ();
-    missile.solid            = SOLID_BBOX;
-    setsize (missile, '-3 -3 -3', '3 3 3'); // give it some size so it can be shot
-    setorigin(missile, self.tur_shotorg);
-
-    missile.scale            = 1;
-    missile.classname        = "hk_missile";
-    missile.owner            = self;
-    missile.bot_dodge        = TRUE;
-    missile.bot_dodgerating  = self.shot_dmg;
-    missile.takedamage       = DAMAGE_YES;
-    missile.damageforcescale = 4;
-    missile.health           = 10;
-    missile.think            = turret_hk_missile_think;
-    missile.event_damage     = turret_hk_missile_damage;
-    missile.nextthink        = time + 0.25;
-    missile.movetype         = MOVETYPE_BOUNCEMISSILE;
-    missile.velocity         = self.tur_shotdir_updated * (self.shot_speed * 0.75);
-    missile.angles           = vectoangles(missile.velocity);
-    missile.touch            = turret_hk_missile_explode; //turret_hk_missile_touch;
-    missile.flags            = FL_PROJECTILE;
-    missile.enemy            = self.enemy;
-    missile.team             = self.team;
-    missile.cnt              = time + 30;
-    missile.ticrate          = max(autocvar_sys_ticrate,0.05);
-
-       CSQCProjectile(missile, FALSE, PROJECTILE_ROCKET, FALSE); // no culling, fly sound
-
-    te_explosion (missile.origin);
-
-    if (self.tur_head.frame == 0)
-        self.tur_head.frame = self.tur_head.frame + 1;
-
-}
-
 void turret_hk_missile_think()
 {
     vector vu, vd, vf, vl, vr, ve;  // Vector (direction)
@@ -172,7 +92,7 @@ void turret_hk_missile_think()
         // Close enougth to do decent damage?
         if ( edist <= (self.owner.shot_radius * 0.25) )
         {
-            turret_hk_missile_explode();
+            turret_projectile_explode();
             return;
         }
 
@@ -207,12 +127,12 @@ void turret_hk_missile_think()
         ad = vlen(vectoangles(normalize(self.enemy.origin - self.origin)) - self.angles);
 
         // To close to something, Slow down!
-        if ( ((ff < 0.7) || (ad > 4)) && (myspeed > hk_minspeed) )
-            myspeed = max(myspeed * hk_decel,hk_minspeed);
+        if ( ((ff < 0.7) || (ad > 4)) && (myspeed > autocvar_g_turrets_unit_hk_std_shot_speed) )
+            myspeed = max(myspeed * autocvar_g_turrets_unit_hk_std_shot_speed_decel, autocvar_g_turrets_unit_hk_std_shot_speed);
 
         // Failry clear, accelerate.
-        if ( (ff > 0.7) && (myspeed < hk_maxspeed) )
-            myspeed = min(myspeed * hk_accel,hk_maxspeed);
+        if ( (ff > 0.7) && (myspeed < autocvar_g_turrets_unit_hk_std_shot_speed_max) )
+            myspeed = min(myspeed * autocvar_g_turrets_unit_hk_std_shot_speed_accel, autocvar_g_turrets_unit_hk_std_shot_speed_max);
 
         // Setup trace pitch
         pt_seek = 1 - ff;
@@ -268,14 +188,14 @@ void turret_hk_missile_think()
     {
         // Got a clear path to target, speed up fast (if not at full speed) and go straight for it.
         myspeed = vlen(self.velocity);
-        if (myspeed < hk_maxspeed)
-            myspeed = min(myspeed * hk_accel2,hk_maxspeed);
+        if (myspeed < autocvar_g_turrets_unit_hk_std_shot_speed_max)
+            myspeed = min(myspeed * autocvar_g_turrets_unit_hk_std_shot_speed_accel2,autocvar_g_turrets_unit_hk_std_shot_speed_max);
 
         wishdir = ve;
     }
 
-    if ((myspeed > hk_minspeed) && (self.cnt > time))
-        myspeed = min(myspeed * hk_accel2,hk_maxspeed);
+    if ((myspeed > autocvar_g_turrets_unit_hk_std_shot_speed) && (self.cnt > time))
+        myspeed = min(myspeed * autocvar_g_turrets_unit_hk_std_shot_speed_accel2,autocvar_g_turrets_unit_hk_std_shot_speed_max);
 
     // Ranoutagazfish?
     if (self.cnt < time)
@@ -321,77 +241,59 @@ void turret_hk_missile_think()
        UpdateCSQCProjectile(self);
 }
 
-void turret_hk_missile_explode()
+void turret_hk_attack()
 {
-    float d;
-
-    if(self.event_damage != SUB_Null)
-    {
-        self.event_damage = SUB_Null;
-        self.think = turret_hk_missile_explode;
-        self.nextthink = time;
-        return;
-    }
-
-    if ((other == self.owner)||(other == self.owner.tur_head))
-        return;
+    entity missile;
 
-    self.event_damage = SUB_Null;
-    d = RadiusDamage (self, self.owner, self.owner.shot_dmg, 0, self.owner.shot_radius, world, self.owner.shot_force, DEATH_TURRET_HK, world);
+    missile = turret_projectile("weapons/rocket_fire.wav", 6, 10, DEATH_TURRET_HK, PROJECTILE_ROCKET, FALSE, FALSE);
+    te_explosion (missile.origin);
 
-#ifdef TURRET_DEBUG
-    self.owner.tur_dbg_dmg_t_h = self.owner.tur_dbg_dmg_t_h + d; //self.owner.shot_dmg;
-    self.owner.tur_dbg_dmg_t_f = self.owner.tur_dbg_dmg_t_f + self.owner.shot_dmg;
-#endif
+    missile.think            = turret_hk_missile_think;
+    missile.nextthink        = time + 0.25;
+    missile.movetype         = MOVETYPE_BOUNCEMISSILE;
+    missile.velocity         = self.tur_shotdir_updated * (self.shot_speed * 0.75);
+    missile.angles           = vectoangles(missile.velocity);
+    missile.cnt              = time + 30;
+    missile.ticrate          = max(autocvar_sys_ticrate, 0.05);
 
-    // Target dead, get another is still targeting the same.
-    if ((self.enemy.deadflag != DEAD_NO) && (self.enemy == self.owner.enemy))
-        self.owner.enemy = world;
+    if (self.tur_head.frame == 0)
+        self.tur_head.frame = self.tur_head.frame + 1;
 
-    remove (self);
 }
 
 void turret_hk_postthink()
 {
-    if (autocvar_g_turrets_reloadcvars)
-    {
-        hk_maxspeed = autocvar_g_turrets_unit_hk_std_shot_speed_max;
-        hk_minspeed = autocvar_g_turrets_unit_hk_std_shot_speed;
-        hk_accel    = autocvar_g_turrets_unit_hk_std_shot_speed_accel;
-        hk_accel2   = autocvar_g_turrets_unit_hk_std_shot_speed_accel2;
-        hk_decel    = autocvar_g_turrets_unit_hk_std_shot_speed_decel;
-    }
-
     if (self.tur_head.frame != 0)
         self.tur_head.frame = self.tur_head.frame + 1;
 
     if (self.tur_head.frame > 5)
         self.tur_head.frame = 0;
+}
 
+float turret_hk_addtarget(entity e_target,entity e_sender)
+{
+    if (e_target)
+    {
+        if (turret_validate_target(self,e_target,self.target_validate_flags) > 0)
+        {
+            self.enemy = e_target;
+            return 1;
+        }
+    }
+
+    return 0;
 }
 
 void turret_hk_dinit()
 {
-    if (self.netname == "")      self.netname  = "Hunter-killer turret";
-
-    hk_maxspeed = autocvar_g_turrets_unit_hk_std_shot_speed_max;
-    hk_minspeed = autocvar_g_turrets_unit_hk_std_shot_speed;
-    hk_accel    = autocvar_g_turrets_unit_hk_std_shot_speed_accel;
-    hk_accel2   = autocvar_g_turrets_unit_hk_std_shot_speed_accel2;
-    hk_decel    = autocvar_g_turrets_unit_hk_std_shot_speed_decel;
+    if (self.netname == "")      
+        self.netname  = "Hunter-killer turret";
 
     self.turrcaps_flags = TFL_TURRCAPS_RADIUSDMG | TFL_TURRCAPS_MEDPROJ | TFL_TURRCAPS_PLAYERKILL | TFL_TURRCAPS_RECIVETARGETS;
-
     self.ammo_flags = TFL_AMMO_ROCKETS | TFL_AMMO_RECHARGE;
-
     self.aim_flags = TFL_AIM_SIMPLE;
-
     self.target_select_flags = TFL_TARGETSELECT_LOS | TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_TRIGGERTARGET | TFL_TARGETSELECT_RANGELIMTS | TFL_TARGETSELECT_TEAMCHECK;
-
-    self.firecheck_flags = TFL_FIRECHECK_WORLD | TFL_FIRECHECK_DEAD | TFL_FIRECHECK_TEAMCECK  | TFL_FIRECHECK_REFIRE | TFL_FIRECHECK_AFF;
-
-    self.target_select_flags = TFL_TARGETSELECT_LOS | TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_TRIGGERTARGET | TFL_TARGETSELECT_RANGELIMTS | TFL_TARGETSELECT_TEAMCHECK;
-
+    self.firecheck_flags = TFL_FIRECHECK_DEAD | TFL_FIRECHECK_TEAMCECK  | TFL_FIRECHECK_REFIRE | TFL_FIRECHECK_AFF;
     self.shoot_flags = TFL_SHOOT_CLEARTARGET;
 
     if (turret_stdproc_init("hk_std", "models/turrets/base.md3", "models/turrets/hk.md3", TID_HK) == 0)
index 990385fda221c544d7376e31252a88638589a711..65c0ed058500873456c5b7b4c443b062b85e295b 100644 (file)
@@ -1,8 +1,6 @@
 void spawnfunc_turret_mlrs();
 void turret_mlrs_dinit();
 void turret_mlrs_attack();
-void turret_mlrs_rocket_explode();
-void turret_mlrs_rocket_touch();
 
 void turret_mlrs_postthink()
 {
@@ -13,78 +11,16 @@ void turret_mlrs_postthink()
        dprint("ammo:",ftos(self.ammo),"\n");
        dprint("shot_dmg:",ftos(self.shot_dmg),"\n");
     }
-    
 }
 
 void turret_mlrs_attack()
 {
     entity missile;
-
-    turret_tag_fire_update();
-
-    sound (self, CH_WEAPON_A, "weapons/rocket_fire.wav", VOL_BASE, ATTN_NORM);
-
-    missile                    = spawn ();
-    setsize (missile, '-3 -3 -3', '3 3 3'); // give it some size so it can be shot
-    setorigin(missile, self.tur_shotorg);
-    missile.classname          = "mlrs_missile";
-    missile.owner              = self;
-    missile.bot_dodge          = TRUE;
-    missile.bot_dodgerating    = self.shot_dmg;
-    missile.takedamage         = DAMAGE_NO;
-    missile.damageforcescale   = 4;
-    missile.think              = turret_mlrs_rocket_explode;
-    missile.nextthink          = time + max(self.tur_impacttime,(self.shot_radius * 2) / self.shot_speed);
-    missile.solid              = SOLID_BBOX;
-    missile.movetype           = MOVETYPE_FLYMISSILE;
-    missile.velocity           = normalize(self.tur_shotdir_updated + randomvec() * self.shot_spread) * self.shot_speed;
-    missile.angles             = vectoangles(missile.velocity);
-    missile.touch              = turret_mlrs_rocket_touch;
-    missile.flags              = FL_PROJECTILE;
-    missile.solid              = SOLID_BBOX;
-    missile.enemy              = self.enemy;
-
-       CSQCProjectile(missile, TRUE, PROJECTILE_ROCKET, FALSE); // no cull, fly sound
-
-    te_explosion (missile.origin);
-}
-
-void turret_mlrs_rocket_touch()
-{
-    if( (other == self.owner) || (other == self.owner.tur_head) )
-        return;
-
-    PROJECTILE_TOUCH;
-
-    turret_mlrs_rocket_explode();
-}
-
-void turret_mlrs_rocket_explode()
-{
-
-    if(self.event_damage != SUB_Null)
-    {
-        self.event_damage = SUB_Null;
-        self.think = turret_mlrs_rocket_explode;
-        self.nextthink = time;
-        return;
-    }
-
-#ifdef TURRET_DEBUG
-    float d;
-
-    d = RadiusDamage (self, self.owner, self.owner.shot_dmg, 0, self.owner.shot_radius, world, self.owner.shot_force, DEATH_TURRET_MLRS, world);
-    self.owner.tur_dbg_dmg_t_h = self.owner.tur_dbg_dmg_t_h + d; //self.owner.shot_dmg;
-    self.owner.tur_dbg_dmg_t_f = self.owner.tur_dbg_dmg_t_f + self.owner.shot_dmg;
-#else
-    RadiusDamage (self, self.owner, self.owner.shot_dmg, self.owner.shot_dmg * 0.5, self.owner.shot_radius, world, self.owner.shot_force, DEATH_TURRET_MLRS, world);
-#endif
-
-    // Target dead, Tell turret.
-    if ((self.enemy.deadflag != DEAD_NO) && (self.enemy == self.owner.enemy))
-        self.owner.enemy = world;
-
-    remove (self);
+    
+    turret_tag_fire_update();    
+    missile = turret_projectile("weapons/rocket_fire.wav", 6, 10, DEATH_TURRET_MLRS, PROJECTILE_ROCKET, TRUE, TRUE);
+    missile.nextthink = time + max(self.tur_impacttime,(self.shot_radius * 2) / self.shot_speed);
+    te_explosion (missile.origin);    
 }
 
 void turret_mlrs_dinit()
@@ -93,7 +29,7 @@ void turret_mlrs_dinit()
 
     self.turrcaps_flags = TFL_TURRCAPS_RADIUSDMG | TFL_TURRCAPS_MEDPROJ | TFL_TURRCAPS_PLAYERKILL;
     self.ammo_flags = TFL_AMMO_ROCKETS | TFL_AMMO_RECHARGE;
-    self.aim_flags = TFL_AIM_LEAD | TFL_AIM_SHOTTIMECOMPENSATE;// | TFL_AIM_GROUND2;
+    self.aim_flags = TFL_AIM_LEAD | TFL_AIM_SHOTTIMECOMPENSATE;
 
     if (turret_stdproc_init("mlrs_std", "models/turrets/base.md3", "models/turrets/mlrs.md3", TID_MLRS) == 0)
     {
index 7867310329452f9f3fca928caa3cb760d7a25628..d5abf654be6a8c0f9c9d453d5cb44ea005f3108c 100644 (file)
@@ -5,7 +5,7 @@ void turret_plasma_std_init();
 void turret_plasma_dual_init();
 
 void turret_plasma_attack();
-void turret_plasma_projectile_explode();
+
 
 void turret_plasma_postthink()
 {
@@ -26,77 +26,18 @@ void turret_plasma_dual_postthink()
 }
 
 void turret_plasma_attack()
-{
-    entity proj;
-
-    sound (self, CH_WEAPON_A, "weapons/hagar_fire.wav", VOL_BASE, ATTN_NORM);
+{ 
+    turret_projectile("weapons/hagar_fire.wav", 1, 0, DEATH_TURRET_PLASMA, PROJECTILE_ELECTRO_BEAM, TRUE, TRUE);    
     pointparticles(particleeffectnum("laser_muzzleflash"), self.tur_shotorg, self.tur_shotdir_updated * 1000, 1);
-
-    proj                    = spawn ();
-    setorigin(proj, self.tur_shotorg);
-    setsize(proj, '-1 -1 -1', '1 1 1');
-    proj.classname       = "plasmabomb";
-    proj.owner           = self;
-    proj.bot_dodge       = TRUE;
-    proj.bot_dodgerating = self.shot_dmg;
-    proj.think           = turret_plasma_projectile_explode;
-    proj.nextthink       = time + 9;
-    proj.solid           = SOLID_BBOX;
-    proj.movetype        = MOVETYPE_FLYMISSILE;
-    proj.velocity        = normalize(self.tur_shotdir_updated + randomvec() * self.shot_spread) * self.shot_speed;
-    proj.touch           = turret_plasma_projectile_explode;
-    proj.flags           = FL_PROJECTILE;
-    proj.enemy           = self.enemy;
-    proj.flags           = FL_PROJECTILE | FL_NOTARGET;
-
-    CSQCProjectile(proj, TRUE, PROJECTILE_ELECTRO_BEAM, TRUE);
-
     if (self.tur_head.frame == 0)
         self.tur_head.frame = 1;
 }
 
 void turret_plasma_dual_attack()
 {
-    entity proj;
-
-    sound (self, CH_WEAPON_A, "weapons/hagar_fire.wav", VOL_BASE, ATTN_NORM);
-    proj                    = spawn ();
-    setorigin(proj, self.tur_shotorg);
-    setsize(proj, '0 0 0', '0 0 0');
-    proj.classname       = "plasmabomb";
-    proj.owner           = self;
-    proj.bot_dodge       = TRUE;
-    proj.bot_dodgerating = self.shot_dmg;
-    proj.think           = turret_plasma_projectile_explode;
-    proj.nextthink       = time + 9;
-    proj.solid           = SOLID_BBOX;
-    proj.movetype        = MOVETYPE_FLYMISSILE;
-    proj.velocity        = normalize(self.tur_shotdir_updated + randomvec() * self.shot_spread) * self.shot_speed;
-    proj.touch           = turret_plasma_projectile_explode;
-    proj.flags           = FL_PROJECTILE;
-    proj.enemy           = self.enemy;
-    proj.flags           = FL_PROJECTILE | FL_NOTARGET;
-
+    turret_projectile("weapons/hagar_fire.wav", 1, 0, DEATH_TURRET_PLASMA, PROJECTILE_ELECTRO_BEAM, TRUE, TRUE);    
+    pointparticles(particleeffectnum("laser_muzzleflash"), self.tur_shotorg, self.tur_shotdir_updated * 1000, 1);
     self.tur_head.frame += 1;
-
-    CSQCProjectile(proj, TRUE, PROJECTILE_ELECTRO_BEAM, TRUE);
-}
-
-void turret_plasma_projectile_explode()
-{
-    self.event_damage = SUB_Null;
-    //w_deathtypestring = "ate to much plasma";
-#ifdef TURRET_DEBUG
-    float d;
-
-    d = RadiusDamage (self, self.owner, self.owner.shot_dmg, 0, self.owner.shot_radius, world, self.owner.shot_force, DEATH_TURRET_PLASMA, world);
-    self.owner.tur_dbg_dmg_t_h = self.owner.tur_dbg_dmg_t_h + d; //self.owner.shot_dmg;
-    self.owner.tur_dbg_dmg_t_f = self.owner.tur_dbg_dmg_t_f + self.owner.shot_dmg;
-#else
-    RadiusDamage (self, self.owner, self.owner.shot_dmg, 0, self.owner.shot_radius, world, self.owner.shot_force, DEATH_TURRET_PLASMA, world);
-#endif
-
-    remove (self);
 }
 
 void turret_plasma_std_init()
@@ -107,8 +48,8 @@ void turret_plasma_std_init()
     self.ammo_flags = TFL_AMMO_ENERGY | TFL_AMMO_RECHARGE | TFL_AMMO_RECIVE;
 
     // How to aim
-    self.aim_flags      = TFL_AIM_LEAD | TFL_AIM_SHOTTIMECOMPENSATE | TFL_AIM_GROUND2;
-    self.turrcaps_flags = TFL_TURRCAPS_RADIUSDMG | TFL_TURRCAPS_MEDPROJ | TFL_TURRCAPS_PLAYERKILL | TFL_TURRCAPS_MISSILEKILL;
+    self.aim_flags      = TFL_AIM_LEAD | TFL_AIM_SHOTTIMECOMPENSATE | TFL_AIM_GROUNDGROUND;
+    self.turrcaps_flags = TFL_TURRCAPS_RADIUSDMG | TFL_TURRCAPS_MEDPROJ | TFL_TURRCAPS_PLAYERKILL;
 
     if (turret_stdproc_init("plasma_std", "models/turrets/base.md3", "models/turrets/plasma.md3", TID_PLASMA) == 0)
     {
@@ -136,7 +77,7 @@ void turret_plasma_dual_init()
     self.ammo_flags = TFL_AMMO_ENERGY | TFL_AMMO_RECHARGE | TFL_AMMO_RECIVE;
 
     // How to aim at targets
-    self.aim_flags      = TFL_AIM_LEAD | TFL_AIM_SHOTTIMECOMPENSATE  | TFL_AIM_GROUND2 ;
+    self.aim_flags      = TFL_AIM_LEAD | TFL_AIM_SHOTTIMECOMPENSATE  | TFL_AIM_GROUNDGROUND ;
     self.turrcaps_flags = TFL_TURRCAPS_RADIUSDMG | TFL_TURRCAPS_MEDPROJ | TFL_TURRCAPS_PLAYERKILL;
 
     if (turret_stdproc_init("plasma_dual", "models/turrets/base.md3", "models/turrets/plasmad.md3", TID_PLASMA_DUAL) == 0)
index 23c34dc5db023f6499b5f493690589c52f793ba2..454557010d11f8b3328aa8a5381e5ad11cdc634b 100644 (file)
@@ -101,7 +101,7 @@ void turret_tesla_fire()
 
 void turret_tesla_postthink()
 {
-    if not (self.tur_active)
+    if not (self.active)
     {
         self.tur_head.avelocity = '0 0 0';
         return;
index a438229cf5df53d264e077bebec549fa0c4970fc..646fccccb2b8ab7e57751e40e6f26c76e9fdcbc8 100644 (file)
@@ -36,9 +36,9 @@ void walker_meele_do_dmg()
     e = findradius(where,32);
     while (e) 
     {
-        if (turret_validate_target(self,e,self.target_validate_flags))
+        if (turret_validate_target(self, e, self.target_validate_flags))
             if (e != self && e.owner != self)
-                Damage(e, self, self, autocvar_g_turrets_unit_walker_std_meele_dmg ,DEATH_TURRET_WALKER_MEELE,'0 0 0', v_forward * autocvar_g_turrets_unit_walker_std_meele_force);
+                Damage(e, self, self, autocvar_g_turrets_unit_walker_std_meele_dmg, DEATH_TURRET_WALKER_MEELE, '0 0 0', v_forward * autocvar_g_turrets_unit_walker_std_meele_force);
 
         e = e.chain;
     }
@@ -51,16 +51,7 @@ void walker_setnoanim()
 }
 void walker_rocket_explode()
 {
-    if (self.event_damage != SUB_Null)
-    {
-        self.event_damage = SUB_Null;
-        self.think = walker_rocket_explode;
-        self.nextthink = time;
-        return;
-    }
-
-    RadiusDamage (self, self.owner, autocvar_g_turrets_unit_walker_std_rocket_dmg, 0, autocvar_g_turrets_unit_walker_std_rocket_radius, world,autocvar_g_turrets_unit_walker_std_rocket_force, DEATH_TURRET_WALKER_ROCKET, world);
-
+    RadiusDamage (self, self.owner, autocvar_g_turrets_unit_walker_std_rocket_dmg, 0, autocvar_g_turrets_unit_walker_std_rocket_radius, self, autocvar_g_turrets_unit_walker_std_rocket_force, DEATH_TURRET_WALKER_ROCKET, world);
     remove (self);
 }
 
@@ -68,8 +59,9 @@ void walker_rocket_damage (entity inflictor, entity attacker, float damage, floa
 {
     self.health = self.health - damage;
     self.velocity = self.velocity + vforce;
+    
     if (self.health <= 0)
-        walker_rocket_explode();
+        W_PrepareExplosionByDamage(self.owner, walker_rocket_explode);
 }
 
 #define WALKER_ROCKET_MOVE movelib_move_simple(newdir, autocvar_g_turrets_unit_walker_std_rocket_speed, autocvar_g_turrets_unit_walker_std_rocket_turnrate); UpdateCSQCProjectile(self)
@@ -96,7 +88,7 @@ void walker_rocket_think()
         self.cnt = time + 0.5;
     }
 
-    if (edist < 256)
+    if (edist < 128)
         self.tur_shotorg = '0 0 0';
 
     if (self.tur_health < time)
@@ -307,9 +299,6 @@ void walker_move_path()
 }
 
 .float idletime;
-
-
-
 void walker_postthink()
 {
     fixedmakevectors(self.angles);
@@ -520,7 +509,6 @@ void walker_postthink()
     
     self.oldorigin = self.origin;
     turrets_setframe(self.animflag, FALSE);
-
 }
 
 void walker_attack()
@@ -537,7 +525,7 @@ void walker_respawnhook()
     entity e;
 
     // Respawn is called & first spawn to, to set team. need to make sure we do not move the initial spawn.
-    if(self.movetype  != MOVETYPE_WALK)
+    if(self.movetype != MOVETYPE_WALK)
                return;
                
     setorigin(self, self.pos1);
@@ -545,7 +533,7 @@ void walker_respawnhook()
     
     if (self.target != "")
     {
-        e = find(world,targetname,self.target);
+        e = find(world, targetname, self.target);
         if (!e)
         {
             dprint("Warning! initital waypoint for Walker does NOT exsist!\n");
@@ -556,25 +544,27 @@ void walker_respawnhook()
             dprint("Warning: not a turrret path\n");
         else
         {
-            self.pathcurrent = WALKER_PATH(self.origin,e.origin);
+ #ifdef WALKER_FANCYPATHING
+            self.pathcurrent = WALKER_PATH(self.origin, e.origin);
             self.pathgoal = e;
+#else
+            self.pathcurrent = e;
+#endif
         }
     }
 }
 
 void walker_diehook()
 {
-#ifdef self.pathcurrent
+#ifdef WALKER_FANCYPATHING
     if (self.pathcurrent)
         pathlib_deletepath(self.pathcurrent.owner);
 #endif
-
     self.pathcurrent = world;
 }
 
 void turret_walker_dinit()
 {
-
     entity e;
 
     if (self.netname == "")      self.netname     = "Walker Turret";
@@ -598,25 +588,19 @@ void turret_walker_dinit()
         remove(self);
         return;
     }
-
-    self.damage_flags |= TFL_DMG_DEATH_NOGIBS;
+    setsize(self, WALKER_MIN, WALKER_MAX);
     self.target_select_flags   = TFL_TARGETSELECT_PLAYERS | 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.iscreature = TRUE;
+    self.damagedbycontents = TRUE;
     self.movetype   = MOVETYPE_WALK;
     self.solid      = SOLID_SLIDEBOX;
-    self.takedamage = DAMAGE_AIM;
-
-
-    setsize(self, WALKER_MIN, WALKER_MAX);
-
+    self.takedamage = DAMAGE_AIM;    
     setorigin(self, self.origin);
-    tracebox(self.origin + '0 0 128', self.mins,self.maxs,self.origin - '0 0 10000', MOVE_NORMAL, self);
+    tracebox(self.origin + '0 0 128', self.mins, self.maxs, self.origin - '0 0 10000', MOVE_NORMAL, self);
     setorigin(self, trace_endpos + '0 0 4');
     self.pos1 = self.origin;
     self.pos2 = self.angles;
-    
     self.idle_aim = '0 0 0';
     self.turret_firecheckfunc = walker_firecheck;
     self.turret_firefunc      = walker_attack;
diff --git a/qcsrc/server/vehicles/bumblebee.qc b/qcsrc/server/vehicles/bumblebee.qc
deleted file mode 100644 (file)
index f784563..0000000
+++ /dev/null
@@ -1,371 +0,0 @@
-#ifdef SVQC
-// Auto cvars
-float autocvar_g_vehicle_bumblebee_speed_forward;
-float autocvar_g_vehicle_bumblebee_speed_strafe;
-float autocvar_g_vehicle_bumblebee_speed_up;
-float autocvar_g_vehicle_bumblebee_speed_down;
-float autocvar_g_vehicle_bumblebee_turnspeed;
-float autocvar_g_vehicle_bumblebee_pitchspeed;
-float autocvar_g_vehicle_bumblebee_pitchlimit;
-float autocvar_g_vehicle_bumblebee_friction;
-
-float autocvar_g_vehicle_bumblebee_energy;
-float autocvar_g_vehicle_bumblebee_energy_regen;
-float autocvar_g_vehicle_bumblebee_energy_regen_pause;
-
-float autocvar_g_vehicle_bumblebee_health;
-float autocvar_g_vehicle_bumblebee_health_regen;
-float autocvar_g_vehicle_bumblebee_health_regen_pause;
-
-float autocvar_g_vehicle_bumblebee_shield;
-float autocvar_g_vehicle_bumblebee_shield_regen;
-float autocvar_g_vehicle_bumblebee_shield_regen_pause;
-
-float autocvar_g_vehicle_bumblebee_cannon_cost;
-float autocvar_g_vehicle_bumblebee_cannon_damage;
-float autocvar_g_vehicle_bumblebee_cannon_radius;
-float autocvar_g_vehicle_bumblebee_cannon_refire;
-float autocvar_g_vehicle_bumblebee_cannon_speed;
-float autocvar_g_vehicle_bumblebee_cannon_spread;
-float autocvar_g_vehicle_bumblebee_cannon_force;
-
-float autocvar_g_vehicle_bumblebee_cannon_turnspeed;
-float autocvar_g_vehicle_bumblebee_cannon_pitchlimit_down;
-float autocvar_g_vehicle_bumblebee_cannon_pitchlimit_up;
-float autocvar_g_vehicle_bumblebee_cannon_turnlimit_in;
-float autocvar_g_vehicle_bumblebee_cannon_turnlimit_out;
-
-float autocvar_g_vehicle_bumblebee_respawntime;
-
-float autocvar_g_vehicle_bumblebee_blowup_radius;
-float autocvar_g_vehicle_bumblebee_blowup_coredamage;
-float autocvar_g_vehicle_bumblebee_blowup_edgedamage;
-float autocvar_g_vehicle_bumblebee_blowup_forceintensity;
-
-#define BUMB_MIN '-120 -120 -40'
-#define BUMB_MAX '120 120 40'
-
-.entity gunner1;
-//.entity gunner2;
-.vector lastaim;
-float bumb_gunner_frame()
-{
-    entity vehic, gun, gunner;
-    float ftmp, ftmp2;
-    vector vtmp;
-
-    vehic   = self.vehicle;
-    gun     = self.vehicle.gun1;
-    gunner  = self;
-
-    self    = vehic;
-    vehic.solid = SOLID_NOT;
-    crosshair_trace(gunner);
-
-    //vtmp = gettaginfo(vehic, gettagindexvehic, "tag_hardpoint01"));
-    vtmp = gettaginfo(gun, gettagindex(gun, "muzzle"));
-    vtmp = vectoangles(normalize(trace_endpos - vtmp)); // Find the direction & angle
-    vtmp = shortangle_vxy(vtmp - (vehic.angles + gun.angles), vehic.angles + gun.angles);     // Find aim offset
-
-    // Bind to aimspeed
-    ftmp2 = autocvar_g_vehicle_bumblebee_cannon_turnspeed * frametime; ftmp = -ftmp2;
-    vtmp_x = bound(ftmp, vtmp_x, ftmp2);
-    vtmp_y = bound(ftmp, vtmp_y, ftmp2);
-    // Bind to limts
-    gun.angles_x = bound(-autocvar_g_vehicle_bumblebee_cannon_pitchlimit_down, vtmp_x + gun.angles_x, autocvar_g_vehicle_bumblebee_cannon_pitchlimit_up);
-    gun.angles_y = bound(-autocvar_g_vehicle_bumblebee_cannon_turnlimit_in,  vtmp_y + gun.angles_y, autocvar_g_vehicle_bumblebee_cannon_turnlimit_out);
-
-    if(gunner.BUTTON_ATCK && gun.cnt <= time)
-    {
-        vtmp = gettaginfo(gun, gettagindex(gun, "muzzle"));
-        v_forward = normalize(v_forward);
-        vtmp += v_forward * 50;
-
-        fireBullet (vtmp, v_forward, autocvar_g_vehicle_spiderbot_minigun_spread, autocvar_g_vehicle_spiderbot_minigun_damage,
-            autocvar_g_vehicle_spiderbot_minigun_spread, DEATH_SBMINIGUN, 0);
-
-        gun.cnt = time + 0.1;
-    }
-
-    setorigin(gunner, vehic.origin);
-    gunner.velocity = vehic.velocity;
-
-    vehic.solid = SOLID_BBOX;
-    gunner.BUTTON_ATCK = gunner.BUTTON_ATCK2 = gunner.BUTTON_CROUCH = 0;
-    self = gunner;
-    return 1;
-}
-
-void bumb_gunner_enter()
-{
-    if(self.gunner1 != world)
-        return;
-
-    self.gunner1         = other;
-    self.gunner1.vehicle = self;
-
-    msg_entity = other;
-    WriteByte (MSG_ONE, SVC_SETVIEWPORT);
-    WriteEntity(MSG_ONE, self.gun1);
-    WriteByte (MSG_ONE, SVC_SETVIEWANGLES);
-    if(self.tur_head)
-    {
-        WriteAngle(MSG_ONE, self.gun1.angles_x + self.angles_x); // tilt
-        WriteAngle(MSG_ONE, self.gun1.angles_y + self.angles_y); // yaw
-        WriteAngle(MSG_ONE, 0);                                  // roll
-    }
-    other.PlayerPhysplug = bumb_gunner_frame;
-}
-
-float bumb_pilot_frame()
-{
-    entity pilot, gunner, vehic;
-    vector newvel;
-
-    pilot = self;
-    vehic = self.vehicle;
-    self   = vehic;
-
-    if(pilot.BUTTON_USE && vehic.deadflag == DEAD_NO)
-    {
-        self = vehic;
-        vehicles_exit(VHEF_NORMAL);
-        self = pilot;
-        return 0;
-    }
-
-    if(vehic.deadflag != DEAD_NO)
-    {
-        self = pilot;
-        pilot.BUTTON_ATCK = pilot.BUTTON_ATCK2 = 0;
-        return 1;
-    }
-
-    crosshair_trace(pilot);
-
-    vector vang;
-    float ftmp;
-
-    vang = vehic.angles;
-    newvel = vectoangles(normalize(trace_endpos - self.origin + '0 0 32'));
-    vang_x *= -1;
-    newvel_x *= -1;
-    if(newvel_x > 180)  newvel_x -= 360;
-    if(newvel_x < -180) newvel_x += 360;
-    if(newvel_y > 180)  newvel_y -= 360;
-    if(newvel_y < -180) newvel_y += 360;
-
-    ftmp = shortangle_f(pilot.v_angle_y - vang_y, vang_y);
-    if(ftmp > 180)  ftmp -= 360; if(ftmp < -180) ftmp += 360;
-    vehic.avelocity_y = bound(-autocvar_g_vehicle_bumblebee_turnspeed, ftmp + vehic.avelocity_y * 0.9, autocvar_g_vehicle_bumblebee_turnspeed);
-
-    // Pitch
-    ftmp = 0;
-    if(pilot.movement_x > 0 && vang_x < autocvar_g_vehicle_bumblebee_pitchlimit) ftmp = 5;
-    else if(pilot.movement_x < 0 && vang_x > -autocvar_g_vehicle_bumblebee_pitchlimit) ftmp = -20;
-
-    newvel_x = bound(-autocvar_g_vehicle_bumblebee_pitchlimit, newvel_x , autocvar_g_vehicle_bumblebee_pitchlimit);
-    ftmp = vang_x - bound(-autocvar_g_vehicle_bumblebee_pitchlimit, newvel_x + ftmp, autocvar_g_vehicle_bumblebee_pitchlimit);
-    vehic.avelocity_x = bound(-autocvar_g_vehicle_bumblebee_pitchspeed, ftmp + vehic.avelocity_x * 0.9, autocvar_g_vehicle_bumblebee_pitchspeed);
-
-    vehic.angles_x = anglemods(vehic.angles_x);
-    vehic.angles_y = anglemods(vehic.angles_y);
-    vehic.angles_z = anglemods(vehic.angles_z);
-
-    makevectors('0 1 0' * vehic.angles_y);
-    newvel = vehic.velocity * -autocvar_g_vehicle_bumblebee_friction;
-
-    if(pilot.movement_x != 0)
-    {
-        if(pilot.movement_x > 0)
-            newvel += v_forward  * autocvar_g_vehicle_bumblebee_speed_forward;
-        else if(pilot.movement_x < 0)
-            newvel -= v_forward  * autocvar_g_vehicle_bumblebee_speed_forward;
-    }
-
-    if(pilot.movement_y != 0)
-    {
-        if(pilot.movement_y < 0)
-            newvel -= v_right * autocvar_g_vehicle_bumblebee_speed_strafe;
-        else if(pilot.movement_y > 0)
-            newvel += v_right * autocvar_g_vehicle_bumblebee_speed_strafe;
-        ftmp = newvel * v_right;
-        ftmp *= frametime * 0.1;
-        vehic.angles_z = bound(-15, vehic.angles_z + ftmp, 15);
-    }
-    else
-    {
-        vehic.angles_z *= 0.95;
-        if(vehic.angles_z >= -1 && vehic.angles_z <= -1)
-            vehic.angles_z = 0;
-    }
-
-    if(pilot.BUTTON_CROUCH)
-        newvel -=   v_up * autocvar_g_vehicle_bumblebee_speed_down;
-    else if (pilot.BUTTON_JUMP)
-        newvel +=  v_up * autocvar_g_vehicle_bumblebee_speed_up;
-
-    vehic.velocity  += newvel * frametime;
-    pilot.velocity = pilot.movement  = vehic.velocity;
-    setorigin(pilot,vehic.origin + '0 0 32');
-
-
-    if(vehic.vehicle_flags  & VHF_SHIELDREGEN)
-        vehicles_regen(dmg_time, vehicle_shield, autocvar_g_vehicle_bumblebee_shield, autocvar_g_vehicle_bumblebee_shield_regen_pause, autocvar_g_vehicle_bumblebee_shield_regen, frametime);
-
-    if(vehic.vehicle_flags  & VHF_HEALTHREGEN)
-        vehicles_regen(dmg_time, vehicle_health, autocvar_g_vehicle_bumblebee_health, autocvar_g_vehicle_bumblebee_health_regen_pause, autocvar_g_vehicle_bumblebee_health_regen, frametime);
-
-    if(vehic.vehicle_flags  & VHF_ENERGYREGEN)
-        vehicles_regen(cnt, vehicle_energy, autocvar_g_vehicle_bumblebee_energy, autocvar_g_vehicle_bumblebee_energy_regen_pause, autocvar_g_vehicle_bumblebee_energy_regen, frametime);
-
-    VEHICLE_UPDATE_PLAYER(health, bumblebee);
-    VEHICLE_UPDATE_PLAYER(energy, bumblebee);
-    if(vehic.vehicle_flags & VHF_HASSHIELD)
-        VEHICLE_UPDATE_PLAYER(shield, bumblebee);
-
-    pilot.BUTTON_ATCK = pilot.BUTTON_ATCK2 = pilot.BUTTON_CROUCH = 0;
-    self = pilot;
-
-    return 1;
-}
-
-void bumb_think()
-{
-    self.velocity = self.velocity * 0.99;
-    self.nextthink = time + 0.1;
-}
-
-void bumb_enter()
-{
-    self.touch  = bumb_gunner_enter;
-}
-
-void bumb_exit(float eject)
-{
-    self.owner = world;
-    self.touch = vehicles_touch;
-}
-
-void bumb_spawn()
-{
-    self.vehicle_health = autocvar_g_vehicle_bumblebee_health;
-    self.vehicle_shield = autocvar_g_vehicle_bumblebee_shield;
-    self.movetype       = MOVETYPE_TOSS;
-    self.solid          = SOLID_BBOX;
-    //self.vehicle_energy = 1;
-    self.movetype = MOVETYPE_FLY;
-    setorigin(self, self.origin + '0 0 25');
-}
-
-void bumb_die()
-{
-    self.health       = 0;
-    self.event_damage = SUB_Null;
-    self.solid        = SOLID_CORPSE;
-    self.takedamage   = DAMAGE_NO;
-    self.deadflag     = DEAD_DYING;
-    self.movetype     = MOVETYPE_BOUNCE;
-
-    pointparticles(particleeffectnum("rocket_explode"), findbetterlocation (self.origin, 16), '0 0 0', 1);
-}
-
-void bumb_dinit()
-{
-    if not (vehicle_initialize(
-             "Bumblebee",
-             "models/vehicles/bumblebee_body.dpm",
-             "",
-             "models/vehicles/spiderbot_cockpit.dpm",
-             "", "", "tag_viewport",
-             HUD_BUMBLEBEE,
-             BUMB_MIN, BUMB_MAX,
-             FALSE,
-             bumb_spawn, autocvar_g_vehicle_bumblebee_respawntime,
-             bumb_pilot_frame,
-             bumb_enter, bumb_exit,
-             bumb_die,   bumb_think,
-             FALSE))
-    {
-        remove(self);
-        return;
-    }
-    self.gun1 = spawn();
-    setmodel(self.gun1, "models/vehicles/bumblebee_ray.dpm");
-    setattachment(self.gun1, self, "tag_hardpoint03");
-
-    self.gun1 = spawn();
-    self.gun2 = spawn();
-
-    self.gun1.owner = self;
-    self.gun2.owner = self;
-
-    setmodel(self.gun1, "models/vehicles/bumblebee_plasma_right.dpm");
-    setmodel(self.gun2, "models/vehicles/bumblebee_plasma_left.dpm");
-
-    setattachment(self.gun1, self, "tag_hardpoint01");
-    setattachment(self.gun2, self, "tag_hardpoint02");
-
-    vector ofs;
-    ofs = gettaginfo(self, gettagindex(self, "tag_hardpoint01"));
-    ofs -= self.origin;
-    setattachment(self.gun1, self, "");
-    setorigin(self.gun1, ofs);
-
-    ofs = gettaginfo(self, gettagindex(self, "tag_hardpoint02"));
-    ofs -= self.origin;
-    setattachment(self.gun2, self, "");
-    setorigin(self.gun2, ofs);
-
-
-}
-
-void spawnfunc_vehicle_bumblebee()
-{
-
-    precache_model ("models/vehicles/bumblebee_body.dpm");
-    precache_model ("models/vehicles/bumblebee_plasma_left.dpm");
-    precache_model ("models/vehicles/bumblebee_plasma_right.dpm");
-    precache_model ("models/vehicles/bumblebee_ray.dpm");
-
-    //vehicles_configcheck("vehicle_bumblebee.cfg", autocvar_g_vehicle_bumblebee_health);
-
-    if(autocvar_g_vehicle_bumblebee_energy)
-        if(autocvar_g_vehicle_bumblebee_energy_regen)
-            self.vehicle_flags |= VHF_ENERGYREGEN;
-
-    if(autocvar_g_vehicle_bumblebee_shield)
-        self.vehicle_flags |= VHF_HASSHIELD;
-
-    if(autocvar_g_vehicle_bumblebee_shield_regen)
-        self.vehicle_flags |= VHF_SHIELDREGEN;
-
-    if(autocvar_g_vehicle_bumblebee_health_regen)
-        self.vehicle_flags |= VHF_HEALTHREGEN;
-
-    self.think = bumb_dinit;
-    self.nextthink = time + 1;
-}
-#endif // SVQC
-
-#ifdef CSQC
-void bumblebee_draw()
-{
-
-}
-
-void bumblebee_draw2d()
-{
-
-}
-
-void bumblebee_read_extra()
-{
-
-}
-
-void vehicle_bumblebee_assemble()
-{
-
-}
-#endif //CSQC
diff --git a/qcsrc/server/vehicles/collision.qc b/qcsrc/server/vehicles/collision.qc
deleted file mode 100644 (file)
index 11488a0..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-vector collision_force;
-vector collision_angle;
-
-vector bb1[9];
-vector bb2[9];
-
-float collision_run()
-{
-    vector vtmp, vmin, vmax, vrot, vforce, vtmp2, vtmp3;
-    float i, fvel, bcol;
-
-
-    // Extract the 8 bbox corners from mins/maxs for self
-    vmax = self.maxs;
-    vmin = self.mins;
-    bb1[0] = vmax;
-    vtmp   = vmax; vtmp_x = vmin_x; bb1[1] = vtmp;
-    vtmp   = vmax; vtmp_y = vmin_y; bb1[2] = vtmp;
-    vtmp   = vmin; vtmp_z = vmax_z; bb1[3] = vtmp;
-    bb1[4] = vmin;
-    vtmp   = vmin; vtmp_x = vmax_x; bb1[5] = vtmp;
-    vtmp   = vmin; vtmp_y = vmax_y; bb1[6] = vtmp;
-    vtmp   = vmax; vtmp_z = vmin_z; bb1[7] = vtmp;
-
-    makevectors(self.angles + '-2 0 0' * self.angles_x);
-    bcol = 0;
-
-    // Pass1: Transform by rotation, ajust points by impact/s
-    for(i = 8; i >= 0; --i)
-    {
-        vtmp = bb1[i];
-        vtmp = self.origin + vtmp_x * v_forward - vtmp_y * v_right + vtmp_z * v_up;
-        traceline(self.origin, vtmp, MOVE_WORLDONLY, self);
-        te_lightning1(world,self.origin,vtmp);
-        if(trace_fraction != 1.0)
-        {
-            vforce += (trace_endpos - vtmp);
-            vtmp3 = self.origin + self.velocity * frametime;
-            vtmp2 =  vectoangles(normalize(vtmp - vtmp3));
-            vrot   += (vectoangles(normalize(trace_endpos - vtmp3)) - vtmp2);
-            bcol += 1;
-        }
-    }
-
-    if(bcol)
-    {
-
-        vtmp = self.origin + self.velocity * frametime;
-        self.angles += vrot * frametime;
-        self.velocity += vforce * frametime;
-
-    }
-
-}
-
diff --git a/qcsrc/server/vehicles/network.qc b/qcsrc/server/vehicles/network.qc
deleted file mode 100644 (file)
index 688aa7c..0000000
+++ /dev/null
@@ -1,237 +0,0 @@
-#ifdef VEHICLES_CSQC
-// SendFlags
-float VSF_SETUP       = 1;          /// Send vehicle type etc
-float VSF_ORIGIN      = 2;          /// Send location
-float VSF_MOVEMENT    = 4;          /// Send movement update (and angles)
-float VSF_AVEL        = 8;          /// Send Angular velocity
-float VSF_STATS       = 16;         /// Send ammo, health etc
-float VSF_EXTRA       = 32;         /// Send additional data (turret rotations etc). Handeld per vehicle type.
-float VSF_ANIMINFO    = 64;         /// Animation info
-float VSF_FULL_UPDATE = 16777215;    /// Send everything
-
-float VSX_FAR   = 1;
-float VSX_OWNER = 2;
-float VSX_GUN1  = 4;
-float VSX_GUN2  = 8;
-
-#ifdef SVQC
-#define VSX_FARDISTANCE 2000
-float send_vehile(entity to, float sf)
-{
-       float dist, xf;
-
-    var void WriteFunc(float, float);
-
-    dist = vlen(self.origin - to.origin);
-    if(to == self.owner)
-        xf |= VSX_OWNER;
-    else if(dist > VSX_FARDISTANCE)
-        xf |= VSX_FAR;
-
-       // Always send a movement and origin to owner
-       if(to == self.owner)
-           sf |= VSF_ORIGIN | VSF_MOVEMENT;
-
-       WriteByte(MSG_ENTITY, ENT_CLIENT_VEHICLE);
-
-       // We need to know client-side what was sent
-       WriteByte(MSG_ENTITY, sf);
-       WriteByte(MSG_ENTITY, xf);
-
-       if(sf & VSF_SETUP)
-       {
-        WriteByte(MSG_ENTITY,  self.hud);        //vehicle type = hud
-        WriteByte(MSG_ENTITY,  self.team);
-        WriteShort(MSG_ENTITY, self.colormap);
-        WriteShort(MSG_ENTITY, self.vehicle_flags);
-       }
-
-    if(sf & VSF_ORIGIN)
-    {
-        WriteFunc = ((xf & VSX_FAR) ? WriteShort : WriteCoord);
-        WriteFunc(MSG_ENTITY, self.origin_x);
-        WriteFunc(MSG_ENTITY, self.origin_y);
-        WriteFunc(MSG_ENTITY, self.origin_z);
-    }
-
-    if(sf & VSF_MOVEMENT)
-    {
-        WriteFunc = ((xf & VSX_FAR) ? WriteShort : WriteCoord);
-        WriteFunc(MSG_ENTITY, self.velocity_x);
-        WriteFunc(MSG_ENTITY, self.velocity_y);
-        WriteFunc(MSG_ENTITY, self.velocity_z);
-
-        WriteFunc = ((xf & VSX_FAR) ? WriteShort : WriteAngle);
-        WriteFunc(MSG_ENTITY, self.angles_x);
-        WriteFunc(MSG_ENTITY, self.angles_y);
-        WriteFunc(MSG_ENTITY, self.angles_z);
-    }
-
-    if(sf & VSF_AVEL)
-    {
-        WriteFunc = ((xf & VSX_FAR) ? WriteShort : WriteCoord);
-        WriteFunc(MSG_ENTITY, self.avelocity_x);
-        WriteFunc(MSG_ENTITY, self.avelocity_y);
-        WriteFunc(MSG_ENTITY, self.avelocity_z);
-    }
-
-    if(sf & VSF_STATS)
-    {
-        WriteByte(MSG_ENTITY, self.vehicle_health);
-        if(xf & VSX_OWNER)
-        {
-            WriteByte(MSG_ENTITY, self.vehicle_shield);
-            WriteByte(MSG_ENTITY, self.vehicle_energy);
-
-            WriteByte(MSG_ENTITY, self.vehicle_ammo1);
-            WriteByte(MSG_ENTITY, self.vehicle_reload1);
-
-            WriteByte(MSG_ENTITY, self.vehicle_ammo2);
-            WriteByte(MSG_ENTITY, self.vehicle_reload2);
-
-        }
-    }
-
-    if(sf & VSF_EXTRA)
-        self.vehile_send_exta(to, sf);
-
-    return TRUE;
-}
-
-void net_link_vehile()
-{
-    self.SendFlags = 0xFFFFFF;
-    Net_LinkEntity(self, FALSE, 0, send_vehile);
-}
-#endif // SVQC
-
-#ifdef CSQC
-void vehicle_spiderbot_assemble()
-{
-
-}
-
-void vehicle_raptor_assemble()
-{
-
-}
-
-void vehicle_bumblebee_assemble()
-{
-
-}
-
-.float lastupdate;
-void read_vehicle(float bIsNew)
-{
-    float sf, xf;
-    var float ReadFunc();
-
-    sf = ReadByte();
-    xf = ReadByte();
-
-    if(xf & VSX_OWNER)
-        vehicle = self;
-
-       if(sf & VSF_SETUP)
-       {
-        self.vehicle_hud   = ReadByte();
-        self.team          = ReadByte();
-        self.colormap      = ReadShort();
-        self.vehicle_flags = ReadShort();
-
-        switch(self.vehicle_hud)
-        {
-            case HUD_WAKIZASHI:
-                vehicle_racer_assemble();
-                break;
-            case HUD_SPIDERBOT:
-                vehicle_spiderbot_assemble();
-                break;
-            case HUD_RAPTOR:
-                vehicle_raptor_assemble();
-                break;
-            case HUD_BUMBLEBEE:
-                vehicle_bumblebee_assemble();
-                break;
-            default:
-                break;
-        }
-       }
-
-       if(self.vehicle_hud == HUD_WAKIZASHI && xf & VSX_OWNER)
-       {
-
-        vehicle_hudmodel.owner  = self;
-       }
-
-    //if(xf & VSX_FAR)
-    //    dprint("Client vehicle faaar set\n");
-
-    if(sf & VSF_ORIGIN)
-    {
-        ReadFunc = ((xf & VSX_FAR) ? ReadShort : ReadCoord);
-        self.origin_x = ReadFunc();
-        self.origin_y = ReadFunc();
-        self.origin_z = ReadFunc();
-
-        setorigin(self, self.origin);
-        //self.lastupdate = time;
-    }
-
-    if(sf & VSF_MOVEMENT)
-    {
-        ReadFunc = ((xf & VSX_FAR) ? ReadShort : ReadCoord);
-        self.velocity_x  = ReadFunc();
-        self.velocity_y  = ReadFunc();
-        self.velocity_z  = ReadFunc();
-
-        ReadFunc = ((sf & VSX_FAR) ? ReadShort : ReadAngle);
-        self.angles_x = ReadFunc();
-        self.angles_y = ReadFunc();
-        self.angles_z = ReadFunc();
-
-        //self.lastupdate = time;
-        // self.move_velocity  = self.velocity;
-        // self.move_angles    = self.angles;
-    }
-
-    if(sf & VSF_AVEL)
-    {
-        ReadFunc = ((xf & VSX_FAR) ? ReadShort : ReadCoord);
-        self.avelocity_x = ReadFunc();
-        self.avelocity_y = ReadFunc();
-        self.avelocity_z = ReadFunc();
-
-        // self.move_avelocity  = self.avelocity;
-    }
-
-    if(sf & VSF_STATS)
-    {
-        self.vehicle_health = ReadByte();
-        if(xf & VSX_OWNER)
-        {
-            self.vehicle_shield  = ReadByte();
-            self.vehicle_energy  = ReadByte();
-            self.vehicle_ammo1   = ReadByte();
-            self.vehicle_reload1 = ReadByte();
-            self.vehicle_ammo2   = ReadByte();
-            self.vehicle_reload2 = ReadByte();
-        }
-    }
-
-    if(sf & VSF_EXTRA)
-        self.vehile_read_exta(sf);
-
-}
-
-#endif // CSQC
-#else
-#ifdef CSQC
-.float lastupdate;
-void read_vehicle(float bIsNew)
-{
-
-}
-#endif
-#endif // VEHICLES_CSQC
index 683b43669536cc76a3ce2d3defe1762f2844701f..c4e2875380486575ed766684f7def98d1053ff28 100644 (file)
@@ -339,6 +339,7 @@ void vehicles_spawn()
     self.touch              = vehicles_touch;
     self.event_damage       = vehicles_damage;
     self.iscreature         = TRUE;
+    self.damagedbycontents     = TRUE;
     self.movetype           = MOVETYPE_WALK;
     self.solid              = SOLID_SLIDEBOX;
     self.takedamage         = DAMAGE_AIM;
@@ -974,6 +975,7 @@ float vehicle_initialize(string  net_name,
     self.takedamage         = DAMAGE_AIM;
     self.bot_attack         = TRUE;
     self.iscreature         = TRUE;
+    self.damagedbycontents     = TRUE;
     self.hud                = vhud;
 
     self.vehicle_die         = dieproc;
diff --git a/qcsrc/server/verbstack.qc b/qcsrc/server/verbstack.qc
deleted file mode 100644 (file)
index b0601af..0000000
+++ /dev/null
@@ -1,274 +0,0 @@
-/// Some default stacks.
-.entity verbs_idle;
-.entity verbs_attack;
-.entity verbs_move;
-//.entity vchain;
-
-/// This global gets set to the verb in question each time the stack manager calls verb_call
-entity verb;
-//.entity current_verb;
-//.float verb_done;
-
-/// Execure this verb
-#define VCM_DO     0
-/// Return the value of this verb. Return VS_CALL_REMOVE to delete it.
-#define VCM_EVAL   1
-/// This verb is beeing removed NOW (not sent when verb_call returns VS_CALL_REMOVE)
-#define VCM_REMOVE 2
-
-/// Verb callback
-.float(float message) verb_call;
-
-/// Points to this verb's stack.
-.entity  verbstack;
-
-/// Static value of this verb
-.float verb_static_value;
-
-/// verb_call returns this when a verb in not doable
-#define VS_CALL_NO        0
-/// verb_call(VCM_DO) returns this when a verb is executing
-#define VS_CALL_YES_DOING -1
-/// verb_call(VCM_DO) returns this when a verb did execure and is done
-#define VS_CALL_YES_DONE  -2
-/// verb_call(VCM_DO) returns this when a verb should be deleted by the stack manager
-#define VS_CALL_REMOVE    -3
-
-/*
-void verbstack_updatechain(entity stack)
-{
-    entity vrb, v;
-    if not (stack)
-        return;
-
-    dprint("verbstack_updatechain\n");
-
-    vrb = findchainentity(verbstack, stack);
-    if not (vrb)
-    {
-        stack.vchain = world;
-        return;
-    }
-
-    stack.vchain = vrb;
-    v = vrb;
-
-    while(vrb)
-    {
-        vrb = vrb.chain;
-
-
-    }
-}
-
-void verbstack_remove(entity vverb)
-{
-    entity vstack;
-    dprint("verbstack_remove\n");
-
-    vstack = verb.verbstack;
-    remove(vverb);
-    vverb.verbstack = world;
-    verbstack_updatechain(vstack);
-
-    //vverb.think = SUB_Remove;
-    //vverb.nextthink = time;
-}
-
-void verbstack_thinkremove()
-{
-    dprint("verbstack_thinkremove\n");
-    verbstack_remove(self);
-}
-*/
-
-/**
-    Push a new verb onto the specified stack. Set vrb_life to make it time-limited.
-**/
-entity verbstack_push(entity stack, float(float eval) vrb_call, float val_static, float vrb_life,entity verb_owner)
-{
-    entity vrb;
-
-    if not(stack)
-        return world;
-
-    if not(vrb_call)
-        return world;
-
-    vrb                   = spawn();
-    vrb.owner             = verb_owner;
-    vrb.verbstack         = stack;
-    vrb.verb_call         = vrb_call;
-    vrb.verb_static_value = val_static;
-
-    vrb.classname         = "verb";
-    stack.classname       = "verbstack";
-
-    if(vrb_life)
-    {
-        //vrb.think     = verbstack_thinkremove;
-        vrb.think     = SUB_Remove;
-        vrb.nextthink = time + vrb_life;
-    }
-
-    //verbstack_updatechain(stack);
-
-    return vrb;
-}
-
-/**
-    Find the best verb in this stack and execurte it.
-    ALso remove any verbs returning VS_CALL_REMOVE on VCM_EVAL or VCM_DO
-**/
-float verbstack_pop(entity stack)
-{
-    entity vrb, bestverb, oldself;
-    float  value, bestvalue;
-
-    oldself = self;
-
-    vrb = findchainentity(verbstack,stack);
-    //vrb = stack.vchain;
-    //dprint("owner:", stack.owner.classname, " vsn:", stack.classname,"\n");
-    while(vrb)
-    {
-        //dprint("vn:", vrb.classname,"\n");
-        verb  = vrb;
-        vrb   = vrb.chain;
-        self  = verb.owner;
-        value = verb.verb_call(VCM_EVAL);
-
-        if(value < 0)
-        {
-            if(value == VS_CALL_REMOVE)
-                remove(verb);
-        }
-        else
-        {
-            if(value > bestvalue)
-            {
-                bestverb  = verb;
-                bestvalue = value;
-            }
-        }
-    }
-
-    if(bestverb)
-    {
-        verb  = bestverb;
-        self  = verb.owner;
-        value = verb.verb_call(VCM_DO);
-
-        if(value == VS_CALL_REMOVE)
-            remove(bestverb);
-    }
-
-    self = oldself;
-
-    return value;
-}
-
-float verbstack_popfifo(entity stack)
-{
-    entity oldself;
-    float ret;
-
-    oldself = self;
-    verb = findentity(stack,verbstack,stack);
-    if not (verb)
-        ret = 0;
-    else
-    {
-        self = verb.owner;
-        ret = verb.verb_call(VCM_DO);
-
-        if(ret == VS_CALL_REMOVE)
-            remove(verb);
-    }
-
-    self = oldself;
-    return ret;
-}
-
-/**
-    Find the best verb in this stack and return it.
-    ALso remove any verbs returning VS_CALL_REMOVE on VCM_EVAL.
-**/
-entity verbstack_pull(entity stack)
-{
-    entity vrb;
-    entity bestverb, oldself;
-    float  value, bestvalue;
-
-    oldself = self;
-
-    vrb = findchainentity(verbstack,stack);
-    while(vrb)
-    {
-        self = vrb.owner;
-
-        verb  = vrb;
-        vrb   = vrb.chain;
-        value = verb.verb_call(VCM_EVAL);
-
-        if(value < 0)
-        {
-            if(value == VS_CALL_REMOVE)
-                remove(verb);
-        }
-        else
-        {
-            if(value > bestvalue)
-            {
-                bestverb = verb;
-                bestvalue = value;
-            }
-        }
-    }
-
-    self = oldself;
-
-    return bestverb;
-}
-
-entity verbstack_pullfifo(entity stack)
-{
-    return findentity(stack,verbstack,stack);
-}
-
-/**
-    Delete every verb on this stack, signaling them with VCM_REMOVE first.
-**/
-void verbstack_flush(entity stack)
-{
-    entity vrb, oldself;
-
-    oldself = self;
-
-    vrb = findchainentity(verbstack,stack);
-    while(vrb)
-    {
-        self = vrb.owner;
-
-        verb = vrb;
-        vrb  = vrb.chain;
-        verb.verb_call(VCM_REMOVE);
-        remove(verb);
-    }
-
-    self = oldself;
-
-    //stack.vchain = world;
-}
-
-void verbstack_doverb(entity vrb)
-{
-    float value;
-
-    verb  = vrb;
-    self  = verb.owner;
-    value = verb.verb_call(VCM_DO);
-
-    if(value == VS_CALL_REMOVE)
-        remove(vrb);
-}
index 55570c6f2bcc806a7dcafd2a10b1848db4a5679d..3043ceaab510a3e4bb882c69e71984f245174f27 100644 (file)
@@ -117,7 +117,7 @@ float RemapVote(string vote, string cmd, entity e)
 }
 
 float GameCommand_Vote(string s, entity e) {
-       local float playercount;
+       float playercount;
        float argc;
        argc = tokenize_console(s);
        if(argv(0) == "help") {
@@ -145,7 +145,7 @@ float GameCommand_Vote(string s, entity e) {
                                else if(votecalled) {
                                        print_to(e, "^1There is already a vote called.");
                                } else {
-                                       local string vote;
+                                       string vote;
                                        vote = VoteParse(s, argc);
                                        if(vote == "") {
                                                print_to(e, "^1Your vote is empty. See 'vhelp' for more info.");
@@ -172,7 +172,7 @@ float GameCommand_Vote(string s, entity e) {
                                                VoteCount(); // needed if you are the only one
                                                msg_entity = e;
 
-                                               local entity player;
+                                               entity player;
                                                FOR_EACH_REALCLIENT(player)
                                                {
                                                        ++playercount;
@@ -224,7 +224,7 @@ float GameCommand_Vote(string s, entity e) {
                        }
                } else if(argv(1) == "do") {
                        if(!e || e.vote_master) {
-                               local string dovote;
+                               string dovote;
                                dovote = VoteParse(s, argc);
                                if(dovote == "") {
                                        print_to(e, "^1Your command was empty. See 'vhelp' for more info.");
@@ -242,10 +242,10 @@ float GameCommand_Vote(string s, entity e) {
                                print_to(e, "^1You are NOT a master.  You might need to login or vote to become master first. See 'vhelp' for more info.");
                        }
                } else if(argv(1) == "login") {
-                       local string masterpwd;
+                       string masterpwd;
                        masterpwd = autocvar_sv_vote_master_password;
                        if(masterpwd != "") {
-                               local float granted;
+                               float granted;
                                granted = (masterpwd == argv(2));
                                if (e)
                                        e.vote_master = granted;
@@ -318,17 +318,17 @@ float GameCommand_Vote(string s, entity e) {
 }
 
 void VoteHelp(entity e) {
-       local string vmasterdis;
+       string vmasterdis;
        if(!autocvar_sv_vote_master) {
                vmasterdis = " ^1(disabled)";
        }
 
-       local string vlogindis;
+       string vlogindis;
        if("" == autocvar_sv_vote_master_password) {
                vlogindis = " ^1(disabled)";
        }
 
-       local string vcalldis;
+       string vcalldis;
        if(!autocvar_sv_vote_call) {
                vcalldis = " ^1(disabled)";
        }
@@ -439,7 +439,7 @@ float VoteAllowed(string votecommand, string cmd) {
 }
 
 void VoteReset() {
-       local entity player;
+       entity player;
 
        FOR_EACH_CLIENT(player)
        {
@@ -535,17 +535,17 @@ void VoteSpam(float notvoters, float mincount, string result)
 }
 
 void VoteCount() {
-       local float playercount;
+       float playercount;
        playercount = 0;
        vote_yescount = 0;
        vote_nocount = 0;
        vote_abstaincount = 0;
-       local entity player;
+       entity player;
        //same for real players
-       local float realplayercount;
-       local float realplayeryescount;
-       local float realplayernocount;
-       local float realplayerabstaincount;
+       float realplayercount;
+       float realplayeryescount;
+       float realplayernocount;
+       float realplayerabstaincount;
        realplayercount = realplayernocount = realplayerabstaincount = realplayeryescount = 0;
 
        Nagger_VoteCountChanged();
index f1e33ec968aec26b989f22dd29c7c98786ac0242..08c56121b5c6a110661fe6c6977bc90edee2d992 100644 (file)
@@ -26,9 +26,9 @@ void W_GiveWeapon (entity e, float wep, string name)
 .vector railgunforce;
 void FireRailgunBullet (vector start, vector end, float bdamage, float bforce, float mindist, float maxdist, float halflifedist, float forcehalflifedist, float deathtype)
 {
-       local vector hitloc, force, endpoint, dir;
-       local entity ent, endent;
-       local float endq3surfaceflags;
+       vector hitloc, force, endpoint, dir;
+       entity ent, endent;
+       float endq3surfaceflags;
        float totaldmg;
        entity o;
 
@@ -541,6 +541,48 @@ void fireBullet (vector start, vector dir, float spread, float damage, float for
        trace_endpos = end;
 }
 
+float W_CheckProjectileDamage(entity inflictor, entity projowner, float deathtype, float exception)
+{
+       float is_from_contents = (deathtype == DEATH_SLIME || deathtype == DEATH_LAVA);
+       float is_from_owner = (inflictor == projowner);
+       float is_from_exception = (exception != -1);
+       
+       //print(strcat("from_contents ", ftos(is_from_contents), " : from_owner ", ftos(is_from_owner), " : exception ", strcat(ftos(is_from_exception), " (", ftos(exception), "). \n")));
+
+       if(autocvar_g_projectiles_damage <= -2)
+       {
+               return FALSE; // no damage to projectiles at all, not even with the exceptions
+       }
+       else if(autocvar_g_projectiles_damage == -1)
+       {
+               if(is_from_exception)
+                       return (exception); // if exception is detected, allow it to override
+               else
+                       return FALSE; // otherwise, no other damage is allowed
+       }
+       else if(autocvar_g_projectiles_damage == 0)
+       {
+               if(is_from_exception)
+                       return (exception); // if exception is detected, allow it to override
+               else if not(is_from_contents)
+                       return FALSE; // otherwise, only allow damage from contents
+       }       
+       else if(autocvar_g_projectiles_damage == 1)
+       {
+               if(is_from_exception)
+                       return (exception); // if exception is detected, allow it to override
+               else if not(is_from_contents || is_from_owner)
+                       return FALSE; // otherwise, only allow self damage and damage from contents
+       }
+       else if(autocvar_g_projectiles_damage == 2) // allow any damage, but override for exceptions
+       {
+               if(is_from_exception)
+                       return (exception); // if exception is detected, allow it to override
+       }
+
+       return TRUE; // if none of these return, then allow damage anyway.
+}
+
 void W_PrepareExplosionByDamage(entity attacker, void() explode)
 {
        self.takedamage = DAMAGE_NO;
index aa72d8ec1736590dc0c1bb42b8f2489d289a7bea..0b3118bb606cea52a6c5115e5bf437ea0a313b6e 100644 (file)
@@ -315,9 +315,9 @@ void W_Crylink_Fadethink (void)
 
 void W_Crylink_Attack (void)
 {
-       local float counter, shots;
-       local entity proj, prevproj, firstproj;
-       local vector s;
+       float counter, shots;
+       entity proj, prevproj, firstproj;
+       vector s;
        vector forward, right, up;
        float maxdmg;
 
@@ -425,8 +425,8 @@ void W_Crylink_Attack (void)
 
 void W_Crylink_Attack2 (void)
 {
-       local float counter, shots;
-       local entity proj, prevproj, firstproj;
+       float counter, shots;
+       entity proj, prevproj, firstproj;
        float maxdmg;
 
        W_DecreaseAmmo(ammo_cells, autocvar_g_balance_crylink_secondary_ammo, autocvar_g_balance_crylink_reload_ammo);
@@ -634,7 +634,7 @@ float w_crylink(float req)
                W_Reload(min(autocvar_g_balance_crylink_primary_ammo, autocvar_g_balance_crylink_secondary_ammo), autocvar_g_balance_crylink_reload_ammo, autocvar_g_balance_crylink_reload_time, "weapons/reload.wav");
        }
        return TRUE;
-};
+}
 #endif
 #ifdef CSQC
 float w_crylink(float req)
index e51b1a826673180c7614a7f52251cf767146c284..c52043b9775b5b5e9702de536ca70fb699aa97e4 100644 (file)
@@ -9,7 +9,7 @@ void W_Plasma_Explode_Combo (void);
 
 void W_Plasma_TriggerCombo(vector org, float rad, entity own)
 {
-       local entity e;
+       entity e;
        e = WarpZone_FindRadius(org, rad, TRUE);
        while (e)
        {
@@ -83,13 +83,19 @@ void W_Plasma_Damage (entity inflictor, entity attacker, float damage, float dea
 {
        if(self.health <= 0)
                return;
+
        // note: combos are usually triggered by W_Plasma_TriggerCombo, not damage
+       float is_combo = (inflictor.classname == "plasma_chain" || inflictor.classname == "plasma_prim");
+       
+       if (!W_CheckProjectileDamage(inflictor.realowner, self.realowner, deathtype, (is_combo ? 1 : -1)))
+               return; // g_projectiles_damage says to halt    
+       
        self.health = self.health - damage;
        if (self.health <= 0)
        {
                self.takedamage = DAMAGE_NO;
                self.nextthink = time;
-               if (inflictor.classname == "plasma_chain" || inflictor.classname == "plasma_prim")
+               if (is_combo)
                {
                        // change owner to whoever caused the combo explosion
                        self.realowner = inflictor.realowner;
@@ -108,7 +114,7 @@ void W_Plasma_Damage (entity inflictor, entity attacker, float damage, float dea
 
 void W_Electro_Attack()
 {
-       local entity proj;
+       entity proj;
 
        W_DecreaseAmmo(ammo_cells, autocvar_g_balance_electro_primary_ammo, autocvar_g_balance_electro_reload_ammo);
 
@@ -142,7 +148,7 @@ void W_Electro_Attack()
 
 void W_Electro_Attack2()
 {
-       local entity proj;
+       entity proj;
 
        W_DecreaseAmmo(ammo_cells, autocvar_g_balance_electro_secondary_ammo, autocvar_g_balance_electro_reload_ammo);
 
@@ -175,6 +181,7 @@ void W_Electro_Attack2()
        proj.health = autocvar_g_balance_electro_secondary_health;
        proj.event_damage = W_Plasma_Damage;
        proj.flags = FL_PROJECTILE;
+       proj.damagedbycontents = (autocvar_g_balance_electro_secondary_damagedbycontents);
 
        proj.bouncefactor = autocvar_g_balance_electro_secondary_bouncefactor;
        proj.bouncestop = autocvar_g_balance_electro_secondary_bouncestop;
@@ -531,7 +538,7 @@ float w_electro(float req)
                W_Reload(min(autocvar_g_balance_electro_primary_ammo, autocvar_g_balance_electro_secondary_ammo), autocvar_g_balance_electro_reload_ammo, autocvar_g_balance_electro_reload_time, "weapons/reload.wav");
        }
        return TRUE;
-};
+}
 #endif
 #ifdef CSQC
 float w_electro(float req)
index 9469c354dbf24d8f5262fccb8bb0011e61c81c9a..3cc484da9c9beaaec33fb179cd9be34de25d6807 100644 (file)
@@ -115,6 +115,10 @@ void W_Fireball_Damage (entity inflictor, entity attacker, float damage, float d
 {
        if(self.health <= 0)
                return;
+               
+       if (!W_CheckProjectileDamage(inflictor.realowner, self.realowner, deathtype, -1)) // no exceptions
+               return; // g_projectiles_damage says to halt
+               
        self.health = self.health - damage;
        if (self.health <= 0)
        {
@@ -125,7 +129,7 @@ void W_Fireball_Damage (entity inflictor, entity attacker, float damage, float d
 
 void W_Fireball_Attack1()
 {
-       local entity proj;
+       entity proj;
 
        W_SetupShot_ProjectileSize (self, '-16 -16 -16', '16 16 16', FALSE, 2, "weapons/fireball_fire2.wav", CH_WEAPON_A, autocvar_g_balance_fireball_primary_damage + autocvar_g_balance_fireball_primary_bfgdamage);
 
@@ -241,7 +245,7 @@ void W_Firemine_Touch (void)
 
 void W_Fireball_Attack2()
 {
-       local entity proj;
+       entity proj;
        vector f_diff;
        float c;
 
@@ -387,7 +391,7 @@ float w_fireball(float req)
                W_Reload(min(autocvar_g_balance_fireball_primary_ammo, autocvar_g_balance_fireball_secondary_ammo), autocvar_g_balance_fireball_reload_ammo, autocvar_g_balance_fireball_reload_time, "weapons/reload.wav");
        }
        return TRUE;
-};
+}
 #endif
 #ifdef CSQC
 float w_fireball(float req)
index a9d1246448f784661490a2d176c1e2635d5eed3d..bb073a988cd2ae1c6daaf3fd28543d9490c28b40 100644 (file)
@@ -49,11 +49,14 @@ void W_Grenade_Damage (entity inflictor, entity attacker, float damage, float de
 {
        if (self.health <= 0)
                return;
+               
+       if (!W_CheckProjectileDamage(inflictor.realowner, self.realowner, deathtype, -1)) // no exceptions
+               return; // g_projectiles_damage says to halt
+               
        self.health = self.health - damage;
+       
        if (self.health <= 0)
-       {
-               W_PrepareExplosionByDamage(attacker, self.think);
-       }
+               W_PrepareExplosionByDamage(attacker, self.use);
 }
 
 void W_Grenade_Think1 (void)
@@ -164,7 +167,7 @@ void W_Grenade_Touch2 (void)
 
 void W_Grenade_Attack (void)
 {
-       local entity gren;
+       entity gren;
 
        W_DecreaseAmmo(ammo_rockets, autocvar_g_balance_grenadelauncher_primary_ammo, autocvar_g_balance_grenadelauncher_reload_ammo);
 
@@ -196,6 +199,7 @@ void W_Grenade_Attack (void)
        gren.health = autocvar_g_balance_grenadelauncher_primary_health;
        gren.damageforcescale = autocvar_g_balance_grenadelauncher_primary_damageforcescale;
        gren.event_damage = W_Grenade_Damage;
+       gren.damagedbycontents = TRUE;
        W_SETUPPROJECTILEVELOCITY_UP(gren, g_balance_grenadelauncher_primary);
 
        gren.angles = vectoangles (gren.velocity);
@@ -211,7 +215,7 @@ void W_Grenade_Attack (void)
 
 void W_Grenade_Attack2 (void)
 {
-       local entity gren;
+       entity gren;
 
        W_DecreaseAmmo(ammo_rockets, autocvar_g_balance_grenadelauncher_secondary_ammo, autocvar_g_balance_grenadelauncher_reload_ammo);
 
@@ -242,6 +246,7 @@ void W_Grenade_Attack2 (void)
        gren.health = autocvar_g_balance_grenadelauncher_secondary_health;
        gren.damageforcescale = autocvar_g_balance_grenadelauncher_secondary_damageforcescale;
        gren.event_damage = W_Grenade_Damage;
+       gren.damagedbycontents = TRUE;
        W_SETUPPROJECTILEVELOCITY_UP(gren, g_balance_grenadelauncher_secondary);
 
        gren.angles = vectoangles (gren.velocity);
@@ -360,7 +365,7 @@ float w_glauncher(float req)
                W_Reload(min(autocvar_g_balance_grenadelauncher_primary_ammo, autocvar_g_balance_grenadelauncher_secondary_ammo), autocvar_g_balance_grenadelauncher_reload_ammo, autocvar_g_balance_grenadelauncher_reload_time, "weapons/reload.wav");
        }
        return TRUE;
-};
+}
 #endif
 #ifdef CSQC
 float w_glauncher(float req)
index 1952607b823e04838f4f4b671a97a009d4a844f9..12abae6eac7463294df678d82cf4e496263665e1 100644 (file)
@@ -20,6 +20,30 @@ void W_Hagar_Explode2 (void)
        remove (self);
 }
 
+void W_Hagar_Damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+{
+       if (self.health <= 0)
+               return;
+               
+       float is_linkexplode = ((inflictor.realowner == self.realowner) 
+               && (inflictor.projectiledeathtype & HITTYPE_SECONDARY) 
+               && (self.projectiledeathtype & HITTYPE_SECONDARY));
+       
+       if(is_linkexplode)
+               is_linkexplode = (is_linkexplode && autocvar_g_balance_hagar_secondary_load_linkexplode);
+       else
+               is_linkexplode = -1; // not secondary load, so continue as normal without exception.
+               
+       if (!W_CheckProjectileDamage(inflictor.realowner, self.realowner, deathtype, is_linkexplode))
+               return; // g_projectiles_damage says to halt
+
+       self.health = self.health - damage;
+       self.angles = vectoangles(self.velocity);
+       
+       if (self.health <= 0)
+               W_PrepareExplosionByDamage(attacker, self.think);
+}
+
 void W_Hagar_Touch (void)
 {
        PROJECTILE_TOUCH;
@@ -43,7 +67,7 @@ void W_Hagar_Touch2 (void)
 
 void W_Hagar_Attack (void)
 {
-       local entity missile;
+       entity missile;
 
        W_DecreaseAmmo(ammo_rockets, autocvar_g_balance_hagar_primary_ammo, autocvar_g_balance_hagar_reload_ammo);
 
@@ -56,6 +80,13 @@ void W_Hagar_Attack (void)
        missile.classname = "missile";
        missile.bot_dodge = TRUE;
        missile.bot_dodgerating = autocvar_g_balance_hagar_primary_damage;
+       
+       missile.takedamage = DAMAGE_YES;
+       missile.health = autocvar_g_balance_hagar_primary_health;
+       missile.damageforcescale = autocvar_g_balance_hagar_primary_damageforcescale;
+       missile.event_damage = W_Hagar_Damage;
+       missile.damagedbycontents = TRUE;
+       
        missile.touch = W_Hagar_Touch;
        missile.use = W_Hagar_Explode;
        missile.think = adaptor_think2use_hittype_splash;
@@ -78,7 +109,7 @@ void W_Hagar_Attack (void)
 
 void W_Hagar_Attack2 (void)
 {
-       local entity missile;
+       entity missile;
 
        W_DecreaseAmmo(ammo_rockets, autocvar_g_balance_hagar_secondary_ammo, autocvar_g_balance_hagar_reload_ammo);
 
@@ -91,6 +122,13 @@ void W_Hagar_Attack2 (void)
        missile.classname = "missile";
        missile.bot_dodge = TRUE;
        missile.bot_dodgerating = autocvar_g_balance_hagar_secondary_damage;
+       
+       missile.takedamage = DAMAGE_YES;
+       missile.health = autocvar_g_balance_hagar_secondary_health;
+       missile.damageforcescale = autocvar_g_balance_hagar_secondary_damageforcescale;
+       missile.event_damage = W_Hagar_Damage;
+       missile.damagedbycontents = TRUE;
+
        missile.touch = W_Hagar_Touch2;
        missile.cnt = 0;
        missile.use = W_Hagar_Explode2;
@@ -112,14 +150,14 @@ void W_Hagar_Attack2 (void)
        other = missile; MUTATOR_CALLHOOK(EditProjectile);
 }
 
-.float hagar_loadstep, hagar_loadblock, hagar_loadbeep;
+.float hagar_loadstep, hagar_loadblock, hagar_loadbeep, hagar_warning;
 void W_Hagar_Attack2_Load_Release (void)
 {
        // time to release the rockets we've loaded
 
-       local entity missile;
-       local float counter, shots, spread_pershot;
-       local vector s;
+       entity missile;
+       float counter, shots, spread_pershot;
+       vector s;
        vector forward, right, up;
 
        if(!self.hagar_load)
@@ -143,13 +181,19 @@ void W_Hagar_Attack2_Load_Release (void)
                missile.classname = "missile";
                missile.bot_dodge = TRUE;
                missile.bot_dodgerating = autocvar_g_balance_hagar_secondary_damage;
+               
+               missile.takedamage = DAMAGE_YES;
+               missile.health = autocvar_g_balance_hagar_secondary_health;
+               missile.damageforcescale = autocvar_g_balance_hagar_secondary_damageforcescale;
+               missile.event_damage = W_Hagar_Damage;
+               missile.damagedbycontents = TRUE;
 
                missile.touch = W_Hagar_Touch; // not bouncy
                missile.use = W_Hagar_Explode2;
                missile.think = adaptor_think2use_hittype_splash;
                missile.nextthink = time + autocvar_g_balance_hagar_secondary_lifetime_min + random() * autocvar_g_balance_hagar_secondary_lifetime_rand;
                PROJECTILE_MAKETRIGGER(missile);
-               missile.projectiledeathtype = WEP_HAGAR;
+               missile.projectiledeathtype = WEP_HAGAR | HITTYPE_SECONDARY;
                setorigin (missile, w_shotorg);
                setsize(missile, '0 0 0', '0 0 0');
                missile.movetype = MOVETYPE_FLY;
@@ -183,7 +227,7 @@ void W_Hagar_Attack2_Load_Release (void)
                counter = counter + 1;
        }
 
-       weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_hagar_secondary_refire, w_ready);
+       weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_hagar_secondary_load_animtime, w_ready);
        self.hagar_loadstep = time + autocvar_g_balance_hagar_secondary_refire * W_WeaponRateFactor();
        self.hagar_load = 0;
 }
@@ -192,7 +236,7 @@ void W_Hagar_Attack2_Load (void)
 {
        // loadable hagar secondary attack, must always run each frame
 
-       local float loaded, enough_ammo;
+       float loaded, enough_ammo;
        loaded = self.hagar_load >= autocvar_g_balance_hagar_secondary_load_max;
 
        // this is different than WR_CHECKAMMO when it comes to reloading
@@ -230,9 +274,12 @@ void W_Hagar_Attack2_Load (void)
                                        W_DecreaseAmmo(ammo_rockets, autocvar_g_balance_hagar_secondary_ammo, autocvar_g_balance_hagar_reload_ammo);
                                        self.weaponentity.state = WS_INUSE;
                                        self.hagar_load += 1;
-                                       sound(self, CH_WEAPON_B, "weapons/hagar_load.wav", VOL_BASE, ATTN_NORM);
+                                       sound(self, CH_WEAPON_B, "weapons/hagar_load.wav", VOL_BASE * 0.8, ATTN_NORM); // sound is too loud according to most
 
-                                       self.hagar_loadstep = time + autocvar_g_balance_hagar_secondary_load_speed * W_WeaponRateFactor();
+                                       if (self.hagar_load >= autocvar_g_balance_hagar_secondary_load_max)
+                                               self.hagar_loadstep = time + autocvar_g_balance_hagar_secondary_load_hold * W_WeaponRateFactor();
+                                       else
+                                               self.hagar_loadstep = time + autocvar_g_balance_hagar_secondary_load_speed * W_WeaponRateFactor();
                                }
                        }
                        else if(!self.hagar_loadbeep && self.hagar_load) // prevents the beep from playing each frame
@@ -251,7 +298,19 @@ void W_Hagar_Attack2_Load (void)
 
        if(self.hagar_load)
        {
-               if(!self.BUTTON_ATCK2 || ((loaded || !enough_ammo) && self.hagar_loadstep < time && !autocvar_g_balance_hagar_secondary_load_hold))
+               // play warning sound if we're about to release
+               if((loaded || !enough_ammo) && self.hagar_loadstep - 0.5 < time && autocvar_g_balance_hagar_secondary_load_hold >= 0)
+               {
+                       if(!self.hagar_warning && self.hagar_load) // prevents the beep from playing each frame
+                       {
+                               // we're about to automatically release after holding time, play a beep sound to notify the player
+                               sound(self, CH_WEAPON_A, "weapons/hagar_beep.wav", VOL_BASE, ATTN_NORM);
+                               self.hagar_warning = TRUE;
+                       }
+               }
+               
+               // release if player let go of button or if they've held it in too long
+               if(!self.BUTTON_ATCK2 || ((loaded || !enough_ammo) && self.hagar_loadstep < time && autocvar_g_balance_hagar_secondary_load_hold >= 0))
                {
                        self.weaponentity.state = WS_READY;
                        W_Hagar_Attack2_Load_Release();
@@ -260,6 +319,7 @@ void W_Hagar_Attack2_Load (void)
        else
        {
                self.hagar_loadbeep = FALSE;
+               self.hagar_warning = FALSE;
        }
 
        // we aren't checking ammo during an attack, so we must do it here
@@ -289,7 +349,7 @@ float w_hagar(float req)
                }
        else if (req == WR_THINK)
        {
-               local float loadable_secondary;
+               float loadable_secondary;
                loadable_secondary = autocvar_g_balance_hagar_secondary_load && autocvar_g_balance_hagar_secondary;
 
                if (loadable_secondary)
@@ -372,7 +432,7 @@ float w_hagar(float req)
                        W_Reload(min(autocvar_g_balance_hagar_primary_ammo, autocvar_g_balance_hagar_secondary_ammo), autocvar_g_balance_hagar_reload_ammo, autocvar_g_balance_hagar_reload_time, "weapons/reload.wav");
        }
        return TRUE;
-};
+}
 #endif
 #ifdef CSQC
 float w_hagar(float req)
index 0a163e2f98affc699d87da07e3ddcb69b0a8dd2d..c8ea61ed6b3a2128bfd43e1baab2ab8b8f06421d 100644 (file)
@@ -19,7 +19,7 @@ void W_HLAC_Touch (void)
 
 void W_HLAC_Attack (void)
 {
-       local entity missile;
+       entity missile;
     float spread;
 
        W_DecreaseAmmo(ammo_cells, autocvar_g_balance_hlac_primary_ammo, autocvar_g_balance_hlac_reload_ammo);
@@ -68,7 +68,7 @@ void W_HLAC_Attack (void)
 
 void W_HLAC_Attack2f (void)
 {
-       local entity missile;
+       entity missile;
     float spread;
 
     spread = autocvar_g_balance_hlac_secondary_spread;
@@ -153,7 +153,7 @@ void HLAC_fire1_02()
        {
                weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_hlac_primary_animtime, w_ready);
        }
-};
+}
 
 void spawnfunc_weapon_hlac (void)
 {
@@ -219,7 +219,7 @@ float w_hlac(float req)
                W_Reload(min(autocvar_g_balance_hlac_primary_ammo, autocvar_g_balance_hlac_secondary_ammo), autocvar_g_balance_hlac_reload_ammo, autocvar_g_balance_hlac_reload_time, "weapons/reload.wav");
        }
        return TRUE;
-};
+}
 #endif
 #ifdef CSQC
 float w_hlac(float req)
index 754ffff909bf1a90a75976f115e86d70f8c9bef5..6feacc7d5ef01c2478800e277e25677348cef085 100644 (file)
@@ -52,6 +52,20 @@ void W_Hook_Explode2 (void)
        self.movetype = MOVETYPE_NONE;
 }
 
+void W_Hook_Damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+{
+       if (self.health <= 0)
+               return;
+               
+       if (!W_CheckProjectileDamage(inflictor.realowner, self.realowner, deathtype, -1)) // no exceptions
+               return; // g_projectiles_damage says to halt    
+       
+       self.health = self.health - damage;
+       
+       if (self.health <= 0)
+               W_PrepareExplosionByDamage(self.realowner, W_Hook_Explode2);
+}
+
 void W_Hook_Touch2 (void)
 {
        PROJECTILE_TOUCH;
@@ -60,7 +74,7 @@ void W_Hook_Touch2 (void)
 
 void W_Hook_Attack2()
 {
-       local entity gren;
+       entity gren;
 
        W_DecreaseAmmo(ammo_cells, autocvar_g_balance_hook_secondary_ammo, FALSE);
        W_SetupShot (self, FALSE, 4, "weapons/hookbomb_fire.wav", CH_WEAPON_A, autocvar_g_balance_hook_secondary_damage);
@@ -80,6 +94,12 @@ void W_Hook_Attack2()
        gren.think = adaptor_think2use_hittype_splash;
        gren.use = W_Hook_Explode2;
        gren.touch = W_Hook_Touch2;
+       
+       gren.takedamage = DAMAGE_YES;
+       gren.health = autocvar_g_balance_hook_secondary_health;
+       gren.damageforcescale = autocvar_g_balance_hook_secondary_damageforcescale;
+       gren.event_damage = W_Hook_Damage;
+       gren.damagedbycontents = TRUE;
 
        gren.velocity = '0 0 1' * autocvar_g_balance_hook_secondary_speed;
        if(autocvar_g_projectiles_newton_style)
@@ -245,7 +265,7 @@ float w_hook(float req)
                self.hook_refire = time;
        }
        return TRUE;
-};
+}
 #endif
 #ifdef CSQC
 float w_hook(float req)
index fa52a6e0dfb6ad2f7877538874af8333eefb2621..3da9e422b5c377799d9556013c41a2b2d3dfaaa8 100644 (file)
@@ -31,7 +31,7 @@ void W_Laser_Think()
 
 void W_Laser_Attack (float issecondary)
 {
-       local entity missile;
+       entity missile;
        vector s_forward;
        float a;
        float nodamage;
@@ -215,8 +215,8 @@ void spawnfunc_weapon_laser (void)
 
 float w_laser(float req)
 {
-       local float r1;
-       local float r2;
+       float r1;
+       float r2;
        if (req == WR_AIM)
        {
                if(autocvar_g_balance_laser_secondary)
@@ -291,7 +291,7 @@ float w_laser(float req)
                W_Reload(0, autocvar_g_balance_laser_reload_ammo, autocvar_g_balance_laser_reload_time, "weapons/reload.wav");
        }
        return TRUE;
-};
+}
 #endif
 #ifdef CSQC
 float w_laser(float req)
index cf970ae9f785f2bba64dbeb8a11a1936bddbcbe4..03c2651289418644b01006f2f62ef30c42a06a78 100644 (file)
@@ -38,6 +38,7 @@ void W_Mine_Stick (entity to)
        newmine.health = self.health;
        newmine.event_damage = self.event_damage;
        newmine.spawnshieldtime = self.spawnshieldtime;
+       newmine.damagedbycontents = TRUE;
 
        newmine.movetype = MOVETYPE_NONE; // lock the mine in place
        newmine.projectiledeathtype = self.projectiledeathtype;
@@ -241,8 +242,15 @@ void W_Mine_Damage (entity inflictor, entity attacker, float damage, float death
 {
        if (self.health <= 0)
                return;
+               
+       float is_from_enemy = (inflictor.realowner != self.realowner);
+               
+       if (!W_CheckProjectileDamage(inflictor.realowner, self.realowner, deathtype, (is_from_enemy ? 1 : -1)))
+               return; // g_projectiles_damage says to halt
+               
        self.health = self.health - damage;
        self.angles = vectoangles(self.velocity);
+       
        if (self.health <= 0)
                W_PrepareExplosionByDamage(attacker, W_Mine_Explode);
 }
@@ -284,6 +292,7 @@ void W_Mine_Attack (void)
        mine.damageforcescale = autocvar_g_balance_minelayer_damageforcescale;
        mine.health = autocvar_g_balance_minelayer_health;
        mine.event_damage = W_Mine_Damage;
+       mine.damagedbycontents = TRUE;
 
        mine.movetype = MOVETYPE_TOSS;
        PROJECTILE_MAKETRIGGER(mine);
@@ -502,7 +511,7 @@ float w_minelayer(float req)
                W_Reload(autocvar_g_balance_minelayer_ammo, autocvar_g_balance_minelayer_reload_ammo, autocvar_g_balance_minelayer_reload_time, "weapons/reload.wav");
        }
        return TRUE;
-};
+}
 #endif
 #ifdef CSQC
 float w_minelayer(float req)
index 10014a7e1b2fb7f794a24b6fdef0c21f79eb9d9f..6901e2b2d38b822c2972941fb81abff5321c0e09 100644 (file)
@@ -272,7 +272,7 @@ float w_minstanex(float req)
                W_Reload(used_ammo, autocvar_g_balance_minstanex_reload_ammo, autocvar_g_balance_minstanex_reload_time, "weapons/reload.wav");
        }
        return TRUE;
-};
+}
 #endif
 #ifdef CSQC
 float w_minstanex(float req)
index 802298912d96eb774796b893d222705f92eeb754..994864dce0fcd227198bcb90ca07771580ed2de1 100644 (file)
@@ -232,7 +232,7 @@ float w_nex(float req)
        }
 
        return TRUE;
-};
+}
 #endif
 #ifdef CSQC
 float w_nex(float req)
index 4d3b8588ecd90ac21f49b9eddf3499233ade491b..fb8e427cc141c67d64dee696496b431fa72549b1 100644 (file)
@@ -156,7 +156,7 @@ void W_Porto_Touch (void)
 
 void W_Porto_Attack (void)
 {
-       local entity gren;
+       entity gren;
 
        if not(self.items & IT_UNLIMITED_SUPERWEAPONS)
                self.weapons = self.weapons - (self.weapons & WEPBIT_PORTO);
@@ -279,7 +279,7 @@ float w_porto(float req)
                self.porto_current = world;
        }
        return TRUE;
-};
+}
 #endif
 #ifdef CSQC
 float w_porto(float req)
index 941a528a4b0b4fa9eac087b0222cc3c4d60b9d93..43f8a6cfb334b2a462eb65c66618616f6bcb8766 100644 (file)
@@ -201,7 +201,7 @@ float w_rifle(float req)
                W_Reload(min(autocvar_g_balance_rifle_primary_ammo, autocvar_g_balance_rifle_secondary_ammo), autocvar_g_balance_rifle_reload_ammo, autocvar_g_balance_rifle_reload_time, "weapons/reload.wav");
        }
        return TRUE;
-};
+}
 #endif
 #ifdef CSQC
 float w_rifle(float req)
index 4da611e7263dc023953dbce8ff8408e1db7535f2..11b39527ede1326f9f3e2cf42d553f02a50c728c 100644 (file)
@@ -238,16 +238,21 @@ void W_Rocket_Damage (entity inflictor, entity attacker, float damage, float dea
 {
        if (self.health <= 0)
                return;
+       
+       if (!W_CheckProjectileDamage(inflictor.realowner, self.realowner, deathtype, -1)) // no exceptions
+               return; // g_projectiles_damage says to halt
+               
        self.health = self.health - damage;
        self.angles = vectoangles(self.velocity);
+       
        if (self.health <= 0)
                W_PrepareExplosionByDamage(attacker, W_Rocket_Explode);
 }
 
 void W_Rocket_Attack (void)
 {
-       local entity missile;
-       local entity flash;
+       entity missile;
+       entity flash;
 
        W_DecreaseAmmo(ammo_rockets, autocvar_g_balance_rocketlauncher_ammo, autocvar_g_balance_rocketlauncher_reload_ammo);
 
@@ -270,6 +275,7 @@ void W_Rocket_Attack (void)
        missile.damageforcescale = autocvar_g_balance_rocketlauncher_damageforcescale;
        missile.health = autocvar_g_balance_rocketlauncher_health;
        missile.event_damage = W_Rocket_Damage;
+       missile.damagedbycontents = TRUE;
 
        missile.movetype = MOVETYPE_FLY;
        PROJECTILE_MAKETRIGGER(missile);
@@ -314,9 +320,9 @@ float w_rlauncher(float req)
                if(skill >= 2) // skill 0 and 1 bots won't detonate rockets!
                {
                        // decide whether to detonate rockets
-                       local entity missile, targetlist, targ;
-                       local float edgedamage, coredamage, edgeradius, recipricoledgeradius, d;
-                       local float selfdamage, teamdamage, enemydamage;
+                       entity missile, targetlist, targ;
+                       float edgedamage, coredamage, edgeradius, recipricoledgeradius, d;
+                       float selfdamage, teamdamage, enemydamage;
                        edgedamage = autocvar_g_balance_rocketlauncher_edgedamage;
                        coredamage = autocvar_g_balance_rocketlauncher_damage;
                        edgeradius = autocvar_g_balance_rocketlauncher_radius;
@@ -349,7 +355,7 @@ float w_rlauncher(float req)
                                }
                                missile = find(missile, classname, "rocket");
                        }
-                       local float desirabledamage;
+                       float desirabledamage;
                        desirabledamage = enemydamage;
                        if (time > self.invincible_finished && time > self.spawnshieldtime)
                                desirabledamage = desirabledamage - selfdamage * autocvar_g_balance_selfdamagepercent;
@@ -378,7 +384,7 @@ float w_rlauncher(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 rocket spawnfunc_light to see if the rocket gets near a player
                                        if(v_forward * normalize(missile.origin - self.enemy.origin)< 0.1)
@@ -480,7 +486,7 @@ float w_rlauncher(float req)
                W_Reload(autocvar_g_balance_rocketlauncher_ammo, autocvar_g_balance_rocketlauncher_reload_ammo, autocvar_g_balance_rocketlauncher_reload_time, "weapons/reload.wav");
        }
        return TRUE;
-};
+}
 #endif
 #ifdef CSQC
 float w_rlauncher(float req)
index a110c003fdada021479974cbf2b057668d88026e..83a374ea7d213cb22c397b41ac59d9a4bf2fc6de 100644 (file)
@@ -124,6 +124,9 @@ void Seeker_Missile_Damage (entity inflictor, entity attacker, float damage, flo
 {
        if (self.health <= 0)
                return;
+               
+       if (!W_CheckProjectileDamage(inflictor.realowner, self.realowner, deathtype, -1)) // no exceptions
+               return; // g_projectiles_damage says to halt
 
        if (self.realowner == attacker)
                self.health = self.health - (damage * 0.25);
@@ -161,7 +164,7 @@ void Seeker_Missile_Animate()
 
 void Seeker_Fire_Missile(vector f_diff, entity m_target)
 {
-       local entity missile;
+       entity missile;
 
        W_DecreaseAmmo(ammo_rockets, autocvar_g_balance_seeker_missile_ammo, autocvar_g_balance_seeker_reload_ammo);
 
@@ -189,6 +192,7 @@ void Seeker_Fire_Missile(vector f_diff, entity m_target)
        missile.takedamage      = DAMAGE_YES;
        missile.health          = autocvar_g_balance_seeker_missile_health;
        missile.damageforcescale = autocvar_g_balance_seeker_missile_damageforcescale;
+       missile.damagedbycontents = TRUE;
        //missile.think           = Seeker_Missile_Animate; // csqc projectiles.
        
        if (missile.enemy != world)
@@ -231,7 +235,7 @@ void Seeker_Flac_Touch()
 
 void Seeker_Fire_Flac()
 {
-       local entity missile;
+       entity missile;
        vector f_diff;
        float c;
 
@@ -468,7 +472,7 @@ void Seeker_Tag_Touch()
 
 void Seeker_Fire_Tag()
 {
-       local entity missile;
+       entity missile;
        W_DecreaseAmmo(ammo_rockets, autocvar_g_balance_seeker_tag_ammo, autocvar_g_balance_seeker_reload_ammo);
 
        W_SetupShot_ProjectileSize (self, '-2 -2 -2', '2 2 2', FALSE, 2, "weapons/tag_fire.wav", CH_WEAPON_A, autocvar_g_balance_seeker_missile_damage * autocvar_g_balance_seeker_missile_count);
@@ -602,7 +606,7 @@ float w_seeker(float req)
                W_Reload(min(autocvar_g_balance_seeker_missile_ammo, autocvar_g_balance_seeker_tag_ammo), autocvar_g_balance_seeker_reload_ammo, autocvar_g_balance_seeker_reload_time, "weapons/reload.wav");
        }
        return TRUE;
-};
+}
 #endif
 #ifdef CSQC
 float w_seeker(float req)
index 1f097132d84de84acc70fa16375ff6dab115ecaf..2be9e44a6f9c6f091751b95782145a8bc329972f 100644 (file)
@@ -13,7 +13,7 @@ void W_Shotgun_Attack (void)
        float   spread;
        float   bulletspeed;
        float   bulletconstant;
-       local entity flash;
+       entity flash;
 
        ammoamount = autocvar_g_balance_shotgun_primary_ammo;
        bullets = autocvar_g_balance_shotgun_primary_bullets;
@@ -46,52 +46,103 @@ void W_Shotgun_Attack (void)
        W_AttachToShotorg(flash, '5 0 0');
 }
 
-entity lgbeam_owner_ent;
+.float swing_prev;
+.entity swing_alreadyhit;
 void shotgun_meleethink (void)
 {
-       // store time when we started swinging down inside self.cnt
-       if(!self.cnt)
-               self.cnt = time;
-
-       makevectors(self.realowner.v_angle);
-       vector angle;
-       angle = v_forward;
-
-       float meleetime;
-       meleetime = autocvar_g_balance_shotgun_secondary_melee_time * W_WeaponRateFactor();
-
-       // perform trace
-       float f;
-       f = (self.cnt + meleetime - time) / meleetime * 2 - 1;
+       // declarations
+       float i, f, swing, swing_factor, swing_damage, meleetime, is_player;
        vector targpos;
-       targpos = self.realowner.origin + self.realowner.view_ofs + angle * autocvar_g_balance_shotgun_secondary_melee_range + v_right * f * autocvar_g_balance_shotgun_secondary_melee_swing + v_up * f * autocvar_g_balance_shotgun_secondary_melee_swing;
 
-       if(!lgbeam_owner_ent)
+       if(!self.cnt) // set start time of melee
        {
-               lgbeam_owner_ent = spawn();
-               lgbeam_owner_ent.classname = "lgbeam_owner_ent";
+               self.cnt = time; 
+               W_PlayStrengthSound(self.realowner);
        }
-       WarpZone_traceline_antilag(lgbeam_owner_ent, self.realowner.origin + self.realowner.view_ofs, targpos, FALSE, lgbeam_owner_ent, ANTILAG_LATENCY(self.realowner));
 
-       // apply the damage, also remove self
-       if(trace_fraction < 1 && trace_ent.takedamage == DAMAGE_AIM && (trace_ent.classname == "player" || trace_ent.classname == "body"))
+       makevectors(self.realowner.v_angle); // update values for v_* vectors
+       
+       // calculate swing percentage based on time
+       meleetime = autocvar_g_balance_shotgun_secondary_melee_time * W_WeaponRateFactor();
+       swing = bound(0, (self.cnt + meleetime - time) / meleetime, 10);
+       f = ((1 - swing) * autocvar_g_balance_shotgun_secondary_melee_traces);
+       
+       // check to see if we can still continue, otherwise give up now
+       if((self.realowner.deadflag != DEAD_NO) && autocvar_g_balance_shotgun_secondary_melee_no_doubleslap)
        {
-               vector force;
-               force = angle * autocvar_g_balance_shotgun_secondary_force;
-               if(accuracy_isgooddamage(self.realowner, trace_ent))
-                       accuracy_add(self.realowner, WEP_SHOTGUN, 0, autocvar_g_balance_shotgun_secondary_damage * min(1, f + 1));
-               Damage (trace_ent, self.realowner, self.realowner, autocvar_g_balance_shotgun_secondary_damage * min(1, f + 1), WEP_SHOTGUN | HITTYPE_SECONDARY , self.realowner.origin + self.realowner.view_ofs, force);
                remove(self);
+               return;
+       }
+       
+       // if okay, perform the traces needed for this frame 
+       for(i=self.swing_prev; i < f; ++i)
+       {
+               swing_factor = ((1 - (i / autocvar_g_balance_shotgun_secondary_melee_traces)) * 2 - 1);
+               
+               targpos = (self.realowner.origin + self.realowner.view_ofs 
+                       + (v_forward * autocvar_g_balance_shotgun_secondary_melee_range)
+                       + (v_up * swing_factor * autocvar_g_balance_shotgun_secondary_melee_swing_up)
+                       + (v_right * swing_factor * autocvar_g_balance_shotgun_secondary_melee_swing_side));
+
+               WarpZone_traceline_antilag(self.realowner, self.realowner.origin + self.realowner.view_ofs, targpos, FALSE, self.realowner, ANTILAG_LATENCY(self.realowner));
+
+               // draw lightning beams for debugging
+               //te_lightning2(world, targpos, self.realowner.origin + self.realowner.view_ofs + v_forward * 5 - v_up * 5); 
+               //te_customflash(targpos, 40,  2, '1 1 1');
+               
+               is_player = (trace_ent.classname == "player" || trace_ent.classname == "body");
+
+               if((trace_fraction < 1) // if trace is good, apply the damage and remove self
+                       && (trace_ent.takedamage == DAMAGE_AIM)  
+                       && (trace_ent != self.swing_alreadyhit)
+                       && (is_player || autocvar_g_balance_shotgun_secondary_melee_nonplayerdamage))
+               {       
+                       if(is_player) // this allows us to be able to nerf the non-player damage done in e.g. assault or onslaught.
+                               swing_damage = (autocvar_g_balance_shotgun_secondary_damage * min(1, swing_factor + 1));
+                       else
+                               swing_damage = (autocvar_g_balance_shotgun_secondary_melee_nonplayerdamage * min(1, swing_factor + 1));
+                       
+                       Damage(trace_ent, self.realowner, self.realowner, 
+                               swing_damage, WEP_SHOTGUN | HITTYPE_SECONDARY, 
+                               self.realowner.origin + self.realowner.view_ofs, 
+                               v_forward * autocvar_g_balance_shotgun_secondary_force);
+                               
+                       if(accuracy_isgooddamage(self.realowner, trace_ent))
+                               accuracy_add(self.realowner, WEP_SHOTGUN, 0, swing_damage);
+                               
+                       // draw large red flash for debugging
+                       //te_customflash(targpos, 200, 2, '15 0 0');
+                       
+                       if(autocvar_g_balance_shotgun_secondary_melee_multihit) // allow multiple hits with one swing, but not against the same player twice.
+                       {
+                               self.swing_alreadyhit = trace_ent;
+                               continue; // move along to next trace
+                       }
+                       else
+                       {
+                               remove(self);
+                               return;
+                       }
+               }
        }
-       else if(time >= self.cnt + meleetime || (self.realowner.deadflag != DEAD_NO && autocvar_g_balance_shotgun_secondary_melee_no_doubleslap)) // missed or owner died, remove ent
+       
+       if(time >= self.cnt + meleetime)
+       {
+               // melee is finished
                remove(self);
-       else // continue swinging the weapon in hope of hitting someone :)
+               return;
+       }
+       else
+       {
+               // set up next frame 
+               self.swing_prev = i;
                self.nextthink = time;
+       }
 }
 
 void W_Shotgun_Attack2 (void)
 {
-       sound (self, CH_SHOTS, "weapons/shotgun_melee.wav", VOL_BASE, ATTN_NORM);
+       sound (self, CH_WEAPON_A, "weapons/shotgun_melee.wav", VOL_BASE, ATTN_NORM);
        weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_shotgun_secondary_animtime, w_ready);
 
        entity meleetemp;
@@ -144,6 +195,7 @@ float w_shotgun(float req)
                        }
                }
                if (self.clip_load >= 0) // we are not currently reloading
+               if (!self.crouch) // we are not currently crouching; this fixes an exploit where your melee anim is not visible, and besides wouldn't make much sense
                if (self.BUTTON_ATCK2 && autocvar_g_balance_shotgun_secondary)
                if (weapon_prepareattack(1, autocvar_g_balance_shotgun_secondary_refire))
                {
@@ -183,7 +235,7 @@ float w_shotgun(float req)
                W_Reload(autocvar_g_balance_shotgun_primary_ammo, autocvar_g_balance_shotgun_reload_ammo, autocvar_g_balance_shotgun_reload_time, "weapons/reload.wav");
        }
        return TRUE;
-};
+}
 #endif
 #ifdef CSQC
 .float prevric;
index 987e7b41e2570b6480e4d141aa546fcd3dc6ccec..c10d1f544a2d01e67fdef7e2c3b8b396fe53b515 100644 (file)
@@ -78,6 +78,10 @@ float W_Tuba_NoteSendEntity(entity to, float sf)
 {
        float f;
 
+       msg_entity = to;
+       if(!sound_allowed(MSG_ONE, self.realowner))
+               return FALSE;
+
        WriteByte(MSG_ENTITY, ENT_CLIENT_TUBANOTE);
        WriteByte(MSG_ENTITY, sf);
        if(sf & 1)
@@ -141,10 +145,19 @@ void W_Tuba_Attack(float hittype)
 {
        vector o;
        float n;
+
        W_SetupShot(self, FALSE, 2, "", 0, autocvar_g_balance_tuba_damage);
 
        n = Tuba_GetNote(self, hittype);
 
+       hittype = 0;
+       if(self.tuba_instrument & 1)
+               hittype |= HITTYPE_SECONDARY;
+       if(self.tuba_instrument & 2)
+               hittype |= HITTYPE_BOUNCE;
+       if(self.tuba_instrument & 4)
+               hittype |= HITTYPE_HEADSHOT;
+
        if(self.tuba_note)
        {
                if(self.tuba_note.cnt != n || self.tuba_note.tuba_instrument != self.tuba_instrument)
@@ -240,22 +253,20 @@ float w_tuba(float req)
        }
        else if (req == WR_RELOAD)
        {
-               // TODO switch to alternate instruments :)
+               // switch to alternate instruments :)
                if(self.weaponentity.state == WS_READY)
                {
-                       /*
                        switch(self.tuba_instrument)
                        {
                                case 0:
                                        self.tuba_instrument = 1;
-                                       self.weaponname = "laser";
+                                       self.weaponname = "akordeon";
                                        break;
                                case 1:
                                        self.tuba_instrument = 0;
                                        self.weaponname = "tuba";
                                        break;
                        }
-                       */
                        W_SetupShot(self, FALSE, 0, "", 0, 0);
                        pointparticles(particleeffectnum("teleport"), w_shotorg, '0 0 0', 1);
                        self.weaponentity.state = WS_INUSE;
@@ -267,7 +278,7 @@ float w_tuba(float req)
        else if (req == WR_CHECKAMMO2)
                return TRUE; // TODO use fuel?
        return TRUE;
-};
+}
 #endif
 #ifdef CSQC
 float w_tuba(float req)
@@ -282,11 +293,45 @@ float w_tuba(float req)
        }
        else if (req == WR_SUICIDEMESSAGE)
        {
-               w_deathtypestring = _("%s hurt his own ears with the @!#%%'n Tuba");
+               float instr;
+               instr = 0;
+               if(w_deathtype & HITTYPE_SECONDARY)
+                       instr |= 1;
+               if(w_deathtype & HITTYPE_BOUNCE)
+                       instr |= 2;
+               if(w_deathtype & HITTYPE_HEADSHOT)
+                       instr |= 4;
+               switch(instr)
+               {
+                       default:
+                       case 0: // Tuba
+                               w_deathtypestring = _("%s hurt his own ears with the @!#%%'n Tuba");
+                               break;
+                       case 1: // Accordeon
+                               w_deathtypestring = _("%s hurt his own ears with the @!#%%'n Accordeon");
+                               break;
+               }
        }
        else if (req == WR_KILLMESSAGE)
        {
-               w_deathtypestring = _("%s died of %s's great playing on the @!#%%'n Tuba");
+               float instr;
+               instr = 0;
+               if(w_deathtype & HITTYPE_SECONDARY)
+                       instr |= 1;
+               if(w_deathtype & HITTYPE_BOUNCE)
+                       instr |= 2;
+               if(w_deathtype & HITTYPE_HEADSHOT)
+                       instr |= 4;
+               switch(instr)
+               {
+                       default:
+                       case 0: // Tuba
+                               w_deathtypestring = _("%s died of %s's great playing on the @!#%%'n Tuba");
+                               break;
+                       case 1: // Accordeon
+                               w_deathtypestring = _("%s died of %s's great playing on the @!#%%'n Accordeon");
+                               break;
+               }
        }
        return TRUE;
 }
index 71ea1f6f6710d33f25dd833324c15f824fbe8a79..f5bacd22036ea554c2835b434725b0496110b3ad 100644 (file)
@@ -290,7 +290,7 @@ float w_uzi(float req)
                W_Reload(min(max(autocvar_g_balance_uzi_sustained_ammo, autocvar_g_balance_uzi_first_ammo), autocvar_g_balance_uzi_burst_ammo), autocvar_g_balance_uzi_reload_ammo, autocvar_g_balance_uzi_reload_time, "weapons/reload.wav");
        }
        return TRUE;
-};
+}
 #endif
 #ifdef CSQC
 float w_uzi(float req)
index 987fb6d33956d4e7d2f504332208dca3c1302a98..0e62df7cb2cd029a8cd0aa5d183e63f135c1e948 100644 (file)
@@ -127,9 +127,9 @@ void WaypointSprite_FadeOutIn(entity e, float t)
 
 void WaypointSprite_Init()
 {
-       waypointsprite_limitedrange = autocvar_g_waypointsprite_limitedrange;
-       waypointsprite_deployed_lifetime = autocvar_g_waypointsprite_deployed_lifetime;
-       waypointsprite_deadlifetime = autocvar_g_waypointsprite_deadlifetime;
+       waypointsprite_limitedrange = autocvar_sv_waypointsprite_limitedrange;
+       waypointsprite_deployed_lifetime = autocvar_sv_waypointsprite_deployed_lifetime;
+       waypointsprite_deadlifetime = autocvar_sv_waypointsprite_deadlifetime;
 }
 void WaypointSprite_InitClient(entity e)
 {
index 63e3e712ab84fade91945a62dc4bcd1ff0b63c9f..118b4f0f5d439017456802de601805b110a95f37 100644 (file)
@@ -326,6 +326,9 @@ float WarpZone_CheckProjectileImpact(entity player)
                return 0;
 
        print("impactfilter found something - and it even gets handled correctly - please tell divVerent that this code apparently gets triggered again\n");
+       print("Entity type: ", player.classname, "\n");
+       print("Origin: ", vtos(player.origin), "\n");
+       print("Velocity: ", vtos(player.velocity), "\n");
 
        // retry previous move
        setorigin(player, player.warpzone_oldorigin);
diff --git a/scripts/akordeon.shader b/scripts/akordeon.shader
new file mode 100644 (file)
index 0000000..19a3041
--- /dev/null
@@ -0,0 +1,9 @@
+akordeon
+{
+       dpglossexponentmod  64
+       dpreflectcube env/exomorph/exomorph
+       {
+               map models/weapons/akordeon.tga
+               rgbgen lightingDiffuse
+       }
+}
\ No newline at end of file
diff --git a/scripts/gibs.shader b/scripts/gibs.shader
new file mode 100644 (file)
index 0000000..c1c40e5
--- /dev/null
@@ -0,0 +1,111 @@
+meat
+{
+       surfaceparm nomarks
+       {
+               map textures/meat
+       }
+       {
+               map $lightmap
+       }
+}
+
+meat_alien
+{
+       surfaceparm nomarks
+       {
+               map textures/meat_alien
+       }
+       {
+               map $lightmap
+       }
+}
+
+meat_robot
+{
+       surfaceparm nomarks
+       {
+               map textures/meat_robot
+       }
+       {
+               map $lightmap
+       }
+}
+
+eyeblood
+{
+       surfaceparm nomarks
+       {
+               map textures/eyeblood
+       }
+       {
+               map $lightmap
+       }
+}
+
+nutsandbolts1
+{
+       surfaceparm nomarks
+       {
+               map textures/nutsandbolts1
+       }
+       {
+               map $lightmap
+       }
+}
+
+nutsandbolts3
+{
+       surfaceparm nomarks
+       {
+               map textures/nutsandbolts3
+       }
+       {
+               map $lightmap
+       }
+}
+
+nutsandbolts4
+{
+       surfaceparm nomarks
+       {
+               map textures/nutsandbolts4
+       }
+       {
+               map $lightmap
+       }
+}
+
+nutsandbolts5
+{
+       surfaceparm nomarks
+       {
+               map textures/nutsandbolts5
+       }
+       {
+               map $lightmap
+       }
+}
+
+nutsandboltssteel
+{
+       surfaceparm nomarks
+       {
+               map textures/nutsandbolts3
+               tcgen environment
+       }
+       {
+               map $lightmap
+       }
+}
+
+models/gibs/chunk.mdl_0
+{
+       surfaceparm nomarks
+       {
+               map models/gibs/chunk.mdl_0
+               tcgen environment
+       }
+       {
+               map $lightmap
+       }
+}
diff --git a/scripts/nutsandbolts.shader b/scripts/nutsandbolts.shader
deleted file mode 100644 (file)
index e0eb347..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-nutsandboltssteel
-{
-       {
-               map textures/nutsandbolts3
-               tcgen environment
-       }
-       {
-               map $lightmap
-       }
-}
index 006f67dd31a4ae721d9fc90df6830fb5c90c9802..f407aba1536818066149dd82d120ce4ecdb073bb 100644 (file)
@@ -1,3 +1,11 @@
+evil_basewall/mtl_gray
+{
+       {               
+               map textures/exx/base/base_metal01
+               rgbgen lightingDiffuse
+       }
+}
+
 models/turrets/tesla_chrome
 {
 
diff --git a/sound/misc/medplat1.ogg b/sound/misc/medplat1.ogg
deleted file mode 100644 (file)
index 018782c..0000000
Binary files a/sound/misc/medplat1.ogg and /dev/null differ
diff --git a/sound/misc/medplat2.ogg b/sound/misc/medplat2.ogg
deleted file mode 100644 (file)
index 3e7d65b..0000000
Binary files a/sound/misc/medplat2.ogg and /dev/null differ
diff --git a/sound/weapons/tuba1_loopnote-12.ogg b/sound/weapons/tuba1_loopnote-12.ogg
new file mode 100644 (file)
index 0000000..f838b61
Binary files /dev/null and b/sound/weapons/tuba1_loopnote-12.ogg differ
diff --git a/sound/weapons/tuba1_loopnote-18.ogg b/sound/weapons/tuba1_loopnote-18.ogg
new file mode 100644 (file)
index 0000000..53ca26b
Binary files /dev/null and b/sound/weapons/tuba1_loopnote-18.ogg differ
diff --git a/sound/weapons/tuba1_loopnote-6.ogg b/sound/weapons/tuba1_loopnote-6.ogg
new file mode 100644 (file)
index 0000000..4d44467
Binary files /dev/null and b/sound/weapons/tuba1_loopnote-6.ogg differ
diff --git a/sound/weapons/tuba1_loopnote-src.txt b/sound/weapons/tuba1_loopnote-src.txt
new file mode 100644 (file)
index 0000000..91b4300
--- /dev/null
@@ -0,0 +1,47 @@
+r=44642
+
+base=261.6
+ls=$((7646/2))
+le=$((10378/2))
+for n in -18 -12 -6; do
+       this=`echo "440*e(l(2)/12*($n+60-69))" | bc -l`
+       f=`echo "$r * $this / $base + 0.5" | bc -l`
+       f=${f%.*}
+       echo "$r -> $f"
+       if [ "$f" -gt 48000 ]; then
+               o="-r 48000"
+               s=`echo "$ls * 48000 / $f + 0.5" | bc -l`
+               s=${s%.*}
+               e=`echo "$le * 48000 / $f + 0.5" | bc -l`
+               e=${e%.*}
+       else
+               o=
+               s=$ls
+               e=$le
+       fi
+       sox -r "$f" 023_Tango_Accordion-0.wav $o "tuba1_loopnote$n.wav"
+       oggenc -c "LOOP_START=$s" -c "LOOP_END=$e" -q8 -o "tuba1_loopnote$n.ogg" "tuba1_loopnote$n.wav"
+done
+
+base=659.191
+ls=$((6326/2))
+le=$((7140/2))
+for n in 0 6 12 18 24; do
+       this=`echo "440*e(l(2)/12*($n+60-69))" | bc -l`
+       f=`echo "$r * $this / $base + 0.5" | bc -l`
+       f=${f%.*}
+       echo "$r -> $f"
+       if [ "$f" -gt 48000 ]; then
+               o="-r 48000"
+               s=`echo "$ls * 48000 / $f + 0.5" | bc -l`
+               s=${s%.*}
+               e=`echo "$le * 48000 / $f + 0.5" | bc -l`
+               e=${e%.*}
+       else
+               o=
+               s=$ls
+               e=$le
+       fi
+       sox -r "$f" 023_Tango_Accordion-1.wav $o "tuba1_loopnote$n.wav"
+       oggenc -c "LOOP_START=$s" -c "LOOP_END=$e" -q8 -o "tuba1_loopnote$n.ogg" "tuba1_loopnote$n.wav"
+done
diff --git a/sound/weapons/tuba1_loopnote0.ogg b/sound/weapons/tuba1_loopnote0.ogg
new file mode 100644 (file)
index 0000000..b0cd552
Binary files /dev/null and b/sound/weapons/tuba1_loopnote0.ogg differ
diff --git a/sound/weapons/tuba1_loopnote12.ogg b/sound/weapons/tuba1_loopnote12.ogg
new file mode 100644 (file)
index 0000000..dc53a27
Binary files /dev/null and b/sound/weapons/tuba1_loopnote12.ogg differ
diff --git a/sound/weapons/tuba1_loopnote18.ogg b/sound/weapons/tuba1_loopnote18.ogg
new file mode 100644 (file)
index 0000000..122a875
Binary files /dev/null and b/sound/weapons/tuba1_loopnote18.ogg differ
diff --git a/sound/weapons/tuba1_loopnote24.ogg b/sound/weapons/tuba1_loopnote24.ogg
new file mode 100644 (file)
index 0000000..23bd01b
Binary files /dev/null and b/sound/weapons/tuba1_loopnote24.ogg differ
diff --git a/sound/weapons/tuba1_loopnote6.ogg b/sound/weapons/tuba1_loopnote6.ogg
new file mode 100644 (file)
index 0000000..a89fa7e
Binary files /dev/null and b/sound/weapons/tuba1_loopnote6.ogg differ
index 3b5ed662748f9136eadefd83e6a20ab7afe6d64a..de5a5661c9a95aeac814159a2cb0f37b97dcc8cf 100644 (file)
Binary files a/sound/weapons/tuba_loopnote-12.ogg and b/sound/weapons/tuba_loopnote-12.ogg differ
index dda1ed85c19d4fc45d3c8c13f21472eeb9bd6402..df83c9f409500ac7cb3ff03b2933624604a84700 100644 (file)
Binary files a/sound/weapons/tuba_loopnote-18.ogg and b/sound/weapons/tuba_loopnote-18.ogg differ
index 12eae360a4a84fa663c6387c683a61b4a5a44d1d..35c46954c3484319a22e4ad8303e163334d14854 100644 (file)
Binary files a/sound/weapons/tuba_loopnote-6.ogg and b/sound/weapons/tuba_loopnote-6.ogg differ
index e7e601769b61c5c2a1eacd9ca281b0d537c63644..5536ed97cdb58e3fcdafc4e07f3e3e5050b98843 100644 (file)
Binary files a/sound/weapons/tuba_loopnote0.ogg and b/sound/weapons/tuba_loopnote0.ogg differ
index 4a20ee68a4329eaec56a48e8d96bf031c9c9935c..cd6b241ac43471cf3ddd25cce4df30d603a9d069 100644 (file)
Binary files a/sound/weapons/tuba_loopnote12.ogg and b/sound/weapons/tuba_loopnote12.ogg differ
index 3a27ec3707dda29907f71b494344261838420431..8c9ec5ab0608562c0dd7f5e3203ae9ba3c385feb 100644 (file)
Binary files a/sound/weapons/tuba_loopnote18.ogg and b/sound/weapons/tuba_loopnote18.ogg differ
index 927d63a23a9c2ed9f9c2b238e7c9973043d50f31..a271b2a9a1f8d385ecbc9361de81521fd2c4e93b 100644 (file)
Binary files a/sound/weapons/tuba_loopnote24.ogg and b/sound/weapons/tuba_loopnote24.ogg differ
index 664f4a1201e3b4ff8b5725cbe790a44c0b698040..3f72b4aeb2ffdcc60e6280d95a90cabdf85dfaee 100644 (file)
Binary files a/sound/weapons/tuba_loopnote6.ogg and b/sound/weapons/tuba_loopnote6.ogg differ