]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into terencehill/physics_panel_updates
authorterencehill <piuntn@gmail.com>
Thu, 10 Nov 2011 00:57:15 +0000 (01:57 +0100)
committerterencehill <piuntn@gmail.com>
Thu, 10 Nov 2011 00:57:15 +0000 (01:57 +0100)
Conflicts:
defaultXonotic.cfg
qcsrc/client/autocvars.qh

260 files changed:
_hud_common.cfg [new file with mode: 0644]
_hud_descriptions.cfg
balance25.cfg
balanceFruit.cfg
balanceLeeStricklin.cfg
balanceXonotic.cfg
balancetZork.cfg
defaultXPM.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
hud_luminos.cfg
hud_luminos_minimal.cfg
hud_luminos_minimal_xhair.cfg [new file with mode: 0644]
hud_luminos_old.cfg
hud_luminos_xhair_minimal.cfg [deleted file]
hud_nexuiz.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/keys/key.md3 [new file with mode: 0644]
models/keys/key.tga [new file with mode: 0644]
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/Defs.qc
qcsrc/client/Main.qc
qcsrc/client/View.qc
qcsrc/client/announcer.qc [new file with mode: 0644]
qcsrc/client/autocvars.qh
qcsrc/client/ctf.qc
qcsrc/client/damage.qc
qcsrc/client/hud.qc
qcsrc/client/hud.qh
qcsrc/client/hud_config.qc
qcsrc/client/main.qh
qcsrc/client/miscfunctions.qc
qcsrc/client/progs.src
qcsrc/client/projectile.qc
qcsrc/client/scoreboard.qc
qcsrc/client/shownames.qc
qcsrc/client/shownames.qh
qcsrc/client/teamradar.qc
qcsrc/client/tturrets.qc
qcsrc/client/tuba.qc
qcsrc/common/constants.qh
qcsrc/common/mapinfo.qc
qcsrc/common/mapinfo.qh
qcsrc/common/urllib.qc
qcsrc/common/urllib.qh
qcsrc/common/util.qc
qcsrc/common/util.qh
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_multiplayer_playersetup.c
qcsrc/menu/xonotic/dialog_multiplayer_playersetup_waypoint.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/antilag.qc
qcsrc/server/antilag.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/item_key.qc [new file with mode: 0644]
qcsrc/server/item_key.qh [new file with mode: 0644]
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/base.qh
qcsrc/server/mutators/gamemode_keepaway.qc
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/secret.qc [new file with mode: 0644]
qcsrc/server/secret.qh [new file with mode: 0644]
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/racer.qc
qcsrc/server/vehicles/raptor.qc
qcsrc/server/vehicles/spiderbot.qc
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/common.qc
qcsrc/warpzonelib/common.qh
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
vehicle_racer.cfg
vehicle_raptor.cfg
vehicle_spiderbot.cfg

diff --git a/_hud_common.cfg b/_hud_common.cfg
new file mode 100644 (file)
index 0000000..c46bbee
--- /dev/null
@@ -0,0 +1,92 @@
+// hud variables
+set _hud_configure 0 "1 = configure the HUD"
+seta hud_configure_teamcolorforced 0 "1 = force display of team colors in configure mode"
+seta hud_configure_checkcollisions 1 "check for collisions against other panels when in hud configure mode"
+seta hud_configure_bg_minalpha 0.25 "minimum panel background alpha when in hud configure mode"
+seta hud_configure_grid_alpha 0.15 "alpha for visible grid when in configure mode"
+
+seta hud_fontsize 11 "text fontsize for the hud"
+seta hud_width 560 "2D virtual width for the hud"
+
+// general hud panel cvars (i.e. shouldn't be adjusted by a skin config)
+seta hud_panel_weapons_ammo_full_shells 60 "show 100% of the status bar at this ammo count"
+seta hud_panel_weapons_ammo_full_nails 320 "show 100% of the status bar at this ammo count"
+seta hud_panel_weapons_ammo_full_cells 180 "show 100% of the status bar at this ammo count"
+seta hud_panel_weapons_ammo_full_rockets 160 "show 100% of the status bar at this ammo count"
+seta hud_panel_weapons_ammo_full_fuel 100 "show 100% of the status bar at this ammo count"
+
+seta hud_panel_ammo_maxammo "40" "when you have this much ammo, the ammo status bar is full"
+
+seta hud_panel_healtharmor_maxhealth "200" "when you have this much health, the health status bar is full"
+seta hud_panel_healtharmor_maxarmor "200" "when you have this much armor, the armor status bar is full"
+seta hud_panel_healtharmor_progressbar_gfx_damage 5 "show damage effect when damaged at least by this amount; 0 disables the effect"
+seta hud_panel_healtharmor_progressbar_gfx_lowhealth 40 "health progressbar blinks when health is lower than this amount"
+
+seta hud_panel_engineinfo_framecounter_exponentialmovingaverage 1 "use an averaging method for calculating fps instead of counting frametime like engine does"
+seta hud_panel_engineinfo_framecounter_exponentialmovingaverage_new_weight 0.1 "weight of latest data point"
+seta hud_panel_engineinfo_framecounter_exponentialmovingaverage_instantupdate_change_threshold 0.5 "threshold for fps change when to update instantly, to make big fps changes update faster"
+
+// hud panel aliases
+alias hud_panel_radar_rotate "toggle hud_panel_radar_rotation 0 1 2 3 4"
+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"
+
+// other hud cvars
+seta hud_showbinds 1   "what to show in the HUD to indicate certain keys to press: 0 display commands, 1 bound keys, 2 both"
+seta hud_showbinds_limit 2     "maximum number of bound keys to show for a command. 0 for unlimited"
+
+seta hud_colorflash_alpha 0.5 "starting alpha of the color flash"
+
+seta hud_damage 0.55 "an improved version of gl_polyblend for damage, draw an image instead when hurt"
+seta hud_damage_blur 10 "Use postprocessing to blur the screen when you have taken damage. This can be paired with current hud damage or just used alone. Higher values = more blur"
+seta hud_damage_blur_alpha 0.5 "Amount of alpha to use when merging the blurred layers back into the render. Turning this up higher will remove bloom, so it's best to find a balance"
+seta hud_damage_gentle_alpha_multiplier 0.10 "how much to multiply alpha of flash when using the cl_gentle version, it's much more opaque than the non-gentle version"
+seta hud_damage_gentle_color "1 0.7 1" "color of flash for cl_gentle version"
+seta hud_damage_color "1 0 0" "color of flash"
+seta hud_damage_factor 0.025 "(damage * factor) = how much to add to the alpha value"
+seta hud_damage_fade_rate 0.75 "how much to subtract from the alpha value each second"
+seta hud_damage_maxalpha 1.5 "how much to limit the alpha value to"
+seta hud_damage_pain_threshold 0.1 "how much alpha to ignore (must be bigger than the hud_damage_factor so that e.g. rot is ignored)"
+seta hud_damage_pain_threshold_lower 1.25 "how much we lower pain_threshold with when nearing 0 health (if pain_threshold gets negative then we always draw a flash at alpha = fabs(pain_threshold)"
+seta hud_damage_pain_threshold_lower_health 50 "at which health we start lowering pain_threshold"
+seta hud_damage_pain_threshold_pulsating_min 0.6 "minimum value when calculating the pulse: max(pulsating_min, fabs(sin(PI * time / period))"
+seta hud_damage_pain_threshold_pulsating_period 0.8 "one pulse every X seconds"
+
+seta hud_powerup 0 "power of the sharpen effect when owning the shield or strength powerups, default is 0.5"
+
+seta hud_postprocessing 1 "enables the ability for effects such as hud_damage_blur and hud_contents to apply a postprocessing method upon the screen - enabling this disables manual editing of the postprocess cvars"
+seta hud_postprocessing_maxbluralpha 0 "maximum alpha which the blur postprocess can be, default is 0.5"
+seta hud_postprocessing_maxblurradius 8 "maximum radius which the blur postprocess can be, default is 8"
+
+seta hud_contents 1 "an improved version of gl_polyblend for liquids such as water/lava/slime, draw a filler when inside the liquid"
+seta hud_contents_blur 10 "Use postprocessing to blur the screen when you are inside a liquid. Higher values = more blur"
+seta hud_contents_blur_alpha 0.5 "Amount of alpha to use when merging the blurred layers back into the render. Turning this up higher will remove bloom, so it's best to find a balance"
+seta hud_contents_factor 1 "factor at which to multiply the current faded value."
+seta hud_contents_fadeintime 0.02 "factor of time it takes for the alpha level to reach normal value when entering the liquid"
+seta hud_contents_fadeouttime 0.1 "factor of time it takes for the alpha level to reach normal value when leaving the liquid"
+seta hud_contents_lava_alpha 0.7 "alpha of the lava"
+seta hud_contents_lava_color "0.8 0.1 0" "color blend when inside lava"
+seta hud_contents_slime_alpha 0.7 "alpha of the slime" 
+seta hud_contents_slime_color "0 0.4 0.1" "color blend when inside slime"
+seta hud_contents_water_alpha 0.5 "alpha of the water"
+seta hud_contents_water_color "0.4 0.3 0.3" "color blend when inside water"
+
+seta hud_shownames 1 "draw names and health/armor of nearby players"
+seta hud_shownames_enemies 1 "show tags for enemies as well"
+seta hud_shownames_crosshairdistance 0 "if set, only draw tags which came within this distance of your crosshair (25 recommended)"
+seta hud_shownames_crosshairdistance_time 5 "how many seconds the tag is still visible after pointing at them"
+seta hud_shownames_crosshairdistance_antioverlap 0 "allow antioverlap to work as normal even with crosshairdistance on"
+seta hud_shownames_self 0 "also include your own name to be shown when third person camera mode is on (chase_active/cl_eventchase)"
+seta hud_shownames_status 1 "1 = draw health/armor status of teammates"
+seta hud_shownames_statusbar_height 4 "height of status bar"
+seta hud_shownames_aspect 8 "aspect ratio of total drawing area per name"
+seta hud_shownames_fontsize 12 "font size"
+seta hud_shownames_decolorize 1 "1 = decolorize name in team games, 2 = decolorize always"
+seta hud_shownames_alpha 0.7 "alpha"
+seta hud_shownames_resize 1 "enable resizing of the names, then the size cvars will correspond to the maximum size"
+seta hud_shownames_mindistance 1000 "start fading alpha/size at this distance"
+seta hud_shownames_maxdistance 5000 "alpha/size is 0 at this distance"
+seta hud_shownames_antioverlap 1 "if two tags get too close to each other, fade out the one further away from you"
+seta hud_shownames_antioverlap_distance 50 "2d distance to other tag after which to fade out"
+seta hud_shownames_offset 52 "offset (along z-axis) tag from player origin by this many units"
\ No newline at end of file
index 13804214383530983ba25662d8c85d58a4039120..719ccb09cac26d0bb31a402f597bb922dbd5455e 100644 (file)
@@ -42,6 +42,8 @@ seta hud_panel_weapons_bg_border "" "if set to something else than \"\" = overri
 seta hud_panel_weapons_bg_padding "" "if set to something else than \"\" = override default padding of contents from border"
 seta hud_panel_weapons_aspect "" "use this aspect on the items"
 seta hud_panel_weapons_complainbubble "" "complain bubble (out of ammo, weapon not available etc)"
+seta hud_panel_weapons_complainbubble_time "" "time that a new entry stays until it fades out"
+seta hud_panel_weapons_complainbubble_fadetime "" "fade out time"
 seta hud_panel_weapons_complainbubble_padding "" "padding for the complainbubble"
 seta hud_panel_weapons_complainbubble_color_outofammo "" "color of the complainbubble when showing out of ammo message"
 seta hud_panel_weapons_complainbubble_color_donthave "" "color of the complainbubble when showing don't have weapon message"
@@ -50,6 +52,14 @@ seta hud_panel_weapons_ammo_color "" "color of status bar"
 seta hud_panel_weapons_ammo_alpha "" "alpha of status bar"
 seta hud_panel_weapons_timeout "" "panel disappears if you don't switch weapon for this amount of seconds"
 seta hud_panel_weapons_timeout_effect "" "disappearance effect: 0) no effect; 1) panel moves out of screen; 2) panel fades out"
+seta hud_panel_weapons_label "" "1 = show number of weapon, 2 = show bound key of weapon"
+seta hud_panel_weapons_accuracy "" "show accuracy color as the weapon icon background; colors can be configured with accuracy_color* cvars"
+seta hud_panel_weapons_accuracy_color "" "low accuracy color"
+seta hud_panel_weapons_accuracy_color "" "medium accuracy color"
+seta hud_panel_weapons_accuracy_color "" "high accuracy color"
+seta hud_panel_weapons_accuracy_color_levels "" "levels of accuracy (normally 3)"
+seta hud_panel_weapons_ammo "" "show ammo as a status bar"
+seta hud_panel_weapons_onlyowned "" "show only owned weapons"
 
 seta hud_panel_ammo "" "enable/disable this panel"
 seta hud_panel_ammo_pos "" "position of this panel"
@@ -96,10 +106,12 @@ seta hud_panel_healtharmor_bg_color_team "" "override panel color with team colo
 seta hud_panel_healtharmor_bg_alpha "" "if set to something else than \"\" = override default panel background alpha"
 seta hud_panel_healtharmor_bg_border "" "if set to something else than \"\" = override default size of border around the background"
 seta hud_panel_healtharmor_bg_padding "" "if set to something else than \"\" = override default padding of contents from border"
+seta hud_panel_healtharmor_text "" "show text/icons in the healtharmor panel"
 seta hud_panel_healtharmor_progressbar "" "enable progressbar in panel"
 seta hud_panel_healtharmor_progressbar_health "" "progressbar image for health"
 seta hud_panel_healtharmor_progressbar_armor "" "progressbar image for armor"
-seta hud_panel_healtharmor_text "" "show text/icons in the healtharmor panel"
+seta hud_panel_healtharmor_progressbar_gfx "" "enable graphic effects on the progressbars"
+seta hud_panel_healtharmor_progressbar_gfx_smooth "" "smooth changes of the progressbar when health/armor change at least by this amount; 0 disables the effect"
 
 seta hud_panel_notify "" "enable/disable this panel"
 seta hud_panel_notify_pos "" "position of this base of the panel"
@@ -113,6 +125,8 @@ seta hud_panel_notify_bg_padding "" "if set to something else than \"\" = overri
 seta hud_panel_notify_flip "" "order the list top to bottom instead of bottom to top"
 seta hud_panel_notify_fontsize "" "multiplier for the font size used for player names in the panel"
 seta hud_panel_notify_print "" "also con_notify print the messages that are shown on the notify panel"
+seta hud_panel_notify_fadetime "" "fade out time"
+seta hud_panel_notify_time "" "time that a new entry stays until it fades out"
 
 seta hud_panel_timer "" "enable/disable this panel"
 seta hud_panel_timer_pos "" "position of this base of the panel"
@@ -123,6 +137,7 @@ seta hud_panel_timer_bg_color_team "" "override panel color with team color in t
 seta hud_panel_timer_bg_alpha "" "if set to something else than \"\" = override default panel background alpha"
 seta hud_panel_timer_bg_border "" "if set to something else than \"\" = override default size of border around the background"
 seta hud_panel_timer_bg_padding "" "if set to something else than \"\" = override default padding of contents from border"
+seta hud_panel_timer_increment "" "show elapsed time instead of remaining time"
 
 seta hud_panel_radar "" "enable/disable this panel, 2 = also enable in non-teambased gamemodes"
 seta hud_panel_radar_pos "" "position of this base of the panel"
@@ -134,6 +149,11 @@ seta hud_panel_radar_bg_alpha "" "if set to something else than \"\" = override
 seta hud_panel_radar_bg_border "" "if set to something else than \"\" = override default size of border around the background"
 seta hud_panel_radar_bg_padding "" "if set to something else than \"\" = override default padding of contents from border"
 seta hud_panel_radar_foreground_alpha "" "alpha of the map"
+seta hud_panel_radar_rotation "" "rotation mode: you set what points up. 0 = player, 1 = west, 2 = south, 3 = east, 4 = north"
+seta hud_panel_radar_zoommode "" "zoom mode: 0 = zoomed by default, 1 = zoomed when +zoom, 2 = always zoomed, 3 = always zoomed out"
+seta hud_panel_radar_scale "" "distance you can see on the team radar"
+seta hud_panel_radar_maximized_scale "" "distance you can see on the radar when maximized"
+seta hud_panel_radar_maximized_size "" "size of the radar when maximized"
 
 seta hud_panel_score "" "enable/disable this panel"
 seta hud_panel_score_pos "" "position of this base of the panel"
@@ -144,6 +164,7 @@ seta hud_panel_score_bg_color_team "" "override panel color with team color in t
 seta hud_panel_score_bg_alpha "" "if set to something else than \"\" = override default panel background alpha"
 seta hud_panel_score_bg_border "" "if set to something else than \"\" = override default size of border around the background"
 seta hud_panel_score_bg_padding "" "if set to something else than \"\" = override default padding of contents from border"
+seta hud_panel_score_rankings "" "show rankings: 1 always show my own score; 2 pure rankings" 
 
 seta hud_panel_racetimer "" "enable/disable this panel"
 seta hud_panel_racetimer_pos "" "position of this base of the panel"
@@ -175,6 +196,7 @@ seta hud_panel_modicons_bg_color_team "" "override panel color with team color i
 seta hud_panel_modicons_bg_alpha "" "if set to something else than \"\" = override default panel background alpha"
 seta hud_panel_modicons_bg_border "" "if set to something else than \"\" = override default size of border around the background"
 seta hud_panel_modicons_bg_padding "" "if set to something else than \"\" = override default padding of contents from border"
+seta hud_panel_modicons_dom_layout "" "3 possible layouts: 0) only icons; 1) icons and percentage of average pps (points per second); 2) icons and average pps"
 
 seta hud_panel_pressedkeys "" "enable/disable this panel, 1 = show only when spectating other players, 2 = show always"
 seta hud_panel_pressedkeys_pos "" "position of this base of the panel"
@@ -206,6 +228,8 @@ seta hud_panel_engineinfo_bg_color_team "" "override panel color with team color
 seta hud_panel_engineinfo_bg_alpha "" "if set to something else than \"\" = override default panel background alpha"
 seta hud_panel_engineinfo_bg_border "" "if set to something else than \"\" = override default size of border around the background"
 seta hud_panel_engineinfo_bg_padding "" "if set to something else than \"\" = override default padding of contents from border"
+seta hud_panel_engineinfo_framecounter_decimals "" "amount of decimals to show"
+seta hud_panel_engineinfo_framecounter_time "" "time between framerate display updates"
 
 seta hud_panel_infomessages "" "enable/disable this panel"
 seta hud_panel_infomessages_pos "" "position of this base of the panel"
@@ -230,8 +254,19 @@ seta hud_panel_physics_bg_padding "" "if set to something else than \"\" = overr
 seta hud_panel_physics_baralign "" "0 = align bars to the left, 1 = align bars to the right, 2 = align only left bar to the right, 3 = align only right bar to the right, 4 = align bars to the center"
 seta hud_panel_physics_flip "" "flip speed/acceleration positions"
 seta hud_panel_physics_progressbar "" "enable progressbar in panel (2 = only for speed; 3 = only for acceleration)"
+seta hud_panel_physics_acceleration_max "" "acceleration progressbar gets completely filled up by this value (in g)"
 seta hud_panel_physics_acceleration_progressbar_mode "" "0 = progressbar increases from the center to the right if the acceleration is positive, to the left if it's negative; 1 = progressbar increases from the border in the same direction for both positive and negative accelerations"
+seta hud_panel_physics_acceleration_progressbar_scale "" "multiply acceleration progressbar values by this factor (allow progressbar to go out of panel bounds)"
+seta hud_panel_physics_acceleration_progressbar_nonlinear "" "use a non linear function to display acceleration progressbar values (amplify more smaller values)"
+seta hud_panel_physics_acceleration_vertical "" "include the acceleration on the Z-axis"
 seta hud_panel_physics_text "" "show text in panel (2 = only for speed; 3 = only for acceleration)"
+seta hud_panel_physics_text_scale "" "scale text height by this factor"
+seta hud_panel_physics_speed_unit "" "speed unit (1 = qu/s, 2 = m/s, 3 = km/h, 4 = mph, 5 = knots)"
+seta hud_panel_physics_speed_unit_show "" "also show speed unit"
+seta hud_panel_physics_speed_max "" "speed progressbar gets filled up completely by this value (in qu/s)"
+seta hud_panel_physics_speed_vertical "" "include the speed on the Z-axis"
+seta hud_panel_physics_topspeed "" "also show top speed"
+seta hud_panel_physics_topspeed_time "" "how many seconds the top speed takes to fade out"
 
 seta hud_panel_centerprint "" "enable/disable this panel"
 seta hud_panel_centerprint_pos "" "position of this base of the panel"
@@ -246,4 +281,12 @@ seta hud_panel_centerprint_align "" "text alignment: 0 left, 0.5 center, 1 right
 seta hud_panel_centerprint_flip "" "invert messages order"
 seta hud_panel_centerprint_fontscale "" "scale the text font by this amount"
 seta hud_panel_centerprint_time "" "message duration (NOTE: certain messages have a fixed duration)"
-seta hud_panel_centerprint_fadetime "" "how long a message takes to fade out (this time is included in the message duration and can't be > 1)"
+seta hud_panel_centerprint_fade_in "" "how long a message takes to fade in"
+seta hud_panel_centerprint_fade_out "" "how long a message takes to fade out (this time is included in the message duration and can't be > 5)"
+seta hud_panel_centerprint_fade_subsequent "" "enable extra fading effects for each additional message, so that the more messages you have the more they become faded out"
+seta hud_panel_centerprint_fade_subsequent_passone "" "division factor for the first pass for alpha fading, with 2 all messages after the first have half alpha"
+seta hud_panel_centerprint_fade_subsequent_passone_minalpha "" "minimum factor that the first pass can fade to"
+seta hud_panel_centerprint_fade_subsequent_passtwo "" "division factor for the second pass for alpha fading, it applies another fade on top of the first pass to make it more transitioned"
+seta hud_panel_centerprint_fade_subsequent_passtwo_minalpha "" "minimum factor that the second pass can fade to"
+seta hud_panel_centerprint_fade_subsequent_minfontsize "" "minimum factor for the font size from the subsequent fading effects"
+seta hud_panel_centerprint_fade_minfontsize "" "minimum factor for the font size from the fading in/out effects"
index 81381f4638cbc21084ac14e196e476554331e121..1a203eb89003e036db6bd4594253f611d0ba68a6 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
@@ -287,12 +306,14 @@ set g_balance_uzi_burst_ammo 3
 
 set g_balance_uzi_first 1
 set g_balance_uzi_first_damage 30
+set g_balance_uzi_first_headshotaddeddamage 0
 set g_balance_uzi_first_force 50
 set g_balance_uzi_first_spread 0.015
 set g_balance_uzi_first_refire 0.2
 set g_balance_uzi_first_ammo 1
 
 set g_balance_uzi_sustained_damage 15
+set g_balance_uzi_sustained_headshotaddeddamage 0
 set g_balance_uzi_sustained_force 27
 set g_balance_uzi_sustained_spread 0.05
 set g_balance_uzi_sustained_refire 0.1
@@ -406,6 +427,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 +534,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 +555,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 +572,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 +643,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..f8bdb2a3c87ebb822c6b386ccdeee4c11faa8c20 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
@@ -287,12 +306,14 @@ set g_balance_uzi_burst_ammo 3
 
 set g_balance_uzi_first 1
 set g_balance_uzi_first_damage 15 / f/ LOG: 22 -> 15
+set g_balance_uzi_first_headshotaddeddamage 0
 set g_balance_uzi_first_force 50
 set g_balance_uzi_first_spread 0.03
 set g_balance_uzi_first_refire 0.2
 set g_balance_uzi_first_ammo 2
 
 set g_balance_uzi_sustained_damage 12   // 120 dps
+set g_balance_uzi_sustained_headshotaddeddamage 0
 set g_balance_uzi_sustained_force 12
 set g_balance_uzi_sustained_spread 0.06
 set g_balance_uzi_sustained_refire 0.1
@@ -406,6 +427,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 +555,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 +572,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 +643,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..bfe7c2fb78288171de9351ed6503005b7e8fccc8 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
@@ -287,12 +306,14 @@ set g_balance_uzi_burst_ammo 3
 
 set g_balance_uzi_first 1
 set g_balance_uzi_first_damage 26
+set g_balance_uzi_first_headshotaddeddamage 0
 set g_balance_uzi_first_force -30
 set g_balance_uzi_first_spread 0.01
 set g_balance_uzi_first_refire 0.2
 set g_balance_uzi_first_ammo 1
 
 set g_balance_uzi_sustained_damage 17
+set g_balance_uzi_sustained_headshotaddeddamage 0
 set g_balance_uzi_sustained_force 27
 set g_balance_uzi_sustained_spread 0.05
 set g_balance_uzi_sustained_refire 0.1
@@ -406,6 +427,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 +534,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 +555,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 +572,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 +643,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..e3c0ecff45b358bc23aa789f995e7878e6b1daea 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,28 +292,30 @@ 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
 
 set g_balance_uzi_first 1
 set g_balance_uzi_first_damage 14
+set g_balance_uzi_first_headshotaddeddamage 0
 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_headshotaddeddamage 0
 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 +340,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 +359,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 +396,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
@@ -393,7 +414,7 @@ set g_balance_electro_primary_falloff_maxdist 850
 set g_balance_electro_primary_falloff_halflifedist 425
 set g_balance_electro_secondary_damage 40
 set g_balance_electro_secondary_edgedamage 20
-set g_balance_electro_secondary_force 200
+set g_balance_electro_secondary_force 50
 set g_balance_electro_secondary_radius 150
 set g_balance_electro_secondary_speed 900
 set g_balance_electro_secondary_speed_up 200
@@ -406,11 +427,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 +534,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 +554,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 +569,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 +601,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 +619,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 +635,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 +643,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..520b96ee432ede3d61c63641a291657074b9d3f8 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
@@ -287,12 +306,14 @@ set g_balance_uzi_burst_ammo 3
 
 set g_balance_uzi_first 1
 set g_balance_uzi_first_damage 30
+set g_balance_uzi_first_headshotaddeddamage 0
 set g_balance_uzi_first_force 50
 set g_balance_uzi_first_spread 0.015
 set g_balance_uzi_first_refire 0.2
 set g_balance_uzi_first_ammo 1
 
 set g_balance_uzi_sustained_damage 14  // 120 dps
+set g_balance_uzi_sustained_headshotaddeddamage 0
 set g_balance_uzi_sustained_force 12
 set g_balance_uzi_sustained_spread 0.02
 set g_balance_uzi_sustained_refire 0.1
@@ -406,6 +427,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 +533,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 +554,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 +571,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 +642,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 b8a5ce7a17658bd11f6a50107cde738c5d8aaaf7..38d74c7c990f1dd7ed047c427b108e4e7f83944c 100644 (file)
@@ -28,4 +28,4 @@ set timelimit_overtimes 1 // overtimes on, draw matches are less interesting! :)
 set g_forced_respawn 1 // no delaying/cheating a match by not spawning
 
 // info
-set sv_fragmessage_information_stats 0 // don't reveal how much health/armor the attacker had
+set sv_fraginfo_stats 0 // don't reveal how much health/armor the attacker had
index 083c5d0ceec38fd4618657a3a144a676309fb38d..fe131c24b22f0b1c4204b6ab40a6195e02a0b88e 100644 (file)
@@ -53,8 +53,6 @@ alias asay_drop "say_team (%l) dropped %w ; impulse 17"
 alias +hook +button6
 alias -hook -button6
 alias use "impulse 21"
-alias +use use // always send that impulse AND press the key (+use is engine internal command and executes anyway)
-set cl_newusekeysupported 1 // indicates that we always send the use impulse too, so they do not need to be synthesized
 alias ready "cmd ready"
 alias lockteams "sv_cmd lockteams"
 alias unlockteams "sv_cmd unlockteams"
@@ -215,12 +213,15 @@ seta crosshair_ring_reload 1 "main cvar to enable or disable ammo crosshair ring
 seta crosshair_ring_reload_size 2.5    "reload ring size"
 seta crosshair_ring_reload_alpha 0.2   "reload ring alpha"
 
+seta cl_reticle 1 "control for toggling whether ANY zoom reticles are shown"
 seta cl_reticle_stretch 0 "whether to stretch reticles so they fit the screen (brakes image proportions)"
 seta cl_reticle_item_nex 1 "draw aiming reticle for the nex weapon's zoom, 0 disables and values between 0 and 1 change alpha"
 seta cl_reticle_item_normal 1 "draw reticle when zooming with the zoom button, 0 disables and values between 0 and 1 change alpha"
 fov 90
 seta cl_velocityzoom 0 "velocity based zooming of fov, negative values zoom out"
-seta cl_velocityzoomtime 0.3   "time value for averaging speed values"
+seta cl_velocityzoom_type 3 "how to factor in speed, 1 = all velocity in all directions, 2 = velocity only in forward direction (can be negative), 3 = velocity only in forward direction (limited to forward only)"
+seta cl_velocityzoom_speed 1000 "target speed for fov factoring"
+seta cl_velocityzoom_time 0.2  "time value for averaging speed values"
 seta cl_zoomfactor 5   "how much +zoom will zoom (1-16)"
 seta cl_zoomspeed 8    "how fast it will zoom (0.5-16), negative values mean instant zoom"
 seta cl_zoomsensitivity 0      "how zoom changes sensitivity (0 = weakest, 1 = strongest)"
@@ -353,7 +354,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"
@@ -367,10 +367,10 @@ set g_respawn_ghosts_maxtime 6 "maximum amount of time a respawn ghost can last,
 set sv_gibhealth 100 "Minus health a dead body must have in order to get gibbed"
 
 // fragmessage: This allows extra information to be displayed with the frag centerprints. 
-set sv_fragmessage_information_ping 1 "Enable ping display information, 0 = Never display; 1 = Always display (If the player is a bot, it will say bot instead of the ping.)"
-set sv_fragmessage_information_handicap 1 "Enable handicap display information, 0 = Never display; 1 = Only when the player has handicap on; 2 = Always display (Displays Off if off)"
-set sv_fragmessage_information_stats 1 "Enable statistics (health/armor) display information, 0 = Never display; 1 = Always display (Only available for the person who was killed)"
-set sv_fragmessage_information_typefrag 1 "Enable typefrag display information, 0 = Never display; 1 = Always display"
+set sv_fraginfo_ping 1 "Enable ping display information, 0 = Never display; 1 = Always display (If the player is a bot, it will say bot instead of the ping.)"
+set sv_fraginfo_handicap 1 "Enable handicap display information, 0 = Never display; 1 = Only when the player has handicap on; 2 = Always display (Displays Off if off)"
+set sv_fraginfo_stats 1 "Enable statistics (health/armor) display information, 0 = Never display; 1 = Always display (Only available for the person who was killed)"
+set sv_fraginfo_typefrag 1 "Enable typefrag display information, 0 = Never display; 1 = Always display"
 
 // use default physics
 set sv_friction_on_land 0
@@ -387,6 +387,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 +491,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 +538,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 +553,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"
 
@@ -956,10 +957,11 @@ cl_sound_ric3 weapons/ric3.wav
 cl_sound_r_exp3 ""
 sv_sound_land ""
 sv_sound_watersplash ""
-seta cl_sound_maptime_warning "1" "play announcer sound telling you the remaining maptime - 0: do not play at all, 1: play at one minute, 2: play at five minutes, 3: play both"
-seta cl_notify_carried_items "3" "notify you of carried items when you obtain them (e.g. flags in CTF) - 0: disabled, 1: notify of taken items, 2: notify of picking up dropped items, 3: notify of both"
 
 seta cl_announcer default "name of the announcer you wish to use from data/sound/announcer"
+seta cl_announcer_antispam 2 "number of seconds before an announcement of the same sound can be played again"
+seta cl_announcer_maptime 3 "play announcer sound telling you the remaining maptime - 0: do not play at all, 1: play at one minute, 2: play at five minutes, 3: play both"
+seta cl_notify_carried_items "3" "notify you of carried items when you obtain them (e.g. flags in CTF) - 0: disabled, 1: notify of taken items, 2: notify of picking up dropped items, 3: notify of both"
 
 // startmap_dm is used when running with the -listen or -dedicated commandline options
 set serverconfig server.cfg
@@ -1040,7 +1042,7 @@ bind MWHEELDOWN weapprev
 bind r reload
 bind BACKSPACE dropweapon
 bind g dropweapon
-bind f use
+bind f +use
 
 // misc
 bind e +hook
@@ -1052,6 +1054,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 +1243,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 +1410,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
@@ -1428,15 +1432,9 @@ con_chatwidth 0.6
 con_notifysize 10
 con_notifyalign 0
 
-// hud variables
-set _hud_configure 0 "1 = configure the HUD"
-seta hud_configure_teamcolorforced 0 "1 = force display of team colors in configure mode"
-seta hud_configure_checkcollisions 1 "check for collisions against other panels when in hud configure mode"
-seta hud_configure_bg_minalpha 0.25 "minimum panel background alpha when in hud configure mode"
-seta hud_configure_grid_alpha 0.15 "alpha for visible grid when in configure mode"
-
 seta sbar_info_pos 0 "Y-axis distance from lower right corner for engine info prints"
 
+<<<<<<< HEAD
 // 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"
@@ -1546,6 +1544,8 @@ seta hud_shownames_antioverlap 1 "if two tags get too close to each other, fade
 seta hud_shownames_antioverlap_distance 125 "2d distance to other tag after which to fade out"
 seta hud_shownames_offset 52 "offset (along z-axis) tag from player origin by this many units"
 
+=======
+>>>>>>> master
 // scoreboard
 seta scoreboard_columns default
 seta scoreboard_border_thickness 1 "scoreboard border thickness"
@@ -1565,8 +1565,9 @@ seta scoreboard_fadeoutspeed 5 "speed at which scoreboard fades out, higher is f
 seta scoreboard_highlight 1 "enable highlighting for rows and columns in the scoreboard"
 seta scoreboard_highlight_alpha 0.10 "highlight alpha value (depends on hud_scoreboard_highlight 1)"
 seta scoreboard_highlight_alpha_self 0.25 "self highlight alpha value"
-seta scoreboard_offset_left 0.15 "how many pixels the scoreboard is offset from the left screen edge"
-seta scoreboard_offset_right 0.15 "how many pixels the scoreboard is offset from the right screen edge"
+seta scoreboard_offset_left 0.15 "how far (by percent) the scoreboard is offset from the left screen edge"
+seta scoreboard_offset_right 0.15 "how far (by percent) the scoreboard is offset from the right screen edge"
+seta scoreboard_offset_vertical 0.05 "how far (by percent) the scoreboard is offset from the top and bottom of the screen"
 seta scoreboard_bg_scale 0.25 "scale for the tiled scoreboard background"
 
 seta accuracy_color_levels "0 20 100" "accuracy values at which a specified color (accuracy_color<X>) will be used. If your accuracy is between 2 of these values then a mix of the Xth and X+1th colors will be used. You can specify up to 10 values, in increasing order"
@@ -1699,15 +1700,12 @@ set sv_maxidle_spectatorsareidle 0
 // CTF capture limit placeholder cvar
 set capturelimit 0
 
-// hud: font size
-seta hud_fontsize 11
-seta hud_width 560
-
 // these entities are not referenced by anything directly, they just represent
 // teams and are found by find() when needed
 prvm_leaktest_ignore_classnames "ctf_team dom_team tdm_team"
 
 sv_allowdownloads_inarchive 1 // for csprogs.dat
+sv_allowdownloads 0 // download protocol is evil
 
 set g_jump_grunt 0     "Do you make a grunting noise every time you jump? Is it the same grunting noise every time?"
 
@@ -1735,8 +1733,7 @@ set g_maplist_allow_frustrating 0 "allow impossible maps to be, e.g., voted for
 if_client set g_start_delay 0  "delay before the game starts, so everyone can join; recommended to set this to like 15 on a public server"
 if_dedicated set g_start_delay 15      "delay before the game starts, so everyone can join; recommended to set this to like 15 on a public server"
 
-alias ons_map           "cl_cmd radar" // legacy alias
-alias radar             "cl_cmd radar"
+alias radar "cl_cmd hud_panel_radar_maximized"
 alias scoreboard_columns_set  "" // aliased later
 alias scoreboard_columns_help "cl_cmd scoreboard_columns_help $*"
 
@@ -1752,6 +1749,8 @@ set cl_handicap 1 "the higher, the more damage you will receive (client setting)
 
 seta cl_clippedspectating 1 "movement collision for spectators so that you can't pass through walls and such. (client setting) NOTE: reconnect or use sendcvar command to update the choice." 
 
+seta cl_autoscreenshot 0 "client option to automatically take a screenshot once the map has ended (see also sv_autoscreenshot)"
+
 // must be at the bottom of this file:
 // alias for switching the teamselect menu
 alias menu_showteamselect "menu_cmd directmenu TeamSelect"
@@ -2002,6 +2001,7 @@ set _campaign_name ""
 
 // debug
 set _independent_players 0 "DO NOT TOUCH"
+set _notarget 0 "NO, REALLY, DON'T"
 
 // define some engine cvars that we need even on dedicated server
 set r_showbboxes 0
@@ -2161,13 +2161,28 @@ set g_weapon_charge_colormod_blue_full -1
 set g_playerstats_uri ""
 set g_playerstats_debug 0 "when 1, player stats are dumped to the console too"
 
+// session locking
+locksession 1
+
 // 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"
@@ -2189,10 +2204,11 @@ exec physicsX.cfg
 exec turrets.cfg
 exec vehicles.cfg
 
-// hud cvar descriptions
+// hud cvar descriptions and common settings
+exec _hud_common.cfg
 exec _hud_descriptions.cfg
 // exec the default skin config
-// please add any new cvars into the hud_save script in qcsrc/client/hud.qc for consistency
+// please add any new cvars into the hud_save script in qcsrc/client/hud_config.qc for consistency
 exec hud_luminos.cfg
 
 // enable menu syncing
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 0e4e4495b50bfe0a6433806b45f0e303655a38d8..cc889c50689dd23f6fd42c79a654e6c462614e61 100644 (file)
@@ -19,9 +19,9 @@ seta hud_progressbar_health_color "0.6 0 0"
 seta hud_progressbar_armor_color "0 0.6 0"
 seta hud_progressbar_fuel_color "0.6 0.6 0"
 seta hud_progressbar_nexball_color "0.7 0.1 0"
-seta hud_progressbar_speed_color "1 0.75 0"
-seta hud_progressbar_acceleration_color "0.5 0.75 1"
-seta hud_progressbar_acceleration_neg_color "0.125 0.25 0.5"
+seta hud_progressbar_speed_color "1 0.75 0" 
+seta hud_progressbar_acceleration_color "0.5 0.75 1" 
+seta hud_progressbar_acceleration_neg_color "0.125 0.25 0.5" 
 
 seta _hud_panelorder "15 12 9 10 5 6 14 0 7 4 11 2 1 3 8 13 16 "
 
@@ -30,24 +30,30 @@ seta hud_configure_grid_xsize "0.010000"
 seta hud_configure_grid_ysize "0.010000"
 
 seta hud_panel_weapons 1
-seta hud_panel_weapons_pos "0.940000 0.180000"
-seta hud_panel_weapons_size "0.060000 0.610000"
+seta hud_panel_weapons_pos "0.930000 0.170000"
+seta hud_panel_weapons_size "0.070000 0.650000"
 seta hud_panel_weapons_bg "border_small_weapons"
 seta hud_panel_weapons_bg_color ""
 seta hud_panel_weapons_bg_color_team ""
 seta hud_panel_weapons_bg_alpha ""
 seta hud_panel_weapons_bg_border ""
-seta hud_panel_weapons_bg_padding ""
+seta hud_panel_weapons_bg_padding "4"
+seta hud_panel_weapons_accuracy "1"
+seta hud_panel_weapons_label "1"
 seta hud_panel_weapons_complainbubble "1"
-seta hud_panel_weapons_complainbubble_padding "-10"
+seta hud_panel_weapons_complainbubble_padding "2"
+seta hud_panel_weapons_complainbubble_time "4"
+seta hud_panel_weapons_complainbubble_fadetime "2"
 seta hud_panel_weapons_complainbubble_color_outofammo "0.8 0 0"
 seta hud_panel_weapons_complainbubble_color_donthave "0.8 0.5 0"
 seta hud_panel_weapons_complainbubble_color_unavailable "0 0.3 0.8"
+seta hud_panel_weapons_ammo "1"
 seta hud_panel_weapons_ammo_color "0 1 0"
 seta hud_panel_weapons_ammo_alpha "1"
 seta hud_panel_weapons_aspect "2"
-seta hud_panel_weapons_timeout "3"
-seta hud_panel_weapons_timeout_effect "2"
+seta hud_panel_weapons_timeout "5"
+seta hud_panel_weapons_timeout_effect "3"
+seta hud_panel_weapons_onlyowned "1"
 
 seta hud_panel_ammo 1
 seta hud_panel_ammo_pos "0.330000 0.960000"
@@ -97,6 +103,8 @@ seta hud_panel_healtharmor_baralign "3"
 seta hud_panel_healtharmor_progressbar "1"
 seta hud_panel_healtharmor_progressbar_health "progressbar"
 seta hud_panel_healtharmor_progressbar_armor "progressbar"
+seta hud_panel_healtharmor_progressbar_gfx "1"
+seta hud_panel_healtharmor_progressbar_gfx_smooth "2"
 seta hud_panel_healtharmor_text "1"
 
 seta hud_panel_notify 1
@@ -111,6 +119,8 @@ seta hud_panel_notify_bg_padding ""
 seta hud_panel_notify_flip "0"
 seta hud_panel_notify_fontsize "0.8"
 seta hud_panel_notify_print "1"
+seta hud_panel_notify_time "10"
+seta hud_panel_notify_fadetime "3"
 
 seta hud_panel_timer 1
 seta hud_panel_timer_pos "0.800000 0.040000"
@@ -121,6 +131,7 @@ seta hud_panel_timer_bg_color_team ""
 seta hud_panel_timer_bg_alpha ""
 seta hud_panel_timer_bg_border ""
 seta hud_panel_timer_bg_padding "0"
+seta hud_panel_timer_increment "0"
 
 seta hud_panel_radar 2
 seta hud_panel_radar_pos "0 0"
@@ -132,6 +143,11 @@ seta hud_panel_radar_bg_alpha "0.800000"
 seta hud_panel_radar_bg_border ""
 seta hud_panel_radar_bg_padding "-1"
 seta hud_panel_radar_foreground_alpha "0.800000"
+seta hud_panel_radar_rotation "0"
+seta hud_panel_radar_zoommode "0"
+seta hud_panel_radar_scale "4096"
+seta hud_panel_radar_maximized_scale "8192"
+seta hud_panel_radar_maximized_size "0.5 0.5"
 
 seta hud_panel_score 1
 seta hud_panel_score_pos "0.890000 0.030000"
@@ -142,6 +158,7 @@ seta hud_panel_score_bg_color_team ""
 seta hud_panel_score_bg_alpha ""
 seta hud_panel_score_bg_border ""
 seta hud_panel_score_bg_padding "0"
+seta hud_panel_score_rankings "1"
 
 seta hud_panel_racetimer 1
 seta hud_panel_racetimer_pos "0.360000 0.110000"
@@ -156,7 +173,7 @@ seta hud_panel_racetimer_bg_padding ""
 seta hud_panel_vote 1
 seta hud_panel_vote_pos "0.710000 0.660000"
 seta hud_panel_vote_size "0.210000 0.100000"
-seta hud_panel_vote_bg "border_vote"
+seta hud_panel_vote_bg ""
 seta hud_panel_vote_bg_color ""
 seta hud_panel_vote_bg_color_team ""
 seta hud_panel_vote_bg_alpha ""
@@ -173,6 +190,7 @@ seta hud_panel_modicons_bg_color_team ""
 seta hud_panel_modicons_bg_alpha ""
 seta hud_panel_modicons_bg_border ""
 seta hud_panel_modicons_bg_padding "0"
+seta hud_panel_modicons_dom_layout "1"
 
 seta hud_panel_pressedkeys 1
 seta hud_panel_pressedkeys_pos "0.450000 0.720000"
@@ -204,6 +222,8 @@ seta hud_panel_engineinfo_bg_color_team ""
 seta hud_panel_engineinfo_bg_alpha ""
 seta hud_panel_engineinfo_bg_border ""
 seta hud_panel_engineinfo_bg_padding ""
+seta hud_panel_engineinfo_framecounter_time "0.1"
+seta hud_panel_engineinfo_framecounter_decimals "0"
 
 seta hud_panel_infomessages 1
 seta hud_panel_infomessages_pos "0.720000 0.100000"
@@ -225,15 +245,26 @@ seta hud_panel_physics_bg_color_team ""
 seta hud_panel_physics_bg_alpha ""
 seta hud_panel_physics_bg_border ""
 seta hud_panel_physics_bg_padding ""
+seta hud_panel_physics_speed_unit "3"
+seta hud_panel_physics_speed_unit_show "1"
+seta hud_panel_physics_speed_max "1800"
+seta hud_panel_physics_speed_vertical "0"
+seta hud_panel_physics_topspeed "1"
+seta hud_panel_physics_topspeed_time "4"
+seta hud_panel_physics_acceleration_max "1.5"
+seta hud_panel_physics_acceleration_vertical "0"
 seta hud_panel_physics_flip "0"
 seta hud_panel_physics_baralign "0"
-seta hud_panel_physics_acceleration_progressbar_mode "0"
 seta hud_panel_physics_progressbar "1"
+seta hud_panel_physics_acceleration_progressbar_mode "0"
+seta hud_panel_physics_acceleration_progressbar_scale "1"
+seta hud_panel_physics_acceleration_progressbar_nonlinear "0"
 seta hud_panel_physics_text "1"
+seta hud_panel_physics_text_scale "0.7"
 
 seta hud_panel_centerprint 1
-seta hud_panel_centerprint_pos "0.175000 0.260000"
-seta hud_panel_centerprint_size "0.650000 0.210000"
+seta hud_panel_centerprint_pos "0.175000 0.220000"
+seta hud_panel_centerprint_size "0.650000 0.220000"
 seta hud_panel_centerprint_bg "0"
 seta hud_panel_centerprint_bg_color ""
 seta hud_panel_centerprint_bg_color_team ""
@@ -241,9 +272,17 @@ seta hud_panel_centerprint_bg_alpha ""
 seta hud_panel_centerprint_bg_border ""
 seta hud_panel_centerprint_bg_padding ""
 seta hud_panel_centerprint_align "0.5"
-seta hud_panel_centerprint_flip "1"
+seta hud_panel_centerprint_flip "0"
 seta hud_panel_centerprint_fontscale "1"
 seta hud_panel_centerprint_time "3"
-seta hud_panel_centerprint_fadetime "0.25"
+seta hud_panel_centerprint_fade_in "0.2"
+seta hud_panel_centerprint_fade_out "0.5"
+seta hud_panel_centerprint_fade_subsequent "1"
+seta hud_panel_centerprint_fade_subsequent_passone "3"
+seta hud_panel_centerprint_fade_subsequent_passone_minalpha "0.5"
+seta hud_panel_centerprint_fade_subsequent_passtwo "10" 
+seta hud_panel_centerprint_fade_subsequent_passtwo_minalpha "0.5"
+seta hud_panel_centerprint_fade_subsequent_minfontsize "0.75"
+seta hud_panel_centerprint_fade_minfontsize "0"
 
 menu_sync
index 9d255bb4acba033271d12e8b6de8371f11149bee..715d38498d23b960b10149310934a726b6b3a6eb 100644 (file)
@@ -19,9 +19,9 @@ seta hud_progressbar_health_color "0.6 0 0"
 seta hud_progressbar_armor_color "0 0.6 0"
 seta hud_progressbar_fuel_color "0.6 0.6 0"
 seta hud_progressbar_nexball_color "0.7 0.1 0"
-seta hud_progressbar_speed_color "1 0.75 0"
-seta hud_progressbar_acceleration_color "0.5 0.75 1"
-seta hud_progressbar_acceleration_neg_color "0.125 0.25 0.5"
+seta hud_progressbar_speed_color "1 0.75 0" 
+seta hud_progressbar_acceleration_color "0.5 0.75 1" 
+seta hud_progressbar_acceleration_neg_color "0.125 0.25 0.5" 
 
 seta _hud_panelorder "10 3 0 14 6 9 13 4 1 2 11 12 7 5 8 15 16 "
 
@@ -38,16 +38,22 @@ seta hud_panel_weapons_bg_color_team ""
 seta hud_panel_weapons_bg_alpha ""
 seta hud_panel_weapons_bg_border ""
 seta hud_panel_weapons_bg_padding ""
+seta hud_panel_weapons_accuracy "1"
+seta hud_panel_weapons_label "1"
 seta hud_panel_weapons_complainbubble "1"
 seta hud_panel_weapons_complainbubble_padding "-10"
+seta hud_panel_weapons_complainbubble_time "1"
+seta hud_panel_weapons_complainbubble_fadetime "0.25"
 seta hud_panel_weapons_complainbubble_color_outofammo "0.8 0 0"
 seta hud_panel_weapons_complainbubble_color_donthave "0.8 0.5 0"
 seta hud_panel_weapons_complainbubble_color_unavailable "0 0.3 0.8"
+seta hud_panel_weapons_ammo "1"
 seta hud_panel_weapons_ammo_color "0 1 0"
 seta hud_panel_weapons_ammo_alpha "1"
 seta hud_panel_weapons_aspect "2"
 seta hud_panel_weapons_timeout "0"
 seta hud_panel_weapons_timeout_effect "0"
+seta hud_panel_weapons_onlyowned "1"
 
 seta hud_panel_ammo 1
 seta hud_panel_ammo_pos "0.650000 0.890000"
@@ -61,8 +67,8 @@ seta hud_panel_ammo_bg_padding ""
 seta hud_panel_ammo_onlycurrent "0"
 seta hud_panel_ammo_iconalign "0"
 seta hud_panel_ammo_progressbar "0"
-seta hud_panel_ammo_progressbar_xoffset "0"
 seta hud_panel_ammo_progressbar_name "progressbar"
+seta hud_panel_ammo_progressbar_xoffset "0"
 seta hud_panel_ammo_text "1"
 
 seta hud_panel_powerups 1
@@ -97,6 +103,8 @@ seta hud_panel_healtharmor_baralign "3"
 seta hud_panel_healtharmor_progressbar "1"
 seta hud_panel_healtharmor_progressbar_health "progressbar"
 seta hud_panel_healtharmor_progressbar_armor "progressbar"
+seta hud_panel_healtharmor_progressbar_gfx "1"
+seta hud_panel_healtharmor_progressbar_gfx_smooth "2"
 seta hud_panel_healtharmor_text "1"
 
 seta hud_panel_notify 1
@@ -111,6 +119,8 @@ seta hud_panel_notify_bg_padding ""
 seta hud_panel_notify_flip "1"
 seta hud_panel_notify_fontsize "0.8"
 seta hud_panel_notify_print "0"
+seta hud_panel_notify_time "10"
+seta hud_panel_notify_fadetime "3"
 
 seta hud_panel_timer 1
 seta hud_panel_timer_pos "0.435000 0"
@@ -121,6 +131,7 @@ seta hud_panel_timer_bg_color_team ""
 seta hud_panel_timer_bg_alpha ""
 seta hud_panel_timer_bg_border ""
 seta hud_panel_timer_bg_padding "0"
+seta hud_panel_timer_increment "0"
 
 seta hud_panel_radar 2
 seta hud_panel_radar_pos "0.810000 0"
@@ -132,6 +143,11 @@ seta hud_panel_radar_bg_alpha "0.500000"
 seta hud_panel_radar_bg_border "0"
 seta hud_panel_radar_bg_padding "0"
 seta hud_panel_radar_foreground_alpha "0.500000"
+seta hud_panel_radar_rotation "0"
+seta hud_panel_radar_zoommode "0"
+seta hud_panel_radar_scale "4096"
+seta hud_panel_radar_maximized_scale "8192"
+seta hud_panel_radar_maximized_size "0.5 0.5"
 
 seta hud_panel_score 1
 seta hud_panel_score_pos "0.465000 0.045000"
@@ -142,6 +158,7 @@ seta hud_panel_score_bg_color_team ""
 seta hud_panel_score_bg_alpha ""
 seta hud_panel_score_bg_border ""
 seta hud_panel_score_bg_padding ""
+seta hud_panel_score_rankings "1"
 
 seta hud_panel_racetimer 1
 seta hud_panel_racetimer_pos "0.360000 0.090000"
@@ -173,6 +190,7 @@ seta hud_panel_modicons_bg_color_team ""
 seta hud_panel_modicons_bg_alpha ""
 seta hud_panel_modicons_bg_border ""
 seta hud_panel_modicons_bg_padding ""
+seta hud_panel_modicons_dom_layout "1"
 
 seta hud_panel_pressedkeys 1
 seta hud_panel_pressedkeys_pos "0.450000 0.650000"
@@ -204,6 +222,8 @@ seta hud_panel_engineinfo_bg_color_team ""
 seta hud_panel_engineinfo_bg_alpha ""
 seta hud_panel_engineinfo_bg_border ""
 seta hud_panel_engineinfo_bg_padding ""
+seta hud_panel_engineinfo_framecounter_time "0.1"
+seta hud_panel_engineinfo_framecounter_decimals "0"
 
 seta hud_panel_infomessages 1
 seta hud_panel_infomessages_pos "0.710000 0"
@@ -225,15 +245,26 @@ seta hud_panel_physics_bg_color_team ""
 seta hud_panel_physics_bg_alpha ""
 seta hud_panel_physics_bg_border ""
 seta hud_panel_physics_bg_padding ""
+seta hud_panel_physics_speed_unit "3"
+seta hud_panel_physics_speed_unit_show "1"
+seta hud_panel_physics_speed_max "1800"
+seta hud_panel_physics_speed_vertical "0"
+seta hud_panel_physics_topspeed "1"
+seta hud_panel_physics_topspeed_time "4"
+seta hud_panel_physics_acceleration_max "1.5"
+seta hud_panel_physics_acceleration_vertical "0"
 seta hud_panel_physics_flip "0"
 seta hud_panel_physics_baralign "0"
-seta hud_panel_physics_acceleration_progressbar_mode "0"
 seta hud_panel_physics_progressbar "3"
-seta hud_panel_physics_text "2"
+seta hud_panel_physics_acceleration_progressbar_mode "0"
+seta hud_panel_physics_acceleration_progressbar_scale "1"
+seta hud_panel_physics_acceleration_progressbar_nonlinear "0"
+seta hud_panel_physics_text "1"
+seta hud_panel_physics_text_scale "0.7"
 
 seta hud_panel_centerprint 1
-seta hud_panel_centerprint_pos "0.175000 0.260000"
-seta hud_panel_centerprint_size "0.650000 0.210000"
+seta hud_panel_centerprint_pos "0.175000 0.220000"
+seta hud_panel_centerprint_size "0.650000 0.220000"
 seta hud_panel_centerprint_bg "0"
 seta hud_panel_centerprint_bg_color ""
 seta hud_panel_centerprint_bg_color_team ""
@@ -241,9 +272,17 @@ seta hud_panel_centerprint_bg_alpha ""
 seta hud_panel_centerprint_bg_border ""
 seta hud_panel_centerprint_bg_padding ""
 seta hud_panel_centerprint_align "0.5"
-seta hud_panel_centerprint_flip "1"
+seta hud_panel_centerprint_flip "0"
 seta hud_panel_centerprint_fontscale "1"
 seta hud_panel_centerprint_time "3"
-seta hud_panel_centerprint_fadetime "0.25"
+seta hud_panel_centerprint_fade_in "0.2"
+seta hud_panel_centerprint_fade_out "0.5"
+seta hud_panel_centerprint_fade_subsequent "1"
+seta hud_panel_centerprint_fade_subsequent_passone "3"
+seta hud_panel_centerprint_fade_subsequent_passone_minalpha "0.5"
+seta hud_panel_centerprint_fade_subsequent_passtwo "10" 
+seta hud_panel_centerprint_fade_subsequent_passtwo_minalpha "0.5"
+seta hud_panel_centerprint_fade_subsequent_minfontsize "0.75"
+seta hud_panel_centerprint_fade_minfontsize "0"
 
 menu_sync
diff --git a/hud_luminos_minimal_xhair.cfg b/hud_luminos_minimal_xhair.cfg
new file mode 100644 (file)
index 0000000..7e44f8c
--- /dev/null
@@ -0,0 +1,288 @@
+seta hud_skin "luminos_xhair"
+seta hud_panel_bg "0"
+seta hud_panel_bg_color "1 0.4375 0"
+seta hud_panel_bg_color_team "0"
+seta hud_panel_bg_alpha "1"
+seta hud_panel_bg_border "8"
+seta hud_panel_bg_padding "2"
+seta hud_panel_fg_alpha "1"
+
+seta hud_dock "0"
+seta hud_dock_color "0 0.449576 0.860796"
+seta hud_dock_color_team "0.700000"
+seta hud_dock_alpha "1"
+
+seta hud_progressbar_alpha "0.3"
+seta hud_progressbar_strength_color "0 0 0.6"
+seta hud_progressbar_shield_color "0.6 0 0.6"
+seta hud_progressbar_health_color "0.6 0 0"
+seta hud_progressbar_armor_color "0 0.6 0"
+seta hud_progressbar_fuel_color "0.6 0.6 0"
+seta hud_progressbar_nexball_color "0.7 0.1 0"
+seta hud_progressbar_speed_color "1 0.75 0" 
+seta hud_progressbar_acceleration_color "0.5 0.75 1" 
+seta hud_progressbar_acceleration_neg_color "0.125 0.25 0.5" 
+
+seta _hud_panelorder "15 3 1 2 11 10 0 14 6 9 13 4 12 7 5 8 16 "
+
+seta hud_configure_grid "1"
+seta hud_configure_grid_xsize "0.010000"
+seta hud_configure_grid_ysize "0.010000"
+
+seta hud_panel_weapons 1
+seta hud_panel_weapons_pos "0.350000 0.940000"
+seta hud_panel_weapons_size "0.300000 0.060000"
+seta hud_panel_weapons_bg ""
+seta hud_panel_weapons_bg_color ""
+seta hud_panel_weapons_bg_color_team ""
+seta hud_panel_weapons_bg_alpha ""
+seta hud_panel_weapons_bg_border ""
+seta hud_panel_weapons_bg_padding ""
+seta hud_panel_weapons_accuracy "1"
+seta hud_panel_weapons_label "1"
+seta hud_panel_weapons_complainbubble "1"
+seta hud_panel_weapons_complainbubble_padding "-10"
+seta hud_panel_weapons_complainbubble_time "1"
+seta hud_panel_weapons_complainbubble_fadetime "0.25"
+seta hud_panel_weapons_complainbubble_color_outofammo "0.8 0 0"
+seta hud_panel_weapons_complainbubble_color_donthave "0.8 0.5 0"
+seta hud_panel_weapons_complainbubble_color_unavailable "0 0.3 0.8"
+seta hud_panel_weapons_ammo "1"
+seta hud_panel_weapons_ammo_color "0 1 0"
+seta hud_panel_weapons_ammo_alpha "1"
+seta hud_panel_weapons_aspect "2"
+seta hud_panel_weapons_timeout "0"
+seta hud_panel_weapons_timeout_effect "0"
+seta hud_panel_weapons_onlyowned "1"
+
+seta hud_panel_ammo 1
+seta hud_panel_ammo_pos "0.450000 0.630000"
+seta hud_panel_ammo_size "0.080000 0.040000"
+seta hud_panel_ammo_bg ""
+seta hud_panel_ammo_bg_color ""
+seta hud_panel_ammo_bg_color_team ""
+seta hud_panel_ammo_bg_alpha ""
+seta hud_panel_ammo_bg_border ""
+seta hud_panel_ammo_bg_padding ""
+seta hud_panel_ammo_onlycurrent "1"
+seta hud_panel_ammo_iconalign "0"
+seta hud_panel_ammo_progressbar "1"
+seta hud_panel_ammo_progressbar_name "progressbar_ammo"
+seta hud_panel_ammo_progressbar_xoffset "0.32"
+seta hud_panel_ammo_text "1"
+
+seta hud_panel_powerups 1
+seta hud_panel_powerups_pos "0.270000 0.940000"
+seta hud_panel_powerups_size "0.080000 0.060000"
+seta hud_panel_powerups_bg "0"
+seta hud_panel_powerups_bg_color ""
+seta hud_panel_powerups_bg_color_team ""
+seta hud_panel_powerups_bg_alpha ""
+seta hud_panel_powerups_bg_border ""
+seta hud_panel_powerups_bg_padding "-3"
+seta hud_panel_powerups_flip "1"
+seta hud_panel_powerups_iconalign "1"
+seta hud_panel_powerups_baralign "1"
+seta hud_panel_powerups_progressbar "1"
+seta hud_panel_powerups_progressbar_strength "progressbar"
+seta hud_panel_powerups_progressbar_shield "progressbar"
+seta hud_panel_powerups_text "1"
+
+seta hud_panel_healtharmor 1
+seta hud_panel_healtharmor_pos "0.350000 0.380000"
+seta hud_panel_healtharmor_size "0.070000 0.240000"
+seta hud_panel_healtharmor_bg "border_healtharmor"
+seta hud_panel_healtharmor_bg_color "0.464391 0.464391 0.464391"
+seta hud_panel_healtharmor_bg_color_team ""
+seta hud_panel_healtharmor_bg_alpha "0.600000"
+seta hud_panel_healtharmor_bg_border "-1"
+seta hud_panel_healtharmor_bg_padding "0"
+seta hud_panel_healtharmor_flip "0"
+seta hud_panel_healtharmor_iconalign "1"
+seta hud_panel_healtharmor_baralign "1"
+seta hud_panel_healtharmor_progressbar "1"
+seta hud_panel_healtharmor_progressbar_health "progressbar_health"
+seta hud_panel_healtharmor_progressbar_armor "progressbar_armor"
+seta hud_panel_healtharmor_progressbar_gfx "1"
+seta hud_panel_healtharmor_progressbar_gfx_smooth "2"
+seta hud_panel_healtharmor_text "0"
+
+seta hud_panel_notify 1
+seta hud_panel_notify_pos "0 0"
+seta hud_panel_notify_size "0.210000 0.260000"
+seta hud_panel_notify_bg "0"
+seta hud_panel_notify_bg_color ""
+seta hud_panel_notify_bg_color_team ""
+seta hud_panel_notify_bg_alpha ""
+seta hud_panel_notify_bg_border ""
+seta hud_panel_notify_bg_padding ""
+seta hud_panel_notify_flip "1"
+seta hud_panel_notify_fontsize "0.8"
+seta hud_panel_notify_print "0"
+seta hud_panel_notify_time "10"
+seta hud_panel_notify_fadetime "3"
+
+seta hud_panel_timer 1
+seta hud_panel_timer_pos "0.435000 0"
+seta hud_panel_timer_size "0.135000 0.060000"
+seta hud_panel_timer_bg "0"
+seta hud_panel_timer_bg_color ""
+seta hud_panel_timer_bg_color_team ""
+seta hud_panel_timer_bg_alpha ""
+seta hud_panel_timer_bg_border ""
+seta hud_panel_timer_bg_padding "0"
+seta hud_panel_timer_increment "0"
+
+seta hud_panel_radar 2
+seta hud_panel_radar_pos "0.810000 0"
+seta hud_panel_radar_size "0.190000 0.250000"
+seta hud_panel_radar_bg "border_radar"
+seta hud_panel_radar_bg_color ""
+seta hud_panel_radar_bg_color_team ""
+seta hud_panel_radar_bg_alpha "0.500000"
+seta hud_panel_radar_bg_border "0"
+seta hud_panel_radar_bg_padding "0"
+seta hud_panel_radar_foreground_alpha "0.500000"
+seta hud_panel_radar_rotation "0"
+seta hud_panel_radar_zoommode "0"
+seta hud_panel_radar_scale "4096"
+seta hud_panel_radar_maximized_scale "8192"
+seta hud_panel_radar_maximized_size "0.5 0.5"
+
+seta hud_panel_score 1
+seta hud_panel_score_pos "0.465000 0.045000"
+seta hud_panel_score_size "0.090000 0.060000"
+seta hud_panel_score_bg ""
+seta hud_panel_score_bg_color ""
+seta hud_panel_score_bg_color_team ""
+seta hud_panel_score_bg_alpha ""
+seta hud_panel_score_bg_border ""
+seta hud_panel_score_bg_padding ""
+seta hud_panel_score_rankings "1"
+
+seta hud_panel_racetimer 1
+seta hud_panel_racetimer_pos "0.360000 0.090000"
+seta hud_panel_racetimer_size "0.280000 0.090000"
+seta hud_panel_racetimer_bg "0"
+seta hud_panel_racetimer_bg_color ""
+seta hud_panel_racetimer_bg_color_team ""
+seta hud_panel_racetimer_bg_alpha ""
+seta hud_panel_racetimer_bg_border ""
+seta hud_panel_racetimer_bg_padding ""
+
+seta hud_panel_vote 1
+seta hud_panel_vote_pos "0 0.890000"
+seta hud_panel_vote_size "0.170000 0.110000"
+seta hud_panel_vote_bg ""
+seta hud_panel_vote_bg_color ""
+seta hud_panel_vote_bg_color_team ""
+seta hud_panel_vote_bg_alpha ""
+seta hud_panel_vote_bg_border ""
+seta hud_panel_vote_bg_padding ""
+seta hud_panel_vote_alreadyvoted_alpha "0.800000"
+
+seta hud_panel_modicons 1
+seta hud_panel_modicons_pos "0.560000 0"
+seta hud_panel_modicons_size "0.050000 0.100000"
+seta hud_panel_modicons_bg ""
+seta hud_panel_modicons_bg_color ""
+seta hud_panel_modicons_bg_color_team ""
+seta hud_panel_modicons_bg_alpha ""
+seta hud_panel_modicons_bg_border ""
+seta hud_panel_modicons_bg_padding ""
+seta hud_panel_modicons_dom_layout "1"
+
+seta hud_panel_pressedkeys 1
+seta hud_panel_pressedkeys_pos "0.450000 0.690000"
+seta hud_panel_pressedkeys_size "0.100000 0.110000"
+seta hud_panel_pressedkeys_bg "0"
+seta hud_panel_pressedkeys_bg_color ""
+seta hud_panel_pressedkeys_bg_color_team ""
+seta hud_panel_pressedkeys_bg_alpha ""
+seta hud_panel_pressedkeys_bg_border ""
+seta hud_panel_pressedkeys_bg_padding ""
+seta hud_panel_pressedkeys_aspect "1.600000"
+
+seta hud_panel_chat 1
+seta hud_panel_chat_pos "0 0.775000"
+seta hud_panel_chat_size "0.460000 0.110000"
+seta hud_panel_chat_bg "0"
+seta hud_panel_chat_bg_color ""
+seta hud_panel_chat_bg_color_team ""
+seta hud_panel_chat_bg_alpha ""
+seta hud_panel_chat_bg_border ""
+seta hud_panel_chat_bg_padding ""
+
+seta hud_panel_engineinfo 0
+seta hud_panel_engineinfo_pos "0.910000 0.970000"
+seta hud_panel_engineinfo_size "0.090000 0.030000"
+seta hud_panel_engineinfo_bg "0"
+seta hud_panel_engineinfo_bg_color ""
+seta hud_panel_engineinfo_bg_color_team ""
+seta hud_panel_engineinfo_bg_alpha ""
+seta hud_panel_engineinfo_bg_border ""
+seta hud_panel_engineinfo_bg_padding ""
+seta hud_panel_engineinfo_framecounter_time "0.1"
+seta hud_panel_engineinfo_framecounter_decimals "0"
+
+seta hud_panel_infomessages 1
+seta hud_panel_infomessages_pos "0.710000 0"
+seta hud_panel_infomessages_size "0.290000 0.100000"
+seta hud_panel_infomessages_bg "0"
+seta hud_panel_infomessages_bg_color ""
+seta hud_panel_infomessages_bg_color_team ""
+seta hud_panel_infomessages_bg_alpha ""
+seta hud_panel_infomessages_bg_border ""
+seta hud_panel_infomessages_bg_padding "0"
+seta hud_panel_infomessages_flip "1"
+
+seta hud_panel_physics 3
+seta hud_panel_physics_pos "0.270000 0.730000"
+seta hud_panel_physics_size "0.170000 0.030000"
+seta hud_panel_physics_bg ""
+seta hud_panel_physics_bg_color ""
+seta hud_panel_physics_bg_color_team ""
+seta hud_panel_physics_bg_alpha ""
+seta hud_panel_physics_bg_border ""
+seta hud_panel_physics_bg_padding ""
+seta hud_panel_physics_speed_unit "3"
+seta hud_panel_physics_speed_unit_show "1"
+seta hud_panel_physics_speed_max "1800"
+seta hud_panel_physics_speed_vertical "0"
+seta hud_panel_physics_topspeed "1"
+seta hud_panel_physics_topspeed_time "4"
+seta hud_panel_physics_acceleration_max "1.5"
+seta hud_panel_physics_acceleration_vertical "0"
+seta hud_panel_physics_flip "0"
+seta hud_panel_physics_baralign "0"
+seta hud_panel_physics_progressbar "3"
+seta hud_panel_physics_acceleration_progressbar_mode "0"
+seta hud_panel_physics_acceleration_progressbar_scale "1"
+seta hud_panel_physics_acceleration_progressbar_nonlinear "0"
+seta hud_panel_physics_text "1"
+seta hud_panel_physics_text_scale "0.7"
+
+seta hud_panel_centerprint 1
+seta hud_panel_centerprint_pos "0.175000 0.220000"
+seta hud_panel_centerprint_size "0.650000 0.220000"
+seta hud_panel_centerprint_bg "0"
+seta hud_panel_centerprint_bg_color ""
+seta hud_panel_centerprint_bg_color_team ""
+seta hud_panel_centerprint_bg_alpha ""
+seta hud_panel_centerprint_bg_border ""
+seta hud_panel_centerprint_bg_padding ""
+seta hud_panel_centerprint_align "0.5"
+seta hud_panel_centerprint_flip "0"
+seta hud_panel_centerprint_fontscale "1"
+seta hud_panel_centerprint_time "3"
+seta hud_panel_centerprint_fade_in "0.2"
+seta hud_panel_centerprint_fade_out "0.5"
+seta hud_panel_centerprint_fade_subsequent "1"
+seta hud_panel_centerprint_fade_subsequent_passone "3"
+seta hud_panel_centerprint_fade_subsequent_passone_minalpha "0.5"
+seta hud_panel_centerprint_fade_subsequent_passtwo "10" 
+seta hud_panel_centerprint_fade_subsequent_passtwo_minalpha "0.5"
+seta hud_panel_centerprint_fade_subsequent_minfontsize "0.75"
+seta hud_panel_centerprint_fade_minfontsize "0"
+
+menu_sync
index 4308c0b4feb4646b99d23bb8aeff667849e949fd..f96e461cace0ed0e18c64238c7b82d3e9b8ecfb8 100644 (file)
@@ -19,9 +19,9 @@ seta hud_progressbar_health_color "0.6 0 0"
 seta hud_progressbar_armor_color "0 0.6 0"
 seta hud_progressbar_fuel_color "0.6 0.6 0"
 seta hud_progressbar_nexball_color "0.7 0.1 0"
-seta hud_progressbar_speed_color "1 0.75 0"
-seta hud_progressbar_acceleration_color "0.5 0.75 1"
-seta hud_progressbar_acceleration_neg_color "0.125 0.25 0.5"
+seta hud_progressbar_speed_color "1 0.75 0" 
+seta hud_progressbar_acceleration_color "0.5 0.75 1" 
+seta hud_progressbar_acceleration_neg_color "0.125 0.25 0.5" 
 
 seta _hud_panelorder "15 10 9 6 8 14 5 0 4 13 2 7 1 3 11 12 16 "
 
@@ -38,16 +38,22 @@ seta hud_panel_weapons_bg_color_team ""
 seta hud_panel_weapons_bg_alpha ""
 seta hud_panel_weapons_bg_border ""
 seta hud_panel_weapons_bg_padding ""
+seta hud_panel_weapons_accuracy "1"
+seta hud_panel_weapons_label "1"
 seta hud_panel_weapons_complainbubble "1"
 seta hud_panel_weapons_complainbubble_padding "-10"
+seta hud_panel_weapons_complainbubble_time "1"
+seta hud_panel_weapons_complainbubble_fadetime "0.25"
 seta hud_panel_weapons_complainbubble_color_outofammo "0.8 0 0"
 seta hud_panel_weapons_complainbubble_color_donthave "0.8 0.5 0"
 seta hud_panel_weapons_complainbubble_color_unavailable "0 0.3 0.8"
+seta hud_panel_weapons_ammo "1"
 seta hud_panel_weapons_ammo_color "0 1 0"
 seta hud_panel_weapons_ammo_alpha "1"
 seta hud_panel_weapons_aspect "2"
 seta hud_panel_weapons_timeout "3"
 seta hud_panel_weapons_timeout_effect "1"
+seta hud_panel_weapons_onlyowned "1"
 
 seta hud_panel_ammo 1
 seta hud_panel_ammo_pos "0.190000 0.920000"
@@ -61,8 +67,8 @@ seta hud_panel_ammo_bg_padding ""
 seta hud_panel_ammo_onlycurrent "0"
 seta hud_panel_ammo_iconalign "0"
 seta hud_panel_ammo_progressbar "0"
-seta hud_panel_ammo_progressbar_xoffset "0"
 seta hud_panel_ammo_progressbar_name "progressbar"
+seta hud_panel_ammo_progressbar_xoffset "0"
 seta hud_panel_ammo_text "1"
 
 seta hud_panel_powerups 1
@@ -97,6 +103,8 @@ seta hud_panel_healtharmor_baralign "3"
 seta hud_panel_healtharmor_progressbar "1"
 seta hud_panel_healtharmor_progressbar_health "progressbar"
 seta hud_panel_healtharmor_progressbar_armor "progressbar"
+seta hud_panel_healtharmor_progressbar_gfx "1"
+seta hud_panel_healtharmor_progressbar_gfx_smooth "2"
 seta hud_panel_healtharmor_text "1"
 
 seta hud_panel_notify 1
@@ -111,6 +119,8 @@ seta hud_panel_notify_bg_padding ""
 seta hud_panel_notify_flip "0"
 seta hud_panel_notify_fontsize "0.8"
 seta hud_panel_notify_print "1"
+seta hud_panel_notify_time "10"
+seta hud_panel_notify_fadetime "3"
 
 seta hud_panel_timer 1
 seta hud_panel_timer_pos "0.870000 0"
@@ -121,8 +131,9 @@ seta hud_panel_timer_bg_color_team ""
 seta hud_panel_timer_bg_alpha ""
 seta hud_panel_timer_bg_border ""
 seta hud_panel_timer_bg_padding "0"
+seta hud_panel_timer_increment "0"
 
-seta hud_panel_radar 2 // enabled for keepaway and to make the HUD consistent throughout game modes
+seta hud_panel_radar 2
 seta hud_panel_radar_pos "0.030000 0.020000"
 seta hud_panel_radar_size "0.170000 0.220000"
 seta hud_panel_radar_bg ""
@@ -132,6 +143,11 @@ seta hud_panel_radar_bg_alpha ""
 seta hud_panel_radar_bg_border ""
 seta hud_panel_radar_bg_padding "-3"
 seta hud_panel_radar_foreground_alpha "0.800000"
+seta hud_panel_radar_rotation "0"
+seta hud_panel_radar_zoommode "0"
+seta hud_panel_radar_scale "4096"
+seta hud_panel_radar_maximized_scale "8192"
+seta hud_panel_radar_maximized_size "0.5 0.5"
 
 seta hud_panel_score 1
 seta hud_panel_score_pos "0.020000 0.920000"
@@ -142,6 +158,7 @@ seta hud_panel_score_bg_color_team ""
 seta hud_panel_score_bg_alpha ""
 seta hud_panel_score_bg_border ""
 seta hud_panel_score_bg_padding ""
+seta hud_panel_score_rankings "1"
 
 seta hud_panel_racetimer 1
 seta hud_panel_racetimer_pos "0.360000 0.090000"
@@ -173,6 +190,7 @@ seta hud_panel_modicons_bg_color_team ""
 seta hud_panel_modicons_bg_alpha ""
 seta hud_panel_modicons_bg_border ""
 seta hud_panel_modicons_bg_padding ""
+seta hud_panel_modicons_dom_layout "1"
 
 seta hud_panel_pressedkeys 1
 seta hud_panel_pressedkeys_pos "0.410000 0.710000"
@@ -204,6 +222,8 @@ seta hud_panel_engineinfo_bg_color_team ""
 seta hud_panel_engineinfo_bg_alpha ""
 seta hud_panel_engineinfo_bg_border ""
 seta hud_panel_engineinfo_bg_padding ""
+seta hud_panel_engineinfo_framecounter_time "0.1"
+seta hud_panel_engineinfo_framecounter_decimals "0"
 
 seta hud_panel_infomessages 1
 seta hud_panel_infomessages_pos "0.510000 0"
@@ -225,15 +245,26 @@ seta hud_panel_physics_bg_color_team ""
 seta hud_panel_physics_bg_alpha ""
 seta hud_panel_physics_bg_border ""
 seta hud_panel_physics_bg_padding ""
+seta hud_panel_physics_speed_unit "3"
+seta hud_panel_physics_speed_unit_show "1"
+seta hud_panel_physics_speed_max "1800"
+seta hud_panel_physics_speed_vertical "0"
+seta hud_panel_physics_topspeed "1"
+seta hud_panel_physics_topspeed_time "4"
+seta hud_panel_physics_acceleration_max "1.5"
+seta hud_panel_physics_acceleration_vertical "0"
 seta hud_panel_physics_flip "0"
 seta hud_panel_physics_baralign "0"
-seta hud_panel_physics_acceleration_progressbar_mode "0"
 seta hud_panel_physics_progressbar "1"
+seta hud_panel_physics_acceleration_progressbar_mode "0"
+seta hud_panel_physics_acceleration_progressbar_scale "1"
+seta hud_panel_physics_acceleration_progressbar_nonlinear "0"
 seta hud_panel_physics_text "1"
+seta hud_panel_physics_text_scale "0.7"
 
 seta hud_panel_centerprint 1
-seta hud_panel_centerprint_pos "0.175000 0.260000"
-seta hud_panel_centerprint_size "0.650000 0.210000"
+seta hud_panel_centerprint_pos "0.175000 0.220000"
+seta hud_panel_centerprint_size "0.650000 0.220000"
 seta hud_panel_centerprint_bg "0"
 seta hud_panel_centerprint_bg_color ""
 seta hud_panel_centerprint_bg_color_team ""
@@ -241,9 +272,17 @@ seta hud_panel_centerprint_bg_alpha ""
 seta hud_panel_centerprint_bg_border ""
 seta hud_panel_centerprint_bg_padding ""
 seta hud_panel_centerprint_align "0.5"
-seta hud_panel_centerprint_flip "1"
+seta hud_panel_centerprint_flip "0"
 seta hud_panel_centerprint_fontscale "1"
 seta hud_panel_centerprint_time "3"
-seta hud_panel_centerprint_fadetime "0.25"
+seta hud_panel_centerprint_fade_in "0.2"
+seta hud_panel_centerprint_fade_out "0.5"
+seta hud_panel_centerprint_fade_subsequent "1"
+seta hud_panel_centerprint_fade_subsequent_passone "3"
+seta hud_panel_centerprint_fade_subsequent_passone_minalpha "0.5"
+seta hud_panel_centerprint_fade_subsequent_passtwo "10" 
+seta hud_panel_centerprint_fade_subsequent_passtwo_minalpha "0.5"
+seta hud_panel_centerprint_fade_subsequent_minfontsize "0.75"
+seta hud_panel_centerprint_fade_minfontsize "0"
 
 menu_sync
diff --git a/hud_luminos_xhair_minimal.cfg b/hud_luminos_xhair_minimal.cfg
deleted file mode 100644 (file)
index 2aca597..0000000
+++ /dev/null
@@ -1,249 +0,0 @@
-seta hud_skin "luminos_xhair"
-seta hud_panel_bg "0"
-seta hud_panel_bg_color "1 0.4375 0"
-seta hud_panel_bg_color_team "0"
-seta hud_panel_bg_alpha "1"
-seta hud_panel_bg_border "8"
-seta hud_panel_bg_padding "2"
-seta hud_panel_fg_alpha "1"
-
-seta hud_dock "0"
-seta hud_dock_color "0 0.449576 0.860796"
-seta hud_dock_color_team "0.700000"
-seta hud_dock_alpha "1"
-
-seta hud_progressbar_alpha "0.3"
-seta hud_progressbar_strength_color "0 0 0.6"
-seta hud_progressbar_shield_color "0.6 0 0.6"
-seta hud_progressbar_health_color "0.6 0 0"
-seta hud_progressbar_armor_color "0 0.6 0"
-seta hud_progressbar_fuel_color "0.6 0.6 0"
-seta hud_progressbar_nexball_color "0.7 0.1 0"
-seta hud_progressbar_speed_color "1 0.75 0"
-seta hud_progressbar_acceleration_color "0.5 0.75 1"
-seta hud_progressbar_acceleration_neg_color "0.125 0.25 0.5"
-
-seta _hud_panelorder "15 3 1 2 11 10 0 14 6 9 13 4 12 7 5 8 16 "
-
-seta hud_configure_grid "1"
-seta hud_configure_grid_xsize "0.010000"
-seta hud_configure_grid_ysize "0.010000"
-
-seta hud_panel_weapons 1
-seta hud_panel_weapons_pos "0.350000 0.940000"
-seta hud_panel_weapons_size "0.300000 0.060000"
-seta hud_panel_weapons_bg ""
-seta hud_panel_weapons_bg_color ""
-seta hud_panel_weapons_bg_color_team ""
-seta hud_panel_weapons_bg_alpha ""
-seta hud_panel_weapons_bg_border ""
-seta hud_panel_weapons_bg_padding ""
-seta hud_panel_weapons_complainbubble "1"
-seta hud_panel_weapons_complainbubble_padding "-10"
-seta hud_panel_weapons_complainbubble_color_outofammo "0.8 0 0"
-seta hud_panel_weapons_complainbubble_color_donthave "0.8 0.5 0"
-seta hud_panel_weapons_complainbubble_color_unavailable "0 0.3 0.8"
-seta hud_panel_weapons_ammo_color "0 1 0"
-seta hud_panel_weapons_ammo_alpha "1"
-seta hud_panel_weapons_aspect "2"
-seta hud_panel_weapons_timeout "0"
-seta hud_panel_weapons_timeout_effect "0"
-
-seta hud_panel_ammo 1
-seta hud_panel_ammo_pos "0.450000 0.630000"
-seta hud_panel_ammo_size "0.080000 0.040000"
-seta hud_panel_ammo_bg ""
-seta hud_panel_ammo_bg_color ""
-seta hud_panel_ammo_bg_color_team ""
-seta hud_panel_ammo_bg_alpha ""
-seta hud_panel_ammo_bg_border ""
-seta hud_panel_ammo_bg_padding ""
-seta hud_panel_ammo_onlycurrent "1"
-seta hud_panel_ammo_iconalign "0"
-seta hud_panel_ammo_progressbar "1"
-seta hud_panel_ammo_progressbar_name "progressbar_ammo"
-seta hud_panel_ammo_progressbar_xoffset "0.32"
-seta hud_panel_ammo_text "1"
-
-seta hud_panel_powerups 1
-seta hud_panel_powerups_pos "0.270000 0.940000"
-seta hud_panel_powerups_size "0.080000 0.060000"
-seta hud_panel_powerups_bg "0"
-seta hud_panel_powerups_bg_color ""
-seta hud_panel_powerups_bg_color_team ""
-seta hud_panel_powerups_bg_alpha ""
-seta hud_panel_powerups_bg_border ""
-seta hud_panel_powerups_bg_padding "-3"
-seta hud_panel_powerups_flip "1"
-seta hud_panel_powerups_iconalign "1"
-seta hud_panel_powerups_baralign "1"
-seta hud_panel_powerups_progressbar "1"
-seta hud_panel_powerups_progressbar_strength "progressbar"
-seta hud_panel_powerups_progressbar_shield "progressbar"
-seta hud_panel_powerups_text "0"
-
-seta hud_panel_healtharmor 1
-seta hud_panel_healtharmor_pos "0.350000 0.380000"
-seta hud_panel_healtharmor_size "0.070000 0.240000"
-seta hud_panel_healtharmor_bg "border_healtharmor"
-seta hud_panel_healtharmor_bg_color "0.464391 0.464391 0.464391"
-seta hud_panel_healtharmor_bg_color_team ""
-seta hud_panel_healtharmor_bg_alpha "0.600000"
-seta hud_panel_healtharmor_bg_border "-1"
-seta hud_panel_healtharmor_bg_padding "0"
-seta hud_panel_healtharmor_flip "0"
-seta hud_panel_healtharmor_iconalign "1"
-seta hud_panel_healtharmor_baralign "1"
-seta hud_panel_healtharmor_progressbar "1"
-seta hud_panel_healtharmor_progressbar_health "progressbar_health"
-seta hud_panel_healtharmor_progressbar_armor "progressbar_armor"
-seta hud_panel_healtharmor_text "0"
-
-seta hud_panel_notify 1
-seta hud_panel_notify_pos "0 0"
-seta hud_panel_notify_size "0.210000 0.260000"
-seta hud_panel_notify_bg "0"
-seta hud_panel_notify_bg_color ""
-seta hud_panel_notify_bg_color_team ""
-seta hud_panel_notify_bg_alpha ""
-seta hud_panel_notify_bg_border ""
-seta hud_panel_notify_bg_padding ""
-seta hud_panel_notify_flip "1"
-seta hud_panel_notify_fontsize "0.8"
-seta hud_panel_notify_print "0"
-
-seta hud_panel_timer 1
-seta hud_panel_timer_pos "0.435000 0"
-seta hud_panel_timer_size "0.135000 0.060000"
-seta hud_panel_timer_bg "0"
-seta hud_panel_timer_bg_color ""
-seta hud_panel_timer_bg_color_team ""
-seta hud_panel_timer_bg_alpha ""
-seta hud_panel_timer_bg_border ""
-seta hud_panel_timer_bg_padding "0"
-
-seta hud_panel_radar 2
-seta hud_panel_radar_pos "0.810000 0"
-seta hud_panel_radar_size "0.190000 0.250000"
-seta hud_panel_radar_bg "border_radar"
-seta hud_panel_radar_bg_color ""
-seta hud_panel_radar_bg_color_team ""
-seta hud_panel_radar_bg_alpha "0.500000"
-seta hud_panel_radar_bg_border "0"
-seta hud_panel_radar_bg_padding "0"
-seta hud_panel_radar_foreground_alpha "0.500000"
-
-seta hud_panel_score 1
-seta hud_panel_score_pos "0.465000 0.045000"
-seta hud_panel_score_size "0.090000 0.060000"
-seta hud_panel_score_bg ""
-seta hud_panel_score_bg_color ""
-seta hud_panel_score_bg_color_team ""
-seta hud_panel_score_bg_alpha ""
-seta hud_panel_score_bg_border ""
-seta hud_panel_score_bg_padding ""
-
-seta hud_panel_racetimer 1
-seta hud_panel_racetimer_pos "0.360000 0.090000"
-seta hud_panel_racetimer_size "0.280000 0.090000"
-seta hud_panel_racetimer_bg "0"
-seta hud_panel_racetimer_bg_color ""
-seta hud_panel_racetimer_bg_color_team ""
-seta hud_panel_racetimer_bg_alpha ""
-seta hud_panel_racetimer_bg_border ""
-seta hud_panel_racetimer_bg_padding ""
-
-seta hud_panel_vote 1
-seta hud_panel_vote_pos "0 0.890000"
-seta hud_panel_vote_size "0.170000 0.110000"
-seta hud_panel_vote_bg ""
-seta hud_panel_vote_bg_color ""
-seta hud_panel_vote_bg_color_team ""
-seta hud_panel_vote_bg_alpha ""
-seta hud_panel_vote_bg_border ""
-seta hud_panel_vote_bg_padding ""
-seta hud_panel_vote_alreadyvoted_alpha "0.800000"
-
-seta hud_panel_modicons 1
-seta hud_panel_modicons_pos "0.560000 0"
-seta hud_panel_modicons_size "0.050000 0.100000"
-seta hud_panel_modicons_bg ""
-seta hud_panel_modicons_bg_color ""
-seta hud_panel_modicons_bg_color_team ""
-seta hud_panel_modicons_bg_alpha ""
-seta hud_panel_modicons_bg_border ""
-seta hud_panel_modicons_bg_padding ""
-
-seta hud_panel_pressedkeys 1
-seta hud_panel_pressedkeys_pos "0.450000 0.690000"
-seta hud_panel_pressedkeys_size "0.100000 0.110000"
-seta hud_panel_pressedkeys_bg "0"
-seta hud_panel_pressedkeys_bg_color ""
-seta hud_panel_pressedkeys_bg_color_team ""
-seta hud_panel_pressedkeys_bg_alpha ""
-seta hud_panel_pressedkeys_bg_border ""
-seta hud_panel_pressedkeys_bg_padding ""
-seta hud_panel_pressedkeys_aspect "1.600000"
-
-seta hud_panel_chat 1
-seta hud_panel_chat_pos "0 0.775000"
-seta hud_panel_chat_size "0.460000 0.110000"
-seta hud_panel_chat_bg "0"
-seta hud_panel_chat_bg_color ""
-seta hud_panel_chat_bg_color_team ""
-seta hud_panel_chat_bg_alpha ""
-seta hud_panel_chat_bg_border ""
-seta hud_panel_chat_bg_padding ""
-
-seta hud_panel_engineinfo 0
-seta hud_panel_engineinfo_pos "0.910000 0.970000"
-seta hud_panel_engineinfo_size "0.090000 0.030000"
-seta hud_panel_engineinfo_bg "0"
-seta hud_panel_engineinfo_bg_color ""
-seta hud_panel_engineinfo_bg_color_team ""
-seta hud_panel_engineinfo_bg_alpha ""
-seta hud_panel_engineinfo_bg_border ""
-seta hud_panel_engineinfo_bg_padding ""
-
-seta hud_panel_infomessages 1
-seta hud_panel_infomessages_pos "0.710000 0"
-seta hud_panel_infomessages_size "0.290000 0.100000"
-seta hud_panel_infomessages_bg "0"
-seta hud_panel_infomessages_bg_color ""
-seta hud_panel_infomessages_bg_color_team ""
-seta hud_panel_infomessages_bg_alpha ""
-seta hud_panel_infomessages_bg_border ""
-seta hud_panel_infomessages_bg_padding "0"
-seta hud_panel_infomessages_flip "1"
-
-seta hud_panel_physics 3
-seta hud_panel_physics_pos "0.270000 0.730000"
-seta hud_panel_physics_size "0.170000 0.030000"
-seta hud_panel_physics_bg ""
-seta hud_panel_physics_bg_color ""
-seta hud_panel_physics_bg_color_team ""
-seta hud_panel_physics_bg_alpha ""
-seta hud_panel_physics_bg_border ""
-seta hud_panel_physics_bg_padding ""
-seta hud_panel_physics_flip "0"
-seta hud_panel_physics_baralign "0"
-seta hud_panel_physics_acceleration_progressbar_mode "0"
-seta hud_panel_physics_progressbar "3"
-seta hud_panel_physics_text "2"
-
-seta hud_panel_centerprint 1
-seta hud_panel_centerprint_pos "0.175000 0.260000"
-seta hud_panel_centerprint_size "0.650000 0.210000"
-seta hud_panel_centerprint_bg "0"
-seta hud_panel_centerprint_bg_color ""
-seta hud_panel_centerprint_bg_color_team ""
-seta hud_panel_centerprint_bg_alpha ""
-seta hud_panel_centerprint_bg_border ""
-seta hud_panel_centerprint_bg_padding ""
-seta hud_panel_centerprint_align "0.5"
-seta hud_panel_centerprint_flip "1"
-seta hud_panel_centerprint_fontscale "1"
-seta hud_panel_centerprint_time "3"
-seta hud_panel_centerprint_fadetime "0.25"
-
-menu_sync
index 705af40a12ff230625c1ac3762524954050943aa..e3f0a9428a7553194e1f4bef8ba4bbb43faf4d4f 100644 (file)
@@ -19,9 +19,9 @@ seta hud_progressbar_health_color "0.6 0 0"
 seta hud_progressbar_armor_color "0 0.6 0"
 seta hud_progressbar_fuel_color "0.6 0.6 0"
 seta hud_progressbar_nexball_color "0.7 0.1 0"
-seta hud_progressbar_speed_color "0.25 0.25 1"
-seta hud_progressbar_acceleration_color "0.25 1 0.25"
-seta hud_progressbar_acceleration_neg_color "1 0.25 0.25"
+seta hud_progressbar_speed_color "1 0.75 0" 
+seta hud_progressbar_acceleration_color "0.5 0.75 1" 
+seta hud_progressbar_acceleration_neg_color "0.125 0.25 0.5" 
 
 seta _hud_panelorder "15 0 11 8 5 6 14 9 13 7 2 3 1 10 12 4 16 "
 
@@ -30,24 +30,30 @@ seta hud_configure_grid_xsize "0.01"
 seta hud_configure_grid_ysize "0.01"
 
 seta hud_panel_weapons 1
-seta hud_panel_weapons_pos "0.370000 0.870000"
-seta hud_panel_weapons_size "0.340000 0.060000"
+seta hud_panel_weapons_pos "0.375000 0.870000"
+seta hud_panel_weapons_size "0.300000 0.060000"
 seta hud_panel_weapons_bg "0"
 seta hud_panel_weapons_bg_color ""
 seta hud_panel_weapons_bg_color_team ""
 seta hud_panel_weapons_bg_alpha ""
 seta hud_panel_weapons_bg_border ""
 seta hud_panel_weapons_bg_padding "-5"
+seta hud_panel_weapons_accuracy "1"
+seta hud_panel_weapons_label "1"
 seta hud_panel_weapons_complainbubble "1"
 seta hud_panel_weapons_complainbubble_padding "-10"
+seta hud_panel_weapons_complainbubble_time "1"
+seta hud_panel_weapons_complainbubble_fadetime "0.25"
 seta hud_panel_weapons_complainbubble_color_outofammo "0.8 0 0"
 seta hud_panel_weapons_complainbubble_color_donthave "0.8 0.5 0"
 seta hud_panel_weapons_complainbubble_color_unavailable "0 0.3 0.8"
+seta hud_panel_weapons_ammo "1"
 seta hud_panel_weapons_ammo_color "0 1 0"
 seta hud_panel_weapons_ammo_alpha "1"
 seta hud_panel_weapons_aspect "2"
 seta hud_panel_weapons_timeout "0"
 seta hud_panel_weapons_timeout_effect "0"
+seta hud_panel_weapons_onlyowned "0"
 
 seta hud_panel_ammo 1
 seta hud_panel_ammo_pos "0.160000 0.910000"
@@ -61,8 +67,8 @@ seta hud_panel_ammo_bg_padding ""
 seta hud_panel_ammo_onlycurrent "0"
 seta hud_panel_ammo_iconalign "0"
 seta hud_panel_ammo_progressbar "0"
-seta hud_panel_ammo_progressbar_xoffset "0"
 seta hud_panel_ammo_progressbar_name "progressbar"
+seta hud_panel_ammo_progressbar_xoffset "0"
 seta hud_panel_ammo_text "1"
 
 seta hud_panel_powerups 1
@@ -97,6 +103,8 @@ seta hud_panel_healtharmor_baralign "0"
 seta hud_panel_healtharmor_progressbar "0"
 seta hud_panel_healtharmor_progressbar_health "progressbar"
 seta hud_panel_healtharmor_progressbar_armor "progressbar"
+seta hud_panel_healtharmor_progressbar_gfx "1"
+seta hud_panel_healtharmor_progressbar_gfx_smooth "2"
 seta hud_panel_healtharmor_text "1"
 
 seta hud_panel_notify 0
@@ -111,6 +119,8 @@ seta hud_panel_notify_bg_padding ""
 seta hud_panel_notify_flip "0"
 seta hud_panel_notify_fontsize "1"
 seta hud_panel_notify_print "1"
+seta hud_panel_notify_time "10"
+seta hud_panel_notify_fadetime "3"
 
 seta hud_panel_timer 1
 seta hud_panel_timer_pos "0.850000 0"
@@ -121,9 +131,10 @@ seta hud_panel_timer_bg_color_team ""
 seta hud_panel_timer_bg_alpha ""
 seta hud_panel_timer_bg_border ""
 seta hud_panel_timer_bg_padding "0"
+seta hud_panel_timer_increment "0"
 
 seta hud_panel_radar 2
-seta hud_panel_radar_pos "0.800000 0"
+seta hud_panel_radar_pos "0 0"
 seta hud_panel_radar_size "0.200000 0.260000"
 seta hud_panel_radar_bg "border_radar"
 seta hud_panel_radar_bg_color ""
@@ -132,16 +143,22 @@ seta hud_panel_radar_bg_alpha "0.500000"
 seta hud_panel_radar_bg_border "0"
 seta hud_panel_radar_bg_padding "0"
 seta hud_panel_radar_foreground_alpha "1"
+seta hud_panel_radar_rotation "0"
+seta hud_panel_radar_zoommode "0"
+seta hud_panel_radar_scale "4096"
+seta hud_panel_radar_maximized_scale "8192"
+seta hud_panel_radar_maximized_size "0.5 0.5"
 
 seta hud_panel_score 1
 seta hud_panel_score_pos "0.760000 0.910000"
-seta hud_panel_score_size "0.240000 0.090000"
+seta hud_panel_score_size "0.200000 0.080000"
 seta hud_panel_score_bg "0"
 seta hud_panel_score_bg_color ""
 seta hud_panel_score_bg_color_team ""
 seta hud_panel_score_bg_alpha ""
 seta hud_panel_score_bg_border ""
 seta hud_panel_score_bg_padding ""
+seta hud_panel_score_rankings "0"
 
 seta hud_panel_racetimer 1
 seta hud_panel_racetimer_pos "0.360000 0.140000"
@@ -173,6 +190,7 @@ seta hud_panel_modicons_bg_color_team ""
 seta hud_panel_modicons_bg_alpha ""
 seta hud_panel_modicons_bg_border ""
 seta hud_panel_modicons_bg_padding ""
+seta hud_panel_modicons_dom_layout "1"
 
 seta hud_panel_pressedkeys 1
 seta hud_panel_pressedkeys_pos "0.440000 0.760000"
@@ -204,6 +222,8 @@ seta hud_panel_engineinfo_bg_color_team ""
 seta hud_panel_engineinfo_bg_alpha ""
 seta hud_panel_engineinfo_bg_border ""
 seta hud_panel_engineinfo_bg_padding ""
+seta hud_panel_engineinfo_framecounter_time "0.1"
+seta hud_panel_engineinfo_framecounter_decimals "0"
 
 seta hud_panel_infomessages 1
 seta hud_panel_infomessages_pos "0.700000 0.620000"
@@ -225,15 +245,26 @@ seta hud_panel_physics_bg_color_team ""
 seta hud_panel_physics_bg_alpha ""
 seta hud_panel_physics_bg_border ""
 seta hud_panel_physics_bg_padding ""
+seta hud_panel_physics_speed_unit "3"
+seta hud_panel_physics_speed_unit_show "1"
+seta hud_panel_physics_speed_max "1800"
+seta hud_panel_physics_speed_vertical "0"
+seta hud_panel_physics_topspeed "1"
+seta hud_panel_physics_topspeed_time "4"
+seta hud_panel_physics_acceleration_max "1.5"
+seta hud_panel_physics_acceleration_vertical "0"
 seta hud_panel_physics_flip "0"
 seta hud_panel_physics_baralign "0"
-seta hud_panel_physics_acceleration_progressbar_mode "0"
 seta hud_panel_physics_progressbar "3"
-seta hud_panel_physics_text "2"
+seta hud_panel_physics_acceleration_progressbar_mode "0"
+seta hud_panel_physics_acceleration_progressbar_scale "4"
+seta hud_panel_physics_acceleration_progressbar_nonlinear "0"
+seta hud_panel_physics_text "1"
+seta hud_panel_physics_text_scale "0.7"
 
 seta hud_panel_centerprint 1
 seta hud_panel_centerprint_pos "0.175000 0.260000"
-seta hud_panel_centerprint_size "0.650000 0.210000"
+seta hud_panel_centerprint_size "0.650000 0.200000"
 seta hud_panel_centerprint_bg "0"
 seta hud_panel_centerprint_bg_color ""
 seta hud_panel_centerprint_bg_color_team ""
@@ -241,9 +272,17 @@ seta hud_panel_centerprint_bg_alpha ""
 seta hud_panel_centerprint_bg_border ""
 seta hud_panel_centerprint_bg_padding ""
 seta hud_panel_centerprint_align "0.5"
-seta hud_panel_centerprint_flip "1"
+seta hud_panel_centerprint_flip "0"
 seta hud_panel_centerprint_fontscale "1"
 seta hud_panel_centerprint_time "3"
-seta hud_panel_centerprint_fadetime "0.25"
+seta hud_panel_centerprint_fade_in "0.2"
+seta hud_panel_centerprint_fade_out "0.5"
+seta hud_panel_centerprint_fade_subsequent "1"
+seta hud_panel_centerprint_fade_subsequent_passone "3"
+seta hud_panel_centerprint_fade_subsequent_passone_minalpha "0.5"
+seta hud_panel_centerprint_fade_subsequent_passtwo "10" 
+seta hud_panel_centerprint_fade_subsequent_passtwo_minalpha "0.5"
+seta hud_panel_centerprint_fade_subsequent_minfontsize "0.75"
+seta hud_panel_centerprint_fade_minfontsize "0"
 
 menu_sync
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
diff --git a/models/keys/key.md3 b/models/keys/key.md3
new file mode 100644 (file)
index 0000000..097c90c
Binary files /dev/null and b/models/keys/key.md3 differ
diff --git a/models/keys/key.tga b/models/keys/key.tga
new file mode 100644 (file)
index 0000000..5e70fa3
Binary files /dev/null and b/models/keys/key.tga 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 4ef1d04d6765a3260f0825bb2e88b875970cb968..a1a32404dd48ec7d57bdeb83eca8b624433f58fd 100644 (file)
@@ -177,9 +177,6 @@ float               dmg_take;
 float vid_conwidth, vid_conheight;
 float binddb;
 
-//     Announcer
-string announce_snd;
-
 // QUALIFYING
 float race_checkpoint;
 float race_time;
@@ -225,10 +222,6 @@ float spectatee_status;
 // short mapname
 string shortmapname;
 
-//remaining maptime announcer sounds, true when sound was already played
-float announcer_1min;
-float announcer_5min;
-
 // database for misc stuff
 float tempdb;
 float ClientProgsDB;
index 606123ad1c1d2c2ba4696b3f792bc8eb05a65e89..326bae22b5118a7be4a9566ae83dda022167560a 100644 (file)
@@ -25,24 +25,23 @@ 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;
 #endif
 
 string forcefog;
-string cl_announcer_prev;
 void WaypointSprite_Load();
 void CSQC_Init(void)
 {
@@ -83,10 +82,6 @@ void CSQC_Init(void)
                        break;
        maxclients = i;
 
-       //ctf_temp_1 = "";
-       // localcmd("alias order \"cmd order $*\""); enable if ctf-command thingy is used
-       //registercmd("ctf_menu");
-       registercmd("ons_map");
        registercmd("hud_configure");
        registercmd("hud_save");
        //registercmd("menu_action");
@@ -141,18 +136,15 @@ void CSQC_Init(void)
        DamageInfo_Precache();
        Vehicles_Precache();
        turrets_precache();
-
-       if(autocvar_cl_announcer != cl_announcer_prev) {
-               Announcer_Precache();
-               if(cl_announcer_prev)
-                       strunzone(cl_announcer_prev);
-               cl_announcer_prev = strzone(autocvar_cl_announcer);
-       }
+  Announcer_Precache();
        Tuba_Precache();
-
-       if(autocvar_cl_reticle_item_normal) precache_pic("gfx/reticle_normal");
-       if(autocvar_cl_reticle_item_nex) precache_pic("gfx/reticle_nex");
-
+       
+       if(autocvar_cl_reticle)
+       {
+               if(autocvar_cl_reticle_item_normal) { precache_pic("gfx/reticle_normal"); }
+               if(autocvar_cl_reticle_item_nex) { precache_pic("gfx/reticle_nex"); }
+       }
+       
        get_mi_min_max_texcoords(1); // try the CLEVER way first
        minimapname = strcat("gfx/", mi_shortname, "_radar.tga");
        shortmapname = mi_shortname;
@@ -354,11 +346,10 @@ float CSQC_ConsoleCommand(string strMessage)
 {
        float argc;
        // Tokenize String
-       //argc = tokenize(strMessage);
        argc = tokenize_console(strMessage);
 
        // Acquire Command
-       local string strCmd;
+       string strCmd;
        strCmd = argv(0);
 
        if(strCmd == "hud_configure") { // config hud
@@ -507,6 +498,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 +593,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 +608,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 +634,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 +935,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;
@@ -958,13 +956,23 @@ void(float bIsNewEntity) CSQC_Ent_Update =
 
 #ifdef DP_CSQC_ENTITY_REMOVE_IS_B0RKED
        if(self.enttype)
-               if(t != self.enttype)
+       {
+               if(t != self.enttype || bIsNewEntity)
                {
                        //print(_("A CSQC entity changed its type!\n"));
-                       print(sprintf(_("A CSQC entity changed its type! (edict: %d, classname: %s)\n"), num_for_edict(self), self.classname));
+                       print(sprintf(_("A CSQC entity changed its type! (edict: %d, server: %d, type: %d -> %d)\n"), num_for_edict(self), self.entnum, self.enttype, t));
                        Ent_Remove();
                        bIsNewEntity = 1;
                }
+       }
+       else
+       {
+               if(!bIsNewEntity)
+               {
+                       print(sprintf(_("A CSQC entity appeared out of nowhere! (edict: %d, server: %d, type: %d)\n"), num_for_edict(self), self.entnum, t));
+                       bIsNewEntity = 1;
+               }
+       }
 #endif
        self.enttype = t;
        switch(t)
@@ -1007,7 +1015,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 +1339,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...
@@ -1377,7 +1385,7 @@ float CSQC_Parse_TempEntity()
                        bHandled = true;
                        break;
                case TE_CSQC_ANNOUNCE:
-                       announce_snd = strzone(ReadString());
+                       Announcer_Play(ReadString());
                        bHandled = true;
                        break;
                case TE_CSQC_KILLNOTIFY:
@@ -1403,10 +1411,10 @@ float CSQC_Parse_TempEntity()
                        Net_WeaponComplain();
                        bHandled = true;
                        break;
-        case TE_CSQC_VEHICLESETUP:
-            Net_VehicleSetup();
-            bHandled = true;
-            break;
+               case TE_CSQC_VEHICLESETUP:
+                       Net_VehicleSetup();
+                       bHandled = true;
+                       break;
                default:
                        // No special logic for this temporary entity; return 0 so the engine can handle it
                        bHandled = false;
index ade5155c46ff2e7c26e50070c05e31b269982085..2d79f8f1045b4c181694d9e76f946e546680eb8f 100644 (file)
@@ -78,30 +78,6 @@ void Porto_Draw()
        }
 }
 
-/**
- * Checks whether the server initiated a map restart (stat_game_starttime changed)
- *
- * TODO: Use a better solution where a common shared entitiy is used that contains
- * timelimit, fraglimit and game_starttime! Requires engine changes (remove STAT_TIMELIMIT
- * and STAT_FRAGLIMIT to be auto-sent)
- */
-void CheckForGamestartChange() {
-       float startTime;
-       startTime = getstatf(STAT_GAMESTARTTIME);
-       if (previous_game_starttime != startTime) {
-               if ((time + 5.0) < startTime) {
-                       //if connecting to server while restart was active don't always play prepareforbattle
-                       sound(world, CH_INFO, strcat("announcer/", autocvar_cl_announcer, "/prepareforbattle.wav"), VOL_BASEVOICE, ATTN_NONE);
-               }
-               if (time < startTime) {
-                       restartAnnouncer = spawn();
-                       restartAnnouncer.think = restartAnnouncer_Think;
-                       restartAnnouncer.nextthink = startTime - floor(startTime - time); //synchronize nextthink to startTime
-               }
-       }
-       previous_game_starttime = startTime;
-}
-
 void Porto_Init()
 {
        porto = spawn();
@@ -114,7 +90,8 @@ float drawtime;
 float avgspeed;
 vector GetCurrentFov(float fov)
 {
-       float zoomsensitivity, zoomspeed, zoomfactor, zoomdir, velocityzoom;
+       float zoomsensitivity, zoomspeed, zoomfactor, zoomdir;
+       float velocityzoom, curspeed;
 
        zoomsensitivity = autocvar_cl_zoomsensitivity;
        zoomfactor = autocvar_cl_zoomfactor;
@@ -177,13 +154,23 @@ vector GetCurrentFov(float fov)
                setsensitivityscale(pow(current_viewzoom, 1 - zoomsensitivity));
        else
                setsensitivityscale(1);
+               
+       makevectors(view_angles);
 
-       if (autocvar_cl_velocityzoom)
+       if(autocvar_cl_velocityzoom)
        {
-               velocityzoom = bound(0, drawframetime / max(0.000000001, autocvar_cl_velocityzoomtime), 1);
-               avgspeed = avgspeed * (1 - velocityzoom) + (vlen(pmove_vel) / 1000) * velocityzoom;
+               switch(autocvar_cl_velocityzoom_type)
+               {
+                       case 3: curspeed = max(0, v_forward * pmove_vel); break;
+                       case 2: curspeed = (v_forward * pmove_vel); break;
+                       case 1: default: curspeed = vlen(pmove_vel); break;
+               }
+               
+               velocityzoom = bound(0, drawframetime / max(0.000000001, autocvar_cl_velocityzoom_time), 1); // speed at which the zoom adapts to player velocity
+               avgspeed = avgspeed * (1 - velocityzoom) + (curspeed / autocvar_cl_velocityzoom_speed) * velocityzoom;
                velocityzoom = exp(float2range11(avgspeed * -autocvar_cl_velocityzoom / 1) * 1);
-               //print(ftos(avgspeed), " avgspeed, ", ftos(autocvar_cl_velocityzoom), " cvar, ", ftos(velocityzoom), " return\n"); // for debugging
+               
+               //print(ftos(avgspeed), " avgspeed, ", ftos(curspeed), " curspeed, ", ftos(velocityzoom), " return\n"); // for debugging
        }
        else
                velocityzoom = 1;
@@ -399,6 +386,7 @@ void CSQC_UpdateView(float w, float h)
        CHECKFAIL_ASSERT(3, cvar, "\{114}\{95}\{115}\{104}\{111}\{119}\{111}\{118}\{101}\{114}\{100}\{114}\{97}\{119}", 0);
        CHECKFAIL_ASSERT(4, cvar, "\{114}\{95}\{115}\{104}\{111}\{119}\{108}\{105}\{103}\{104}\{116}", 0);
        CHECKFAIL_ASSERT(5, cvar, "\{114}\{95}\{115}\{104}\{111}\{119}\{115}\{104}\{97}\{100}\{111}\{119}\{118}\{111}\{108}\{117}\{109}\{101}\{115}", 0);
+       CHECKFAIL_ASSERT(6, cvar, "\{114}\{95}\{115}\{104}\{111}\{119}\{111}\{118}\{101}\{114}\{100}\{114}\{97}\{119}", 0);
 
        vf_size = R_SetView3fv(VF_SIZE);
        vf_min = R_SetView3fv(VF_MIN);
@@ -514,16 +502,15 @@ void CSQC_UpdateView(float w, float h)
                PostInit();
 
        if(intermission && !isdemo() && !(calledhooks & HOOK_END))
+       {
                if(calledhooks & HOOK_START)
                {
                        localcmd("\ncl_hook_gameend\n");
                        calledhooks |= HOOK_END;
                }
-
-       CheckForGamestartChange();
-       serverAnnouncer();
-       maptimeAnnouncer();
-       carrierAnnouncer();
+       }
+       
+  Announcer();
 
        fov = autocvar_fov;
        if(fov <= 59.5)
@@ -718,7 +705,7 @@ void CSQC_UpdateView(float w, float h)
        else if(activeweapon == WEP_NEX && button_attack2 || activeweapon == WEP_RIFLE && button_attack2)
                reticle_type = 2; // nex zoom
     
-       if (reticle_type)
+       if(reticle_type && autocvar_cl_reticle)
        {
                if(autocvar_cl_reticle_stretch)
                {
@@ -817,7 +804,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 +852,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 +1059,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
@@ -1445,7 +1439,7 @@ void CSQC_common_hud(void)
             if(acc_color_levels)
                 strunzone(acc_color_levels);
             acc_color_levels = strzone(autocvar_accuracy_color_levels);
-            acc_levels = tokenize(acc_color_levels);
+            acc_levels = tokenize_console(acc_color_levels);
             if (acc_levels > MAX_ACCURACY_LEVELS)
                 acc_levels = MAX_ACCURACY_LEVELS;
 
@@ -1512,8 +1506,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;
diff --git a/qcsrc/client/announcer.qc b/qcsrc/client/announcer.qc
new file mode 100644 (file)
index 0000000..c1f023d
--- /dev/null
@@ -0,0 +1,231 @@
+float previous_announcement_time;
+float previous_game_starttime;
+string previous_announcement;
+
+// remaining maptime announcer sounds, true when sound was already played
+float announcer_1min;
+float announcer_5min;
+
+void Announcer_Play(string announcement)
+{
+       if((announcement != previous_announcement) || (time >= (previous_announcement_time + autocvar_cl_announcer_antispam)))
+       {
+               sound(world, CH_INFO, strcat("announcer/", autocvar_cl_announcer, "/", announcement, ".wav"), VOL_BASEVOICE, ATTN_NONE);
+
+               if(previous_announcement) { strunzone(previous_announcement); }
+               
+               previous_announcement = strzone(announcement);
+               previous_announcement_time = time;
+       }
+}
+
+void Announcer_Countdown() 
+{
+       float starttime = getstatf(STAT_GAMESTARTTIME);
+       float countdown = (starttime - time);
+       float countdown_rounded = floor(0.5 + countdown);
+       
+       if(countdown <= 0) // countdown has finished, starttime is now
+       {
+               if (!spectatee_status) 
+                       centerprint_generic(CPID_GAME_STARTING, _("^1Begin!"), 1, 0);
+
+               Announcer_Play("begin");
+               announcer_5min = announcer_1min = FALSE; // reset maptime announcers now as well
+               remove(self);
+               return;
+       }
+       else // countdown is still going
+       {
+               if (!spectatee_status)
+                       centerprint_generic(CPID_GAME_STARTING, _("^1Game starts in %d seconds"), 1, countdown_rounded);
+
+               if(countdown_rounded <= 3 && countdown_rounded >= 1) 
+                       Announcer_Play(ftos(countdown_rounded));
+
+               self.nextthink = (starttime - (countdown - 1));
+       }
+}
+
+/**
+ * Checks whether the server initiated a map restart (stat_game_starttime changed)
+ *
+ * TODO: Use a better solution where a common shared entitiy is used that contains
+ * timelimit, fraglimit and game_starttime! Requires engine changes (remove STAT_TIMELIMIT
+ * and STAT_FRAGLIMIT to be auto-sent)
+ */
+void Announcer_Gamestart() 
+{
+       float startTime = getstatf(STAT_GAMESTARTTIME);
+       
+       if(previous_game_starttime != startTime) 
+       {
+               if((time + 5.0) < startTime) // if connecting to server while restart was active don't always play prepareforbattle
+                       Announcer_Play("prepareforbattle");
+               
+               if(time < startTime) 
+               {
+                       entity e;
+                       e = spawn();
+                       e.think = Announcer_Countdown;
+                       e.nextthink = startTime - floor(startTime - time); //synchronize nextthink to startTime
+               }
+       }
+       
+       previous_game_starttime = startTime;
+}
+
+
+// Plays the 1 minute or 5 minutes (of maptime) remaining sound, if client wants it
+void Announcer_Time() 
+{
+       float timelimit = getstatf(STAT_TIMELIMIT);
+       float timeleft = max(0, timelimit * 60 + getstatf(STAT_GAMESTARTTIME) - time);
+       float warmup_timeleft;
+       
+       if(warmup_stage) 
+               if(autocvar_g_warmup_limit > 0)
+                       warmup_timeleft = max(0, autocvar_g_warmup_limit + getstatf(STAT_GAMESTARTTIME) - time); 
+
+       // 5 minute check
+       if(autocvar_cl_announcer_maptime >= 2) 
+       {
+               // make sure that after connect (and e.g. 4 minutes left) we will not get a wrong sound
+               if(announcer_5min)
+               {
+                       if(((!warmup_stage || autocvar_g_warmup_limit == 0) && timeleft > 300) 
+                               || (warmup_stage && autocvar_g_warmup_limit > 0 && warmup_timeleft > 300))
+                                       announcer_5min = FALSE;
+               }
+               else 
+               {
+                       if(((!warmup_stage || autocvar_g_warmup_limit == 0) && timelimit > 0 && timeleft < 300 && timeleft > 299) 
+                               || (warmup_stage && autocvar_g_warmup_limit > 0 && warmup_timeleft < 300 && warmup_timeleft > 299))
+                       {
+                               //if we're in warmup mode, check whether there's a warmup timelimit
+                               if not(autocvar_g_warmup_limit == -1 && warmup_stage) 
+                               {
+                                       announcer_5min = TRUE;
+                                       Announcer_Play("5minutesremain");
+                               }
+                       }
+               }
+       }
+
+       // 1 minute check
+       if((autocvar_cl_announcer_maptime == 1) || (autocvar_cl_announcer_maptime == 3))
+       {
+               if (announcer_1min)
+               {
+                       if(((!warmup_stage || autocvar_g_warmup_limit == 0) && timeleft > 60) 
+                               || (warmup_stage && autocvar_g_warmup_limit > 0 && warmup_timeleft > 60))
+                                       announcer_1min = FALSE;
+               }
+               else if(((!warmup_stage || autocvar_g_warmup_limit == 0) && timelimit > 0 && timeleft < 60) 
+                       || (warmup_stage && autocvar_g_warmup_limit > 0 && warmup_timeleft < 60))
+               {
+                       // if we're in warmup mode, check whether there's a warmup timelimit
+                       if not(autocvar_g_warmup_limit == -1 && warmup_stage) 
+                       {
+                               announcer_1min = TRUE;
+                               Announcer_Play("1minuteremains");
+                       }
+               }
+       }
+}
+
+float redflag_prev;
+float blueflag_prev;
+void carrierAnnouncer() {
+       float stat_items, redflag, blueflag;
+       float pickup;
+       string item;
+
+       if not(autocvar_cl_notify_carried_items)
+               return;
+
+       stat_items = getstati(STAT_ITEMS);
+
+       redflag = (stat_items/IT_RED_FLAG_TAKEN) & 3;
+       blueflag = (stat_items/IT_BLUE_FLAG_TAKEN) & 3;
+
+       if (redflag == 3 && redflag != redflag_prev) {
+               item = _("^1RED^7 flag");
+               pickup = (redflag_prev == 2);
+       }
+
+       if (blueflag == 3 && blueflag != blueflag_prev) {
+               item = _("^4BLUE^7 flag");
+               pickup = (blueflag_prev == 2);
+       }
+
+       if (item)
+       {
+               if (pickup) {
+                       if (autocvar_cl_notify_carried_items & 2)
+                               centerprint(sprintf(_("You picked up the %s!"), item));
+               }
+               else {
+                       if (autocvar_cl_notify_carried_items & 1)
+                               centerprint(sprintf(_("You got the %s!"), item));
+               }
+       }
+
+       blueflag_prev = blueflag;
+       redflag_prev = redflag;
+}
+
+void Announcer()
+{
+       Announcer_Gamestart();
+       Announcer_Time();
+       carrierAnnouncer();
+}
+
+void Announcer_Precache () 
+{
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/1minuteremains.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/5minutesremain.wav"));
+
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/electrobitch.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/airshot.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/03kills.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/05kills.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/10kills.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/15kills.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/20kills.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/25kills.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/30kills.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/botlike.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/yoda.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/amazing.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/awesome.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/headshot.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/impressive.wav"));
+
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/prepareforbattle.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/begin.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/timeoutcalled.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/1fragleft.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/2fragsleft.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/3fragsleft.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/terminated.wav"));
+
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/1.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/2.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/3.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/4.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/5.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/6.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/7.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/8.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/9.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/10.wav"));
+
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/lastsecond.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/narrowly.wav"));
+
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/voteaccept.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/votecall.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/votefail.wav"));
+}
index 87d1809fc71d66949b7cd392496c5b09717de110..e19f420e16ec4740004207beb6d7c8fa4a3b33af 100644 (file)
@@ -19,6 +19,8 @@ float autocvar_camera_speed_roll;
 float autocvar_chase_active;
 float autocvar_cl_allow_uid2name;
 string autocvar_cl_announcer;
+var float autocvar_cl_announcer_antispam = 2;
+var float autocvar_cl_announcer_maptime = 3;
 float autocvar_cl_autodemo_delete;
 float autocvar_cl_autodemo_delete_keeprecords;
 float autocvar_cl_casings;
@@ -57,15 +59,17 @@ float autocvar_cl_particles_oldnexbeam;
 float autocvar_cl_particles_quality;
 float autocvar_cl_projectiles_sloppy;
 float autocvar_cl_readpicture_force;
+var float autocvar_cl_reticle = 1;
 float autocvar_cl_reticle_item_nex;
 float autocvar_cl_reticle_item_normal;
 float autocvar_cl_reticle_stretch;
-float autocvar_cl_sound_maptime_warning;
 float autocvar_cl_stripcolorcodes;
 var float autocvar_cl_vehicle_spiderbot_cross_alpha = 0.6;
 var float autocvar_cl_vehicle_spiderbot_cross_size = 1;
 float autocvar_cl_velocityzoom;
-var float autocvar_cl_velocityzoomtime = 0.3;
+float autocvar_cl_velocityzoom_type;
+float autocvar_cl_velocityzoom_speed;
+float autocvar_cl_velocityzoom_time;
 string autocvar_cl_weaponpriority;
 float autocvar_cl_zoomfactor;
 float autocvar_cl_zoomsensitivity;
@@ -123,30 +127,30 @@ float autocvar_g_balance_tuba_fadetime;
 float autocvar_g_balance_tuba_volume;
 float autocvar_g_balance_tuba_pitchstep;
 float autocvar_g_warmup_limit;
-var float autocvar_g_waypointsprite_uppercase = 1;
-var float autocvar_g_waypointsprite_alpha = 1;
-var float autocvar_g_waypointsprite_crosshairfadealpha = 1;
+float autocvar_g_waypointsprite_uppercase;
+float autocvar_g_waypointsprite_alpha;
+float autocvar_g_waypointsprite_crosshairfadealpha;
 float autocvar_g_waypointsprite_crosshairfadedistance;
-var float autocvar_g_waypointsprite_crosshairfadescale = 1;
+float autocvar_g_waypointsprite_crosshairfadescale;
 float autocvar_g_waypointsprite_distancealphaexponent;
-var float autocvar_g_waypointsprite_distancefadealpha = 1;
-var float autocvar_g_waypointsprite_distancefadedistancemultiplier = 1;
-var float autocvar_g_waypointsprite_distancefadescale = 1;
-var float autocvar_g_waypointsprite_edgefadealpha = 1;
+float autocvar_g_waypointsprite_distancefadealpha;
+float autocvar_g_waypointsprite_distancefadedistancemultiplier;
+float autocvar_g_waypointsprite_distancefadescale;
+float autocvar_g_waypointsprite_edgefadealpha;
 float autocvar_g_waypointsprite_edgefadedistance;
-var float autocvar_g_waypointsprite_edgefadescale = 1;
-var float autocvar_g_waypointsprite_edgeoffset_bottom = 0;
-var float autocvar_g_waypointsprite_edgeoffset_left = 0;
-var float autocvar_g_waypointsprite_edgeoffset_right = 0;
-var float autocvar_g_waypointsprite_edgeoffset_top = 0;
-var float autocvar_g_waypointsprite_fontsize = 12;
+float autocvar_g_waypointsprite_edgefadescale;
+float autocvar_g_waypointsprite_edgeoffset_bottom;
+float autocvar_g_waypointsprite_edgeoffset_left;
+float autocvar_g_waypointsprite_edgeoffset_right;
+float autocvar_g_waypointsprite_edgeoffset_top;
+float autocvar_g_waypointsprite_fontsize;
 float autocvar_g_waypointsprite_minalpha;
 float autocvar_g_waypointsprite_minscale;
 float autocvar_g_waypointsprite_normdistance;
-var float autocvar_g_waypointsprite_scale = 1;
+float autocvar_g_waypointsprite_scale;
 float autocvar_g_waypointsprite_spam;
 float autocvar_g_waypointsprite_timealphaexponent;
-var float autocvar_hud_colorflash_alpha = 0.5;
+float autocvar_hud_colorflash_alpha;
 float autocvar_hud_configure_bg_minalpha;
 float autocvar_hud_configure_checkcollisions;
 float autocvar_hud_configure_grid;
@@ -202,6 +206,28 @@ float autocvar_hud_panel_bg_border;
 vector autocvar_hud_panel_bg_color;
 float autocvar_hud_panel_bg_color_team;
 float autocvar_hud_panel_bg_padding;
+float autocvar_hud_panel_centerprint;
+string autocvar_hud_panel_centerprint_pos;
+string autocvar_hud_panel_centerprint_size;
+string autocvar_hud_panel_centerprint_bg;
+string autocvar_hud_panel_centerprint_bg_color;
+string autocvar_hud_panel_centerprint_bg_color_team;
+string autocvar_hud_panel_centerprint_bg_alpha;
+string autocvar_hud_panel_centerprint_bg_border = "";
+string autocvar_hud_panel_centerprint_bg_padding = "";
+float autocvar_hud_panel_centerprint_align;
+var float autocvar_hud_panel_centerprint_fade_in = 0.2;
+var float autocvar_hud_panel_centerprint_fade_out = 0.5;
+var float autocvar_hud_panel_centerprint_fade_subsequent = 1;
+var float autocvar_hud_panel_centerprint_fade_subsequent_passone = 3;
+var float autocvar_hud_panel_centerprint_fade_subsequent_passone_minalpha = 0.5;
+var float autocvar_hud_panel_centerprint_fade_subsequent_passtwo = 10;
+var float autocvar_hud_panel_centerprint_fade_subsequent_passtwo_minalpha = 0.5;
+var float autocvar_hud_panel_centerprint_fade_subsequent_minfontsize = 0.75;
+var float autocvar_hud_panel_centerprint_fade_minfontsize = 0;
+float autocvar_hud_panel_centerprint_flip;
+float autocvar_hud_panel_centerprint_fontscale;
+float autocvar_hud_panel_centerprint_time;
 float autocvar_hud_panel_chat;
 float autocvar_hud_panel_engineinfo;
 float autocvar_hud_panel_engineinfo_framecounter_decimals;
@@ -220,22 +246,6 @@ float autocvar_hud_panel_healtharmor_progressbar_gfx;
 float autocvar_hud_panel_healtharmor_progressbar_gfx_damage;
 float autocvar_hud_panel_healtharmor_progressbar_gfx_lowhealth;
 float autocvar_hud_panel_healtharmor_progressbar_gfx_smooth;
-
-// TEMPORARY hard coded default for compatibility - remove after 0.2 release
-var float autocvar_hud_panel_centerprint = 1;
-noref var string autocvar_hud_panel_centerprint_pos = "0.180000 0.260000";
-noref var string autocvar_hud_panel_centerprint_size = "0.650000 0.210000";
-noref var string autocvar_hud_panel_centerprint_bg = "";
-noref var string autocvar_hud_panel_centerprint_bg_color = "";
-noref var string autocvar_hud_panel_centerprint_bg_color_team = "";
-noref var string autocvar_hud_panel_centerprint_bg_alpha = "";
-noref var string autocvar_hud_panel_centerprint_bg_border = "";
-noref var string autocvar_hud_panel_centerprint_bg_padding = "";
-var float autocvar_hud_panel_centerprint_align = 0.5;
-var float autocvar_hud_panel_centerprint_fadetime = 0.25;
-var float autocvar_hud_panel_centerprint_flip = 1;
-var float autocvar_hud_panel_centerprint_fontscale = 1;
-var float autocvar_hud_panel_centerprint_time = 3;
 float autocvar_hud_panel_healtharmor_text;
 float autocvar_hud_panel_infomessages;
 float autocvar_hud_panel_infomessages_flip;
@@ -277,6 +287,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;
@@ -315,6 +327,9 @@ float autocvar_hud_showbinds;
 float autocvar_hud_showbinds_limit;
 float autocvar_hud_shownames;
 float autocvar_hud_shownames_enemies;
+float autocvar_hud_shownames_crosshairdistance;
+float autocvar_hud_shownames_crosshairdistance_time;
+float autocvar_hud_shownames_crosshairdistance_antioverlap;
 float autocvar_hud_shownames_self;
 float autocvar_hud_shownames_status;
 float autocvar_hud_shownames_statusbar_height;
@@ -355,6 +370,7 @@ var float autocvar_scoreboard_highlight_alpha = 0.10;
 var float autocvar_scoreboard_highlight_alpha_self = 0.25;
 float autocvar_scoreboard_offset_left;
 float autocvar_scoreboard_offset_right;
+float autocvar_scoreboard_offset_vertical;
 float autocvar_v_flipped;
 float autocvar_vid_conheight;
 float autocvar_vid_conwidth;
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 4fe558b55c83cd45f6ad297323170411e036ff7e..2f511307fdeb343acc806a30a2336f2fd35eb25c 100644 (file)
@@ -431,40 +431,58 @@ float GetAmmoTypeForWep(float i)
 
 void HUD_Weapons(void)
 {
-       float i, f, screen_ar;
-       float center_x, center_y;
-    if(hud != HUD_NORMAL) return;
+       // declarations
+       float weapons_stat = getstati(STAT_WEAPONS); 
+       float i, f, a, j, factor;
+       float screen_ar, center_x, center_y; 
+       float weapon_count, weapon_id, weapon_alpha; 
+       float row, column, rows, columns; 
+       float aspect = autocvar_hud_panel_weapons_aspect;
+       
+       float show_accuracy, panel_weapon_accuracy;
+       
+       float timeout = autocvar_hud_panel_weapons_timeout;
+       float timein_effect_length = (autocvar_hud_panel_weapons_timeout_effect ? 0.375 : 0);
+       float timeout_effect_length = (autocvar_hud_panel_weapons_timeout_effect ? 0.75 : 0);
+       
+       float ammo_type, ammo_full, ammo_alpha;
+       float barsize_x, barsize_y, baroffset_x, baroffset_y;
+       
+       float when = autocvar_hud_panel_weapons_complainbubble_time;
+       float fadetime = autocvar_hud_panel_weapons_complainbubble_fadetime;
+       
+       vector weapon_pos, weapon_size;
+       vector old_panel_size;
+       vector color, ammo_color;
+       
+       // check to see if we want to continue
+  if(hud != HUD_NORMAL) { return; }
+  
        if(!autocvar__hud_configure)
-       {
-               if(!autocvar_hud_panel_weapons) return;
-               if(spectatee_status == -1) return;
-       }
+               if((!autocvar_hud_panel_weapons) || (spectatee_status == -1))
+                       return;
+               else if(timeout && time >= weapontime + timeout + timeout_effect_length)
+               {
+                       weaponprevtime = time;
+                       return;
+               }
        else
                hud_configure_active_panel = HUD_PANEL_WEAPONS;
 
-       float timeout = autocvar_hud_panel_weapons_timeout;
-       float timeout_effect_length, timein_effect_length;
-       if (autocvar_hud_panel_weapons_timeout_effect == 0)
+       // update generic hud functions
+       HUD_Panel_UpdateCvars(weapons);
+       HUD_Panel_ApplyFadeAlpha();
+       
+       // calculate fading effect to weapon images for when the panel is idle
+       if(autocvar_hud_panel_weapons_fade)
        {
-               timeout_effect_length = 0;
-               timein_effect_length = 0;
+               weapon_alpha = 3.2 - 2 * (time - weapontime);
+               weapon_alpha = bound(0.7, weapon_alpha, 1) * panel_fg_alpha;
        }
        else
-       {
-               timeout_effect_length = 0.75;
-               timein_effect_length = 0.375;
-       }
+               weapon_alpha = panel_fg_alpha;
 
-       if (timeout && time >= weapontime + timeout + timeout_effect_length && !autocvar__hud_configure)
-       {
-               weaponprevtime = time;
-               return;
-       }
-
-       HUD_Panel_UpdateCvars(weapons);
-       HUD_Panel_ApplyFadeAlpha();
-
-       // TODO make this configurable
+       // figure out weapon order (how the weapons are sorted) // TODO make this configurable
        if(weaponorder_bypriority != autocvar_cl_weaponpriority || !weaponorder[0])
        {
                float weapon_cnt;
@@ -493,33 +511,34 @@ void HUD_Weapons(void)
 
                weaponorder_cmp_str = string_null;
        }
-
-       float when, fadetime;
-       when = autocvar_hud_panel_weapons_complainbubble_time;
-       fadetime = autocvar_hud_panel_weapons_complainbubble_fadetime;
-       float weapons_st = getstati(STAT_WEAPONS);
-       float weapon_count;
+       
+       // determine which weapons are going to be shown
        if (autocvar_hud_panel_weapons_onlyowned)
        {
                if(autocvar__hud_configure)
                {
-                       if (weapons_st == 0)
+                       if (weapons_stat == 0) // create some fake weapons anyway
                                for(i = 0; i <= WEP_LAST-WEP_FIRST; i += floor((WEP_LAST-WEP_FIRST)/5))
-                                       weapons_st |= power2of(i);
+                                       weapons_stat |= power2of(i);
+                                       
                        if(menu_enabled != 2)
                                HUD_Panel_DrawBg(1); // also draw the bg of the entire panel
                }
-
-               vector old_panel_size;
+               
+               // do we own this weapon?
                for(i = 0; i <= WEP_LAST-WEP_FIRST; ++i)
-               {
-                       if(weapons_st & weaponorder[i].weapons)
+                       if(weapons_stat & weaponorder[i].weapons)
                                ++weapon_count;
-               }
-               if(!autocvar__hud_configure && (autocvar_hud_panel_weapons_complainbubble && time - complain_weapon_time < when + fadetime))// && complain_weapon >= 0
-                       ++weapon_count;
-               if (weapon_count == 0)
-                       return;
+               
+               // add it anyway if weaponcomplain is shown
+               if((!autocvar__hud_configure) 
+                       && (autocvar_hud_panel_weapons_complainbubble 
+                               && time - complain_weapon_time < when + fadetime))
+                                       ++weapon_count;
+                       
+               // might as well commit suicide now, no reason to live ;)
+               if (weapon_count == 0) { return; }
+               
                // reduce size of the panel
                if (panel_size_y > panel_size_x)
                {
@@ -537,126 +556,107 @@ void HUD_Weapons(void)
        else
                weapon_count = WEP_COUNT;
 
-       if (timeout && time >= weapontime + timeout && !autocvar__hud_configure)
+       // animation for fading in/out the panel respectively when not in use
+       if(!autocvar__hud_configure)
        {
-               f = (time - (weapontime + timeout)) / timeout_effect_length;
-               if (autocvar_hud_panel_weapons_timeout_effect == 1 || autocvar_hud_panel_weapons_timeout_effect == 3)
-               {
-                       panel_bg_alpha *= (1 - f);
-                       panel_fg_alpha *= (1 - f);
-               }
-               if (autocvar_hud_panel_weapons_timeout_effect == 2 || autocvar_hud_panel_weapons_timeout_effect == 3)
+               if (timeout && time >= weapontime + timeout) // apply timeout effect if needed
                {
-                       f *= f; // for a cooler movement
-                       center_x = panel_pos_x + panel_size_x/2;
-                       center_y = panel_pos_y + panel_size_y/2;
-                       screen_ar = vid_conwidth/vid_conheight;
-                       if (center_x/center_y < screen_ar) //bottom left
+                       f = (time - (weapontime + timeout)) / timeout_effect_length;
+                       if (autocvar_hud_panel_weapons_timeout_effect == 1 || autocvar_hud_panel_weapons_timeout_effect == 3)
                        {
-                               if ((vid_conwidth - center_x)/center_y < screen_ar) //bottom
-                                       panel_pos_y += f * (vid_conheight - panel_pos_y);
-                               else //left
-                                       panel_pos_x -= f * (panel_pos_x + panel_size_x);
+                               panel_bg_alpha *= (1 - f);
+                               panel_fg_alpha *= (1 - f);
                        }
-                       else //top right
+                       if (autocvar_hud_panel_weapons_timeout_effect == 2 || autocvar_hud_panel_weapons_timeout_effect == 3)
                        {
-                               if ((vid_conwidth - center_x)/center_y < screen_ar) //right
-                                       panel_pos_x += f * (vid_conwidth - panel_pos_x);
-                               else //top
-                                       panel_pos_y -= f * (panel_pos_y + panel_size_y);
+                               f *= f; // for a cooler movement
+                               center_x = panel_pos_x + panel_size_x/2;
+                               center_y = panel_pos_y + panel_size_y/2;
+                               screen_ar = vid_conwidth/vid_conheight;
+                               if (center_x/center_y < screen_ar) //bottom left
+                               {
+                                       if ((vid_conwidth - center_x)/center_y < screen_ar) //bottom
+                                               panel_pos_y += f * (vid_conheight - panel_pos_y);
+                                       else //left
+                                               panel_pos_x -= f * (panel_pos_x + panel_size_x);
+                               }
+                               else //top right
+                               {
+                                       if ((vid_conwidth - center_x)/center_y < screen_ar) //right
+                                               panel_pos_x += f * (vid_conwidth - panel_pos_x);
+                                       else //top
+                                               panel_pos_y -= f * (panel_pos_y + panel_size_y);
+                               }
                        }
+                       weaponprevtime = time - (1 - f) * timein_effect_length;
                }
-               weaponprevtime = time - (1 - f) * timein_effect_length;
-       }
-       else if (timeout && time < weaponprevtime + timein_effect_length && !autocvar__hud_configure)
-       {
-               f = (time - weaponprevtime) / timein_effect_length;
-               if (autocvar_hud_panel_weapons_timeout_effect == 1 || autocvar_hud_panel_weapons_timeout_effect == 3)
-               {
-                       panel_bg_alpha *= (f);
-                       panel_fg_alpha *= (f);
-               }
-               if (autocvar_hud_panel_weapons_timeout_effect == 2 || autocvar_hud_panel_weapons_timeout_effect == 3)
+               else if (timeout && time < weaponprevtime + timein_effect_length) // apply timein effect if needed
                {
-                       f *= f; // for a cooler movement
-                       f = 1 - f;
-                       center_x = panel_pos_x + panel_size_x/2;
-                       center_y = panel_pos_y + panel_size_y/2;
-                       screen_ar = vid_conwidth/vid_conheight;
-                       if (center_x/center_y < screen_ar) //bottom left
+                       f = (time - weaponprevtime) / timein_effect_length;
+                       if (autocvar_hud_panel_weapons_timeout_effect == 1 || autocvar_hud_panel_weapons_timeout_effect == 3)
                        {
-                               if ((vid_conwidth - center_x)/center_y < screen_ar) //bottom
-                                       panel_pos_y += f * (vid_conheight - panel_pos_y);
-                               else //left
-                                       panel_pos_x -= f * (panel_pos_x + panel_size_x);
+                               panel_bg_alpha *= (f);
+                               panel_fg_alpha *= (f);
                        }
-                       else //top right
+                       if (autocvar_hud_panel_weapons_timeout_effect == 2 || autocvar_hud_panel_weapons_timeout_effect == 3)
                        {
-                               if ((vid_conwidth - center_x)/center_y < screen_ar) //right
-                                       panel_pos_x += f * (vid_conwidth - panel_pos_x);
-                               else //top
-                                       panel_pos_y -= f * (panel_pos_y + panel_size_y);
+                               f *= f; // for a cooler movement
+                               f = 1 - f;
+                               center_x = panel_pos_x + panel_size_x/2;
+                               center_y = panel_pos_y + panel_size_y/2;
+                               screen_ar = vid_conwidth/vid_conheight;
+                               if (center_x/center_y < screen_ar) //bottom left
+                               {
+                                       if ((vid_conwidth - center_x)/center_y < screen_ar) //bottom
+                                               panel_pos_y += f * (vid_conheight - panel_pos_y);
+                                       else //left
+                                               panel_pos_x -= f * (panel_pos_x + panel_size_x);
+                               }
+                               else //top right
+                               {
+                                       if ((vid_conwidth - center_x)/center_y < screen_ar) //right
+                                               panel_pos_x += f * (vid_conwidth - panel_pos_x);
+                                       else //top
+                                               panel_pos_y -= f * (panel_pos_y + panel_size_y);
+                               }
                        }
                }
        }
 
+       // draw the background, then change the virtual size of it to better fit other items inside 
        HUD_Panel_DrawBg(1);
        if(panel_bg_padding)
        {
                panel_pos += '1 1 0' * panel_bg_padding;
-               panel_size -= '2 2 0' * panel_bg_padding;
+               panel_size -= '1 1 0' * panel_bg_padding;
        }
 
-       float weapid, wpnalpha;
-
-       if(autocvar_hud_panel_weapons_fade)
-       {
-               wpnalpha = 3.2 - 2 * (time - weapontime);
-               wpnalpha = bound(0.7, wpnalpha, 1) * panel_fg_alpha;
-       }
-       else
-               wpnalpha = panel_fg_alpha;
-
-       float rows, columns;
-       float aspect = autocvar_hud_panel_weapons_aspect;
+       // after the sizing and animations are done, update the other values
        rows = panel_size_y/panel_size_x;
        rows = bound(1, floor((sqrt(4 * aspect * rows * weapon_count + rows * rows) + rows + 0.5) / 2), weapon_count);
-
        columns = ceil(weapon_count/rows);
-       float row, column;
-
-       float a, type, fullammo;
-
-       vector color;
-       vector wpnpos;
-       vector wpnsize;
-
-       vector ammo_color;
-       float ammo_alpha;
-       wpnsize = eX * panel_size_x*(1/columns) + eY * panel_size_y*(1/rows);
-       float barsize_x, barsize_y, baroffset_x, baroffset_y;
+       weapon_size = eX * panel_size_x*(1/columns) + eY * panel_size_y*(1/rows);
+       
+       // calculate position/size for visual bar displaying ammount of ammo status
        if (autocvar_hud_panel_weapons_ammo)
        {
                ammo_color = stov(autocvar_hud_panel_weapons_ammo_color);
                ammo_alpha = panel_fg_alpha * autocvar_hud_panel_weapons_ammo_alpha;
 
-
-               if(wpnsize_x/wpnsize_y > aspect)
+               if(weapon_size_x/weapon_size_y > aspect)
                {
-                       barsize_x = aspect * wpnsize_y;
-                       barsize_y = wpnsize_y;
-                       baroffset_x = (wpnsize_x - barsize_x) / 2;
+                       barsize_x = aspect * weapon_size_y;
+                       barsize_y = weapon_size_y;
+                       baroffset_x = (weapon_size_x - barsize_x) / 2;
                }
                else
                {
-                       barsize_y = 1/aspect * wpnsize_x;
-                       barsize_x = wpnsize_x;
-                       baroffset_y = (wpnsize_y - barsize_y) / 2;
+                       barsize_y = 1/aspect * weapon_size_x;
+                       barsize_x = weapon_size_x;
+                       baroffset_y = (weapon_size_y - barsize_y) / 2;
                }
        }
 
-       float show_accuracy;
-       float weapon_stats;
        if(autocvar_hud_panel_weapons_accuracy && acc_levels)
        {
                show_accuracy = true;
@@ -667,105 +667,117 @@ void HUD_Weapons(void)
 
        for(i = 0; i <= WEP_LAST-WEP_FIRST; ++i)
        {
+               // retrieve information about the current weapon to be drawn
                self = weaponorder[i];
-               if (!self || self.impulse < 0)
-                       continue;
-               if (autocvar_hud_panel_weapons_onlyowned)
-               if (!((weapons_st & self.weapons) || (self.weapon == complain_weapon && time - complain_weapon_time < when + fadetime && autocvar_hud_panel_weapons_complainbubble)))
-                       continue;
-               wpnpos = panel_pos + eX * column * wpnsize_x + eY * row * wpnsize_y;
-
-               weapid = self.impulse;
+               weapon_id = self.impulse;
+               
+               // skip if this weapon doesn't exist
+               if (!self || self.impulse < 0) { continue; }
+               
+               // skip this weapon if we don't own it (and onlyowned is enabled)-- or if weapons_complainbubble is showing for this weapon
+               if (autocvar_hud_panel_weapons_onlyowned
+                       && !((weapons_stat & self.weapons) 
+                       || (self.weapon == complain_weapon 
+                               && time - complain_weapon_time < when + fadetime 
+                               && autocvar_hud_panel_weapons_complainbubble)))
+                                       continue;
+                                       
+               // figure out the drawing position of weapon
+               weapon_pos = (panel_pos 
+                       + eX * column * weapon_size_x 
+                       + eY * row * weapon_size_y);
 
                // draw background behind currently selected weapon
                if(self.weapon == switchweapon)
-                       drawpic_aspect_skin(wpnpos, "weapon_current_bg", wpnsize, '1 1 1', wpnalpha, DRAWFLAG_NORMAL);
+                       drawpic_aspect_skin(weapon_pos, "weapon_current_bg", weapon_size, '1 1 1', weapon_alpha, DRAWFLAG_NORMAL);
 
                // draw the weapon accuracy
                if(show_accuracy)
                {
-                       weapon_stats = weapon_accuracy[self.weapon-WEP_FIRST];
-                       if(weapon_stats >= 0)
+                       panel_weapon_accuracy = weapon_accuracy[self.weapon-WEP_FIRST];
+                       if(panel_weapon_accuracy >= 0)
                        {
-                               // find the max level lower than weapon_stats
-                               float j;
+                               // find the max level lower than weapon_accuracy
                                j = acc_levels-1;
-                               while ( j && weapon_stats < acc_lev[j] )
+                               while ( j && panel_weapon_accuracy < acc_lev[j] )
                                        --j;
 
-                               // inject color j+1 in color j, how much depending on how much weapon_stats is higher than level j
-                               float factor;
-                               factor = (weapon_stats - acc_lev[j]) / (acc_lev[j+1] - acc_lev[j]);
+                               // inject color j+1 in color j, how much depending on how much weapon_accuracy is higher than level j
+                               factor = (panel_weapon_accuracy - acc_lev[j]) / (acc_lev[j+1] - acc_lev[j]);
                                color = acc_col[j];
                                color = color + factor * (acc_col[j+1] - color);
 
-                               drawpic_aspect_skin(wpnpos, "weapon_accuracy", wpnsize, color, panel_fg_alpha, DRAWFLAG_NORMAL);
+                               drawpic_aspect_skin(weapon_pos, "weapon_accuracy", weapon_size, color, panel_fg_alpha, DRAWFLAG_NORMAL);
                        }
                }
 
-               // draw the weapon icon
-               if(weapons_st & self.weapons)
+               // drawing all the weapon items
+               if(weapons_stat & self.weapons)
                {
-                       drawpic_aspect_skin(wpnpos, strcat("weapon", self.netname), wpnsize, '1 1 1', wpnalpha, DRAWFLAG_NORMAL);
-
-                       if(autocvar_hud_panel_weapons_label == 1) // weapon number
-                               drawstring(wpnpos, ftos(weapid), '1 1 0' * 0.5 * wpnsize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
-                       else if(autocvar_hud_panel_weapons_label == 2) // bind
-                               drawstring(wpnpos, getcommandkey(ftos(weapid), strcat("impulse ", ftos(weapid))), '1 1 0' * 0.5 * wpnsize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+                       // draw the weapon image
+                       drawpic_aspect_skin(weapon_pos, strcat("weapon", self.netname), weapon_size, '1 1 1', weapon_alpha, DRAWFLAG_NORMAL);
 
+                       // draw weapon label string
+                       switch(autocvar_hud_panel_weapons_label)
+                       {
+                               case 1: // weapon number
+                                       drawstring(weapon_pos, ftos(weapon_id), '1 1 0' * 0.5 * weapon_size_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+                                       break;
+                                       
+                               case 2: // bind
+                                       drawstring(weapon_pos, getcommandkey(ftos(weapon_id), strcat("impulse ", ftos(weapon_id))), '1 1 0' * 0.5 * weapon_size_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+                                       break;
+                                       
+                               case 3: // weapon name
+                                       drawstring(weapon_pos, self.netname, '1 1 0' * 0.5 * weapon_size_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+                                       break;
+                                       
+                               default: // nothing
+                                       break;
+                       }
+                       
                        // draw ammo status bar
                        if(autocvar_hud_panel_weapons_ammo && self.weapon != WEP_TUBA && self.weapon != WEP_LASER && self.weapon != WEP_PORTO)
                        {
                                a = 0;
-                               type = GetAmmoTypeForWep(self.weapon);
-                               if(type != -1)
-                                       a = getstati(GetAmmoStat(type)); // how much ammo do we have?
+                               ammo_type = GetAmmoTypeForWep(self.weapon);
+                               if(ammo_type != -1)
+                                       a = getstati(GetAmmoStat(ammo_type)); // how much ammo do we have?
 
                                if(a > 0)
                                {
-                                       switch(type) {
-                                               case 0: fullammo = autocvar_hud_panel_weapons_ammo_full_shells; break;
-                                               case 1: fullammo = autocvar_hud_panel_weapons_ammo_full_nails; break;
-                                               case 2: fullammo = autocvar_hud_panel_weapons_ammo_full_rockets; break;
-                                               case 3: fullammo = autocvar_hud_panel_weapons_ammo_full_cells; break;
-                                               case 4: fullammo = autocvar_hud_panel_weapons_ammo_full_fuel; break;
-                                               default: fullammo = 60;
+                                       switch(ammo_type) {
+                                               case 0: ammo_full = autocvar_hud_panel_weapons_ammo_full_shells; break;
+                                               case 1: ammo_full = autocvar_hud_panel_weapons_ammo_full_nails; break;
+                                               case 2: ammo_full = autocvar_hud_panel_weapons_ammo_full_rockets; break;
+                                               case 3: ammo_full = autocvar_hud_panel_weapons_ammo_full_cells; break;
+                                               case 4: ammo_full = autocvar_hud_panel_weapons_ammo_full_fuel; break;
+                                               default: ammo_full = 60;
                                        }
 
                                        drawsetcliparea(
-                                               wpnpos_x + baroffset_x,
-                                               wpnpos_y + baroffset_y,
-                                               barsize_x * bound(0, a/fullammo, 1),
+                                               weapon_pos_x + baroffset_x,
+                                               weapon_pos_y + baroffset_y,
+                                               barsize_x * bound(0, a/ammo_full, 1),
                                                barsize_y);
-                                       drawpic_aspect_skin(wpnpos, "weapon_ammo", wpnsize, ammo_color, ammo_alpha, DRAWFLAG_NORMAL);
+                                       drawpic_aspect_skin(weapon_pos, "weapon_ammo", weapon_size, ammo_color, ammo_alpha, DRAWFLAG_NORMAL);
                                        drawresetcliparea();
                                }
                        }
                }
-
-               // draw a "ghost weapon icon" if you don't have the weapon
-               else
+               else // draw a "ghost weapon icon" if you don't have the weapon
                {
-                       drawpic_aspect_skin(wpnpos, strcat("weapon", self.netname), wpnsize, '0 0 0', panel_fg_alpha * 0.5, DRAWFLAG_NORMAL);
+                       drawpic_aspect_skin(weapon_pos, strcat("weapon", self.netname), weapon_size, '0 0 0', panel_fg_alpha * 0.5, DRAWFLAG_NORMAL);
                }
-
+               
                // draw the complain message
                if(time - complain_weapon_time < when + fadetime && self.weapon == complain_weapon && autocvar_hud_panel_weapons_complainbubble)
                {
                        if(fadetime)
-                       {
-                               if(complain_weapon_time + when > time)
-                                       a = 1;
-                               else
-                                       a = bound(0, (complain_weapon_time + when + fadetime - time) / fadetime, 1);
-                       }
+                               a = ((complain_weapon_time + when > time) ? 1 : bound(0, (complain_weapon_time + when + fadetime - time) / fadetime, 1));
                        else
-                       {
-                               if(complain_weapon_time + when > time)
-                                       a = 1;
-                               else
-                                       a = 0;
-                       }
+                               a = ((complain_weapon_time + when > time) ? 1 : 0);
+
 
                        string s;
                        if(complain_weapon_type == 0) {
@@ -781,10 +793,11 @@ void HUD_Weapons(void)
                                color = stov(autocvar_hud_panel_weapons_complainbubble_color_unavailable);
                        }
                        float padding = autocvar_hud_panel_weapons_complainbubble_padding;
-                       drawpic_aspect_skin(wpnpos + '1 1 0' * padding, "weapon_complainbubble", wpnsize - '2 2 0' * padding, color, a * panel_fg_alpha, DRAWFLAG_NORMAL);
-                       drawstring_aspect(wpnpos + '1 1 0' * padding, s, wpnsize - '2 2 0' * padding, '1 1 1', panel_fg_alpha * a, DRAWFLAG_NORMAL);
+                       drawpic_aspect_skin(weapon_pos + '1 1 0' * padding, "weapon_complainbubble", weapon_size - '2 2 0' * padding, color, a * panel_fg_alpha, DRAWFLAG_NORMAL);
+                       drawstring_aspect(weapon_pos + '1 1 0' * padding, s, weapon_size - '2 2 0' * padding, '1 1 1', panel_fg_alpha * a, DRAWFLAG_NORMAL);
                }
 
+               // continue with new position for the next weapon
                ++row;
                if(row >= rows)
                {
@@ -792,7 +805,6 @@ void HUD_Weapons(void)
                        ++column;
                }
        }
-
 }
 
 // Ammo (#1)
@@ -1789,10 +1801,55 @@ 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 +2396,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 +2435,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 +3006,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 +3016,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 +3926,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;
@@ -4440,7 +4521,6 @@ float centerprint_msgID[CENTERPRINT_MAX_MSGS];
 float centerprint_time[CENTERPRINT_MAX_MSGS];
 float centerprint_expire_time[CENTERPRINT_MAX_MSGS];
 float centerprint_countdown_num[CENTERPRINT_MAX_MSGS];
-float centerprint_fadetime;
 float centerprint_showing;
 
 void centerprint_generic(float new_id, string strMessage, float duration, float countdown_num)
@@ -4473,8 +4553,6 @@ void centerprint_generic(float new_id, string strMessage, float duration, float
        if (!centerprint_showing)
                centerprint_showing = TRUE;
 
-       centerprint_fadetime = bound(0, autocvar_hud_panel_centerprint_fadetime, 1);
-
        for (i=0, j=cpm_index; i<CENTERPRINT_MAX_MSGS; ++i, ++j)
        {
                if (j == CENTERPRINT_MAX_MSGS)
@@ -4484,9 +4562,9 @@ void centerprint_generic(float new_id, string strMessage, float duration, float
                        if (strMessage == "" && centerprint_messages[j] != "" && centerprint_countdown_num[j] == 0)
                        {
                                // fade out the current msg (duration and countdown_num are ignored)
-                               centerprint_time[j] = centerprint_fadetime;
-                               if (centerprint_expire_time[j] > time + centerprint_fadetime || centerprint_expire_time[j] < time)
-                                       centerprint_expire_time[j] = time + centerprint_fadetime;
+                               centerprint_time[j] = min(5, autocvar_hud_panel_centerprint_fade_out);
+                               if (centerprint_expire_time[j] > time + min(5, autocvar_hud_panel_centerprint_fade_out) || centerprint_expire_time[j] < time)
+                                       centerprint_expire_time[j] = time + min(5, autocvar_hud_panel_centerprint_fade_out);
                                return;
                        }
                        break; // found a msg with the same id, at position j
@@ -4577,9 +4655,14 @@ void HUD_CenterPrint (void)
                if (scoreboard_bottom >= 0.96 * vid_conheight)
                        return;
                vector target_pos;
+               
                target_pos = eY * scoreboard_bottom + eX * 0.5 * (vid_conwidth - panel_size_x);
-               panel_pos = panel_pos + (target_pos - panel_pos) * sqrt(scoreboard_fade_alpha);
-               panel_size_y = min(panel_size_y, vid_conheight - scoreboard_bottom);
+               
+               if(target_pos_y > panel_pos_y)
+               {
+                       panel_pos = panel_pos + (target_pos - panel_pos) * sqrt(scoreboard_fade_alpha);
+                       panel_size_y = min(panel_size_y, vid_conheight - scoreboard_bottom);
+               }
        }
 
        HUD_Panel_DrawBg(1);
@@ -4629,22 +4712,32 @@ void HUD_CenterPrint (void)
                        else
                                continue;
                }
-               if (centerprint_time[j] < 0 || centerprint_expire_time[j] - centerprint_fadetime > time)
-               {
-                       a = bound(0, (time - (centerprint_expire_time[j] - centerprint_time[j])) / centerprint_fadetime, 1);
-                       sz = 0.8 + a * (1 - 0.8);
-               }
+               
+               // fade the centerprint in/out 
+               if (centerprint_time[j] < 0 || centerprint_expire_time[j] - autocvar_hud_panel_centerprint_fade_out > time)
+                       a = bound(0, (time - (centerprint_expire_time[j] - centerprint_time[j])) / max(0.0001, autocvar_hud_panel_centerprint_fade_in), 1);
                else if (centerprint_expire_time[j] > time)
+                       a = (centerprint_expire_time[j] - time) / max(0.0001, autocvar_hud_panel_centerprint_fade_out);
+               
+               // set the size from fading in/out before subsequent fading
+               sz = autocvar_hud_panel_centerprint_fade_minfontsize + a * (1 - autocvar_hud_panel_centerprint_fade_minfontsize); 
+               
+               // also fade it based on positioning
+               if(autocvar_hud_panel_centerprint_fade_subsequent)
                {
-                       a = (centerprint_expire_time[j] - time) / centerprint_fadetime;
-                       sz = 0.8 + a * (1 - 0.8);
+                       a = a * bound(autocvar_hud_panel_centerprint_fade_subsequent_passone_minalpha, (1 - (i / max(1, autocvar_hud_panel_centerprint_fade_subsequent_passone))), 1); // pass one: all messages after the first have half alpha
+                       a = a * bound(autocvar_hud_panel_centerprint_fade_subsequent_passtwo_minalpha, (1 - (i / max(1, autocvar_hud_panel_centerprint_fade_subsequent_passtwo))), 1); // pass two: after that, gradually lower alpha even more for each message
                }
-
+               
+               // finally set the size based on the new alpha from subsequent fading
+               sz = sz * (autocvar_hud_panel_centerprint_fade_subsequent_minfontsize + a * (1 - autocvar_hud_panel_centerprint_fade_subsequent_minfontsize)); 
                drawfontscale = sz * '1 1 0';
+               
                if (centerprint_countdown_num[j])
                        n = tokenizebyseparator(sprintf(centerprint_messages[j], centerprint_countdown_num[j]), "\n");
                else
                        n = tokenizebyseparator(centerprint_messages[j], "\n");
+
                if (autocvar_hud_panel_centerprint_flip)
                {
                        // check if the message can be entirely shown
@@ -4658,12 +4751,6 @@ void HUD_CenterPrint (void)
                                                pos_y -= fontsize_y;
                                        else
                                                pos_y -= fontsize_y * CENTERPRINT_SPACING/2;
-                                       // NOTE: uncommented so as to not reject messages whenever they are "too large" -- This just continues drawing it anyway.
-                                       //if (pos_y < panel_pos_y) // check if the next line can be shown
-                                       //{
-                                       //      drawfontscale = '1 1 0';
-                                       //      return;
-                                       //}
                                }
                        }
                        current_msg_pos_y = pos_y; // save starting pos (first line) of the current message
@@ -4685,12 +4772,6 @@ void HUD_CenterPrint (void)
                                }
                                else
                                        pos_y += fontsize_y * CENTERPRINT_SPACING/2;
-                               // NOTE: uncommented so as to not reject messages whenever they are "too large" -- This just continues drawing it anyway.
-                               //if (!autocvar_hud_panel_centerprint_flip && pos_y > panel_pos_y + panel_size_y - fontsize_y) // check if the next line can be shown
-                               //{
-                               //      drawfontscale = '1 1 0';
-                               //      return;
-                               //}
                        }
                }
                msg_size = pos_y - msg_size;
@@ -4698,13 +4779,25 @@ void HUD_CenterPrint (void)
                {
                        pos_y = current_msg_pos_y - CENTERPRINT_SPACING * fontsize_y;
                        if (a < 1 && centerprint_msgID[j] == 0) // messages with id can be replaced just after they are faded out, so never move over them the next messages
-                               pos_y += (msg_size + CENTERPRINT_SPACING * fontsize_y) * (1 - sqrt(a));
+                               pos_y += (msg_size + CENTERPRINT_SPACING * fontsize_y) * (1 - sqrt(sz));
+                               
+                       if (pos_y < panel_pos_y) // check if the next message can be shown
+                       {
+                               drawfontscale = '1 1 0';
+                               return;
+                       }
                }
                else
                {
                        pos_y += CENTERPRINT_SPACING * fontsize_y;
                        if (a < 1 && centerprint_msgID[j] == 0) // messages with id can be replaced just after they are faded out, so never move over them the next messages
-                               pos_y -= (msg_size + CENTERPRINT_SPACING * fontsize_y) * (1 - sqrt(a));
+                               pos_y -= (msg_size + CENTERPRINT_SPACING * fontsize_y) * (1 - sqrt(sz));
+                               
+                       if(pos_y > panel_pos_y + panel_size_y - fontsize_y) // check if the next message can be shown
+                       {
+                               drawfontscale = '1 1 0';
+                               return;
+                       }
                }
        }
        drawfontscale = '1 1 0';
@@ -4912,15 +5005,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 f26f65ea54b53d3c7a5d8cd564457416d81755d7..cf6a0f70afa88c4a369c869ccbc7bc6d0cc53d13 100644 (file)
@@ -35,6 +35,9 @@ void HUD_Panel_ExportCfg(string cfgname)
                HUD_Write_Cvar_q("hud_progressbar_armor_color");
                HUD_Write_Cvar_q("hud_progressbar_fuel_color");
                HUD_Write_Cvar_q("hud_progressbar_nexball_color");
+               HUD_Write_Cvar_q("hud_progressbar_speed_color");
+               HUD_Write_Cvar_q("hud_progressbar_acceleration_color");
+               HUD_Write_Cvar_q("hud_progressbar_acceleration_neg_color");
                HUD_Write("\n");
 
                HUD_Write_Cvar_q("_hud_panelorder");
@@ -61,17 +64,23 @@ void HUD_Panel_ExportCfg(string cfgname)
                        HUD_Write_PanelCvar_q("_bg_border");
                        HUD_Write_PanelCvar_q("_bg_padding");
                        switch(i) {
-                               case HUD_PANEL_WEAPONS:
+                               case HUD_PANEL_WEAPONS: 
+                                       HUD_Write_PanelCvar_q("_accuracy");
+                                       HUD_Write_PanelCvar_q("_label");
                                        HUD_Write_PanelCvar_q("_complainbubble");
                                        HUD_Write_PanelCvar_q("_complainbubble_padding");
+                                       HUD_Write_PanelCvar_q("_complainbubble_time");
+                                       HUD_Write_PanelCvar_q("_complainbubble_fadetime");
                                        HUD_Write_PanelCvar_q("_complainbubble_color_outofammo");
                                        HUD_Write_PanelCvar_q("_complainbubble_color_donthave");
                                        HUD_Write_PanelCvar_q("_complainbubble_color_unavailable");
+                                       HUD_Write_PanelCvar_q("_ammo");
                                        HUD_Write_PanelCvar_q("_ammo_color");
                                        HUD_Write_PanelCvar_q("_ammo_alpha");
                                        HUD_Write_PanelCvar_q("_aspect");
                                        HUD_Write_PanelCvar_q("_timeout");
                                        HUD_Write_PanelCvar_q("_timeout_effect");
+                                       HUD_Write_PanelCvar_q("_onlyowned");
                                        break;
                                case HUD_PANEL_AMMO:
                                        HUD_Write_PanelCvar_q("_onlycurrent");
@@ -88,6 +97,7 @@ void HUD_Panel_ExportCfg(string cfgname)
                                        HUD_Write_PanelCvar_q("_progressbar");
                                        HUD_Write_PanelCvar_q("_progressbar_strength");
                                        HUD_Write_PanelCvar_q("_progressbar_shield");
+                                       HUD_Write_PanelCvar_q("_text");
                                        break;
                                case HUD_PANEL_HEALTHARMOR:
                                        HUD_Write_PanelCvar_q("_flip");
@@ -96,37 +106,79 @@ void HUD_Panel_ExportCfg(string cfgname)
                                        HUD_Write_PanelCvar_q("_progressbar");
                                        HUD_Write_PanelCvar_q("_progressbar_health");
                                        HUD_Write_PanelCvar_q("_progressbar_armor");
+                                       HUD_Write_PanelCvar_q("_progressbar_gfx");
+                                       HUD_Write_PanelCvar_q("_progressbar_gfx_smooth");
                                        HUD_Write_PanelCvar_q("_text");
                                        break;
                                case HUD_PANEL_NOTIFY:
                                        HUD_Write_PanelCvar_q("_flip");
                                        HUD_Write_PanelCvar_q("_fontsize");
                                        HUD_Write_PanelCvar_q("_print");
+                                       HUD_Write_PanelCvar_q("_time");
+                                       HUD_Write_PanelCvar_q("_fadetime");
+                                       break;
+                               case HUD_PANEL_TIMER:
+                                       HUD_Write_PanelCvar_q("_increment");
                                        break;
                                case HUD_PANEL_RADAR:
                                        HUD_Write_PanelCvar_q("_foreground_alpha");
+                                       HUD_Write_PanelCvar_q("_rotation");
+                                       HUD_Write_PanelCvar_q("_zoommode");
+                                       HUD_Write_PanelCvar_q("_scale");
+                                       HUD_Write_PanelCvar_q("_maximized_scale");
+                                       HUD_Write_PanelCvar_q("_maximized_size");
+                                       break;
+                               case HUD_PANEL_SCORE:
+                                       HUD_Write_PanelCvar_q("_rankings");
                                        break;
                                case HUD_PANEL_VOTE:
                                        HUD_Write_PanelCvar_q("_alreadyvoted_alpha");
                                        break;
+                               case HUD_PANEL_MODICONS:
+                                       HUD_Write_PanelCvar_q("_dom_layout");
+                                       break;
                                case HUD_PANEL_PRESSEDKEYS:
                                        HUD_Write_PanelCvar_q("_aspect");
                                        break;
+                               case HUD_PANEL_ENGINEINFO:
+                                       HUD_Write_PanelCvar_q("_framecounter_time");
+                                       HUD_Write_PanelCvar_q("_framecounter_decimals");
+                                       break;
                                case HUD_PANEL_INFOMESSAGES:
                                        HUD_Write_PanelCvar_q("_flip");
                                        break;
                                case HUD_PANEL_PHYSICS:
+                                       HUD_Write_PanelCvar_q("_speed_unit");
+                                       HUD_Write_PanelCvar_q("_speed_unit_show");
+                                       HUD_Write_PanelCvar_q("_speed_max");
+                                       HUD_Write_PanelCvar_q("_speed_vertical");
+                                       HUD_Write_PanelCvar_q("_topspeed");
+                                       HUD_Write_PanelCvar_q("_topspeed_time");
+                                       HUD_Write_PanelCvar_q("_acceleration_max");
+                                       HUD_Write_PanelCvar_q("_acceleration_vertical");
                                        HUD_Write_PanelCvar_q("_flip");
                                        HUD_Write_PanelCvar_q("_baralign");
                                        HUD_Write_PanelCvar_q("_progressbar");
-                                       HUD_Write_PanelCvar_q("_acceleration_mode");
+                                       HUD_Write_PanelCvar_q("_progressbar_acceleration_mode");
+                                       HUD_Write_PanelCvar_q("_progressbar_acceleration_scale");
+                                       HUD_Write_PanelCvar_q("_progressbar_acceleration_nonlinear");
+                                       HUD_Write_PanelCvar_q("_text");
+                                       HUD_Write_PanelCvar_q("_text_scale");
                                        break;
                                case HUD_PANEL_CENTERPRINT:
                                        HUD_Write_PanelCvar_q("_align");
                                        HUD_Write_PanelCvar_q("_flip");
                                        HUD_Write_PanelCvar_q("_fontscale");
                                        HUD_Write_PanelCvar_q("_time");
-                                       HUD_Write_PanelCvar_q("_fadetime");
+                                       HUD_Write_PanelCvar_q("_fade_in");
+                                       HUD_Write_PanelCvar_q("_fade_out");
+                                       HUD_Write_PanelCvar_q("_fade_subsequent");
+                                       HUD_Write_PanelCvar_q("_fade_subsequent_passone");
+                                       HUD_Write_PanelCvar_q("_fade_subsequent_passone_minalpha");
+                                       HUD_Write_PanelCvar_q("_fade_subsequent_passtwo");
+                                       HUD_Write_PanelCvar_q("_fade_subsequent_passtwo_minalpha");
+                                       HUD_Write_PanelCvar_q("_fade_subsequent_minfontsize");
+                                       HUD_Write_PanelCvar_q("_fade_minfontsize");
                                        break;
                        }
                        HUD_Write("\n");
@@ -583,7 +635,7 @@ float HUD_Panel_InputEvent(float bInputType, float nPrimary, float nSecondary)
        string con_keys;
        float keys;
        con_keys = findkeysforcommand("toggleconsole");
-       keys = tokenize(con_keys);
+       keys = tokenize(con_keys); // findkeysforcommand returns data for this
 
        float hit_con_bind, i;
        for (i = 0; i < keys; ++i)
index 9ea50c02b33d285aabce80a91a0504e470b2977f..58a0bad1969c8dbdaee95fcff27c75390f23a303 100644 (file)
@@ -131,10 +131,6 @@ float ready_waiting_for_me;
 float vote_waiting;
 float vote_waiting_for_me;
 
-float previous_game_starttime;
-entity restartAnnouncer; //a temporary entity which will play the countdown sounds 3, 2, 1 for the client
-void restartAnnouncer_Think();
-
 float current_zoomfraction;
 
 float cs_project_is_b0rked;
index 7301fbf0bbf2922fa30b14f83c487e770239da5e..1a512c77481260b2aa9a29de4ddd981d1df8a168 100644 (file)
@@ -3,189 +3,6 @@ var float(string text, float handleColors, vector fontSize) stringwidth;
 entity players;
 entity teams;
 
-void serverAnnouncer()
-{
-       // check for pending announcement, play it and remove it
-       if(announce_snd != "")
-       {
-               sound(world, CH_INFO, strcat("announcer/", autocvar_cl_announcer, "/", announce_snd, ".wav"), VOL_BASEVOICE, ATTN_NONE);
-               strunzone(announce_snd);
-               announce_snd = "";
-       }
-}
-
-void restartAnnouncer_Think() {
-       float countdown_rounded, countdown;
-       countdown = getstatf(STAT_GAMESTARTTIME) - time;
-       countdown_rounded = floor(0.5 + countdown);
-       if(countdown <= 0) {
-               if (!spectatee_status) //do cprint only for players
-                       centerprint_generic(CPID_GAME_STARTING, _("^1Begin!"), 1, 0);
-
-               sound(world, CH_INFO, strcat("announcer/", autocvar_cl_announcer, "/begin.wav"), VOL_BASEVOICE, ATTN_NONE);
-               //reset maptime announcers now as well
-               announcer_5min = announcer_1min = FALSE;
-
-               remove(self);
-               return;
-       }
-       else {
-               if (!spectatee_status) //do cprint only for players
-                       centerprint_generic(CPID_GAME_STARTING, _("^1Game starts in %d seconds"), 1, countdown_rounded);
-
-               if(countdown_rounded <= 3 && countdown_rounded >= 1) {
-                       sound(world, CH_INFO, strcat("announcer/", autocvar_cl_announcer, "/", ftos(countdown_rounded), ".wav"), VOL_BASEVOICE, ATTN_NONE);
-               }
-
-               self.nextthink = getstatf(STAT_GAMESTARTTIME) - (countdown - 1);
-       }
-}
-
-/**
- * Plays the 1minute or 5 minutes (of maptime) remaining sound, if client wants it
- */
-void maptimeAnnouncer() {
-       float timelimit;
-       timelimit = getstatf(STAT_TIMELIMIT);
-       float timeleft;
-       timeleft = max(0, timelimit * 60 + getstatf(STAT_GAMESTARTTIME) - time);
-
-       float warmuplimit;
-       float warmuptimeleft;
-       if(warmup_stage) {
-               warmuplimit = autocvar_g_warmup_limit;
-               if(warmuplimit > 0) {
-                       warmuptimeleft = max(0, warmuplimit + getstatf(STAT_GAMESTARTTIME) - time); 
-               }
-       }
-
-       //5 minute check
-       if (autocvar_cl_sound_maptime_warning >= 2) {
-               //make sure that after connect (and e.g. 4 minutes left) we will not get a wrong sound
-               if(announcer_5min)
-               {
-                       if(((!warmup_stage || warmuplimit == 0) && timeleft > 300) || (warmup_stage && warmuplimit > 0 && warmuptimeleft > 300))
-                               announcer_5min = FALSE;
-               }
-               else if (((!warmup_stage || warmuplimit == 0) && timelimit > 0 && timeleft < 300 && timeleft > 299) || (warmup_stage && warmuplimit > 0 && warmuptimeleft < 300 && warmuptimeleft > 299))
-                       //if we're in warmup mode, check whether there's a warmup timelimit
-                       if not (warmuplimit == -1 && warmup_stage) {
-                               announcer_5min = TRUE;
-                               sound(world, CH_INFO, strcat("announcer/", autocvar_cl_announcer, "/5minutesremain.wav"), VOL_BASEVOICE, ATTN_NONE);
-                       }
-       }
-
-       //1 minute check
-       if (autocvar_cl_sound_maptime_warning == 1 || autocvar_cl_sound_maptime_warning == 3) {
-               if (announcer_1min)
-               {
-                       if(((!warmup_stage || warmuplimit == 0) && timeleft > 60) || (warmup_stage && warmuplimit > 0 && warmuptimeleft > 60))
-                               announcer_1min = FALSE;
-               }
-               else if (((!warmup_stage || warmuplimit == 0) && timelimit > 0 && timeleft < 60) || (warmup_stage && warmuplimit > 0 && warmuptimeleft < 60))
-                       //if we're in warmup mode, check whether there's a warmup timelimit
-                       if not (warmuplimit == -1 && warmup_stage) {
-                               announcer_1min = TRUE;
-                               sound(world, CH_INFO, strcat("announcer/", autocvar_cl_announcer, "/1minuteremains.wav"), VOL_BASEVOICE, ATTN_NONE);
-                       }
-       }
-}
-
-/**
- * Announce carried items (e.g. flags in CTF).
- */
-float redflag_prev;
-float blueflag_prev;
-void carrierAnnouncer() {
-       float stat_items, redflag, blueflag;
-       float pickup;
-       string item;
-
-       if not(autocvar_cl_notify_carried_items)
-               return;
-
-       stat_items = getstati(STAT_ITEMS);
-
-       redflag = (stat_items/IT_RED_FLAG_TAKEN) & 3;
-       blueflag = (stat_items/IT_BLUE_FLAG_TAKEN) & 3;
-
-       if (redflag == 3 && redflag != redflag_prev) {
-               item = _("^1RED^7 flag");
-               pickup = (redflag_prev == 2);
-       }
-
-       if (blueflag == 3 && blueflag != blueflag_prev) {
-               item = _("^4BLUE^7 flag");
-               pickup = (blueflag_prev == 2);
-       }
-
-       if (item)
-       {
-               if (pickup) {
-                       if (autocvar_cl_notify_carried_items & 2)
-                               centerprint(sprintf(_("You picked up the %s!"), item));
-               }
-               else {
-                       if (autocvar_cl_notify_carried_items & 1)
-                               centerprint(sprintf(_("You got the %s!"), item));
-               }
-       }
-
-       blueflag_prev = blueflag;
-       redflag_prev = redflag;
-}
-
-/**
- * Add all future announcer sounds precaches here.
- * TODO: announcer queues
- */
-void Announcer_Precache () {
-       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/1minuteremains.wav"));
-       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/5minutesremain.wav"));
-
-       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/electrobitch.wav"));
-       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/airshot.wav"));
-       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/03kills.wav"));
-       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/05kills.wav"));
-       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/10kills.wav"));
-       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/15kills.wav"));
-       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/20kills.wav"));
-       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/25kills.wav"));
-       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/30kills.wav"));
-       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/botlike.wav"));
-       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/yoda.wav"));
-       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/amazing.wav"));
-       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/awesome.wav"));
-       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/headshot.wav"));
-       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/impressive.wav"));
-
-       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/prepareforbattle.wav"));
-       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/begin.wav"));
-       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/timeoutcalled.wav"));
-       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/1fragleft.wav"));
-       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/2fragsleft.wav"));
-       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/3fragsleft.wav"));
-       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/terminated.wav"));
-
-       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/1.wav"));
-       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/2.wav"));
-       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/3.wav"));
-       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/4.wav"));
-       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/5.wav"));
-       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/6.wav"));
-       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/7.wav"));
-       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/8.wav"));
-       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/9.wav"));
-       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/10.wav"));
-
-       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/lastsecond.wav"));
-       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/narrowly.wav"));
-
-       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/voteaccept.wav"));
-       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/votecall.wav"));
-       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/votefail.wav"));
-}
-
 void AuditLists()
 {
        entity e;
index 0d024a9411fc4306280c5b54c22a3d89a7669f59..f650d04bda64703050ecd00610833db629dd7dcc 100644 (file)
@@ -66,6 +66,7 @@ vehicles/vehicles.qc
 shownames.qh
 shownames.qc
 
+announcer.qc
 Main.qc
 View.qc
 interpolate.qc
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 be457e480876119eaf22a614cfe8138c8ca374f1..9d2e8bd580be7ffc59ae68463d7e1f315515d2a5 100644 (file)
@@ -1053,6 +1053,59 @@ vector HUD_DrawScoreboardAccuracyStats(vector pos, vector rgb, vector bg_size)
        return pos;
 }
 
+vector HUD_DrawKeyValue(vector pos, string key, string value) {
+       float px = pos_x;
+       pos_x += hud_fontsize_x * 0.25;
+       drawstring(pos, key, hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
+       pos_x = xmax - stringwidth(value, FALSE, hud_fontsize) - hud_fontsize_x * 0.25;
+       drawstring(pos, value, hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
+       pos_x = px;
+       pos_y+= hud_fontsize_y;
+       
+       return pos;
+}
+
+vector HUD_DrawMapStats(vector pos, vector rgb, vector bg_size) {
+       float stat_secrets_found, stat_secrets_total;
+       float rows;
+       string val;
+
+       // get secrets stats
+       stat_secrets_found = getstatf(STAT_SECRETS_FOUND);
+       stat_secrets_total = getstatf(STAT_SECRETS_TOTAL);
+
+       // get number of rows
+       rows = (stat_secrets_total ? 1 : 0);
+
+       // if no rows, return
+       if not(rows)
+               return pos;
+
+       //  draw table header
+       drawstring(pos, _("Map stats:"), hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
+       pos_y += 1.25 * hud_fontsize_y + autocvar_scoreboard_border_thickness;
+       
+       // draw table   
+       vector tmp;
+       tmp_x = sbwidth;
+       tmp_y = hud_fontsize_y * rows;
+
+       if (teamplay)
+               drawpic_tiled(pos, "gfx/scoreboard/scoreboard_bg", bg_size, tmp, rgb * autocvar_scoreboard_color_bg_team, scoreboard_alpha_bg, DRAWFLAG_NORMAL);
+       else
+               drawpic_tiled(pos, "gfx/scoreboard/scoreboard_bg", bg_size, tmp, rgb, scoreboard_alpha_bg, DRAWFLAG_NORMAL);
+       drawborderlines(autocvar_scoreboard_border_thickness, pos, tmp, '0 0 0', scoreboard_alpha_bg * 0.75, DRAWFLAG_NORMAL);
+
+       // draw secrets
+       val = sprintf("%d/%d", stat_secrets_found, stat_secrets_total);
+       pos = HUD_DrawKeyValue(pos, _("Secrets found:"), val);
+       
+       // update position
+       pos_y += 1.25 * hud_fontsize_y;
+       return pos;
+}
+
+
 vector HUD_DrawScoreboardRankings(vector pos, entity pl,  vector rgb, vector bg_size)
 {
        float i;
@@ -1151,11 +1204,11 @@ void HUD_DrawScoreboard()
        entity pl, tm;
        string str;
 
-       xmin = autocvar_scoreboard_offset_left * vid_conwidth;
-       ymin = autocvar_con_notify * autocvar_con_notifysize;
+       xmin = (autocvar_scoreboard_offset_left * vid_conwidth);
+       ymin = max((autocvar_con_notify * autocvar_con_notifysize), (autocvar_scoreboard_offset_vertical * vid_conwidth));
 
-       xmax = (1 - autocvar_scoreboard_offset_right) * vid_conwidth;
-       ymax = vid_conheight - ymin;
+       xmax = ((1 - autocvar_scoreboard_offset_right) * vid_conwidth);
+       ymax = (vid_conheight - ymin);
 
        sbwidth = xmax - xmin;
 
@@ -1228,6 +1281,12 @@ void HUD_DrawScoreboard()
                        pos = HUD_DrawScoreboardAccuracyStats(pos, rgb, bg_size);
        }
 
+               
+       if(teamplay)
+               pos = HUD_DrawMapStats(pos, GetTeamRGB(myteam), bg_size);
+       else
+               pos = HUD_DrawMapStats(pos, rgb, bg_size);
+
        // List spectators
        float specs;
        specs = 0;
index b13f6122c268cdaaa1b4cd18a0783ff70387d82d..21e8bcd420799ac3688e938abcefcc780cf67fd4 100644 (file)
@@ -4,9 +4,10 @@
 // self.armorvalue
 // self.sameteam = player is on same team as local client
 // self.fadedelay = time to wait before name tag starts fading in for enemies
+// self.pointtime = last time you pointed at this player
 //
 const float SHOWNAMES_FADESPEED = 4;
-const float SHOWNAMES_FADEDELAY = 0.5;
+const float SHOWNAMES_FADEDELAY = 0.4;
 void Draw_ShowNames(entity ent)
 {
        if(!autocvar_hud_shownames)
@@ -21,9 +22,9 @@ void Draw_ShowNames(entity ent)
        if(ent.sameteam || (!ent.sameteam && autocvar_hud_shownames_enemies))
        {
                ent.origin_z += autocvar_hud_shownames_offset;
-
+       
                float hit;
-               if(ent.sameteam)
+               if(ent.sameteam && !autocvar_hud_shownames_crosshairdistance)
                {
                        hit = 1;
                }
@@ -36,10 +37,12 @@ void Draw_ShowNames(entity ent)
                                hit = 1;
                }
 
+               // handle tag fading
+               float overlap, onscreen, crosshairdistance;
                vector o, eo;
+               
                o = project_3d_to_2d(ent.origin);
-               float overlap, onscreen;
-
+               
                if(autocvar_hud_shownames_antioverlap)
                {
                        // fade tag out if another tag that is closer to you overlaps
@@ -62,6 +65,18 @@ void Draw_ShowNames(entity ent)
                }
 
                onscreen = (o_z >= 0 && o_x >= 0 && o_y >= 0 && o_x <= vid_conwidth && o_y <= vid_conheight);
+               crosshairdistance = sqrt( pow(o_x - vid_conwidth/2, 2) + pow(o_y - vid_conheight/2, 2) );
+               
+               if(autocvar_hud_shownames_crosshairdistance)
+               {
+                       if(autocvar_hud_shownames_crosshairdistance > crosshairdistance)
+                               ent.pointtime = time;
+                               
+                       if not(ent.pointtime + autocvar_hud_shownames_crosshairdistance_time > time)
+                               overlap = TRUE;
+                       else
+                               overlap = (autocvar_hud_shownames_crosshairdistance_antioverlap ? overlap : FALSE); // override what antioverlap says unless allowed by cvar.
+               }
                
                if(!ent.fadedelay)
                        ent.fadedelay = time + SHOWNAMES_FADEDELAY;
index d30f1acce3801f0d4b948465fcb518286ac317a7..adbfa57120376e5091f3c957d05557b9873de870 100644 (file)
@@ -2,4 +2,4 @@
 .float armorvalue;
 .float sameteam;
 .float fadedelay;
-
+.float pointtime;
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..0f22893075e36ddab30f9ae380fab7597e9a930c 100644 (file)
@@ -355,6 +355,9 @@ const float STAT_VEHICLESTAT_RELOAD1 = 64;
 const float STAT_VEHICLESTAT_AMMO2   = 65;
 const float STAT_VEHICLESTAT_RELOAD2 = 66;
 
+const float STAT_SECRETS_TOTAL = 70;
+const float STAT_SECRETS_FOUND = 71;
+
 // mod stats (1xx)
 const float STAT_REDALIVE = 100;
 const float STAT_BLUEALIVE = 101;
@@ -575,9 +578,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 +718,4 @@ float HUD_MENU_ENABLE               = 0;
 
 #define SERVERFLAG_ALLOW_FULLBRIGHT 1
 #define SERVERFLAG_TEAMPLAY 2
+#define SERVERFLAG_PLAYERSTATS 4
index 469c86a2b68f18822121160a4cea454e0540099e..4ec54b0f06ace8cd5773fa846296ccda602b23ca 100644 (file)
@@ -326,6 +326,10 @@ float _MapInfo_Generate(string pFilename) // 0: failure, 1: ok ent, 2: ok bsp
                                        { }
                                else if(startsWith(v, "weapon_"))
                                        MapInfo_Map_supportedFeatures |= MAPINFO_FEATURE_WEAPONS;
+                               else if(startsWith(v, "turret_"))
+                                       MapInfo_Map_supportedFeatures |= MAPINFO_FEATURE_TURRETS;
+                               else if(startsWith(v, "vehicle_"))
+                                       MapInfo_Map_supportedFeatures |= MAPINFO_FEATURE_VEHICLES;
                                else if(v == "target_music" || v == "trigger_music")
                                        _MapInfo_Map_worldspawn_music = string_null; // don't use regular BGM
                        }
@@ -896,6 +900,14 @@ float MapInfo_Get_ByName(string pFilename, float pAllowGenerate, float pGametype
                                fputs(fh, "has weapons\n");
                        else
                                fputs(fh, "// uncomment this if you added weapon pickups: has weapons\n");
+                       if(MapInfo_Map_supportedFeatures & MAPINFO_FEATURE_TURRETS)
+                               fputs(fh, "has turrets\n");
+                       else
+                               fputs(fh, "// uncomment this if you added turrets: has turrets\n");
+                       if(MapInfo_Map_supportedFeatures & MAPINFO_FEATURE_VEHICLES)
+                               fputs(fh, "has weapons\n");
+                       else
+                               fputs(fh, "// uncomment this if you added vehicles: has vehicles\n");
                        if(MapInfo_Map_flags & MAPINFO_FLAG_FRUSTRATING)
                                fputs(fh, "frustrating\n");
 
@@ -954,6 +966,8 @@ float MapInfo_Get_ByName(string pFilename, float pAllowGenerate, float pGametype
                {
                        t = car(s); s = cdr(s);
                        if     (t == "weapons") MapInfo_Map_supportedFeatures |= MAPINFO_FEATURE_WEAPONS;
+                       else if(t == "turrets") MapInfo_Map_supportedFeatures |= MAPINFO_FEATURE_TURRETS;
+                       else if(t == "vehicles") MapInfo_Map_supportedFeatures |= MAPINFO_FEATURE_VEHICLES;
                        else if(t == "new_toys") MapInfo_Map_supportedFeatures |= MAPINFO_FEATURE_WEAPONS;
                        else
                                dprint("Map ", pFilename, " supports unknown feature ", t, ", ignored\n");
index 3eb16d8544b11835f4f272811aef53bbd66a3a5a..ebfc0e4438e2c6426671a26dd09373221288b418 100644 (file)
@@ -17,6 +17,8 @@ float MAPINFO_TYPE_KEEPAWAY   = 32768;
 float MAPINFO_TYPE_ALL                 = 65535; // this has to include all above bits
 
 float MAPINFO_FEATURE_WEAPONS       = 1; // not defined for minstagib-only maps
+float MAPINFO_FEATURE_VEHICLES      = 2;
+float MAPINFO_FEATURE_TURRETS       = 4;
 
 float MAPINFO_FLAG_HIDDEN           = 1; // not in lsmaps/menu/vcall/etc., can just be changed to manually
 float MAPINFO_FLAG_FORBIDDEN        = 2; // don't even allow the map by a cvar setting that allows hidden maps
index 0ab17f34a4eebed25e7dee028c104c7d5fb25602..1bc06502734f66719fd81fabb14b17bb7bd14b3e 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,64 @@ 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 || status < 0)
+       {
+               if(status == -422) // Unprocessable Entity
+               {
+                       print("uri_multi_ready: got HTTP error 422, data is in unusable format - not continuing\n");
+                       me.url_ready(fh, me.url_ready_pass, status);
+                       strunzone(me.url_url);
+                       remove(me);
+                       return;
+               }
+               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..5ffef8f092052aeb4361799d5d63ed0d34663e3c 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;
@@ -1296,6 +1322,12 @@ string getWrappedLine(float w, vector theFontSize, textLengthUpToWidth_widthFunc
        string s;
 
        s = getWrappedLine_remaining;
+       
+       if(w <= 0)
+       {
+               getWrappedLine_remaining = string_null;
+               return s; // the line has no size ANYWAY, nothing would be displayed.
+       }
 
        cantake = textLengthUpToWidth(s, w, theFontSize, tw);
        if(cantake > 0 && cantake < strlen(s))
@@ -1308,6 +1340,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 +1349,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);
                }
        }
@@ -1332,6 +1368,12 @@ string getWrappedLineLen(float w, textLengthUpToLength_lenFunction_t tw)
        string s;
 
        s = getWrappedLine_remaining;
+       
+       if(w <= 0)
+       {
+               getWrappedLine_remaining = string_null;
+               return s; // the line has no size ANYWAY, nothing would be displayed.
+       }
 
        cantake = textLengthUpToLength(s, w, tw);
        if(cantake > 0 && cantake < strlen(s))
@@ -1344,6 +1386,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 +1395,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 +2097,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 2eee6d74ef1a4d369286c1fcc01a71588ccd130d..b2e77484e398695ea3b2febb290bd217cdf83af5 100644 (file)
@@ -22,7 +22,7 @@ void wordwrap_cb(string s, float l, void(string) callback)
 
 float GameCommand_Generic(string cmd);
 // returns TRUE if handled, FALSE otherwise
-// uses tokenize on its argument!
+// tokenizes its input!
 
 // iterative depth-first search, with fields that go "up", "down left" and "right" in a tree
 // for each element, funcPre is called first, then funcPre and funcPost for all its children, and funcPost last
index f3d780b6f55fe7edf13e8e18129b44199b110a6a..ea2e4034eb08fadb820ea319ae2e6fa17fca8401 100644 (file)
@@ -45,12 +45,17 @@ void Curl_URI_Get_Callback(float id, float status, string data)
        if(status != 0)
        {
                print(sprintf(_("error: status is %d\n"), status));
+               if(do_cvar)
+                       strunzone(do_cvar);
                return;
        }
        if(do_exec)
                localcmd(data);
        if(do_cvar)
+       {
                cvar_set(do_cvar, data);
+               strunzone(do_cvar);
+       }
        if(!do_exec && !do_cvar)
                print(data);
 }
@@ -74,8 +79,7 @@ void GameCommand(string theCommand)
 
        if(argv(0) == "sync")
        {
-               loadAllCvars(main);
-               updateCompression();
+               m_sync();
                return;
        }
 
@@ -119,18 +123,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;
@@ -150,7 +142,7 @@ void GameCommand(string theCommand)
                        if(argv(i) == "--cvar" && i+2 < argc)
                        {
                                ++i;
-                               do_cvar = argv(i);
+                               do_cvar = strzone(argv(i));
                                continue;
                        }
                        if(argv(i) == "--exec")
@@ -197,44 +189,5 @@ void GameCommand(string theCommand)
                return;
        }
 
-#if 0
-       if(argv(0) == "tokentest")
-       {
-               string s;
-               float i, n;
-
-               print("SANE tokenizer:\n");
-               s = cvar_string("tokentest");
-               n = tokenize_console_force_builtin(s);
-               for(i = -n; i < n; ++i)
-               {
-                       print("token ", ftos(i), ": '", argv(i), "' = ");
-                       print(ftos(argv_start_index(i)), " to ", ftos(argv_end_index(i)), "\n");
-               }
-               print(".\n");
-
-               print("INSANE tokenizer:\n");
-               s = cvar_string("tokentest");
-               n = tokenize(s);
-               for(i = -n; i < n; ++i)
-               {
-                       print("token ", ftos(i), ": '", argv(i), "' = ");
-                       print(ftos(argv_start_index(i)), " to ", ftos(argv_end_index(i)), "\n");
-               }
-               print(".\n");
-
-               print("EMULATED tokenizer:\n");
-               s = cvar_string("tokentest");
-               n = tokenize_console_force_emulation(s);
-               for(i = -n; i < n; ++i)
-               {
-                       print("token ", ftos(i), ": '", argv(i), "' = ");
-                       print(ftos(argv_start_index(i)), " to ", ftos(argv_end_index(i)), "\n");
-               }
-               print(".\n");
-               return;
-       }
-#endif
-
        print(_("Invalid command. For a list of supported commands, try menu_cmd help.\n"));
 }
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 17b12896c44f3a9d994a5f744473e77144c2c6e9..caa986d4362a081bd6270f704d60b0e581c23c02 100644 (file)
@@ -192,7 +192,7 @@ void XonoticPlayerSettingsTab_fill(entity me)
                me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.05, "hud_damage"));
 
        me.gotoRC(me, me.rows - 1, 0);
-               me.TD(me, 1, me.columns, makeXonoticCommandButton(_("Apply immediately"), '0 0 0', "color -1 -1;name \"$_cl_name\";cl_cmd sendcvar cl_weaponpriority;sendcvar cl_zoomfactor;sendcvar cl_zoomspeed;sendcvar cl_autoswitch;sendcvar cl_shownames;sendcvar cl_forceplayermodelsfromxonotic;sendcvar cl_forceplayermodels;playermodel $_cl_playermodel;playerskin $_cl_playerskin", COMMANDBUTTON_APPLY));
+               me.TD(me, 1, me.columns, makeXonoticCommandButton(_("Apply immediately"), '0 0 0', "color -1 -1;name \"$_cl_name\";cl_cmd sendcvar cl_weaponpriority;sendcvar cl_zoomfactor;sendcvar cl_zoomspeed;sendcvar cl_autoswitch;sendcvar cl_forceplayermodelsfromxonotic;sendcvar cl_forceplayermodels;playermodel $_cl_playermodel;playerskin $_cl_playerskin", COMMANDBUTTON_APPLY));
 }
 void HUDSetup_Join_Click(entity me, entity btn)
 {
index 5805d2ea11de914382ad11beb108db1f71f60a55..7ded2c5054c5fae01b84e2f2ed0f8eb424cf6f30 100644 (file)
@@ -5,7 +5,7 @@ CLASS(XonoticWaypointDialog) EXTENDS(XonoticDialog)
        ATTRIB(XonoticWaypointDialog, title, string, _("Waypoints"))
        ATTRIB(XonoticWaypointDialog, color, vector, SKINCOLOR_DIALOG_WAYPOINTS)
        ATTRIB(XonoticWaypointDialog, intendedWidth, float, 0.5)
-       ATTRIB(XonoticWaypointDialog, rows, float, 6)
+       ATTRIB(XonoticWaypointDialog, rows, float, 5)
        ATTRIB(XonoticWaypointDialog, columns, float, 3)
 ENDCLASS(XonoticWaypointDialog)
 #endif
@@ -30,13 +30,7 @@ void XonoticWaypointDialog_fill(entity me)
                        me.TD(me, 1, 2, e = makeXonoticSlider(0.1, 1, 0.05, "g_waypointsprite_alpha"));
                                setDependent(e, "cl_hidewaypoints", 0, 0);
        me.TR(me);
-       me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Show names:")));
-               me.TD(me, 1, 2, e = makeXonoticTextSlider("cl_shownames"));
-                       e.addValue(e, _("Never"), "0");
-                       e.addValue(e, _("Teammates"), "1");
-                       e.addValue(e, _("All players"), "2");
-                       e.configureXonoticTextSliderValues(e);
+               me.TD(me, 1, 3, e = makeXonoticCheckBox(1, "hud_shownames", _("Show names above players")));
        me.gotoRC(me, me.rows - 1, 0);
                me.TD(me, 1, me.columns, e = makeXonoticButton(_("OK"), '0 0 0'));
                        e.onClick = Dialog_Close;
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..e5f5da237bc73be61dc3e2ab264bece41d243758 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", _("8bit")));
+       me.TR(me);
+               me.TDempty(me, 0.2);
+               me.TD(me, 1, 0.9, e = makeXonoticRadioButton(1, "r_viewfbo", "2", _("16bit HDR")));
+               me.TD(me, 1, 0.9, e = makeXonoticRadioButton(1, "r_viewfbo", "3", _("32bit 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 8a628a1bea91e1c5f9e5d5158b176b3eeedfad91..0f6434eab68e3330c5807a4f46c664e8721cdf9f 100644 (file)
@@ -3,6 +3,7 @@
 .float antilag_times[ANTILAG_MAX_ORIGINS];
 .float antilag_index;
 .vector antilag_saved_origin;
+.float antilag_takenback;
 
 .float antilag_debug;
 
@@ -14,6 +15,9 @@ void antilag_dummy()
 
 void antilag_record(entity e, float t)
 {
+    if(e.vehicle)
+        antilag_record(e.vehicle, t);
+
        if(time < e.(antilag_times[e.antilag_index]))
                return;
        e.antilag_index = e.antilag_index + 1;
@@ -24,6 +28,7 @@ void antilag_record(entity e, float t)
 
        if(e.antilag_debug)
                te_spark(antilag_takebackorigin(e, t - e.antilag_debug), '0 0 0', 32);
+
 }
 
 // finds the index BEFORE t
@@ -75,6 +80,7 @@ vector antilag_takebackorigin(entity e, float t)
 vector antilag_takebackavgvelocity(entity e, float t0, float t1)
 {
        vector o0, o1;
+
        if(t0 >= t1)
                return '0 0 0';
        o0 = antilag_takebackorigin(e, t0);
@@ -84,11 +90,24 @@ vector antilag_takebackavgvelocity(entity e, float t0, float t1)
 
 void antilag_takeback(entity e, float t)
 {
-       e.antilag_saved_origin = e.origin;
+       if(e.vehicle)
+               antilag_takeback(e.vehicle, t);
+
+       if(!e.antilag_takenback)
+               e.antilag_saved_origin = e.origin;
+
        setorigin(e, antilag_takebackorigin(e, t));
+       e.antilag_takenback = TRUE;
 }
 
 void antilag_restore(entity e)
 {
+       if(e.vehicle)
+               antilag_restore(e.vehicle);
+
+       if(!e.antilag_takenback)
+               return;
+
        setorigin(e, e.antilag_saved_origin);
+       e.antilag_takenback = FALSE;
 }
index 2a7343243dd6e4dc7cfd80d2cd2bd6394928197e..08e33e2e58c07c9ed8f18f703342826f0ddd7949 100644 (file)
@@ -1,5 +1,4 @@
 void antilag_record(entity e, float t);
-float antilag_find(entity e, float t);
 vector antilag_takebackorigin(entity e, float t);
 vector antilag_takebackavgvelocity(entity e, float t0, float t1);
 void antilag_takeback(entity e, float t);
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..3b64b1b63f458cb7d2716671efdcaaeca828a785 100644 (file)
@@ -1,3 +1,4 @@
+float autocvar__notarget;
 float autocvar__independent_players;
 float autocvar__campaign_index;
 string autocvar__campaign_name;
@@ -120,6 +121,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 +222,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 +288,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 +327,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 +342,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 +412,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 +672,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;
@@ -681,6 +702,7 @@ float autocvar_g_balance_uzi_burst_spread;
 float autocvar_g_balance_uzi_first;
 float autocvar_g_balance_uzi_first_ammo;
 float autocvar_g_balance_uzi_first_damage;
+float autocvar_g_balance_uzi_first_headshotaddeddamage;
 float autocvar_g_balance_uzi_first_force;
 float autocvar_g_balance_uzi_first_refire;
 float autocvar_g_balance_uzi_first_spread;
@@ -691,6 +713,7 @@ float autocvar_g_balance_uzi_spread_max;
 float autocvar_g_balance_uzi_spread_min;
 float autocvar_g_balance_uzi_sustained_ammo;
 float autocvar_g_balance_uzi_sustained_damage;
+float autocvar_g_balance_uzi_sustained_headshotaddeddamage;
 float autocvar_g_balance_uzi_sustained_force;
 float autocvar_g_balance_uzi_sustained_refire;
 float autocvar_g_balance_uzi_sustained_spread;
@@ -857,24 +880,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 +931,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 +1031,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;
@@ -1056,6 +1060,7 @@ float autocvar_quit_when_empty;
 float autocvar_r_showbboxes;
 float autocvar_rescan_pending;
 float autocvar_samelevel;
+string autocvar_sessionid;
 #define autocvar_skill cvar("skill")
 float autocvar_skill_auto;
 #define autocvar_slowmo cvar("slowmo")
@@ -1105,10 +1110,10 @@ float autocvar_sv_eventlog_files_counter;
 string autocvar_sv_eventlog_files_nameprefix;
 string autocvar_sv_eventlog_files_namesuffix;
 float autocvar_sv_eventlog_files_timestamps;
-float autocvar_sv_fragmessage_information_handicap;
-float autocvar_sv_fragmessage_information_ping;
-float autocvar_sv_fragmessage_information_stats;
-float autocvar_sv_fragmessage_information_typefrag;
+float autocvar_sv_fraginfo_handicap;
+float autocvar_sv_fraginfo_ping;
+float autocvar_sv_fraginfo_stats;
+float autocvar_sv_fraginfo_typefrag;
 float autocvar_sv_friction;
 float autocvar_sv_friction_on_land;
 float autocvar_sv_gameplayfix_q2airaccelerate;
@@ -1134,10 +1139,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 +1179,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..91eb2ec1a5afbce4132a566baa3c2d115f480edc 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)
@@ -162,21 +162,12 @@ void havocbot_goalrating_enemyplayers(float ratingscale, vector org, float sradi
        FOR_EACH_PLAYER(head)
        {
                // TODO: Merge this logic with the bot_shouldattack function
-               if (self != head)
-               if (head.health > 0)
-               if ((noteam && (!bot_ignore_bots || clienttype(head) == CLIENTTYPE_REAL)) || head.team != self.team)
+               if(bot_shouldattack(head))
                {
                        distance = vlen(head.origin - org);
                        if (distance < 100 || distance > sradius)
                                continue;
 
-                       if (head.freezetag_frozen)
-                               continue;
-
-                       if(g_minstagib)
-                       if(head.items & IT_STRENGTH)
-                               continue;
-
                        // rate only visible enemies
                        /*
                        traceline(self.origin + self.view_ofs, head.origin, MOVE_NOMONSTERS, self);
@@ -207,10 +198,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 +220,7 @@ void havocbot_role_dom()
                //havocbot_goalrating_waypoints(1, self.origin, 1000);
                navigation_goalrating_end();
        }
-};
+}
 
 //DM:
 //go to best items
@@ -247,7 +238,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 +272,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 +311,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 4a2de06131ffe3ad6bba6c06ba9269b570bbd411..7445c6b38b0cf5f2c4f4f43ea47ea3cf11ab1efc 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 = "";
 
@@ -860,6 +861,9 @@ void PutClientInServer (void)
                WriteByte(MSG_ONE, SVC_SETVIEW);
                WriteEntity(MSG_ONE, self);
        }
+       
+       // reset player keys
+       self.itemkeys = 0;
 
        // player is dead and becomes observer
        // FIXME fix LMS scoring for new system
@@ -899,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;
@@ -910,6 +915,8 @@ void PutClientInServer (void)
                if(INDEPENDENT_PLAYERS)
                        MAKE_INDEPENDENT_PLAYER(self);
                self.flags = FL_CLIENT;
+               if(autocvar__notarget)
+                       self.flags |= FL_NOTARGET;
                self.takedamage = DAMAGE_AIM;
                if(g_minstagib)
                        self.effects = EF_FULLBRIGHT;
@@ -1028,7 +1035,8 @@ void PutClientInServer (void)
                self.prevorigin = self.origin;
                self.lastrocket = world; // stop rocket guiding, no revenge from the grave!
                self.lastteleporttime = time; // prevent insane speeds due to changing origin
-
+        self.hud = HUD_NORMAL;
+        
                if(g_arena)
                {
                        Spawnqueue_Remove(self);
@@ -1841,6 +1849,7 @@ void ClientDisconnect (void)
 
        Portal_ClearAll(self);
 
+       RemoveGrapplingHook(self);
        if(self.flagcarried)
                DropFlag(self.flagcarried, world, world);
        if(self.ballcarried && g_nexball)
@@ -1908,7 +1917,7 @@ void ChatBubbleThink()
                self.model = self.mdl;
        else
                self.model = "";
-};
+}
 
 void UpdateChatBubble()
 {
@@ -1937,7 +1946,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';
@@ -1947,7 +1956,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)
@@ -1961,7 +1970,7 @@ void respawn(void)
                self.avelocity = randomvec() * autocvar_g_respawn_ghosts_speed * 3 - randomvec() * autocvar_g_respawn_ghosts_speed * 3;
                self.effects |= EF_ADDITIVE;
                self.oldcolormap = self.colormap;
-               self.colormap = 512;
+               self.colormap = 0; // this originally was 512, but raises a warning in the engine, so get rid of it
                pointparticles(particleeffectnum("respawn_ghost"), self.origin, '0 0 0', 1);
                if(autocvar_g_respawn_ghosts_maxtime)
                        SUB_SetFade (self, time + autocvar_g_respawn_ghosts_maxtime / 2 + random () * (autocvar_g_respawn_ghosts_maxtime - autocvar_g_respawn_ghosts_maxtime / 2), 1.5);
@@ -2524,16 +2533,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;
 
@@ -2774,7 +2783,7 @@ void PlayerPreThink (void)
 
        MUTATOR_CALLHOOK(PlayerPreThink);
 
-       if(!self.cvar_cl_newusekeysupported)
+       if(!self.cvar_cl_newusekeysupported) // FIXME remove this - it was a stupid idea to begin with, we can JUST use the button
        {
                if(self.BUTTON_USE && !self.usekeypressed)
                        PlayerUseKey();
@@ -2946,14 +2955,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
@@ -3012,7 +3021,10 @@ void PlayerPreThink (void)
 
                if(g_nexball)
                        nexball_setstatus();
-
+               
+               // secret status
+               secrets_setstatus();
+               
                self.dmg_team = max(0, self.dmg_team - autocvar_g_teamdamage_resetspeed * frametime);
 
                //self.angles_y=self.v_angle_y + 90;   // temp
@@ -3240,7 +3252,7 @@ void PlayerPostThink (void)
                        self.stored_netname = strzone(uid2name(self.crypto_idfp));
                if(self.stored_netname != self.netname)
                {
-                       db_put(ServerProgsDB, strcat("uid2name", self.crypto_idfp), self.netname);
+                       db_put(ServerProgsDB, strcat("/uid2name/", self.crypto_idfp), self.netname);
                        strunzone(self.stored_netname);
                        self.stored_netname = strzone(self.netname);
                }
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..532b67aef7714555b6d93446c23f6e9756279c26 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";
@@ -183,6 +186,9 @@ void CopyBody(float keepvelocity)
 
        Drag_MoveDrag(oldself, self);
 
+       if(self.colormap <= maxclients && self.colormap > 0)
+               self.colormap = 1024 + self.clientcolors;
+
        self = oldself;
 }
 
@@ -199,74 +205,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 +257,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 +346,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 +402,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 +496,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 +506,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 +534,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 +664,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..cfbc5ff18427f68e033e26bb70e5fc53afa447ad 100644 (file)
@@ -145,43 +145,44 @@ float cmd_floodcheck()
 
 .float checkfail;
 void SV_ParseClientCommand(string s) {
-       string cmd;
-       float tokens;
        float i;
        entity e;
 
-       tokens = tokenize_console(s);
-
-       cmd = strtolower(argv(0));
-       if(cmd != "reportcvar")
-       if(cmd != "sentcvar")
-       if(cmd != "pause")
-       if(cmd != "prespawn")
-       if(cmd != "spawn")
-       if(cmd != "begin")
+       cmd_argc = tokenize_console(s);
+       cmd_string = s;
+       cmd_name = strtolower(argv(0));
+       if(cmd_name != "reportcvar")
+       if(cmd_name != "sentcvar")
+       if(cmd_name != "pause")
+       if(cmd_name != "prespawn")
+       if(cmd_name != "spawn")
+       if(cmd_name != "begin")
        {
                if(cmd_floodcheck())
                        return;
        }
 
+       if(MUTATOR_CALLHOOK(SV_ParseClientCommand))
+               return; // already handled
+       
        if(GameCommand_Vote(s, self)) {
                return;
        } else if(GameCommand_MapVote(argv(0))) {
                return;
-       } else if(cmd == "checkfail") {
+       } else if(cmd_name == "checkfail") {
                print(sprintf("CHECKFAIL: %s (%s) epically failed check %s\n", self.netname, self.netaddress, substring(s, argv_start_index(1), argv_end_index(-1) - argv_start_index(1))));
                self.checkfail = 1;
-       } else if(cmd == "autoswitch") {
+       } else if(cmd_name == "autoswitch") {
                // be backwards compatible with older clients (enabled)
                self.autoswitch = ("0" != argv(1));
-               local string autoswitchmsg;
+               string autoswitchmsg;
                if (self.autoswitch) {
                        autoswitchmsg = "on";
                } else {
                        autoswitchmsg = "off";
                }
                sprint(self, strcat("^1autoswitch turned ", autoswitchmsg, "\n"));
-       } else if(cmd == "clientversion") {
+       } else if(cmd_name == "clientversion") {
                if not(self.flags & FL_CLIENT)
                        return;
                if (argv(1) == "$gameversion") {
@@ -201,21 +202,21 @@ void SV_ParseClientCommand(string s) {
                        self.classname = "observer";
                        stuffcmd(self,"menu_showteamselect\n");
                }
-       } else if(cmd == "reportcvar") { // old system
+       } else if(cmd_name == "reportcvar") { // old system
                if(substring(argv(2), 0, 1) == "$") // undefined cvar: use the default value on the server then
                {
                        s = strcat(substring(s, argv_start_index(0), argv_end_index(1) - argv_start_index(0)), " \"", cvar_defstring(argv(1)), "\"");
-                       tokens = tokenize_console(s);
+                       cmd_argc = tokenize_console(s);
                }
                GetCvars(1);
-       } else if(cmd == "sentcvar") { // new system
-               if(tokens == 2) // undefined cvar: use the default value on the server then
+       } else if(cmd_name == "sentcvar") { // new system
+               if(cmd_argc == 2) // undefined cvar: use the default value on the server then
                {
                        s = strcat(substring(s, argv_start_index(0), argv_end_index(1) - argv_start_index(0)), " \"", cvar_defstring(argv(1)), "\"");
-                       tokens = tokenize_console(s);
+                       cmd_argc = tokenize_console(s);
                }
                GetCvars(1);
-       } else if(cmd == "spectate") {
+       } else if(cmd_name == "spectate") {
                if(cmd_floodcheck())
                        return;
                if not(self.flags & FL_CLIENT)
@@ -244,7 +245,7 @@ void SV_ParseClientCommand(string s) {
                        sprint(self, "WARNING: you will spectate in the next round.\n");
                        self.caplayer = 0;
                }
-       } else if(cmd == "join") {
+       } else if(cmd_name == "join") {
                if not(self.flags & FL_CLIENT)
                        return;
                if(!g_arena)
@@ -265,7 +266,7 @@ void SV_ParseClientCommand(string s) {
                                centerprint(self, PREVENT_JOIN_TEXT);
                        }
                }
-       } else if( cmd == "selectteam" ) {
+       } else if( cmd_name == "selectteam" ) {
                if not(self.flags & FL_CLIENT)
                        return;
                if( !teamplay ) {
@@ -301,7 +302,7 @@ void SV_ParseClientCommand(string s) {
                } else {
                        sprint( self, strcat( "selectteam none/red/blue/yellow/pink/auto - \"", argv(1), "\" not recognised\n" ) );
                }
-       } else if(cmd == "ready") {
+       } else if(cmd_name == "ready") {
                if not(self.flags & FL_CLIENT)
                        return;
 
@@ -328,54 +329,54 @@ void SV_ParseClientCommand(string s) {
                                sprint(self, "^1Game has already been restarted\n");
                        }
                }
-       } else if(cmd == "maplist") {
+       } else if(cmd_name == "maplist") {
                sprint(self, maplist_reply);
-       } else if(cmd == "lsmaps") {
+       } else if(cmd_name == "lsmaps") {
                sprint(self, lsmaps_reply);
-       } else if(cmd == "lsnewmaps") {
+       } else if(cmd_name == "lsnewmaps") {
                sprint(self, lsnewmaps_reply);
-       } else if(cmd == "records") {
+       } else if(cmd_name == "records") {
                for(i = 0; i < 10; ++i)
                        sprint(self, records_reply[i]);
-       } else if(cmd == "ladder") {
+       } else if(cmd_name == "ladder") {
                sprint(self, ladder_reply);
-       } else if(cmd == "rankings") {
+       } else if(cmd_name == "rankings") {
                sprint(self, rankings_reply);
-       } else if(cmd == "voice") {
-               if(tokens >= 3)
+       } else if(cmd_name == "voice") {
+               if(cmd_argc >= 3)
                        VoiceMessage(argv(1), substring(s, argv_start_index(2), argv_end_index(-1) - argv_start_index(2)));
                else
                        VoiceMessage(argv(1), "");
-       } else if(cmd == "say") {
-               if(tokens >= 2)
+       } else if(cmd_name == "say") {
+               if(cmd_argc >= 2)
                        Say(self, FALSE, world, substring(s, argv_start_index(1), argv_end_index(-1) - argv_start_index(1)), 1);
                //clientcommand(self, formatmessage(s));
-       } else if(cmd == "say_team") {
-               if(tokens >= 2)
+       } else if(cmd_name == "say_team") {
+               if(cmd_argc >= 2)
                        Say(self, TRUE, world, substring(s, argv_start_index(1), argv_end_index(-1) - argv_start_index(1)), 1);
                //clientcommand(self, formatmessage(s));
-       } else if(cmd == "tell") {
-               e = GetCommandPlayerSlotTargetFromTokenizedCommand(tokens, 1);
-               if(e && tokens > ParseCommandPlayerSlotTarget_firsttoken)
+       } else if(cmd_name == "tell") {
+               e = GetCommandPlayerSlotTargetFromTokenizedCommand(cmd_argc, 1);
+               if(e && cmd_argc > ParseCommandPlayerSlotTarget_firsttoken)
                {
                        Say(self, FALSE, e, substring(s, argv_start_index(ParseCommandPlayerSlotTarget_firsttoken), argv_end_index(-1) - argv_start_index(ParseCommandPlayerSlotTarget_firsttoken)), TRUE);
                }
                else
                {
-                       if(tokens > ParseCommandPlayerSlotTarget_firsttoken)
+                       if(cmd_argc > ParseCommandPlayerSlotTarget_firsttoken)
                                trigger_magicear_processmessage_forallears(self, -1, world, substring(s, argv_start_index(ParseCommandPlayerSlotTarget_firsttoken), argv_end_index(-1) - argv_start_index(ParseCommandPlayerSlotTarget_firsttoken)));
                        sprint(self, "ERROR: usage: tell # playerid text...\n");
                }
                //clientcommand(self, formatmessage(s));
-       } else if(cmd == "info") {
-               cmd = cvar_string_builtin(strcat("sv_info_", argv(1))); // This needed fixed for the cvar check
-               if(cmd == "")
+       } else if(cmd_name == "info") {
+               cmd_name = cvar_string_builtin(strcat("sv_info_", argv(1))); // This needed fixed for the cvar check
+               if(cmd_name == "")
                        sprint(self, "ERROR: unsupported info command\n");
                else
-                       wordwrap_sprint(cmd, 1111);
-       } else if(cmd == "suggestmap") {
+                       wordwrap_sprint(cmd_name, 1111);
+       } else if(cmd_name == "suggestmap") {
                sprint(self, strcat(MapVote_Suggest(argv(1)), "\n"));
-       } else if(cmd == "timeout") {
+       } else if(cmd_name == "timeout") {
                if not(self.flags & FL_CLIENT)
                        return;
                if(autocvar_sv_timeout) {
@@ -388,42 +389,42 @@ void SV_ParseClientCommand(string s) {
                        else
                                sprint(self, "^7Error: only players can call a timeout!\n");
                }
-       } else if(cmd == "timein") {
+       } else if(cmd_name == "timein") {
                if not(self.flags & FL_CLIENT)
                        return;
                if(autocvar_sv_timeout) {
                        evaluateTimein();
                }
-       } else if(cmd == "teamstatus") {
+       } else if(cmd_name == "teamstatus") {
                Score_NicePrint(self);
-       } else if(cmd == "cvar_changes") {
+       } else if(cmd_name == "cvar_changes") {
                sprint(self, cvar_changes);
-       } else if(cmd == "cvar_purechanges") {
+       } else if(cmd_name == "cvar_purechanges") {
                sprint(self, cvar_purechanges);
-       } else if(CheatCommand(tokens)) {
+       } else if(CheatCommand(cmd_argc)) {
        } else {
 #if 0
                //if(ctf_clientcommand())
                //      return;
                // grep for Cmd_AddCommand_WithClientCommand to find them all
-               if(cmd != "status")
-               //if(cmd != "say") // handled above
-               //if(cmd != "say_team") // handled above
-               if(cmd != "kill")
-               if(cmd != "pause")
-               if(cmd != "ping")
-               if(cmd != "name")
-               if(cmd != "color")
-               if(cmd != "rate")
-               if(cmd != "pmodel")
-               if(cmd != "playermodel")
-               if(cmd != "playerskin")
-               if(cmd != "prespawn")
-               if(cmd != "spawn")
-               if(cmd != "begin")
-               if(cmd != "pings")
-               if(cmd != "sv_startdownload")
-               if(cmd != "download")
+               if(cmd_name != "status")
+               //if(cmd_name != "say") // handled above
+               //if(cmd_name != "say_team") // handled above
+               if(cmd_name != "kill")
+               if(cmd_name != "pause")
+               if(cmd_name != "ping")
+               if(cmd_name != "name")
+               if(cmd_name != "color")
+               if(cmd_name != "rate")
+               if(cmd_name != "pmodel")
+               if(cmd_name != "playermodel")
+               if(cmd_name != "playerskin")
+               if(cmd_name != "prespawn")
+               if(cmd_name != "spawn")
+               if(cmd_name != "begin")
+               if(cmd_name != "pings")
+               if(cmd_name != "sv_startdownload")
+               if(cmd_name != "download")
                {
                        print("WARNING: Invalid clientcommand by ", self.netname, ": ", s, "\n");
                        return;
@@ -431,7 +432,7 @@ void SV_ParseClientCommand(string s) {
 #endif
 
                if(self.jointime > 0 && time > self.jointime + 10 && time > self.nickspamtime) // allow any changes in the first 10 seconds since joining
-               if(cmd == "name" || cmd == "playermodel") // TODO also playerskin and color?
+               if(cmd_name == "name" || cmd_name == "playermodel") // TODO also playerskin and color?
                {
                        if(self.nickspamtime == 0 || time > self.nickspamtime + autocvar_g_nick_flood_timeout)
                                // good, no serious flood
@@ -450,7 +451,7 @@ void SV_ParseClientCommand(string s) {
 
 void ReadyRestartForce()
 {
-       local entity e;
+       entity e;
 
        bprint("^1Server is restarting...\n");
 
@@ -538,8 +539,8 @@ void ReadyRestart()
  */
 void ReadyCount()
 {
-       local entity e;
-       local float r, p;
+       entity e;
+       float r, p;
 
        r = p = 0;
 
@@ -590,10 +591,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 9f4631a47c1195f5bf345f36f45c0a971c6fd31c..b84d03164d312d8c2b3b410bb8c86a602bb1fca0 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;
@@ -245,6 +246,12 @@ float alreadychangedlevel;
 
 .float runes;
 
+// Keys player is holding
+.float itemkeys;
+// message delay for func_door locked by keys and key locks
+// this field is used on player entities
+.float key_door_messagetime;
+
 
 .float version;
 
@@ -314,6 +321,7 @@ float default_weapon_alpha;
 .float cvar_cl_handicap;
 .float cvar_cl_playerdetailreduction;
 .float cvar_cl_clippedspectating;
+.float cvar_cl_autoscreenshot;
 .float cvar_cl_movement_track_canjump;
 .float cvar_cl_newusekeysupported;
 
@@ -661,3 +669,4 @@ float serverflags;
 .float misc_bulletcounter;     // replaces uzi & hlac bullet counter.
 
 void PlayerUseKey();
+
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..fe4df352fb5a2fc1c6cfd565d8985f72d05bf6d8 100644 (file)
@@ -221,6 +221,42 @@ void GiveFrags (entity attacker, entity targ, float f, float deathtype)
                UpdateFrags(attacker, f);
 }
 
+string Obituary_ExtraFragInfo(entity player) // Extra fragmessage information
+{
+       string health_output;
+       string ping_output;
+       string handicap_output;
+       string output;
+
+       // health/armor of attacker (person who killed you)
+       if(autocvar_sv_fraginfo_stats && (player.health >= 1))
+               if((autocvar_sv_fraginfo_stats == 2) || !inWarmupStage)
+                       health_output = strcat("^7(Health ^1", ftos(rint(player.health)), "^7 / Armor ^2", ftos(rint(player.armorvalue)), "^7)");
+       
+       // ping display
+       if(autocvar_sv_fraginfo_ping)
+               ping_output = ((clienttype(player) == CLIENTTYPE_BOT) ? "^2Bot" : strcat("Ping ", ((player.ping >= 150) ? "^1" : "^2"), ftos(player.ping), "ms"));
+               
+       // handicap display 
+       if(autocvar_sv_fraginfo_handicap) 
+       {
+               if(autocvar_sv_fraginfo_handicap == 2)  
+                       handicap_output = strcat(output, strcat("Handicap ^2", ((player.cvar_cl_handicap <= 1) ? "Off" : ftos(player.cvar_cl_handicap))));
+               else if(player.cvar_cl_handicap) // with _handicap 1, only show this if there actually is a handicap enabled.   
+                       handicap_output = strcat("Handicap ^2", ftos(player.cvar_cl_handicap));
+       }
+       
+       // format the string
+       output = strcat(health_output, (health_output ? " ^7(" : ((ping_output || handicap_output) ? "^7(" : "")), 
+               ping_output, ((ping_output && handicap_output) ? "^7 / " : ""), 
+               handicap_output, ((ping_output || handicap_output) ? "^7)" : ""));
+       
+       // add new line to the beginning if there is a message
+       if(output) { output = strcat("\n", output); }
+               
+       return output;
+}
+
 string AppendItemcodes(string s, entity player)
 {
        float w;
@@ -329,7 +365,7 @@ void Obituary (entity attacker, entity inflictor, entity targ, float deathtype)
                }
                else if (attacker.classname == "player")
                {
-                       if(teamplay && attacker.team == targ.team)
+                       if(!IsDifferentTeam(attacker, targ))
                        {
                                if(attacker.team == COLOR_TEAM1)
                                        type = KILL_TEAM_RED;
@@ -367,12 +403,12 @@ void Obituary (entity attacker, entity inflictor, entity targ, float deathtype)
                                        PlayerStats_Event(targ, PLAYERSTATS_ACHIEVEMENT_FIRSTVICTIM, 1);
                                }
 
-                               if((autocvar_sv_fragmessage_information_typefrag) && (targ.BUTTON_CHAT)) {
-                                       Send_CSQC_KillCenterprint(attacker, s, GetAdvancedDeathReports(targ), KILL_TYPEFRAG, MSG_KILL);
-                                       Send_CSQC_KillCenterprint(targ, a, GetAdvancedDeathReports(attacker), KILL_TYPEFRAGGED, MSG_KILL);
+                               if((autocvar_sv_fraginfo_typefrag) && (targ.BUTTON_CHAT)) {
+                                       Send_CSQC_KillCenterprint(attacker, s, Obituary_ExtraFragInfo(targ), KILL_TYPEFRAG, MSG_KILL);
+                                       Send_CSQC_KillCenterprint(targ, a, Obituary_ExtraFragInfo(attacker), KILL_TYPEFRAGGED, MSG_KILL);
                                } else {
-                                       Send_CSQC_KillCenterprint(attacker, s, GetAdvancedDeathReports(targ), KILL_FRAG, MSG_KILL);
-                                       Send_CSQC_KillCenterprint(targ, a, GetAdvancedDeathReports(attacker), KILL_FRAGGED, MSG_KILL);
+                                       Send_CSQC_KillCenterprint(attacker, s, Obituary_ExtraFragInfo(targ), KILL_FRAG, MSG_KILL);
+                                       Send_CSQC_KillCenterprint(targ, a, Obituary_ExtraFragInfo(attacker), KILL_FRAGGED, MSG_KILL);
                                }
 
                                attacker.taunt_soundtime = time + 1;
@@ -501,7 +537,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;
@@ -561,7 +597,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
                                damage = 0;
                                force = '0 0 0';
                        }
-                       else if(teamplay && attacker.team == targ.team)
+                       else if(!IsDifferentTeam(attacker, targ))
                        {
                                if(autocvar_teamplay_mode == 1)
                                        damage = 0;
@@ -758,26 +794,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 +1024,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..6a62d61b5d423e43debf69ab9461e031c427142c 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)
@@ -400,12 +389,9 @@ void tracebox_antilag_force_wz (entity source, vector v1, vector mi, vector ma,
        if (lag)
        {
                // take players back into the past
-               player = player_list;
-               while (player)
-               {
-                       antilag_takeback(player, time - lag);
-                       player = player.nextplayer;
-               }
+               FOR_EACH_PLAYER(player)
+                       if(player != forent)
+                               antilag_takeback(player, time - lag);
        }
 
        // do the trace
@@ -417,12 +403,9 @@ void tracebox_antilag_force_wz (entity source, vector v1, vector mi, vector ma,
        // restore players to current positions
        if (lag)
        {
-               player = player_list;
-               while (player)
-               {
-                       antilag_restore(player);
-                       player = player.nextplayer;
-               }
+               FOR_EACH_PLAYER(player)
+                       if(player != forent)
+                               antilag_restore(player);
        }
 
        // restore shooter solid type
@@ -836,7 +819,7 @@ void SetMovedir()
        }
 
        self.angles = '0 0 0';
-};
+}
 
 void InitTrigger()
 {
@@ -848,7 +831,7 @@ void InitTrigger()
        self.movetype = MOVETYPE_NONE;
        self.modelindex = 0;
        self.model = "";
-};
+}
 
 void InitSolidBSPTrigger()
 {
@@ -860,7 +843,7 @@ void InitSolidBSPTrigger()
        self.movetype = MOVETYPE_NONE; // why was this PUSH? -div0
 //     self.modelindex = 0;
        self.model = "";
-};
+}
 
 float InitMovingBrushTrigger()
 {
@@ -875,4 +858,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..5c326b8e6213ce96361b02b368b7b552231f1d60 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_");
@@ -379,6 +382,7 @@ void cvar_changes_init()
                BADCVAR("leadlimit_and_fraglimit");
                BADCVAR("leadlimit_override");
                BADCVAR("pausable");
+               BADCVAR("sv_allow_fullbright");
                BADCVAR("sv_checkforpacketsduringsleep");
                BADCVAR("sv_timeout");
                BADCVAR("welcome_message_time");
@@ -389,7 +393,8 @@ void cvar_changes_init()
                BADPREFIX("net_");
                BADPREFIX("prvm_");
                BADPREFIX("skill_");
-               BADPREFIX("sv_fragmessage_");
+               BADPREFIX("sv_cullentities_");
+               BADPREFIX("sv_fraginfo_");
                BADPREFIX("sv_maxidle_");
                BADPREFIX("sv_vote_");
                BADPREFIX("timelimit_");
@@ -628,7 +633,7 @@ void spawnfunc_worldspawn (void)
 
        allowed_to_spawn = TRUE;
 
-       local entity head;
+       entity head;
        head = nextent(world);
        maxclients = 0;
        while(head)
@@ -640,7 +645,7 @@ void spawnfunc_worldspawn (void)
        // needs to be done so early as they would still spawn
        RegisterWeapons();
 
-       ServerProgsDB = db_load("server.db");
+       ServerProgsDB = db_load(strcat("server.db", autocvar_sessionid));
 
        TemporaryDB = db_create();
 
@@ -851,7 +856,11 @@ void spawnfunc_worldspawn (void)
        addstat(STAT_MOVEVARS_MAXSPEED, AS_FLOAT, stat_sv_maxspeed);
        addstat(STAT_MOVEVARS_AIRACCEL_QW, AS_FLOAT, stat_sv_airaccel_qw);
        addstat(STAT_MOVEVARS_AIRSTRAFEACCEL_QW, AS_FLOAT, stat_sv_airstrafeaccel_qw);
-
+       
+       // secrets
+       addstat(STAT_SECRETS_TOTAL, AS_FLOAT, stat_secrets_total);
+       addstat(STAT_SECRETS_FOUND, AS_FLOAT, stat_secrets_found);
+       
        next_pingtime = time + 5;
 
        detect_maptype();
@@ -958,7 +967,7 @@ string GetMapname()
 float Map_Count, Map_Current;
 string Map_Current_Name;
 
-// NOTE: this now expects the map list to be already tokenize()d and the count in Map_Count
+// NOTE: this now expects the map list to be already tokenized and the count in Map_Count
 float GetMaplistPosition()
 {
        float pos, idx;
@@ -1098,7 +1107,7 @@ void GameResetCfg()
 {
        // settings persist, except...
        localcmd("\nsettemp_restore\n");
-};
+}
 
 void Map_Goto()
 {
@@ -1237,7 +1246,7 @@ string GetNextMap()
        }
 
        return "";
-};
+}
 
 float DoNextMapOverride()
 {
@@ -1288,13 +1297,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 +1333,7 @@ void GotoNextMap()
                }
                Map_Goto();
        }
-};
+}
 
 
 /*
@@ -1342,9 +1351,8 @@ void IntermissionThink()
 {
        FixIntermissionClient(self);
 
-       if(autocvar_sv_autoscreenshot)
-       if(self.autoscreenshot > 0)
-       if(time > self.autoscreenshot)
+       if( (autocvar_sv_autoscreenshot || self.cvar_cl_autoscreenshot)
+               && ((self.autoscreenshot > 0) && (time > self.autoscreenshot)) )
        {
                self.autoscreenshot = -1;
                if(clienttype(self) == CLIENTTYPE_REAL)
@@ -1360,7 +1368,7 @@ void IntermissionThink()
                        return;
 
        MapVote_Start();
-};
+}
 
 /*
 ============
@@ -1407,7 +1415,7 @@ entity FindIntermission()
 
        //objerror ("FindIntermission: no spot");
        return world;
-};
+}
 */
 
 /*
@@ -1623,7 +1631,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 +1740,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 +1800,7 @@ float LMS_NewPlayerLives()
 void assault_new_round();
 float WinningCondition_Assault()
 {
-       local float status;
+       float status;
 
        WinningConditionHelper(); // set worldstatus
 
@@ -1807,7 +1815,7 @@ float WinningCondition_Assault()
                SetWinners(team, COLOR_TEAM1);
        }
 
-       local entity ent;
+       entity ent;
        ent = find(world, classname, "target_assault_roundend");
        if(ent)
        {
@@ -1824,7 +1832,7 @@ float WinningCondition_Assault()
                        }
                        else
                        {
-                               local entity oldself;
+                               entity oldself;
                                oldself = self;
                                self = ent;
                                assault_new_round();
@@ -2279,7 +2287,7 @@ void CheckRules_World()
                //print("WINNING\n");
                NextLevel();
        }
-};
+}
 
 float mapvote_nextthink;
 float mapvote_initialized;
@@ -2799,7 +2807,7 @@ void MapVote_Think()
        }
 
        MapVote_Tick();
-};
+}
 
 string GotoMap(string m)
 {
@@ -2908,7 +2916,7 @@ void RestoreGame()
        // some things then break, so let's work around them...
 
        // Progs DB (capture records)
-       ServerProgsDB = db_load("server.db");
+       ServerProgsDB = db_load(strcat("server.db", autocvar_sessionid));
 
        // Mapinfo
        MapInfo_Shutdown();
@@ -2942,9 +2950,9 @@ void SV_Shutdown()
                if(!cheatcount_total)
                {
                        if(autocvar_sv_db_saveasdump)
-                               db_dump(ServerProgsDB, "server.db");
+                               db_dump(ServerProgsDB, strcat("server.db", autocvar_sessionid));
                        else
-                               db_save(ServerProgsDB, "server.db");
+                               db_save(ServerProgsDB, strcat("server.db", autocvar_sessionid));
                }
                if(autocvar_developer)
                {
index a8537a0ae88c93cb92cf845f5463fd389abc0c10..986f2dd84536c7b7141dbe3065a340a817df7d5b 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();
@@ -596,7 +596,7 @@ void EffectIndexDump()
        fh = fopen("effectinfo.txt", FILE_READ);
        while((s = fgets(fh)))
        {
-               tokenize(s); // tokenize_console would hit the loop counter :(
+               tokenize_console(s);
                if(argv(0) == "effect")
                {
                        if(db_get(d, argv(1)) != "1")
@@ -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"));
diff --git a/qcsrc/server/item_key.qc b/qcsrc/server/item_key.qc
new file mode 100644 (file)
index 0000000..e39f281
--- /dev/null
@@ -0,0 +1,423 @@
+/*
+TODO:
+- add an unlock sound (here to trigger_keylock and to func_door)
+- display available keys on the HUD
+- make more tests
+- think about adding NOT_EASY/NOT_NORMAL/NOT_HARD for Q1 compatibility
+- should keys have a trigger?
+*/
+
+float item_keys_usekey(entity l, entity p) {
+       float valid = l.itemkeys & p.itemkeys;
+       
+       if not(valid) {
+               // other has none of the needed keys
+               return FALSE;
+       } else if (l.itemkeys == valid) {
+               // ALL needed keys were given
+               l.itemkeys = 0;
+               return TRUE;
+       } else {
+               // only some of the needed keys were given
+               l.itemkeys &~= valid;
+               return TRUE;
+       }
+}
+
+string item_keys_keylist(float keylist) {
+       float base, l;
+       string n;
+       
+       // no keys
+       if not(keylist)
+               return "";
+       
+       // one key
+       if ((keylist & (keylist-1)) != 0)
+               return strcat("the ", item_keys_names[lowestbit(keylist)]);
+       
+       while (keylist) {
+               l = lowestbit(keylist);
+               if (n)
+                       n = strcat(n, ", the ", item_keys_names[base + l]);
+               else
+                       n = strcat("the ", item_keys_names[base + l]);
+               
+               keylist = bitshift(keylist,  -(l + 1));
+               base+= l + 1;
+       }
+       
+       return n;
+}
+
+
+/*
+================================
+item_key
+================================
+*/
+
+/**
+ * Key touch handler.
+ */
+void item_key_touch(void) {
+       if (other.classname != "player")
+               return;
+               
+       // player already picked up this key
+       if (other.itemkeys & self.itemkeys)
+               return;
+       
+       other.itemkeys |= self.itemkeys;
+       play2(other, self.noise);
+       
+       centerprint(other, self.message);
+};
+
+/**
+ * Spawn a key with given model, key code and color.
+ */
+void spawn_item_key() {
+       precache_model(self.model);
+       
+       if (self.spawnflags & 1) // FLOATING
+               self.noalign = 1;
+       
+       if (self.noalign)
+               self.movetype = MOVETYPE_NONE;
+       else
+               self.movetype = MOVETYPE_TOSS;
+               
+       precache_sound(self.noise);
+               
+       self.mdl = self.model;
+       self.effects = EF_LOWPRECISION;
+       setmodel(self, self.model);
+       //setsize(self, '-16 -16 -24', '16 16 32');
+       setorigin(self, self.origin + '0 0 32');
+       setsize(self, '-16 -16 -56', '16 16 0');
+       self.modelflags |= MF_ROTATE;
+       self.solid = SOLID_TRIGGER;
+       
+       if (!self.noalign)
+       {
+               // first nudge it off the floor a little bit to avoid math errors
+               setorigin(self, self.origin + '0 0 1');
+               // note droptofloor returns FALSE if stuck/or would fall too far
+               droptofloor();
+       }
+
+       self.touch = item_key_touch;
+};
+
+
+/*QUAKED item_key (0 .5 .8) (-16 -16 -24) (16 16 32) FLOATING
+A key entity.
+The itemkeys should contain one of the following key IDs:
+1 - GOLD key - 
+2 - SILVER key
+4 - BRONZE key
+8 - RED keycard
+16 - BLUE keycard
+32 - GREEN keycard
+Custom keys:
+... - last key is 1<<23
+Keys with bigger Id than 32 don't have a default netname and model, if you use one of them, you MUST provide those.
+-----------KEYS------------
+colormod: color of the key (default: '.9 .9 .9').
+itemkeys: a key Id.
+message: message to print when player picks up this key.
+model: custom key model to use.
+netname: the display name of the key.
+noise: custom sound to play when player picks up the key.
+-------- SPAWNFLAGS --------
+FLOATING: the item will float in air, instead of aligning to the floor by falling
+---------NOTES----------
+This is the only correct way to put keys on the map!
+
+itemkeys MUST always have exactly one bit set.
+*/
+void spawnfunc_item_key() {
+       local string _model, _netname;
+       local vector _colormod;
+       
+       // reject this entity if more than one key was set!
+       if (self.itemkeys>0 && (self.itemkeys & (self.itemkeys-1)) != 0) {
+               objerror("item_key.itemkeys must contain only 1 bit set specifying the key it represents!");
+               remove(self);
+               return;
+       }
+
+       // find default netname and colormod
+       switch(self.itemkeys) {
+       case 1:
+               _netname = "GOLD key";
+               _colormod = '1 .9 0';
+               break;
+               
+       case 2:
+               _netname = "SILVER key";
+               _colormod = '.9 .9 .9';
+               break;
+               
+       case 4:
+               _netname = "BRONZE key";
+               _colormod = '.6 .25 0';
+               break;
+               
+       case 8:
+               _netname = "RED keycard";
+               _colormod = '.9 0 0';
+               break;
+               
+       case 16:
+               _netname = "BLUE keycard";
+               _colormod = '0 0 .9';
+               break;
+               
+       case 32:
+               _netname = "GREEN keycard";
+               _colormod = '0 .9 0';
+               break;
+       
+       default:
+               if (!self.netname) {
+                       objerror("item_key doesn't have a default name for this key and a custom one was not specified!");
+                       remove(self);
+                       return;
+               } else if (!self.colormod) {
+                       _colormod = '1 1 1';
+               }
+               break;
+               
+       }
+       
+       // find default model
+       if (self.itemkeys <= ITEM_KEY_BIT(2)) {
+               _model = "models/keys/key.md3";
+       } else if (self.itemkeys >= ITEM_KEY_BIT(3) && self.itemkeys <= ITEM_KEY_BIT(5)) {
+               _model = "models/keys/key.md3"; // FIXME: replace it by a keycard model!
+       } else if (!self.model) {
+               objerror("item_key doesn't have a default model for this key and a custom one was not specified!");
+               remove(self);
+               return;
+       }
+       
+       // set defailt netname
+       if (!self.netname)
+               self.netname = _netname;
+       
+       // set default colormod
+       if (!self.colormod)
+               self.colormod = _colormod;
+       
+       // set default model
+       if (!self.model)
+               self.model = _model;
+       
+       // set default pickup message
+       if (!self.message)
+               self.message = strzone(strcat("You've picked up the ", self.netname, "!"));
+
+       if (!self.noise)
+               self.noise = "misc/itempickup.wav";
+       
+       // save the name for later
+       item_keys_names[lowestbit(self.itemkeys)] = self.netname;
+
+       // put the key on the map       
+       spawn_item_key();
+}
+
+/*QUAKED item_key1 (0 .5 .8) (-16 -16 -24) (16 16 32) FLOATING
+SILVER key.
+-----------KEYS------------
+colormod: color of the key (default: '.9 .9 .9').
+message: message to print when player picks up this key.
+model: custom model to use.
+noise: custom sound to play when player picks up the key.
+-------- SPAWNFLAGS --------
+FLOATING: the item will float in air, instead of aligning to the floor by falling
+---------NOTES----------
+Don't use this entity on new maps! Use item_key instead.
+*/
+void spawnfunc_item_key1(void) {
+       self.classname = "item_key";
+       self.itemkeys = ITEM_KEY_BIT(1);
+       spawnfunc_item_key();
+};
+
+/*QUAKED item_key2 (0 .5 .8) (-16 -16 -24) (16 16 32) FLOATING
+GOLD key.
+-----------KEYS------------
+colormod: color of the key (default: '1 .9 0').
+message: message to print when player picks up this key.
+model: custom model to use.
+noise: custom sound to play when player picks up the key.
+-------- SPAWNFLAGS --------
+FLOATING: the item will float in air, instead of aligning to the floor by falling
+---------NOTES----------
+Don't use this entity on new maps! Use item_key instead.
+*/
+void spawnfunc_item_key2(void) {
+       self.classname = "item_key";
+       self.itemkeys = ITEM_KEY_BIT(0);
+       spawnfunc_item_key();
+};
+
+
+/*
+================================
+trigger_keylock
+================================
+*/
+
+/**
+ * trigger givent targets
+ */
+void trigger_keylock_trigger(string s) {
+       local entity t, stemp, otemp, atemp;
+       
+       stemp = self;
+       otemp = other;
+       atemp = activator;
+       
+       
+       for(t = world; (t = find(t, targetname, s)); )
+               if (t.use) {
+                       self = t;
+                       other = stemp;
+                       activator = atemp;
+                       self.use();
+               }
+       
+       self = stemp;
+       other = otemp;
+       activator = atemp;
+};
+
+/**
+ * kill killtarget of trigger keylock.
+ */
+void trigger_keylock_kill(string s) {
+       local entity t;
+       for(t = world; (t = find(t, targetname, s)); )
+               remove(t);
+};
+
+void trigger_keylock_touch(void) {
+       local float key_used, started_delay;
+       
+       key_used = FALSE;
+       started_delay = FALSE;
+       
+       // only player may trigger the lock
+       if (other.classname != "player")
+               return;
+       
+       
+       // check silver key
+       if (self.itemkeys)
+               key_used = item_keys_usekey(self, other);
+       
+       activator = other;
+       
+       if (self.itemkeys) {
+               // at least one of the keys is missing
+               if (key_used) {
+                       // one or more keys were given, but others are still missing!
+                       play2(other, self.noise1);
+                       centerprint(other, strcat("You also need ", item_keys_keylist(self.itemkeys), "!"));
+                       other.key_door_messagetime = time + 2;
+               } else if (other.key_door_messagetime <= time) {
+                       // no keys were given
+                       play2(other, self.noise2);
+                       centerprint(other, strcat("You need ", item_keys_keylist(self.itemkeys), "!"));
+                       other.key_door_messagetime = time + 2;
+               }
+               
+               // trigger target2
+               if (self.delay <= time || started_delay == TRUE)
+               if (self.target2) {
+                       trigger_keylock_trigger(self.target2);
+                       started_delay = TRUE;
+                       self.delay = time + self.wait;
+               }
+       } else {
+               // all keys were given!
+               play2(other, self.noise);
+               centerprint(other, self.message);
+               
+               if (self.target)
+                       trigger_keylock_trigger(self.target);
+                       
+               if (self.killtarget)
+                       trigger_keylock_kill(self.killtarget);
+               
+               remove(self);
+       }
+       
+};
+
+/*QUAKED trigger_keylock (.0 .5 .8) ?
+Keylock trigger.  Must target other entities.
+This trigger will trigger target entities when all required keys are provided.
+-------- KEYS --------
+itemkeys: A bit field with key IDs that are needed to open this lock.
+sounds: 1 to play misc/secret.wav, 2 to play misc/talk.wav, 3 to play misc/trigger1.wav (3 is default)
+target: trigger all entities with this targetname when triggered and all keys have been given to it, then remove this trigger
+target2: trigger all entities with this targetname when triggered without giving it all the required keys.
+killtarget: remove all entities with this targetname when triggered with all the needed keys.
+message: print this message to the player who activated the trigger when all needed keys have been given.
+message2: print this message to the player who activated the trigger when not all of the needed keys have been given.
+noise: sound to play when lock gets unlocked (default: see sounds)
+noise1: sound to play when only some of the needed key were used but not all (default: misc/decreasevalue.wav)
+noise2: sound to play when a key is missing (default: misc/talk.wav)
+wait: prevent triggering again for this amount of time (default: 5) - applies to target2, target3, target4.
+---------NOTES----------
+If spawned without any key specified in itemkeys, this trigger will display an error and remove itself.
+message2 and noise2 will be resent to the player every 2 seconds while he is in the trigger zone.
+*/
+void spawnfunc_trigger_keylock(void) {
+       if (!self.itemkeys) {
+               remove(self);
+               return;
+       }
+
+       // set unlocked message 
+       if (!self.message)
+               self.message = "Unlocked!";
+       
+       // set default unlock noise
+       if (!self.noise) {
+               if (self.sounds == 1)
+                       self.noise = "misc/secret.wav";
+               else if (self.sounds == 2)
+                       self.noise = "misc/talk.wav";
+               else //if (self.sounds == 3) {
+                       self.noise = "misc/trigger1.wav";
+       }
+       
+       // set default use key sound
+       if (!self.noise1)
+               self.noise1 = "misc/decreasevalue.wav";
+       
+       // set closed sourd
+       if (!self.noise2)
+               self.noise2 = "misc/talk.wav";
+       
+       // delay between triggering message2 and trigger2
+       if (!self.wait)
+               self.wait = 5;
+       
+       // precache sounds
+       precache_sound(self.noise);
+       precache_sound(self.noise1);
+       precache_sound(self.noise2);
+       
+       EXACTTRIGGER_INIT;
+       
+       self.touch = trigger_keylock_touch;
+};
+
+
diff --git a/qcsrc/server/item_key.qh b/qcsrc/server/item_key.qh
new file mode 100644 (file)
index 0000000..24ef1e9
--- /dev/null
@@ -0,0 +1,23 @@
+/**
+ * Returns the bit ID of a key
+ */
+#define ITEM_KEY_BIT(n)        ( bitshift(1, n) )
+
+#define ITEM_KEY_MAX   24
+
+/**
+ * list of key names.
+ */
+string item_keys_names[ITEM_KEY_MAX];
+
+/**
+ * Use keys from p on l.
+ * Returns TRUE if any new keys were given, FALSE otherwise.
+ */
+float item_keys_usekey(entity l, entity p);
+
+/**
+ * Returns a string with a comma separated list of key names, as specified in keylist.
+ */
+string item_keys_keylist(float keylist);
+
index 19465d09dd1a156e397abb29ca4fac14d7633ae8..2fe562774d0d625468b36e4333f1e9547e17a607 100644 (file)
@@ -79,53 +79,6 @@ string strcat1(string s) = #115; // FRIK_FILE
 float logfile_open;
 float logfile;
 
-string GetAdvancedDeathReports(entity enPlayer) // Extra fragmessage information
-{
-       float nPlayerHealth = rint(enPlayer.health);
-       float nPlayerArmor = rint(enPlayer.armorvalue);
-       float nPlayerHandicap = enPlayer.cvar_cl_handicap;
-       float nPlayerPing = rint(enPlayer.ping);
-       string strPlayerPingColor;
-       string strMessage;
-       
-       if(nPlayerPing >= 150)
-               strPlayerPingColor = "^1";
-       else
-               strPlayerPingColor = "^2";
-
-       if((autocvar_sv_fragmessage_information_stats) && (enPlayer.health >= 1))
-               strMessage = strcat(strMessage, "^7(Health ^1", ftos(nPlayerHealth), "^7 / Armor ^2", ftos(nPlayerArmor), "^7)");
-
-       if(autocvar_sv_fragmessage_information_ping) {
-               if(clienttype(enPlayer) == CLIENTTYPE_BOT) // Bots have no ping
-                       strMessage = strcat(strMessage, " ^7(^2Bot");
-               else
-                       strMessage = strcat(strMessage, " ^7(Ping ", strPlayerPingColor, ftos(nPlayerPing), "ms");
-               if(autocvar_sv_fragmessage_information_handicap)
-                       if(autocvar_sv_fragmessage_information_handicap == 2)
-                               if(nPlayerHandicap <= 1)
-                                       strMessage = strcat(strMessage, "^7 / Handicap ^2Off^7)");
-                               else
-                                       strMessage = strcat(strMessage, "^7 / Handicap ^2", ftos(nPlayerHandicap), "^7)");
-                       else if not(nPlayerHandicap <= 1)
-                               strMessage = strcat(strMessage, "^7 / Handicap ^2", ftos(nPlayerHandicap), "^7)");
-               else
-                       strMessage = strcat(strMessage, "^7)");
-       } else if(autocvar_sv_fragmessage_information_handicap) {
-               if(autocvar_sv_fragmessage_information_handicap == 2)
-                       if(nPlayerHandicap <= 1)
-                               strMessage = strcat(strMessage, "^7(Handicap ^2Off^7)");
-                       else
-                               strMessage = strcat(strMessage, "^7(Handicap ^2", ftos(nPlayerHandicap), "^7)");
-               else if(nPlayerHandicap > 1)
-                       strMessage = strcat(strMessage, "^7(Handicap ^2", ftos(nPlayerHandicap), "^7)");
-       }
-       
-       if(strMessage) // add new line to the beginning if there is a message
-               strMessage = strcat("\n", strMessage);
-               
-       return strMessage;
-}
 void bcenterprint(string s)
 {
     // TODO replace by MSG_ALL (would show it to spectators too, though)?
@@ -367,13 +320,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)
 {
@@ -583,6 +536,7 @@ void GetCvars(float f)
        get_cvars_s = s;
        MUTATOR_CALLHOOK(GetCvars);
        GetCvars_handleFloat(s, f, autoswitch, "cl_autoswitch");
+       GetCvars_handleFloat(s, f, cvar_cl_autoscreenshot, "cl_autoscreenshot");
        GetCvars_handleFloat(s, f, cvar_cl_playerdetailreduction, "cl_playerdetailreduction");
        GetCvars_handleString(s, f, cvar_g_xonoticversion, "g_xonoticversion");
        GetCvars_handleFloat(s, f, cvar_cl_handicap, "cl_handicap");
@@ -740,13 +694,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 +1076,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 +1246,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 +1414,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 +1588,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 +2001,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 +2021,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");
@@ -2084,7 +2037,19 @@ void print_to(entity e, string s)
 
 string uid2name(string myuid) {
        string s;
-       s = db_get(ServerProgsDB, strcat("uid2name", myuid));
+       s = db_get(ServerProgsDB, strcat("/uid2name/", myuid));
+
+       // FIXME remove this later after 0.6 release
+       // convert old style broken records to correct style
+       if(s == "")
+       {
+               s = db_get(ServerProgsDB, strcat("uid2name", myuid));
+               if(s != "")
+               {
+                       db_put(ServerProgsDB, strcat("/uid2name/", myuid), s);
+                       db_put(ServerProgsDB, strcat("uid2name", myuid), "");
+               }
+       }
        
        if(s == "")
                s = "^1Unregistered Player";
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
index e26280e61a695cf0fedcff92ff3fd487c803a830..73b23bbd3f224201ecffa53725fe544a3b225573 100644 (file)
@@ -159,3 +159,32 @@ MUTATOR_HOOKABLE(PlayerUseKey);
        // called when the use key is pressed
        // if MUTATOR_RETURNVALUE is 1, don't do anything
        // return 1 if the use key actually did something
+
+MUTATOR_HOOKABLE(SV_ParseClientCommand);
+       // called when a client command is parsed
+       // NOTE: hooks MUST start with if(MUTATOR_RETURNVALUE) return 0;
+       // NOTE: return 1 if you handled the command, return 0 to continue handling
+       // NOTE: THESE HOOKS MUST NEVER EVER CALL tokenize()
+       // INPUT
+       string cmd_name; // command name
+       float cmd_argc; // also, argv() can be used
+       string cmd_string; // whole command, use only if you really have to
+       /*
+               // example:
+               MUTATOR_HOOKFUNCTION(foo_SV_ParseClientCommand)
+               {
+                       if(MUTATOR_RETURNVALUE) // command was already handled?
+                               return 0;
+                       if(cmd_name == "echocvar" && cmd_argc >= 2)
+                       {
+                               print(cvar_string(argv(1)), "\n");
+                               return 1;
+                       }
+                       if(cmd_name == "echostring" && cmd_argc >= 2)
+                       {
+                               print(substring(cmd_string, argv_start_index(1), argv_end_index(-1) - argv_start_index(1)), "\n");
+                               return 1;
+                       }
+                       return 0;
+               }
+       */
index 8d3511eceda0750e74266d5649133b69f9c15e84..9134353e015574860dc4478938633ba80e3a56ec 100644 (file)
@@ -3,6 +3,7 @@ void ka_TouchEvent(void);
 void ka_RespawnBall(void);
 void ka_DropEvent(entity);
 void ka_TimeScoring(void);
+void ka_EventLog(string, entity);
 
 entity ka_ball;
 
@@ -125,6 +126,7 @@ void ka_TouchEvent() // runs any time that the ball comes in contact with someth
        other.effects |= autocvar_g_keepaway_ballcarrier_effects;
        
        // messages and sounds
+       ka_EventLog("pickup", other);
        Send_KillNotification(other.netname, "", "", KA_PICKUPBALL, MSG_KA);
        WriteByte(MSG_BROADCAST, SVC_CENTERPRINT);
        WriteString(MSG_BROADCAST, strcat(other.netname, "^7 has picked up the ball!"));
@@ -167,6 +169,7 @@ void ka_DropEvent(entity plyr) // runs any time that a player is supposed to los
        plyr.effects &~= autocvar_g_keepaway_ballcarrier_effects;
 
        // messages and sounds
+       ka_EventLog("dropped", plyr);
        Send_KillNotification(plyr.netname, "", "", KA_DROPBALL, MSG_KA);
        WriteByte(MSG_BROADCAST, SVC_CENTERPRINT);
        WriteString(MSG_BROADCAST, strcat(plyr.netname, "^7 has dropped the ball!"));
@@ -205,6 +208,12 @@ void ka_TimeScoring()
        }
 }
 
+void ka_EventLog(string mode, entity actor) // use an alias for easy changing and quick editing later
+{
+       if(autocvar_sv_eventlog)
+               GameLogEcho(strcat(":ka:", mode, ((actor != world) ? (strcat(":", ftos(actor.playerid))) : "")));
+}
+
 MUTATOR_HOOKFUNCTION(ka_Scoring)
 {
        if((frag_attacker != frag_target) && (frag_attacker.classname == "player"))
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 c78b9f2fa5908c650ba76fd71cb0298146764599..c29ac5ff965380bd8dde021b95856a8eef9a385d 100644 (file)
@@ -64,6 +64,10 @@ vote.qh
 
 playerdemo.qh
 
+// singleplayer stuff
+item_key.qh
+secret.qh
+
 scores_rules.qc
 
 miscfunctions.qc
@@ -102,6 +106,10 @@ sv_main.qc
 g_triggers.qc
 g_models.qc
 
+// singleplayer stuff
+item_key.qc
+secret.qc
+
 cl_weaponsystem.qc
 w_common.qc
 
@@ -168,11 +176,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
 
@@ -188,6 +192,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
diff --git a/qcsrc/server/secret.qc b/qcsrc/server/secret.qc
new file mode 100644 (file)
index 0000000..2694cb3
--- /dev/null
@@ -0,0 +1,76 @@
+
+
+void secrets_setstatus() {
+       self.stat_secrets_total = secrets_total;
+       self.stat_secrets_found = secrets_found;
+}
+
+/**
+ * A secret has been found (maybe :P)
+ */
+void trigger_secret_touch() {
+       // only a player can trigger this
+       if (other.classname != "player")
+               return;
+       
+       // update secrets found counter
+       secrets_found += 1;
+       //print("Secret found: ", ftos(secret_counter.cnt), "/");
+       //print(ftos(secret_counter.count), "\n");
+
+       // centerprint message (multi_touch() doesn't always call centerprint())
+       centerprint(other, self.message);
+       self.message = "";
+       
+       // handle normal trigger features
+       multi_touch();
+       remove(self);
+}
+
+/*QUAKED trigger_secret (.5 .5 .5) ?
+Variable sized secret trigger. Can be targeted at one or more entities.
+Basically, it's a trigger_once (with restrictions, see notes) that additionally updates the number of secrets found.
+-------- KEYS --------
+sounds: 1 to play misc/secret.wav, 2 to play misc/talk.wav, 3 to play misc/trigger1.wav (default: 1)
+noise: path to sound file, if you want to play something else
+target: trigger all entities with this targetname when triggered
+message: print this message to the player who activated the trigger instead of the standard 'You found a secret!'
+killtarget: remove all entities with this targetname when triggered
+-------- NOTES --------
+You should create a common/trigger textured brush covering the entrance to a secret room/area.
+Trigger secret can only be trigger by a player's touch and can not be a target itself.
+*/
+void spawnfunc_trigger_secret() {
+       // FIXME: should it be disabled in most modes?
+       
+       // update secrets count
+       secrets_total += 1;
+       
+       // add default message
+       if (self.message == "")
+               self.message = "You found a secret!";
+       
+       // set default sound
+       if (self.noise == "")
+       if not(self.sounds)
+               self.sounds = 1; // misc/secret.wav
+       
+       // this entity can't be a target itself!!!!
+       self.targetname = "";
+       
+       // you can't just shoot a room to find it, can you?
+       self.health = 0;
+       
+       // a secret can not be delayed
+       self.delay = 0;
+       
+       // convert this trigger to trigger_once
+       self.classname = "trigger_once";
+       spawnfunc_trigger_once();
+       
+       // take over the touch() function, so we can mark secret as found
+       self.touch = trigger_secret_touch;
+       // ignore triggering;
+       self.use = SUB_Null;
+}
+
diff --git a/qcsrc/server/secret.qh b/qcsrc/server/secret.qh
new file mode 100644 (file)
index 0000000..dd94b19
--- /dev/null
@@ -0,0 +1,19 @@
+/**
+ * Total number of secrets on the map.
+ */
+float secrets_total;
+
+/**
+ * Total numbe of secrets found on the map.
+ */
+float secrets_found;
+
+
+.float stat_secrets_total;
+.float stat_secrets_found;
+
+/**
+ * update secrets status.
+ */
+void secrets_setstatus();
+
index 15f43ad9eb730f980a1c40827213b13106c84a55..eb386005d16f16201ba064b01d32e799b1a85bee 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);
@@ -263,7 +275,7 @@ void SV_OnEntityPreSpawnFunction()
                        s = substring(s, 1, -1);
                }
 
-               n = tokenize(s);
+               n = tokenize_console(s);
                for(i = 0; i < n; ++i)
                {
                        s = argv(i);
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 ca87ede224ad45a1a67f401008ec253271c2a65f..f44dcb7b9476be220390010163dd175108282428 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,8 @@ void door_go_up()
        self.message = "";
        SUB_UseTargets();
        self.message = oldmessage;
-};
+}
+
 
 
 /*
@@ -893,10 +894,54 @@ ACTIVATION FUNCTIONS
 =============================================================================
 */
 
+float door_check_keys(void) {
+       local entity door;
+       
+       
+       if (self.owner)
+               door = self.owner;
+       else
+               door = self;
+       
+       // no key needed
+       if not(door.itemkeys)
+               return TRUE;
+
+       // this door require a key
+       // only a player can have a key
+       if (other.classname != "player")
+               return FALSE;
+       
+       if (item_keys_usekey(door, other)) {
+               // some keys were used
+               if (other.key_door_messagetime <= time) {
+                       play2(other, "misc/talk.wav");
+                       centerprint(other, strcat("You also need ", item_keys_keylist(door.itemkeys), "!"));
+                       other.key_door_messagetime = time + 2;
+               }
+       } else {
+               // no keys were used
+               if (other.key_door_messagetime <= time) {
+                       play2(other, "misc/talk.wav");
+                       centerprint(other, strcat("You need ", item_keys_keylist(door.itemkeys), "!"));
+                       other.key_door_messagetime = time + 2;
+               }
+       }
+
+       if (door.itemkeys) {
+               // door is now unlocked
+               play2(other, "misc/talk.wav");
+               centerprint(other, "Door unlocked!");
+               return TRUE;
+       } else
+               return FALSE;
+}
+
+
 void door_fire()
 {
-       local entity    oself;
-       local entity    starte;
+       entity  oself;
+       entity  starte;
 
        if (self.owner != self)
                objerror ("door_fire: self.owner != self");
@@ -950,14 +995,15 @@ 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");
+       
        if (self.owner)
        {
                oself = self;
@@ -965,33 +1011,44 @@ void door_use()
                door_fire ();
                self = oself;
        }
-};
+}
 
 
 void door_trigger_touch()
 {
        if (other.health < 1)
-       if not(other.iscreature && other.deadflag == DEAD_NO)
-               return;
+               if not(other.iscreature && other.deadflag == DEAD_NO)
+                       return;
 
        if (time < self.attack_finished_single)
                return;
+       
+       // check if door is locked
+       if (!door_check_keys())
+               return;
+       
        self.attack_finished_single = time + 1;
 
        activator = other;
 
        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;
        self.health = self.health - damage;
+       
+       if (self.itemkeys) {
+               // don't allow opening doors through damage if keys are required
+               return;
+       }
+       
        if (self.health <= 0)
        {
                oself = self;
@@ -1001,7 +1058,7 @@ void door_damage(entity inflictor, entity attacker, float damage, float deathtyp
                door_use ();
                self = oself;
        }
-};
+}
 
 
 /*
@@ -1026,7 +1083,7 @@ void door_touch()
                        centerprint (other, self.owner.message);
                play2(other, "misc/talk.wav");
        }
-};
+}
 
 
 void door_generic_plat_blocked()
@@ -1066,7 +1123,7 @@ void door_generic_plat_blocked()
                        door_rotating_go_down ();
        }
 */
-};
+}
 
 
 void door_rotating_hit_top()
@@ -1078,7 +1135,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()
 {
@@ -1090,7 +1147,7 @@ void door_rotating_hit_bottom()
                self.lip = 0;
        }
        self.state = STATE_BOTTOM;
-};
+}
 
 void door_rotating_go_down()
 {
@@ -1104,7 +1161,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()
 {
@@ -1126,7 +1183,7 @@ void door_rotating_go_up()
        self.message = "";
        SUB_UseTargets();
        self.message = oldmessage;
-};
+}
 
 
 
@@ -1142,8 +1199,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";
@@ -1156,7 +1213,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)
@@ -1174,7 +1231,7 @@ float EntitiesTouching(entity e1, entity e2)
        if (e1.absmax_z < e2.absmin_z)
                return FALSE;
        return TRUE;
-};
+}
 
 
 /*
@@ -1186,8 +1243,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
@@ -1268,16 +1325,20 @@ void LinkDoors()
                }
        } while (1 );
 
-};
+}
 
 
-/*QUAKED spawnfunc_func_door (0 .5 .8) ? START_OPEN x DOOR_DONT_LINK x x TOGGLE
+/*QUAKED spawnfunc_func_door (0 .5 .8) ? START_OPEN x DOOR_DONT_LINK GOLD_KEY SILVER_KEY TOGGLE
 if two doors touch, they are assumed to be connected and operate as a unit.
 
 TOGGLE causes the door to wait in both the start and end states for a trigger event.
 
 START_OPEN causes the door to move to its destination when spawned, and operate in reverse.  It is used to temporarily or permanently close off an area when triggered (not useful for touch or takedamage doors).
 
+GOLD_KEY causes the door to open only if the activator holds a gold key.
+
+SILVER_KEY causes the door to open only if the activator holds a silver key.
+
 "message"      is printed when the door is touched if it is a trigger door and it hasn't been fired yet
 "angle"                determines the opening direction
 "targetname" if set, no touch field will be spawned and a remote button or trigger field activates the door.
@@ -1311,8 +1372,17 @@ void door_reset()
        self.think = SUB_Null;
 }
 
+// spawnflags require key (for now only func_door)
+#define SPAWNFLAGS_GOLD_KEY 8
+#define SPAWNFLAGS_SILVER_KEY 16
 void spawnfunc_func_door()
 {
+       // Quake 1 keys compatibility
+       if (self.spawnflags & SPAWNFLAGS_GOLD_KEY)
+               self.itemkeys |= ITEM_KEY_BIT(0);
+       if (self.spawnflags & SPAWNFLAGS_SILVER_KEY)
+               self.itemkeys |= ITEM_KEY_BIT(1);
+               
        //if (!self.deathtype) // map makers can override this
        //      self.deathtype = " got in the way";
        SetMovedir ();
@@ -1326,8 +1396,9 @@ void spawnfunc_func_door()
        self.blocked = door_blocked;
        self.use = door_use;
 
-    if(self.spawnflags & 8)
-        self.dmg = 10000;
+       // FIXME: undocumented flag 8, originally (Q1) GOLD_KEY
+       // if(self.spawnflags & 8)
+       //      self.dmg = 10000;
 
     if(self.dmg && (!self.message))
                self.message = "was squished";
@@ -1375,7 +1446,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.
@@ -1499,7 +1570,7 @@ void spawnfunc_func_door_rotating()
        InitializeEntity(self, LinkDoors, INITPRIO_LINKDOORS);
 
        self.reset = door_rotating_reset;
-};
+}
 
 /*
 =============================================================================
@@ -1526,7 +1597,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;
@@ -1572,7 +1643,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()
@@ -1581,7 +1652,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()
@@ -1589,7 +1660,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()
@@ -1601,7 +1672,7 @@ void fd_secret_move3()
                self.nextthink = self.ltime + self.wait;
                self.think = fd_secret_move4;
        }
-};
+}
 
 // Move backward...
 void fd_secret_move4()
@@ -1609,7 +1680,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()
@@ -1618,14 +1689,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()
 {
@@ -1637,7 +1708,7 @@ void fd_secret_done()
        }
        if (self.noise3 != "")
                sound(self, CH_TRIGGER_SINGLE, self.noise3, VOL_BASE, ATTN_NORM);
-};
+}
 
 void secret_blocked()
 {
@@ -1645,7 +1716,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);
-};
+}
 
 /*
 ==============
@@ -1669,7 +1740,7 @@ void secret_touch()
                        centerprint (other, self.message);
                play2(other, "misc/talk.wav");
        }
-};
+}
 
 void secret_reset()
 {
@@ -1737,7 +1808,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.
@@ -1752,7 +1823,7 @@ dmgtime: See above.
 
 void func_fourier_controller_think()
 {
-       local vector v;
+       vector v;
        float n, i, t;
 
        self.nextthink = time + 0.1;
@@ -1777,11 +1848,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);
@@ -1825,7 +1896,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;
@@ -1918,7 +1989,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..6c2cce6a73341ad4d3b80fcd25a19233b269b688 100644 (file)
@@ -46,24 +46,45 @@ entity toast(entity from, float range, float damage)
 
 float turret_tesla_firecheck()
 {
-    if not (turret_stdproc_firecheck())
-        return 0;
+    // g_turrets_targetscan_maxdelay forces a target re-scan at least this often
+    float do_target_scan;
+    
+    if((self.target_select_time + autocvar_g_turrets_targetscan_maxdelay) < time)
+        do_target_scan = 1;
+
+    // Old target (if any) invalid?
+    if(self.target_validate_time < time)
+    if (turret_validate_target(self, self.enemy, self.target_validate_flags) <= 0)
+    {
+        self.enemy = world;
+        self.target_validate_time = time + 0.5;
+        do_target_scan = 1;
+    }
 
-    self.target_select_flags = TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_MISSILES | TFL_TARGETSELECT_RANGELIMTS | TFL_TARGETSELECT_TEAMCHECK;
+    // But never more often then g_turrets_targetscan_mindelay!
+    if (self.target_select_time + autocvar_g_turrets_targetscan_mindelay > time)
+        do_target_scan = 0;
 
-    self.enemy = turret_select_target();
+    if(do_target_scan)
+    {
+        self.enemy = turret_select_target();
+        self.target_select_time = time;
+    }
+
+    if not (turret_stdproc_firecheck())
+        return 0;
 
     if(self.enemy)
         return 1;
 
     return 0;
-
 }
 
+
 void turret_tesla_fire()
 {
-    entity e,t;
-    float d,r,i;
+    entity e, t;
+    float d, r, i;
 
     //w_deathtypestring = "discoverd how a tesla coil works";
 
@@ -101,7 +122,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 e3c74c5e190c864a1d0832834729d2fc4b534979..ff7f2e483333ff1a318f486f54675333042f8a79 100644 (file)
@@ -66,6 +66,10 @@ float autocvar_g_vehicle_racer_blowup_coredamage;
 float autocvar_g_vehicle_racer_blowup_edgedamage;
 float autocvar_g_vehicle_racer_blowup_forceintensity;
 
+float autocvar_g_vehicle_racer_bouncefactor;
+float autocvar_g_vehicle_racer_bouncestop;
+vector autocvar_g_vehicle_racer_bouncepain;
+
 var vector racer_force_from_tag(string tag_name, float spring_length, float max_power);
 
 void racer_align4point()
@@ -527,6 +531,13 @@ void racer_exit(float eject)
        
     self.owner = world;
 }
+void racer_worldimpact()
+{
+    if(self.play_time < time)
+    if(autocvar_g_vehicle_racer_bouncepain_x)
+        vehilces_worldimpact(autocvar_g_vehicle_racer_bouncepain_x, autocvar_g_vehicle_racer_bouncepain_y, autocvar_g_vehicle_racer_bouncepain_z);
+
+}
 
 void racer_spawn()
 {
@@ -541,6 +552,10 @@ void racer_spawn()
     self.scale          = 0.5;
 
     setsize(self, RACER_MIN * 0.5, RACER_MAX * 0.5);
+    self.bouncefactor = autocvar_g_vehicle_racer_bouncefactor;
+    self.bouncestop = autocvar_g_vehicle_racer_bouncestop;    
+    self.vehicle_worldimpact = racer_worldimpact;
+    //self.destvec = autocvar_g_vehicle_racer_bouncepain;
 }
 
 
index 201c186c37947d65ad983efd0b4c67c1f0484120..63509aecd665d655fc63c852413c97e5e6c77900 100644 (file)
@@ -57,6 +57,10 @@ float autocvar_g_vehicle_raptor_shield;
 float autocvar_g_vehicle_raptor_shield_regen;
 float autocvar_g_vehicle_raptor_shield_regen_pause;
 
+float autocvar_g_vehicle_raptor_bouncefactor;
+float autocvar_g_vehicle_raptor_bouncestop;
+vector autocvar_g_vehicle_raptor_bouncepain;
+
 void raptor_spawn();
 float raptor_frame();
 float raptor_takeoff();
@@ -66,7 +70,7 @@ float raptor_takeoff();
 
 float raptor_altitude(float amax)
 {
-       tracebox(self.origin, self.mins, self.maxs, self.origin - ('0 0 1' * amax), TRUE, self);
+       tracebox(self.origin, self.mins, self.maxs, self.origin - ('0 0 1' * amax), MOVE_WORLDONLY, self);
     return vlen(self.origin - trace_endpos);
 }
 
@@ -194,26 +198,26 @@ void raptor_enter()
 }
 
 void raptor_land()
-{
-
+{    
     float hgt;
-    
-    hgt = raptor_altitude(512);
+        
+    hgt = raptor_altitude(512);    
     self.velocity = (self.velocity * 0.9) + ('0 0 -1800' * (hgt / 256) * sys_frametime);
     self.angles_x *= 0.95;
     self.angles_z *= 0.95;
 
     if(hgt < 128)
-        if(self.frame != 0)
-            self.frame = max(self.frame - 0.25, 0);
+    if(hgt > 0)
+        self.frame = (hgt / 128) * 25;
 
     self.bomb1.gun1.avelocity_y = 90 + ((self.frame / 25) * 2000);
     self.bomb1.gun2.avelocity_y = -self.bomb1.gun1.avelocity_y;
 
     if(hgt < 16)
     {
-        self.movetype   = MOVETYPE_TOSS;
-        self.think      = raptor_think;
+        self.movetype = MOVETYPE_TOSS;
+        self.think    = raptor_think;
+        self.frame    = 0;
     }
 
     self.nextthink  = time;
@@ -591,6 +595,13 @@ void raptor_die()
        self.touch     = raptor_blowup;
 }
 
+void raptor_worldimpact()
+{
+    if(self.play_time < time)
+    if(autocvar_g_vehicle_raptor_bouncepain_x)
+        vehilces_worldimpact(autocvar_g_vehicle_raptor_bouncepain_x, autocvar_g_vehicle_raptor_bouncepain_y, autocvar_g_vehicle_raptor_bouncepain_z);
+}
+
 void raptor_spawn()
 {
     self.frame          = 0;
@@ -605,6 +616,10 @@ void raptor_spawn()
 
     setsize(self, RAPTOR_MIN, RAPTOR_MAX );
     self.delay = time;
+        
+    self.bouncefactor = autocvar_g_vehicle_raptor_bouncefactor;
+    self.bouncestop = autocvar_g_vehicle_raptor_bouncestop;    
+    self.vehicle_worldimpact = raptor_worldimpact;    
 }
 
 // If we dont do this ever now and then, the raptors rotors
index f43ec08e52f35f9a792a172a82c6a9da3e4f0093..903d3b2047ff12468f9077945768b21c83c52f52 100644 (file)
@@ -51,6 +51,11 @@ float autocvar_g_vehicle_spiderbot_rocket_noise;
 float autocvar_g_vehicle_spiderbot_rocket_turnrate;
 float autocvar_g_vehicle_spiderbot_rocket_lifetime;
 
+float autocvar_g_vehicle_spiderbot_bouncefactor;
+float autocvar_g_vehicle_spiderbot_bouncestop;
+vector autocvar_g_vehicle_spiderbot_bouncepain;
+
+
 void spiderbot_exit(float eject);
 void spiderbot_enter();
 void spiderbot_spawn();
@@ -480,7 +485,12 @@ void spiderbot_exit(float eject)
         
     self.owner = world;
 }
-
+void spider_worldimpact()
+{
+    if(self.play_time < time)
+    if(autocvar_g_vehicle_spiderbot_bouncepain_x)
+        vehilces_worldimpact(autocvar_g_vehicle_spiderbot_bouncepain_x, autocvar_g_vehicle_spiderbot_bouncepain_y, autocvar_g_vehicle_spiderbot_bouncepain_z);    
+}
 void spiderbot_spawn()
 {
     self.frame              = 5;
@@ -496,6 +506,7 @@ void spiderbot_spawn()
 
     setorigin(self, self.pos1 + '0 0 128');
     self.angles = self.pos2;
+    self.vehicle_worldimpact = spider_worldimpact;
 }
 
 void spiderbot_headfade()
index 683b43669536cc76a3ce2d3defe1762f2844701f..908ccc624253cb118cff557a8cde5481b5eeb869 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;
@@ -375,6 +376,28 @@ float vehicles_crushable(entity e)
     return FALSE;
 }
 
+void vehilces_worldimpact(float _minspeed, float _speedfac, float _maxpain)
+{
+    if(self.play_time < time)
+    {                    
+        float wc, take;
+        wc = vlen(self.velocity - self.oldvelocity);
+        if(_minspeed < wc)
+        {
+            take = min(_speedfac * wc, _maxpain);
+            Damage (self, world, world, take, DEATH_FALL, self.origin, '0 0 0');
+            self.play_time = time + 0.25;
+            
+            dprint("oldvel: ", vtos(self.oldvelocity), "\n");
+            dprint("vel: ", vtos(self.velocity), "\n");
+            dprint("wc: ", ftos(wc), "\n");
+            dprint("take: ", ftos(take), "\n");
+            
+        }
+    }
+}
+
+.void() vehicle_worldimpact;
 void vehicles_touch()
 {
     // Vehicle currently in use
@@ -383,6 +406,8 @@ void vehicles_touch()
         // Colided with world?
         if(other == world)
         {
+            if(self.vehicle_worldimpact)
+                self.vehicle_worldimpact();
         }
         else
         {
@@ -974,6 +999,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..a05c17bd4b40f7dbd392f0a8b45970824d4bb6e8 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;
 
@@ -353,6 +353,8 @@ void fireBallisticBullet_trace_callback(vector start, vector hit, vector end)
 {
        if(vlen(trace_endpos - fireBallisticBullet_trace_callback_ent.origin) > 16)
                zcurveparticles_from_tracetoss(fireBallisticBullet_trace_callback_eff, fireBallisticBullet_trace_callback_ent.origin, trace_endpos, fireBallisticBullet_trace_callback_ent.velocity);
+       WarpZone_trace_forent = world;
+       self.owner = world;
 }
 
 void fireBallisticBullet(vector start, vector dir, float spread, float pSpeed, float lifetime, float damage, float headshotbonus, float force, float dtype, float tracereffects, float gravityfactor, float bulletconstant)
@@ -416,7 +418,8 @@ void fireBallisticBullet(vector start, vector dir, float spread, float pSpeed, f
 
                if(lag)
                        FOR_EACH_PLAYER(pl)
-                               antilag_takeback(pl, time - lag);
+                               if(pl != self)
+                                       antilag_takeback(pl, time - lag);
 
                oldself = self;
                self = proj;
@@ -438,15 +441,6 @@ void fireBallisticBullet(vector start, vector dir, float spread, float pSpeed, f
                        trace_fraction = 0;
                        fireBallisticBullet_trace_callback_ent = self;
                        fireBallisticBullet_trace_callback_eff = eff;
-                       // FIXME can we somehow do this with just ONE trace?
-                       WarpZone_TraceToss(self, self.owner);
-                       if(self.owner && WarpZone_trace_firstzone)
-                       {
-                               self.owner = world;
-                               self.velocity = v0;
-                               self.gravity = g0;
-                               continue;
-                       }
                        WarpZone_TraceToss_ThroughZone(self, self.owner, world, fireBallisticBullet_trace_callback);
                        self.velocity = v0;
                        self.gravity = g0;
@@ -503,7 +497,8 @@ void fireBallisticBullet(vector start, vector dir, float spread, float pSpeed, f
 
                if(lag)
                        FOR_EACH_PLAYER(pl)
-                               antilag_restore(pl);
+                               if(pl != self)
+                                       antilag_restore(pl);
 
                remove(proj);
 
@@ -541,6 +536,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);
+       
+       //dprint(strcat("W_CheckProjectileDamage: 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..ec333cc724d1291abcd11285b391037181c784e5 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)
@@ -571,27 +578,27 @@ float w_electro(float req)
        else if (req == WR_SUICIDEMESSAGE)
        {
                if(w_deathtype & HITTYPE_SECONDARY)
-                       w_deathtypestring = _("%s could not remember where they put plasma");
+                       w_deathtypestring = _("%s could not remember where they put their electro plasma");
                else
-                       w_deathtypestring = _("%s played with plasma");
+                       w_deathtypestring = _("%s played with electro plasma");
        }
        else if (req == WR_KILLMESSAGE)
        {
                if(w_deathtype & HITTYPE_SECONDARY)
                {
                        if(w_deathtype & HITTYPE_SPLASH) // unchecked: BOUNCE
-                               w_deathtypestring = _("%s just noticed %s's blue ball");
+                               w_deathtypestring = _("%s just noticed %s's electro plasma");
                        else // unchecked: BOUNCE
-                               w_deathtypestring = _("%s got in touch with %s's blue ball");
+                               w_deathtypestring = _("%s got in touch with %s's electro plasma");
                }
                else
                {
                        if(w_deathtype & HITTYPE_BOUNCE) // combo
-                               w_deathtypestring = _("%s felt the electrifying air of %s's combo");
+                               w_deathtypestring = _("%s felt the electrifying air of %s's electro combo");
                        else if(w_deathtype & HITTYPE_SPLASH)
-                               w_deathtypestring = _("%s got too close to %s's blue beam");
+                               w_deathtypestring = _("%s got too close to %s's blue electro bolt");
                        else
-                               w_deathtypestring = _("%s was blasted by %s's blue beam");
+                               w_deathtypestring = _("%s was blasted by %s's blue electro bolt");
                }
        }
        return TRUE;
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..352ce883bd255fb49c9ebf0ff95bdb9bf40c06f1 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)
@@ -380,9 +385,9 @@ float w_glauncher(float req)
        else if (req == WR_SUICIDEMESSAGE)
        {
                if(w_deathtype & HITTYPE_SECONDARY)
-                       w_deathtypestring = _("%s tried out his own grenade");
+                       w_deathtypestring = _("%s didn't see their own grenade");
                else
-                       w_deathtypestring = _("%s detonated");
+                       w_deathtypestring = _("%s blew themself up with their grenadelauncher");
        }
        else if (req == WR_KILLMESSAGE)
        {
index 1952607b823e04838f4f4b671a97a009d4a844f9..76103f347e34fa50c6d16c849f6ee0dc0c15f2ac 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.owner != world) ? (inflictor.owner == self.owner) : TRUE)
+               && (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)
@@ -399,13 +459,13 @@ float w_hagar(float req)
                precache_sound("weapons/hagexp3.wav");
        }
        else if (req == WR_SUICIDEMESSAGE)
-               w_deathtypestring = _("%s played with tiny rockets");
+               w_deathtypestring = _("%s played with tiny hagar rockets");
        else if (req == WR_KILLMESSAGE)
        {
                if(w_deathtype & HITTYPE_BOUNCE) // must be secondary; unchecked: SPLASH
-                       w_deathtypestring = _("%s hoped %s's missiles wouldn't bounce");
+                       w_deathtypestring = _("%s was pummeled with a burst of hagar rockets by %s");
                else // unchecked: SPLASH, SECONDARY
-                       w_deathtypestring = _("%s was pummeled by %s");
+                       w_deathtypestring = _("%s was pummeled with hagar rockets by %s");
        }
        return TRUE;
 }
index 0a163e2f98affc699d87da07e3ddcb69b0a8dd2d..2eb2918ed6c41a138683ff19df07ee427e8ebb8e 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)
@@ -239,7 +239,7 @@ float w_hlac(float req)
        else if (req == WR_SUICIDEMESSAGE)
                w_deathtypestring = _("%s should have used a smaller gun");
        else if (req == WR_KILLMESSAGE)
-               w_deathtypestring = _("%s was cut down by %s");
+               w_deathtypestring = _("%s was cut down with a HLAC by %s");
        return TRUE;
 }
 #endif
index 754ffff909bf1a90a75976f115e86d70f8c9bef5..695ac381fe55afcaeb750f2890e313addb6ef915 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)
@@ -265,7 +285,7 @@ float w_hook(float req)
        else if (req == WR_SUICIDEMESSAGE)
                w_deathtypestring = _("%s did the impossible");
        else if (req == WR_KILLMESSAGE)
-               w_deathtypestring = _("%s has run into %s's gravity bomb");
+               w_deathtypestring = _("%s was caught in %s's hook gravity bomb");
        return TRUE;
 }
 #endif
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..afe37b56f7b6680bcd143f88d0a460288b11481c 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)
@@ -520,7 +529,10 @@ float w_minelayer(float req)
                precache_sound("weapons/mine_exp.wav");
        }
        else if (req == WR_SUICIDEMESSAGE)
-               w_deathtypestring = _("%s exploded");
+               if(w_deathtype & HITTYPE_BOUNCE) // (remote detonation)
+                       w_deathtypestring = _("%s blew themself up with their minelayer");
+               else
+                       w_deathtypestring = _("%s forgot about their mine");
        else if (req == WR_KILLMESSAGE)
        {
                if(w_deathtype & HITTYPE_BOUNCE) // (remote detonation)
index 10014a7e1b2fb7f794a24b6fdef0c21f79eb9d9f..1dfc281732e88925f33887d24969700bb98d30d8 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)
@@ -292,7 +292,7 @@ float w_minstanex(float req)
        else if (req == WR_SUICIDEMESSAGE)
                w_deathtypestring = _("%s is now thinking with portals");
        else if (req == WR_KILLMESSAGE)
-               w_deathtypestring = _("%s has been vaporized by %s");
+               w_deathtypestring = _("%s has been vaporized by %s's minstanex");
        return TRUE;
 }
 #endif
index 802298912d96eb774796b893d222705f92eeb754..3f47b48fd073b149cfdb6b386f226442badd668a 100644 (file)
@@ -232,7 +232,7 @@ float w_nex(float req)
        }
 
        return TRUE;
-};
+}
 #endif
 #ifdef CSQC
 float w_nex(float req)
@@ -252,7 +252,7 @@ float w_nex(float req)
        else if (req == WR_SUICIDEMESSAGE)
                w_deathtypestring = _("%s is now thinking with portals");
        else if (req == WR_KILLMESSAGE)
-               w_deathtypestring = _("%s has been vaporized by %s");
+               w_deathtypestring = _("%s has been vaporized by %s's nex");
        return TRUE;
 }
 #endif
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..89cb37257d07966aad54751e8dce15d90af11666 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)
@@ -229,19 +229,16 @@ float w_rifle(float req)
        }
        else if (req == WR_SUICIDEMESSAGE)
        {
-               if(w_deathtype & HITTYPE_SECONDARY)
-                       w_deathtypestring = _("%s shot themself automatically");
-               else
-                       w_deathtypestring = _("%s sniped themself somehow");
+               w_deathtypestring = _("%s is now thinking with portals");
        }
        else if (req == WR_KILLMESSAGE)
        {
                if(w_deathtype & HITTYPE_SECONDARY)
                {
                        if(w_deathtype & HITTYPE_BOUNCE)
-                               w_deathtypestring = _("%s failed to hide from %s's bullet hail");
+                               w_deathtypestring = _("%s failed to hide from %s's rifle bullet hail");
                        else
-                               w_deathtypestring = _("%s died in %s's bullet hail");
+                               w_deathtypestring = _("%s died in %s's rifle bullet hail");
                }
                else
                {
@@ -253,9 +250,9 @@ float w_rifle(float req)
                        else
                        {
                                if(w_deathtype & HITTYPE_HEADSHOT)
-                                       w_deathtypestring = _("%s got hit in the head by %s");
+                                       w_deathtypestring = _("%s got shot in the head with a rifle by %s");
                                else
-                                       w_deathtypestring = _("%s was sniped by %s");
+                                       w_deathtypestring = _("%s was sniped with a rifle by %s");
                        }
                }
        }
index 4da611e7263dc023953dbce8ff8408e1db7535f2..723389e7121e5d7536f5f7bf07aec65847548092 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)
@@ -498,7 +504,7 @@ float w_rlauncher(float req)
                precache_sound("weapons/rocket_impact.wav");
        }
        else if (req == WR_SUICIDEMESSAGE)
-               w_deathtypestring = _("%s exploded");
+               w_deathtypestring = _("%s blew themself up with their rocketlauncher");
        else if (req == WR_KILLMESSAGE)
        {
                if(w_deathtype & HITTYPE_BOUNCE) // (remote detonation)
index a110c003fdada021479974cbf2b057668d88026e..c4c08bb51230983d2b80abe456a567eff56f53c0 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)
@@ -654,13 +658,13 @@ float w_seeker(float req)
                precache_sound("weapons/tag_impact.wav");
        }
        else if (req == WR_SUICIDEMESSAGE)
-               w_deathtypestring = _("%s played with tiny rockets");
+               w_deathtypestring = _("%s played with tiny seeker rockets");
        else if (req == WR_KILLMESSAGE)
        {
                if(w_deathtype & HITTYPE_SECONDARY)
-                       w_deathtypestring = _("%s was tagged by %s");
+                       w_deathtypestring = _("%s was tagged with a seeker by %s");
                else
-                       w_deathtypestring = _("%s was pummeled by %s");
+                       w_deathtypestring = _("%s was pummeled with seeker rockets by %s");
        }
        return TRUE;
 }
index 1f097132d84de84acc70fa16375ff6dab115ecaf..6e8fa00f9677a4d0e7fe774a55ef4c92bbf23b0f 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;
@@ -216,9 +268,9 @@ float w_shotgun(float req)
        else if (req == WR_KILLMESSAGE)
        {
                if(w_deathtype & HITTYPE_SECONDARY)
-                       w_deathtypestring = _("%2$s ^7slapped %1$s ^7around a bit with a large ^2shotgun");
+                       w_deathtypestring = _("%2$s slapped %1$s around a bit with a large shotgun");
                else
-                       w_deathtypestring = _("%s was gunned by %s");
+                       w_deathtypestring = _("%s was gunned down with a shotgun by %s");
        }
        return TRUE;
 }
index 987e7b41e2570b6480e4d141aa546fcd3dc6ccec..2e4aa4957df67e7d201fa2b11f216f300888d85e 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)
@@ -227,6 +240,9 @@ float w_tuba(float req)
                precache_model ("models/weapons/g_tuba.md3");
                precache_model ("models/weapons/v_tuba.md3");
                precache_model ("models/weapons/h_tuba.iqm");
+               precache_model ("models/weapons/g_akordeon.md3");
+               precache_model ("models/weapons/v_akordeon.md3");
+               precache_model ("models/weapons/h_akordeon.iqm");
 
                //float i;
                //for(i = -18; i <= +27; ++i)
@@ -240,22 +256,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 +281,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 +296,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..77d8b4aee562215cec57fa4a1021857d41be4ca0 100644 (file)
@@ -52,9 +52,9 @@ void W_UZI_Attack (float deathtype)
        ATTACK_FINISHED(self) = time + autocvar_g_balance_uzi_first_refire * W_WeaponRateFactor();
 
        if (self.misc_bulletcounter == 1)
-               fireBallisticBullet(w_shotorg, w_shotdir, autocvar_g_balance_uzi_first_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_first_damage, 0, autocvar_g_balance_uzi_first_force, deathtype, 0, 1, autocvar_g_balance_uzi_bulletconstant);
+               fireBallisticBullet(w_shotorg, w_shotdir, autocvar_g_balance_uzi_first_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_first_damage, autocvar_g_balance_uzi_first_headshotaddeddamage, autocvar_g_balance_uzi_first_force, deathtype, 0, 1, autocvar_g_balance_uzi_bulletconstant);
        else
-               fireBallisticBullet(w_shotorg, w_shotdir, autocvar_g_balance_uzi_sustained_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_sustained_damage, 0, autocvar_g_balance_uzi_sustained_force, deathtype, 0, 1, autocvar_g_balance_uzi_bulletconstant);
+               fireBallisticBullet(w_shotorg, w_shotdir, autocvar_g_balance_uzi_sustained_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_sustained_damage, autocvar_g_balance_uzi_sustained_headshotaddeddamage, autocvar_g_balance_uzi_sustained_force, deathtype, 0, 1, autocvar_g_balance_uzi_bulletconstant);
        endFireBallisticBullet();
 
        pointparticles(particleeffectnum("uzi_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
@@ -126,7 +126,7 @@ void uzi_mode1_fire_auto()
        }
 
        uzi_spread = bound(autocvar_g_balance_uzi_spread_min, autocvar_g_balance_uzi_spread_min + (autocvar_g_balance_uzi_spread_add * self.misc_bulletcounter), autocvar_g_balance_uzi_spread_max);
-       fireBallisticBullet(w_shotorg, w_shotdir, uzi_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_sustained_damage, 0, autocvar_g_balance_uzi_sustained_force, WEP_UZI, 0, 1, autocvar_g_balance_uzi_bulletconstant);
+       fireBallisticBullet(w_shotorg, w_shotdir, uzi_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_sustained_damage, autocvar_g_balance_uzi_sustained_headshotaddeddamage, autocvar_g_balance_uzi_sustained_force, WEP_UZI, 0, 1, autocvar_g_balance_uzi_bulletconstant);
        endFireBallisticBullet();
 
        self.misc_bulletcounter = self.misc_bulletcounter + 1;
@@ -152,7 +152,7 @@ void uzi_mode1_fire_burst()
                self.punchangle_y = random () - 0.5;
        }
 
-       fireBallisticBullet(w_shotorg, w_shotdir, autocvar_g_balance_uzi_burst_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_sustained_damage, 0, autocvar_g_balance_uzi_sustained_force, WEP_UZI, 0, 1, autocvar_g_balance_uzi_bulletconstant);
+       fireBallisticBullet(w_shotorg, w_shotdir, autocvar_g_balance_uzi_burst_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_sustained_damage, autocvar_g_balance_uzi_sustained_headshotaddeddamage, autocvar_g_balance_uzi_sustained_force, WEP_UZI, 0, 1, autocvar_g_balance_uzi_bulletconstant);
        endFireBallisticBullet();
 
 
@@ -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)
@@ -319,9 +319,9 @@ float w_uzi(float req)
        else if (req == WR_KILLMESSAGE)
        {
                if(w_deathtype & HITTYPE_SECONDARY)
-                       w_deathtypestring = _("%s was sniped by %s");
+                       w_deathtypestring = _("%s was sniped by %s's machine gun");
                else
-                       w_deathtypestring = _("%s was riddled full of holes by %s");
+                       w_deathtypestring = _("%s was riddled full of holes by %s's machine gun");
        }
        return TRUE;
 }
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 0f1337d18fb614c447e8efbac9be7d5fc6645040..f09f25bdcd13d320e5b9277da55795865d5c3e88 100644 (file)
@@ -191,6 +191,7 @@ void WarpZone_TraceBox_ThroughZone(vector org, vector mi, vector ma, vector end,
        entity wz;
        vector vf, vr, vu;
 
+       WarpZone_trace_forent = forent;
        WarpZone_trace_firstzone = world;
        WarpZone_trace_lastzone = world;
        WarpZone_Trace_InitTransform();
@@ -206,7 +207,7 @@ void WarpZone_TraceBox_ThroughZone(vector org, vector mi, vector ma, vector end,
                }
                else
                {
-                       tracebox(org, mi, ma, end, nomonsters, forent);
+                       tracebox(org, mi, ma, end, nomonsters, WarpZone_trace_forent);
                        if(cb)
                                cb(org, trace_endpos, end);
                        return;
@@ -229,8 +230,8 @@ void WarpZone_TraceBox_ThroughZone(vector org, vector mi, vector ma, vector end,
                        nomonsters_adjusted = nomonsters;
                        break;
        }
-       if((contentshack = (forent.dphitcontentsmask && !(forent.dphitcontentsmask & DPCONTENTS_SOLID))))
-               BITSET_ASSIGN(forent.dphitcontentsmask, DPCONTENTS_SOLID);
+       if((contentshack = (WarpZone_trace_forent.dphitcontentsmask && !(WarpZone_trace_forent.dphitcontentsmask & DPCONTENTS_SOLID))))
+               BITSET_ASSIGN(WarpZone_trace_forent.dphitcontentsmask, DPCONTENTS_SOLID);
 
        // if starting in warpzone, first transform
        wz = WarpZone_Find(org + mi, org + ma);
@@ -262,7 +263,7 @@ void WarpZone_TraceBox_ThroughZone(vector org, vector mi, vector ma, vector end,
                        trace_ent = world;
                        break;
                }
-               tracebox(org, mi, ma, end, nomonsters_adjusted, forent);
+               tracebox(org, mi, ma, end, nomonsters_adjusted, WarpZone_trace_forent);
                if(cb)
                        cb(org, trace_endpos, end);
                if(sol < 0)
@@ -273,7 +274,7 @@ void WarpZone_TraceBox_ThroughZone(vector org, vector mi, vector ma, vector end,
                        break;
                if(trace_ent.classname != "trigger_warpzone")
                {
-                       if((nomonsters == MOVE_NOTHING) || ((nomonsters == MOVE_WORLDONLY) && trace_ent) || (contentshack && (trace_dphitcontents & forent.dphitcontentsmask) == DPCONTENTS_SOLID))
+                       if((nomonsters == MOVE_NOTHING) || ((nomonsters == MOVE_WORLDONLY) && trace_ent) || (contentshack && (trace_dphitcontents & WarpZone_trace_forent.dphitcontentsmask) == DPCONTENTS_SOLID))
                        {
                                // continue the trace, ignoring this hit (we only care for warpzones)
                                org = trace_endpos + normalize(end - org);
@@ -302,13 +303,13 @@ void WarpZone_TraceBox_ThroughZone(vector org, vector mi, vector ma, vector end,
                end = WarpZone_TransformOrigin(wz, end);
 
                // we got warped, so let's step back a bit
-               tracebox(org, mi, ma, org + normalize(org - end) * 32, nomonsters_adjusted, forent);
+               tracebox(org, mi, ma, org + normalize(org - end) * 32, nomonsters_adjusted, WarpZone_trace_forent);
                org = trace_endpos;
        }
        WarpZone_MakeAllOther();
 :fail
        if(contentshack)
-               BITCLR_ASSIGN(forent.dphitcontentsmask, DPCONTENTS_SOLID);
+               BITCLR_ASSIGN(WarpZone_trace_forent.dphitcontentsmask, DPCONTENTS_SOLID);
        trace_startsolid = sol;
        v_forward = vf;
        v_right = vr;
@@ -334,13 +335,14 @@ void WarpZone_TraceToss_ThroughZone(entity e, entity forent, entity zone, WarpZo
        o0 = e.origin;
        v0 = e.velocity;
 
+       WarpZone_trace_forent = forent;
        WarpZone_trace_firstzone = world;
        WarpZone_trace_lastzone = world;
        WarpZone_Trace_InitTransform();
        WarpZone_tracetoss_time = 0;
        if(!warpzone_warpzones_exist)
        {
-               tracetoss(e, forent);
+               tracetoss(e, WarpZone_trace_forent);
                if(cb)
                        cb(e.origin, trace_endpos, trace_endpos);
                dt = vlen(e.origin - o0) / vlen(e.velocity);
@@ -384,7 +386,7 @@ void WarpZone_TraceToss_ThroughZone(entity e, entity forent, entity zone, WarpZo
                        trace_ent = world;
                        break;
                }
-               tracetoss(e, forent);
+               tracetoss(e, WarpZone_trace_forent);
                if(cb)
                        cb(e.origin, trace_endpos, trace_endpos);
                dt = vlen(trace_endpos - e.origin) / vlen(e.velocity);
@@ -415,7 +417,7 @@ void WarpZone_TraceToss_ThroughZone(entity e, entity forent, entity zone, WarpZo
 
                // we got warped, so let's step back a bit
                e.velocity = -e.velocity;
-               tracetoss(e, forent);
+               tracetoss(e, WarpZone_trace_forent);
                dt = vlen(trace_endpos - e.origin) / vlen(e.velocity);
                WarpZone_tracetoss_time -= dt;
                e.origin = trace_endpos;
index 1dc12b8cfe97f60bc75d5139bb653a04b1eacf3e..c2f36bea868d8baf7ad06c37294b3b7bb2316a24 100644 (file)
@@ -25,6 +25,7 @@ void WarpZone_MakeAllSolid();
 void WarpZone_MakeAllOther();
 
 #define MOVE_NOTHING -1
+entity WarpZone_trace_forent; // temp, callback is allowed to change it
 typedef void(vector start, vector hit, vector end) WarpZone_trace_callback_t; // called on every elementary trace
 const var WarpZone_trace_callback_t WarpZone_trace_callback_t_null;
 entity WarpZone_trace_transform; // transform accumulator during a trace
index 63e3e712ab84fade91945a62dc4bcd1ff0b63c9f..3d4a750455a3e5947b073e3c62e698a9d347ea74 100644 (file)
@@ -1,3 +1,5 @@
+#define REMOVEHACK
+
 // for think function
 .vector warpzone_save_origin;
 .vector warpzone_save_angles;
@@ -19,7 +21,7 @@ void WarpZone_StoreProjectileData(entity e)
 
 void WarpZone_TeleportPlayer(entity teleporter, entity player, vector to, vector to_angles, vector to_velocity)
 {
-       setorigin (player, to);
+       setorigin (player, to); // NOTE: this also aborts the move, when this is called by touch
        player.oldorigin = to; // for DP's unsticking
        player.angles = to_angles;
        player.fixangle = TRUE;
@@ -42,35 +44,6 @@ float WarpZone_Teleported_Send(entity to, float sf)
        return TRUE;
 }
 
-#define WARPZONE_TELEPORT_FIXSOLID(ret) \
-       do \
-       { \
-               setorigin(player, o1 - player.view_ofs); \
-               if(WarpZoneLib_MoveOutOfSolid(player)) \
-               { \
-                       o1 = player.origin + player.view_ofs; \
-                       setorigin(player, o0 - player.view_ofs); \
-               } \
-               else \
-               { \
-                       print("would have to put player in solid, won't do that\n"); \
-                       setorigin(player, o0 - player.view_ofs); \
-                       return (ret); \
-               } \
-       } \
-       while(0)
-#define WARPZONE_TELEPORT_DOTELEPORT() \
-       do \
-       { \
-               WarpZone_RefSys_Add(player, wz); \
-               WarpZone_TeleportPlayer(wz, player, o1 - player.view_ofs, a1, v1); \
-               WarpZone_StoreProjectileData(player); \
-               player.warpzone_teleport_time = time; \
-               player.warpzone_teleport_finishtime = time; \
-               player.warpzone_teleport_zone = wz; \
-       } \
-       while(0)
-
 float WarpZone_Teleport(entity wz, entity player, float f0, float f1)
 {
        vector o0, a0, v0, o1, a1, v1, o10;
@@ -109,12 +82,31 @@ float WarpZone_Teleport(entity wz, entity player, float f0, float f1)
                        o1 = o1 - v1 * (d / dv);
        }
 
-       // put him inside solid
+       // put him out of solid
        tracebox(o1 - player.view_ofs, player.mins, player.maxs, o1 - player.view_ofs, MOVE_NOMONSTERS, player);
        if(trace_startsolid)
-               WARPZONE_TELEPORT_FIXSOLID(0);
+       {
+               setorigin(player, o1 - player.view_ofs);
+               if(WarpZoneLib_MoveOutOfSolid(player))
+               {
+                       o1 = player.origin + player.view_ofs;
+                       setorigin(player, o0 - player.view_ofs);
+               }
+               else
+               {
+                       print("would have to put player in solid, won't do that\n");
+                       setorigin(player, o0 - player.view_ofs);
+                       return 0;
+               }
+       }
 
-       WARPZONE_TELEPORT_DOTELEPORT();
+       // do the teleport
+       WarpZone_RefSys_Add(player, wz);
+       WarpZone_TeleportPlayer(wz, player, o1 - player.view_ofs, a1, v1);
+       WarpZone_StoreProjectileData(player);
+       player.warpzone_teleport_time = time;
+       player.warpzone_teleport_finishtime = time;
+       player.warpzone_teleport_zone = wz;
 
        // prevent further teleports back
        float dt = (o1 - o10) * v1 * (1 / (v1 * v1));
@@ -325,8 +317,18 @@ float WarpZone_CheckProjectileImpact(entity player)
        if(!wz)
                return 0;
 
+#ifdef REMOVEHACK
+       print("impactfilter found something - and it no longer gets handled correctly - please tell divVerent whether anything behaves broken now\n");
+#else
        print("impactfilter found something - and it even gets handled correctly - please tell divVerent that this code apparently gets triggered again\n");
+#endif
+       print("Entity type: ", player.classname, "\n");
+       print("Origin: ", vtos(player.origin), "\n");
+       print("Velocity: ", vtos(player.velocity), "\n");
 
+#ifdef REMOVEHACK
+       return 0;
+#else
        // retry previous move
        setorigin(player, player.warpzone_oldorigin);
        player.velocity = player.warpzone_oldvelocity;
@@ -361,6 +363,7 @@ float WarpZone_CheckProjectileImpact(entity player)
        }
 
        return +1;
+#endif
 }
 float WarpZone_Projectile_Touch()
 {
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
index af6587546def9aa83b5581a4eb2efbc746754923..33fb4140baa7b79a3938cb63029e745f781ab7ef 100644 (file)
@@ -61,4 +61,8 @@ set g_vehicle_racer_blowup_coredamage       250
 set g_vehicle_racer_blowup_edgedamage       15
 set g_vehicle_racer_blowup_forceintensity   250
 
+set g_vehicle_racer_bouncefactor 0.25   // Factor of old velocity to keep after colission
+set g_vehicle_racer_bouncestop 0        // if != 0, New veloctiy after bounce = 0 if new velocity < this
+set g_vehicle_racer_bouncepain "35 2 250" // "minspeed_for_pain speedchange_to_pain_factor max_damage"
+
 set g_vehicle_racer_mass                    900
index e502c8db2ea4952d470127cf0021d3c6111d242a..2a46dd28250be16fad45df4f06cb233780357db2 100644 (file)
@@ -58,4 +58,8 @@ set g_vehicle_raptor_shield             120
 set g_vehicle_raptor_shield_regen       25
 set g_vehicle_raptor_shield_regen_pause 1.5
 
+set g_vehicle_raptor_bouncefactor 0.2
+set g_vehicle_raptor_bouncestop 0
+set g_vehicle_raptor_bouncepain "1 1.5 500"
+
 set g_vehicle_raptor_mass              2200
index 10a09454c65577f19a249219a7144bf25324ce67..bb866037adbd0d4c86b23bd660a9cf8555419aa5 100644 (file)
@@ -55,6 +55,9 @@ set g_vehicle_spiderbot_crush_force       50
 
 set g_vehicle_spiderbot_mass              5000
 
+set g_vehicle_spiderbot_bouncefactor 0   // Factor of old velocity to keep after colission
+set g_vehicle_spiderbot_bouncestop 0        // if != 0, New veloctiy after bounce = 0 if new velocity < this
+set g_vehicle_spiderbot_bouncepain "0 0 0" // "minspeed_for_pain speedchange_to_pain_factor max_damage"
 
 set cl_vehicle_spiderbot_cross_alpha 0.4
 set cl_vehicle_spiderbot_cross_size  1